PDA

View Full Version : Visual MAXScript: Does it actually save time?


Jon Huhn
10-22-2005, 07:03 AM
I've edited my original post after realizing that the answer to my question was right in the Maxscript reference under the Visual Maxscript category. I ALWAYS check the referene extensively before asking a question, but this time for some reason that fell through the cracks. Sorry! My original post was this:


I've found VMS to be a great tool for learning how to script UI elements, but for actual development it seems rather impractical for these reasons:

1) I can't just hit a button and have the script generated for me. I have to save the .vms file as an .ms and then open that new file, and copy and paste it into my working script. So any changes I make, I have to first save as .vms, then .ms.

2) When VMS generates UI event handlers, sometimes the ( ) around the code aren't indented correctly. This adds an extra step to the already cumbersome process described in item #1 above.

I'm curious how you experieced MaxScripters use VMS in your development workflow (or IF you do.)

Thanks!

antonv
10-22-2005, 08:26 AM
You can edit a script in VMS by pressing F2 but make a copy of your script before because most of the time it will change more than you need. What I do is copy the UI part in a new script and edit it that way, which is a bit cumbersome but it does the job...

There is a tutorial on scriptspot.com which describes more on the VMS subject. Here is the link:
http://www.scriptspot.com/Tutorials/ChrisJohnsonVisualMXS/VisualMaxscriptTutorial.htm

I am curious on what's new in MAX 8 regarding the VMS. Anyone who got their copy of 8 has any insight?

Jon Huhn
10-22-2005, 08:59 AM
Yeah, I noticed when I hit 'F2' to edit en existing rollout definition, upon saving, a few characters are deleted from my original script right after the ending ")" in the new definition. That means if I had code after the rollout definition, it starts to be deleted character by character every time I edit and save the definition in VMS.

stuh505
10-22-2005, 03:05 PM
I find VMS very helpful for laying out the UI...it's much better than, say, drawing a mockup in paint and then measuring the coordinates of each element. I just throw things together in VMS, export to MS, and copy/paste into my regular code

eek
10-23-2005, 02:23 AM
Isnt that deletion at the end part of a fix extension wahooney wrote awhile back?

eek

Wahooney
10-24-2005, 06:50 AM
Yes it does :)

I don't know why Autodesk didn't fix that in Max 8... I'm sure they must've noticed it by now!

j-man
10-24-2005, 09:03 AM
I seem to remember that AME are no longer developing VMS, so I wouldn't expect any updates whatsoever. I always found it to be a little more hassle than it was worth, and I didn't manage to develop a good workflow using it.



Wahooney
10-24-2005, 09:08 AM
Purely hard coding rollouts is a bit too much of a mission for me. And the automatic layout (using across: and all that lot) is unreliable at best.

If I read the online manuals correctly AME are planning on improving the scripting user interfaces in max, perhaps a new VMS is part of that? Besides, discreet didn't even write VMS it was bought/borrowed/whatever from Asylum Software. Maybe they want something over which they have more control, adapting third party code isn't always the most pleasant or easy of things to do.

j-man
10-24-2005, 09:40 AM
I seem to remember a big conversation at the descreet board about someone else developing the code since the original developers were no-longer interested but I don't know what happened. If AME are developing something new then as long as it's more reliable the VMS then great!
I found it more trouble than it's worth. You get use to writing you own rollouts pretty quick when you do itall the time. I use templates and cut and paste fromt things I've written before

Cheers,

Josh.

Bobo
10-24-2005, 01:13 PM
Besides, discreet didn't even write VMS it was bought/borrowed/whatever from Asylum Software. Maybe they want something over which they have more control, adapting third party code isn't always the most pleasant or easy of things to do.

I think this is not entirely correct.
Simon Feltman was Max Developer at Discreet around the time he developed the VMS for R4. His own company was Asylum Software. I assume he wrote the VMS as a side project and Discreet licensed his code to make it part of the release.
After googling for "Simon Feltman Asylum", I found this:
http://microsoft.ease.lsoft.com/scripts/wa-msn.exe?A2=ind0003a&L=mfc&T=0&F=&S=&P=2859
It is dated March 6th, 2000, just when VMS was written... :)
Of course, Simon might have left Discreet shortly before writting VMS, in that case you would be technically right...

Wahooney
10-24-2005, 01:16 PM
Ok, so that's the story, I just read the header in the CPP files crediting Asylum Software as the creator.

Bobo
10-24-2005, 02:06 PM
Ok, so that's the story, I just read the header in the CPP files crediting Asylum Software as the creator.

Forgot to mention - I have never used VMS myself and don't intend to...

stuh505
10-24-2005, 02:56 PM
Nice detective work...I was half expecting to read "and my 3rd bug is that it keeps deleting the last few characters"...but that would just be too funny. If you guys don't use VMS, how do you design the placement of items on your GUIs?

Bobo
10-24-2005, 03:25 PM
If you guys don't use VMS, how do you design the placement of items on your GUIs?

Just like we used to design HTML pages back in 1995 - by hand, of course :)
Infact, it is one of my favorite parts of scripting. I use automatic placement and offsets, almost never absolute positions.

j-man
10-24-2005, 04:29 PM
I use automatic placement and offsets, almost never absolute positions.

same here.

Stuh505 have a look at a couple of my maxscript challenges for a good example if you like:

