ZBrushCentral

DefaultZcript recall when H key pressed

hi there,

Everything is in the Title.
The DefaultZcript got called again (first time for startup as expected) when I toggle the Zscript:Hide Zcript button (e.g “H”).

Any solution to avoid this issue?

here is the code

[RoutineDef, setup, 

    [IShowActions,0]
    [IConfig,4.5]
    [IPress,Material:BasicMaterial]
    [ISet,Draw:Z Intensity,66]
    [note, "setup intialized successfully",,.5]
    ]


[If,[MemGetSize,StartupMem],
    [RoutineCall, setup] ,
     [MVarDef,StartupMem,1]
    ]


[pd]

[EDIT] Actually the method is called everytime the UI changes.
cheers

Bruce

As it stands your code will run everytime. Change it so that it only runs when the memblock doesn’t exist:


[If,[MemGetSize,StartupMem],
   //do nothing
,//else no memblock
    [RoutineCall, setup] 
    [MVarDef,StartupMem,1]
]

Thank you, Marcus!