-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
BoxShape3D and RectangleShape2D has incorrect size after project conversion due to change how size/extents are treated in 4.x #77931
Comments
BoxShape3D already handles |
Are you saying BoxShape3D already deals with the old |
Yes godot/scene/resources/box_shape_3d.cpp Lines 60 to 65 in 0a0132c
|
Ah okay. So the issue is with BoxShape3D doing the conversion and the project converter doing it as well? I converted my project a while ago, so it may be that it wasn't handled by the converter back then, or maybe some other weirdness happened. Either way the size of all of them was half what it should be and I ended up writing some regex stuff to go through and fix all 300+ instances in my project |
Hmm I looked into |
It's in another file godot/editor/renames_map_3_to_4.cpp Line 1101 in 300748e
|
Yes I found that as well. A really weird thing just happened. So I used my local version of Godot (did Its just a simple scene with a CSGBox3D. Weird thing is: In Godot 3.5 (Steam version), the size was (2, 4, 6) but after converting it to Godot 4 using my engine version (I changed nothing in the converter files), the size was (1, 4, 6)... Can anyone explain why that would happen? |
Sorry I forgot to test out BoxShape3D. So, updated project: Converting this project ("Convert full project") also produces that (1, 4, 6) size on the CSG node, but leaves the newly added CollisionShape3D with a BoxShape of size (2, 4, 6) at that exact size. So does the conversion not work? Can someone else try this out? |
Seems like 3.x CSGBox had width/height/depth properties instead of size. In your scene:
It's missing |
@KoBeWi 90% sure this is the case but I can't check as my CSG-using project is broken by an attempt to convert to 4.x |
Can confirm that adding width to the G3 project's
And gives you a box sized (2, 4, 6). I never used 3.x so I'm unclear whether it omits dimensions if the values are default size. |
Default values are not stored. |
So a fix for this would either be 1) something that adds a line |
Hii everyone, I am working on this issue! Just trying to understand the changes needed on LightmapGI so I can safely delete the conversion from the renames_map_3_to_4.cpp file |
Can this be changed to include CollisionShape2D? (Also is imported at half the size due to extents changing) |
Trying to solve the problem, I commented the line godot/editor/renames_map_3_to_4.cpp Line 1101 in 300748e
But this arrived a new issue: when trying to access your own extents property (on a ReflectionProbe converted script, for example), Godot 4 rises the error Identifier 'extents' not declared in the current scope . However, if you use self.extents it works fine. So, removing the extents rename causes this type of script error as a side effect.Should I create a PR to solve this issue and open a new issue to deal with this side effect? Or should we try to solve everything at once? |
I think script errors are ok, because you can see that something is wrong. In case of scenes the values are silently lost. |
Godot version
v4.1.dev.custom_build [0a0132c]
System information
Windows 10
Issue description
When converting a project from 3 to 4, any BoxShape3D resources will end up being half the size they were in Godot 3.x
This seems to be due to the fact BoxShape3D's dimensions were defined by half extents, and now Godot 4.x uses full extents.
So a BoxShape3D that had extents of 1,1,1 in Godot 3 was actually 2m x 2m x 2m, whereas now in Godot 4 those same values would be treated as 1m x 1m x 1m
Steps to reproduce
Create a Godot 3.x project with a BoxShape3D shape as part of a collider
Convert the project to 4.x using the project converter and open it
Notice that the BoxShape3D now appears to be half the size in the editor despite the values being the same
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: