Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instanced Collections -- not accounted for [Blender 2.8 and on] #360

Open
PhilosopherTruelove opened this issue Aug 21, 2020 · 1 comment
Labels

Comments

@PhilosopherTruelove
Copy link

OS:

Using Windows, but if I had to guess, I'd predict this affects all OS's.

Godot version:

Current stable, Godot v3.2.2

Blender version:

Verified add-on bug using both Blender v.2.82a & v2.83.5 (current stable)

Issue description:

Instanced Collections are not exported.

When you load an exported .escn scene into Godot,
each Instanced Collection from Blender will have its name copied
into an empty Spatial node in Godot, without instances of any objects nor data
(one empty Spatial generated per Instanced Collection in the exported Blender scene).

Background on recent Blender 2.8 changes:

Blender no longer has layers in the Outliner Editor for grouping objects in 3D scenes, and
Blender no longer has "groups" for objects in 3D scenes.

Both these features have been merged and replaced by "Collections".

Initial overview :
https://code.blender.org/2018/05/collections-and-groups/

Release Notes introducing "Collections" :
https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Layers

Blender Docs for "Collections" :
https://docs.blender.org/manual/en/latest/scene_layout/collections/introduction.html

Steps to Reproduce :

  1. Launch Blender (v2.8 or higher). Load the default scene with a single cube.

  2. Select the cube, hit [M] to pull up the context menu "Move To Collection" -> and choose "+New Collection" and type a name for your new Collection.

    All of the following steps take place in the Outliner Editor

  3. Look at the Outliner Editor. Click the "Display Mode" button in the Outliner's header and select "Scene".

  4. Observe the elements of your scene:
    a. "View Layers"
    b. "Scene Collection" (all of the collections present in the current scene)
    c. "Objects"

  5. Look under the "Scene Collection" item and find the Collection you created and moved the Cube to.

  6. Right-Click your Collection.

  7. In the context menu that pops up, choose "Instance to Scene"

    Done with the Outliner

  8. Move the Instanced Collection in the 3D Viewport Editor so they don't overlap.

  9. File -> Export -> "Godot Engine (.escn)" -> export to a Godot project for testing.

  10. Load the exported scene in Godot.

  11. Observe the original cube exists, but there is no 2nd cube instance.
    There will be an empty Spatial node in the Scene's Node Tree with the name of your custom added Collection. If you repeat step 7. above, you will have one empty Spatial node in Godot for every Instanced Collection present in the exported Blender scene.

Expected Behaviour :

Godot's use of scenes and instancing is what makes it incredible for component reuse and solid modular design.

Any setup in Blender which uses instances should be able to export to Godot, keeping the structure of instanced items as reused nodes or scenes.

Collections are a huge new organizational feature in Blender, and I doubt the new Collections organization feature is going anywhere anytime soon. This exporter will be outdated for Blender versions 2.8 and onward, until it accounts for Blender's new paradigm.

Related to #130, but that pertains to the previous iteration of Blender before Collections.

All in all though, this add-on is incredible, and many thanks to all who contributed to it.

Visual Summary :

2020-08-20 21_43_22-Blender  C__ Blender __projects__experiments   tests_1 2 - B -  2020_8_20  - upd

2020-08-20 21_43_35-Godot Engine - 1 2 -  2020_8_20  - Blender Import Test, Instanced Trees - landsc

@PhilosopherTruelove
Copy link
Author

Clarification :
Using alt+d on selected objects (or parented object hierarchies) in Blender creates a "linked duplicate", which is a new object that shares object data with the source. Linked duplicates of both single objects & also nested parented hierarchies do export correctly still.

This behaviour just needs to be extended to the "Instance To Scene" function for Collections.

Addendum :
Instanced Collections are presented in Blender's Outliner as Objects (not as Collections), with their Object Data referencing the original Collection.

This wasn't obvious to me at first, adding this in case it's helpful to anyone who wishes to patch this.

@Calinou Calinou added the bug label Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants