Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions material_maker/nodes/tones/tones.gd
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ func _on_Auto_pressed():
if in_mid_value < value:
in_mid = i
in_mid_value = value
get_parent().undoredo.start_group()
cursor_in_min.update_value(float(in_min)/float(histogram_size-1))
cursor_in_mid.update_value(float(in_mid)/float(histogram_size-1))
cursor_in_max.update_value(float(in_max)/float(histogram_size-1))
get_parent().undoredo.end_group()


func _on_reset_pressed() -> void:
get_parent().undoredo.start_group()
cursor_in_min.update_value(0.0)
cursor_in_mid.update_value(0.5)
cursor_in_max.update_value(1.0)
cursor_out_min.update_value(0.0)
cursor_out_max.update_value(1.0)
get_parent().undoredo.end_group()
18 changes: 15 additions & 3 deletions material_maker/nodes/tones/tones.tscn
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
[gd_scene load_steps=5 format=3 uid="uid://7wslfieqleli"]
[gd_scene load_steps=7 format=3 uid="uid://7wslfieqleli"]

[ext_resource type="PackedScene" uid="uid://0b6d65sghy3s" path="res://material_maker/widgets/histogram/histogram.tscn" id="1"]
[ext_resource type="Script" uid="uid://nbk6k40bfmwi" path="res://material_maker/nodes/tones/tones.gd" id="2"]
[ext_resource type="Texture2D" uid="uid://c0j4px4n72di5" path="res://material_maker/icons/icons.tres" id="3"]
[ext_resource type="Texture2D" uid="uid://cvorvnes6fiq7" path="res://material_maker/icons/icons.svg" id="2_o4mha"]
[ext_resource type="Texture2D" uid="uid://1s0c37uoj4rf" path="res://material_maker/theme/default_theme_icons.svg" id="3_hpd32"]

[sub_resource type="AtlasTexture" id="1"]
atlas = ExtResource("3")
atlas = ExtResource("2_o4mha")
region = Rect2(16, 80, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_jb2ll"]
atlas = ExtResource("3_hpd32")
region = Rect2(80, 192, 16, 16)

[node name="Tones" type="GraphNode"]
offset_right = 192.0
offset_bottom = 141.0
Expand Down Expand Up @@ -77,6 +82,12 @@ size_flags_vertical = 4
tooltip_text = "Set levels automatically"
texture_normal = SubResource("1")

[node name="Reset" type="TextureButton" parent="Bar"]
layout_mode = 2
size_flags_vertical = 4
tooltip_text = "Reset levels"
texture_normal = SubResource("AtlasTexture_jb2ll")

[node name="Spacer1" type="Control" parent="."]
custom_minimum_size = Vector2(0, 4)
layout_mode = 2
Expand All @@ -91,3 +102,4 @@ layout_mode = 2

[connection signal="item_selected" from="Bar/Mode" to="." method="_on_Mode_item_selected"]
[connection signal="pressed" from="Bar/Auto" to="." method="_on_Auto_pressed"]
[connection signal="pressed" from="Bar/Reset" to="." method="_on_reset_pressed"]
71 changes: 67 additions & 4 deletions material_maker/theme/default_theme_icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading