How to store last subobjectLevel ?
Hi,
Ive been using melscript for close to 8 years and Im currently learning maxscript.
I would like to know how to store the currently-used subobject level (1-5) into a variable...It would be used in this fashion:
Suppose user "A" is in subobject level 1 (vertex)... he presses a hotkey ("d"), and he is returned to the top-level....if he presses "d" again, it will go to the last-used subobject level he was previously in, in this case; 1 (vertex).
How would I go about scripting this? I will be able to learn from this post enough so I can manage from then on!
Thanks for your time,
David
Comments
wow
This is exactly what I wanted to achieve! Thank-you very much...I will study your code and learn from that!
David
Go to the script thread and
Go to the script thread and read the post #1.
You can uninstall the script because there is built-in max command for that - ctrl+B.
:)
Tools and Scripts for Autodesk 3dsMax
Here the script.Бут, I am
Here the script.
Instead of using the ini file you can create a dummy and write the sol to it userproperties, but, I am sure that Anubis can offer you a much better solution. :)
Tools and Scripts for Autodesk 3dsMax
nice work
Thanks for the nice words about me :) You done good job so hardly need to harm my brain on this task :) Yep, am too like working with ini files, but how (and when) to store settings is dependent on the case. Maybe for this task one temp global variable is a quite enough?
Well, am a bit busy right now but see some points for improvement, so end with some quick script (attached):
I made some restrictions, only those that necessary, to avoid errors. Also used Swap function, so the final functionality is more like "undo-last" subObject level. Im not sure is that follow strictly David request, but lets hope its useful anyway :)
Cheers!
my recent MAXScripts RSS (archive here)
A bit more help
I tried this but it doesnt switch the subObject mode to the int iSub
-- SubObjectModeToggle
-- v1.0
macroScript DaveTools_SubObjectModeToggle
category:"DaveTools"
toolTip:"SubObjectMode Toggle"
global iSub = 0
function DaveTools_SubObjectModeToggle =
(
--print global iSub
if subObjectLevel == 0 and iSub != null then subObjectLevel = iSub
iSub = subObjectLevel
if subObjectLevel != 0 then subObjectLevel = 0
if subObjectLevel != 0 then subObjectLevel = 0
--print global iSub
)-- end - function DaveTools_SubObjectModeToggle
subObjectLevel
subObjectLevel
(read/write) system global variablemy recent MAXScripts RSS (archive here)