Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
4f4bf136
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
4f4bf136
编写于
5月 22, 2016
作者:
T
Takahiro
提交者:
Mr.doob
5月 22, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean Up MMDLoader morph animation (#8964)
上级
c2a5c1f3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
27 deletion
+32
-27
examples/js/loaders/MMDLoader.js
examples/js/loaders/MMDLoader.js
+32
-27
未找到文件。
examples/js/loaders/MMDLoader.js
浏览文件 @
4f4bf136
...
...
@@ -2694,15 +2694,15 @@ THREE.MMDLoader.prototype.createAnimation = function ( mesh, vmd, name ) {
}
if
(
mesh
.
geometry
.
animations
===
undefined
)
{
var
clip
=
THREE
.
AnimationClip
.
parseAnimation
(
animation
,
mesh
.
geometry
.
bones
);
mesh
.
geometry
.
animations
=
[];
if
(
clip
!==
null
)
{
}
if
(
mesh
.
geometry
.
animations
===
undefined
)
{
var
clip
=
THREE
.
AnimationClip
.
parseAnimation
(
animation
,
mesh
.
geometry
.
bones
)
;
mesh
.
geometry
.
animations
=
[]
;
if
(
clip
!==
null
)
{
}
mesh
.
geometry
.
animations
.
push
(
clip
);
...
...
@@ -2747,6 +2747,8 @@ THREE.MMDLoader.prototype.createAnimation = function ( mesh, vmd, name ) {
}
// TODO: should we use THREE.AnimationClip.CreateFromMorphTargetSequence() instead?
var
tracks
=
[];
for
(
var
i
=
0
;
i
<
orderedMorphs
.
length
;
i
++
)
{
...
...
@@ -2767,13 +2769,13 @@ THREE.MMDLoader.prototype.createAnimation = function ( mesh, vmd, name ) {
if
(
clip
!==
null
)
{
if
(
mesh
.
geometry
.
morphA
nimations
===
undefined
)
{
if
(
mesh
.
geometry
.
a
nimations
===
undefined
)
{
mesh
.
geometry
.
morphA
nimations
=
[];
mesh
.
geometry
.
a
nimations
=
[];
}
mesh
.
geometry
.
morphA
nimations
.
push
(
clip
);
mesh
.
geometry
.
a
nimations
.
push
(
clip
);
}
...
...
@@ -4139,45 +4141,48 @@ THREE.MMDHelper.prototype = {
setAnimation
:
function
(
mesh
)
{
if
(
mesh
.
geometry
.
animations
!==
undefined
||
mesh
.
geometry
.
morphAnimations
!==
undefined
)
{
if
(
mesh
.
geometry
.
animations
!==
undefined
)
{
mesh
.
mixer
=
new
THREE
.
AnimationMixer
(
mesh
);
}
if
(
mesh
.
geometry
.
animations
!==
undefined
)
{
var
foundAnimation
=
false
;
var
foundMorphAnimation
=
false
;
for
(
var
i
=
0
;
i
<
mesh
.
geometry
.
animations
.
length
;
i
++
)
{
var
action
=
mesh
.
mixer
.
clipAction
(
mesh
.
geometry
.
animations
[
i
]
)
;
var
clip
=
mesh
.
geometry
.
animations
[
i
]
;
if
(
i
===
0
)
{
var
action
=
mesh
.
mixer
.
clipAction
(
clip
);
action
.
play
();
if
(
clip
.
tracks
[
0
].
name
.
indexOf
(
'
.morphTargetInfluences
'
)
===
0
)
{
}
if
(
!
foundMorphAnimation
)
{
}
action
.
play
();
foundMorphAnimation
=
true
;
mesh
.
ikSolver
=
new
THREE
.
CCDIKSolver
(
mesh
);
}
if
(
mesh
.
geometry
.
grants
!==
undefined
)
{
}
else
{
mesh
.
grantSolver
=
new
THREE
.
MMDGrantSolver
(
mesh
);
if
(
!
foundAnimation
)
{
}
action
.
play
();
foundAnimation
=
true
;
}
}
if
(
mesh
.
geometry
.
morphAnimations
!==
undefined
)
{
}
}
for
(
var
i
=
0
;
i
<
mesh
.
geometry
.
morphAnimations
.
length
;
i
++
)
{
if
(
foundAnimation
)
{
var
action
=
mesh
.
mixer
.
clipAction
(
mesh
.
geometry
.
morphAnimations
[
i
]
);
mesh
.
ikSolver
=
new
THREE
.
CCDIKSolver
(
mesh
);
if
(
i
===
0
)
{
if
(
mesh
.
geometry
.
grants
!==
undefined
)
{
action
.
play
(
);
mesh
.
grantSolver
=
new
THREE
.
MMDGrantSolver
(
mesh
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录