Allow setting properties/attributes on converted elements
When convertion happens already converted geometry gets overwritten, this can lead to a loss of data when the user manually modifies anything in a destructive manner on the resulted object data and reruns the conversion. #104 is an example of this limitation.
To allow changing properties and attributes there needs to be some way to set these values without them getting overwritten.
The attributes branch tries to solve that by implementing a system that writes addon defined attributes whenever the conversion happens.
Note: Conversion always involves a bezier curve which don't yet support geometry attributes, therefor attributes are currently limited to have per object/object data values
Design:
- Adds a CustomAttribute property group which stores the name, type and domain of the attribute definition
- Attribute definitions are stored per sketch
- Attribute values are stored per entity in an id property e.g. entity["attribute_values"] = {"some_integer": 12}
- Values can be set on sketches, this acts as a default if no value is set on an entity Conversion :
- Attributes of domain type "OBJECT" will try to set the value on the converted object and object data
- Attributes of other domain types will set the property with the matching name on the mesh elements or set an geometry attribue with the same settings
Alternatives: Another approach would be to try to reuse existing geometry when converting.