layout.prop(data=context.object.modifiers["GeometryNodes"], property='["Socket_2"]', text="My Attribute")
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()