How do I get the controller property of the diffuse material on the selected object.
I know the simple solution here would be to just do a value change with Animate On but that can be buggy and I don't like doing that.
selfIll = $.material.diffuse.r.controller
newKey = addNewKey selfIll 10 #select
newKey.value = 10
By
Comments (5)
Comment policy
I'm trying to make it more streamline
How can I access those key values without hard coding that particular key.
cRGB = Color_RGB()
$.mat.diffuse.controller = cRGB
addNewKey cRGB sliderTime #select
theSubCtrls = getXYZControllers cRGB
newKey = selectKeys theSubCtrls slidertime
print newKey
newKey[1].value = 0 --r
newKey[2].value = 1 --g
newKey[3].value = 0 --b
slowly getting closer I believe.
cRGB = Color_RGB()
$.mat.diffuse.controller = cRGB
ctrlRGB = $.mat.diffuse.controller
ctrlRGB.r = (random 0 255)
ctrlRGB.g = (random 0 255)
ctrlRGB.b = (random 0 255)
Hmm...
you asked for workaround with addNewKey()
but going with "ctrlRGB.r = (random 0 255)"
you back to the "animate on" method --
..but if works well, why not? :)
try this
Great
That works great. Thanks Anubis,
I had tried several different ideas and none of them seemed to work.
Your solution how ever is just what i needed.
Thanks