Maniphest T96517

Gltf doesn't export instances
Closed, ResolvedBUG

Assigned To
Julien DUROURE (julien)
Authored By
Ladislav Lacko (lacilaci)
Mar 16 2022, 11:09 AM
Tags
  • Add-ons (BF-Blender)
Subscribers
Julien DUROURE (julien)
Ladislav Lacko (lacilaci)
Pratik Borhade (PratikPB2123)

Description

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: rB379bd6d50ce3
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)

Revisions and Commits

rBA Blender Add-ons

Related Objects

Mentioned Here
rB931ae424b9ef: BVH Utils: remove 'isolate' parameter
rBfcda858e3200: Cleanup: remove Python 3.9 annotation workarounds

Event Timeline

Ladislav Lacko (lacilaci) created this task.Mar 16 2022, 11:09 AM
Julien DUROURE (julien) changed the task status from Needs Triage to Needs Information from User.Mar 16 2022, 11:22 AM
Julien DUROURE (julien) added a subscriber: Julien DUROURE (julien).

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

Julien DUROURE (julien) claimed this task.Mar 16 2022, 11:24 AM
Pratik Borhade (PratikPB2123) edited projects, added Add-ons (BF-Blender); removed BF Blender.Mar 16 2022, 11:25 AM
Pratik Borhade (PratikPB2123) added a subscriber: Pratik Borhade (PratikPB2123).
Ladislav Lacko (lacilaci) updated the task description.Mar 16 2022, 11:32 AM
Ladislav Lacko (lacilaci) added a comment.Mar 16 2022, 11:35 AM
In T96517#1323946, @Julien DUROURE (julien) 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)

Julien DUROURE (julien) added a comment.Mar 16 2022, 11:36 AM

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:

Julien DUROURE (julien) added a comment.Mar 16 2022, 11:38 AM

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

Julien DUROURE (julien) added a comment.Mar 16 2022, 11:52 AM

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

Ladislav Lacko (lacilaci) added a comment.Mar 16 2022, 12:11 PM
In T96517#1323969, @Julien DUROURE (julien) 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

Ladislav Lacko (lacilaci) added a comment.Mar 16 2022, 12:14 PM

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.

Julien DUROURE (julien) added a comment.Mar 16 2022, 1:04 PM

I confirm the regression when using Apply Modifier.

Julien DUROURE (julien) changed the task status from Needs Information from User to Confirmed.Mar 16 2022, 1:05 PM
Julien DUROURE (julien) changed the subtype of this task from "Report" to "Bug".
Julien DUROURE (julien) closed this task as Resolved by committing rBA1d5c8b54ee99: glTF exporter: Fix T96517 better instance management when no modifiers.Mar 29 2022, 5:40 PM
Julien DUROURE (julien) added a commit: rBA1d5c8b54ee99: glTF exporter: Fix T96517 better instance management when no modifiers.
Ladislav Lacko (lacilaci) added a comment.Apr 6 2022, 9:59 AM

@Julien DUROURE (julien)

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.

Julien DUROURE (julien) added a comment.Apr 6 2022, 10:46 AM

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

Ladislav Lacko (lacilaci) added a comment.Apr 6 2022, 11:22 AM

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

Julien DUROURE (julien) added a comment.Apr 6 2022, 11:41 AM

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.

Ladislav Lacko (lacilaci) added a comment.Apr 6 2022, 11:48 AM

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.