Skip to content
Merged
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
7 changes: 5 additions & 2 deletions Stitch/Graph/Node/Port/Util/PortValue/PortValuesUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ extension PortValuesList {
var outputsLoop = PortValues()

for output in self {
outputsLoop.append(output[loopIndex])
// outputsLoop.append(output[loopIndex])
if let valueAtIndex = output[safe: loopIndex] {
outputsLoop.append(valueAtIndex)
}
}

valuesList.append(outputsLoop)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,22 @@ extension InputNodeRowObserver: SchemaObserverIdentifiable {
}

extension OutputNodeRowObserver {

@MainActor
func onPrototypeRestart(document: StitchDocumentViewModel) {
// Set outputs to be empty
// MARK: no longer seems necessary, removing for fixing flashing media on restart
// self.allLoopedValues = []

// let containsMedia = self.allLoopedValues.first?.asyncMedia.isDefined ?? false
// if !containsMedia {
// self.allLoopedValues = []
// }

// TODO: better to only reset based on pulses, since some nodes may still look at old-style previous outputs?
let containsPulse = self.allLoopedValues.first?.getPulse.isDefined ?? false
if containsPulse {
self.allLoopedValues = []
}
}
}