Get vertices affected by soft selection


#1

Hey!
I need to get vertices (all affected), when i use soft selection. By default if i use getVertSelection i get only manually selected vertices. I tried to find information about this but failed… There is no solution in the maxscript help(
Can someone please help with a solution?


#2

polyop.getVDataChannelSupport & polyop.getVDataValue
meshop has similar methods as well


#3

Thnx man, work fine))
Maybe you know how do same with modifier #Edit_poly ??


#4

I guess you could disable all modifiers above edit poly and use snapshotasmesh to get trimesh and use meshop getVSelectWeight/getVDataValue method


#5

Maybe it will be usefull for someone. So i put code here

fn f_GetAffectedBySoftSelection mesh_obj treshhold:0.0 onlyNum:false =(
	local getVData = case (ClassOf mesh_obj) of( (Editable_Poly):(polyop.getVDataValue); (Editable_mesh):(meshop.getVDataValue); default:(undefined))
	if getVData != undefined then(
		local softArray = #()  --- #(#(p_index, weight),#(p_index, weight).....)
		max modify mode; select mesh_obj
		modPanel.setCurrentObject mesh_obj; subObjectLevel = 1
		----------main loop-----------
		v_count = mesh_obj.verts.count
		for vNum=1 to v_count do(
			p_weight = getVData mesh_obj 1 vNum ---get vert weight
			if p_weight > treshhold do if onlyNum then append softArray vNum else append softArray #(vNum, p_weight)
		)
		subObjectLevel = 0
		softArray
	)else(print "Unknown object type. Function work only with Editable_Poly OR Editable_Mesh.")
)

f_GetAffectedBySoftSelection $ treshhold:0.75