This commit is contained in:
Quaternions 2024-03-09 10:06:41 -08:00
parent 5ed15e783d
commit fab60f19ee

View File

@ -19,7 +19,7 @@ fn class_is_a(class: &str, superclass: &str) -> bool {
return class_is_a(&class_super, superclass) return class_is_a(&class_super, superclass)
} }
} }
return false false
} }
fn recursive_collect_superclass(objects: &mut std::vec::Vec<rbx_dom_weak::types::Ref>,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, superclass: &str){ fn recursive_collect_superclass(objects: &mut std::vec::Vec<rbx_dom_weak::types::Ref>,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, superclass: &str){
let mut stack=vec![instance]; let mut stack=vec![instance];
@ -465,20 +465,18 @@ pub fn convert<F:FnMut(Option<&str>)->model::RenderConfigId>(dom:&rbx_dom_weak::
let model_id=model::ModelId::new(models1.len() as u32); let model_id=model::ModelId::new(models1.len() as u32);
//TODO: also detect "CylinderMesh" etc here //TODO: also detect "CylinderMesh" etc here
let shape=match &object.class[..]{ let shape=match object.class.as_str(){
"Part"=>{ "Part"=>if let Some(rbx_dom_weak::types::Variant::Enum(shape))=object.properties.get("Shape"){
if let Some(rbx_dom_weak::types::Variant::Enum(shape))=object.properties.get("Shape"){
match shape.to_u32(){ match shape.to_u32(){
0=>primitives::Primitives::Sphere, 0=>primitives::Primitives::Sphere,
1=>primitives::Primitives::Cube, 1=>primitives::Primitives::Cube,
2=>primitives::Primitives::Cylinder, 2=>primitives::Primitives::Cylinder,
3=>primitives::Primitives::Wedge, 3=>primitives::Primitives::Wedge,
4=>primitives::Primitives::CornerWedge, 4=>primitives::Primitives::CornerWedge,
_=>panic!("Funky roblox PartType={};",shape.to_u32()), other=>panic!("Funky roblox PartType={};",other),
} }
}else{ }else{
panic!("Part has no Shape!"); panic!("Part has no Shape!");
}
}, },
"TrussPart"=>primitives::Primitives::Cube, "TrussPart"=>primitives::Primitives::Cube,
"WedgePart"=>primitives::Primitives::Wedge, "WedgePart"=>primitives::Primitives::Wedge,