ZBrushCentral

a simple plugin: Deep Trim

the Usage:

First of all ,if you are using Rect or Circle to Trim, then you must hold Down Ctrl+Shift+ALT to trim,if you didn’t hold the ALT key, the plugin will not work. using Lasso or Curve is perfect whatever ALT is press or not.

After you Trim the mesh ,DON’T DO or CLICK ANYTHING except this plugin button “DeepTrim”.

Below is the code you can save as a TXT file and load into Zscript and run:

================

//RECORDED ZSCRIPT 4.6
[IButton,DeepTrim,“Press to play this ZScript. ZScript can be aborted at anytime by pressing the ëescí key.”,
[IConfig,4.6]

[IKeyPress,ALT+SHIFT+CTRL,[CanvasStroke,[StrokeGetLast]][VarSet,x,[IGet,Stroke:Item Info]]]

[If,x = 6,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimRect]]
[IUnPress,Brush:TrimRect]
[IClick,Brush:ClipRect]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Rect,6]]
[IKeyPress,ALT+SHIFT+CTRL,[CanvasStroke,[StrokeGetLast]]]
[IClick,Brush:TrimRect]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Rect,6]]
[Exit]
]

[If, x = 7,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimCircle]]
[IUnPress,Brush:TrimCircle]
[IClick,Brush:ClipCircle]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Circle,7]]
[IKeyPress,ALT+SHIFT+CTRL,[CanvasStroke,[StrokeGetLast]]]
[IClick,Brush:TrimCircle]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Circle,7]]
[Exit]
]

[If, x = 8,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimCurve]]
[IUnPress,Brush:TrimCurve]
[IClick,Brush:ClipCurve]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Curve,8]]
[IKeyPress,ALT+SHIFT+CTRL,[CanvasStroke,[StrokeGetLast]]]
[IClick,Brush:TrimCurve]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Curve,8]]
[Exit]
]

[If, x = 9,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimLasso]]
[IUnPress,Brush:TrimLasso]
[IClick,Brush:ClipCurve]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Lasso,9]]
[IKeyPress,ALT+SHIFT+CTRL,[CanvasStroke,[StrokeGetLast]]]
[IClick,Brush:TrimLasso]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Lasso,9]]
[Exit]
]

]/End of ZScript/

======================

Attachments

PP.jpg

Cool. :+1: Thanks
As posted it doesn’t show up unless you replace “DeepTrim” with “???” :wink:
You could stick in a routine instead of the code repeated 4 times.
And it begs for the enter button to confirm the action.
I tried adding [IKeyPress,13]//Enter key in several places, but still get the message…

Wow! was just thinking about doing this myself, thank you. Surprised this isn’t default behavior for those brushes.

Modified code, save as DeepTrim.txt
//RECORDED ZSCRIPT 4.6
[IButton,???,“Press to play this ZScript. ZScript can be aborted at anytime by pressing the ëescí key.”,
[IConfig,4.6]
[RoutineDef,DoIt,
[IKeyPress,ALT+SHIFT+CTRL,[CanvasStroke,[StrokeGetLast]]]
]//end of routine
[IKeyPress,ALT+SHIFT+CTRL,[CanvasStroke,[StrokeGetLast]][VarSet,x,[IGet,Stroke:Item Info]]]
[If,x = 6,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimRect]]
[IUnPress,Brush:TrimRect]
[IClick,Brush:ClipRect]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Rect,6]]
[RoutineCall,DoIt]
[IClick,Brush:TrimRect]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Rect,6]]
[Exit]
]
[If, x = 7,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimCircle]]
[IUnPress,Brush:TrimCircle]
[IClick,Brush:ClipCircle]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Circle,7]]
[RoutineCall,DoIt]
[IClick,Brush:TrimCircle]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Circle,7]]
[Exit]
]
[If, x = 8,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimCurve]]
[IUnPress,Brush:TrimCurve]
[IClick,Brush:ClipCurve]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Curve,8]]
[RoutineCall,DoIt]
[IClick,Brush:TrimCurve]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Curve,8]]
[Exit]
]
[If, x = 9,
[IKeyPress,ALT+SHIFT+CTRL,[IPress,Brush:TrimLasso]]
[IUnPress,Brush:TrimLasso]
[IClick,Brush:ClipCurve]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Lasso,9]]
[RoutineCall,DoIt]
[IClick,Brush:TrimLasso]
[IKeyPress,ALT+SHIFT+CTRL,[ISet,Stroke:Lasso,9]]
[Exit]
]
]/End of ZScript/

Works nice :wink:

Doug Jones :

;)yes the message showing all the time until user press “skip”… is your code fixed that problem??

Unfortunately, no. I added keypress for enter in 4 places, still no joy. Maybe it’s not possible? marcus_civis knows this :wink:

How do we get too the Deep Trim Button? I have copied the code opened it with zscripts.

namdoyle, thank you very much

HI,you should press RUN QQ截图20140523120542.jpg,and press this to open ZSCRIPT Buttom panel —>QQ截图20140523120657.jpg

the button should be there.if not,pls try to change other name.

Works great in 4R7
Thanks!

I never thought of putting both of these together! This is a great idea; Excellent Work! Thanks for creating this!

-Joseph

Hi !

First of all!

It’s an amazing script! thank you!

It’s exactly what i’m looking for :wink:

But it seems doesn’t work well with me with Trimcurves brush and B radius tool activated, especially when you hold ALT button.
here with animated gif.

https://drive.google.com/file/d/0B3ECFxtoONPKTHdNZ2pvXzNLaWs/view

the first time, i draw a straight line,
the second time , i draw a curved line,
and Three time, i draw a curved line and launch the script.

Please let me know, :wink:

I get “access denied” when trying to load the gif.

it’s fixed RafalZ! :wink:

thx
I don’t think it works with BRadius at all.
(I don’t use BRadius too often so it’s no biggie for me)