Tue, Dec 3, 9:00 AM 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: embed message in pz3 to retrieve via batch render script...


dennisharoldsen ( ) posted Sun, 02 March 2008 at 6:35 PM · edited Thu, 28 November 2024 at 6:08 PM

i render my scenes differently according to their category. however, i am discovering that some scenes may need exceptions. example: i need to set the light shadow bias lower in some cases but i don't want that to be the general setting, as it increases the render time at least 10% for my type of scenes.

is there a way via poserpython to add a property i can retrieve at render time? preferably, it would be a string.
 

 


svdl ( ) posted Sun, 02 March 2008 at 6:46 PM · edited Sun, 02 March 2008 at 6:51 PM

You could try adding a comment line to the .pz3 file. Fairly easy using the standard Python file handling routines.
Before rendering, your script could read in the .pz3 file and scan for the comment markers ( // ). The name of the .pz3 file is known when you're batch rendering.

It's probably wisest not to add those comments on the first line of the .pz3 file. I'd try inserting those comments right after the version info. That way, you'll only have to read a few lines from the entire .pz3, saves a lot of memory and will speed up things. Also, the first occurence of something that is NOT a comment and NOT version info indicates that this .pz3 doesn't have markers, so you can stop scanning and close the file.

Another option would be adding an invisible prop to the scene (a box or a plane, something simple). Set its internal name to PropertyObject, and its name to a string that's useful to you. At render time you can access poser.Scene().ActorByInternalName("PropertyObject").Name(), and you'll have your property string.

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

My gallery   My freestuff


dennisharoldsen ( ) posted Sun, 02 March 2008 at 6:56 PM

svdl, thanks for your thoughts.

i would like to embed a message during the scene creation if possible. maybe there is a property that i am not using that i could use for this purpose. any ideas on that?

i have started compressing all my files so they are difficult to edit. i can put the info in the name of the file itself, but it would be more object oriented if it were a property of the scene.
 

 


svdl ( ) posted Sun, 02 March 2008 at 7:05 PM

Hmm. The only thing I can think of is the StartupScript() / SetStartupScript() combination.
Actually, putting the non-standard render settings in the Python script that's set as the startup script would do the job perfectly. No need for additional Python when you're rendering!

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

My gallery   My freestuff


ockham ( ) posted Wed, 05 March 2008 at 5:33 PM · edited Wed, 05 March 2008 at 5:35 PM

I've thought about this too, and couldn't find a self-contained solution. 
You could have a script for adding notes, which would pop up an
edit box and re-save the PZ3 with the comment added near the
start as svdl suggests.

But if you're keeping the PZ3's in compressed form, that gets tricky.

The really tricky part is the fact that Python doesn't know the name
of the currently loaded PZ3.  I guess they were thinking that you
can load and import several PZ3's at once, which makes the
title indeterminate anyway.

One thing I had thought of doing (but never got around to!)...

Use a spreadsheet-readable file as the overarching 'storyboard'. 
For instance a CVS file (comma-delimited) which you can handle neatly
in Excel.   Then you could set up the whole story in advance, with render
settings and lots of text in their proper columns, and your batch-render
script could use the CVS file as its complete guide.   The batch-render
could pop up your notes, make any needed changes in the scene,
and do the render.

My python page
My ShareCG freebies


ockham ( ) posted Wed, 05 March 2008 at 5:42 PM

OOps, CSV, not CVS.

My python page
My ShareCG freebies


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.