Wed, Dec 4, 8:59 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: - Poser/Python Export Method Problem !


gbdevo ( ) posted Tue, 25 February 2003 at 11:24 AM · edited Wed, 04 December 2024 at 2:25 PM

Hi ,
I am using the Export/import Poser/PythonModule , and particularly the Exprot Method :
Imex.Export ( suffixfile, pluginname, filepath [ , options, sceneselectioncallback ] )
What's the semantic and syntex for the 5th parameter sceneselectioncallback ? I tried a trivial call back func, with a body part selesction in it , but it doesnt work , the objective is to export just a body part of my figure .
THANKS MUCH for some ideas or informations about this case .
Gerald B.


ockham ( ) posted Tue, 25 February 2003 at 12:35 PM

The CL sample scripts include a pretty good example. Here's a minimum script, written with help from the sample, that works. (I tested it.) # ------------------------------# import poser scene = poser.Scene() imex = scene.ImExporter() # ------------------------------# def SSCall(actor): # The callback routine ~if actor.Name() == "ball_1": ~~return 1 ~else: ~~return 0 # ------------------------------# # You have to fill in the Options argument # even if you're only using the defaults. Options = imex.ExportOptions("obj", None) # Finally the actual Export call: imex.Export("OBJ","File Format OBJ", "POOO.OBJ", Options, SSCall) # ------------------------------# The callback just returns 1 for each Actor that belongs to your selection, or 0 for each Actor you don't want. Here I have supplied a certain name, but you could do a list check instead: if actor in MySels: ~return 1 else: ~return 0 Hint: If you are using a body part, you may need to run the selection on the basis of figure.Actor() instead of scene.Actor().

My python page
My ShareCG freebies


gbdevo ( ) posted Tue, 25 February 2003 at 12:50 PM

Thanks very much ocham, i paste your reply , have not seen this sample in my python scripts . I'll go to test that . It seems logic ( parameter actor in the callback and the return value 1 or 0 on the Name of the actor )and simple , that 's very well. Gerald B.


gbdevo ( ) posted Tue, 25 February 2003 at 12:53 PM

Sorry ockham, replace ocham by ockham in the previous post ;o)). Gerald B.


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.