Handling object groups in collada exporter/importer
Open, Needs TriagePublic

Description

In Blender a group is just a collection of objects unrelated to the object relationship. Apparently Group instances are made of an empty plus instances of the group objects. This blend file contains a group made of 3 simple objects and one group instance:

The Suzanne group in this file is made of 3 objects: "Suzanne", "Pole" and "Base"
When exporting this we can make use of Collada library nodes as follows:

'''
<library_nodes>

<node id="Group-Suzanne" type="NODE">
    <node id="Suzanne" type="NODE">
        <instance_geometry url="#Suzanne-mesh"/> 
    </node>
    <node id="Pole" type="NODE">
        <instance_geometry url="#Pole-mesh"/>
    </node>
    <node id="Stand" type="NODE">
        <instance_geometry url="#Stand-mesh"/>
    </node>
</node>

</library_nodes>

<library_visual_scenes>

<visual_scene id="Scene">
    <node id="Suzanne-Instance" type="NODE">
        <instance_node url="#Suzanne-instance"/> <!-- placed at the location of the instance -->
    </node>
</visual_scene>

</library_visual_scenes>

'''

When importing this, then basically the blend file is reconstructed like the original with one group made of the library nodes and one group instance referring to the group.

caveats

  • What to do when the user has selected the group instance and the objects in the group.
  • How to handle the situation where objects are in multiple groups.
  • Should we also take care of the layers where each object is placed? I think that is doable as well.

Is there anything else to consider? Opinions and suggestions are welcome :)

Thanks
Gaia

Details

Type
Design