[Closed] event functions with rolloutCreator?
I’ve only just jumped into the world of dynamically created rollouts using rolloutCreator. I want to define a function within the rollout so that it can be used to modify the values in the rollout. In the doc’s I can’t find anywhere mentioning how to add functions to a dynamically created rollout. Is this even possible?
One way that I can see that might work is to predefine the whole codestring for the event for the button, and do it that way, but that means if I have multiple buttons that I need to use some of the same functions, then I’ll have to have to define the same code a few times for each button that needs that functionality. Which seems a little awkward and wasteful.
Cheers,
Cg.
Take a look at the lessons on my blog below…
If you’re using RolloutCreator it’s harder to do this sort of function, look at how you can make rollouts in the CreateDialog format instead.
And if you really want to use RolloutCreator then you should be able to have a function for the rollout if you assign it to a new local value… and the init value…
<rollout_creator>.addLocal <string> [init:<value>]
Thanks Dave, the only reason I am using rolloutCreator is I need to create a dialog dynamically. I don’ t know what UI elements I’ll need til it checks what is in the scene. Can the standard createDialog do this somehow? I’ve not checked your blog yet. Headed there now.
Cheers,
Cg.
Hi Dave, I just had a look at your blog, but couldn’t see anything to do with dynamic ui creation. If you were meaning to check your blog for the standard way to create dialogs with contained functions, I’m fine with that, I’ve been doing that for years. Thanks though. But if I missed a section that did talk about dynamic ui creation, could you point me to it?
Cheers,
Cg.
Sorry yes I haven’t covered that on my blog at all.
I’ve found the Dynamic RolloutCreator to be a but annoying to code… I’ve done a different technique before which is just write some code which generates a standard CreateDialog code in a stringstream then executed that stringstream as a string to be like running a new maxscript file. You just start to run in to lots of issues with quotations and % if you need them in your code. Always causes a bit of a headache writing a script which writes a script!
whats wrong with creating a string with the variables embedded, then executing the string on createdialog…works for me but im not quite sure what it is i want to do