Try out locking an internal node in editor

This commit is contained in:
Vojtěch Struhár 2025-02-26 16:07:43 +01:00
parent 447e821429
commit 5345386d36
2 changed files with 11 additions and 4 deletions

View File

@ -39,5 +39,10 @@ func _add_internal_cube_mesh() -> void:
mat.albedo_color = Color("ff4c4e") mat.albedo_color = Color("ff4c4e")
b.material = mat b.material = mat
# Lock the node in editor. Prevents selection (here for internal nodes)
# UNDOCUMENTED
# https://github.com/godotengine/godot-proposals/issues/3046
m.set_meta("_edit_lock_", true)
m.owner = self m.owner = self
m.position.x = 1.5 * get_child_count(true) m.position.x = 1.5 * get_child_count(true)

View File

@ -25,14 +25,16 @@ script = ExtResource("1_glqbe")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 0)
mesh = SubResource("BoxMesh_glqbe") mesh = SubResource("BoxMesh_glqbe")
[node name="MeshInstance3D3" type="MeshInstance3D" parent="."] [node name="MeshInstance3D4" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 0)
mesh = SubResource("BoxMesh_dodl2") mesh = SubResource("BoxMesh_dodl2")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."] [node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0)
mesh = SubResource("BoxMesh_j0q2q") mesh = SubResource("BoxMesh_j0q2q")
metadata/_edit_lock_ = true
[node name="MeshInstance3D4" type="MeshInstance3D" parent="."] [node name="MeshInstance3D3" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 0)
mesh = SubResource("BoxMesh_bkhqo") mesh = SubResource("BoxMesh_bkhqo")
metadata/_edit_lock_ = true