Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
ac6b89b9
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,发现更多精彩内容 >>
提交
ac6b89b9
编写于
10月 22, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7403 from bhouston/blender_export_bugfixes
Blender export bugfixes
上级
1dccaf09
68dc1d83
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
8 deletion
+40
-8
utils/exporters/blender/addons/io_three/constants.py
utils/exporters/blender/addons/io_three/constants.py
+1
-0
utils/exporters/blender/addons/io_three/exporter/api/animation.py
...porters/blender/addons/io_three/exporter/api/animation.py
+4
-4
utils/exporters/blender/addons/io_three/exporter/api/light.py
...s/exporters/blender/addons/io_three/exporter/api/light.py
+20
-0
utils/exporters/blender/addons/io_three/exporter/api/mesh.py
utils/exporters/blender/addons/io_three/exporter/api/mesh.py
+10
-2
utils/exporters/blender/addons/io_three/exporter/geometry.py
utils/exporters/blender/addons/io_three/exporter/geometry.py
+0
-1
utils/exporters/blender/addons/io_three/exporter/object.py
utils/exporters/blender/addons/io_three/exporter/object.py
+5
-1
未找到文件。
utils/exporters/blender/addons/io_three/constants.py
浏览文件 @
ac6b89b9
...
...
@@ -338,6 +338,7 @@ INTENSITY = 'intensity'
DISTANCE
=
'distance'
ASPECT
=
'aspect'
ANGLE
=
'angle'
DECAY
=
'decayExponent'
FOV
=
'fov'
ASPECT
=
'aspect'
...
...
utils/exporters/blender/addons/io_three/exporter/api/animation.py
浏览文件 @
ac6b89b9
...
...
@@ -7,7 +7,6 @@ import mathutils
from
bpy
import
data
,
context
,
ops
from
..
import
constants
,
logger
def
pose_animation
(
armature
,
options
):
"""Query armature animation using pose bones
...
...
@@ -47,9 +46,10 @@ def _parse_action(func, armature, options):
animations
=
[]
logger
.
info
(
"Parsing %d actions"
,
len
(
data
.
actions
))
for
action
in
data
.
actions
:
logger
.
info
(
"Parsing action %s"
,
action
.
name
)
animation
=
func
(
action
,
armature
,
options
)
animations
.
append
(
animation
)
if
action
==
armature
.
animation_data
.
action
:
logger
.
info
(
"Parsing action %s"
,
action
.
name
)
animation
=
func
(
action
,
armature
,
options
)
animations
.
append
(
animation
)
return
animations
...
...
utils/exporters/blender/addons/io_three/exporter/api/light.py
浏览文件 @
ac6b89b9
...
...
@@ -75,3 +75,23 @@ def intensity(lamp):
"""
logger
.
debug
(
"light.intensity(%s)"
,
lamp
)
return
round
(
lamp
.
energy
,
2
)
# mapping enum values to decay exponent
__FALLOFF_TO_EXP
=
{
'CONSTANT'
:
0
,
'INVERSE_LINEAR'
:
1
,
'INVERSE_SQUARE'
:
2
,
'CUSTOM_CURVE'
:
0
,
'LINEAR_QUADRATIC_WEIGHTED'
:
2
}
@
_lamp
def
falloff
(
lamp
):
"""
:param lamp:
:rtype: float
"""
logger
.
debug
(
"light.falloff(%s)"
,
lamp
)
return
__FALLOFF_TO_EXP
[
lamp
.
falloff_type
]
utils/exporters/blender/addons/io_three/exporter/api/mesh.py
浏览文件 @
ac6b89b9
...
...
@@ -342,9 +342,9 @@ def faces(mesh, options, material_list=None):
face_data
.
append
(
mat_index
)
break
else
:
error
=
(
"Could not map the material index "
logger
.
warning
(
"Could not map the material index "
"for face %d"
%
face
.
index
)
raise
exceptions
.
MaterialError
(
error
)
face_data
.
append
(
0
)
# default to index zero if there's a bad material
if
uv_indices
:
for
index
,
uv_layer
in
enumerate
(
uv_indices
):
...
...
@@ -465,6 +465,11 @@ def animated_blend_shapes(mesh, name, options):
:param options:
"""
# let filter the name to only keep the node's name
# the two cases are '%sGeometry' and '%sGeometry.%d', and we want %s
name
=
re
.
search
(
"^(.*)Geometry(\..*)?$"
,
name
).
group
(
1
)
logger
.
debug
(
"mesh.animated_blend_shapes(%s, %s)"
,
mesh
,
options
)
tracks
=
[]
shp
=
mesh
.
shape_keys
...
...
@@ -520,6 +525,9 @@ def materials(mesh, options):
logger
.
info
(
"Vertex colours set to %s"
,
use_colors
)
for
mat
,
index
in
material_sets
:
if
mat
==
None
:
# undefined material for a specific index is skipped
continue
try
:
dbg_color
=
constants
.
DBG_COLORS
[
index
]
except
IndexError
:
...
...
utils/exporters/blender/addons/io_three/exporter/geometry.py
浏览文件 @
ac6b89b9
...
...
@@ -568,7 +568,6 @@ class Geometry(base_classes.BaseNode):
mt
=
api
.
mesh
.
blend_shapes
(
self
.
node
,
self
.
options
)
or
[]
self
[
constants
.
MORPH_TARGETS
]
=
mt
if
len
(
mt
)
>
0
and
self
.
_scene
:
# there's blend shapes, let check for animation
#self[constants.CLIPS] = api.mesh.animated_blend_shapes(self.node, self.options) or []
tracks
=
api
.
mesh
.
animated_blend_shapes
(
self
.
node
,
self
[
constants
.
NAME
],
self
.
options
)
or
[]
merge
=
self
.
_scene
[
constants
.
ANIMATION
][
0
][
constants
.
KEYFRAMES
]
for
track
in
tracks
:
...
...
utils/exporters/blender/addons/io_three/exporter/object.py
浏览文件 @
ac6b89b9
...
...
@@ -51,8 +51,12 @@ class Object(base_classes.BaseNode):
# self[constants.DISTANCE] = api.light.distance(self.data)
self
[
constants
.
DISTANCE
]
=
0
;
if
self
[
constants
.
TYPE
]
==
constants
.
SPOT_LIGHT
:
lightType
=
self
[
constants
.
TYPE
]
if
lightType
==
constants
.
SPOT_LIGHT
:
self
[
constants
.
ANGLE
]
=
api
.
light
.
angle
(
self
.
data
)
self
[
constants
.
DECAY
]
=
api
.
light
.
falloff
(
self
.
data
)
elif
lightType
==
constants
.
POINT_LIGHT
:
self
[
constants
.
DECAY
]
=
api
.
light
.
falloff
(
self
.
data
)
def
_init_mesh
(
self
):
"""Initialize mesh attributes"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录