I'm writing a tool with a very simple panel with buttons.
On pressing a button a custom property with a specific name is to be assigned to the active object.
The UI should have 2 buttons Target and Clear
- Pressing Target button in the UI should create a custom property.
- Pressing Clear button in the UI should delete customer property that was created by the Target button (if such customer property is present).
For example, I have Cube and Sphere (names) objects. I would select Cube, then Sphere, press Target button, and Cube will have custom property names "target" with value "Sphere".
Selecting both of them in any manner and pressing Clear button would remove that custom property.
How do I go about making such basic add-on?
EDIT: Here is a mock-up that should explain it all :)
Link to full screen image: https://i.stack.imgur.com/aWyLc.png