regardless of edtiable poly and editable mesh , how can i clear smothing group

if i select objects editable meshs or editable polys
i would like to clear smoothing groups

can you help me again ?
thank you always

Comments

Comment viewing options

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

With this fn you can clear

With this fn you can clear SG, set Mtl id to 1 and triangulate EditablePoly objects.

fn clearSmoothAndID = if selection.count > 0 do
(
	local setSG = polyop.setFaceSmoothGroup, setFID = polyop.setFaceMatID, retriangulate = polyop.retriangulate	
	for o in selection where isKindOf o Editable_Poly do
	(
		e = #{1..o.faces.count}
		setSG o e 0 ; setFID o e 1 ; retriangulate o e
	)
)

bga

miauu's picture

.

Try this:

macroscript miauuClearSmoothingGroups
category:"miauu"
tooltip:"Clear SGs"
buttonText:"Clear SGs"
(
	if selection.count != 0 do
	(
		for o in selection as array do
		(
			case classOf o of
			(
				Editable_Poly:
				(
					(
						o.selectedfaces = #{1..o.numfaces}
						o.setSmoothingGroups 0 -1 1
					)
				)
				Editable_Mesh:
				(
					facesBA = #{1..o.numfaces}
					o.selectedfaces = facesBA
					for f in facesBA do
						setFaceSmoothGroup o f 0
					update o
				)
			)
		)
	)
)
MaximuM's picture

Great !!

It is just what I was looking for ! Thank you so much miauu !!

dussla's picture

really really thank you

very kindly , very good working
thank you ~

miauu's picture

.

Glad to help. :)

miauu's picture

.

How you doing this manualy?

dussla's picture

yes manua is good , but

i worked many times modfiction from cad
so i need that

Comment viewing options

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