Instancing changes rotation values

When I create an instance I set the following parameters: 

NewInstance.setLocalScale(SelectedNode.getLocalScale());			NewInstance.setLocalPos(SelectedNode.getLocalPos());NewInstance.setLocalRot(SelectedNode.getLocalRot());

now if the original object has a Y rotation of 90, the instance also has a Y Rotation of 90, which is perfect.

But if the original object has a Y rotation of 180, the instance suddenly has a Y Rotation of 0, an X Rotation of -180 and a Z Rotation of -180. The object ends up being in the same position, so it's working, but this messes up my script later on. How do you ensure that it sets the position to match the original, and doesn't do its own thing?

Comments

  • MikeDMikeD Posts: 299

    Use:

            //rotations	NewInstance.getXRotControl().setValue(SelectedNode.getXRotControl().getValue() );	NewInstance.getYRotControl().setValue(SelectedNode.getYRotControl().getValue() );	NewInstance.getZRotControl().setValue(SelectedNode.getZRotControl().getValue() );			//positions	NewInstance.getXPosControl ().setValue(SelectedNode.getXPosControl().getValue() );	NewInstance.getYPosControl ().setValue(SelectedNode.getYPosControl().getValue() );	NewInstance.getZPosControl ().setValue(SelectedNode.getZPosControl().getValue() );		//Scale	NewInstance.getXScaleControl ().setValue(SelectedNode.getXScaleControl().getValue() );	NewInstance.getYScaleControl ().setValue(SelectedNode.getYScaleControl().getValue() );	NewInstance.getZScaleControl ().setValue(SelectedNode.getZScaleControl().getValue() );

     

Sign In or Register to comment.