#736: import FBX 3D models (binary and ASCII)
Problem: After Effects 26 imports FBX models into Advanced 3D comps; File > Import rejected .fbx, so FBX product shots and scenes could not be used. Fix: a clean-room FBX 7.x reader in effectcraft-model (binary node records with 32/64-bit offsets and zlib arrays, ASCII syntax) and a scene builder: meshes with normals, UVs and per-polygon materials, the Model hierarchy with the SDK transform (pivots, offsets, pre/post rotation, rotation order, geometric transform), Lambert/Phong materials onto metallic-roughness with embedded or relative textures, and GlobalSettings axes turned to Y-up. Wired into import, probing, the media browser and the file dialog. Hostile input (truncation, corruption, huge arrays, deep nesting) fails with an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9a7d3e7699
commit
977532f135
@@ -454,6 +454,16 @@ fn png_with_alpha() {
|
||||
assert_eq!((th.width, th.height), (64, 32));
|
||||
}
|
||||
|
||||
/// File ▸ Import of an FBX scene: importable by extension and probed as a 3D model item.
|
||||
#[test]
|
||||
fn fbx_imports_as_a_model() {
|
||||
assert!(effectcraft_media::is_importable(Path::new("scene.fbx")));
|
||||
let fbx = "FBXHeaderExtension: {\n FBXVersion: 7400\n}\nObjects: {\n Geometry: 1, \"Geometry::Tri\", \"Mesh\" {\n Vertices: *9 {\n a: 0,0,0,1,0,0,0,1,0\n }\n PolygonVertexIndex: *3 {\n a: 0,1,-3\n }\n }\n Model: 2, \"Model::Tri\", \"Mesh\" {\n }\n}\nConnections: {\n C: \"OO\",2,0\n C: \"OO\",1,2\n}\n";
|
||||
let f = effectcraft_media::probe_bytes("scene.fbx", Arc::from(fbx.as_bytes())).expect("probe");
|
||||
assert_eq!(f.kind, FootageKind::Model);
|
||||
assert_eq!(f.codec, "FBX (1 meshes, 1 triangles)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wav_audio() {
|
||||
let Some(p) = tone_wav() else { return };
|
||||
|
||||
Reference in New Issue
Block a user