mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 10:35:58 +00:00
After the merge: split_move's Result reaches its callers; to_local's duplicated move check goes
`frames::split_move` returns a Result on this branch: an unplaceable model is an error, not a silent no-split. - Move/Copy of a component (main's #9914) propagates it, as its other calls do. - `to_local` had the solid.move check twice after the merge (brett's Option one and ours). Ours stays, after the no-picks/not-placed return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
This commit is contained in:
@@ -1992,7 +1992,7 @@ fn copy_components(s: &mut Session, p: &Value, paths: Vec<Vec<u64>>) -> Result<V
|
||||
object.remove("occurrences");
|
||||
}
|
||||
// Bodies in differently placed frames split by frame (`frames::split_move`, #9660), as a move of them alone does.
|
||||
let split = crate::frames::split_move(s, &rest);
|
||||
let split = crate::frames::split_move(s, &rest)?;
|
||||
let bodies = if has_bodies && split.is_none() { Some(crate::frames::to_local(s, cmd, &rest)?.unwrap_or_else(|| rest.clone())) } else { None };
|
||||
let mut copies = Vec::new();
|
||||
for path in &paths {
|
||||
|
||||
@@ -431,11 +431,6 @@ impl Drop for Nested {
|
||||
/// `params` with world picks mapped into component frames (`None`: nothing to change). A model
|
||||
/// that cannot be placed is the error.
|
||||
pub fn to_local(s: &Session, id: &str, params: &Value) -> crate::Result<Option<Value>> {
|
||||
// A move of bodies in differently turned frames keeps its world vectors: `solid.move` splits
|
||||
// it by frame and maps each part itself (`split_move`).
|
||||
if id == "solid.move" && split_move(s, params).is_some() {
|
||||
return Ok(None);
|
||||
}
|
||||
// A command with no world picks has nothing to map, and may not need the bodies placed.
|
||||
let picks = !table(id).is_empty() || matches!(id, "library.apply" | "timeline.redefine" | "sketch.redefine");
|
||||
if !picks || !placed(s) {
|
||||
|
||||
Reference in New Issue
Block a user