ZBrushCentral

Drag-Rect to fill canvas

I’m 1 line away from my 1st useful script. (I think)

I need to take a simple brush with Drag-Rect stroke type(already selected), and fill the canvas with my stroke, probably using IStroke. Since canvas sizes and screen sizes may vary, how can i properly build the stroke, or whatever I need?

Thanks ahead of time.

You need to use CanvasClick to emulate a mouse click and drag in the canvas area.

So - how do you know what x,y coordinates to insert? Where can you find the size of the canvas? What palette would you use to change canvas size?

(assuming you have already selected DragRect)

[VarDef,CanvasWidth,DOCUMENT:Width]
[VarDef,CanvasHeight,DOCUMENT:Height]
[CanvasClick,0,0,CanvasWidth,CanvasHeight]

Sven

edit: actually, since the alpha you are probably using for this is Brush 00 (which is square) you probably would want to find out which dimension (width or height) is the larger, and use THAT dimension for both third and fourth argument. In a landscape canvas you would use:
[CanvasClick,0,0,CanvasWidth,CanvasWidth]
:slight_smile:

So, what is your script going to do?

I found it on my own last night looking over other people’s script.

[CanvasStroke,(ZObjStrokeV02n2=H0V0HFFFVFFF)]
this 1 works with less function calls, just go from 0 to max zbrush canvas size (4096, or FFF), this way it don’t matter which is biger, hehe. Everybody was doing it your way to specific sizes, but this works perfectly also.

thank you though.

:+1: