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

CylinderShape and HeightMapShape GodotPhysics error on project startup (due to EditorHelp generation) #32216

Closed
Tracked by #39196 ...
Xrayez opened this issue Sep 20, 2019 · 7 comments

Comments

@Xrayez
Copy link
Contributor

Xrayez commented Sep 20, 2019

Godot version:
3.2-alpha, 2add51d

OS/device including version:
Windows 10

Issue description:
Opening a project without Bullet module compiled leads to these errors (I'm working on a 2D project).

ERROR: CylinderShape is not supported in GodotPhysics. Please switch to Bullet in the Project Settings.
   At: servers\physics\physics_server_sw.cpp:73
ERROR: RID_Owner<class ShapeSW>::get: Condition ' !p_rid.is_valid() ' is true. returned: 0
   At: .\core/rid.h:149
ERROR: PhysicsServerSW::shape_set_data: Condition ' !shape ' is true.
   At: servers\physics\physics_server_sw.cpp:103
ERROR: Invalid ID.
   At: servers\physics\physics_server_sw.cpp:1400

Also present along with #32217.

Steps to reproduce:

  1. Compile with scons platform=windows tools=yes target=debug bits=64 module_bullet_enabled=no
  2. Start up any project.

Expected behavior:
No errors on project startup when Bullet-related physics are not used in the project.

CC @AndreaCatania for Bullet module.

@Xrayez Xrayez changed the title CylinderShape is not supported in GodotPhysics error with disabled Bullet module CylinderShape GodotPhysics error with disabled Bullet module on project startup Sep 20, 2019
@akien-mga
Copy link
Member

akien-mga commented Oct 1, 2020

To clarify, the error is expected if one uses CylinderShape in a GodotPhysics project, as it's indeed not implemented for GodotPhysics.

But the error here happens on any project, even a 2D one. The reason for that is that CylinderShape is instantiated to retrieve default values by the in-editor help:

ERROR: Condition "!shape->is_configured()" is true. Returning: Variant()
   at: shape_get_data (servers/physics_3d/physics_server_3d_sw.cpp:109)

Thread 1 "godot-git" hit Breakpoint 1, PhysicsServer3DSW::shape_create (this=0x77b46a0, p_shape=PhysicsServer3D::SHAPE_CYLINDER) at servers/physics_3d/physics_server_3d_sw.cpp:65
65                              ERR_FAIL_V_MSG(RID(), "CylinderShape3D is not supported in GodotPhysics3D. Please switch to Bullet in the Project Settings.");
(gdb) bt
#0  PhysicsServer3DSW::shape_create (this=0x77b46a0, p_shape=PhysicsServer3D::SHAPE_CYLINDER) at servers/physics_3d/physics_server_3d_sw.cpp:65
#1  0x0000000003d3b3bb in CylinderShape3D::CylinderShape3D (this=0x7ed9eb0) at scene/resources/cylinder_shape_3d.cpp:107
#2  0x00000000035e27fe in ClassDB::creator<CylinderShape3D> () at ./core/class_db.h:146
#3  0x0000000004593a7b in ClassDB::instance (p_class=...) at core/class_db.cpp:513
#4  0x0000000004599621 in ClassDB::class_get_default_property_value (p_class=..., p_property=..., r_valid=0x7fffffff7637) at core/class_db.cpp:1472
#5  0x0000000002a0c289 in get_documentation_default_value (p_class_name=..., p_property_name=..., r_default_value_valid=@0x7fffffff7637: false) at editor/doc_data.cpp:238
#6  0x0000000002a0cbc1 in DocData::generate (this=0x8ae35a0, p_basic_types=true) at editor/doc_data.cpp:329
#7  0x0000000002ab562f in EditorHelp::generate_doc () at editor/editor_help.cpp:1534
#8  0x0000000002b2fa3e in EditorNode::EditorNode (this=0x8b9d260) at editor/editor_node.cpp:5509
#9  0x0000000001a37180 in Main::start () at main/main.cpp:2060
#10 0x0000000001a01cb4 in main (argc=2, argv=0x7fffffffd6c8) at platform/linuxbsd/godot_linuxbsd.cpp:57

There's no easy fix for that, as EditorHelp processes everything registered to ClassDB. So if we want to exclude CylinderShape, we need a way to mark it as unimplemented so that EditorHelp ignores it... or we should drop it from the engine as it's weird to have built-in shapes that work only with a specific physics backend. It was added back when we expected that GodotPhysics would eventually be removed completely, but this is no longer the plan.

@akien-mga akien-mga self-assigned this Oct 1, 2020
@akien-mga akien-mga changed the title CylinderShape GodotPhysics error with disabled Bullet module on project startup CylinderShape and HeightMapShape GodotPhysics error with disabled Bullet module on project startup (due to EditorHelp generation) Oct 1, 2020
@akien-mga akien-mga added this to the 4.0 milestone Oct 1, 2020
@akien-mga
Copy link
Member

For the reference, the currently closed PR #32272 would have been a possible fix for this indeed. #32272 (comment) might need to be re-evaluated (if they're meant to be implemented, we could add stubs to avoid the errors, if not, they should be bullet only).

@madmiraal madmiraal changed the title CylinderShape and HeightMapShape GodotPhysics error with disabled Bullet module on project startup (due to EditorHelp generation) CylinderShape and HeightMapShape GodotPhysics error on project startup (due to EditorHelp generation) Oct 1, 2020
@madmiraal
Copy link
Contributor

madmiraal commented Oct 1, 2020

Updated the title, because these errors are generated just by enabling Godot physics:

ERROR: Condition "!shape->is_configured()" is true. Returning: Variant()
   at: shape_get_data (servers/physics_3d/physics_server_3d_sw.cpp:109)
ERROR: CylinderShape3D is not supported in GodotPhysics3D. Please switch to Bullet in the Project Settings.
   at: shape_create (servers/physics_3d/physics_server_3d_sw.cpp:65)
ERROR: Condition "!shape" is true.
   at: shape_set_data (servers/physics_3d/physics_server_3d_sw.cpp:90)
ERROR: Invalid ID.
   at: free (servers/physics_3d/physics_server_3d_sw.cpp:1281)
ERROR: Condition "!d.has("cell_size")" is true.
   at: set_data (servers/physics_3d/shape_3d_sw.cpp:1491)
ERROR: Condition "!body" is true.
   at: body_attach_object_instance_id (servers/physics_3d/physics_server_3d_sw.cpp:611)
ERROR: Invalid ID.
   at: free (servers/physics_3d/physics_server_3d_sw.cpp:1281)

@Xrayez
Copy link
Contributor Author

Xrayez commented Oct 1, 2020

IIRC, this wasn't an issue back in 3.2-alpha, because GodotPhysics is what I've been using all this time for 2D, and could only be reproduced by module_bullet_enabled=no, I wonder what has possibly changed since then.

@akien-mga
Copy link
Member

akien-mga commented Oct 1, 2020

IIRC, this wasn't an issue back in 3.2-alpha, because GodotPhysics is what I've been using all this time for 2D, and could only be reproduced by module_bullet_enabled=no, I wonder what has possibly changed since then.

This is due to #29380 which queries the whole API to retrieve default values for the docs. Though its merge predates this issue, so I would expect it to have raised errors with GodotPhysics selected back then too.

@akien-mga
Copy link
Member

#45854 implements support for CylinderShape3D, so that part should no longer trigger a warning. HeightMapShape3D is still missing though.

@pouleyKetchoupp
Copy link
Contributor

The last issue was fixed with #47347 so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants