Select Hard Edges(the green ones)

Hello guys,

I need to select Hard Edges.

I saw a similar post selecting hard edges defining a minimum and maximum angle between faces but this is not what I need.

Imagine you have a 32 segment sphere converted to Editable Poly and you randomly declare 2 edges ¨Hard¨, using the Hard button on the Edit Edges rollup. You can see those edges in green if you click on Display Hard Edges, but you wont be able to automatically select them either by angle nor by change of the smoothing groups.

If there´s a way to select those green edges, that would be great.

Thanks.

AttachmentSize
sphere.png109.59 KB

Comments

Comment viewing options

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

.

macroscript macro_SelectHardEdges
category:"miauu"
tooltip:"Select Hard Edges"
buttonText:"Select Hard Edges"
(
	on execute do
	(
		if selection.count == 1 do
		(
			if classOf (curO = selection[1]) == editable_poly do
			(
				subobjectlevel = 2
				curO.selectHardEdges()
			)
		)
	)
)
fzxj520's picture

How to select the edge with

How to select the edge with Crease value greater than or equal to 0.5 ?

miauu's picture

...

(
	creaseVal = 0.5
	poGetEDataValue = polyop.getEDataValue
	if classof (obj = selection[1]) == Editable_Poly do
	(
 
		numEdges = polyop.getNumEdges obj
		edgToSelBA = #{}
		for i = 1 to numEdges where (poGetEDataValue obj 2 i) >= creaseVal do edgToSelBA += #{i}
 
		max modify mode
		subobjectlevel = 2
		polyop.setEdgeSelection obj edgToSelBA
		redrawViews()
	)
)
fzxj520's picture

Thank you very much, it's

Thank you very much, it's great!
Can you make it work for Edit Poly Modifier too?

I tried to replace the corresponding Edit_Poly code, but I couldn't find it in MAXScript Help.

My modified script ‘ Quick Set Edge crease ’

(  obj = modPanel.getCurrentObject() if obj != undefined then
     (
         case (classof obj) of
         (
             Edit_Poly:
             ( obj.setOperation 86 ; obj.dataChannel = 1 ; obj.dataValue = 1 ; obj.Commit ())
             Editable_Poly:
             ( obj.setEdgeData 1 1 )
         )
     )
 ) 
miauu's picture

...

(
	creaseVal = 0.5
	poGetEDataValue = polyop.getEDataValue
	obj = modPanel.getCurrentObject()
	selO = selection[1]
 
	case classOf obj of
	(
		Editable_Poly:
		(
			numEdges = polyop.getNumEdges obj
			edgToSelBA = #{}
			for i = 1 to numEdges where (poGetEDataValue obj 2 i) >= creaseVal do edgToSelBA += #{i}	
			subobjectlevel = 2
			polyop.setEdgeSelection obj edgToSelBA
		)
		Edit_Poly:
		(
			numEdges = obj.getNumEdges()
			edgToSelBA = #{}
			for i = 1 to numEdges where (poGetEDataValue selO 2 i) >= creaseVal do edgToSelBA += #{i}	
			subobjectlevel = 2
			obj.SetSelection #Edge #{}
			obj.Select #Edge edgToSelBA
		)		
	)
	redrawViews()
)
fzxj520's picture

Grateful for that! :):):)

:):):)

x_OL's picture

Comment viewing options

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