Ghostkeeper / Blender3mfFormat

Blender add-on to import/export 3MF files
GNU General Public License v2.0
202 stars 25 forks source link

Metadata is not saved for resource objects without mesh #25

Open Ghostkeeper opened 4 years ago

Ghostkeeper commented 4 years ago

Let's say there is a resource object like this:

<object objectid="3">
    <metadatagroup>
        <metadata name="Title">Some group of objects</metadata>
    </metadatagroup>
    <components>
        <component objectid="1" />
        <component objectid="2" />
    </components>
</object>

This metadata currently won't get stored. Currently we store the metadata in the mesh of the Blender object (the object's data field, which is then a mesh). However this object has no mesh, so there is nothing to store it in. The code that stores the metadata is actually conditional to there being mesh data in the object.

As a solution, we could store the metadata in an empty mesh. The exporter will then perhaps split it to a separate group, but the metadata is retained.