← All ideas
  • Published 26 Dec 2025

[Rigify] Isolate Next/Previous Bone collection buttons.

A couple buttons could be made in the UI, in the form of an additional addon, so when you press these buttons, you travel next and previous Rigify bone collections, isolating them, as if you were cycling weapons in a first person shooter, with previous and next weapon.

I cannot code. I am not a developer. But instead of just asking you to do it, I have asked Gemini to build a prototype of this addon, and it has worked!

The code is these 79 lines of code. And to see it in action, just watch the attached video.

If you want to use it, just go to Blender's scripting panel. Open a new text file. Copypaste the code, and execute it (the play button).

Then create a rigify metarig, and hit 'generate' to go to the rig. On this rig, go pose mode. Then, in the viewport, press N, and go to the Rigify Cycle panel, and press the next and previous buttons to do what can be seen in the video.

Current limitations:

The code has buttons names and comments in spanish, since I was talking to Gemini in Spanish. I am from Spain.

Since I am not a programmer, I don't know how to make this code to become an independent addon. And the creation of shortcuts with right click of the button, doesn't work.

But at the moment you could attach these actions to both keyboard keys, you would travel between bone collections in no time! You could insta filter bone layers and animate much more easily!

Please! Add this as an official Blender Addon. Or shortcuts. Or whatever! Thank you!. Captura desde 2025-12-26 18-49-03.png

0%

Development Status: Open

Upvote 0 Downvote 0
John-Doe-124
26 Dec 2025

1 Comment

John-Doe-124 Author

import bpy

class VIEW3D_PT_rigify_cycle(bpy.types.Panel): bl_label = "Rigify Layer Cycle" bl_idname = "VIEW3D_PT_rigify_cycle" bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_category = 'Rigify Cycle'

def draw(self, context):
    layout = self.layout
    col = layout.column(align=True)

    op_next = col.operator("armature.cycle_bone_coll", text="Siguiente Capa", icon='TRIA_DOWN')
    op_next.direction = 'NEXT'

    op_prev = col.operator("armature.cycle_bone_coll", text="Anterior Capa", icon='TRIA_UP')
    op_prev.direction = 'PREV'

class ARMATURE_OT_cycle_bone_coll(bpy.types.Operator): """Cicla el aislamiento (estrella) asegurando que solo una esté activa""" bl_idname = "armature.cycle_bone_coll" bl_label = "Cycle Bone Collection Solo" bl_options = {'REGISTER', 'UNDO'}

direction: bpy.props.EnumProperty(
    items=[('NEXT', "Next", ""), ('PREV', "Prev", "")],
    default='NEXT'
)

def execute(self, context):
    obj = context.active_object
    if not obj or obj.type != 'ARMATURE':
        self.report({'WARNING'}, "Selecciona un Rig")
        return {'CANCELLED'}

    # Usamos collections_all para asegurar compatibilidad con jerarquías
    bone_colls = obj.data.collections_all 

    if not bone_colls or len(bone_colls) == 0:
        return {'CANCELLED'}

    # 1. Encontrar el índice de la PRIMERA colección que tenga estrella
    current_index = -1
    for i, bc in enumerate(bone_colls):
        if bc.is_solo:
            current_index = i
            break

    # 2. Calcular el nuevo índice
    if self.direction == 'NEXT':
        next_index = (current_index + 1) % len(bone_colls)
    else:
        if current_index <= 0:
            next_index = len(bone_colls) - 1
        else:
            next_index = current_index - 1

    # 3. CRUCIAL: Apagar TODAS las estrellas primero
    for bc in bone_colls:
        bc.is_solo = False

    # 4. Activar solo la estrella que nos interesa
    bone_colls[next_index].is_solo = True

    # Forzar actualización de la interfaz
    context.area.tag_redraw()

    return {'FINISHED'}

def register(): bpy.utils.register_class(VIEW3D_PT_rigify_cycle) bpy.utils.register_class(ARMATURE_OT_cycle_bone_coll)

def unregister(): bpy.utils.unregister_class(VIEW3D_PT_rigify_cycle) bpy.utils.unregister_class(ARMATURE_OT_cycle_bone_coll)

if name == " main ": register()