Notifications
Clear all

[Closed] detach as clone

Hello,I want to ask a question,

(
gmod=modPanel.getCurrentObject ()
gmod.selectByMaterialClear = true
gmod.selectByMaterialID = 2-1
gmod.SetOperation #SelectByMaterial
gmod.DetachToObject #Detachname —-Detach code, I want to know how to change it to detach as clone

How can he use this detach as clone form? Does anyone know? thank you!!

23 Replies

Can someone help me? my friend

you could just modify a bit the code printed in the listener for it to work

$.modifiers[#Edit_Poly].ButtonOp #CloneFace
$.modifiers[#Edit_Poly].SetOperation #Transform
$.modifiers[#Edit_Poly].MoveSelection  [0,0,0] 
$.modifiers[#Edit_Poly].Commit ()

First of all, thank you for your reply. I tested your code and the result was wrong. It did not Detach and clone any selected faces.

gif

UOUktEKa56

Maybe you have to switch to certain selection mode like face or element.

I tested it again and understood the cause of the error. I chose the face by ID,Thank you again for your reply, this is not the result I want

In your case selection didn’t happen and thats why it didn’t work

gif

bZye6pOb4l

(	
	gmod = modPanel.getCurrentObject()
	gmod.selectByMaterialID = 1 -- zero based
	gmod.ButtonOp #SelectByMaterial
	gmod.ButtonOp #CloneFace
	-- gmod.SetOperation #Transform -- if you don't need to move cloned faces it can safely be commented out
	-- gmod.MoveSelection  [50,0,0] 
)

I can’t operate by element, because I want to delete the original object after it detach.

I guess there’s some contradiction present in what you want to achieve.

Page 1 / 3