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…
EDIT; Seems like I found the solution already :) Just replace the "EditPolyMod.SetSelection ePoly_obj #Face face_savedSelection" with "Edit_Poly.select ePoly_obj #Face face_savedSelection"..need to test some more, hopefully it wont break anything else. Yeah, this weekend I really feel like wanted to learn some maxscript to…
( -- save SO selection into memory global vert_savedSelectionBA global edge_savedSelectionBA global face_savedSelectionBA if (selection.count == 1) then ( case (classOf $.modifiers[1]) of ( undefinedClass: ( global base_obj = $.baseobject case subobjectlevel of ( 1: ( vert_savedSelectionBA = polyOp.getVertSelection…
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…
This functionality already exists in 3DS Max. 1. With sub objects selected just type a name into the Selection Sets drop down. Then to retrieve a selection just use the drop down list. You can modify stored sub object selections by pressing the button next to the drop down. 2. In the ribbon the Stored Selections Panel. Is…
Dang! that's the thread that started me doing all this maxscript stuff few weeks ago. Read too many pages of words makes me forgot the very first thing that I read which started my journey onto maxscript >_< part of it because back then I have no idea of what fn is and how to use those 2 scripts together, that's why it…
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?…