fix(blocks): preserve UCS transformations

Bake BEDIT frames into block-local geometry while keeping model and viewport UCS isolated. Normalize legacy nonzero block origins during load.
This commit is contained in:
Hakan Seven committed 2026-07-30 19:50:33 +03:00
1 parent 02d15f5d23
commit 2c64888048
22 files changed
+693 -41

No files matched your search

+14 -2
View File
@@ -55,15 +55,27 @@ pub struct BlockEditSession {
/// Parent block tab to return to for a nested BEDIT session. `None` returns
/// to `return_layout`.
pub return_block: Option<String>,
/// The block's block-local entities captured on entry, so Discard can
/// restore the definition (structural Block/BlockEnd/AttDef excluded).
/// The complete block definition captured on entry, so Discard restores
/// structural markers and content with their original handles.
pub snapshot: Vec<EntityType>,
/// Baked anonymous dimension-block entities transformed alongside
/// dimensions in this definition. They remain in place, so Discard can
/// restore their shared before-images directly.
pub dependent_snapshot: Vec<std::sync::Arc<EntityType>>,
/// Inline ATTRIB values/positions on every existing INSERT of this block.
/// Rebasing the origin moves them with the definition; Discard restores
/// their exact on-entry state.
pub reference_attributes:
Vec<(Handle, Vec<acadrust::entities::AttributeEntity>)>,
/// Camera state of the space that was active when BEDIT began, restored
/// on Save/Discard so the view returns exactly where it was (#425).
pub return_camera: crate::scene::view::camera::Camera,
/// Camera owned by this block tab. Updated whenever another space tab is
/// activated, then restored when the user returns to this block.
pub editor_camera: crate::scene::view::camera::Camera,
/// Transient UCS being manipulated in this block tab. On commit its full
/// frame is baked into the definition and this returns to `None`.
pub editor_ucs: Option<acadrust::tables::Ucs>,
}
// ── BEDIT pick command ─────────────────────────────────────────────────────