Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
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.")
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."
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
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."