Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 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
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.
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.