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
f5084a00
Commit
f5084a00
authored
14 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix [#26643] [obj export] mp_bump in .mtl file
parent
9653e002
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_obj/export_obj.py
+23
-9
23 additions, 9 deletions
io_scene_obj/export_obj.py
with
23 additions
and
9 deletions
io_scene_obj/export_obj.py
+
23
−
9
View file @
f5084a00
...
...
@@ -111,16 +111,30 @@ def write_mtl(scene, filepath, copy_images, mtl_dict):
# file.write('map_Kd %s\n' % img.filepath.split('\\')[-1].split('/')[-1]) # Diffuse mapping image
elif
mat
:
# No face image. if we havea material search for MTex image.
for
mtex
in
mat
.
texture_slots
:
image_map
=
{}
# backwards so topmost are highest priority
for
mtex
in
reversed
(
mat
.
texture_slots
):
if
mtex
and
mtex
.
texture
.
type
==
'
IMAGE
'
:
try
:
filepath
=
copy_image
(
mtex
.
texture
.
image
)
# filepath = mtex.texture.image.filepath.split('\\')[-1].split('/')[-1]
file
.
write
(
'
map_Kd %s
\n
'
%
repr
(
filepath
)[
1
:
-
1
])
# Diffuse mapping image
break
except
:
# Texture has no image though its an image type, best ignore.
pass
image
=
mtex
.
texture
.
image
if
image
:
if
mtex
.
use_map_ambient
:
image_map
[
"
map_Ka
"
]
=
image
if
mtex
.
use_map_color_diffuse
:
image_map
[
"
map_Kd
"
]
=
image
if
mtex
.
use_map_specular
:
image_map
[
"
map_Ks
"
]
=
image
if
mtex
.
use_map_alpha
:
image_map
[
"
map_d
"
]
=
image
if
mtex
.
use_map_translucency
:
image_map
[
"
map_Tr
"
]
=
image
if
mtex
.
use_map_normal
:
image_map
[
"
map_Bump
"
]
=
image
if
mtex
.
use_map_hardness
:
image_map
[
"
map_Ns
"
]
=
image
for
key
,
image
in
image_map
.
items
():
filepath
=
copy_image
(
image
)
file
.
write
(
'
%s %s
\n
'
%
(
key
,
repr
(
filepath
)[
1
:
-
1
]))
file
.
write
(
'
\n\n
'
)
...
...
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