-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Fix collision shape debug color breaking GDExtension #100317
Fix collision shape debug color breaking GDExtension #100317
Conversation
Thanks! I agree that we shouldn't be conditionally binding these methods - the methods should always exist. However, do we always want them to actually do something? Is it possible to show debug shapes in release builds? If so, then, yes, then this PR is probably the way to go. But if debug shapes can only be shown in editor or debug builds, then we probably want to remove the functionality in release builds, and just keep the method registration. |
I'm honestly not sure. I've personally never used debug colors. But I did reference how it is done on the 2d side, and it does look like these ones are functional in release builds and do not differentiate with DEBUG_ENABLED define symbols: I'll let someone with additional expertise on this area of code comment though. @dsnopek any idea who we should cc? |
|
@dalexeev sounds good! I'll update the pr! :) |
147435b
to
fd232ed
Compare
@dalexeev The PR has been updated. Let me know if you have any other suggestions :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
fd232ed
to
f0c077d
Compare
Thanks! |
This fixes #100313.
Issue description copied in below:
Tested versions
System information
N/A
Issue description
Discovered when using Rust gdext here: https://github.com/godot-rust/gdext
I've found exactly what is causing the issue. Its because Godot only binds these methods in debug and editor builds:
https://github.com/godotengine/godot/blob/38775731e8494a28deddc3febda895679f49fd6e/scene/3d/physics/collision_shape_3d.cpp#L183C1-L195C24
And don't let the
DEBUG_ENABLED
fool you like it did me. That is not only indicating a debug build. That is indicating it is an editor or debug build as can be seen in theSConstruct
here:godot/SConstruct
Line 475 in 3877573
I'm thinking the proper solution is to support these debug colors even in release builds. Especially since we do for collision_shape_2d: https://github.com/godotengine/godot/blob/38775731e8494a28deddc3febda895679f49fd6e/scene/2d/physics/collision_shape_2d.cpp#L269C1-L288C2
Steps to reproduce
Invoke the godot editor with the
--dump-extension-api
arg. Then inspect theextension_api.json
and see thatset_debug_color
,get_debug_color
, and other related methods that are only available in debug and editor builds are dumped for CollisionShape3D.Proposed Solution:
Allow these methods in all builds the same way we do for ColisionShape2D.
Minimal reproduction project (MRP)
N/A