Nesting Collection instances cause first objects to disappear (restricted by MAX_DUPLI_RECUR) #89844

Closed
opened 2021-07-13 22:30:17 +02:00 by Jon · 6 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71

Blender Version
Broken: version: 2.93.1, branch: master, commit date: 2021-06-22 05:57, hash: 1b8d33b18c

Short description of error
Ten levels of collection instances cause the base object to become invisible. Steps to recreate the issue are:

1: Create a collection "Collection 1" and add a mesh object to it.
2: Create a collection "Collection 2" and add an instance of "Collection 1" to it.
3: Continue repeating step 2) of adding of adding nested collection instances, until collection "Collection 10" contains an instance of "Collection 9".
4: Create a collection instance of "Collection 10" and hide all other collections. The mesh object in "Collection 1" will no longer visible (or rendered).
5: If a mesh object is added to "Collection 2", it becomes visible in the "Collection 10" instance but disappears from a "Collection 11" instance, if created.

This bug has been in Blender since collections were first added and its unusual for a project to have 10 levels of collection instances, so it doesn't normally cause a problem. If this is 'correct' behaviour it would be nice if a warning message was displayed to users explaining that the base objects wont be rendered.

Exact steps for others to reproduce the error
Open the linked file and no mesh will be displayed for the "Collection 10" collection instance. If its "Object Properties → Instancing → Collection" field is edited to "Collection 9", then the mesh will become visible.

NestedCollectionBug.blend

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71 **Blender Version** Broken: version: 2.93.1, branch: master, commit date: 2021-06-22 05:57, hash: `1b8d33b18c` **Short description of error** Ten levels of collection instances cause the base object to become invisible. Steps to recreate the issue are: 1: Create a collection "Collection 1" and add a mesh object to it. 2: Create a collection "Collection 2" and add an instance of "Collection 1" to it. 3: Continue repeating step 2) of adding of adding nested collection instances, until collection "Collection 10" contains an instance of "Collection 9". 4: Create a collection instance of "Collection 10" and hide all other collections. The mesh object in "Collection 1" will no longer visible (or rendered). 5: If a mesh object is added to "Collection 2", it becomes visible in the "Collection 10" instance but disappears from a "Collection 11" instance, if created. This bug has been in Blender since collections were first added and its unusual for a project to have 10 levels of collection instances, so it doesn't normally cause a problem. If this is 'correct' behaviour it would be nice if a warning message was displayed to users explaining that the base objects wont be rendered. **Exact steps for others to reproduce the error** Open the linked file and no mesh will be displayed for the "Collection 10" collection instance. If its "Object Properties → Instancing → Collection" field is edited to "Collection 9", then the mesh will become visible. [NestedCollectionBug.blend](https://archive.blender.org/developer/F10223485/NestedCollectionBug.blend)
Author

Added subscriber: @StraumliBlight

Added subscriber: @StraumliBlight
Member

Added subscribers: @mont29, @brecht, @lichtwerk

Added subscribers: @mont29, @brecht, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Can confirm the behavior.

This seems to be restricted by MAX_DUPLI_RECUR.
Changing this might be possible (needs to be done in a couple of places, see the following patch), but I assume there will be issues with persistent_id then (that I cannot forsee).

P2350: T89844_snippet



