未验证 提交 9a41ff35 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #12411 from looeee/FBXLoader_rotation_order_warning

FBXLoader: added warning for unsupported rotation orders
......@@ -1906,6 +1906,36 @@
// parse the model node for transform details and apply them to the model
function setModelTransforms( FBXTree, model, modelNode, connections, sceneGraph ) {
// http://help.autodesk.com/view/FBX/2017/ENU/?guid=__cpp_ref_class_fbx_euler_html
if ( 'RotationOrder' in modelNode.properties ) {
var enums = [
'XYZ', // default
'XZY',
'YZX',
'ZXY',
'YXZ',
'ZYX',
'SphericXYZ',
];
var value = parseInt( modelNode.properties.RotationOrder.value, 10 );
if ( value > 0 && value < 6 ) {
// model.rotation.order = enums[ value ];
// Note: Euler order other than XYZ is currently not supported, so just display a warning for now
console.warn( 'THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.', enums[ value ] );
} else if ( value === 6 ) {
console.warn( 'THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.' );
}
}
if ( 'Lcl_Translation' in modelNode.properties ) {
model.position.fromArray( modelNode.properties.Lcl_Translation.value );
......@@ -1941,7 +1971,7 @@
}
// rotated pivots - note: rotation must be applied before translation here
if ( 'GeometricRotation' in modelNode.properties ) {
if ( 'GeometricRotation' in modelNode.properties ) {
var array = modelNode.properties.GeometricRotation.value.map( THREE.Math.degToRad );
......@@ -3950,12 +3980,6 @@
}
function parseVector3( property ) {
return new THREE.Vector3().fromArray( property.value );
}
function parseColor( property ) {
var color = new THREE.Color();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册