Mon, Jan 20, 4:29 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)

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: Voodoo matchmove into Poser


sixus1 ( ) posted Wed, 09 September 2009 at 10:25 AM · edited Wed, 24 July 2024 at 2:57 PM

Yo folks! Anyone know of any scripts out there that would convert camera data generated with the Voodoo motion tracker to a Poser camera? Right now, I have a good matchmove setup that I can get seamlessly into Maya and I"ve tried exporting the camera from that via Poser fusion, but apparently Poser Fusion will only export single frame camera poses! Surprised I hadn't ran into that before. Seems like one serious deficiency to me, but then again they don't really push the animation capabilities of Poser as much as I think they should. A quick workaround would be a combination of mell script and python script to 1. use the Poser cam export to output the camera at each frame to a directory then 2. step frame by frame through the Poser scene applying each camera pose from said directory to each frame.  Just spitballing some ideas here, but I do think that it would be damn nice to come up with a semi-reliable way to get real world camera movement into Poser. -Les


markschum ( ) posted Wed, 09 September 2009 at 4:08 PM

Do you has a sample file , or set of files  to take into poser. ? The script should not be that hard to do.


sixus1 ( ) posted Wed, 09 September 2009 at 4:24 PM · edited Wed, 09 September 2009 at 4:27 PM

Attached (hopefully) is .ma (Maya Ascii) file that you can open in a text editor to see the results of the matchmove in Voodoo. -Les

edited: Ok. Uploading didn't work. Ah, duh. So, attached is a link.

http://www.sixus1.com/bin/tes1.ma


markschum ( ) posted Wed, 09 September 2009 at 7:16 PM

file_439118.txt

OK, pitiful first attempt

the script will terminate with a message to manually set the endframe higher than the frames in the import file, dont know how to automate that.
the translate values will need to be scaled from whatever units to Poser units , thats pretty easy. 
it needs a dialog for selecting the input file - not hard but havent done it :)
uses Main Camera as the camera to animate
does not use the zoom info yet - thats also not hard to add.

Theres a lot in the file I dont understand , I have just grabbed the camera animation curve.


sixus1 ( ) posted Wed, 09 September 2009 at 9:18 PM

Yeah, a Maya file has a LOT inside it that's hard to grasp if you haven't been dealing in MEL for years. My MEL skills are still not what I'd like them to be and Python... nope. Nada. Not there at all.

The function curves are really the most important thing since I think one can manually set up the all the film back stuff inside Poser to match the footage. Can't wait to give this a shot. -Les


sixus1 ( ) posted Wed, 09 September 2009 at 9:25 PM

Hmm... I keep getting an error at line 8 saying no such file or directory, even if I alter the path in the script to point to where I know I have the .ma file. Any ideas there? -Les


markschum ( ) posted Wed, 09 September 2009 at 10:33 PM · edited Wed, 09 September 2009 at 10:45 PM

file_439127.txt

fi = file("c:/program files/python24/sixus1/test1.ma", "r")

that line ?  use either / or for seperators. and watch the quotes.  I copy paste from explorer for the path. 

Here is that script with a file selection dialog.


sixus1 ( ) posted Thu, 10 September 2009 at 12:45 AM

Just finished setting up a shot using your script. It's working pretty well. I think a few more tries will help get some little kinks worked out for usage sake.  There's a really good description of Poser vs. Maya scaling here: http://www.digitalartform.com/archives/2009/04/matching_poser.html

Don't know if you'd want to plug something into the script to adjust for the difference in scales between the two, but I did notice that the scaling seemed to be integral for really tweaking out the results. I should have a test clip comped together sometime tomorrow; when I do I'll post it. I am really excited by the possibilities of this because with the right render and material settings, and post production,  Poser is really capable of rendering some very useable footage for stuff like this. -Les


markschum ( ) posted Thu, 10 September 2009 at 10:34 AM

quote: the translate values will need to be scaled from whatever units to Poser units , thats pretty easy./endquote

the input file seems to contain the units used. - at least thats how I read it . I extract the value of the translation in the script so it just needs the conversion factor added. If you always work in the same unit that would be easier. The issue is getting an accurate conversion which might take some trial and error.


sixus1 ( ) posted Thu, 10 September 2009 at 10:56 AM

Gotcha. I'll come back here with more feedback, but at least this is a good start. -Les


markschum ( ) posted Thu, 10 September 2009 at 12:36 PM

file_439168.txt

Here is the latest version.

I added the focal length parameter. 
I added the conversion factor , taking the unit from the file
----    the only unit i test for is millimeters , which is in the file i have test.ma
----   adding other units is easy

Cleaned up the print statements.

I realized I dont actually set a keyframe , I may need to add that explicitly


sixus1 ( ) posted Thu, 10 September 2009 at 1:42 PM

Dude, I'm amazed.  This is not only some top notch work, but could be incredibly handy for all kinds of Poser-to-film based projects. I don't know if you realize it, but for some of us in the indy film community, what you're making here is something we've all wanted for YEARS on end. Seriously. Thanks. -Les


markschum ( ) posted Thu, 10 September 2009 at 2:32 PM

 :blushing:


markschum ( ) posted Mon, 14 September 2009 at 10:54 PM

file_439432.txt

Not sure what the last action with this was , sos HERE is the final version. I still need to add Ockhams routine to match the preview window size to the file size. I made a slight name change to the script.


markschum ( ) posted Tue, 15 September 2009 at 1:02 AM

file_439440.txt

I have added the routine to set number of frames , and set document size using Ockhams code, slightly modified. 

Unless theres a problem with it , thats the final version.


sixus1 ( ) posted Tue, 15 September 2009 at 1:50 AM

sweeet! Dude, you rule. :) -Les


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.