Skip to content
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

GLB assets configured with "Decompose Convex" colliders now loading with "Trimesh" #93501

Closed
Malcolmnixon opened this issue Jun 23, 2024 · 3 comments · Fixed by #93506
Closed

Comments

@Malcolmnixon
Copy link
Contributor

Tested versions

Godot 4.3-beta2

System information

Windows 11, gl_compatibility, NVidia RTX 3070 TI

Issue description

I have numerous asset libraries constructed with Godot 4.2 and containing GLB files configured with different physics colliders, including:

  • Simple Convex
  • Box
  • Decompose Convex
  • Manually Constructed Colliders

In Godot 4.3-beta.2 all the "Decompose Convex" GLB files are instead coming in with Trimesh colliders.

Steps to reproduce

  1. Open/Create Godot 4.2 Project
  2. Add GLB file
  3. Configure GLB file for Decompose Convex physics body
  4. Close project and clear .godot folder
  5. Reopen project in Godot 4.3-beta2
  6. Observe GLB has physics body of Trimesh

Minimal reproduction project (MRP)

N/A

@Malcolmnixon
Copy link
Contributor Author

This appears to have been caused by #89461 which switched the default physics shape type from Decompose Convex to Trimesh. The comment stated it should not break compatibility as the shape_type should have been serialized.

At least for Godot 4.2 that isn't the case and the physics/shape_type = 0 line is not written to the file. It is written for Godot 4.3; but that does no good for earlier projects.

@BastiaanOlij
Copy link
Contributor

Just to add some more info to this for people wanting to reproduce why this is an issue.

Clone: https://github.com/Malcolmnixon/KayKitDungeon
Check out commit d8f6476c9e1bb80523489a7d10b59d1f701cc061 (the current master we've manually hacked the physics/shape_type setting in there.

Looking at the file behind the scenes, we can see that files where shape_type is non-zero, but files that have the shape_type set to 0 are missing. For instance bottle_A_brown.gltf which is one of the shapes that users can pick up:

image

Opening this up in Godot 4.2.2 we can verify that the asset is correctly setup:

image

Saving this asset with a different shape type, I can see the shape type being added to the .import file, changing it back to Decompose Convex, the entry is removed from the file.
The assumption @reduz made that this is saved in earlier versions is thus false.

Opening this project in Godot 4.3 beta 2, the setting is still not saved in the .import file, but we can now see that it's using:
image

Now here it gets a bit tricky as to why we're making a big deal of it. In Godot XR we make it possible for the player to pick these objects up and throw them around. We need them as RigidBody3Ds.
So:

  • we inherit a scene (addons/godot-xr-tools/objects/pickable.tscn) that has all the logic that allows picking up objects,
  • we add our GLB to this scene
  • we copy our shape to our collision shape node for our rigidbody
  • and we disable the static body.

And we get this wonderful warning:
image

So the collision shape that we have now set as the default, has a big warning that it won't work for rigidbodies. We don't know the fallout of this yet, but I've seen an uptick of support questions on the discord about pickable objects no longer working in XR tools and am wondering if this is the root cause.

At the very least the default needs to be returned so that we get consistent behaviour.

@fire
Copy link
Member

fire commented Jun 27, 2024

Approved the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Release Blocker
Development

Successfully merging a pull request may close this issue.

4 participants