CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-04-2013, 08:49 PM   #1
yamanash
New Member
portfolio
Kyle
Caledonia, Canada
 
Join Date: May 2010
Posts: 12
Scripting assistance for a remove tool

Hi all, I recently decided to start leaning maxscript. The fist thing I want to tackle is scripting a decent remove tool that works on simple editable poly objects or in the presence of an edit poly modifier.

This is what I have thus far:

Code:
macroScript My_Edge_Remove category: "My Tools" buttonText: "Kyle's Edge Remove3" tooltip:"Remove edges and clean verts3" ( oper=false for x = 1 to $.modifiers.count do ( if ((ClassOf $.modifiers[x])== Edit_Poly) and (oper=false) then if subobjectLevel==2 then $.modifiers[x].ButtonOp #RemoveEdgeRemoveVertices oper=true if subobjectLevel==1 then $.modifiers[x].ButtonOp #RemoveVertex oper=true ) if oper==false then $.EditablePoly.Remove () )


this code seems to work correctly if the object is only an editable poly, however, If an edit poly modifier is added later the script only seems to remove verts when I use it under selection level 1 of this modifier. If I use the script under selection level 2 in the edit poly modifier then there is simply no result, no error message appears on the screen or in the Listener. The same is true if after adding the edit poly modifier I go back down to edit the editable poly level of the hierarchy, though this does yield an "--Unknown system exception" error after a few attempts. If anyone knows how to directly get the currently selected modifier from 3ds max that would be more efficient than looping through and trying to find an Edit_Poly modifier in the hierarchy.

Any help would be greatly appreciated!

Last edited by yamanash : 03-04-2013 at 08:57 PM.
 
Old 03-04-2013, 09:10 PM   #2
Swordslayer
isKindOf Artist
 
Swordslayer's Avatar
portfolio
Vojtech Cada
3D generalist
Czech Republic
 
Join Date: Jun 2006
Posts: 364
Send a message via ICQ to Swordslayer
As for the second part, getting the current object in modifier stack: modPanel.GetCurrentObject()

For the rest be sure to search the forum for posts like this one.
__________________
Blog :: LinkedIn profile
 
Old 03-04-2013, 10:31 PM   #3
yamanash
New Member
portfolio
Kyle
Caledonia, Canada
 
Join Date: May 2010
Posts: 12
Thanks a lot, I have it working now.
 
Old 03-04-2013, 10:31 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:52 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.