fix severe lag issue when recording for more than like 20 seconds
This commit is contained in:
parent
8a6c19732a
commit
e3b2679f95
4 changed files with 30 additions and 32 deletions
|
@ -5,17 +5,10 @@
|
||||||
[node name="MovementFrameIndicator" type="Control"]
|
[node name="MovementFrameIndicator" type="Control"]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_right = 2.0
|
|
||||||
offset_bottom = 32.0
|
|
||||||
script = ExtResource("1_ttcva")
|
script = ExtResource("1_ttcva")
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="."]
|
[node name="ColorRect" type="ColorRect" parent="."]
|
||||||
layout_mode = 1
|
layout_mode = 0
|
||||||
anchors_preset = -1
|
offset_right = 2.0
|
||||||
anchor_left = 1.0
|
offset_bottom = 32.0
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
offset_left = -2.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
grow_vertical = 2
|
|
||||||
color = Color(0.0941176, 0.0941176, 0.0941176, 1)
|
color = Color(0.0941176, 0.0941176, 0.0941176, 1)
|
||||||
|
|
|
@ -5,17 +5,10 @@
|
||||||
[node name="MovementFrameIndicator" type="Control"]
|
[node name="MovementFrameIndicator" type="Control"]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_right = 2.0
|
|
||||||
offset_bottom = 32.0
|
|
||||||
script = ExtResource("1_2om8h")
|
script = ExtResource("1_2om8h")
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="."]
|
[node name="ColorRect" type="ColorRect" parent="."]
|
||||||
layout_mode = 1
|
layout_mode = 0
|
||||||
anchors_preset = -1
|
offset_right = 2.0
|
||||||
anchor_left = 1.0
|
offset_bottom = 32.0
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
offset_left = -2.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
grow_vertical = 2
|
|
||||||
color = Color(0, 1, 0, 1)
|
color = Color(0, 1, 0, 1)
|
||||||
|
|
|
@ -13,8 +13,8 @@ signal return_to_zero()
|
||||||
func update_time_label() -> void:
|
func update_time_label() -> void:
|
||||||
var frames = index % 60
|
var frames = index % 60
|
||||||
var seconds = floori(index/60) % 60
|
var seconds = floori(index/60) % 60
|
||||||
var minutes = floori(index/360) % 60
|
var minutes = floori(index/3600) % 60
|
||||||
var hours = floori(index/7200)
|
var hours = floori(index/216000)
|
||||||
$SequencerPanel/TransportControls/TimeLabel.text = "%d:%02d:%02d:%02d" % [hours, minutes, seconds, frames]
|
$SequencerPanel/TransportControls/TimeLabel.text = "%d:%02d:%02d:%02d" % [hours, minutes, seconds, frames]
|
||||||
#$SequencerPanel/TransportControls/TimeLabel.text = str(index)
|
#$SequencerPanel/TransportControls/TimeLabel.text = str(index)
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ var playback_held_on_previous_frame : bool = false
|
||||||
var etching: bool = false
|
var etching: bool = false
|
||||||
var recording : bool = false
|
var recording : bool = false
|
||||||
var playing : bool = true
|
var playing : bool = true
|
||||||
|
var current_block_indicator
|
||||||
|
|
||||||
signal movement_in(movement, rate)
|
signal movement_in(movement, rate)
|
||||||
signal movement_out(movement, rate)
|
signal movement_out(movement, rate)
|
||||||
|
@ -24,18 +25,20 @@ signal movement_out(movement, rate)
|
||||||
func set_at_current() -> void:
|
func set_at_current() -> void:
|
||||||
if (current_index > self.movements.size()-1): self.movements.append(true)
|
if (current_index > self.movements.size()-1): self.movements.append(true)
|
||||||
else: self.movements.set(current_index, true)
|
else: self.movements.set(current_index, true)
|
||||||
var indicator = load("res://Scenes/GUI/Controls/MovementFrameIndicatorOn.tscn")
|
if (check_at_index(current_index-1)): current_block_indicator.get_node("ColorRect").size.x += 2
|
||||||
var instance = indicator.instantiate()
|
else:
|
||||||
instance.x_offset = current_index * 2
|
current_block_indicator = load("res://Scenes/GUI/Controls/MovementFrameIndicatorOn.tscn").instantiate()
|
||||||
$MovementsBG/InvisibleMask/MovementsHandle.add_child(instance)
|
current_block_indicator.position.x = current_index * 2
|
||||||
|
$MovementsBG/InvisibleMask/MovementsHandle.add_child(current_block_indicator)
|
||||||
|
|
||||||
func unset_at_current() -> void:
|
func unset_at_current() -> void:
|
||||||
if (current_index > self.movements.size()-1): self.movements.append(false)
|
if (current_index > self.movements.size()-1): self.movements.append(false)
|
||||||
else: self.movements.set(current_index, false)
|
else: self.movements.set(current_index, false)
|
||||||
var indicator = load("res://Scenes/GUI/Controls/MovementFrameIndicatorOff.tscn")
|
if (!check_at_index(current_index-1)): current_block_indicator.get_node("ColorRect").size.x += 2
|
||||||
var instance = indicator.instantiate()
|
else:
|
||||||
instance.x_offset = current_index * 2
|
current_block_indicator = load("res://Scenes/GUI/Controls/MovementFrameIndicatorOff.tscn").instantiate()
|
||||||
$MovementsBG/InvisibleMask/MovementsHandle.add_child(instance)
|
current_block_indicator.position.x = current_index * 2
|
||||||
|
$MovementsBG/InvisibleMask/MovementsHandle.add_child(current_block_indicator)
|
||||||
|
|
||||||
func check_at_current() -> bool:
|
func check_at_current() -> bool:
|
||||||
if (current_index > self.movements.size()-1): return false
|
if (current_index > self.movements.size()-1): return false
|
||||||
|
@ -43,9 +46,17 @@ func check_at_current() -> bool:
|
||||||
if (out == null): return false
|
if (out == null): return false
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
func check_at_index(cindex: int) -> bool:
|
||||||
|
if (cindex > self.movements.size()-1): return false
|
||||||
|
if (cindex < 0): return false
|
||||||
|
var out = self.movements.get(cindex)
|
||||||
|
if (out == null): return false
|
||||||
|
return out
|
||||||
|
|
||||||
func _step(amount: int):
|
func _step(amount: int):
|
||||||
if (recording && etching): set_at_current()
|
if (recording):
|
||||||
elif (recording && !etching): unset_at_current()
|
if (etching): set_at_current()
|
||||||
|
else: unset_at_current()
|
||||||
if (playing):
|
if (playing):
|
||||||
if (check_at_current()):
|
if (check_at_current()):
|
||||||
if (!playback_held_on_previous_frame):
|
if (!playback_held_on_previous_frame):
|
||||||
|
@ -102,6 +113,7 @@ func _ready() -> void:
|
||||||
editor.start_recording.connect(_start_recording)
|
editor.start_recording.connect(_start_recording)
|
||||||
editor.end_recording.connect(_end_recording)
|
editor.end_recording.connect(_end_recording)
|
||||||
editor.return_to_zero.connect(_return_to_zero)
|
editor.return_to_zero.connect(_return_to_zero)
|
||||||
|
current_block_indicator = load("res://Scenes/GUI/Controls/MovementFrameIndicatorOff.tscn").instantiate()
|
||||||
update_text()
|
update_text()
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue