mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-23 21:16:54 +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:
|
||||
set_need_save(true)
|
||||
timer.start(0.1)
|
||||
timer.stop()
|
||||
timer.start(0.2)
|
||||
|
||||
func do_send_changed_signal() -> void:
|
||||
emit_signal("graph_changed")
|
||||
|
@ -6,6 +6,9 @@ var recent_files = []
|
||||
var editor_interface = null
|
||||
var current_tab = null
|
||||
|
||||
var updating : bool = false
|
||||
var need_update : bool = false
|
||||
|
||||
onready var renderer = $Renderer
|
||||
onready var projects = $VBoxContainer/HBoxContainer/ProjectsPane/Projects
|
||||
onready var library = $VBoxContainer/HBoxContainer/VBoxContainer/Library
|
||||
@ -405,8 +408,20 @@ func _on_PopupMenu_id_pressed(id) -> void:
|
||||
# Preview
|
||||
|
||||
func update_preview() -> void:
|
||||
update_preview_2d()
|
||||
update_preview_3d()
|
||||
var status
|
||||
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:
|
||||
var graph_edit : MMGraphEdit = get_current_graph_edit()
|
||||
|
Loading…
Reference in New Issue
Block a user