# When writing an operator, what is the blender-idiomatic way of parameterising on an object?

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.

• Thank you @batFINGER, that's a useful link. The second point about making the render object the context object makes me think that I could rename my operator to make the context objects and selected objects as intuitive as Set parent, currently it is Place foliage but it could be Place foliage cluster on surfaces or hopefully something even more obvious. Sep 8 at 15:12