Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
9c0349a7
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,发现更多精彩内容 >>
提交
9c0349a7
编写于
3月 31, 2017
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MorphAnimation: Removal
上级
6c5354f4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
161 deletion
+4
-161
editor/js/Sidebar.Animation.js
editor/js/Sidebar.Animation.js
+0
-85
examples/js/MorphAnimation.js
examples/js/MorphAnimation.js
+0
-73
utils/exporters/blender/tests/scripts/js/review.js
utils/exporters/blender/tests/scripts/js/review.js
+4
-3
未找到文件。
editor/js/Sidebar.Animation.js
浏览文件 @
9c0349a7
...
@@ -19,91 +19,6 @@ Sidebar.Animation = function ( editor ) {
...
@@ -19,91 +19,6 @@ Sidebar.Animation = function ( editor ) {
var
animationsRow
=
new
UI
.
Row
();
var
animationsRow
=
new
UI
.
Row
();
container
.
add
(
animationsRow
);
container
.
add
(
animationsRow
);
/*
var animations = {};
signals.objectAdded.add( function ( object ) {
object.traverse( function ( child ) {
if ( child instanceof THREE.SkinnedMesh ) {
var material = child.material;
if ( material instanceof THREE.MultiMaterial ) {
for ( var i = 0; i < material.materials.length; i ++ ) {
material.materials[ i ].skinning = true;
}
} else {
child.material.skinning = true;
}
animations[ child.id ] = new THREE.Animation( child, child.geometry.animation );
} else if ( child instanceof THREE.MorphAnimMesh ) {
var animation = new THREE.MorphAnimation( child );
animation.duration = 30;
// temporal hack for THREE.AnimationHandler
animation._play = animation.play;
animation.play = function () {
this._play();
THREE.AnimationHandler.play( this );
};
animation.resetBlendWeights = function () {};
animation.stop = function () {
this.pause();
THREE.AnimationHandler.stop( this );
};
animations[ child.id ] = animation;
}
} );
} );
signals.objectSelected.add( function ( object ) {
container.setDisplay( 'none' );
if ( object instanceof THREE.SkinnedMesh || object instanceof THREE.MorphAnimMesh ) {
animationsRow.clear();
var animation = animations[ object.id ];
var playButton = new UI.Button( 'Play' ).onClick( function () {
animation.play();
} );
animationsRow.add( playButton );
var pauseButton = new UI.Button( 'Stop' ).onClick( function () {
animation.stop();
} );
animationsRow.add( pauseButton );
container.setDisplay( 'block' );
}
} );
*/
return
container
;
return
container
;
};
};
examples/js/MorphAnimation.js
已删除
100644 → 0
浏览文件 @
6c5354f4
/**
* @author mrdoob / http://mrdoob.com
* @author willy-vvu / http://willy-vvu.github.io
*/
THREE
.
MorphAnimation
=
function
(
mesh
)
{
this
.
mesh
=
mesh
;
this
.
frames
=
mesh
.
morphTargetInfluences
.
length
;
this
.
currentTime
=
0
;
this
.
duration
=
1000
;
this
.
loop
=
true
;
this
.
lastFrame
=
0
;
this
.
currentFrame
=
0
;
this
.
isPlaying
=
false
;
};
THREE
.
MorphAnimation
.
prototype
=
{
constructor
:
THREE
.
MorphAnimation
,
play
:
function
()
{
this
.
isPlaying
=
true
;
},
pause
:
function
()
{
this
.
isPlaying
=
false
;
},
update
:
function
(
delta
)
{
if
(
this
.
isPlaying
===
false
)
return
;
this
.
currentTime
+=
delta
;
if
(
this
.
loop
===
true
&&
this
.
currentTime
>
this
.
duration
)
{
this
.
currentTime
%=
this
.
duration
;
}
this
.
currentTime
=
Math
.
min
(
this
.
currentTime
,
this
.
duration
);
var
frameTime
=
this
.
duration
/
this
.
frames
;
var
frame
=
Math
.
floor
(
this
.
currentTime
/
frameTime
);
var
influences
=
this
.
mesh
.
morphTargetInfluences
;
if
(
frame
!==
this
.
currentFrame
)
{
influences
[
this
.
lastFrame
]
=
0
;
influences
[
this
.
currentFrame
]
=
1
;
influences
[
frame
]
=
0
;
this
.
lastFrame
=
this
.
currentFrame
;
this
.
currentFrame
=
frame
;
}
var
mix
=
(
this
.
currentTime
%
frameTime
)
/
frameTime
;
influences
[
frame
]
=
mix
;
influences
[
this
.
lastFrame
]
=
1
-
mix
;
}
};
utils/exporters/blender/tests/scripts/js/review.js
浏览文件 @
9c0349a7
...
@@ -147,13 +147,14 @@ function loadGeometry( data, url ) {
...
@@ -147,13 +147,14 @@ function loadGeometry( data, url ) {
}
else
{
}
else
{
mesh
=
new
THREE
.
Mesh
(
data
.
geometry
,
material
);
if
(
data
.
geometry
.
morphTargets
.
length
>
0
)
{
if
(
data
.
geometry
.
morphTargets
.
length
>
0
)
{
console
.
log
(
'
loading morph targets
'
);
console
.
log
(
'
loading morph targets
'
);
data
.
materials
[
0
].
morphTargets
=
true
;
data
.
materials
[
0
].
morphTargets
=
true
;
animation
=
new
THREE
.
MorphAnimation
(
mesh
);
mesh
=
new
THREE
.
MorphAnimMesh
(
data
.
geometry
,
material
);
mixer
=
mesh
.
mixer
;
animation
=
mixer
.
clipAction
(
mesh
.
geometry
.
animations
[
0
]
);
hasMorph
=
true
;
hasMorph
=
true
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录