ZBrushCentral

Lazy Susan

Hi, this is my first attempt at scripting.
I figured that I could use Lazy Susan functionality in my sculpting, meaning having the object rotate at a predefined speed around an axis while I work on it.

So far I’ve managed to get the object to rotate in steps using buttons but here are a couple of problems preventing me from going further:

  1. The object seems to flip at certain points during the rotation, I’m guessing that’s what’s referred to as gimbal lock?
    How would one go about getting around that, just somehow rotate the other axes to compensate?

  2. When in a rotation loop I can’t actually use a brush on the object, which is the whole point.
    I assumed there would be a way to rotate, check the brush and apply the portion it drew, check the amount of time that passed and rotate again, but I don’t see how I would do that, so any suggestions?

P.S. I’m basically using this line to rotate: [TransformSet, xPos, yPos, zPos, xSc, ySc, zSc, xRot, (yRot + (rotationSpeed * varDir)), zRot]

Hi EnsilZah,

Good to hear that you are starting zscripting. :+1:

  1. Yes, this is gimbal lock. It’s difficult to avoid (at least, I’ve not come up with a fail safe method). It will happen when the model nears 90 degree rotation so you can avoid it a bit by not using increments that include 90 degrees. Otherwise you can adjust all axes together as you mention.

  2. I’m afraid this isn’t possible. There’s no way to rotate the model using zscript and still be able to sculpt. It’s a restriction of zscripts that while they are running they have control of the interface.

The best way to sculpt as if using a lazy susan is to switch on radial symmetry. This isn’t the same thing, of course, but it does get the job done.

Going back to the rotation problem, one method I use for rotating the model is to use the CanvasClick command to simulate a mouse drag off the canvas:

[CanvasClick,-4096,-4096,-4096+(#shift),-4096]

The axis can be selected using Transform>Rot X,Y,Z switches and the #shift variable above will determine how mush the model rotates each time. This seems to work well and without gimbal lock.

HTH,

Thanks for the reply.
Is there any other way to rotate the object while retaining the ability to sculpt, say if I’m somewhat familiar with C++?

No, there’s no direct access to the ZBrush data to make such a thing possible.