Notifications
Clear all

[Closed] Scripted Attributes: Script order and Checkboxes

Hey guys,
It seems like I’m incompetent, but I’ve learned a lot over the last two weeks. I’m currently working with scripted attributes assigned to the rootNode in order to save data and flags to scene files. While working on my script, I came across two issues that I can’t seem to get around:

First, scripted attributes that are wired to UI elements seem to have ordering issues. i.e. if the rollout is defined before or after the custom attributes are assigned makes a difference. Unfortunately, I can’t figure out that difference. That’s what’s keeping this code from working.

Second, this code is intended to test what I’m doing wrong regarding checkboxes controlling boolean flags. In a larger and more complex script I’m crafting, I’m baffled at how my checkboxes aren’t affecting boolean flags I’ve setup similar to this example.

Anyone had this problem before?
Thanks!!


 rollout thisRollout "this_Rollout" width:112 height:142
 (
 	checkbox chk1 "Checkbox1" pos:[8,8] width:120 height:16
 	checkbox chk2 "Checkbox2" pos:[8,40] width:120 height:16
 )
 the_SceneData = attributes SceneData
 (
 	parameters worldParams rollout:thisRollout
 	(
 		checkBox1Flag type:#boolean ui:chk1 default:false
 		checkBox2Flag type:#boolean ui:chk2 default:true
 	)
 )
 custAttributes.add rootNode the_SceneData
 createDialog thisRollout
 

output…
Rollout:thisRollout
– Compile error: Specified rollout not found: thisRollout

1 Reply

I tried moving the rollout description into the attributes, and it compiled (wierd). However, my second test is still on the fritz. If you check one of the boxes, it doesn’t change away from the defaults.



the_SceneData = attributes SceneData
(
	rollout thisRollout "this_Rollout" width:112 height:142
	(
		checkbox chk1 "Checkbox1" pos:[8,8] width:120 height:16
		checkbox chk2 "Checkbox2" pos:[8,40] width:120 height:16
	)
	parameters worldParams rollout:thisRollout
	(
		checkBox1Flag type:#boolean ui:chk1 default:false
		checkBox2Flag type:#boolean ui:chk2 default:true
	)
)
custAttributes.add rootNode the_SceneData
createDialog thisRollout