www.joshuanewman.net/scripts/download/laserwars.zip (http://www.joshuanewman.net/scripts/download/laserwars.zip)

www.joshuanewman.net/scripts/download/tangra-lightning_generator.zip (http://www.joshuanewman.net/scripts/download/tangra-lightning_generator.zip)

I't no where near as hard as you may think, but you have to keep executing and adjusting. I kick myself sometimes about moving things around by one pixel < ; sometimes you just have to let things go!


stuh505
10-24-2005, 05:00 PM
Josh, the lightning script is awesome! (ever think of making it animated? :D )
Still, I think you guys are just being stubborn about VMS...if you just use it to draw your GUI elements on, export to ms, and paste that into your code...you don't have to worry about tweaking it at all, and it takes all of about 5 seconds.

I have made GUI's without a designer before, usually what I would do is draw the GUI in photoshop, then measure the coordinates of each button or element and write them all down...but this isn't nearly as good or as easy to tweak as VMS.

If you need to tweak it, just tweak the vms file and re-export to ms. For this reason it is worth it to name the UI elements in the vms editor so that you don't have to worry about re-naming each time you want to tweak.

Well, you dont have to like it, but it works great for me and saves me tons of time!

Wahooney
10-25-2005, 05:37 AM
I use automatic placement alot too, in fact in many cases I prefer it to VMS, but sometimes it just doesn't give the results you'd expect, especially when using across with different sized objects, resulting in overlapping and such.

ie.
(
rollout ro "Rollout"
(
button btn01 "Button01" width:16 height:16 across:4
button btn02 "Button02" width:32 height:16
button btn03 "Button03" width:48 height:16
button btn04 "Button04" width:64 height:16
)
createDialog ro
)
It's an extreme example, but it show's what I mean.

I'd also like an across function for groups.

j-man
10-25-2005, 08:58 AM
[QUOTE=stuh505]Josh, the lightning script is awesome! (ever think of making it animated? :D ) /[QUOTE]

Thanks!! :D

and yes, I planned to from the start but you know how things go! I haven't had time for any scripting recently but I like it enough to come back to it so it's only a matter of time!

Maybe I'm a little more slap-dash when it comes to designing the interface. I studied design so I've got an idea about it but I also think having a large resource of scripts behind me helps as I can cut and paste a bit, and most of my scripts are a similar width (260) so you kind of know what will fit across anyway.
I found VMS added loads of stuff I didn't want, adjusted the formatting in a way that I couldn't read easily and also broke code.
Maybe I will try it again later.


PEN
10-25-2005, 12:32 PM
I'm the same as Bobo, maybe because I creadit Bobo with teaching me Max script. I just use the automatic methods and offsets and avoid ever using the absolute ways. I find that if I ever want to add in another UI item it just sorts it self out but if I use absolute I have to rearange it all. Even if I were to use VMS it would be more work. I also find that is makes a mess of the UI creation as many people have found including if you add another control in the middle of the UI layout it still just adds the code to the bottom so you have to move that around as well. I find it more of a pain then just coding it. And again I'm with Bobo, I like making the UI's

Light
10-25-2005, 09:35 PM
same here.

Stuh505 have a look at a couple of my maxscript challenges for a good example if you like:

www.joshuanewman.net/scripts/download/laserwars.zip (http://www.joshuanewman.net/scripts/download/laserwars.zip)

www.joshuanewman.net/scripts/download/tangra-lightning_generator.zip (http://www.joshuanewman.net/scripts/download/tangra-lightning_generator.zip)

I't no where near as hard as you may think, but you have to keep executing and adjusting. I kick myself sometimes about moving things around by one pixel < ; sometimes you just have to let things go!



On the opposite side, I always use absolute positions simply because automatic placement doesnt position the controls exactly where I want.

Sometimes I also push hard to move a control one pixel, by using this app as well:

http://www.downlinx.com/proghtml/84/8429.htm

Check out Pola X to see a prime example.





Light

j-man
10-26-2005, 10:34 AM
Light,

your interface is packed tight with so many goodies you would have to use absolute co-ordinates! :) can't see your app unfortunately, 'policy denied' (damn firewall) Might have a look at home later.

Cheers,

Josh.

Light
10-26-2005, 08:51 PM
Light,

your interface is packed tight with so many goodies you would have to use absolute co-ordinates! :) can't see your app unfortunately, 'policy denied' (damn firewall) Might have a look at home later.

Cheers,

Josh.

That's right. The interface looks like this:

http://www.orionflame.com/Light/Super%20Magnify.png




Light

Wahooney
11-01-2005, 08:26 AM
I believe Autodesk has big plans for maxScript, which may(or may not) include a new VMSE.


From Max 8 Help File
"The MAXScript debugger implements the first half of a script development and debugging environment."

f97ao
11-25-2005, 07:13 AM
I always use MaxScript, and for semi complex interface it would be very time consuming not to imho.

There are a few problems with the visual maxscript you have to know though, if you know how to avoid these problems it will definetly be able to save alot of time. I can put up a pic of the new PolySpeed interface if you like, to put those buttons by hand would be quite dreadful.

Problems:
1) You can have no variables to the the controlers. For example you cannot write checkbutton chb_pressMe caption:"Press" *** checked:checked_variable ***

To solve this, all changes to the controller should be done in the Open event:
on rol_Rollout open do
(
chb_PressMe.checked=checked_variable
)

2) As you know, the visual interface can easily eat the last line below the rollout. Just add a few lines with comments below it.

3) Be careful with copying buttons that have events in the visual editor. The events will be copied too.

It really depends on what kind of interface you have if the visual maxScript editor should be used. I only use it to place my buttons, and sometimes copy them etc, but I don't use it for anything else.

/Andreas

Wahooney
11-25-2005, 08:43 AM
I'd actually like a VMS that places controls and generates codes as you would using the relative method. (across, offset, etc)

CGTalk Moderation
11-25-2005, 08:43 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.