Compare commits

...

1 Commits

Author SHA1 Message Date
651b221639 migrate all legacy sketch mode endpoint calls 2024-05-03 10:29:52 -07:00
4 changed files with 13 additions and 11 deletions

View File

@ -873,7 +873,7 @@ export const modelingMachine = createMachine(
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),
cmd: { cmd: {
type: 'default_camera_disable_sketch_mode', type: 'sketch_mode_disable',
}, },
}) })
.then(async () => { .then(async () => {

View File

@ -642,14 +642,15 @@ impl Callable for StartSketchAt {
// Next, enter sketch mode. // Next, enter sketch mode.
stack_api_call( stack_api_call(
&mut instructions, &mut instructions,
ModelingCmdEndpoint::SketchModeEnable, ModelingCmdEndpoint::EnableSketchMode,
None, None,
Uuid::new_v4().into(), Uuid::new_v4().into(),
[ [
Some(axes.z).into_parts(), Some(axes.z).into_parts(),
vec![false.into()], // animated vec![false.into()], // adjust camera
vec![false.into()], // ortho mode vec![false.into()], // animated
vec![plane_id.into()], vec![false.into()], // ortho mode
vec![plane_id.into()], // entity id (plane in this case)
], ],
); );

View File

@ -1005,12 +1005,12 @@ async fn start_sketch_on_plane(data: PlaneData, args: Args) -> Result<Box<Plane>
// Enter sketch mode on the plane. // Enter sketch mode on the plane.
args.send_modeling_cmd( args.send_modeling_cmd(
uuid::Uuid::new_v4(), uuid::Uuid::new_v4(),
ModelingCmd::SketchModeEnable { ModelingCmd::EnableSketchMode {
animated: false, animated: false,
ortho: false, ortho: false,
plane_id: plane.id, entity_id: plane.id,
// We pass in the normal for the plane here. // We pass in the normal for the plane here.
disable_camera_with_plane: Some(plane.z_axis.clone().into()), planar_normal: Some(plane.z_axis.clone().into()),
}, },
) )
.await?; .await?;

View File

@ -67,11 +67,12 @@ async fn setup(code: &str, name: &str) -> Result<(ExecutorContext, Program, uuid
.send_modeling_cmd( .send_modeling_cmd(
uuid::Uuid::new_v4(), uuid::Uuid::new_v4(),
SourceRange::default(), SourceRange::default(),
ModelingCmd::SketchModeEnable { ModelingCmd::EnableSketchMode {
adjust_camera: false,
animated: false, animated: false,
ortho: true, ortho: true,
plane_id, entity_id: plane_id,
disable_camera_with_plane: Some(Point3D { x: 0.0, y: 0.0, z: 1.0 }), planar_normal: Some(Point3D { x: 0.0, y: 0.0, z: 1.0 }),
}, },
) )
.await?; .await?;