Wed, Sep 4, 12:08 AM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 03 11:27 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Need a pyhton script


EL-Aiko ( ) posted Thu, 06 December 2007 at 6:36 AM · edited Mon, 02 September 2024 at 10:23 AM

Hi all

i want to exported the actors from a figure as obj as morphtarget.
But not the complet figure in one obj .. for every actor a obj.
Example:
hip.obj, chest.obj.....

How can help me??
Many thanks
elena


EnglishBob ( ) posted Thu, 06 December 2007 at 11:24 AM

Attached Link: http://www.philc.net/PTB_page3.htm#morphTools

PhilC's Poser Toolbox has that capability.


EL-Aiko ( ) posted Thu, 06 December 2007 at 11:48 AM

Thats a cool Tool but i need a script for free.
Thats to expensive for me ;-(

Thanks.
elena


Miss Nancy ( ) posted Thu, 06 December 2007 at 2:18 PM

if they did that for free, it would infringe on phil's rights IMVHO. it could be called a derivative product. I ain't a lawyer.



PhilC ( ) posted Thu, 06 December 2007 at 2:41 PM

You just need to iterate through the figure's body parts exporting as you go. See the example scripts that come with Poser.

For how many figures do you need to do this?


EL-Aiko ( ) posted Thu, 06 December 2007 at 2:46 PM

Quote - You just need to iterate through the figure's body parts exporting as you go. See the example scripts that come with Poser.

For how many figures do you need to do this?

Hi

i have seen the scrips, (Export.DXF etc.) but i cant programming in Python.
I have try but allways errors. ;-(

I need it only for my morph and learning.

Thanks for your answer
elena


PhilC ( ) posted Thu, 06 December 2007 at 3:00 PM

I couldn't either when I started. My background was plumbing. I just worked through those example scripts and read the basic documentation at www.python.org . After much trial and tribulation and dare I say hard work I became familiar with it. If you wish to learn Python for Poser you may be interested in my Poser for Python Manual. I've basically re-written the Poser Python manual to produce the document that I would have killed for when I was getting started. It includes many example scripts.

Not withstanding the above we can run through it together if you like. As a first step try writing a script that iterates through the current figure and prints out both the internal and external name for all the body parts. We can then develop that further to export out the geometry.


EL-Aiko ( ) posted Thu, 06 December 2007 at 3:16 PM

I would like to learn it with pleasure .
And are with the Scripts in the Poser5, is one script which  "actorNamen" is economical.
With it I have tried to continue however without occur.


PhilC ( ) posted Thu, 06 December 2007 at 4:18 PM · edited Thu, 06 December 2007 at 4:19 PM

If by "actorNamen" you mean actor.Name() then yes that phrase does occur in several of the example scripts. If you are typing actorNamen then yes you will get errors. The manual was written for Poser 7 but much will apply to Poser 5 also.

The gist of my offer was that you make your best attempt at writing the script, then let me see it so that I can guide you as you learn. My time like so many others is limited but I'll certainly be happy to set you on the right initial path.


Angelouscuitry ( ) posted Thu, 06 December 2007 at 6:41 PM

I've requested this script, here, in the past; and would also love to see a free version

Hi PhilC!

:thumbupboth:


PhilC ( ) posted Thu, 06 December 2007 at 6:51 PM

Yes, free always holds a certain appeal.


Miss Nancy ( ) posted Thu, 06 December 2007 at 6:59 PM · edited Thu, 06 December 2007 at 6:59 PM

just as an aside, when one imports a poser obj geom into some modellers, said obj can then be split up by group, either on import or after import. in case anybody asks.



markschum ( ) posted Sat, 08 December 2007 at 12:59 PM

a script to export each badypart as a seperate obj file ? 

hmmmm


markschum ( ) posted Sat, 08 December 2007 at 4:05 PM

OK, I have a script done that does what you want, at least I think it does.

Every body part is exported as an obj file , to c:temp as File_bodypart.obj and using
export options as export a morph .

If you drop me a message of where to send it to you , you can give it a try.


Angelouscuitry ( ) posted Sat, 08 December 2007 at 10:25 PM

:tt1: markschum rules!  I've waited...a year(...maybe more) for script to attempt this!

🆒 Any ideas on, subsequent Importation of, all of the new Actor Geometries?

:closedeyes: I've also more regard for PhilC's attendance in this thread; as I am aware his solution involves Importation.

😄


markschum ( ) posted Sat, 08 December 2007 at 10:40 PM · edited Sat, 08 December 2007 at 10:49 PM

k, the script requested was only export , so thats what I did . I get 140+ files written since every body part is written . This really asks for a nice interface where you can select out only the parts you want, but thats tkinter and I hate that a lot .

There are at least two scripts being written , or now available , to import and create a full body morph . 

I really suggest people consider Philc toolkit if they have much of a need for this .  There may be others as well but Phil has been around for a while :-)

If anyone wants this simple script either pm me or add your name here  and I will look at making it available once I have had a reply from the original requester.


Angelouscuitry ( ) posted Mon, 10 December 2007 at 3:31 AM

I just tested the script, with P6, from my latest V3 scene(3Figures.)  The script ran.  The text window listed through all of V3's(the currently selected figure) parts, and then said "Done"; but I could'nt find c:temp, and what looked like a GUI had kept flashing off the screen?


MatrixWorkz ( ) posted Mon, 10 December 2007 at 4:28 AM

I'm definately interested in such a script. It would speed up creating FBM's now that I know how to do it. I'd also like to know if it could be reversed so that the same exported OBJ's could then be loaded to a new figure as Morphs. Now that would be whiz bang!

My Freebies


Indoda ( ) posted Mon, 10 December 2007 at 9:40 AM

I would be interested in having a copy of the scripts, please

The important thing is not to stop questioning.
- Albert Einstein

Indoda


Angelouscuitry ( ) posted Mon, 10 December 2007 at 10:29 AM

*" There are at least two scripts being written , or now available , to import and create a full body morph"

Hi again markschum, would you elaborate on this?

I just tested myexport.py a couple more times; first with only one figure, and then again after having changed the export directory, but encountered the same experience as before.

What version of Poser was this written with?


markschum ( ) posted Mon, 10 December 2007 at 10:56 AM · edited Mon, 10 December 2007 at 11:07 AM

The script was written for Poser 7 and tested in Poser 5 as well.    The script attempts to write the files on drive C:   in the folder Temp .   This is in the readme file included in the zip.  I thought that was a standard windows folder for temporary files , but it might just be my system .   The output window does tend to flash a bit while the script runs .

You can either create the folder  c:Temp  or change the script to use another folder .  Just change the folder and drive inside the quotes on this line :

            myfile = r"C:tempFile-" + actor.Name() + r".obj"  

** there should be some slashes in the line above too  - after c: and before File ***

dont change anything else except the c:temp part  

I saw something about full body morphs within the last couple of weeks in this forum .  

The script for exporting parts is now up on sharecg 

http://www.sharecg.com/v/20288/script/Poser-python-script---export-parts

The export turned out to be easier than I thought , but gee, Poser does some odd things ! , but the import as morphs isnt as simple. If I manage to get someth8ing working It would need to be a commercial product because of the time involved . I suggest having a look at Philc toolbox and see if that does everything you need . 


svdl ( ) posted Fri, 14 December 2007 at 12:40 PM

Hmm. Need to search through my script library - I remember making a script like that.

Actually, it was even more intelligent. Morphs tend to spread over several body parts (buff up a chest and you'll have to do some work on the abdomen, collars and neck as well), so I made a script that imports the whole figure .OBJ, splits it into the applicable body parts, and applies those props as morph targets to all body parts. It even created an associated full body morph.

I hope I can find the script again - made it a couple of years ago, and I no longer  have the computer I made it on...

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


Angelouscuitry ( ) posted Sat, 15 December 2007 at 1:12 PM · edited Sat, 15 December 2007 at 1:14 PM

*" You can either create the folder..."

*Oh the folder needs to exist before the script is run!  I just expected the script to create the folder? 

The scripts sheck out O.K. with:

XP
P6
V3 and two other figures in the scene(Hair and Skydome.)
700Mhz Duron
756MBs RAM
4GBs Virtual

Yes, I believe a GUI to check/uncheck parts; like fingers, toes, hands, and feet, would be super!

Congradulations markschum!

Thank you ver much!

SVDL - If you would haev another look for that script, I would appreciate it very much?


markschum ( ) posted Sat, 15 December 2007 at 7:05 PM

Hello again ,

THIS IS IMPORTANT ***  

I have posted a revised script here

www.sharecg.com/v/20288/script/Poser-python-script---export-parts

This version checks that the part exported is actually part of the selected figure , so it will work correctly with more than one figure in the scene .


Angelouscuitry ( ) posted Sat, 15 December 2007 at 7:58 PM

😄 Thanks!


Angelouscuitry ( ) posted Fri, 29 February 2008 at 4:41 PM

Hi, again, markschum!

was the script at:

www.sharecg.com/v/20288/script/Poser-python-script---export-parts

myexport.py?  

I just tried this link, but it did'nt work; has the script found another home?


markschum ( ) posted Fri, 29 February 2008 at 6:06 PM

k, script renamed and reloaded to sharecg .

http://www.sharecg.com/v/23775/script/Poser-gemoetry-exporter-and-morph-loader

I have included the loader script in the zip  and a brief readme file .

The loader script takes the geom files exported by the export script , and loads them as a morph, sets the morph value to 1 and ends . You can delete any geom files from the export that arent wanted , whatever is in the folder will be loaded as morphs . The filename is critical to the operation of the script.


svdl ( ) posted Sat, 01 March 2008 at 10:10 PM

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


Angelouscuitry ( ) posted Sat, 01 March 2008 at 10:55 PM

SVDL - The link is down.  What is it this script will do?


svdl ( ) posted Sat, 01 March 2008 at 10:58 PM

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


svdl ( ) posted Sat, 01 March 2008 at 11:02 PM

What does the script do:

  • in case of a figure with PBMCC channels (Millenium 3, V4/A4), it'll allow you to select a channel for the new morph, otherwise it'll create one.
  • it reads in an entire OBJ mesh, splits it into the body parts, and uses those props to generate morph targets;
  • it creates a full body morph fro those morph targets;
  • it generates INJ/REM poses for the morph targets
  • in case of a non-PBMCC enabled figure, it also creates a Python script that will prepare the figure for morph injection
  • optionally, it renders thumbnails for the INJ/REM poses

Needs Poser 6 or higher.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


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.