Notifications
Clear all

[Closed] function for selecting skin verts by bone?

Title says it all really, I’m trying to quickly select all verts affected by a particular bone in the skin modifier.

Any help would be appreciated!

3 Replies

Anyone? I’m really struggling with this.

 PEN

 	fn getAffectedVerts skinMod boneID=
 	(
 		vertAr=#()
 		numVerts=skinOps.getNumberVertices skinMod
 		for i = 1 to numVerts do
 		(
 			numBoneAffectVert=skinOps.GetVertexWeightCount skinMod i
 			
 			for boneNum = 1 to numBoneAffectVert do
 			(
 		    	sysBoneID=skinOps.GetVertexWeightBoneID skinMod i boneNum
 				if sysBoneID==boneID then append vertAr i
 			)
 		)
 		vertAr
 	)
 	fn selectAffectedVerts obj=
 	(
 		boneIndex=skinOps.getSelectedBone obj.skin
 		affectedVerts=getAffectedVerts obj.skin boneIndex
 		skinOps.selectVertices obj.skin affectedVerts
 	)
 

Brilliant, thanks Paul, I was almost there, but your code has cleared up where I was going wrong.

Thanks again.