godotengine / godotengine/godot
Extending from an abstract class bloats the `tscn` file with properties with default values
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Godot Engine v4.2.1
### System information
Godot v4.2.1.stable (b09f793f5) - Freedesktop SDK 23.08 (Flatpak runtime) - X11 - GLES3 (Compatibility) - AMD Radeon Vega 8 Graphics (radeonsi, raven, LLVM 17.0.6, DRM 3.42, 5.15.0-91-generic) () - AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (8 Threads)
### Issue description
As the title suggests.
The following is the (partial) content of the `tscn` file that I got when I did the `steps to reproduce` below:
```
[gd_scene load_steps=2 format=3 uid="uid://c0rcsci2apet4"]
[ext_resource type="Script" path="res://test1.gd" id="1_iw8vt"]
[node name="Test" type="Control"]
layout_mode = 3
anchors_preset = 0
[node name="TestClass" type="BaseButton" parent="."]
_import_path = NodePath("")
unique_name_in_owner = false
process_mode = 0
process_priority = 0
process_physics_priority = 0
process_thread_group = 0
editor_description = ""
visible = true
modulate = Color(1, 1, 1, 1)
self_modulate = Color(1, 1, 1, 1)
show_behind_parent = false
top_level = false
clip_children = 0
light_mask = 1
visibility_layer = 1
z_index = 0
z_as_relative = true
y_sort_enabled = false
texture_filter = 0
texture_repeat = 0
material = null
use_parent_material = false
clip_contents = false
custom_minimum_size = Vector2(0, 0)
layout_direction = 0
layout_mode = 0
anchors_preset = 0
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
offset_left = 0.0
offset_top = 0.0
offset_right = 40.0
offset_bottom = 40.0
(and so on)
```
### Steps to reproduce
- Create a new script with the following code:
```
class_name TestClass
extends BaseButton # I only tested BaseButton & Range
```
- Create a new scene, then add the `TestClass` as a child node.
### Minimal reproduction project (MRP)
n/a
Contributor guide
Research direction
Start by reproducing the issue with Godot v4.2.1 using the TestClass script extending BaseButton and inspect the resulting .tscn file. No source file, test, or entry point is named; trace the scene-saving path and verify that adding the abstract-derived node no longer writes unnecessary default-valued properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100