LaidlawFX Posted November 9, 2017 Share Posted November 9, 2017 Hello, I feel like I should know this but Houdini keeps erroring on me so I am doing something wrong. I want to read the primitive attribute Cd, multiple the values by say 6, and then add it to a new attribute called color. For the example scene, drop a box, a color sop and set it to primitive and bounding color, followed with a python sop. I am not looking for this in VEX, via nodes, or any other language. It has to be in python for this case. Thanks for the help, -Ben Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted November 9, 2017 Share Posted November 9, 2017 color = geo.addAttrib(hou.attribType.Prim, 'Color', hou.Vector3(0,0,0)) for prim in geo.prims() : v = hou.Vector3(prim.attribValue('Cd')) v *= 6 prim.setAttribValue('Color', v) This worked for me. Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted November 9, 2017 Author Share Posted November 9, 2017 Thank you, Tom. I blanked out on the for prim in geo.prims() : Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.