Mon, Nov 25, 10:44 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 25 12:38 pm)



Subject: Try my new app/script


scourge ( ) posted Fri, 25 November 2005 at 1:40 PM · edited Mon, 25 November 2024 at 10:40 PM

Attached Link: http://www.lut.fi/~pihlajis/pyMPE.tar.gz

file_307601.jpg

Hi there. Here's an early development version of my new proggie. As I mentioned in some other thread, the Visual Basic version of MAT Pose Edit is now a dead project, and I decided to write a new different one with Python. I call it pyMPE (Python MPE) but the name may change as the program changes.

Requirements for running this application:

  • Runs on almost any Windows, Linux, Unix or OS X operating system
  • Python 2.3 or newer (http://www.python.org/)
  • wxPython 2.6 or newer (http://www.wxpython.org/)

To run the application:

  1. Open a terminal
  2. Navigate to the directory where you copied this app
  3. enter the command 'python pyMPE.py'

OR simply clicking/double-clicking on the pyMPE.py file in a file manager might also do the trick.

As you can see from the screenshot (taken in Ubuntu Linux) the GUI is very simple. Using the proggie is simple as well:

  1. Use the File->Open menu option to open a Poser file.
  2. If you want to make a MAT file, press the "Create MAT" button. And if you want to convert all the materials in the file from Poser 3/4 to Poser 5/6 or vice versa, press the respective button.
  3. Use File->Save As to save your work into a new Poser file. If the extension ends with a "z" (i.e. mike.crz) the file will be compressed.

So this tool isn't just a MAT maker, it can also be used for converting the materials (and the version number) in a file. As always I don't recommend anyone to blindly trust this program so don't overwrite your original files before testing that everything works. I didn't add a Save menu option for just this reason.

Unfortunately you can't run this app inside Poser. That's because Poser uses Python 2.2, and wxPython, which is used for the GUI, requires Python 2.3 or better. But the good news is that I GPL'd pyMPE so if someone wants to turn it into a Poser script, be my guest. I'm even willing to offer my help to such a person.

Got questions? Ask here, and I'll give my best answer. I'd especially like to hear from OS X users because I haven't had the opportunity to test the tool on that particular OS.

Regards,
Ilari Pihlajisto


manoloz ( ) posted Fri, 25 November 2005 at 2:23 PM

Cool! downloading it right now!

still hooked to real life and enjoying the siesta!
Visit my blog! :D
Visit my portfolio! :D


TrekkieGrrrl ( ) posted Fri, 25 November 2005 at 4:45 PM

Thanks! Can you actually run Poser under Linux? How? Hubby is trying hard to convince me to switch to the Penguin side of life.. but so far I've herded him off by saying that Poser won't run under Linux...

FREEBIES! | My Gallery | My Store | My FB | Tumblr |
You just can't put the words "Poserites" and "happy" in the same sentence - didn't you know that? LaurieA
  Using Poser since 2002. Currently at Version 11.1 - Win 10.



manoloz ( ) posted Fri, 25 November 2005 at 4:51 PM

Maybe you could run Poser under WINE, but I doubt it would be fast. I think he is just running the script under linux, but Poser under Windows/Mac. But I could be wrong...

still hooked to real life and enjoying the siesta!
Visit my blog! :D
Visit my portfolio! :D


Faery_Light ( ) posted Fri, 25 November 2005 at 4:53 PM

Thanks. I've downloaded and will give it a try later.


Let me introduce you to my multiple personalities. :)
     BluEcho...Faery_Light...Faery_Souls.


Little_Dragon ( ) posted Fri, 25 November 2005 at 9:01 PM

Can it convert P6 material collections (MC6) to MAT poses? You only need to change one line (two lines, if you count the version number).



Francemi ( ) posted Sat, 26 November 2005 at 12:05 AM

Thank you. I'll try it. I use MPE all the time because it's the app I prefer for creating matposes.

France, Proud Owner of

KCTC Freebies  


scourge ( ) posted Sat, 26 November 2005 at 3:18 AM

Ernyoka1, No, Poser doesn't run in Linux. But my script does. It's easier to make sure that it works in OSX if I also test it in Linux. Little Dragon, No, it doesn't convert mc6 files yet... but it's pretty easy to write a script for that. Just paste this line in a new *.py file (i.e. 'convert_mc6.py'): self.node.get_child('mtlCollection').rename('figure') Then open a mc6 file in pyMPE and use File->Run Script to run your new script. Then press the "Convert to P4" button if you want a P4 MAT file, and finally save the file. I tried to make extending the featureset of pyMPE as easy as possible. You can do a lot with just a few lines of code.


MarianneR ( ) posted Sat, 26 November 2005 at 7:44 AM

I downloaded and installed wxPython2.6-osx-ansi-2.6.1.0-macosx10.3-py2.3.dmg on my Mac running OSX 10.3.9. MacPython is already installed. When I tried running the program with python pyMPW.py the text "This program needs access to the screen. Please run with 'pythonw', not 'python', and only when you are logged in on the main display of your Mac." was displayed, so I did that. I let the program open a simple cr2-file with materials in Poser 4-style. When I clicked the "Create MAT" button the terminal displayed the following: Traceback (most recent call last): File "pyMPE.py", line 243, in OnButton make_mat(self.node) File "pyMPE.py", line 922, in make_mat figure.remove_children([['material', 0]], inverse=True) File "pyMPE.py", line 321, in remove_children for child in reversed(self.children): NameError: global name 'reversed' is not defined Then I restarted the program and tried the button "Convert to P5". This time I didn't get any error messages but the menu "Save as " was greyed out. python -v reports (among many other things) Python 2.3 (#1, Sep 13 2003, 00:49:11)


scourge ( ) posted Sat, 26 November 2005 at 5:37 PM

Thanks for your report Marianne. It seems that the reversed() function is only in Python 2.4 and the latest version of MacPython is 2.3. But I think I got this problem fixed by writing a new reversed() function. I have now updated the package so please try downloading it again. I also fixed a couple of other issues I found: - when converting materials into P4 format the bump strength could sometimes go over the maximum value - converting a highlight size value of 0 would result in a "divided by zero" error


MarianneR ( ) posted Sun, 27 November 2005 at 3:00 AM

I tried the new version and now it doesn't give any error messages, but "Save as" is still greyed out in the menu.


scourge ( ) posted Sun, 27 November 2005 at 5:24 AM

Ok, I'll try to find out what's wrong. In the mean time you can enable the Save As menu by commenting out this line (line 97) in the pyMPE.py file: filemenu.Enable(ID_SAVE, False) It should do the trick, but it lets you use the Save As menu even when there's nothing to save so this is only a temporary solution.


PabloS ( ) posted Sun, 27 November 2005 at 5:37 AM

~bookmark~


scourge ( ) posted Sun, 27 November 2005 at 8:50 AM

I updated the package again, so you can forget about editing the script Marianne. I found out that my use of absolute panel item positioning is bad and results in unportable code. But that should be fixed now. Hey, it's called "development version" for a reason. ;-)


MarianneR ( ) posted Sun, 27 November 2005 at 9:12 AM

In the latest version "Save as" is still greyed out. I edited the version before that, and then saving worked and the pz2-files looked OK.


scourge ( ) posted Sun, 27 November 2005 at 9:40 AM

This is totally bumming me out. This may sound desperate but could it be that your browser didn't really download the latest version and simply retrieved the previous version from cache? The latest version disables the Save As menu at line 97: "self.file_menu.Enable(ID_SAVE, False)" Then it enables it in the OnOpen function at line 169: "self.file_menu.Enable(ID_SAVE, True)" If the first line works the second one should work as well. But then again, nothing that should work ever does.


MarianneR ( ) posted Sun, 27 November 2005 at 11:42 AM

Yes, my first thought was also that I got an old version, but it doesn't seem so. The time stamp on pyMPE.py is today at 15.23. This is line 98 (my texteditor seems to count differently): self.file_menu.Enable(ID_SAVE, False) and this is line 170: self.file_menu.Enable(ID_SAVE, True)


scourge ( ) posted Sun, 27 November 2005 at 12:51 PM

Yeah, you do have the latest version. I'll do my best to find out what's wrong. Damn, I need a Mac.


scourge ( ) posted Sun, 27 November 2005 at 2:21 PM

Here's another thing you could try. Replace line 170 (according to your text editor) with: self.file_menu.FindItemById(ID_SAVE).Enable(True) If that doesn't work you can try this line instead: self.GetMenuBar().FindItemById(ID_SAVE).Enable(True) They both work on my system.


MarianneR ( ) posted Sun, 27 November 2005 at 4:25 PM

No, none of the changes worked for me. I was wondering if I'm doing something wrong so I installed the program and python on the pc that I also have, and there it works. But that is python 2.4.2. I didn't try the modifications there.


scourge ( ) posted Mon, 28 November 2005 at 2:14 AM

It's probably not your fault. But seems that it's not my fault either. I did some research and found this page: http://tinyurl.com/7s33s Apparently I can't trust these ID numbers that I'm supposed to trust. I just updated the package again. This time the script tries to find the Save As menu by the name string. It's a dirty fix but it should work. The script now also tells you the Save As ID number when you open a file. Could you tell me what it outputs on your Mac?


MarianneR ( ) posted Mon, 28 November 2005 at 9:33 AM · edited Mon, 28 November 2005 at 9:39 AM

I have to admit that I don't understand what is says on the page that you linked to. My programming skills are still at the "Hello World" level.

However I tried the program, time stamp 09.00 today, and it says "Save As ID: 103". My pc says the same. Edited to add that "Save as" is still greyed out on the mac.

Message edited on: 11/28/2005 09:39


scourge ( ) posted Mon, 28 November 2005 at 2:21 PM

Oh, the site just describes some portability problems. WxPython is still under development and the Mac version is a little behind the Windows and Linux versions so some things just don't work in all OSes as expected. I just learned that Mac OSes have very strict rules concerning the menus: every app has to have a Help menu, only one frame can have a menubar, etc. It was also recommended to use the "official" id tags for menu items like "Open", "Save" and "About". So I just did that and uploaded a yet another new version. Dunno if it helps though...


MarianneR ( ) posted Mon, 28 November 2005 at 2:33 PM

The menus look different, but alas! the "Save as" stubbornly insists on being disabled.


scourge ( ) posted Mon, 28 November 2005 at 3:41 PM

Hmm. I'll have to bug my Steve Jobs-worshipping, Mac-using uber-nerd friend about this. While waiting for that fix you can use the latest version which I just uploaded. It has the Save As menu enabled all the time.


MarianneR ( ) posted Mon, 28 November 2005 at 3:51 PM

"Hmm. I'll have to bug my Steve Jobs-worshipping, Mac-using uber-nerd friend about this." LOL "While waiting for that fix you can use the latest version which I just uploaded. It has the Save As menu enabled all the time." Thanks :)


