Notifications
Clear all

[Closed] Adding a number of spinners to a custom attribute

Hi there,

I’d like to add a large number of spinners to a series of custom attributes and I’m really not sure how to get it working. I’d really like to be able to make a for loop that adds a new slider to the custom rollout each cycle but I’m not sure this is possible since it seems you have to add the whole rollout in one hit…

If anyone who knows a little about Custom attributes could help me out with this it would be great

Any ideas?
Thanks
Pete

2 Replies

Try this one


spinsCount = 10
myCAstr = "attributes mySpins (
"
myCAstr += "	parameters main rollout:spins_rollout (
"
for i=1 to spinsCount do myCAstr += "		spin_"+i as string+" type:#float ui:my"+i as string+"_spn
"
myCAstr += "	)

"
myCAstr += "	rollout spins_rollout \"Spins\" (
"
for i=1 to spinsCount do myCAstr += "		spinner my"+i as string+"_spn \"MySpinner_"+i as string+"\" 
"
myCAstr += "	)
"
myCAstr += ")"
myCA = execute myCAstr
custAttributes.add $ myCa

Cheers,
Nick

Awesome! Thanks sinokgr, that’s perfect!