Notifications
Clear all

[Closed] EditablePoly "Remove"

After many times going back and forth between modes, i made a script that allows you to use editable poly’s “remove” command, from either poly or mesh mode. The problem is, its not performing it as fast as i would like. Could someone take a look at this code to see if there is a way to optimize it, or at least make it a little cleaner. I’m still learning MaxScript so my coding is not the best.

(
if $selection[1]== undefined then
(
messagebox “select an object”
)
else
(
if $.classID[1] == 469250957 then
(
$.EditablePoly.Remove ()
)

else
(
  --if in mesh mode, convert to poly, and perform action
  Level = subobjectLevel
  macros.run "Modifier Stack" "Convert_to_Poly"
  subobjectLevel = Level
  $.EditablePoly.Remove ()
  convertToMesh($)--convert back to mesh
  subobjectLevel = Level
)

)
)

3 Replies

Hi,

Try using selection[1].remove()

As for Editable Mesh, there is no remove command for it. Do you mean Delete?

Light

I didn’t know you could just remove with the selection command. Thanks

“Delete” in Mesh mode also deletes the face, if i’m not mistaken.

What i’m trying to use my code for is to basically be able to use the “remove” command…to get rid of edges and verts, in either poly or mesh mode.

My code does this, but basically i’m asking if there is a faster, more efficient way to do it, the from what I have above. The part i’m looking to make more efficient is below.

  else
  (
    --if in mesh mode, convert to poly, and perform action
    Level = subobjectLevel
    macros.run "Modifier Stack" "Convert_to_Poly"
    subobjectLevel = Level
    $.EditablePoly.Remove ()
    convertToMesh($)--convert back to mesh
    subobjectLevel = Level
  )

You could run into potential problems converting a mesh object to a poly object. It’s possible that the geometry will change because there are certain things you can do with a mesh, like have more than two faces connected to and edge, that you can’t do with a poly. Just something to be aware of.