Forum: Poser Python Scripting


Subject: - Poser/Python Export Method Problem !

gbdevo opened this issue on Feb 25, 2003 ยท 4 posts


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