Use artifactGraph helpers for more concise code
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
This commit is contained in:
@ -301,20 +301,12 @@ export const Stream = () => {
|
|||||||
sendSelectEventToEngine(e, videoRef.current)
|
sendSelectEventToEngine(e, videoRef.current)
|
||||||
.then(({ entity_id }) => {
|
.then(({ entity_id }) => {
|
||||||
if (!entity_id) return // No entity selected. This is benign
|
if (!entity_id) return // No entity selected. This is benign
|
||||||
const artifact = engineCommandManager.artifactGraph.get(entity_id)
|
const artifact = getArtifactOfTypes(
|
||||||
// If an ID is returned and the artifact is not found, we can't do anything, but that's bad and worth reporting
|
{ key: entity_id, types: ['path', solid2D, 'segment'] },
|
||||||
if (!artifact)
|
engineCommandManager.artifactGraph
|
||||||
return reportRejection(`No artifact with ID: ${entity_id}`)
|
)
|
||||||
const sketchArtifactTypes: Artifact['type'][] = [
|
if (err(path)) return path
|
||||||
'path',
|
sceneInfra.modelingSend({ type: 'Enter sketch' })
|
||||||
'solid2D',
|
|
||||||
'segment',
|
|
||||||
]
|
|
||||||
if (sketchArtifactTypes.includes(artifact.type)) {
|
|
||||||
sceneInfra.modelingSend({ type: 'Enter sketch' })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(reportRejection)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user