ZBrushCentral

Question: IButton won't close?

My button won’t close anymore when i delete this part of the code it wants to close but now it doesn’t, So i assume something is wrong here

[If, result == 9, //Without this one everything woks






[VarSet, ButtonNo3, 2]






[NoteIButton, “Yes”,0xff9923]// button1






[NoteIButton, “No”,0xff9923]// button2






[VarSet,result,[Note,"\Cff9923 Make new UVs?
",0x282f42,400]]






[If, result == 1,






[Note, “Please go Back to EaZy Exploder and hit UVs Used”]







[VarSet, makeUv, 1]







[IPress, Zplugin:Uv Master:Unwrap]







[IPress, Zplugin:Uv Master:Flatten]







]






[If, result == 2,






[RoutineCall, Part2]







]






[LoopExit]







]

//_______________________________________________________whole code

[IButton, “Explode”,“EaZy Exploder”,

[IPress, Tool:Visibility:ShowPT]

[IPress, Tool:Subtool: Duplicate]

[VarSet, sTNr, [SubToolGetActiveIndex]+1]

[SubToolSelect, sTNr]

[VarSet, sTNr, 0]

[IPress, Tool:Visibility:ShowPT]

[VarSet, sDIV, [IGetMax, Tool:Geometry:sDIV]-[IGet, Tool:Geometry:sDIV]]

[IPress, Tool:Layers:Bake All]

[Loop, sDIV,

[IPress,Tool:Geometry:Higher Res]

]

[VarSet, sDIV, [IGet, Tool:Geometry:sDIV]-1]

[IPress, Tool:Subtool:Duplicate]

[IPress,Tool:Geometry:Del Lower]

[VarSet, sTNr, [SubToolGetActiveIndex]+1]

[SubToolSelect, sTNr] //____goes to lp procces

[ISet, Tool:Geometry:AdaptiveSize, 50]

[ISet, Tool:Geometry:Curves Strength, 50]

[IPress, Tool:Geometry:Adapt]

[IUnPress, Tool:Geometry:FreezeBorder]

[IUnPress, Tool:Geometry:FreezeGroups]

[IUnPress, Tool:Geometry:KeepGroups]

[IUnPress, Tool:Geometry:Use Polypaint]

[VarSet, ButtonNo, 4]

[NoteIButton, “Use Lowest sDIV”,0xff9923]// button1

[NoteIButton, “Use Styx”,0xff9923]// button2

[NoteIButton, “Import”,0xff9923]// button3

[NoteIButton, “Create LP”,0xff9923]// button4

[VarSet,result,[Note,"\Cff9923 Please select low poly option?
",0x282f42,400]]

[If, result == 1,


[Loop, sDIV,



[IPress,Tool:Geometry:Lower Res]




]



[IPress,Tool:Geometry:Del Higher]



[VarSet, sDIV, 0]



[RoutineCall, Part2]



]


[If, result == 2,


[Loop, sDIV,



[IPress,Tool:Geometry:Lower Res]




]



[IPress,Tool:Geometry:Del Higher]



[VarSet, sDIV, 0]



[Note, “Please go Back to EaZy Exploder and hit Styx Used”]



[VarSet, styxUsed=1]



[IPress, Zplugin:Styx:ImportExport:Imp]



]


[If, result == 3,


[Loop, sDIV,



[IPress,Tool:Geometry:Lower Res]




]



[IPress,Tool:Geometry:Del Higher]



[VarSet, sDIV, 0]



[IPress, Tool:Import]



[RoutineCall, Part2]



]


[If, result == 4,


[IPress, Transform:PF]



[IPress, Transform:Solo]



[Loop, 9999,



[VarSet, ButtonNo2, 9]




[NoteIButton, “Double Polycount”,0xff9923]// button1




[NoteIButton, “Split Polycount”,0xff9923]// button2




[NoteIButton, “New Edge Flow”,0xff9923]// button3




[NoteIButton, “+1”,0xff9923]// button4




[NoteIButton, “-1”,0xff9923]// button5




[NoteIButton, “+0.1”,0xff9923]// button6




[NoteIButton, “-0.1”,0xff9923]// button7




[NoteIButton, Target Polygon Amount,0xff9923]// button8




[NoteIButton, “Done”,0xff9923]// button9




[VarSet,result,[Note,"\Cff9923 Make low poly
",0x282f42,400]]




[If, result == 1,





[IPress, Tool:Geometry:Double]






[IPress, Tool:Geometry:ZRemesher]






]





[If, result == 2,





[IPress, Tool:Geometry:Half]






[IPress, Tool:Geometry:ZRemesher]






]





[If, result == 3,





[IPress, Tool:Geometry:Same]






[IPress, Tool:Geometry:ZRemesher]






]





[If, result == 4,





[VarSet, Target Polygon Amount, Target Polygon Amount+1]






]





[If, result == 5,





[If, Target Polygon Amount>0.1,






[VarSet, Target Polygon Amount, Target Polygon Amount-1]







]






]





[If, result == 6,





[VarSet, Target Polygon Amount, Target Polygon Amount+0.1]






]





[If, result == 7,





[If, Target Polygon Amount>0.1,






[VarSet, Target Polygon Amount, Target Polygon Amount-0.1]







]






]





[If, result == 8,





[IUnPress, Tool:Geometry:Same]






[IUnPress, Tool:Geometry:Double]






[IUnPress, Tool:Geometry:Half]






[ISet, Tool:Geometry:Target Polygons Count, Target Polygon Amount]






[IPress, Tool:Geometry:ZRemesher]






]





[If, result == 9, //Without this one everything woks






[VarSet, ButtonNo3, 2]






[NoteIButton, “Yes”,0xff9923]// button1






[NoteIButton, “No”,0xff9923]// button2






[VarSet,result,[Note,"\Cff9923 Make new UVs?
",0x282f42,400]]






[If, result == 1,






[Note, “Please go Back to EaZy Exploder and hit UVs Used”]







[VarSet, makeUv, 1]







[IPress, Zplugin:Uv Master:Unwrap]







[IPress, Zplugin:Uv Master:Flatten]







]






[If, result == 2,






[RoutineCall, Part2]







]






[LoopExit]






]





]//end loop



]



]

I’m not getting an error. You need a routine called “Part2” and also you need to define a variable for “Target Polygon Amount” and give it an initial value. (I think it would be best not to have spaces in the variable name but that’s only coding style.)

Thanks fixed it. Yeah I also hate the spaces but I wanted to display the var name on the ui.