PDA

View Full Version : A couple tricky UI questions


stuh505
09-28-2005, 06:01 AM
1) In Maxscript can you dynamically generate variable names?

eg, could add controls to a rollout using a loop, or create variables dynamically from strings (same thing).

2) This extends from the first question...but can you add/remove controls to a rollout that has already been initialized?

erilaz
09-28-2005, 06:47 AM
1) Why would you want to dynamically create variables? Couldn't you just use an array?
2) You can add and remove rollouts and subRollouts, but i'm not sure about elements within the rollouts themselves.

stuh505
09-28-2005, 07:13 AM
1) Why would you want to dynamically create variables? Couldn't you just use an array?

No. In some programming languages you can dynamically (while it is running) generate variable names. This gives a lot of power...for example, I could easily use a loop to create buttons on a panel in a specific mathematical position using only a few lines of code, instead of defining each button with extra lines of code.

2) You can add and remove rollouts and subRollouts, but i'm not sure about elements within the rollouts themselves.

Yeah you probably can't do it. I wanted to have certain controls on my rollout be used to duplicate other controls.

rdg
09-28-2005, 11:18 AM
To create ui controls take a look at the
RolloutCreator Functions.

To create variables dynamically, you could use execute?

Georg

j-man
09-28-2005, 11:34 AM
can you add/remove controls to a rollout that has already been initialized?

Generally you remove the rollout, modify the contents, and then add it back on. Not exactly what you wanted but there it is.


CGTalk Moderation
09-28-2005, 11:34 AM
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.