(state: &EditorState, kind: &str)
| 1813 | let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| { |
| 1814 | if let Ok(paths) = scan_res_paths(Path::new(&state.project_root)) { |
| 1815 | state.file_paths = paths; |
| 1816 | } |
| 1817 | state.active_asset_path = out_path.clone(); |
| 1818 | state.active_anim_path = out_path.clone(); |
| 1819 | state.active_glb_path.clear(); |
| 1820 | state.active_glb_summary.clear(); |
| 1821 | state.activity_mode = "scene".to_string(); |
| 1822 | state.anim_drawer_open = true; |
| 1823 | if player_key.is_none() { |
| 1824 | state.active_anim_player_key = None; |
| 1825 | } |
| 1826 | state.log = format!("glb anim -> panim\n{out_path}"); |
| 1827 | }); |
| 1828 | if player_key.is_some() { |
| 1829 | attach_animation_to_selected_player(ctx, &out_path); |
| 1830 | } else { |
| 1831 | refresh_all(ctx); |
| 1832 | } |
| 1833 | } |
| 1834 | Err(err) => set_log(ctx, &format!("glb anim write fail\n{out_path}\n{err}")), |
| 1835 | } |
| 1836 | } |
| 1837 | Err(err) => set_log(ctx, &format!("glb anim fail\n{glb_path}\n{err}")), |
| 1838 | } |
| 1839 | } |
| 1840 | |
| 1841 | pub fn export_selected_glb_material<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>) { |
| 1842 | let request = with_state!(ctx.run, EditorState, ctx.id, |state| { |
| 1843 | let path = active_gltf_asset_path(state)?; |
| 1844 | Some(( |
| 1845 | state.project_root.clone(), |
| 1846 | path, |
| 1847 | state.active_glb_mat_index, |
nothing calls this directly
no test coverage detected