Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
5db2bb4f
Commit
5db2bb4f
authored
13 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
- update 3DS export for BMesh.
- pep8 edits for after effects script.
parent
9692a3e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io_export_after_effects.py
+3
-5
3 additions, 5 deletions
io_export_after_effects.py
io_scene_3ds/export_3ds.py
+8
-8
8 additions, 8 deletions
io_scene_3ds/export_3ds.py
with
11 additions
and
13 deletions
io_export_after_effects.py
+
3
−
5
View file @
5db2bb4f
...
@@ -331,7 +331,6 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
...
@@ -331,7 +331,6 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
'
orientation_anim
'
:
False
,
'
orientation_anim
'
:
False
,
}
}
# create structure for nulls
# create structure for nulls
for
i
,
obj
in
enumerate
(
selection
[
'
nulls
'
]):
# nulls representing blender's obs except cameras, lamps and solids
for
i
,
obj
in
enumerate
(
selection
[
'
nulls
'
]):
# nulls representing blender's obs except cameras, lamps and solids
if
include_selected_objects
:
if
include_selected_objects
:
...
@@ -461,7 +460,7 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
...
@@ -461,7 +460,7 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
js_data
[
'
cameras
'
][
name_ae
][
'
position_static
'
]
=
position
js_data
[
'
cameras
'
][
name_ae
][
'
position_static
'
]
=
position
js_data
[
'
cameras
'
][
name_ae
][
'
orientation_static
'
]
=
orientation
js_data
[
'
cameras
'
][
name_ae
][
'
orientation_static
'
]
=
orientation
js_data
[
'
cameras
'
][
name_ae
][
'
zoom_static
'
]
=
zoom
js_data
[
'
cameras
'
][
name_ae
][
'
zoom_static
'
]
=
zoom
'''
'''
# keyframes for all solids. Not ready yet. Temporarily not active
# keyframes for all solids. Not ready yet. Temporarily not active
for i, ob in enumerate(selection[
'
solids
'
]):
for i, ob in enumerate(selection[
'
solids
'
]):
...
@@ -469,7 +468,7 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
...
@@ -469,7 +468,7 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
name_ae = selection[
'
solids
'
][i][1]
name_ae = selection[
'
solids
'
][i][1]
#convert ob position to AE space
#convert ob position to AE space
'''
'''
# keyframes for all lights.
# keyframes for all lights.
if
include_selected_objects
:
if
include_selected_objects
:
for
i
,
ob
in
enumerate
(
selection
[
'
lights
'
]):
for
i
,
ob
in
enumerate
(
selection
[
'
lights
'
]):
...
@@ -549,7 +548,6 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
...
@@ -549,7 +548,6 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
#
#
#
#
#
#
# ---- write JSX file
# ---- write JSX file
jsx_file
=
open
(
file
,
'
w
'
)
jsx_file
=
open
(
file
,
'
w
'
)
...
@@ -678,6 +676,7 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
...
@@ -678,6 +676,7 @@ def write_jsx_file(file, data, selection, include_animation, include_active_cam,
# DO IT
# DO IT
##########################################
##########################################
def
main
(
file
,
context
,
include_animation
,
include_active_cam
,
include_selected_cams
,
include_selected_objects
,
include_cam_bundles
):
def
main
(
file
,
context
,
include_animation
,
include_active_cam
,
include_selected_cams
,
include_selected_objects
,
include_cam_bundles
):
data
=
get_comp_data
(
context
)
data
=
get_comp_data
(
context
)
selection
=
get_selected
(
context
)
selection
=
get_selected
(
context
)
...
@@ -772,4 +771,3 @@ def unregister():
...
@@ -772,4 +771,3 @@ def unregister():
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
register
()
register
()
This diff is collapsed.
Click to expand it.
io_scene_3ds/export_3ds.py
+
8
−
8
View file @
5db2bb4f
...
@@ -525,13 +525,13 @@ def extract_triangles(mesh):
...
@@ -525,13 +525,13 @@ def extract_triangles(mesh):
If the mesh contains quads, they will be split into triangles.
'''
If the mesh contains quads, they will be split into triangles.
'''
tri_list
=
[]
tri_list
=
[]
do_uv
=
len
(
mesh
.
uv_textures
)
do_uv
=
bool
(
mesh
.
tessface_
uv_textures
)
img
=
None
img
=
None
for
i
,
face
in
enumerate
(
mesh
.
faces
):
for
i
,
face
in
enumerate
(
mesh
.
tess
faces
):
f_v
=
face
.
vertices
f_v
=
face
.
vertices
uf
=
mesh
.
uv_textures
.
active
.
data
[
i
]
if
do_uv
else
None
uf
=
mesh
.
tessface_
uv_textures
.
active
.
data
[
i
]
if
do_uv
else
None
if
do_uv
:
if
do_uv
:
f_uv
=
uf
.
uv
f_uv
=
uf
.
uv
...
@@ -638,7 +638,7 @@ def make_faces_chunk(tri_list, mesh, materialDict):
...
@@ -638,7 +638,7 @@ def make_faces_chunk(tri_list, mesh, materialDict):
face_chunk
=
_3ds_chunk
(
OBJECT_FACES
)
face_chunk
=
_3ds_chunk
(
OBJECT_FACES
)
face_list
=
_3ds_array
()
face_list
=
_3ds_array
()
if
mesh
.
uv_textures
:
if
mesh
.
tessface_
uv_textures
:
# Gather materials used in this mesh - mat/image pairs
# Gather materials used in this mesh - mat/image pairs
unique_mats
=
{}
unique_mats
=
{}
for
i
,
tri
in
enumerate
(
tri_list
):
for
i
,
tri
in
enumerate
(
tri_list
):
...
@@ -725,7 +725,7 @@ def make_mesh_chunk(mesh, matrix, materialDict):
...
@@ -725,7 +725,7 @@ def make_mesh_chunk(mesh, matrix, materialDict):
# Extract the triangles from the mesh:
# Extract the triangles from the mesh:
tri_list
=
extract_triangles
(
mesh
)
tri_list
=
extract_triangles
(
mesh
)
if
mesh
.
uv_textures
:
if
mesh
.
tessface_
uv_textures
:
# Remove the face UVs and convert it to vertex UV:
# Remove the face UVs and convert it to vertex UV:
vert_array
,
uv_array
,
tri_list
=
remove_face_uv
(
mesh
.
vertices
,
tri_list
)
vert_array
,
uv_array
,
tri_list
=
remove_face_uv
(
mesh
.
vertices
,
tri_list
)
else
:
else
:
...
@@ -963,11 +963,11 @@ def save(operator,
...
@@ -963,11 +963,11 @@ def save(operator,
mat_ls_len
=
len
(
mat_ls
)
mat_ls_len
=
len
(
mat_ls
)
# get material/image tuples.
# get material/image tuples.
if
data
.
uv_textures
:
if
data
.
tessface_
uv_textures
:
if
not
mat_ls
:
if
not
mat_ls
:
mat
=
mat_name
=
None
mat
=
mat_name
=
None
for
f
,
uf
in
zip
(
data
.
faces
,
data
.
uv_textures
.
active
.
data
):
for
f
,
uf
in
zip
(
data
.
tess
faces
,
data
.
tessface_
uv_textures
.
active
.
data
):
if
mat_ls
:
if
mat_ls
:
mat_index
=
f
.
material_index
mat_index
=
f
.
material_index
if
mat_index
>=
mat_ls_len
:
if
mat_index
>=
mat_ls_len
:
...
@@ -987,7 +987,7 @@ def save(operator,
...
@@ -987,7 +987,7 @@ def save(operator,
materialDict
.
setdefault
((
mat
.
name
,
None
),
(
mat
,
None
))
materialDict
.
setdefault
((
mat
.
name
,
None
),
(
mat
,
None
))
# Why 0 Why!
# Why 0 Why!
for
f
in
data
.
faces
:
for
f
in
data
.
tess
faces
:
if
f
.
material_index
>=
mat_ls_len
:
if
f
.
material_index
>=
mat_ls_len
:
f
.
material_index
=
0
f
.
material_index
=
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment