New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glTF importer ignores "-colonly" import hint on Blender empty objects #32363
Comments
Relevant code: godot/editor/import/resource_importer_scene.cpp Lines 379 to 465 in 04032a9
|
@akien-mga: thanks, I'll let you know if I have any clue. |
It clearly seems to come from the "empty_draw_type" meta data not being set in the node at glTF import time. If I force it with this patch (very quick and dirty of course), But I don't know how to identify empties at import time yet. When exporting the Blender scene to a plain text gltf file, it doesn't really differ from other objects (expect that it has no mesh attached but so does a light). I'm trying to have a look at glTF exporter documentation for more info. |
In the gltf importer, all the empty node candidates are the spatial nodes. Spatial nodes only get created when neither mesh, camera, skin, joint, etc is flagged on an import node. Basically, it's the end case for no mesh/camera. What I do not know however, is what is considered an empty_draw_type. Is it just a spatial node? Or is it any node with no render body? Or is it the above + no renderable children? @reduz might have insight |
Ok thanks, that's interesting. Which leads me to notice that, on the Collada side, empties are taken explicitly in charge by the Better Collada exporter that adds some extra information in the dae file, which are then handled by the importer:
When exporting with Blender default Collada exporter, those extra information are missing, which leads to the same behavior as with glTF (no StaticBody created at import time). |
Might be good to attack this issue from both ends? Seems there's been some effort put forward to add rigid body info to glTF but the discussion seems to have stalled. |
Current list of flags that need to be recognized: |
In 3.2, i'm only noticing this issue when the exported object is parented to an armature. I've attached a glb which demonstrates the issue. |
Try gltf master from blender, this is why the release notes mention blender 2.83. |
What do you mean gltf master from blender? I should try to run from blender's master branch? I'm new to the project, where are the release notes that mention blender 2.83? |
Seems still valid in 3.2.4 beta4 |
problem still exists with blender-3.0.0 and godot-3.4, are there any quick workarounds ? |
I'm still running into this issue with Godot 3.4.4 and Blender 3.1.2 |
Godot 4.0 b1 have the same issue. '-col' works but '-colonly' on empty objects not working. |
I wonder why it's wrong, need to get the godot-tests to the godot master and do a look https://github.com/godotengine/godot-tests |
I believe this should be mentioned in the docs |
I just tested this on both godot4 (compiled from master) and godot3.5.1 with GLTF, so, godot4 has it could be that better-collada-exporter changes something, but I was not able to install it easily. edit:
edit: |
Godot 4.0 RC2, Blender 3.4 The issues is not limited to GLTF importer (which includes both direct Blend import as well as exported GLTF). It also affects Collada exports, so I assume all file types are affected. The issue is not limited to Empties of Cube type either - it affects all shapes of Empty - that is none work. Col / colonly makes no difference - neither work. Exporting Empty collision shapes by themselves, without mesh parent, doesn't work either. Polygonal shapes work as expected. |
I would appreciate an example file from someone encountering this issue on Godot 4 To be clear, this is a feature where specific collision shapes can be added to empty nodes, but only when coming from Blender? If so, I believe this feature is not fully implemented in Godot 4 due to the new blend -> gltf import pipeline. It relies on something called As an alternative to blend->gltf import, there is ESCN which does technically function in Godot 4. However, due to the version upgrade and the fact that most exporters are designed for Godot 3, we cannot fully support ESCN workflow in Godot 4.0 until the tooling is updated (chicken/egg problem). Renaming a .tscn to .escn is the only fully supported usage of ESCN import at this time. Correct me if I'm wrong, @fire Having an actual example (blend or gltf) would help us triage this specific issue, but otherwise the clock has run out for 4.0, and due to the implementation complexity of supporting node metadata not standardized in gltf, I'm not sure it's trivial to fix. We may look into this in a future 4.x release. |
Okay I see the other usecase is convering a node into a sort of placeholder StaticBody3D with no known collision shape attached. is that correct? That might be possible to get working for 4.0 by removing the check for I might be in favor of this. It means imported scenes will not be fully functional since they will be missing collision shapes, but it will provide a space to add your own. Is this what you all are expecting? |
Very simple example, two meshes - one which generates polygonal collision shape, the other should generate primitive box collider - but does not. |
Hi! I just checked Empty export from Blender (v3.6.5) to Godot (v4.1.1) and it still doesn't work (tested with sphere and cube). It seems like a great option to have, allowing us to use primitive shapes instead of complex ones for collisions ;) It seems that this issue hasn't been fixed in a while, do you think that's going to change anytime soon? If not, perhaps the documentation could be updated? |
Godot version:
Both 3.1.1 and 202440a
OS/device including version:
Ubuntu 19.10
Issue description:
Documentation on import hints states that:
However, when importing a glTF file with such an empty into Godot, it just turns into a Spatial node as such:
A Collada file exported from the same Blender scene shows the expected behavior:
where
Cube3-TestColonly
is a StaticBody andBoxShape
is a CollisionShapeSteps to reproduce:
Import a glTF file exported from a Blender scene that includes an empty having
-colonly
appended to its nameObserve that the empty has turned into a Spatial node insteal of a StaticBody
Minimal reproduction project:
glTF import test.zip
The project directory also includes the Blender (2.80) file used to export the glb and dae (with Better Collada exporter) files.
The node of interest is
Cube3-TestColonly
, other ones are here to showcase other kind of import hints.The text was updated successfully, but these errors were encountered: