PDA

View Full Version : access layer property inside an attribute


mrfred
03-31-2012, 01:21 AM
I'm trying to access a layer property from a custom attributes using a local variable.


BtnProps = attributes controls
--redefine:ca
(
local LayerBags=LayerManager.GetLayerFromName "Layer001"

parameters main rollout:cbt
(
BagsBtn type:#Boolean ui:(bags)
)

rollout cbt "Checki"
(

button bags "bags"
on bags pressed do
(
print LayerBags.on
)

)
)


When I evaluate this code I get my button + the printed state when I pressed the button but when I re-open the scene after closing max I get a:
-- Unknown property: "on" in undefined <<

ok... so I guessing my variable LayerBags isnt stored... so I added the local var... still not working. I tried defining the variable as a global in the scene but I get a -- Runtime error: Attempt to access deleted <MixinInterface> later on

What is exactly the problem... is it how I called in the local variable, how I'm trying to access the layermanager inside a custom attributes or both of them?

mrfred
03-31-2012, 06:35 PM
nvm got it working

declaring the local var inside the button/chckbox/checker changed state did it

checkbox bags "bags"
on bags changed state do
(
test=layermanager.getLayerFromName "Layer001"
test.ishidden=state
)

CGTalk Moderation
03-31-2012, 06:35 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.