AREA forums upgrade
Read more about the planned upgrade of our forums
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Removing edges and vertices for multiple editable poly
IMPORTANT ANNOUNCEMENT ABOUT AREA FORUMS
  RSS 2.0 ATOM  

Removing edges and vertices for multiple editable poly
Rate this thread
 
68872
 
Permlink of this thread  
avatar
  • Total Posts: 41
  • Joined: 28 March 2007 10:57 AM

Please could you help me loop this script. It works on one editable poly but i want it to work on multiple ones. Thanks

for =  1 to selection.count do
(
max modify mode
subobjectlevel
2
i
.remove ()
subobjectLevel 0
 
)


3dmaxdesign 2011 64-bit
i7 2600 windows 7 64-bit
quadro 600

Replies: 0
avatar

Not possible because you can only select sub-object level when you have a single object selected.

Also, I don’t quite understand what you’re trying to do…

Selection is a built-in collection of the objects you currently have selected, not the edges within those objects, so you’re looping over the objects, but you’re not selecting any edges to remove.

Look in the help for Remove - there’s no need at all for the Max Modify and using it will slow down the procedure horribly. That also shows that you need to create a bitarray of vertex (or in your case, edge) numbers to remove.

If you could explain what you’re trying to achieve it might help.



Max 4.2 through 2014, Composite 2014.
XP-64 (SP2).
nVidia 9800GTX+ (512MB) (Driver 314.22).
i5-3570K @ 4.4GHz, 8Gb Ram, DX9.0c.

Replies: 1
/img/forum/light/default_avatar.png

Thanks for your quick reply

I have selected a number of editable poly objects which have already got their edges selected once i go to subobject level 2.
if i run the code on a single editable poly object it runs fine and removes the edges and vertices too as i have the ctrl key pressed.  but i want to achieve this on many editable poly objects

Author: hanselmoniz

Replied: 05 July 2012 08:11 AM  
avatar

for obj in selection do
   
obj.EditablePoly.Remove #Edge

IMO the results are not what they could be - deleting the edges gives better results than removing them. Same if you do it manually - it’s not the fault of the script.



Max 4.2 through 2014, Composite 2014.
XP-64 (SP2).
nVidia 9800GTX+ (512MB) (Driver 314.22).
i5-3570K @ 4.4GHz, 8Gb Ram, DX9.0c.

Replies: 0
avatar
  • barigazy
  • Posted: 05 July 2012 10:37 AM

Hope this is what you want

max create mode
(
   
local getSelEdges polyop.getEdgeSelection
   local getEdgesVerts 
polyop.getVertsUsingEdge
   local setEFlags 
polyop.setEdgeFlags
   local setVFlags 
polyop.setVertFlags 
   
for obj in selection where iskindof obj Editable_Poly do
   (
      
local seledges getSelEdges obj
      
if seledges.numberset != do
      (
         
local bitE bit.set 0 30 true
         setEFlags obj seledges bitE
         local selverts 
getEdgesVerts obj seledges
         setVFlags obj selverts bitE
         obj
.EditablePoly.remove selLevel:#edge flag:bitE
         
obj.EditablePoly.remove selLevel:#vertex flag:bitE
      
)
    )
 )


Replies: 1
/img/forum/light/default_avatar.png

Thanks a lot!!! This worked like a charm…

Author: hanselmoniz

Replied: 05 July 2012 06:21 PM  
avatar
  • barigazy
  • Posted: 05 July 2012 08:37 PM

My pleasure :)



Replies: 0