Edit Poly Modifier Quick Detach

Hey guys I am trying to create a script that will allow me to detach subobject elements without being asked(options dialog box).

If I understand correctly you can't access the Edit Poly Modifier Detach options? (Detach as element, Detach as clone, ect.)

So I have been playing with some work arounds... Problem is! They both create extremely unstable geometry. They detach fine... but when I go to the newly created object and try to, for example, move the faces or chamfer a vertex... max crashes. On my work computer and home computer.

Any ideas to a better solution or to stabilize what I have?
Any help would be greatly appreciated. Been at this a few nights now.. :(

Work Around #1
- this one adds a second editpoly modifier... detaches with default settings then deletes the second editpoly modifier back off.

OriginalSOL = subobjectlevel
modPanel.addModToSelection (Edit_Poly ()) ui:on
$.modifiers[#Edit_Poly].name = "DetachEditPoly"
 
subobjectLevel = 4
$.modifiers[#Edit_Poly].DetachToObject "Junk"
 
 
DetachModIndex = modPanel.getModifierIndex $ $.modifiers[#DetachEditPoly]
deleteModifier $ DetachModIndex
 
 
EditpolyIndex = ((modPanel.getModifierIndex $ (modPanel.getCurrentObject())) + 1)
modPanel.setCurrentObject $.modifiers[EditpolyIndex]
subobjectlevel = 0
 
select $Junk
subobjectlevel = 4
$.EditablePoly.SetSelection #Face #{}

Work Around #2
- this one duplicates the mesh, takes the new one, jumps into face subobject level, inverts the selection, deletes it. Goes back to the original object, deletes originally selected faces.

OriginalDetachObj = $
OriginalModIndex = (modPanel.getModifierIndex $ (modPanel.getCurrentObject()))
OriginalSOL = subobjectlevel
--
suspendediting()
maxOps.cloneNodes $ cloneType:#copy newNodes:&nnl
select nnl
resumeediting()
 
modPanel.setCurrentObject $.modifiers[OriginalModIndex]
subobjectlevel = OriginalSOL
max select invert
$.modifiers[#Edit_Poly].ButtonOp #DeleteFace
max select all
subobjectlevel = 0
 
while(modPanel.getModifierIndex $ (modPanel.getCurrentObject())) != 1 do
(
	deleteModifier $ 1
)
macros.run "Modifier Stack" "Convert_to_Poly"
 
 
select OriginalDetachObj
modPanel.setCurrentObject $.modifiers[OriginalModIndex]
subobjectlevel = OriginalSOL
$.modifiers[#Edit_Poly].ButtonOp #DeleteFace

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sen's picture

Hi

Are you just try :

subobjectLevel = 4 	
$.EditablePoly.SetSelection #Face #{......}
polyop.detachfaces $ #{.....} asNode:true name:"YourString" -- detach as node 

Don't add modifier , no need .

jeremiah_bigley's picture

hmmm

guess no one has any ideas :/

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.