Notifications
Clear all

[Closed] EditMesh equivalent for polyop.getFaceSelection and polyOp.detachFaces

I wrote this to duplicate selected faces in SubObject

Could someone pelase help me fix the selection part inside Editable_Poly?

What are the equivalent to select and to detach faces for Editable Poly and Editable Mesh modifiers?
Couldn’t find those.

if selection.count == 1 then
(
if classof $.baseobject == Editable_Poly then
(
elo = polyop.getFaceSelection $
$.EditablePoly.SetSelection #Face #{} –deselect
polyOp.detachFaces $ elo delete:false asNode:false
– here I need to select the newly created faces
)
else (
if classof $.baseobject == Editable_mesh then
(
elo = $.selectedFaces
meshop.detachFaces $ elo delete:false asMesh:false
)
else ()
)
)
else
(
messagebox “Nothing to clone. Please select a face or element.” title:“Selection needed”
)

5 Replies

For face selection:
getFaceSelection obj (so just exclude the polyOp portion)

For detach:
meshop.detachfaces obj #{5,6} delete:on asmesh:on

I am afraid you misunderstood me.
In Editable Poly, I managed to clone my selection into a new set of polygons. However, I wanted to the NEW meshes to be selected.
For reference, in Editable Mesh, the cloned mesh gets selected automatically, so no need to select anything here.

If on the other hand you meant this is how you select faces in the Edit Poly (which was one of my questions) modifier, then my answer is that it doesn’t work.

What is this for? I am already using meshop.detachfaces, am I not?

A weird thing I discovered about adding an Edit Mesh modifier on top of an Editable Mesh is that the detach happens on the Editable Mesh below the Edit Mesh modifier. It defies the purpose of having a modifier if the alteration happens on the node below it…

Forget about this one. You’ll have to emulate user actions (click or press buttons) in order to make it work.

I also do not see any reason to use the Edit Mesh modifier.

Ah, so you meant the Edit_Mesh modifier (there’s not such thing as an “Editable Mesh modifier”). I was just stating the commands for a standard Editable Mesh as your terminology was a bit confusing.

The Edit Mesh modifier is a black box as far as I’ve ever been able to tell, and there’s no real documentation on it. However, you can get the face selection in an Edit Poly modifier (please don’t call it the “Editable Poly modifier”) like this:

curObj = (selection as array)[1]
curMod = modpanel.getCurrentObject()
curMod.getSelection #Face node:curObj