use mesh_loader::collada::from_str; // https://github.com/openrr/mesh-loader/issues/61 #[test] fn issue61() { let cube = r##" Blender User Blender 2.79.0 commit date:2018-03-22, commit time:14:10, hash:f4dc9f9d68b 2018-11-19T22:54:36 2018-11-19T22:54:36 Z_UP 0 0 0 1 0 0 0 1 0.64 0.64 0.64 1 0.5 0.5 0.5 1 50 1 -0.5 -0.5 -0.5 -0.5 -0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5 0.5 -0.5 0.5 0.5 0.5 -1 0 0 0 1 0 1 0 0 0 -1 0 0 0 -1 0 0 1

1 0 2 0 0 0 3 1 6 1 2 1 7 2 4 2 6 2 5 3 0 3 4 3 6 4 0 4 2 4 3 5 5 5 7 5 1 0 3 0 2 0 3 1 7 1 6 1 7 2 5 2 4 2 5 3 1 3 0 3 6 4 4 4 0 4 3 5 1 5 5 5

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
"##; let scene = from_str(cube).unwrap(); assert_eq!(scene.materials[0].name, "Material"); } // https://github.com/openrr/mesh-loader/issues/62 #[test] fn issue62() { let cube = r##" Blender User Blender 2.79.0 commit date:2018-03-22, commit time:14:10, hash:f4dc9f9d68b 2018-11-19T22:54:36 2018-11-19T22:54:36 Z_UP 0 0 0 1 0 0 0 1 0.64 0.64 0.64 1 0.5 0.5 0.5 1 50 1 0 0 0 1 0.5 0.5 0.5 1 0 0 0 1 0.125 0.125 0.125 1 50 1 -0.5 -0.5 -0.5 -0.5 -0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5 0.5 -0.5 0.5 0.5 0.5 -1 0 0 0 1 0 1 0 0 0 -1 0 0 0 -1 0 0 1

1 0 2 0 0 0 3 1 6 1 2 1 7 2 4 2 6 2 5 3 0 3 4 3 6 4 0 4 2 4 3 5 5 5 7 5 1 0 3 0 2 0 3 1 7 1 6 1 7 2 5 2 4 2 5 3 1 3 0 3 6 4 4 4 0 4 3 5 1 5 5 5

-0.5 -0.5 -0.5 -0.5 -0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5 0.5 -0.5 0.5 0.5 0.5 -1 0 0 0 1 0 1 0 0 0 -1 0 0 0 -1 0 0 1

1 0 2 0 0 0 3 1 6 1 2 1 7 2 4 2 6 2 5 3 0 3 4 3 6 4 0 4 2 4 3 5 5 5 7 5 1 0 3 0 2 0 3 1 7 1 6 1 7 2 5 2 4 2 5 3 1 3 0 3 6 4 4 4 0 4 3 5 1 5 5 5

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
"##; let scene = from_str(cube).unwrap(); println!( "mat : {:?} | len : {}", scene.materials, scene.materials.len() ); assert_eq!(scene.meshes.len(), 2); assert_eq!(scene.meshes[0].name, "Cube_001-mesh"); assert_eq!(scene.meshes[1].name, "Cube_002-mesh"); assert_eq!(scene.materials.len(), 2); assert_eq!(scene.materials[0].name, "Material"); assert_eq!(scene.materials[1].name, "Material_002"); }