Skip to main content
2 of 3
added 112 characters in body
X Y
  • 6.8k
  • 1
  • 10
  • 26
md = context.object.modifiers["GeometryNodes"]
name = next(rna.name for rna in md.node_group.interface.items_tree if rna.identifier == "Socket_2")

layout.prop(data=md, property='["Socket_2"]', text=name)

enter image description here

import bpy

class OBJECT_PT_CustomPanel(bpy.types.Panel):
    bl_label = "Custom Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"
    
    def draw(self, context):
        layout = self.layout
        layout.prop(data=bpy.context.scene.render,property="fps",text="Frame Rate")
        obj_name = "Cube"
        md_name = "GeometryNodes"
        
        try:
            layout.prop(data=bpy.data.objects[obj_name].modifiers[md_name], property='["Socket_2"]')
        except:
            pass


def register():
    bpy.utils.register_class(OBJECT_PT_CustomPanel)

def unregister():
    bpy.utils.unregister_class(OBJECT_PT_CustomPanel)

if __name__ == "__main__":
    register()
X Y
  • 6.8k
  • 1
  • 10
  • 26