use super::*;
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct BlenderDoctorConfig {
pub(crate) blender_bin: Option<PathBuf>,
#[get(type(copy))]
pub(crate) mcp_port: u16,
#[get(type(copy))]
pub(crate) probe_gltf_exporter: bool,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderDoctorReport {
#[get(type(copy))]
pub(crate) blender_found: bool,
pub(crate) blender_path: Option<String>,
#[get(type(copy))]
pub(crate) binary_source: BlenderBinarySource,
pub(crate) version_raw: Option<String>,
#[get(type(copy))]
pub(crate) version_major: Option<u16>,
#[get(type(copy))]
pub(crate) version_minor: Option<u16>,
#[get(type(copy))]
pub(crate) version_patch: Option<u16>,
#[get(type(copy))]
pub(crate) supports_gltf_exporter: bool,
#[get(type(copy))]
pub(crate) gltf_exporter_ready: bool,
#[get(type(copy))]
pub(crate) supports_blender_mcp_version: bool,
#[get(type(copy))]
pub(crate) live_link_addon_installed: bool,
pub(crate) live_link_addon_path: Option<String>,
#[get(type(copy))]
pub(crate) live_sync_default_port: u16,
#[get(type(copy))]
pub(crate) mcp_port: u16,
#[get(type(copy))]
pub(crate) mcp_reachable: bool,
pub(crate) hints: Vec<String>,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct BlenderEuv3dSectionSummary {
pub(crate) kind: String,
#[get(type(copy))]
pub(crate) offset: u64,
#[get(type(copy))]
pub(crate) byte_length: u64,
#[get(type(copy))]
pub(crate) element_count: u32,
#[get(type(copy))]
pub(crate) aligned_64: bool,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderNativeBlendSummary {
pub(crate) version: String,
#[get(type(copy))]
pub(crate) pointer_size_bytes: u8,
#[get(type(copy))]
pub(crate) is_little_endian: bool,
#[get(type(copy))]
pub(crate) is_large_header_v5: bool,
pub(crate) compression: String,
#[get(type(copy))]
pub(crate) block_count: usize,
#[get(type(copy))]
pub(crate) dna_struct_count: usize,
pub(crate) scenes: Vec<String>,
pub(crate) collections: Vec<String>,
pub(crate) objects: Vec<String>,
pub(crate) meshes: Vec<String>,
pub(crate) materials: Vec<String>,
pub(crate) cameras: Vec<String>,
pub(crate) lights: Vec<String>,
pub(crate) armatures: Vec<String>,
pub(crate) actions: Vec<String>,
pub(crate) images: Vec<String>,
pub(crate) node_trees: Vec<String>,
pub(crate) warnings: Vec<String>,
}
#[derive(Clone, Data, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderSceneSummary {
pub(crate) name: String,
pub(crate) generator: String,
#[get(type(copy))]
pub(crate) node_count: usize,
pub(crate) collections: Vec<String>,
#[get(type(copy))]
pub(crate) mesh_count: usize,
#[get(type(copy))]
pub(crate) total_vertices: usize,
#[get(type(copy))]
pub(crate) total_triangles: usize,
#[get(type(copy))]
pub(crate) material_count: usize,
pub(crate) material_names: Vec<String>,
#[get(type(copy))]
pub(crate) texture_count: usize,
#[get(type(copy))]
pub(crate) skin_count: usize,
#[get(type(copy))]
pub(crate) animation_count: usize,
pub(crate) animation_names: Vec<String>,
#[get(type(copy))]
pub(crate) camera_count: usize,
#[get(type(copy))]
pub(crate) light_count: usize,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderEuv3dSummary {
#[get(type(copy))]
pub(crate) format_version: u32,
#[get(type(copy))]
pub(crate) content_crc32: u32,
#[get(type(copy))]
pub(crate) digest_fnv1a: u64,
#[get(type(copy))]
pub(crate) has_bvh4: bool,
#[get(type(copy))]
pub(crate) has_meshlets: bool,
#[get(type(copy))]
pub(crate) has_lods: bool,
#[get(type(copy))]
pub(crate) max_lod_levels: usize,
#[get(type(copy))]
pub(crate) bvh_count: usize,
pub(crate) sections: Vec<BlenderEuv3dSectionSummary>,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderInspectReport {
pub(crate) path: String,
#[get(type(copy))]
pub(crate) format: BlenderAssetFormat,
#[get(type(copy))]
pub(crate) file_bytes: u64,
pub(crate) blend: Option<BlenderNativeBlendSummary>,
pub(crate) scene: Option<BlenderSceneSummary>,
pub(crate) euv3d: Option<BlenderEuv3dSummary>,
}
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct BlenderImportConfig {
pub(crate) input: PathBuf,
pub(crate) out_dir: PathBuf,
pub(crate) blender_bin: Option<PathBuf>,
#[get(type(copy))]
pub(crate) bake: bool,
#[get(type(copy))]
pub(crate) lods: usize,
#[get(type(copy))]
pub(crate) build_meshlets: bool,
#[get(type(copy))]
pub(crate) bake_bvh4: bool,
#[get(type(copy))]
pub(crate) plan: bool,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderImportReport {
pub(crate) input_path: String,
#[get(type(copy))]
pub(crate) input_format: BlenderAssetFormat,
pub(crate) out_dir: String,
pub(crate) asset_output_path: Option<String>,
pub(crate) baked_euv3d_path: Option<String>,
pub(crate) manifest_path: Option<String>,
pub(crate) planned_command: Vec<String>,
pub(crate) scene: Option<BlenderSceneSummary>,
#[get(type(copy))]
pub(crate) elapsed_ms: u64,
}
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct BlenderBakeConfig {
pub(crate) input: PathBuf,
pub(crate) out_file: PathBuf,
pub(crate) blender_bin: Option<PathBuf>,
#[get(type(copy))]
pub(crate) lods: usize,
#[get(type(copy))]
pub(crate) build_meshlets: bool,
#[get(type(copy))]
pub(crate) bake_bvh4: bool,
#[get(type(copy))]
pub(crate) plan: bool,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderBakeReport {
pub(crate) input_path: String,
#[get(type(copy))]
pub(crate) input_format: BlenderAssetFormat,
pub(crate) out_file: String,
#[get(type(copy))]
pub(crate) input_bytes: u64,
#[get(type(copy))]
pub(crate) output_bytes: u64,
#[get(type(copy))]
pub(crate) lod_levels: usize,
#[get(type(copy))]
pub(crate) meshlets_enabled: bool,
#[get(type(copy))]
pub(crate) bvh4_enabled: bool,
#[get(type(copy))]
pub(crate) content_crc32: u32,
#[get(type(copy))]
pub(crate) digest_fnv1a: u64,
#[get(type(copy))]
pub(crate) section_count: usize,
pub(crate) scene: Option<BlenderSceneSummary>,
pub(crate) planned_command: Vec<String>,
#[get(type(copy))]
pub(crate) elapsed_ms: u64,
}
#[derive(Clone, Data, Debug, Default, Eq, PartialEq)]
pub struct BlenderAddonInstallConfig {
pub(crate) out: Option<PathBuf>,
#[get(type(copy))]
pub(crate) print_only: bool,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderAddonInstallReport {
pub(crate) filename: String,
pub(crate) installed_path: Option<String>,
#[get(type(copy))]
pub(crate) byte_length: usize,
pub(crate) sha256: String,
#[get(type(copy))]
pub(crate) default_port: u16,
pub(crate) instructions: String,
}
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct BlenderLiveSyncConfig {
pub(crate) host: String,
#[get(type(copy))]
pub(crate) port: u16,
pub(crate) out_dir: Option<PathBuf>,
#[get(type(copy))]
pub(crate) heartbeat_ms: u64,
#[get(type(copy))]
pub(crate) replay_capacity: usize,
#[get(type(copy))]
pub(crate) max_asset_bytes: usize,
#[get(type(copy))]
pub(crate) once: bool,
}
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct BlenderWatchConfig {
pub(crate) path: PathBuf,
pub(crate) out_dir: PathBuf,
pub(crate) host: String,
#[get(type(copy))]
pub(crate) port: u16,
pub(crate) blender_bin: Option<PathBuf>,
#[get(type(copy))]
pub(crate) poll_ms: u64,
#[get(type(copy))]
pub(crate) lods: usize,
#[get(type(copy))]
pub(crate) once: bool,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderWatchReport {
pub(crate) watch_path: String,
pub(crate) out_dir: String,
pub(crate) live_sync_url: Option<String>,
pub(crate) events_url: Option<String>,
pub(crate) baked_assets: Vec<BlenderBakeReport>,
#[get(type(copy))]
pub(crate) once: bool,
}
#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct BlenderLiveTransformDelta {
pub(crate) name: String,
#[get(type(copy))]
pub(crate) translation: Option<[f32; 3]>,
#[get(type(copy))]
pub(crate) rotation: Option<[f32; 4]>,
#[get(type(copy))]
pub(crate) scale: Option<[f32; 3]>,
#[get(type(copy))]
pub(crate) visible: Option<bool>,
#[serde(default)]
pub(crate) collections: Vec<String>,
}
#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct BlenderLiveCameraDelta {
pub(crate) name: String,
#[get(type(copy))]
pub(crate) is_perspective: Option<bool>,
#[get(type(copy))]
pub(crate) fov_deg: Option<f32>,
#[get(type(copy))]
pub(crate) ortho_scale: Option<f32>,
#[get(type(copy))]
pub(crate) clip_start: Option<f32>,
#[get(type(copy))]
pub(crate) clip_end: Option<f32>,
#[get(type(copy))]
pub(crate) translation: Option<[f32; 3]>,
#[get(type(copy))]
pub(crate) rotation: Option<[f32; 4]>,
}
#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct BlenderLiveLightDelta {
pub(crate) name: String,
pub(crate) kind: Option<String>,
#[get(type(copy))]
pub(crate) color: Option<[f32; 3]>,
#[get(type(copy))]
pub(crate) intensity: Option<f32>,
#[get(type(copy))]
pub(crate) width: Option<f32>,
#[get(type(copy))]
pub(crate) height: Option<f32>,
#[get(type(copy))]
pub(crate) translation: Option<[f32; 3]>,
#[get(type(copy))]
pub(crate) rotation: Option<[f32; 4]>,
}
#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct BlenderLiveMaterialDelta {
pub(crate) name: String,
#[get(type(copy))]
pub(crate) base_color: Option<[f32; 4]>,
#[get(type(copy))]
pub(crate) metallic: Option<f32>,
#[get(type(copy))]
pub(crate) roughness: Option<f32>,
#[get(type(copy))]
pub(crate) ior: Option<f32>,
#[get(type(copy))]
pub(crate) specular: Option<f32>,
#[get(type(copy))]
pub(crate) clearcoat: Option<f32>,
#[get(type(copy))]
pub(crate) clearcoat_roughness: Option<f32>,
#[get(type(copy))]
pub(crate) transmission: Option<f32>,
#[get(type(copy))]
pub(crate) sheen: Option<f32>,
#[get(type(copy))]
pub(crate) sheen_roughness: Option<f32>,
#[get(type(copy))]
pub(crate) emissive: Option<[f32; 3]>,
#[get(type(copy))]
pub(crate) emissive_strength: Option<f32>,
}
#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct BlenderLiveMorphDelta {
pub(crate) name: String,
#[serde(default)]
pub(crate) weights: Vec<f32>,
}
#[derive(Clone, Data, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct BlenderLiveDeltaPayload {
#[serde(default)]
pub(crate) scene_name: String,
pub(crate) blender_version: Option<String>,
#[get(type(copy))]
pub(crate) frame: Option<i32>,
#[get(type(copy))]
pub(crate) client_seq: Option<u64>,
#[get(type(copy))]
pub(crate) timestamp_ms: Option<u64>,
#[serde(default)]
pub(crate) transforms: Vec<BlenderLiveTransformDelta>,
#[serde(default)]
pub(crate) cameras: Vec<BlenderLiveCameraDelta>,
#[serde(default)]
pub(crate) lights: Vec<BlenderLiveLightDelta>,
#[serde(default)]
pub(crate) materials: Vec<BlenderLiveMaterialDelta>,
#[serde(default)]
pub(crate) morph_weights: Vec<BlenderLiveMorphDelta>,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderLiveAssetNotice {
#[get(type(copy))]
pub(crate) seq: u64,
pub(crate) asset_id: String,
#[get(type(copy))]
pub(crate) format: BlenderAssetFormat,
#[get(type(copy))]
pub(crate) size_bytes: usize,
pub(crate) sha256: String,
#[get(type(copy))]
pub(crate) mesh_count: usize,
#[get(type(copy))]
pub(crate) triangle_count: usize,
pub(crate) asset_url: String,
pub(crate) disk_path: Option<String>,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct BlenderLiveEventRecord {
#[get(type(copy))]
pub(crate) seq: u64,
#[get(type(copy))]
pub(crate) kind: BlenderLiveEventKind,
pub(crate) event_name: String,
pub(crate) json_data: String,
}
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct BlenderStoredAsset {
pub(crate) notice: BlenderLiveAssetNotice,
pub(crate) bytes: Vec<u8>,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlenderLiveSyncReport {
pub(crate) url: String,
pub(crate) delta_url: String,
pub(crate) asset_url: String,
pub(crate) events_url: String,
pub(crate) status_url: String,
#[get(type(copy))]
pub(crate) latest_seq: u64,
#[get(type(copy))]
pub(crate) delta_count: u64,
#[get(type(copy))]
pub(crate) asset_count: u64,
pub(crate) asset_ids: Vec<String>,
#[get(type(copy))]
pub(crate) once: bool,
}
#[cfg(feature = "update-server")]
#[derive(CustomDebug)]
pub struct BlenderLiveSyncState {
#[debug(skip)]
pub(crate) sse_hub: SseHub,
pub(crate) sse_config: SseConfig,
pub(crate) out_dir: Option<PathBuf>,
pub(crate) max_asset_bytes: usize,
pub(crate) replay_capacity: usize,
pub(crate) next_seq: AtomicU64,
pub(crate) delta_count: AtomicU64,
pub(crate) asset_count: AtomicU64,
pub(crate) event_log: Mutex<Vec<BlenderLiveEventRecord>>,
pub(crate) assets: RwLock<BTreeMap<String, BlenderStoredAsset>>,
pub(crate) latest_delta: RwLock<Option<BlenderLiveDeltaPayload>>,
pub(crate) running: AtomicBool,
}
#[cfg(feature = "update-server")]
#[derive(Debug)]
pub struct BlenderLiveSyncHandle {
pub(crate) address: SocketAddr,
pub(crate) state: Arc<BlenderLiveSyncState>,
pub(crate) control: Option<ServerControlHook>,
pub(crate) runtime: Option<runtime::Runtime>,
}
#[cfg(feature = "update-server")]
#[derive(Clone, Copy, Debug, Default)]
pub(crate) struct BlenderDeltaRouteHook;
#[cfg(feature = "update-server")]
#[derive(Clone, Copy, Debug, Default)]
pub(crate) struct BlenderAssetRouteHook;
#[cfg(feature = "update-server")]
#[derive(Clone, Copy, Debug, Default)]
pub(crate) struct BlenderEventsRouteHook;
#[cfg(feature = "update-server")]
#[derive(Clone, Copy, Debug, Default)]
pub(crate) struct BlenderStatusRouteHook;