mirror of
https://github.com/Relintai/material-maker.git
synced 2025-01-13 07:41:14 +01:00
updtaed preview refresh code to avoir queueing many refreshes when tweaking parameters
This commit is contained in:
parent
df07cfab06
commit
e341e25e7f
@ -289,7 +289,8 @@ func paste(pos = Vector2(0, 0)) -> void:
|
|||||||
|
|
||||||
func send_changed_signal() -> void:
|
func send_changed_signal() -> void:
|
||||||
set_need_save(true)
|
set_need_save(true)
|
||||||
timer.start(0.1)
|
timer.stop()
|
||||||
|
timer.start(0.2)
|
||||||
|
|
||||||
func do_send_changed_signal() -> void:
|
func do_send_changed_signal() -> void:
|
||||||
emit_signal("graph_changed")
|
emit_signal("graph_changed")
|
||||||
|
@ -6,6 +6,9 @@ var recent_files = []
|
|||||||
var editor_interface = null
|
var editor_interface = null
|
||||||
var current_tab = null
|
var current_tab = null
|
||||||
|
|
||||||
|
var updating : bool = false
|
||||||
|
var need_update : bool = false
|
||||||
|
|
||||||
onready var renderer = $Renderer
|
onready var renderer = $Renderer
|
||||||
onready var projects = $VBoxContainer/HBoxContainer/ProjectsPane/Projects
|
onready var projects = $VBoxContainer/HBoxContainer/ProjectsPane/Projects
|
||||||
onready var library = $VBoxContainer/HBoxContainer/VBoxContainer/Library
|
onready var library = $VBoxContainer/HBoxContainer/VBoxContainer/Library
|
||||||
@ -405,8 +408,20 @@ func _on_PopupMenu_id_pressed(id) -> void:
|
|||||||
# Preview
|
# Preview
|
||||||
|
|
||||||
func update_preview() -> void:
|
func update_preview() -> void:
|
||||||
update_preview_2d()
|
var status
|
||||||
update_preview_3d()
|
need_update = true
|
||||||
|
if updating:
|
||||||
|
return
|
||||||
|
updating = true
|
||||||
|
while need_update:
|
||||||
|
need_update = false
|
||||||
|
status = update_preview_2d()
|
||||||
|
while status is GDScriptFunctionState:
|
||||||
|
status = yield(status, "completed")
|
||||||
|
status = update_preview_3d()
|
||||||
|
while status is GDScriptFunctionState:
|
||||||
|
status = yield(status, "completed")
|
||||||
|
updating = false
|
||||||
|
|
||||||
func update_preview_2d(node = null) -> void:
|
func update_preview_2d(node = null) -> void:
|
||||||
var graph_edit : MMGraphEdit = get_current_graph_edit()
|
var graph_edit : MMGraphEdit = get_current_graph_edit()
|
||||||
|
Loading…
Reference in New Issue
Block a user