phoelix
05-11-2008, 07:03 AM
Hi there.
Sometimes i found this problem quite frustrating. All the constraint controllers expose a wrong .value property, for example the look_at, if you add a lookat constraint to a helper's rotation controller (and append a target) then if you write in the listener $helper.rotation.controller.value as eulerangles, you get a value different from the real helper's rotation (having in mind that controllers rotation values are respect to parents). The others controllers don't have the same problem, their .value property works perfect.
The only way to get the real constraint value is by accessing the whole transform value and the parent's: ($helper.transform*inverse $helper.parent.transform). But the fact is that sometimes i need to acces the position of a node from a script controller in its own rotation (for example make my own look_At with custom behaviors). The only way to do that without falling into a circular dependancy is by using the controller's value, not the .transform.position value, neither the transform controller, neither the node.position value (it has the same problem). If the controller isn't a constraint it doesn't have any problem and the script will work succesfully.
So what do you think guys?, is there a way to get a right .value property from a constraint or it's a bug or a bad design that we have to live with?
Sometimes i found this problem quite frustrating. All the constraint controllers expose a wrong .value property, for example the look_at, if you add a lookat constraint to a helper's rotation controller (and append a target) then if you write in the listener $helper.rotation.controller.value as eulerangles, you get a value different from the real helper's rotation (having in mind that controllers rotation values are respect to parents). The others controllers don't have the same problem, their .value property works perfect.
The only way to get the real constraint value is by accessing the whole transform value and the parent's: ($helper.transform*inverse $helper.parent.transform). But the fact is that sometimes i need to acces the position of a node from a script controller in its own rotation (for example make my own look_At with custom behaviors). The only way to do that without falling into a circular dependancy is by using the controller's value, not the .transform.position value, neither the transform controller, neither the node.position value (it has the same problem). If the controller isn't a constraint it doesn't have any problem and the script will work succesfully.
So what do you think guys?, is there a way to get a right .value property from a constraint or it's a bug or a bad design that we have to live with?
