Forum: Poser Python Scripting


Subject: Renaming materials in Poser

flyerx opened this issue on Jan 25, 2003 ยท 5 posts


flyerx posted Sat, 25 January 2003 at 6:16 PM

Hello, Because of Poser's broken OBJ export functionality. I have been trying to make a script to rename the material names in a scene. As a trial I tried to first list all the material names in the scene but it keeps giving me syntax error. Here is the text of the scritp: import poser scene = poser.Scene() for actor in scene.Actors(): materials = actor.Materials() for material in materials: print material.Name() Here is the error: File "", line 6 print material.Name() ^ SyntaxError: invalid syntax I tried to store the material.Name() value into a string variable and print it but it showed the same error. Oddly if I add a carriage return at the end of the file a different error shows: Preview Traceback (innermost last): File "", line 5, in ? TypeError: loop over non-sequence This is not really encouraging. So much for easy to use phyton. If anynone knows what the source of the error is I would appreciate any hints. I am using Poser Pro Pack with SR3 FlyerX