Setting color on property
deslea
Posts: 27
Hi - I'd like to set colors A and B on a parameter dial of a morph I've made by script and I can't figure out how to do it. I've looked at setColorValue and setRgb and played with lots of variations, and I can't seem to make it work or even figure out how to set them both (it only seems to allow for setting one).
I've tried several different variations on this -
var oNodeToMorph = Scene.getSelectedNode( 0 ) ;
var oObjToMorph = oNodeToMorph.getObject( );
CreateMorph = new DzMorph( );
CreateMorph.setName( "TestName5" );
CreateMorph.getValueChannel().setLabel( "TestLabel5" );
// More customisations
CreateMorph.getValueChannel().setRgb( 255, 216, 124 ); // doesn't work; neither do several other variations
oObjToMorph.addModifier( CreateMorph );
The script works other than the color (ie, it creates the property as expected with the color line commented out). When the color line isn't commented out, I get variously parse errors or "Result of expression...is not an object", depending on what I've tried.
Any advice welcome! Many thanks!
Post edited by deslea on
Comments
Take a look at the Node Property Presentations sample.
-Rob