ZBrushCentral

PS3 Move Navigation Controller and [IClick, Transform:RotateEdit,...]

So I’m using the PS3 Navigation Controller with ZBrush.

I can rotate Ztools where the controller joystick sends keystrokes and zscript clicks the canvas via

[IClick,1004,-4096,-4096,-4096+(offset),-4096].

But [IClick] on the canvas doesn’t work with modifier keys for pan and zoom.

Using the same IClick method doesn’t work when targeting Transform:MoveEdit, Transform:ScaleEdit, and Transform:RotateEdit.

Life would be really easy if we could just do [IClick,Transform:RotateEdit,-4096,-4096,-4096+(offset),-4096] etc.

It would make adding basic support for other controllers like ones from 3Dconnexion really easy.

-ds

Hi

Using [IKeypress, modifier key, sequence of zscript commands ] you can simulate a key(s) being pressed while other commands run. The Modifier Key can be an Ascii value such as 13, for the return key, or 27 for the escape key. Which is useful to immediately accept or cancel a load/save dialog window.

In your case you can use SHIFT, CTRL and ALT to simulate modifier keys. You can also combine them. For example, SHIFT+ALT. Sometimes you will see them used in zscripts by their numerical values, 256 for SHIFT, 512 for CTRL and 1024 for ALT.

But [IKeyPress,…] will unfortunately only take care of your panning. Like this :

[IKeyPress, ALT, [IClick, 1004, 4096, 4096, 4096+deltaX, 4096+deltaY]]

For scaling the model you would need to simulate a ALT keypress AND a release of the ALT key before performing any [IClick,…] or [CanvasClick,…].

I believe Marcus used [CanvasStroke, stroke data] for one of his plugins to scale a tool on the canvas. Unfortunately the documentation of stroke data is very sparse (there are multiple types of stroke data) and I have no idea if the data format still applies. But in any case see >>this<< for some stroke data parameters of one of the stroke types.

Hope that was somewhat helpful. A full, unencumbered integration of the PS3 Move controller is probably not something you are going to make happen through zscripting. But if you are serious in getting it to work, perhaps akin to how Media Molecule were sculpting at the PlayStation 4 reveal…then you should probably get in contact with someone at Pixologic. Not sure Media Molecule’s way of modeling would fit ZBrush, but perhaps Sculptris ?

As TVeyes says (thanks Mark :slight_smile: ), you can use a [CanvasStroke] to scale the model up or down. You can test the effect very easily by scaling a model just a little, then repeating the last stroke by hitting 1 on the keyboard (or pressing Stroke>Modifiers>ReplayLast).

But really this is no different to using the transform values directly in the [TransformGet] & [TransformSet] commands. With these you would simply get the current value and then add/subtract for the new value. Note that [TransformGet/Set] have a maximum value of 1024, so it is better to use the memory block equivalents of [MTransformGet] and [MTransformSet].

Both these methods are restricted by only operating with single button presses which would need to be repeated. (For a plugin button, assigning a hotkey which is then held down has this effect but you can’t use modifier key combinations.) And you would need to have separate buttons for scaling up and scaling down.