ZBrushCentral

Reading out TransformGet

I need to have the separate values of xPos, yPos, zPos, xSc, ySc, zSc, xRot, yRot, ZRot of the actual cameraposition.
I know that I can get them with: [TransformGet,xPos, yPos, zPos, xSc, ySc, zSc, xRot, yRot, zRot]
My question:
How to VarSet for instance the variable YRotation with the corresponding the value yRot that is ‘hidden’ in [TransformGet,xPos, yPos, zPos, xSc, ySc, zSc, xRot, yRot, zRot]?

Probably an easyanswer, but I could not find the anser elsewhere.

Greetings, EddyL

In your example, xPos, yPos and so on are variables - storage boxes for the actual values. The ‘xPos’ is the variable’s name, as well as, in this case, the type of value that it stores but you could call them anything you like. To use the variables and the values they store throughout your script you first need to declare them at the beginning:

[VarDef,xPos,0]
[VarDef,yPos,0]
[VarDef,zPos,0]
…and the rest

Having done that you can use them to store the values and use how you want. So, to store the values of the current optject in edit more you use:

[TransformGet,xPos, yPos, zPos, xSc, ySc, zSc, xRot, yRot, zRot]

If you later wanted to reset the object to this exact same position you would use:

[TransformSet,xPos, yPos, zPos, xSc, ySc, zSc, xRot, yRot, zRot]

or you could set any of the values how you wanted:

[VarSet,yRot,90] //gives yRot the value 90
//which is then applied to the object using:
[TransformSet,xPos, yPos, zPos, xSc, ySc, zSc, xRot, yRot, zRot]

Note that the other values remain the same as they were before. You need to set them all everytime, you can’t get away with leaving blanks.

HTH,