I came across this question and learned that I can actually expose properties from the Blender UI in my addon panel. So I was experimenting on exposing properties of modifiers like for example the thickness of the Solidify Modifier, I can do:
layout.prop(data=context.object.modifiers["Solidify"], property="thickness", text="Thickness")
layout.prop(data=context.scene.render,property="fps",text="Frame Rate")
So now I'm interested in exposing properties of Geometry Nodes modifiers but I can't get it to work.
I tried the following
layout.prop(data=context.object.modifiers["GeometryNodes"]["Socket_2"], property="My Attr", text="My Attribute")
which gives me the following error:
Traceback (most recent call last):
File "C:\Users\harry\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\test\ui\sidebar_menu.py", line 111, in draw
layout.prop(data=context.object.modifiers["GeometryNodes"]["Socket_2"], property="My Attr", text="My Attribute")
TypeError: UILayout.prop(): error with keyword argument "data" - Function.data expected a AnyType type, not float
and then tried:
layout.prop(data=context.object.modifiers["GeometryNodes"], property="Socket_2", text="My Attribute")
which gives me error:
rna_uiItemR: property not found: NodesModifier.Socket_2
C:\Users\harry\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\test\ui\sidebar_menu.py:111
Is what I'm looking for even possible?