ZBrushCentral

Using Timeline to animate a rotation in a subtool [Answered]

Hi All,

I am trying to rotate a single subtool on the y axis only using the timeline, while leaving all other sutools static.I want to export a movie with that rotation for client approval without having to go to a 3D app. Is that possible in ZBrush? I’ve tried to unlink subtool from the camera in the Timeline Tracks sub palette but that functionality does not appear to be working.

Thanks

It’s possible but you need to use a macro rather than the Timeline and then use the Undo History movie recording. Just save the text file to your ZBrush 4R5/ZStartup/Macros/Misc folder and press the ‘Reload All Macros’ button in the Macro palette. You’ll then have a new ‘RotateSubTool’ button in the Macro>Misc sub-palette.

What this does is set the Tool>Deformation>Rotate slider to 6, repeated 60 times. You can then use the the Movie palette to record the Undo history. So what you would do is:

  1. Make sure you’ve saved a backup of your model before you start then set up your model how you want.
  2. Delete the Undo History by pressing Edit>Tool>DelUH. This just simplifies the movie recording and you’ll be able to scrub along the undo history.
  3. Press the RotateSubTool macro button.
  4. Set the Undo history back to the start for forward recording.
  5. Do a BPR render if you want.
  6. Press Movie>F History to record Forward Undo History, or Movie B History for backwards (rotating the other way).

Note:

  • You can set the Movie>Modifiers>H Frames to a lower number for a faster turntable but don’t set it to 0.

Download here:

You’re the man!!
In the code you have a comment //y axis
Will changing it to 1 be for x and 3 be for z? Might be helpful to know.

X = 1
y = 2
z = 4

You can actually add the numbers together for combined axes which is why z = 4 (as 3 is rotation around X+Y).

Fantastic, thank you Marcus!!!

Another quick question.

When rendering with BPR and recording a movie is it better to have the document size twice that of the desired final output and then record the movie at medium size (50%).

I would say it’s not necessary. BPR has its own antialiasing which produces an excellent result at screen resolution. However, if you wanted to compare, you could easily record a single-frame movie using the Movie>Snapshot button.

Hi Marcus, the macro is working perfectly. I have another question; I have two subtools that need to rotate sumultaneously. Normally I would simply merge them but one subtool requires BPR transparency while the other does not. The transparent subtool is overlapped by the other subtool. Is there a way to set up the macro to rotate one subtool 6 degrees then switch to the other subtool rotate it 6 degrees have it recorded as one piece of history and loop the rotation 60 times as before.

Perhaps I could merge, rotate, split, turn on transparency and repeat… so when I BPR Render before recording the movie I can have shadows and transparency etc. all working.

I realize I’m trying to have my cake and eat it too.

You can do that but it would take some more scripting - it wouldn’t be possible to use the undo history as that will only record one subtool. I’ll try and take a look tomorrow.

OK, this will do what you want.

  1. Unzip to your Desktop.
  2. Copy the RotateSubTools.zsc to your ZBrush 4R5/ZStartup/ZPlugs folder.
  3. Restart ZBrush.

You’ll have a new sub-palette called Rotate SubTools in the Movie palette:

  1. Press the Set SubTool button to store your second subtool.
  2. Turn on the BPR switch if you want the movie rendered with BPR.
  3. Press the Record Movie button to record the movie.

Notes:

  • Your subtools should have no Undo History. This is because the plugin will reset the Undo History at the end.
  • Sometimes you may get the blue donut - leave ZBrush to do its thing, it’s just busy.
  • Set up things before you start - the plugin uses the Movie>Modifiers Spin Frames & Spin Cycles as well as the Movie axis setting. So, for example, you might set Spin Frames to 90, Spin Cycles to -2 and the Axis to X. This would give you a 180 frame movie of two rotations backwards about the X axis.

Download here:

HTH,

Marcus

Thank you again! I will give it a test today. You are an incredible resource and friend to ZBrushers everywhere. I was looking at the ZScripting guide today thinking I should probably start exploring it.

Dave