Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
325ef6b6
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
325ef6b6
编写于
7月 18, 2017
作者:
M
Mr.doob
提交者:
GitHub
7月 18, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11790 from Mugen87/dev
FBXLoader: Code style and logging
上级
2a98f665
bbd08c81
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
41 deletion
+41
-41
examples/js/loaders/FBXLoader.js
examples/js/loaders/FBXLoader.js
+41
-41
未找到文件。
examples/js/loaders/FBXLoader.js
浏览文件 @
325ef6b6
...
...
@@ -98,13 +98,13 @@
if
(
!
isFbxFormatASCII
(
FBXText
)
)
{
throw
new
Error
(
'
FBXLoader: Unknown format.
'
);
throw
new
Error
(
'
THREE.
FBXLoader: Unknown format.
'
);
}
if
(
getFbxVersion
(
FBXText
)
<
7000
)
{
throw
new
Error
(
'
FBXLoader: FBX version not supported, FileVersion:
'
+
getFbxVersion
(
FBXText
)
);
throw
new
Error
(
'
THREE.
FBXLoader: FBX version not supported, FileVersion:
'
+
getFbxVersion
(
FBXText
)
);
}
...
...
@@ -438,7 +438,7 @@
material
=
new
THREE
.
MeshLambertMaterial
();
break
;
default
:
console
.
warn
(
'
No implementation given for material type
'
+
type
+
'
in FBXLoader.js. Defaulting to basic material
'
);
console
.
warn
(
'
THREE.FBXLoader: No implementation given for material type %s in FBXLoader.js. Defaulting to basic material.
'
,
type
);
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x3300ff
}
);
break
;
...
...
@@ -511,27 +511,27 @@
switch
(
type
)
{
case
"
DiffuseColor
"
:
case
"
\"
DiffuseColor
"
:
case
'
DiffuseColor
'
:
case
'
"DiffuseColor
'
:
parameters
.
map
=
textureMap
.
get
(
relationship
.
ID
);
break
;
case
"
Bump
"
:
case
"
\"
Bump
"
:
case
'
Bump
'
:
case
'
"Bump
'
:
parameters
.
bumpMap
=
textureMap
.
get
(
relationship
.
ID
);
break
;
case
"
NormalMap
"
:
case
"
\"
NormalMap
"
:
case
'
NormalMap
'
:
case
'
"NormalMap
'
:
parameters
.
normalMap
=
textureMap
.
get
(
relationship
.
ID
);
break
;
case
"
\"
AmbientColor
"
:
case
"
\"
EmissiveColor
"
:
case
"
AmbientColor
"
:
case
"
EmissiveColor
"
:
case
'
AmbientColor
'
:
case
'
EmissiveColor
'
:
case
'
"AmbientColor
'
:
case
'
"EmissiveColor
'
:
default
:
console
.
warn
(
'
Unknown texture application of type
'
+
type
+
'
, skipping texture
'
);
console
.
warn
(
'
THREE.FBXLoader: Unknown texture application of type %s, skipping texture.
'
,
type
);
break
;
}
...
...
@@ -806,7 +806,7 @@
if
(
!
displayedWeightsWarning
)
{
console
.
warn
(
'
FBXLoader: Vertex has more than 4 skinning weights assigned to vertex.
Deleting additional weights.
'
);
console
.
warn
(
'
THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex.
Deleting additional weights.
'
);
displayedWeightsWarning
=
true
;
}
...
...
@@ -1242,7 +1242,7 @@
if
(
THREE
.
NURBSCurve
===
undefined
)
{
console
.
error
(
"
THREE.FBXLoader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry.
"
);
console
.
error
(
'
THREE.FBXLoader: The loader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry.
'
);
return
new
THREE
.
BufferGeometry
();
}
...
...
@@ -1251,7 +1251,7 @@
if
(
isNaN
(
order
)
)
{
console
.
error
(
"
FBXLoader: Invalid Order
"
+
geometryNode
.
properties
.
Order
+
"
given for geometry ID:
"
+
geometryNode
.
id
);
console
.
error
(
'
THREE.FBXLoader: Invalid Order %s given for geometry ID: %s
'
,
geometryNode
.
properties
.
Order
,
geometryNode
.
id
);
return
new
THREE
.
BufferGeometry
();
}
...
...
@@ -1365,7 +1365,7 @@
switch
(
node
.
attrType
)
{
case
"
Mesh
"
:
case
'
Mesh
'
:
/**
* @type {?THREE.BufferGeometry}
*/
...
...
@@ -1437,7 +1437,7 @@
}
break
;
case
"
NurbsCurve
"
:
case
'
NurbsCurve
'
:
var
geometry
=
null
;
for
(
var
childrenIndex
=
0
,
childrenLength
=
conns
.
children
.
length
;
childrenIndex
<
childrenLength
;
++
childrenIndex
)
{
...
...
@@ -3283,8 +3283,8 @@
}
catch
(
error
)
{
// Curve is not fully plotted.
console
.
log
(
bone
);
console
.
log
(
error
);
console
.
log
(
'
THREE.FBXLoader:
'
,
bone
);
console
.
log
(
'
THREE.FBXLoader:
'
,
error
);
}
...
...
@@ -3617,7 +3617,7 @@
this
.
currentProp
=
[];
this
.
currentPropName
=
''
;
var
split
=
text
.
split
(
"
\n
"
);
var
split
=
text
.
split
(
'
\n
'
);
for
(
var
line
in
split
)
{
...
...
@@ -3636,11 +3636,11 @@
}
// skip empty line
// beginning of node
var
beginningOfNodeExp
=
new
RegExp
(
"
^
\\
t{
"
+
this
.
currentIndent
+
"
}(
\\
w+):(.*){
"
,
''
);
var
beginningOfNodeExp
=
new
RegExp
(
'
^
\\
t{
'
+
this
.
currentIndent
+
'
}(
\\
w+):(.*){
'
,
''
);
var
match
=
l
.
match
(
beginningOfNodeExp
);
if
(
match
)
{
var
nodeName
=
match
[
1
].
trim
().
replace
(
/^"/
,
''
).
replace
(
/"$/
,
""
);
var
nodeName
=
match
[
1
].
trim
().
replace
(
/^"/
,
''
).
replace
(
/"$/
,
''
);
var
nodeAttrs
=
match
[
2
].
split
(
'
,
'
);
for
(
var
i
=
0
,
l
=
nodeAttrs
.
length
;
i
<
l
;
i
++
)
{
...
...
@@ -3653,12 +3653,12 @@
}
// node's property
var
propExp
=
new
RegExp
(
"
^
\\
t{
"
+
(
this
.
currentIndent
)
+
"
}(
\\
w+):[
\\
s
\\
t
\\
r
\\
n](.*)
"
);
var
propExp
=
new
RegExp
(
'
^
\\
t{
'
+
(
this
.
currentIndent
)
+
'
}(
\\
w+):[
\\
s
\\
t
\\
r
\\
n](.*)
'
);
var
match
=
l
.
match
(
propExp
);
if
(
match
)
{
var
propName
=
match
[
1
].
replace
(
/^"/
,
''
).
replace
(
/"$/
,
""
).
trim
();
var
propValue
=
match
[
2
].
replace
(
/^"/
,
''
).
replace
(
/"$/
,
""
).
trim
();
var
propName
=
match
[
1
].
replace
(
/^"/
,
''
).
replace
(
/"$/
,
''
).
trim
();
var
propValue
=
match
[
2
].
replace
(
/^"/
,
''
).
replace
(
/"$/
,
''
).
trim
();
this
.
parseNodeProperty
(
l
,
propName
,
propValue
);
continue
;
...
...
@@ -3666,7 +3666,7 @@
}
// end of node
var
endOfNodeExp
=
new
RegExp
(
"
^
\\
t{
"
+
(
this
.
currentIndent
-
1
)
+
"
}}
"
);
var
endOfNodeExp
=
new
RegExp
(
'
^
\\
t{
'
+
(
this
.
currentIndent
-
1
)
+
'
}}
'
);
if
(
l
.
match
(
endOfNodeExp
)
)
{
this
.
nodeEnd
();
...
...
@@ -3775,7 +3775,7 @@
var
id
=
attrs
[
0
];
if
(
attrs
[
0
]
!==
""
)
{
if
(
attrs
[
0
]
!==
''
)
{
id
=
parseInt
(
attrs
[
0
]
);
...
...
@@ -3807,7 +3807,7 @@
var
parentName
=
currentNode
.
name
;
// special case parent node's is like "Properties70"
// these chilren nodes must treat with careful
// these chil
d
ren nodes must treat with careful
if
(
parentName
!==
undefined
)
{
var
propMatch
=
parentName
.
match
(
/Properties
(\d)
+/
);
...
...
@@ -3821,7 +3821,7 @@
}
// special case Connections
if
(
propName
==
'
C
'
)
{
if
(
propName
==
=
'
C
'
)
{
var
connProps
=
propValue
.
split
(
'
,
'
).
slice
(
1
);
var
from
=
parseInt
(
connProps
[
0
]
);
...
...
@@ -3842,7 +3842,7 @@
}
// special case Connections
if
(
propName
==
'
Node
'
)
{
if
(
propName
==
=
'
Node
'
)
{
var
id
=
parseInt
(
propValue
);
currentNode
.
properties
.
id
=
id
;
...
...
@@ -3917,16 +3917,16 @@
// cast value in its type
switch
(
innerPropType1
)
{
case
"
int
"
:
case
'
int
'
:
innerPropValue
=
parseInt
(
innerPropValue
);
break
;
case
"
double
"
:
case
'
double
'
:
innerPropValue
=
parseFloat
(
innerPropValue
);
break
;
case
"
ColorRGB
"
:
case
"
Vector3D
"
:
case
'
ColorRGB
'
:
case
'
Vector3D
'
:
innerPropValue
=
parseFloatArray
(
innerPropValue
);
break
;
...
...
@@ -3981,7 +3981,7 @@
var
version
=
reader
.
getUint32
();
console
.
log
(
'
FBX binary version:
'
+
version
);
console
.
log
(
'
THREE.FBXLoader:
FBX binary version:
'
+
version
);
var
allNodes
=
new
FBXTree
();
...
...
@@ -4325,7 +4325,7 @@
if
(
window
.
Zlib
===
undefined
)
{
throw
new
Error
(
'
FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js
'
);
throw
new
Error
(
'
THREE.
FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js
'
);
}
...
...
@@ -4360,7 +4360,7 @@
return
reader
.
getArrayBuffer
(
length
);
default
:
throw
new
Error
(
'
FBXLoader: Unknown property type
'
+
type
);
throw
new
Error
(
'
THREE.
FBXLoader: Unknown property type
'
+
type
);
}
...
...
@@ -4900,7 +4900,7 @@
for
(
var
i
=
0
;
i
<
CORRECT
.
length
;
++
i
)
{
var
num
=
read
(
1
);
if
(
num
==
CORRECT
[
i
]
)
{
if
(
num
==
=
CORRECT
[
i
]
)
{
return
false
;
...
...
@@ -4925,7 +4925,7 @@
return
version
;
}
throw
new
Error
(
'
FBXLoader: Cannot find the version number for the file given.
'
);
throw
new
Error
(
'
THREE.
FBXLoader: Cannot find the version number for the file given.
'
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录