1. #1

    Default 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*/



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

  2. #2
    Senior Member Follow User Gallery
    Join Date
    Aug 2011
    Location
    Mebane, NC
    Posts
    4,194

    Default

    Cool. Thanks
    As posted it doesn't show up unless you replace "DeepTrim" with "???"
    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...

  3. #3
    Senior Member Follow User Gallery
    Join Date
    Jun 2003
    Posts
    2,550

    Default

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

  4. #4
    Senior Member Follow User Gallery
    Join Date
    Aug 2011
    Location
    Mebane, NC
    Posts
    4,194

    Default

    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

  5. #5
    Senior Member Follow User Gallery
    Join Date
    Dec 2007
    Posts
    106

    Default

    Doug Jones :

    yes the message showing all the time until user press "skip".... is your code fixed that problem??

  6. #6
    Senior Member Follow User Gallery
    Join Date
    Aug 2011
    Location
    Mebane, NC
    Posts
    4,194

    Default

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

  7. #7

    Default

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

  8. #8
    Member Follow User Gallery
    Join Date
    Oct 2005
    Posts
    66

    Default

    namdoyle, thank you very much

  9. #9

    Default

    HI,you should press RUN ,and press this to open ZSCRIPT Buttom panel --->

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

  10. #10

    Default

    Works great in 4R7
    Thanks!

  11. #11
    Senior Member Follow User Gallery
    Join Date
    Apr 2005
    Location
    Pittsboro, NC
    Age
    40
    Posts
    717

    Default

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

    -Joseph

  12. #12
    Senior Member Follow User Gallery
    Join Date
    Apr 2004
    Location
    france
    Age
    39
    Posts
    263

    Default

    Hi !

    First of all!

    It's an amazing script! thank you!

    It's exactly what i'm looking for

    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/0B3E...pvXzNLaWs/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,
    Vang Cki

    CONCEPT DESIGNER
    www.vangcki.com
    vangcki@gmail.com

  13. #13

    Default

    I get "access denied" when trying to load the gif.

  14. #14
    Senior Member Follow User Gallery
    Join Date
    Apr 2004
    Location
    france
    Age
    39
    Posts
    263

    Default

    it's fixed RafalZ!
    Vang Cki

    CONCEPT DESIGNER
    www.vangcki.com
    vangcki@gmail.com

  15. #15

    Default

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •