ZBrushCentral

Help fix a macro shift_to_Top_MergeDown

Created Macro: Shift to top then Merge Down
was real proud of myself until I realized that if the wrong subtool part was selected and needed an “Undo”, the part would get deleted!
…any macro pros can help?
Also there are 3 files created with the macro, can I just upload the txt file or need all 3?

//ZBRUSH MACRO - Recorded in ZBrush version 2021
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2021]
[IKeyPress,SHIFT,[IPress,Tool:SubTool:MoveUp]]
[CanvasStroke,(ZObjStrokeV03n2%p1FACE7Ap1697EBCp-4ED174n-A24n-9B9FnCB03s1BC1B7Cs1BC1B7Cs1BC1B7Cz1CD=YH1CEVD0K4XH1CEVD0)]
[IKeyPress,SHIFT,[IPress,Tool:SubTool:MoveUp]]
[IPress,Tool:SubTool:MergeDown]
]

hi @sadicus ,

So no you just need to post the code, i had been able to clean up the macro and it work like you want it to work. how could it be the wrong subtool ?

So i came with that concept of macro :

There is a message box which ask if we want to proceed, tell me if you want it out.
Also if you you can to undo that macro will keep a copy of the merge subtool
so if you want to restore it you can then press : Tool:Subtool:Paste to insert the subtool.

You can’t to Undo history anything if the subtool do not exists anymore.

[RoutineDef, ShiftSubtoolAndMergeDown,

    [IKeyPress,SHIFT,[IPress,"Tool:SubTool:MoveUp"]]
    //if you want a custom message
    [VarSet, msgBox, [MessageOKCancel, "Would you like to merge down the subtools?", "Abort Merge Down action ?"]]
    [If, msgBox,
        [IPress, "Tool:Subtool:Copy"]// keep a copy of the subtool on memory
        [IKeyPress,'2',[IPress,"Tool:SubTool:MergeDown"]]// to get ried of popup message
        [Note, "the Subtool has been copied in memory for easy restore. \ndo a Subtool > Paste to restore the subtool."]
        ,//else
        [Note, "Subtools Merge Down operation aborted.",,.3]
    ]
]

[IButton,???,"Press to run this macro. Macros can be aborted by pressing the ëescí key.",
    [IShowActions,0]
    [IConfig,2021]
    [RoutineCall, ShiftSubtoolAndMergeDown]
    
]

Please post you help requests in Zscripting Help Forum not Shared Zscripts and Macros :slight_smile:
Hope It helps!
Nicolas

Thank you! just tested this will works great.
This thread link shows as being posted here: Main> Catagory> ZScripting Help
not sure why it’s showing in Shared Zscripts and Macros.