diff --git a/intern/cycles/blender/blender_id_map.h b/intern/cycles/blender/blender_id_map.h
index 198cfb4b29a..aed18b44e21 100644
--- a/intern/cycles/blender/blender_id_map.h
+++ b/intern/cycles/blender/blender_id_map.h
@@ -196,7 +196,7 @@ template<typename K, typename T> class id_map {
  * To uniquely identify instances, we use the parent, object and persistent instance ID.
  * We also export separate object for a mesh and its particle hair. */
 
-enum { OBJECT_PERSISTENT_ID_SIZE = 8 /* MAX_DUPLI_RECUR in Blender. */ };
+enum { OBJECT_PERSISTENT_ID_SIZE = 10 /* MAX_DUPLI_RECUR in Blender. */ };
 
 struct ObjectKey {
   void *parent;
diff --git a/source/blender/blenkernel/BKE_duplilist.h b/source/blender/blenkernel/BKE_duplilist.h
index c142d5338d1..d3e3ad9a0f1 100644
--- a/source/blender/blenkernel/BKE_duplilist.h
+++ b/source/blender/blenkernel/BKE_duplilist.h
@@ -51,7 +51,7 @@ typedef struct DupliObject {
 
   /* Persistent identifier for a dupli object, for inter-frame matching of
    * objects with motion blur, or inter-update matching for syncing. */
-  int persistent_id- [x]; /* MAX_DUPLI_RECUR */
+  int persistent_id[10]; /* MAX_DUPLI_RECUR */
 
   /* Particle this dupli was generated from. */
   struct ParticleSystem *particle_system;
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index f51b4fa0127..fe719084a61 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -649,7 +649,7 @@ typedef struct EEVEE_ObjectKey {
   /** Parent object for duplis */
   struct Object *parent;
   /** Dupli objects recursive unique identifier */
-  int id- [x]; /* MAX_DUPLI_RECUR */
+  int id[10]; /* MAX_DUPLI_RECUR */
 } EEVEE_ObjectKey;
 
 typedef struct EEVEE_ObjectMotionData {
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 0250d853898..a92327a65b5 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -752,7 +752,7 @@ enum {
   OB_EMPTY_IMAGE_USE_ALPHA_BLEND = 1 << 0,
 };
 
-#define MAX_DUPLI_RECUR 8
+#define MAX_DUPLI_RECUR 10
 
 #ifdef __cplusplus
 }

This was touched before (but in another context:


A related issue came up before in #48913 (Viewport gets stuck when two group instances are emitted from one face using dupli-verts)
And it seems this was raised once in c0161a1bab.
But then reduced again in bfc644dcfb.


@mont29, @brecht: I guess this can/should be closed as Known Issue (as in: wont be fixed)?

Can confirm the behavior. This seems to be restricted by `MAX_DUPLI_RECUR`. Changing this might be possible (needs to be done in a couple of places, see the following patch), but I assume there will be issues with `persistent_id` then (that I cannot forsee). [P2350: T89844_snippet](https://archive.blender.org/developer/P2350.txt) ``` diff --git a/intern/cycles/blender/blender_id_map.h b/intern/cycles/blender/blender_id_map.h index 198cfb4b29a..aed18b44e21 100644 --- a/intern/cycles/blender/blender_id_map.h +++ b/intern/cycles/blender/blender_id_map.h @@ -196,7 +196,7 @@ template<typename K, typename T> class id_map { * To uniquely identify instances, we use the parent, object and persistent instance ID. * We also export separate object for a mesh and its particle hair. */ -enum { OBJECT_PERSISTENT_ID_SIZE = 8 /* MAX_DUPLI_RECUR in Blender. */ }; +enum { OBJECT_PERSISTENT_ID_SIZE = 10 /* MAX_DUPLI_RECUR in Blender. */ }; struct ObjectKey { void *parent; diff --git a/source/blender/blenkernel/BKE_duplilist.h b/source/blender/blenkernel/BKE_duplilist.h index c142d5338d1..d3e3ad9a0f1 100644 --- a/source/blender/blenkernel/BKE_duplilist.h +++ b/source/blender/blenkernel/BKE_duplilist.h @@ -51,7 +51,7 @@ typedef struct DupliObject { /* Persistent identifier for a dupli object, for inter-frame matching of * objects with motion blur, or inter-update matching for syncing. */ - int persistent_id- [x]; /* MAX_DUPLI_RECUR */ + int persistent_id[10]; /* MAX_DUPLI_RECUR */ /* Particle this dupli was generated from. */ struct ParticleSystem *particle_system; diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index f51b4fa0127..fe719084a61 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -649,7 +649,7 @@ typedef struct EEVEE_ObjectKey { /** Parent object for duplis */ struct Object *parent; /** Dupli objects recursive unique identifier */ - int id- [x]; /* MAX_DUPLI_RECUR */ + int id[10]; /* MAX_DUPLI_RECUR */ } EEVEE_ObjectKey; typedef struct EEVEE_ObjectMotionData { diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 0250d853898..a92327a65b5 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -752,7 +752,7 @@ enum { OB_EMPTY_IMAGE_USE_ALPHA_BLEND = 1 << 0, }; -#define MAX_DUPLI_RECUR 8 +#define MAX_DUPLI_RECUR 10 #ifdef __cplusplus } ``` This was touched before (but in another context: --- A related issue came up before in #48913 (Viewport gets stuck when two group instances are emitted from one face using dupli-verts) And it seems this was raised once in c0161a1bab. But then reduced again in bfc644dcfb. --- @mont29, @brecht: I guess this can/should be closed as `Known Issue` (as in: wont be fixed)?
Philipp Oeser changed title from Nesting Collection instances cause first objects to disappear to Nesting Collection instances cause first objects to disappear (restricted by MAX_DUPLI_RECUR) 2021-08-30 13:56:14 +02:00

Changed status from 'Needs Developer To Reproduce' to: 'Archived'

Changed status from 'Needs Developer To Reproduce' to: 'Archived'

Not sure about raising that level of nesting, to me it looks already fairly reasonable as it is, you can always build cases that will break any such limit anyway... Will let that decision to @brecht

In any case, definitely not a bug, not even a 'known issue', just an internal limitation (similar to max amount of materials, etc.).

Not sure about raising that level of nesting, to me it looks already fairly reasonable as it is, you can always build cases that will break any such limit anyway... Will let that decision to @brecht In any case, definitely not a bug, not even a 'known issue', just an internal limitation (similar to max amount of materials, etc.).
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#89844
No description provided.