Francemi ( ) posted Thu, 08 December 2005 at 7:01 PM

Ok I finally was able to use this (after Marianne helping me a lot) ;o) But from what I can see, we now have to save a model with our textures applied to it as a cr2 (or crz) before creating the matpose for it... Is that right?

France, Proud Owner of

KCTC Freebies  


scourge ( ) posted Thu, 08 December 2005 at 9:59 PM

Yeah, that's right. But as you can see this is version 0.0.1, right now it's just a base for an application. I'll be adding new features to it later and it will have a real user-interface.


Francemi ( ) posted Thu, 08 December 2005 at 10:13 PM

Ok. Well at least I now know I'm doing it right. It's a start! loll Keep us posted! Thank you for making nice programs like that which makes our life easier. ;o)

France, Proud Owner of

KCTC Freebies  


kamilche ( ) posted Sat, 21 January 2006 at 3:59 AM

I've made a modification to your code, so it no longer requires wxPython. Under the GNU license, I'm making it available for free! http://www.kamilche.com/files/pyMPE.zip In addition, I made it compatible with versions Pro Pack, 5, and 6 of Poser. Hope you guys find this enhancement useful!


MarianneR ( ) posted Sat, 21 January 2006 at 5:34 AM

Thanks Kamilche! I downloaded and tried it out with a single figure loaded in Poser. Your version saved the whole cr2 for me, not just the material part. Running MacOSX 10.3.9 and Poser 6. Also tried P6 Windows with the same result.


mada ( ) posted Sat, 21 January 2006 at 5:27 PM

.

...faith, trust and pixiedust


scourge ( ) posted Sun, 22 January 2006 at 1:58 AM

This is great! Good to see that someone could read my code. I'm going to try Kamilche's version as soon as I get home.


scourge ( ) posted Mon, 23 January 2006 at 7:50 AM

Kamilche, Okay, haven't been able to test your modification in Poser yet, but here are a couple of things I noticed by reading the code: - Line #467: convert_obj(node, 5) I don't think you need this line at all, pyMPE should be able to convert directly into P4 format without converting into P5 first. Actually the conversion into P5 format will probably do nothing at all because currently pyMPE thinks P5 and P6 have the same file format. But I may be wrong, let me do some tests to be sure. - You should add the line "make_mat(node)" somewhere in the MakeMat function, perhaps right after line #465: node = read_file(tempfile). That will make sure that only the material part is saved (as MarianneR noticed, the script currently saves the whole figure). Of course a script for converting complete cr2 files would be useful too so it may be best to have that option in the pyMPE menu as well. - The script apparently cannot save in compressed gzip format. This is pretty easy to do in a quick & dirty way: if the last (3rd) character of the filename extenstion is "z" the file should be compressed (f = gzip.open(self.full_path, 'wb'). That's at least how I did it (line #195).


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.