Handling object groups in collada exporter/importer #53966

Open
opened 2018-01-31 21:48:37 +01:00 by Gaia Clary · 6 comments
Member

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:

group_export.blend

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

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: [group_export.blend](https://archive.blender.org/developer/F2061340/group_export.blend) 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
Gaia Clary self-assigned this 2018-01-31 21:48:37 +01:00
Author
Member

Added subscribers: @GaiaClary, @mont29

Added subscribers: @GaiaClary, @mont29

Added subscriber: @Sergey

Added subscriber: @Sergey

@GaiaClary, seems this slipped through the cracks. Is it still relevant for the 2.80 with the new instancing based on collections?

@GaiaClary, seems this slipped through the cracks. Is it still relevant for the 2.80 with the new instancing based on collections?
Author
Member

Ops... i completely forgot about this one :( I guess we can get this to work in 2.80 :)

Ops... i completely forgot about this one :( I guess we can get this to work in 2.80 :)

Added subscriber: @Raincry

Added subscriber: @Raincry

Hi, The .DAE exporter is still not working as intended, the Use Object Instances option is not making instances at all and the objects get exported in one big collection with no hierarchy.
The file is not getting that </library_nodes> section as described before.

Thanks for any possible help here :)

Hi, The .DAE exporter is still not working as intended, the Use Object Instances option is not making instances at all and the objects get exported in one big collection with no hierarchy. The file is not getting that </library_nodes> section as described before. Thanks for any possible help here :)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#53966
No description provided.