improve selections and remove redundant edit_mode (#2617)
This commit is contained in:
@ -51,14 +51,6 @@ function CommandBarSelectionInput({
|
|||||||
inputRef.current?.focus()
|
inputRef.current?.focus()
|
||||||
}, [selection, inputRef])
|
}, [selection, inputRef])
|
||||||
|
|
||||||
// Exit engine's edit mode when this input step is active,
|
|
||||||
// and re-enter it when it's not.
|
|
||||||
// In future the engine's edit mode will go away and this will be handled differently.
|
|
||||||
useEffect(() => {
|
|
||||||
kclManager.exitEditMode()
|
|
||||||
return () => kclManager.defaultSelectionFilter()
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
// Fast-forward through this arg if it's marked as skippable
|
// Fast-forward through this arg if it's marked as skippable
|
||||||
// and we have a valid selection already
|
// and we have a valid selection already
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -365,13 +365,6 @@ export class KclManager {
|
|||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
|
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
|
||||||
}
|
}
|
||||||
exitEditMode() {
|
|
||||||
this.engineCommandManager.sendSceneCommand({
|
|
||||||
type: 'modeling_cmd_req',
|
|
||||||
cmd_id: uuidv4(),
|
|
||||||
cmd: { type: 'edit_mode_exit' },
|
|
||||||
})
|
|
||||||
}
|
|
||||||
defaultSelectionFilter() {
|
defaultSelectionFilter() {
|
||||||
defaultSelectionFilter(this.programMemory, this.engineCommandManager)
|
defaultSelectionFilter(this.programMemory, this.engineCommandManager)
|
||||||
}
|
}
|
||||||
@ -386,24 +379,11 @@ function defaultSelectionFilter(
|
|||||||
) as SketchGroup | ExtrudeGroup
|
) as SketchGroup | ExtrudeGroup
|
||||||
firstSketchOrExtrudeGroup &&
|
firstSketchOrExtrudeGroup &&
|
||||||
engineCommandManager.sendSceneCommand({
|
engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_batch_req',
|
type: 'modeling_cmd_req',
|
||||||
batch_id: uuidv4(),
|
|
||||||
responses: false,
|
|
||||||
requests: [
|
|
||||||
{
|
|
||||||
cmd_id: uuidv4(),
|
|
||||||
cmd: {
|
|
||||||
type: 'edit_mode_enter',
|
|
||||||
target: firstSketchOrExtrudeGroup.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
cmd_id: uuidv4(),
|
cmd_id: uuidv4(),
|
||||||
cmd: {
|
cmd: {
|
||||||
type: 'set_selection_filter',
|
type: 'set_selection_filter',
|
||||||
filter: ['face', 'edge', 'solid2d'],
|
filter: ['face', 'edge', 'solid2d', 'curve'],
|
||||||
},
|
},
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user