benwhe opened this issue on Apr 03, 2014 · 3 posts
benwhe posted Thu, 03 April 2014 at 10:22 AM
ockham posted Thu, 03 April 2014 at 11:00 AM
Looks like you're going off track around here:
SetColor needs to be applied to a Shader Node, not to the overall scene.
There are several tiresome steps to reach all the way down to a Shader Node. I'm pretty sure you'll run through those steps if you keep pushing through the tutorial stuff, but you're not quite at that point yet!
Here's one way to reach the simplest ShaderNode.
import poser
scene=poser.Scene()
mat=scene.CurrentMaterial()
r=100
g=200
b=150
mat.SetDiffuseColor(r,g,b)
diffuseColNode = mat.ShaderTree().Node(0).Input(0)
diffuseColNode.SetColor(r,g,b)
Note that the material itself needs to have its Diffuse Color set, and then the Diffuse Color node needs to have its Color set. Both are needed for some reason. (See why I used the word Tiresome?)
PhilC posted Fri, 04 April 2014 at 2:08 AM
Would you like me to copy/paste everything from here? RDNA thread where you ask the same question?
I feel that you are being tripped up by the use of the prop that you are using to test your scripts out on. You need to use one that already has materials assigned to it, the one you are currently using does not. You have then tried to add materials by applying a material collection but because you are just picking a file at random you are getting errors.
I'm happy to help but if you want me now to monitor and answer in both threads it may become confusing.