diff --git a/material_maker/panels/preview_3d/post_process_menu.gd b/material_maker/panels/preview_3d/post_process_menu.gd index 67cfc1545..1a743def1 100644 --- a/material_maker/panels/preview_3d/post_process_menu.gd +++ b/material_maker/panels/preview_3d/post_process_menu.gd @@ -94,14 +94,14 @@ func expand_panel_width() -> void: if v_scroll.visible else custom_min_width) func is_section_not_default(section : String): - var not_default := true + var not_default : bool = true for config in mm_globals.DEFAULT_CONFIG.keys(): - var key := "ui_3d_preview_" + section + var key : String = "ui_3d_preview_" + section if key in config and "enable" not in config: not_default = not_default and (mm_globals.get_config(config) == mm_globals.DEFAULT_CONFIG[config]) return not_default -func _process(_delta: float) -> void: +func _process(_delta : float) -> void: $ScrollContainer/VBoxContainer/TonemapHeader/ResetTonemapSection.disabled = is_section_not_default("tonemap") $ScrollContainer/VBoxContainer/GlowHeader/ResetGlowSection.disabled = is_section_not_default("glow") $ScrollContainer/VBoxContainer/AdjustmentHeader/ResetAdjustmentSection.disabled = is_section_not_default("adjustment") @@ -466,3 +466,6 @@ func _on_far_transition_value_changed(value: Variant) -> void: func _on_near_transition_value_changed(value: Variant) -> void: camera_attributes.dof_blur_near_transition = value mm_globals.set_config(SETTINGS_PREVIEW_DOF_NEAR_TRANSITION, value) + +func _on_visibility_changed() -> void: + set_process(is_visible_in_tree()) diff --git a/material_maker/panels/preview_3d/preview_3d.tscn b/material_maker/panels/preview_3d/preview_3d.tscn index ca6aa9e00..0f2e542d8 100644 --- a/material_maker/panels/preview_3d/preview_3d.tscn +++ b/material_maker/panels/preview_3d/preview_3d.tscn @@ -874,6 +874,7 @@ float_only = true [connection signal="item_selected" from="MainMenu/HBox/ExportMenu/ExportMenuPanel/VBoxContainer/GenerateMapsSection/ExportFile/BoxContainer/MapFileType" to="MainMenu/HBox/ExportMenu/ExportMenuPanel" method="_on_map_file_type_item_selected"] [connection signal="pressed" from="MainMenu/HBox/ExportMenu/ExportMenuPanel/VBoxContainer/GenerateMapButton" to="MainMenu/HBox/ExportMenu/ExportMenuPanel" method="_on_generate_map_button_pressed"] [connection signal="minimum_size_changed" from="MainMenu/HBox/PostProcessMenu/PostProcessPanel" to="MainMenu/HBox/PostProcessMenu/PostProcessPanel" method="_on_minimum_size_changed"] +[connection signal="visibility_changed" from="MainMenu/HBox/PostProcessMenu/PostProcessPanel" to="MainMenu/HBox/PostProcessMenu/PostProcessPanel" method="_on_visibility_changed"] [connection signal="minimum_size_changed" from="MainMenu/HBox/PostProcessMenu/PostProcessPanel/ScrollContainer" to="MainMenu/HBox/PostProcessMenu/PostProcessPanel" method="_on_scroll_container_minimum_size_changed"] [connection signal="minimum_size_changed" from="MainMenu/HBox/PostProcessMenu/PostProcessPanel/ScrollContainer/VBoxContainer" to="MainMenu/HBox/PostProcessMenu/PostProcessPanel" method="_on_v_box_container_minimum_size_changed"] [connection signal="toggled" from="MainMenu/HBox/PostProcessMenu/PostProcessPanel/ScrollContainer/VBoxContainer/TonemapHeader/Tonemap" to="MainMenu/HBox/PostProcessMenu/PostProcessPanel" method="_on_tonemap_toggled"]