I want to draw just the datablock selector button from the pointer property ui:
I tracked the operator down to bpy.ops.ui.eyedropper_ui
, but when I draw it in a panel, the poll conditions are not met and the button is greyed out:
I assume that this is because the operator doesn't know which property to write the selected datablock to. I had a look at the poll function in the C++ source code:
And while I don't know C++ it seems to say that there needs to be an active button in the UI which it takes it's data from.
Is it possible to fake this (maybe using something like UILayout.context_pointer_set
) and draw the button on its own while satisfying the poll function?