Hey Everybody,
Is anybody capable of creating a node which sets the Cd attribute based on its own “node color”?
I think this would be very useful to organize streams of geometry in a network.
so you can see more easily which geometry you see in the viewport corresponds with what part of the network tree.
Cheers
Philipp
Set Color(Cd) from Node Color
2989 4 0- CYTE
- Member
- 664 posts
- Joined: Feb. 2017
- Online
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
- CYTE
- Member
- 664 posts
- Joined: Feb. 2017
- Online
Hey bonsak,
thank you very much for your help! Could you please help me a little bit more
I guess your code is for a python node? as I have no python knowledge could you be so kind and give me the full code that would store the python cd into the Houdini Cd(point) attribute?
Thanks in advantage
Philipp
how do I correctly insert mycolor into the attr…..?
thank you very much for your help! Could you please help me a little bit more
I guess your code is for a python node? as I have no python knowledge could you be so kind and give me the full code that would store the python cd into the Houdini Cd(point) attribute?
Thanks in advantage
Philipp
node = hou.pwd()
geo = node.geometry()
mycolor = node.color()
attr = geo.addAttrib(hou.attribType.Point, "Cd", mycolor)
how do I correctly insert mycolor into the attr…..?
Edited by CYTE - May 7, 2018 14:49:37
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
node = hou.pwd() geo = node.geometry() mycolor = node.color() attr = geo.addAttrib(hou.attribType.Point, "Cd", (1.0, 1.0, 1.0)) for point in geo.points(): point.setAttribValue(attr, mycolor.rgb())
Close You have to loop over all the points in the geo to set the attribute.
The color doesnt change when you change it in the network viewer. It changes when the networks cooks again. So the workflow is a little rough
-b
Edited by bonsak - May 8, 2018 04:53:19
- CYTE
- Member
- 664 posts
- Joined: Feb. 2017
- Online
-
- Quick Links