Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Rename vertex groups #62

Closed
InterruptingOctopus opened this issue Jun 20, 2020 · 2 comments
Closed

Suggestion: Rename vertex groups #62

InterruptingOctopus opened this issue Jun 20, 2020 · 2 comments
Labels
Milestone

Comments

@InterruptingOctopus
Copy link

i know that it is somewhat possible since i've copy pasted rudimentary scripts to do so but it would be much handier to do so through a UI like this addon's

@Weisl Weisl added the feature label Jun 27, 2020
@Weisl
Copy link
Owner

Weisl commented Sep 12, 2021

Could you reference the script you downloaded? It could make my life easier trying to implement this functionality.

@InterruptingOctopus
Copy link
Author

sorry for not getting back to you, i was locked out of my account for a while due to needing to move my 2fac to my new phone.
basically what i did to rename bones was a code somewhat similar to this:

import bpy
obj = bpy.context.active_object
prefixes = ["ORG-", "DEF-", "h_", "x_"]

bpy.ops.object.mode_set(mode='OBJECT',toggle=True)
for obj in bpy.context.selected_objects:
    for g in obj.vertex_groups:
        for prefix in prefixes:
            if g.name.startswith(prefix):
                g.name = g.name[4:]

which was to remove prefixes as defined in the array named as such.

there was also this code for adding a prefix as well.

import bpy

obj =  bpy.context.active_object

for obj in bpy.context.selected_objects:
    for g in obj.vertex_groups:
        g.name = 'DEF-' + g.name

@Weisl Weisl mentioned this issue Sep 14, 2022
@Weisl Weisl added this to the 1.6 milestone Sep 14, 2022
@Weisl Weisl closed this as completed Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants