(
ctx: &mut ScriptContext<'_, API>,
anim_path: &str,
)
| 620 | path: scene_path.to_string(), |
| 621 | ..SceneSession::default() |
| 622 | }); |
| 623 | state.active_asset_path = scene_path.to_string(); |
| 624 | state.active_open = state.open_paths.len() - 1; |
| 625 | state.activity_mode = "scene".to_string(); |
| 626 | state.sidebar_mode = "scene".to_string(); |
| 627 | set_state_scene_doc_loaded(state, &doc); |
| 628 | state.selected_key = first_key; |
| 629 | state.collapsed_scene_keys.clear(); |
| 630 | state.inspector_expanded_paths.clear(); |
| 631 | state.inspector_collapsed_sections.clear(); |
| 632 | state.viewport_mode = mode.to_string(); |
| 633 | if mode == "3D" { |
| 634 | reset_freecam(state); |
| 635 | } else if mode == "2D" { |
| 636 | reset_freecam_2d(state); |
| 637 | } |
| 638 | state.dirty = false; |
| 639 | state.dirty_scene_paths.retain(|path| path != scene_path); |
| 640 | state.active_glb_path.clear(); |
| 641 | state.active_glb_summary.clear(); |
| 642 | state.log = format!("open scene\n{}", editor_files::rel_label(scene_path)); |
| 643 | capture_active_scene_session(state); |
| 644 | }); |
| 645 | rebuild_preview(ctx); |
| 646 | refresh_all(ctx); |
| 647 | } |
| 648 | |
| 649 | pub fn open_animation_path<API: ScriptAPI + ?Sized>( |
| 650 | ctx: &mut ScriptContext<'_, API>, |
| 651 | anim_path: &str, |
| 652 | ) { |
no test coverage detected