I am trying to write a new operator using bpy. It will operate on the currently selected objects and add particle systems, then use a user-selected object as the render object in the particle systems (this user-selected object would be the parameter). This appears to be the wrong way to think about things in Blender, but I could not find the Blender way to think about it.
The tutorials and reference materials explain how to add properties to the operator. I added these and they work fine for value parameters like numbers and strings. When using bpy.props.PointerProperties Blender throws the error ValueError: bpy_struct "MESH_OT_place_foliage" doesn't support datablock properties, and the property doesn't show up in the operator panel.
When looking this up I found other people with the same issue, in particular I found this question where it is suggested that the asker shouldn't be doing things that way, but no suggestion on the way they should be doing it.
Additionally, I found some code examples of bpy.props.PointerProperties, but none targeted objects, which again suggests I am working against the grain. I also tried to think of official operators that I'd used that took secondary object inputs; the only family I thought of was bool tools, and they operate on the active object and the selected objects, rather than separating the operands into separate parameters.
What is the Blender way to think about this problem? I'd greatly appreciate examples as well.
Set parent, currently it isPlace foliagebut it could bePlace foliage cluster on surfacesor hopefully something even more obvious. – fuseinabowl Sep 08 '21 at 15:12