[Closed] Maxscript Interactive Rollout Creator
Something I threw together when bored on a train.
This is a dynamic Maxscript Rollout editor, so you can adjust annoying little UI tweaks like offset and alignment interactively! It might grow into something slightly bigger which allows dotNet controllers to be added. It can sort of load existing script UIs so you can edit your old scripts. It can deal with groups, offset, across and all control values.
Beginning to look at adding event handlers, local and functions to it so that you can manage your code more easily.
Ironically this has grown far too big to be in one rollout floater now so I need to re-do the UI!
I’ll post a script to play with when I’ve got a few of the bugs out of it.
I actually started to play with editing the layout of the buttons in the rollout creator by using the rollout creator
Ha, I remember reading that Microsoft’s expression blend was written in something like notepad by an dev, up to the point where the interface could write the rest of it’s own interface. It’s software inception. :surprised
I must be the only one who likes and uses the visual maxscript editor?
I’m very close to having this all working but alas I found a problem with my method of digesting a control into it’s type, name, label and then parameters. I was using peakToken and readToken to get them but if you had tooltip:“test this” you’d get three tokens rather than 2. So now I need a regex solution. Daniel Santana has already given it a try but we’re not getting everything thus far.
Here is a hideous example showing how nasty decoding this can be.
Checkbox chk_a “test this” tooltip:“Test this” items:#(“a t,a, a ,”,“b (,b)”,“c:#this “#q,u(o,t)e””) text:“test” label:”test : this % ” and “
Which ideally it should split into the following…
First three are easy to get using readToken
Checkbox
chk_a
“test this”
The next should split into parameter and values.
tooltip
“Test this”
items
#(“a t,a, a ,”,“b (,b)”,“c:#this “#q,u(o,t)e””)
text
“test”
label
“test : this % ” and “
Daniel’s Regex.
(?<control>\w+)\s+(?<name>\w+)\s+(?<label>”[^”\](?:\.[^”\])“)?(\s(?<parameter>\w+):(?<value>((#?\w+|\d+)|([[0-9,.]])|(“[^”\](?:\.[^”\])“))))+
Any regex experts out there who can help break this down?
Yowza. I think writing a parser might take less time than reading that regex.
exactly the same i wanted to say.
also i think you should force using more strict syntax than used in mxs to make your life easier.
for example, one line per control’s parameter
but i still don’t understand what can be easier than just write and edit the code
The script easily makes UIs, you can tweak and adjust offsets and alignments interactively. Which is great when you want to make sure your UI is perfect!
The reason I want it to be able to interpret code is so that anyone can load an existing UI and then adjust it.
Think about all those awful MCG UIs with their default button sizes not matching the command panel width! :arteest:
I think I can make it work with readToken and a bit of clever maxscripting without the need for regex…