ZBrushCentral

Question: Problem Disabling Layers via Script

Hello all,
I’m having a really tough time getting my ZScript to startup in the state I want. What I have is a basic tool that already has each of the layers named to L1 -> L8. My ZScript has a series of buttons (1…8) that act as “attempts” on a model. The user can click on button 2, it hides all other layers and activates layer 2. If they want to work on layer 3, they press “3” and all other layers are hidden and #3 becomes visible.

Now, this basic functionality I have working using:
[IModSet,Tool:Layers:L1,0] -and- [IPress,Tool:Layers:L1]

My problem is when I first load a model, I don’t want the user to even see the Layer list under tools and just work with the buttons I provide (it’s for scientific study so consistency is important). However, when I first load a model and try to set the state of all layers, L1 & L2 are both activated causing the whole script to breakdown. I have even tried explicitly deactivating L2 with IModSet at the end of my initialization routine and it just won’t stick. Does anyone have any ideas on how I can either: a) fix it, or b) work around it?

Thanks

E.

Setting the Mods with Layers is problematic. A simpler way would be to set the Intensity of each layer to 0 on creation and then set it to 1 when you want to work with it. You won’t then need to worry about visibility.


[Loop,8,
[IPress,Tool:Layers:New]
[ISet,Tool:Layers:Intensity,0]
]
[IPress,Tool:Layers:3D Layer 0]
[ISet,Tool:Layers:Intensity,1]

HTH,

It looks like that will work nicely. Thanks for the workaround.