[Closed] $.rotation.controller.x_rotation.keys not working when accessed via a variable?
I can access the .keys property like this:
$.rotation.controller.x_rotation.keys
but let’s say I do this:
rotContX = $.rotation.controller.x_rotation
rotContX.keys
It does not work. It says: “Unknown property: “keys” in -0.975016”
Is there something here I don’t understand?
It’s strange because this works:
rotCont = $.rotation.controller
rotCont.keys
thanks,
.x_rotation
is a numerical number (float) and not a controller, thus not keyable.
Use
.x_rotation.controller
That should work…(no guaranties though)
Edit:
Also,
.rotation.controller.x_rotation
looks a bit strange to me.
.rotation.x_rotation.controller
is the correct order methinks
thanks, it works. But which one should I use? It’s getting confusing, both of these works:
$.rotation.controller.x_rotation.controller.keys
$.rotation.x_rotation.controller.keys
I’m not exactly sure of the difference between both
I will
Still, if someone knows what the difference between
$.rotation.controller.x_rotation.controller.keys
and
$.rotation.x_rotation.controller.keys
is, I’d like to know! Thanks
This is a much bigger problem than I thought…
My problem is the variable gets evaluated BEFORE evaluating it WITH its property.
Another example of this is:
rotTransform = $.rotation
print rotTransform.isAnimated
outputs: – Unknown property: “isAnimated” in (quat 0.0347845 0 0 0.999395)
where:
print $.rotation.isAnimated
works perfectly.
I’m betting there’s something really obvious I’m not aware of… Enlighten me please
test = $.rotTransform would return a value not a parameter, so test.isAnimated would return undefined as theres no property for a value, the value itself is the property.
$.rotation.isAnimated is returning if the rotation controller is animated, not its value and so returns a correct value.
So test = $.rotation will return its rotation value, not its controller where as you could do test = $.rotation.controller
test.isAnimated should work (im not at max though so)
not working.
test = $.rotation.controller
test.isAnimated
reports the same error as:
$.rotation.controller.isAnimated
which is: – Unknown property: “isAnimated” in Controller:Euler_XYZ
to get the .isAnimated property to return a value, I have to add it like this: $.rotation.isAnimated
And I’m still left with the problem where:
test = $.rotation
test.isAnimated
won’t work because the variable is evaluated without the property
AFAIK, you cannot ask a variable if it is animated. ‘isAnimated’ needs a property to work with, and these aren’t saved in variables by default.
The only way to do what you want would be
Test = $.rotation
Test.controller.isAnimated
or maybe this…
Test = getproperty $ #rotation
Test.isAnimated
not working either…
Test = $.rotation
Test.controller.isAnimated
returns – Unknown property: “controller” in (quat 0.23211 0 0 0.97269)
again, the variable is evaluated without its property
and same thing with:
Test = getproperty $ #rotation
Test.isAnimated
I get this: – Unknown property: “isAnimated” in (quat 0.23211 0 0 0.97269)
somebody must know what’s going on here…
The examples are a bit flawed… when you run…
Test = $.rotation
Test will now contain the rotation value of the selection (bad idea to use $, btw, as you can only call .rotation on a single object, but that’s another topic). The value, a Quaternion, doesn’t have any controller.
When you run…
Test = $.rotation.controller
Then you’re getting the controller out of the rotation parameter, and that parameter can indeed have a controller.
The only way the former would work is if you made a reference to the parameter:
Test = &$.rotation
*Test.controller
Scary stuff.
However, even when you’ve got the rotation controller, you can’t call .isAnimated on it. .isAnimated is applied to tracks, rather than to controllers (as you already found out). So you would have to use…
$.rotation.isAnimated
or
$.rotation.x_rotation.isAnimated
if you need to check a specific axis.
So you with the aforementioned reference, you can use…
*Test.isAnimated
*Test.x_rotation.isAnimated
Thanks ZeBoxx2, this really is what I was looking for! And it works very well.
Quick question, in this example
Test = &$.rotation
*Test.controller
& is to make a reference,
what does * do in that particular line?
thanks,