Hi,
got a weird little problem with the routine below.
I am saving out the individual state of each Layer in the Layerlist into the global Array "gLayerVisibilityStatus()". It works just as you would expect it to -- as long as the Layers are called the default name "Untitled Layer". As soon as I have a custom named Layer it errors out, telling me that something is wrong with the [IModGet,tmpCurrentLayerState].
I checked the Layerpath result that gets written into the Variable - looks fine to me. Any ideas ?
[CODE]//-------------------------- Save current state of all Layers so it can be reset later into LayerVisbilityStatus Variable -----
[RoutineDef,SaveLayerState,
[VarSet,tmpCurrentScrollbarPosition,[IGetSecondary,Tool:Layers:Layers Scrollbar]]
[VarSet,tmpScrollbarPosition,-1]
[VarSet,tmpArrayCount,0]
[ISet,Tool:Layers:Layers Scrollbar,0,0]
// Loop1 going through Scrollbar
[Loop,gnumberOfLayers,
[VarSet,tmpScrollbarPosition, tmpScrollbarPosition+1]
[If,
(tmpScrollbarPosition==gnumberOfLayers), [LoopExit]
]
//set scrollbar so that current Layer is at the top
[ISet,Tool:Layers:Layers Scrollbar,0,tmpScrollbarPosition]
// Storing Layer States:
[ISet,Tool:Layers:Layers Scrollbar,0,tmpScrollbarPosition]
[VarSet,tmpCurrentLayerState,[StrMerge,"Tool:Layers:",[IGetTitle,"Tool:Layers:Layer Intensity"]]]
[VarSet,gLayerVisibilityStatus(tmpArrayCount),[IModGet,tmpCurrentLayerState]]
[VarInc,tmpArrayCount]
] //End Loop
[ISet,Tool:Layers:Layers Scrollbar,0,tmpCurrentScrollbarPosition]
] // end routine Turn Layers Off
[/CODE]