Is there any way to control a curves color using node editor ?
I know we can change the color using drawing overrides. But how to contol it ?
My need is I want to make my controller change its color if its value is greater than zero. So it makes a visual representation of the values I tweaked ( facial UI controls )
Solved! Go to Solution.
Solved by gautham.chandran47. Go to Solution.
Yes, it is possible to connect to attributes like the override color even though they are not visible by default.
The easiest way is to use MEL:
setAttr "myNURBSCurve.overrideEnabled" 1;
connectAttr myControlNode.outColor myNURBSCurve.overrideColorRGB
Then you get this:
You can also RMB on the node with the hidden attributes and "Show all Attributes":
... and then locate the attribute and connect:
Thanks for the quick replay,
It worked as you said, but unfortunately I couldn't change the color
The "myControlNode" you mentioned is a layered texture ? Thats how I connected it.
If else would you please tell me which node is the "myControlNode" ?
I wouldn't take a texture node because how do you then control the color change?
For a rig with a certain condition to change the color an expression might be the right way.
This example would change the color of the nurbsCircle1 at frame 26:
if (frame>25) {
nurbsCircle1.overrideColorR = 1;
nurbsCircle1.overrideColorG = 0;
nurbsCircle1.overrideColorB = 0;
} else {
nurbsCircle1.overrideColorR = 0;
nurbsCircle1.overrideColorG = 0;
nurbsCircle1.overrideColorB = 1;
}
You can't enter the expression editor from the Attribute Editor (like with most other attributes), you have to open it and create the expression from scratch.
Yes, it won't work in the Script Editor.
This example works only in the Expression Editor:
Create a NURBS circle.
Set "Enable Overrides" ON and "Color" to "RGB"
and then in the Expression Editor:
I did everything as you mentioned and the expressions didn't give any errors but I cant find the out put. The color is not changing..
Any idea why ?
Could you please post the work file for a reference maybe ?
I dont know what I'm doing wrong.
Thanks a lot . as you mentioned I created a "layerd textured node" and curve and renamed it accordingly;
setAttr "myNURBSCurve.overrideEnabled" 1;
connectAttr myControlNode.outColor myNURBSCurve.overrideColorRGB
You were right about using a texture node to control curve color,
so I changed the "color" mode from "index" to "RGB" in the drawing overrides on attribute editor.
And after that I could easily change the color of the curve through the layered texture's properties.
I can even animate it.
Can't find what you're looking for? Ask the community or share your knowledge.