DzQuat.SetValue() doesn't change value

See attached debugger screenshot.

After:

oQuat = oNode.getLocalRot();newQuat = oNode.getLocalRot();newQuat.setValue(1, 0, 0, 0);

 

newQuat should have a different value than oQuat, but it's unchanged.

Since I want to rotate a node of a commercial product, could it be that this node is somehow protected from changes via script?

I can change the rotation via the normal pose-controls, though.

Any help is highly appreciated

Scripting-Problem.jpg
986 x 628 - 203K

Comments

  • Just a little update: changing the DzQuat object still won't work, but actually changing the rotation with:

    oNode.setLocalRot(DzQuat(-0.015271,0,0,0.999883));

    works, so it seems that a new DzQuat instance is needed to do the job. Still no idea why I can't change a DzQuat object, but anyway, if someone encounters the same problem here's a workaround.

  • But you were working on a DzQuat that was equal to the rotation, not the rotation itself - this is one of the drawbacks of scripting, it doesn't make it as clear when you are working with a pointer to a value and when you are working with an actual value: in this case you are working with an independent value, not with the object's own rotation values.

  • edited November 2021

    Richard Haseltine said:

    ...it doesn't make it as clear when you are working with a pointer to a value and when you are working with an actual value..

     Your explanation makes sense, and I've just checked in the debugger again, even when you drill down the DzQuat you have a hard time finding out what is is.

    Thanks for this information, I really appreciate this !

    Post edited by crowning_451d3aec80 on
Sign In or Register to comment.