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
0918250e
Commit
0918250e
authored
13 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix [#28150] .3ds format export
parent
cc104d3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_scene_3ds/export_3ds.py
+18
-7
18 additions, 7 deletions
io_scene_3ds/export_3ds.py
with
18 additions
and
7 deletions
io_scene_3ds/export_3ds.py
+
18
−
7
View file @
0918250e
...
@@ -699,7 +699,15 @@ def make_uv_chunk(uv_array):
...
@@ -699,7 +699,15 @@ def make_uv_chunk(uv_array):
return
uv_chunk
return
uv_chunk
def
make_mesh_chunk
(
mesh
,
materialDict
):
def
make_matrix_4x3_chunk
(
matrix
):
matrix_chunk
=
_3ds_chunk
(
OBJECT_TRANS_MATRIX
)
for
vec
in
matrix
:
for
f
in
vec
[:
3
]:
matrix_chunk
.
add_variable
(
"
matrix_f
"
,
_3ds_float
(
f
))
return
matrix_chunk
def
make_mesh_chunk
(
mesh
,
matrix
,
materialDict
):
'''
Make a chunk out of a Blender mesh.
'''
'''
Make a chunk out of a Blender mesh.
'''
# Extract the triangles from the mesh:
# Extract the triangles from the mesh:
...
@@ -739,8 +747,11 @@ def make_mesh_chunk(mesh, materialDict):
...
@@ -739,8 +747,11 @@ def make_mesh_chunk(mesh, materialDict):
if
uv_array
:
if
uv_array
:
mesh_chunk
.
add_subchunk
(
make_uv_chunk
(
uv_array
))
mesh_chunk
.
add_subchunk
(
make_uv_chunk
(
uv_array
))
mesh_chunk
.
add_subchunk
(
make_matrix_4x3_chunk
(
matrix
))
return
mesh_chunk
return
mesh_chunk
"""
# COMMENTED OUT FOR 2.42 RELEASE!! CRASHES 3DS MAX
"""
# COMMENTED OUT FOR 2.42 RELEASE!! CRASHES 3DS MAX
def make_kfdata(start=0, stop=0, curtime=0):
def make_kfdata(start=0, stop=0, curtime=0):
'''
Make the basic keyframe data chunk
'''
'''
Make the basic keyframe data chunk
'''
...
@@ -928,7 +939,7 @@ def save(operator,
...
@@ -928,7 +939,7 @@ def save(operator,
continue
continue
for
ob_derived
,
mat
in
derived
:
for
ob_derived
,
mat
in
derived
:
if
ob
.
type
not
in
(
'
MESH
'
,
'
CURVE
'
,
'
SURFACE
'
,
'
FONT
'
,
'
META
'
)
:
if
ob
.
type
not
in
{
'
MESH
'
,
'
CURVE
'
,
'
SURFACE
'
,
'
FONT
'
,
'
META
'
}
:
continue
continue
try
:
try
:
...
@@ -937,9 +948,9 @@ def save(operator,
...
@@ -937,9 +948,9 @@ def save(operator,
data
=
None
data
=
None
if
data
:
if
data
:
data
.
transform
(
global_matrix
*
mat
)
matrix
=
global_matrix
*
mat
#
data.transform(mat
, recalc_normals=False
)
data
.
transform
(
mat
rix
)
mesh_objects
.
append
((
ob_derived
,
data
))
mesh_objects
.
append
((
ob_derived
,
data
,
matrix
))
mat_ls
=
data
.
materials
mat_ls
=
data
.
materials
mat_ls_len
=
len
(
mat_ls
)
mat_ls_len
=
len
(
mat_ls
)
...
@@ -993,7 +1004,7 @@ def save(operator,
...
@@ -993,7 +1004,7 @@ def save(operator,
# Create object chunks for all meshes:
# Create object chunks for all meshes:
i
=
0
i
=
0
for
ob
,
blender_mesh
in
mesh_objects
:
for
ob
,
blender_mesh
,
matrix
in
mesh_objects
:
# create a new object chunk
# create a new object chunk
object_chunk
=
_3ds_chunk
(
OBJECT
)
object_chunk
=
_3ds_chunk
(
OBJECT
)
...
@@ -1001,7 +1012,7 @@ def save(operator,
...
@@ -1001,7 +1012,7 @@ def save(operator,
object_chunk
.
add_variable
(
"
name
"
,
_3ds_string
(
sane_name
(
ob
.
name
)))
object_chunk
.
add_variable
(
"
name
"
,
_3ds_string
(
sane_name
(
ob
.
name
)))
# make a mesh chunk out of the mesh:
# make a mesh chunk out of the mesh:
object_chunk
.
add_subchunk
(
make_mesh_chunk
(
blender_mesh
,
materialDict
))
object_chunk
.
add_subchunk
(
make_mesh_chunk
(
blender_mesh
,
matrix
,
materialDict
))
object_info
.
add_subchunk
(
object_chunk
)
object_info
.
add_subchunk
(
object_chunk
)
'''
# COMMENTED OUT FOR 2.42 RELEASE!! CRASHES 3DS MAX
'''
# COMMENTED OUT FOR 2.42 RELEASE!! CRASHES 3DS MAX
...
...
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