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',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_disable_sketch_mode',
type: 'sketch_mode_disable',
},
})
.then(async () => {

View File

@ -642,14 +642,15 @@ impl Callable for StartSketchAt {
// Next, enter sketch mode.
stack_api_call(
&mut instructions,
ModelingCmdEndpoint::SketchModeEnable,
ModelingCmdEndpoint::EnableSketchMode,
None,
Uuid::new_v4().into(),
[
Some(axes.z).into_parts(),
vec![false.into()], // adjust camera
vec![false.into()], // animated
vec![false.into()], // ortho mode
vec![plane_id.into()],
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.
args.send_modeling_cmd(
uuid::Uuid::new_v4(),
ModelingCmd::SketchModeEnable {
ModelingCmd::EnableSketchMode {
animated: false,
ortho: false,
plane_id: plane.id,
entity_id: plane.id,
// 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?;

View File

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