Notifications
Clear all

[Closed] Help needed – Accessing Rollout items properly, How?

Hey guys!

Going a bit nuts here…
I’ve been fighting with this for several days now and i can’t figure it out.
Heres the situation…:
I have a rollout with only one label on it. I want the label to print the name of the object when i loop through the objects in the scene. Everything works fine at the beginning, but as soon as i load another max file (while the rollout is running) I can’t access the label anymore. Max gives me the error message – Unknown property: “current_exp_label”.

Here’s a small example code.

 
global export_scene
 
fn names =
(
for o in geometry do
(
if testFloater != undefined then export_scene.current_exp_label.text = o.name
)
)
 
rollout export_scene "Export Scene" width:401 height:376
(
label current_exp_label "No item" pos:[123,261] width:251 height:18
button btn_names "Export" pos:[147,335] width:102 height:26
 
on btn_names pressed do
(
	 names()
)
)
 
 
if testFloater != undefined then CloseRolloutFloater testFloater
testFloater = newRolloutFloater "Blah.." 421 575
addRollout export_scene testFloater

Why max loses track of rollout items while the rollout is still running? How to implement this properly?
Any help is greatly appreciated !

Thanks
Suvakas

2 Replies

the posted block of code works fine on my machine (Max 8 sp3)
doesn’t give me any error if I open another max file (while the rollout is running)
After the file load, when I press ‘export’, the earlier label name changes to
a new geometry name as per the new file .

maybe you need to look into other areas of the script where you have used
current_exp_label

Strange. The same exact script doesn’t work on my Max 8. Interesting. Will go and check some other workstation.

[edit:]
Worked on other workstation which had max 9. hmm… i’m out of ideas.
[edit2:]
Ok. Solved it. I had one persistent variable with the same name as rollout. It was saved into some max files as undefined. Opening those max files caused that error message. Thanks for testing. It helped alot !