2
$\begingroup$

when you select a single vertex in edit mode, under item tab, if it has been assigned to vertex groups, there is a Vertex Weights Subpanel. how can I append it to my custom addon tab? more specifically the green part? enter image description here

the closest info I can find is for the Vertex Group Panel where you can append it to a panel class with the following code:

row.template_list("MESH_UL_vgroups", "", ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)

full code here at line 242

Also, for the vertex group I found a keyword "DATA_PT_vertex_groups" which is how I get a link from above. for vertex weight there is a keyword: "PANEL_PT_vertexWeightLayersPanel", I am not sure if it is useful.

$\endgroup$

1 Answer 1

1
$\begingroup$

I found it's implemented through C++ and hard to directly copy it to your own script. In detail, you can look into class view3d_panel_vgroup. Here is my another dumble way to get weight: for vertex in mesh.data.vertices: for group in vertex.groups: if mesh.vertex_groups[group.group].name =='腕.L': print(vertex.index,"w",group.weight) To achieve similar funtion, you can fresh your changes on weight manually by button or other ways.

$\endgroup$
1
  • $\begingroup$ Besides, geometry nodes seem to works better $\endgroup$
    – Kerei
    Commented Apr 4 at 9:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .