viewer,ship: external parts ON by default + Ships catalog = composite ships only
Fixes the two things the user saw in the Ships browser: - "Can't find the thrusters": show_external defaulted OFF, hiding the engine rig / bridge / turrets entirely. Externals are EXACT since the node-TRS fix, so the toggle now defaults ON (relabelled; off = bare hull bodies). - "Some parts very far away": families without a composite scene graph (fighter morph sets like f002 whose detached parts are authored far from the origin, shared turret/prop part families) fell into the stack-at-origin fallback and rendered as piles with stray pieces. ShipModel now carries has_composite and the catalog lists only real assembled ships. Offline audit across ALL stages (ship_audit example): the only far-away outliers were composite-less f002 morph parts (now filtered); every capital ship assembles coherently (e108 places its 7 turret instances, f105 its mirrored shield generators). All primary composites are single-key tracks — multikey exists only in animation composites (e901 attacks, missile-open), which assemble_ship does not select. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,10 @@ pub struct ShipModel {
|
||||
pub faction: Faction,
|
||||
/// Base geometry resource names to draw together, in directory order.
|
||||
pub parts: Vec<String>,
|
||||
/// Whether a composite scene graph (`e_rou_<id>`) exists — i.e. this is a
|
||||
/// real assembled ship. Families without one (fighter morph sets, shared
|
||||
/// turret/prop parts) have no placement data and would stack at the origin.
|
||||
pub has_composite: bool,
|
||||
}
|
||||
|
||||
/// The `[a-z]NNN` id prefix of a resource name, if it has one (`e106_bdy_01`
|
||||
@@ -146,7 +150,13 @@ pub fn ships_in_container(bytes: &[u8]) -> Vec<ShipModel> {
|
||||
let id = ship_id_of(n).unwrap().to_string();
|
||||
let entry = ships.entry(id.clone()).or_insert_with(|| {
|
||||
ids.push(id.clone());
|
||||
ShipModel { id: id.clone(), faction: Faction::from_id(&id), parts: Vec::new() }
|
||||
let has_composite = !composites_for(&names, &id).is_empty();
|
||||
ShipModel {
|
||||
id: id.clone(),
|
||||
faction: Faction::from_id(&id),
|
||||
parts: Vec::new(),
|
||||
has_composite,
|
||||
}
|
||||
});
|
||||
entry.parts.push(n.clone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user