knowing selection of an -element sub-object level- vertices count

hallo,

i'm very new to scripting and currently i had to subdivide a very big mesh by element that have a maximum number of vertices of a uint (65536) value.

but when i select part of the elements i can get only the number of faces selected.

how i could achieve this?

currently i select the subobjectlevel 5 (element) for a mesh

with $.basemesh.mesh. i access the mesh, but how i get the element sub-selection (the selected part of the selected mesh)?

thank you for your time and have a good year.

Comments

Comment viewing options

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

thank you for your script,

thank you for your script, miauu, it works very well

cheers!

c++ only

miauu's picture

.

The code below will works only with Editable POly or editable Mesh objects. You must be in Element sub-object level and you must have several polygons selected.

(
	curO = selection[1]
	if classOf curO == Editable_Poly then
	(
		if subobjectlevel == 5 do
		(
			--	"get selected polygons"
			selPolysBA = polyop.getFaceSelection curO
			--	"get the verts that belongs to the selected polygons"
			vertsBA = polyop.getVertsUsingFace curO selPolysBA
			--	"print in the MaxScript Listener the count of the vertices"
			format "Verts count: % \n" vertsBA.numberset
		)
	)
	else
	(
		if classOf curO == Editable_Mesh then
		(
			if subobjectlevel == 5 do
			(
				--	"get selected polygons"
				selPolysBA = getFaceSelection curO
				--	"get the verts that belongs to the selected polygons"
				vertsBA = meshop.getVertsUsingFace curO selPolysBA
				--	"print in the MaxScript Listener the count of the vertices"
				format "Verts count: % \n" vertsBA.numberset
			)
		)
	)
)

Comment viewing options

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