Add checkbox for blender's "GPU Instances" option for exporting GLTF#107672
Add checkbox for blender's "GPU Instances" option for exporting GLTF#107672Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
fire
left a comment
There was a problem hiding this comment.
I'm also ok with it on by default.
That will actually be useful to have considering blender groups them by common parent so they will be culled by the same clusters they were created in. This workflow seems like a good candidate for core because there's nothing to configure in there, it just works |
I think checkbox being disabled by default slightly better, since this is default in blender, and introducing it like this will not change import in any existing project. Also without using any additional scripts it will just create single MeshInstance3D node(instead of several hundreds - which is bad overall, but less confusing) |
I was wrong, it does. Older blender(4.2.1) throws exception while trying to export GN to instances, however. On 4.4.3 it works fine. |
|
Since #107866 having 4.6 milestone now, will it make sense to add same one here? Though not direct, but this one is basically requirement. Or maybe it will be simpler to just move code to other PR and close that one? |
|
Could you squash your commits? See our pull request guidelines for more information |
9ba4a2f to
40fcf5e
Compare
|
Thanks! Congratulations on your first merged contribution! 🎉 |
|
@Repiteo I'm confused as to why this PR was merged, surely it was a mistake? This PR adds a checkbox to tell Blender to export with This PR should've been marked as draft, with PR #107866 as a prerequisite, and that PR itself has other prerequisites, notably #108853 and #109103. |
|
@aaronfranke we can amend or revert. My bad. |
|
This change shouldn't break any files by itself - it just adds fields current import will ignore(or should, at least) I initially planned to just use this for plugins(which is worked). It is now looking kinda useless by itself, however, considering actual imports/exports. |
Bugsquad edit: Depends on #108853, #109103, and #107866.
exposes "export_gpu_instances" option: https://docs.blender.org/api/4.0/bpy.ops.export_scene.html#bpy.ops.export_scene.gltf
Enabling it will export instances and particle systems as GLTF's buffer/accessor data instead of numerous singular Mesh3D object. This does not include Geometry Nodes instancing.
Small project to test export with/without option: https://github.com/2frac/godot-gpu-instances-test
It also has small addon which actually creates and fills MultiMeshInstance3D using GLTFDocumentExtension. I might check if it is easy to add MultiMeshInstance3D creation to engine itself, but that seems like a separate task.