1
$\begingroup$

Pretty simple question, it's pretty easy to create a new vertex group using bpy.ops.object.vertex_group_add(), but I can't find any way to specify the name of this new group without editing it in the Properties menu. Maybe I'm blind, but it just doesn't seem to be obvious to me.

$\endgroup$
5
$\begingroup$

You can use obj.vertex_groups.new(name="mygroup") instead where you can specify the name while creating the group.

if you need to use bpy.ops.object.vertex_group_add() and want to specify the name after that you can also set it as follows : obj.vertex_groups[-1].name="mygroup"

| improve this answer | |
$\endgroup$
0
$\begingroup$

Easier method discovered by a newbie: click on "Weight" (directly beneath, where you would change the default value away from 1.000) and then press tab to scroll through the names of the vertex groups and change them accordingly. I think this is a bug. There's a similar workaround for the name of particle groups in the Active Particle System Index: click in the reusable name slot beneath (above "Emitter"/"Hair" buttons) and then tab through the index.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ FYI, this is not a bug. Tab is a standard way to navigate through input field. and the question was about to rename a group using Python. If you want to rename it directly using the gui, without using tab, you can double click on it. $\endgroup$ – lemon Aug 21 '19 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.