3dcheapskate
Busy Bee
I write a PoserPython script that starts like this:
mats = poser.Scene().WacroMaterials()
if mats:
The script is on my desktop.
I assign my script to one of the ten wacro buttons(alt-click a wacro button to remove the existing assigned wacro, then click the button (now labelled '...') to select and assign my script)
If I now run my script by clicking the wacro button it runs for the current material only, as expected.
If I run my script by shift-clicking the wacro button it runs for the all materials of the current object, as expected.
If I run my script via File > Run Python Script it sometimes runs for just the current material, but sometimes for all materials of the current object. It seems to depend on how I last ran a wacro from one of the ten buttons.
It appears as if running a wacro from one of the ten buttons sets/clears a global flag that indicates current/all materials, and it seems that WacroMaterials() builds a list of mats for the current object based on the current setting of this flag.
Does anybody have any insight into this ?
mats = poser.Scene().WacroMaterials()
if mats:
for mat in mats:
doStuff(mat)
The script is on my desktop.
I assign my script to one of the ten wacro buttons(alt-click a wacro button to remove the existing assigned wacro, then click the button (now labelled '...') to select and assign my script)
If I now run my script by clicking the wacro button it runs for the current material only, as expected.
If I run my script by shift-clicking the wacro button it runs for the all materials of the current object, as expected.
If I run my script via File > Run Python Script it sometimes runs for just the current material, but sometimes for all materials of the current object. It seems to depend on how I last ran a wacro from one of the ten buttons.
It appears as if running a wacro from one of the ten buttons sets/clears a global flag that indicates current/all materials, and it seems that WacroMaterials() builds a list of mats for the current object based on the current setting of this flag.
Does anybody have any insight into this ?