Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
1e313979
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,发现更多精彩内容 >>
提交
1e313979
编写于
1月 16, 2018
作者:
P
Pelle Johnsen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add option in blender exporter to bake keyframe animation
上级
e18b7259
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
0 deletion
+21
-0
utils/exporters/blender/addons/io_three/__init__.py
utils/exporters/blender/addons/io_three/__init__.py
+13
-0
utils/exporters/blender/addons/io_three/constants.py
utils/exporters/blender/addons/io_three/constants.py
+2
-0
utils/exporters/blender/addons/io_three/exporter/api/object.py
.../exporters/blender/addons/io_three/exporter/api/object.py
+6
-0
未找到文件。
utils/exporters/blender/addons/io_three/__init__.py
浏览文件 @
1e313979
...
@@ -434,6 +434,10 @@ def restore_export_settings(properties, settings):
...
@@ -434,6 +434,10 @@ def restore_export_settings(properties, settings):
constants
.
KEYFRAMES
,
constants
.
KEYFRAMES
,
constants
.
EXPORT_OPTIONS
[
constants
.
KEYFRAMES
])
constants
.
EXPORT_OPTIONS
[
constants
.
KEYFRAMES
])
properties
.
option_bake_keyframes
=
settings
.
get
(
constants
.
BAKE_KEYFRAMES
,
constants
.
EXPORT_OPTIONS
[
constants
.
BAKE_KEYFRAMES
])
properties
.
option_frame_step
=
settings
.
get
(
properties
.
option_frame_step
=
settings
.
get
(
constants
.
FRAME_STEP
,
constants
.
FRAME_STEP
,
constants
.
EXPORT_OPTIONS
[
constants
.
FRAME_STEP
])
constants
.
EXPORT_OPTIONS
[
constants
.
FRAME_STEP
])
...
@@ -491,6 +495,7 @@ def set_settings(properties):
...
@@ -491,6 +495,7 @@ def set_settings(properties):
constants
.
BLEND_SHAPES
:
properties
.
option_blend_shape
,
constants
.
BLEND_SHAPES
:
properties
.
option_blend_shape
,
constants
.
ANIMATION
:
properties
.
option_animation_skeletal
,
constants
.
ANIMATION
:
properties
.
option_animation_skeletal
,
constants
.
KEYFRAMES
:
properties
.
option_keyframes
,
constants
.
KEYFRAMES
:
properties
.
option_keyframes
,
constants
.
BAKE_KEYFRAMES
:
properties
.
option_bake_keyframes
,
constants
.
FRAME_STEP
:
properties
.
option_frame_step
,
constants
.
FRAME_STEP
:
properties
.
option_frame_step
,
constants
.
FRAME_INDEX_AS_TIME
:
properties
.
option_frame_index_as_time
,
constants
.
FRAME_INDEX_AS_TIME
:
properties
.
option_frame_index_as_time
,
constants
.
INFLUENCES_PER_VERTEX
:
properties
.
option_influences
constants
.
INFLUENCES_PER_VERTEX
:
properties
.
option_influences
...
@@ -736,6 +741,11 @@ class ExportThree(bpy.types.Operator, ExportHelper):
...
@@ -736,6 +741,11 @@ class ExportThree(bpy.types.Operator, ExportHelper):
description
=
"Export animation (keyframes)"
,
description
=
"Export animation (keyframes)"
,
default
=
constants
.
EXPORT_OPTIONS
[
constants
.
KEYFRAMES
])
default
=
constants
.
EXPORT_OPTIONS
[
constants
.
KEYFRAMES
])
option_bake_keyframes
=
BoolProperty
(
name
=
"Bake keyframe animation"
,
description
=
"Bake keyframe animation each frame step"
,
default
=
constants
.
EXPORT_OPTIONS
[
constants
.
BAKE_KEYFRAMES
])
option_frame_index_as_time
=
BoolProperty
(
option_frame_index_as_time
=
BoolProperty
(
name
=
"Frame index as time"
,
name
=
"Frame index as time"
,
description
=
"Use (original) frame index as frame time"
,
description
=
"Use (original) frame index as frame time"
,
...
@@ -961,6 +971,9 @@ class ExportThree(bpy.types.Operator, ExportHelper):
...
@@ -961,6 +971,9 @@ class ExportThree(bpy.types.Operator, ExportHelper):
row
=
box
.
row
()
row
=
box
.
row
()
row
.
prop
(
self
.
properties
,
'option_keyframes'
)
row
.
prop
(
self
.
properties
,
'option_keyframes'
)
row
=
box
.
row
()
row
.
prop
(
self
.
properties
,
'option_bake_keyframes'
)
row
=
box
.
row
()
row
=
box
.
row
()
row
.
prop
(
self
.
properties
,
'option_influences'
)
row
.
prop
(
self
.
properties
,
'option_influences'
)
...
...
utils/exporters/blender/addons/io_three/constants.py
浏览文件 @
1e313979
...
@@ -93,6 +93,7 @@ FRAME_INDEX_AS_TIME = 'frameIndexAsTime'
...
@@ -93,6 +93,7 @@ FRAME_INDEX_AS_TIME = 'frameIndexAsTime'
ANIMATION
=
'animations'
ANIMATION
=
'animations'
CLIPS
=
"clips"
CLIPS
=
"clips"
KEYFRAMES
=
'tracks'
KEYFRAMES
=
'tracks'
BAKE_KEYFRAMES
=
'bake_tracks'
MORPH_TARGETS
=
'morphTargets'
MORPH_TARGETS
=
'morphTargets'
MORPH_TARGETS_ANIM
=
'morphTargetsAnimation'
MORPH_TARGETS_ANIM
=
'morphTargetsAnimation'
BLEND_SHAPES
=
'blendShapes'
BLEND_SHAPES
=
'blendShapes'
...
@@ -161,6 +162,7 @@ EXPORT_OPTIONS = {
...
@@ -161,6 +162,7 @@ EXPORT_OPTIONS = {
MAPS
:
False
,
MAPS
:
False
,
ANIMATION
:
OFF
,
ANIMATION
:
OFF
,
KEYFRAMES
:
False
,
KEYFRAMES
:
False
,
BAKE_KEYFRAMES
:
False
,
BONES
:
False
,
BONES
:
False
,
SKINNING
:
False
,
SKINNING
:
False
,
MORPH_TARGETS
:
False
,
MORPH_TARGETS
:
False
,
...
...
utils/exporters/blender/addons/io_three/exporter/api/object.py
浏览文件 @
1e313979
...
@@ -231,6 +231,12 @@ def animated_xform(obj, options):
...
@@ -231,6 +231,12 @@ def animated_xform(obj, options):
inverted_fallback
=
mathutils
.
Matrix
()
if
use_inverted
else
None
inverted_fallback
=
mathutils
.
Matrix
()
if
use_inverted
else
None
convert_matrix
=
AXIS_CONVERSION
# matrix to convert the exported matrix
convert_matrix
=
AXIS_CONVERSION
# matrix to convert the exported matrix
original_frame
=
context
.
scene
.
frame_current
original_frame
=
context
.
scene
.
frame_current
if
options
.
get
(
constants
.
BAKE_KEYFRAMES
):
frame_step
=
options
.
get
(
constants
.
FRAME_STEP
,
1
)
logger
.
info
(
"Baking keyframes, frame_step=%d"
,
frame_step
)
times
=
range
(
context
.
scene
.
frame_start
,
context
.
scene
.
frame_end
+
1
,
frame_step
)
for
time
in
times
:
for
time
in
times
:
context
.
scene
.
frame_set
(
time
,
0.0
)
context
.
scene
.
frame_set
(
time
,
0.0
)
if
use_inverted
:
# need to use the inverted, parent matrix might have chance
if
use_inverted
:
# need to use the inverted, parent matrix might have chance
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录