VedaDalsette opened this issue on Jan 11, 2023 ยท 4 posts
VedaDalsette posted Wed, 11 January 2023 at 11:27 AM
I don't know how much to impose on folks here, but I'll give it a try. I'm using Poser 12.
I have a bunch of props/actors whose names begin with Building (ex: Building12_2)
Some of these actors have material names that begin with Concrete (either Concrete1, Concrete2, or Concrete3).
Some of these materials contain a Clouds node.
I want to change the Gain on these nodes from 1.0 to .75
I know this is simple for Python coders, but I ain't one of them. I got as far as this:
# initial references
scene = poser.Scene()
actor = scene.Actor('ActorName')
# loop actors in scene, with specific names...
for actor in scene.Actors():
if actor.Name().startswith('Building'):
# ...do something
And I found this off the pydoc.browse (1521) python shell.
kNodeTypeCodeCLOUDS = 'clouds'
Can I get an Amen? I mean Script. Thanks.
W11,Intel i9-14900KF @ 3.20GHz, 64.0 GB RAM, 64-bit, GeForce GTX 4070 Ti SUPER, 16GB.
Old lady hobbyist.
All visual art or fiction is "playing with dolls."
adp001 posted Wed, 11 January 2023 at 1:34 PM
scene = poser.Scene()
for actor in [a for a in scene.Actors() if a.Name().startswith("Building")]: # type: poser.ActorType
for tree in [m.ShaderTree() for m in actor.Materials() if m.Name().startswith("Concret")]: # type: poser.ShaderTreeType
for node in [n for n in tree.Nodes() if n.Type() == poser.kNodeTypeCodeCLOUDS]: # type: poser.ShaderNodeType
node.InputByInternalName("Gain").SetFloat(0.75)
print("Done.")
VedaDalsette posted Wed, 11 January 2023 at 2:37 PM
adp001 posted at 1:34 PM Wed, 11 January 2023 - #4453662
adp001, thanks so much! I NEVER would have gotten this. Much appreciated. I'm so excited. Now, I can other values in this scene!scene = poser.Scene()
for actor in [a for a in scene.Actors() if a.Name().startswith("Building")]: # type: poser.ActorType
for tree in [m.ShaderTree() for m in actor.Materials() if m.Name().startswith("Concret")]: # type: poser.ShaderTreeType
for node in [n for n in tree.Nodes() if n.Type() == poser.kNodeTypeCodeCLOUDS]: # type: poser.ShaderNodeType
node.InputByInternalName("Gain").SetFloat(0.75)
print("Done.")
on Edit: BTW, it worked like a charm and in the blink of an eye!
W11,Intel i9-14900KF @ 3.20GHz, 64.0 GB RAM, 64-bit, GeForce GTX 4070 Ti SUPER, 16GB.
Old lady hobbyist.
All visual art or fiction is "playing with dolls."
adp001 posted Wed, 11 January 2023 at 3:09 PM
Glad that it helped.