godotengine / godotengine/godot
Converting TileMap to TileMapLayer adds extraneous Property (use_kinematic_bodies) in .tscn file
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in 4.4.1
- Ubuntu 20.04.6 LTS
### System information
Godot v4.4.1.stable - Ubuntu 20.04.6 LTS (Focal Fossa) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - integrated Intel(R) UHD Graphics (CML GT2) - Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz (12 threads)
### Issue description
I was re-creating a demo-project manually, in 4.4.1, and created a TileMapLayer (after seeing that TileMap was deprecated), but it didn't work like the demo I was copying. Looking further, the demo-project was 4.3, and I had converted it to 4.4.1, to compare, and discovered some anomalies in the newly node-transformed TileMapLayer. It had the property `use_kinematic_bodies = true` in two places, in the .tscn file, and when I checked/unchecked the Property checkbox in the Editor tab, it removed only one of them. So there was a case where the .tscn file had the property set to True, but in the Editor, it showed as unchecked. (Took me a long time to debug that, comparing my broken project to the working demo-project, too).
```
$:~/Code/test/book_jungle_jump$ grep -rni use_kinematic_bodies .
./moving_platform.tscn:11:use_kinematic_bodies = true
./moving_platform.tscn:17:use_kinematic_bodies = true
```
### Steps to reproduce
Step 0: get initial, unconverted TileMap
git checkout Step-0-PreConvertTileMap
- note that there is a TileMap, with "collision_animatable=true".
- I'm not sure that's required, it seemed to generate the property either way
Step 1: Extract TileMap Layers
either manually do:
- Select TileMap
- click toolkit "Extract TileMap layers as individual TileMapLayer nodes"
or
git checkout Step01-ExtractTileMap-Layers
Step 1 Results:
There is a "use_kinematic_bodies = true" in the .tscn file
git diff moving_platform.tscn
+[node name="Layer0" type="TileMapLayer" parent="TileMap"]
+use_parent_material = true
+tile_map_data = PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 14, 0, 0, 0, 1, 0, 0, 0, 0, 0, 17, 0, 14, 0, 0, 0, 2, 0, 0, 0, 0, 0, 17, 0, 14, 0, 0, 0, 3, 0,
+tile_set = ExtResource("2_iov41")
+use_kinematic_bodies = true
Step 2: Convert TileMap to TileMapLayer
either manually do:
- Select TileMap
- right-click->Change Type->TileMapLayer
or
git checkout Step02-ConvertTileMap-to-TileMapLayer
Step 2 Results:
There is a "use_kinematic_bodies = true", although in the Editor, the checkbox is not checked.
$ tail -6 moving_platform.tscn
[node name="Layer0" type="TileMapLayer" parent="TileMap"]
use_parent_material = true
tile_map_data = PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 14, 0, 0, 0, 1, 0, 0, 0, 0, 0, 17, 0, 14, 0, 0, 0, 2, 0, 0, 0, 0, 0, 17, 0, 14, 0, 0, 0, 3, 0, 0,
tile_set = ExtResource("2_iov41")
use_kinematic_bodies = true
Step 3: Check the box for "use_kinematic_bodies = true", save file
Step 3 Results:
There are two identical lines in the .tscn file, one of which doesn't show up in the Editor
$ grep -rni use_kinematic_bodies .
./moving_platform.tscn:11:use_kinematic_bodies = true
./moving_platform.tscn:17:use_kinematic_bodies = true
### Minimal reproduction project (MRP)
[repro_error.zip](https://github.com/user-attachments/files/20509020/repro_error.zip)
Contributor guide
Assessment
This issue has not been assessed yet.