Gltf doesn't export instances #96517

Closed
opened 2022-03-16 11:09:23 +01:00 by Ladislav Lacko · 20 comments

{F12929942}System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.79

Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-15 21:22, hash: blender/blender@379bd6d50c
Worked: Previous alpha -> hash: fcda858e3200

gltf doesn't export instances, full geometry is exported instead

Exporting .glb file for unreal engine results in datasmith importing everything as a separate mesh, this isn't case in previous alpha where instances are properly exported.

EDIT: added basic file, export glb and reimport (instances aren't preserved)

{[F12929942](https://archive.blender.org/developer/F12929942/demoexportglb.blend)}**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.79 **Blender Version** Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-15 21:22, hash: `blender/blender@379bd6d50c` Worked: Previous alpha -> hash: fcda858e3200 gltf doesn't export instances, full geometry is exported instead Exporting .glb file for unreal engine results in datasmith importing everything as a separate mesh, this isn't case in previous alpha where instances are properly exported. EDIT: added basic file, export glb and reimport (instances aren't preserved)
Author

Added subscriber: @lacilaci

Added subscriber: @lacilaci
Member

Added subscriber: @JulienDuroure

Added subscriber: @JulienDuroure
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Hello,
As requested by guidelines, can you please upload a simple test case where problem occurs?

Hello, As requested by guidelines, can you please upload a simple test case where problem occurs?
Julien Duroure self-assigned this 2022-03-16 11:24:12 +01:00
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Author

In #96517#1323946, @JulienDuroure wrote:
Hello,
As requested by guidelines, can you please upload a simple test case where problem occurs?

Hi, sorry. Added file to description. It's simple, 4 boxes instanced. Just export glb, reimport, and now instances are regular geometry. previous version (the hash in description) exported instances properly. I get same results importing the files to unreal(which is how I found out it's not working now)

> In #96517#1323946, @JulienDuroure wrote: > Hello, > As requested by guidelines, can you please upload a simple test case where problem occurs? Hi, sorry. Added file to description. It's simple, 4 boxes instanced. Just export glb, reimport, and now instances are regular geometry. previous version (the hash in description) exported instances properly. I get same results importing the files to unreal(which is how I found out it's not working now)
Member

On simple test case, with 2 objects sharing a same mesh (Alt+D) + a another independent cube, and in a collection instanced 2 times, I don't have any issue.

I have only 2 meshes in glTF file, as planned:

image.png

untitled.blend

On simple test case, with 2 objects sharing a same mesh (Alt+D) + a another independent cube, and in a collection instanced 2 times, I don't have any issue. I have only 2 meshes in glTF file, as planned: ![image.png](https://archive.blender.org/developer/F12929947/image.png) [untitled.blend](https://archive.blender.org/developer/F12929949/untitled.blend)
Member

I can't reproduce. I also have only 1 mesh data in glTF exported

I can't reproduce. I also have only 1 mesh data in glTF exported
Member

Can you please upload the gltf you generated on your side?

Can you please upload the gltf you generated on your side?
Author

In #96517#1323969, @JulienDuroure wrote:
Can you please upload the gltf you generated on your side?

Hi I added the file. I also realized I'm using these settings on export
image.png

> In #96517#1323969, @JulienDuroure wrote: > Can you please upload the gltf you generated on your side? Hi I added the file. I also realized I'm using these settings on export ![image.png](https://archive.blender.org/developer/F12930016/image.png)
Author

So, even in your example file if you export using selected objects and apply modifiers it will also generate geometry instead using instances. I guess apply modifiers is working differently then before as this was non issue in previous blender version.

So, even in your example file if you export using selected objects and apply modifiers it will also generate geometry instead using instances. I guess apply modifiers is working differently then before as this was non issue in previous blender version.
Member

I confirm the regression when using Apply Modifier.

I confirm the regression when using Apply Modifier.
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

This issue was referenced by 1d5c8b54ee

This issue was referenced by 1d5c8b54ee99433ff5c3ef416f1f9bc1fd8780ef
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author

@JulienDuroure

Hi, is this already in latest 3.2 alpha? Hash: 931ae424b9ef

Cause if I enable same settings (Selected objects, Apply Modifiers) I still end up with real geometry being exported.

@JulienDuroure Hi, is this already in latest 3.2 alpha? Hash: 931ae424b9ef Cause if I enable same settings (Selected objects, Apply Modifiers) I still end up with real geometry being exported.
Member

Hello,
Yes, it should be.
I can't reproduce your issue with 931ae424b9ef.
With your file, and selected objects + Apply Modifiers, I have only 1 mesh exported, as expected

image.png

Hello, Yes, it should be. I can't reproduce your issue with 931ae424b9ef. With your file, and selected objects + Apply Modifiers, I have only 1 mesh exported, as expected ![image.png](https://archive.blender.org/developer/F12977676/image.png)
Author

demoexportglb.blend

Well, it seems it only works if there aren't any actual modifiers though. Try with this file where the objects have modifiers. Now if you try to export with (apply modifiers) instancing won't work

[demoexportglb.blend](https://archive.blender.org/developer/F12977801/demoexportglb.blend) Well, it seems it only works if there aren't any actual modifiers though. Try with this file where the objects have modifiers. Now if you try to export with (apply modifiers) instancing won't work
Member

Hello,
Your latest case is different from what you define at first in this ticket, and is not a regression, as it is the way it is working from 2.79 version.

Technically, we currently don't detect difference in modifier parameters, so we can't instanciate mesh, as we can't be sure if mesh with modifiers are different or not.

Hello, Your latest case is different from what you define at first in this ticket, and is not a regression, as it is the way it is working from 2.79 version. Technically, we currently don't detect difference in modifier parameters, so we can't instanciate mesh, as we can't be sure if mesh with modifiers are different or not.
Author

But, isn't the "apply modifiers" supposed to just apply modifiers and then export instances? Regardless of how different said modifier settings are?

This is how it worked before, as I mentioned in original post, older alpha did apply modifiers and export instances properly. It really doesn't matter difference in modifiers as I don't want them exported when I tick "apply modifiers" on export.

But, isn't the "apply modifiers" supposed to just apply modifiers and then export instances? Regardless of how different said modifier settings are? This is how it worked before, as I mentioned in original post, older alpha did apply modifiers and export instances properly. It really doesn't matter difference in modifiers as I don't want them exported when I tick "apply modifiers" on export.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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-addons#96517
No description provided.