Forum: Poser Python Scripting


Subject: Need help with simple material script

232bird opened this issue on Sep 27, 2011 · 19 posts


232bird posted Tue, 27 September 2011 at 11:16 PM

I am trying to write a script to change the diffuse color of all materials for a selected figure.  I was able to get the script to run without errors, but it didn't actually do anything, so I thought I should ask for help.  I have been through all Poser-related Python reference materials, so I think this is more an inability on my part to put together a functioning workflow in a script (yet).  Could someone point out what I am doing wrong?  Here is the script, and I also attached the .py file in .txt format.

 import poser
scene = poser.Scene()
materials = poser.Scene().CurrentFigure().Materials()[0]
diffcol = materials
print diffcol
materials.SetDiffuseColor(1.0, 0.1, 0.1)
diffcol2 = materials
print diffcol2
scene.DrawAll()
print "Done"