From 970b24ec407060bce80f2159fc69cd4a4ad26d0f Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:52:18 +0300 Subject: [PATCH] Fix 3DShapeEdit option values not updating when selecting 3D objects --- src/Tools/3DTools/3DShapeEdit.gd | 2 +- src/Tools/3DTools/3DShapeEdit.tscn | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Tools/3DTools/3DShapeEdit.gd b/src/Tools/3DTools/3DShapeEdit.gd index 29d841614..b68a99e9c 100644 --- a/src/Tools/3DTools/3DShapeEdit.gd +++ b/src/Tools/3DTools/3DShapeEdit.gd @@ -359,7 +359,7 @@ func _set_node_values(to_edit: Object, properties: Dictionary) -> void: if property_path.ends_with("v2"): property_path = property_path.replace("v2", "") var value = to_edit.get_indexed(property_path) - if not is_instance_valid(value): + if value == null: continue if "scale" in prop: value *= 100 diff --git a/src/Tools/3DTools/3DShapeEdit.tscn b/src/Tools/3DTools/3DShapeEdit.tscn index 01cc9c90f..564f56fe4 100644 --- a/src/Tools/3DTools/3DShapeEdit.tscn +++ b/src/Tools/3DTools/3DShapeEdit.tscn @@ -6,7 +6,7 @@ [ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="4"] [ext_resource type="Script" path="res://src/UI/Nodes/ValueSlider.gd" id="5"] [ext_resource type="Script" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="6"] -[ext_resource type="PackedScene" path="res://src/UI/Nodes/ValueSliderV3.tscn" id="7"] +[ext_resource type="PackedScene" uid="uid://dpoteid430evf" path="res://src/UI/Nodes/ValueSliderV3.tscn" id="7"] [sub_resource type="InputEventAction" id="InputEventAction_8sqgw"] action = &"delete" @@ -31,10 +31,9 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 mouse_default_cursor_shape = 2 -item_count = 1 selected = 0 +item_count = 1 popup/item_0/text = "None" -popup/item_0/id = 0 [node name="NewObjectMenuButton" type="MenuButton" parent="HandleObjects" index="2"] unique_name_in_owner = true @@ -80,10 +79,9 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 mouse_default_cursor_shape = 2 -item_count = 3 selected = 0 +item_count = 3 popup/item_0/text = "Perspective" -popup/item_0/id = 0 popup/item_1/text = "Orthogonal" popup/item_1/id = 1 popup/item_2/text = "Frustum" @@ -552,7 +550,7 @@ focus_mode = 2 mouse_default_cursor_shape = 2 theme_type_variation = &"ValueSlider" min_value = 1.0 -max_value = 10.0 +max_value = 128.0 value = 1.0 allow_greater = true nine_patch_stretch = true @@ -561,6 +559,7 @@ stretch_margin_top = 3 stretch_margin_right = 3 stretch_margin_bottom = 3 script = ExtResource("5") +snap_step = 2.0 [node name="MeshOffsetLabel" type="Label" parent="ObjectOptions/MeshOptions/GridContainer" index="26"] layout_mode = 2 @@ -614,10 +613,9 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 mouse_default_cursor_shape = 2 -item_count = 3 selected = 0 +item_count = 3 popup/item_0/text = "Left" -popup/item_0/id = 0 popup/item_1/text = "Center" popup/item_1/id = 1 popup/item_2/text = "Right" @@ -634,10 +632,9 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 mouse_default_cursor_shape = 2 -item_count = 3 selected = 0 +item_count = 3 popup/item_0/text = "Top" -popup/item_0/id = 0 popup/item_1/text = "Center" popup/item_1/id = 1 popup/item_2/text = "Bottom"