I'd like to create a panel for my add on with a box with text where I could select an armature

I would like if this panel could show up in the n panel

and just have drop down menus that would list all the armatures in the scene that I could pick from with an eyedropper and text above it Is there a ways Can somebody tell me how to create that or give me a link to an online resource

I need the armature saved to this variable… so it comes out to be like this where rig equals the name of the armature
rig = ‘Genesis 8 Female’

thanks in advance for any help on this

import bpy

from bpy.props import (StringProperty,
                       BoolProperty,
                       IntProperty,
                       FloatProperty,
                       FloatVectorProperty,
                       EnumProperty,
                       PointerProperty,
                       )

class EXAMPLE_PT_panel_1(bpy.types.Panel):
    bl_label = "Panel 1"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        layout.prop(scene, "armature_picker")


def register():
    b = bpy.types.Scene
    
    b.armature_picker = PointerProperty(name="Armature",type = bpy.types.Armature)
    
    bpy.utils.register_class(EXAMPLE_PT_panel_1)


def unregister():
    del b.armature_picker
    bpy.utils.unregister_class(EXAMPLE_PT_panel_1)


if __name__ == "__main__":
    register()
2 Likes

Then to use the picked rig, do:

rig = bpy.data.scenes["Scene"].armature_picker

or bpy.context.scene.armature_picker, either should work

i didnt get a email notification about this Thank you so much!!

1 Like

Nice theme, could you share this theme name?

atom-fixed-v1.xml (46.7 KB)

Thanks! :smiley:

OK I need to get some like this so that I could select it right after in my code

can you tell me how to convert this struct i got to this

bpy.data.objects[‘Genesis 8 Female’]

Like this:

OK this is awesome I figured it out I need a button on the panel that says run or something add to make it when I run my code it’ll create the panel and pause the code until somebody populates the picker text field with the eye dropper and presses the run button… Can you edit what you put in there already to create that button So I know what it looks like and to set up a pause function for that button that won’t run the rest of my code until it’s pressed

I just cut and pasted what you gave me already to the top of my code and set my variable that I use in the rest of the code