ZBrushCentral

Length of Layerlist

Ok, easy question – when I do an Iget on the LayersScrollbar, how do I get both values from the result ?
Tried storing everything in an array but nothing seems to come out of an Iget Tools:Layers: Layers Scrollbar and all I get is 0.

This is what I use to find the number of layers. The scrollbar position is found by using [IGetSecondary].


//****routine to find the number of layers*****************
[RoutineDef,GetLayers,
	[VarSet,numberOfLayers,0]
	[If,[IsEnabled,Tool:Layers:Layers Scrollbar],		
		//store current scroll bar position
		[VarSet,tmpLyScrPos,[IGetSecondary,Tool:Layers:Layers Scrollbar]]
		//set scroll bar to a maximum to ensure it is at the top
		[ISet,Tool:Layers:Layers Scrollbar,0,256]
		[VarSet,numberOfLayers,[IGetSecondary,Tool:Layers:Layers Scrollbar]+1]
	,
		[If,[IsEnabled,"Tool:Layers:Layer Intensity"],
			[VarSet,numberOfLayers,1]	
		]
	]
]//end routine

Hey Marcus,
whenever i use the ISet to set the scrollbar anywhere in my plugin Zbrush crashes immediately after the Routine is launched.
I tried it with different routines and even something super simple as well and it just dies on me. Any thoughts ?

Make sure you are setting two values. The first is always zero and the second the actual scrollbar position:


[ISet,Tool:Layers:Layers Scrollbar,0,256]//sets to the top of the list