Make Instances Real doesn't work for geometry instances #93903

Open
opened 2021-12-09 15:35:42 +01:00 by Dusan · 38 comments

System Information
Operating system: Windows-10-10.0.18363-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 750/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 471.41

Blender Version
Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca30557
Worked: (newest version of Blender that worked as expected)

Short description of error
When I want to make instances real on object that has geometry nodes, blender create duplicate of whole mesh, togather with instances, on each place (point) where single instance mesh should be. I have attached screenshots and test scene that reproduces the bug.

Exact steps for others to reproduce the error
Open .blend file I sent you, hover with mouse over 4 instaced spheres, and pres ctrl+A... select make instances real. You will see that geometry nodes instances are not created properly (whole geometry is duplicated on each geometry node point).

Similar thing happens when instancing collections, and trying to make them real - the parent relationship/hiararchy is not working. So there is a bug there also.geom_nodes_bug.zip
blend01.jpg

blend02.jpg

blend03.jpg

**System Information** Operating system: Windows-10-10.0.18363-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 750/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 471.41 **Blender Version** Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `f1cca30557` Worked: (newest version of Blender that worked as expected) **Short description of error** When I want to make instances real on object that has geometry nodes, blender create duplicate of whole mesh, togather with instances, on each place (point) where single instance mesh should be. I have attached screenshots and test scene that reproduces the bug. **Exact steps for others to reproduce the error** Open .blend file I sent you, hover with mouse over 4 instaced spheres, and pres ctrl+A... select make instances real. You will see that geometry nodes instances are not created properly (whole geometry is duplicated on each geometry node point). Similar thing happens when instancing collections, and trying to make them real - the parent relationship/hiararchy is not working. So there is a bug there also.[geom_nodes_bug.zip](https://archive.blender.org/developer/F12720758/geom_nodes_bug.zip) ![blend01.jpg](https://archive.blender.org/developer/F12720783/blend01.jpg) ![blend02.jpg](https://archive.blender.org/developer/F12720784/blend02.jpg) ![blend03.jpg](https://archive.blender.org/developer/F12720785/blend03.jpg)
Author

Added subscriber: @DS44

Added subscriber: @DS44

#103919 was marked as duplicate of this issue

#103919 was marked as duplicate of this issue

#93734 was marked as duplicate of this issue

#93734 was marked as duplicate of this issue

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Hans Goudey changed title from Make Instances Real on geometry nodes creates duplicate geometry to Make Instances Real doesn't work for geometry instances 2021-12-10 18:14:06 +01:00
Member

Added subscribers: @pixldg, @lichtwerk

Added subscribers: @pixldg, @lichtwerk

Added subscriber: @MattCurtis

Added subscriber: @MattCurtis

Added subscriber: @AndyCuccaro

Added subscriber: @AndyCuccaro

Added subscriber: @MMMM

Added subscriber: @MMMM

How is that a bug?
You're still applying the geometry node to the mesh, while changing the mesh.

When you "realize" instances, in this case, you're creating an entirely new mesh, but your geometry node modifier is still applied.
Instead, use the realize instances node, or delete the geo-nodes modifier of the new mesh.

How is that a bug? You're still applying the geometry node to the mesh, while changing the mesh. When you "realize" instances, in this case, you're creating an entirely new mesh, but your geometry node modifier is still applied. Instead, use the realize instances node, or delete the geo-nodes modifier of the new mesh.
Author

Added subscriber: @Mike-102

Added subscriber: @Mike-102
Author

In #93903#1297015, @MMMM wrote:
How is that a bug?

It is a bug since you are unable to make real meshes from instanced geometry (you get copy of original mesh with geomnode modifier, on each point of the original mesh), and also behavior is changed from previous versions of Blender (in previous versions it was enough to just go to Object->Apply->Make instances real, and visible instances would become meshes, simple as that - now that is not the case)

> In #93903#1297015, @MMMM wrote: > How is that a bug? It is a bug since you are unable to make real meshes from instanced geometry (you get copy of original mesh with geomnode modifier, on each point of the original mesh), and also behavior is changed from previous versions of Blender (in previous versions it was enough to just go to Object->Apply->Make instances real, and visible instances would become meshes, simple as that - now that is not the case)

I see. I'm guessing that, that function would just internally add a "realize instance" after the geo-nodes modifier, just like the node would.

I see. I'm guessing that, that function would just internally add a "realize instance" after the geo-nodes modifier, just like the node would.
Author

In #93903#1297528, @MMMM wrote:
I see. I'm guessing that, that function would just internally add a "realize instance" after the geo-nodes modifier, just like the node would.

Realize instance - works to some extent, since you can make a collapsed mesh from it afterwards (Object->Convert->Mesh). But that is not intended behavior, since in previous versions, when you make instances real, it creates real objects (separate instance mesh for each point) and you can parent them etc.

> In #93903#1297528, @MMMM wrote: > I see. I'm guessing that, that function would just internally add a "realize instance" after the geo-nodes modifier, just like the node would. Realize instance - works to some extent, since you can make a collapsed mesh from it afterwards (Object->Convert->Mesh). But that is not intended behavior, since in previous versions, when you make instances real, it creates real objects (separate instance mesh for each point) and you can parent them etc.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Something like this can work:

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index e9cbd7bed55..7fd18835c86 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -2324,7 +2324,17 @@ static void make_object_duplilist_real(bContext *C,
 
   LISTBASE_FOREACH (DupliObject *, dob, lb_duplis) {
     Object *ob_src = DEG_get_original_object(dob->ob);
-    Object *ob_dst = ID_NEW_SET(ob_src, BKE_id_copy(bmain, &ob_src->id));
+    Object *ob_dst;
+    if (dob->ob == object_eval) {
+      ID *new_data = BKE_id_copy(bmain, dob->ob_data);
+      ob_dst = ID_NEW_SET(ob_src, BKE_id_new(bmain, ID_OB, ob_src->id.name + 2));
+      ob_dst->data = new_data;
+      ob_dst->type = BKE_object_obdata_to_type(new_data);
+    }
+    else {
+      ob_dst = ID_NEW_SET(ob_src, BKE_id_copy(bmain, &ob_src->id));
+    }
+
     id_us_min(&ob_dst->id);
 
     /* font duplis can have a totcol without material, we get them from parent

However, this needs some more investigation with regards to user counting etc.
IMO that's too risky to do for 3.1 now and it's not important enough to justify that risk. Still should be fixed soonish.

Something like this can work: ``` diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index e9cbd7bed55..7fd18835c86 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2324,7 +2324,17 @@ static void make_object_duplilist_real(bContext *C, LISTBASE_FOREACH (DupliObject *, dob, lb_duplis) { Object *ob_src = DEG_get_original_object(dob->ob); - Object *ob_dst = ID_NEW_SET(ob_src, BKE_id_copy(bmain, &ob_src->id)); + Object *ob_dst; + if (dob->ob == object_eval) { + ID *new_data = BKE_id_copy(bmain, dob->ob_data); + ob_dst = ID_NEW_SET(ob_src, BKE_id_new(bmain, ID_OB, ob_src->id.name + 2)); + ob_dst->data = new_data; + ob_dst->type = BKE_object_obdata_to_type(new_data); + } + else { + ob_dst = ID_NEW_SET(ob_src, BKE_id_copy(bmain, &ob_src->id)); + } + id_us_min(&ob_dst->id); /* font duplis can have a totcol without material, we get them from parent ``` However, this needs some more investigation with regards to user counting etc. IMO that's too risky to do for 3.1 now and it's not important enough to justify that risk. Still should be fixed soonish.

Added subscriber: @markbola3d

Added subscriber: @markbola3d

Hi all,

Any word on when this will be fixed?

As far as I can tell this was the only workaround for getting UVed instances into Unity from Geometry Nodes. If anyone has any other workarounds in the interim, I'm all ears!

Video of ideal behaviour here:

https://youtu.be/qrXZNG4yAa8?t=248

Edit: So, commentator's curse is a thing, the moment I posted this I found a workaround:

Future people with same question as me - make a copy of your geo nodes object (for safety), apply geo nodes modifier, convert UVMap attribute from object data properties to an actual UVMap!

Edit 2: It would still be nice to have the Make Instances Real trick working for occlusion culling purposes.

Many thanks,
Mark

Hi all, Any word on when this will be fixed? As far as I can tell this was the only workaround for getting UVed instances into Unity from Geometry Nodes. If anyone has any other workarounds in the interim, I'm all ears! Video of ideal behaviour here: https://youtu.be/qrXZNG4yAa8?t=248 Edit: So, commentator's curse is a thing, the moment I posted this I found a workaround: Future people with same question as me - make a copy of your geo nodes object (for safety), apply geo nodes modifier, convert UVMap attribute from object data properties to an actual UVMap! Edit 2: It would still be nice to have the Make Instances Real trick working for occlusion culling purposes. Many thanks, Mark

Added subscriber: @thierrykobyleski

Added subscriber: @thierrykobyleski

Added subscriber: @tomsmalley

Added subscriber: @tomsmalley

Added subscriber: @JanKaderabek

Added subscriber: @JanKaderabek

Added subscriber: @randum

Added subscriber: @randum

Added subscriber: @Yoshir

Added subscriber: @Yoshir

+1 to fix this.

"Make Instances real" is super important to get blender creations into Unreal and other frameworks. Make Instances Real also does no see to work if you have added a Realize Instance node to you geometry node (graph)

all the best

  • ryan
+1 to fix this. "Make Instances real" is super important to get blender creations into Unreal and other frameworks. Make Instances Real also does no see to work if you have added a Realize Instance node to you geometry node (graph) all the best - ryan

Added subscriber: @wilBr

Added subscriber: @wilBr

Still no fixed for 3.4.1 ?

Still no fixed for 3.4.1 ?

Added subscriber: @F_Scociety

Added subscriber: @F_Scociety

In #93903#1401970, @Yoshir wrote:
+1 to fix this.

"Make Instances real" is super important to get blender creations into Unreal and other frameworks. Make Instances Real also does no see to work if you have added a Realize Instance node to you geometry node (graph)

all the best
-ryan

+1 from me too
Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases.

> In #93903#1401970, @Yoshir wrote: > +1 to fix this. > > "Make Instances real" is super important to get blender creations into Unreal and other frameworks. Make Instances Real also does no see to work if you have added a Realize Instance node to you geometry node (graph) > > all the best > -ryan +1 from me too Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases.

Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases.

With a collection info node the "make instances real" operator works very well, creating individual instances.

> Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases. With a collection info node the "make instances real" operator works very well, creating individual instances.

In #93903#1475269, @wilBr wrote:

Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases.

With a collection info node the "make instances real" operator works very well, creating individual instances.

This works, even with multiple collection that each contain one object. Thank you so much!

> In #93903#1475269, @wilBr wrote: >> Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases. > > With a collection info node the "make instances real" operator works very well, creating individual instances. This works, even with multiple collection that each contain one object. Thank you so much!
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:44:20 +01:00

+1

As it is now, geometry generated using Geometry Nodes cannot be instanced and then realized with this method, not even with the "Geometry to Instance" node. According to the docs, it "can be used in combination with the Pick Instances option in the Instance on Points Node, as a way to pick between geometry generated in the node tree (as opposed to picking from separate instances from the Collection Info Node, for example)." However, "Make Instances Real" works differently when using "Collection Info" and generated geometry with the "Geometry to Instance" node.

+1 As it is now, geometry generated using Geometry Nodes cannot be instanced and then realized with this method, not even with the "Geometry to Instance" node. According to the docs, it "can be used in combination with the Pick Instances option in the Instance on Points Node, as a way to pick between geometry generated in the node tree (as opposed to picking from separate instances from the Collection Info Node, for example)." However, "Make Instances Real" works differently when using "Collection Info" and generated geometry with the "Geometry to Instance" node.

Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases.

With a collection info node the "make instances real" operator works very well, creating individual instances.

Can you please provide an example or explanation on how this works? I can not understand where to use this node and how it works to extract multiple objects from geonode instances.

Though personally, I feel like it should be possible to convert instanced objects from geonodes into Linked Objects, similar to doing Alt + D. But that may be beyond the scope of this thread.

> > Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases. > > > With a collection info node the "make instances real" operator works very well, creating individual instances. > > Can you please provide an example or explanation on how this works? I can not understand where to use this node and how it works to extract multiple objects from geonode instances. Though personally, I feel like it should be possible to convert instanced objects from geonodes into Linked Objects, similar to doing Alt + D. But that may be beyond the scope of this thread.

Can you please provide an example or explanation on how this works? I can not understand where to use this node and how it works to extract multiple objects from geonode instances.

When you plug geometry from a collection info node into a the "Instance" input of the "Instance of Points" node, you convert the instances to real objects.
To convert them go back to the View3D and run the operator "Make instances real". It's not a node.

> Can you please provide an example or explanation on how this works? I can not understand where to use this node and how it works to extract multiple objects from geonode instances. When you plug geometry from a collection info node into a the "Instance" input of the "Instance of Points" node, you convert the instances to real objects. To convert them go back to the View3D and run the operator "Make instances real". It's not a node.

I found a workaround for realizing instances of geometry generated from Geometry Nodes that worked for my use case. I share it here because it might be useful for someone else.

What worked for me was not to use the "Object">"Apply">"Make Instances Real" operator but instead to follow these steps:

  • I added a "Realize Instances" node at the end of my node tree
  • Then, I created a copy of the object with the Geometry Node modifier
  • I applied the Geometry Node modifier to the copy object
  • I switched to edit mode with the copy object and used the "Righ Click">"Separate">"By Loose Parts" operator

I made a simple working example of the workflow in Blender 3.1.2 on Ubuntu. The node tree that I used looks like this:
Screenshot 2023-06-09 12:15:44.png

The geometries going into the "Geometry to Instance" node are three different generated geometries for which I wanted variations.
In the blend file, I also included a Python script that does the above-mentioned steps for you.
According to my testing, this should also work if your generated geometries also use instances, but you would need to join geometries after the separation since all the instances (regardless of which level of the hierarchy they are in) will be turned into a separate object.

I found a workaround for realizing instances of geometry generated from Geometry Nodes that worked for my use case. I share it here because it might be useful for someone else. What worked for me was not to use the "Object">"Apply">"Make Instances Real" operator but instead to follow these steps: - I added a "Realize Instances" node at the end of my node tree - Then, I created a copy of the object with the Geometry Node modifier - I applied the Geometry Node modifier to the copy object - I switched to edit mode with the copy object and used the "Righ Click">"Separate">"By Loose Parts" operator I made a simple working example of the workflow in Blender 3.1.2 on Ubuntu. The node tree that I used looks like this: ![Screenshot 2023-06-09 12:15:44.png](/attachments/34e73ecb-374f-41c6-80f9-6e2df30abd1f) The geometries going into the "Geometry to Instance" node are three different generated geometries for which I wanted variations. In the [blend file](/attachments/dbfc6d1b-b0ec-48fb-a4c4-0053e87cdfff), I also included a Python script that does the above-mentioned steps for you. According to my testing, this should also work if your generated geometries also use instances, but you would need to join geometries after the separation since all the instances (regardless of which level of the hierarchy they are in) will be turned into a separate object.

@Artur-Karoly In many use cases the Separate: By Loose Parts isn't really a workaround, because it doesn't give you the exact original instances with all it's object-specific data (for example you lose origins location, which I need for exporting it into a game engine correctly).

@Artur-Karoly In many use cases the Separate: By Loose Parts isn't really a workaround, because it doesn't give you the exact original instances with all it's object-specific data (for example you lose origins location, which I need for exporting it into a game engine correctly).

@Artur-Karoly In many use cases the Separate: By Loose Parts isn't really a workaround, because it doesn't give you the exact original instances with all it's object-specific data (for example you lose origins location, which I need for exporting it into a game engine correctly).

Yes, by no means did I mean it as an all-purpose solution, but I haven't seen anyone mention the "Separate">"By Loose Parts" method here, so I thought It would be worth a comment since it could be good enough for some specific use-cases.

> @Artur-Karoly In many use cases the Separate: By Loose Parts isn't really a workaround, because it doesn't give you the exact original instances with all it's object-specific data (for example you lose origins location, which I need for exporting it into a game engine correctly). Yes, by no means did I mean it as an all-purpose solution, but I haven't seen anyone mention the "Separate">"By Loose Parts" method here, so I thought It would be worth a comment since it could be good enough for some specific use-cases.

Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases.

With a collection info node the "make instances real" operator works very well, creating individual instances.

Can you please provide an example or explanation on how this works? I can not understand where to use this node and how it works to extract multiple objects from geonode instances.

Though personally, I feel like it should be possible to convert instanced objects from geonodes into Linked Objects, similar to doing Alt + D. But that may be beyond the scope of this thread.

image

> > > Without this the only way is to relalize the instances and Export them as one mesh, which a is very slow in some cases. > > > > > > With a collection info node the "make instances real" operator works very well, creating individual instances. > > > > > > Can you please provide an example or explanation on how this works? I can not understand where to use this node and how it works to extract multiple objects from geonode instances. > > Though personally, I feel like it should be possible to convert instanced objects from geonodes into Linked Objects, similar to doing Alt + D. But that may be beyond the scope of this thread. ![image](/attachments/eab3757a-c076-46de-9d1c-4c0a41925b06)
498 KiB

poke. any plans to fix it? posted 2 years ago…

poke. any plans to fix it? posted 2 years ago…
Hans Goudey added
Type
Known Issue
and removed
Type
Bug
labels 2023-12-28 23:41:47 +01:00
Member

Currently this is probably dependent on some refactors to the instancing system. At least it would be much simpler after that. So for now I'd consider this a known issue.

Currently this is probably dependent on some refactors to the instancing system. At least it would be much simpler after that. So for now I'd consider this a known issue.
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
20 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#93903
No description provided.