Notifications
Clear all

[Closed] Trying to get Inset+Collapse to work together

$.EditablePoly.buttonOp #Inset
$.EditablePoly.collapse #Face

Executing these lines separatly in the script listener does what I want, but if I execute both these lines at the same time, Max just skips inset and goes directly to collapsing my face selection – why?
Also adding $.insetAmount = 1.0
…at the start does nothing.

3 Replies

(
	$.EditablePoly.buttonOp #Inset  
	ps = polyop.getFaceSelection $
	polyop.collapseFaces $ ps
)

Okay thanks – that sure does the trick.
I would like to avoid having to reselect the insetted faces though. Tried this but it doesn’t execute:


(
	$.EditablePoly.buttonOp #Inset
	centerSel = polyop.getFaceSelection $
	macros.run "Ribbon - Modeling" "GrowSelection"

	faceList = #()
	faceNum = polyop.getNumFaces $
	for i = 1 to faceNum do
	(
		append faceList i
	)
	polyop.collapseFaces $ centerSel
	polyop.setFaceSelection $ faceList
)
-- Argument count error: setFaceSelection wanted 2, got 1

Try this, although I am unsure if it will do what you need as it is unclear to me what that should be:

(
 	allFaces = #{1..$.numfaces}
 	selectedFaces = polyop.getfaceselection $
 	
 	$.insetType = 0		
 	$.insetAmount = 2.0
 	$.EditablePoly.buttonOp #Inset
 
 	polyop.setfaceselection $ (#{1..$.numfaces} - allFaces)
 	polyop.collapseFaces $ selectedFaces
 )

PD: A test case or an image describing your goal would help to work this out better.