Previous Thread  Next Thread

chat icon Adding vertex groups and weights

Envil

Posted: Sun Nov 25, 2012 3:14 pm
Joined: 25 Nov 2012
Posts: 2
I'm trying to write an importer script and managed to import the mesh and bones so far. Now i want to add vertex groups to the mesh and assign the weights to each vertex. Apparently the weights are stored in VertexGroupElement's for each vertex in the mesh, but this is marked as read-only so how would i add new ones? And how can i add the vertex groups to the mesh first of all? The documentation seems a bit lacking on examples or I'm to blind to find the right stuff Razz
Reply with quote


Envil

Posted: Sun Nov 25, 2012 9:28 pm
Joined: 25 Nov 2012
Posts: 2
Well found it ^^
Code:

vg = obj.vertex_groups.new("group name")
vg.add([vertice index], weight, "ADD")

obj being the mesh object.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group