I actually commented on the built in methods so that you might research the maxscript behind them. My first step in creating any tool is to see if it already exists. For example. the two scripts below are shorter and avoid extra global variables. ( if selection.count == 1 do ( subLevel = case subobjectlevel of ( 1: 1 2: 2…
Sorry, quick question; from the above example which one do you guys prefer to write from bellow option and why? case subLevel of( 1: case curMod of ( baseMod: -- content editMod: -- content ) 2: case curMod of ( baseMod: -- content editMod: -- content ) 3: case curMod of ( baseMod: -- content editMod: -- content )) OR case…
Whoops error on my part. I assigned the gRevel variable to Revel_Struct() but it's not visible outside those brackets. So its returning undefined. Fixed here:--global scope here... define our single global variableglobal gRevel( -- In local scope here because of our brackets. Define our struct to contain all our functions…
Hi Bryan, that's too complex for me to understand for now O_O Haven't really read anything about defining a function though, so might come back here in the future after I more familiar with function :) Anyway, is it a good idea to define these codes below as a global on 1 file for other scripts use? So I don't have to type…
Oh wow! that's an interesting approach with the 'case of' stuff. Yeah I notice the script that I wrote most of the time are duplicating within the script itself just because Editable Poly and Edit Poly are slightly different in maxscript. Looking at your example I will be able to do it like bellow I suppose; macroScript…
Revel: I would suggest going through the help file tutorials, they are good at explaining the basics of scope and local/global variables. If you want to use globals then try to give them a more personal variable name to prevent other scripts from overriding them. What if you installed another script that used xCurMod?…
Alright, thanks Bryan, you are a genius! :) Found something that doesn't work with the previous code and manage to make it to work properly, but thought I'd like ask the other experienced maxscripter of what's actually going on here; The problem is on the keyPressed, if I use the code;ctrl: (keyboard.controlPressed and not…
There's nothing wrong with either of those methods from what I can see. They do the same thing so its what ever you prefer. Now as far as the actual code you're writing and what you're trying to accomplish? That can be improved upon but it of course takes time and experience. I'm still learning everyday. I'm sure this code…