Hello, everyone. I've found a topic that is already leading me in the right direction: https://www.blender.org/forum/viewtopic.php?t=28466 However, this script only writes what vertex group contains what amount of vertices. What I would like to do is write out the vertex indices that are used within that vertex group to a…
Hello, everyone. I know this is getting older. After having looked at the Blender Python API, and some other sources on the internet, I have managed to come up with this method of getting the correct vertices from the correct bones - all as integers. Here's the code if anyone wants to use it. I know it's not the nicest…
@MrSquetch good to see you producing, keep going! A recommendation: looping through all vertices of a mesh should be done with extreme care, because it might be a very long loop.In your case it's a magnitude larger, looping through all vertices per each vertex group. If you want to associate a vertex group with the…
You know, I've never ever written a script that didn't have an error in it, hahaha. The error is... That .group attribute is an integer index into the .vertex_groups collection of the object, not a reference to the vertex-group itself. So it should really be this: vertexGroupsExport = {group.name:[ ] for group in…
I managed to get this. It appears to be working properly. I added arrays for bone and vertex IDs, and appended values to them. Here's my edited code: # Armature Test import bpy path = 'C:\\Users\\USER\\Desktop\\User\\Models\\LowPoly\\Model.txt' outfile = open(path, 'w') ob = bpy.context.object bone_ids = [] vert_ids = []…
I'd prefer to have a single collection of all groups, like this: # Armature Test<br>import bpy<br>import json<br>ob = bpy.context.object<br><br>allVertexGroups = {group.name:[ ] for group in ob.vertex_groups}<br>for v in ob.data.vertices:<br> for g in v.groups:<br> allVertexGroups[g.group.name].append((v.index,…