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
b57533bc
Commit
b57533bc
authored
14 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix for incorrect attributes, also use bump as map_bump.
parent
0a18240d
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/import_obj.py
+7
-4
7 additions, 4 deletions
io_scene_obj/import_obj.py
with
7 additions
and
4 deletions
io_scene_obj/import_obj.py
+
7
−
4
View file @
b57533bc
...
@@ -249,7 +249,7 @@ def obj_image_load(imagepath, DIR, IMAGE_SEARCH):
...
@@ -249,7 +249,7 @@ def obj_image_load(imagepath, DIR, IMAGE_SEARCH):
if
image
:
if
image
:
return
image
return
image
print
(
"
failed to load
'
%s
'
doesn
'
t exist
"
,
imagepath
)
print
(
"
failed to load
%r
doesn
'
t exist
"
%
imagepath
)
return
None
return
None
# def obj_image_load(imagepath, DIR, IMAGE_SEARCH):
# def obj_image_load(imagepath, DIR, IMAGE_SEARCH):
...
@@ -303,8 +303,8 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
...
@@ -303,8 +303,8 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
mtex
.
use_map_color_diffuse
=
True
mtex
.
use_map_color_diffuse
=
True
mtex
.
use_map_alpha
=
True
mtex
.
use_map_alpha
=
True
texture
.
mipmap
=
True
texture
.
use_
mipmap
=
True
texture
.
interpolation
=
True
texture
.
use_
interpolation
=
True
texture
.
use_alpha
=
True
texture
.
use_alpha
=
True
blender_material
.
use_transparency
=
True
blender_material
.
use_transparency
=
True
blender_material
.
alpha
=
0.0
blender_material
.
alpha
=
0.0
...
@@ -351,6 +351,9 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
...
@@ -351,6 +351,9 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
mtex
.
texture
=
texture
mtex
.
texture
=
texture
mtex
.
texture_coords
=
'
UV
'
mtex
.
texture_coords
=
'
UV
'
mtex
.
use_map_reflect
=
True
mtex
.
use_map_reflect
=
True
else
:
raise
Exception
(
"
invalid type
'
%s
'"
%
type
)
# Add an MTL with the same name as the obj if no MTLs are spesified.
# Add an MTL with the same name as the obj if no MTLs are spesified.
temp_mtl
=
os
.
path
.
splitext
((
os
.
path
.
basename
(
filepath
)))[
0
]
+
'
.mtl
'
temp_mtl
=
os
.
path
.
splitext
((
os
.
path
.
basename
(
filepath
)))[
0
]
+
'
.mtl
'
...
@@ -414,7 +417,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
...
@@ -414,7 +417,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
img_filepath
=
line_value
(
line
.
split
())
img_filepath
=
line_value
(
line
.
split
())
if
img_filepath
:
if
img_filepath
:
load_material_image
(
context_material
,
context_material_name
,
img_filepath
,
'
Kd
'
)
load_material_image
(
context_material
,
context_material_name
,
img_filepath
,
'
Kd
'
)
elif
line_lower
.
startswith
(
'
map_bump
'
)
:
elif
line_lower
.
startswith
(
'
map_bump
'
)
or
line_lower
.
startswith
(
'
bump
'
):
# 'bump' is incorrect but some files use it.
img_filepath
=
line_value
(
line
.
split
())
img_filepath
=
line_value
(
line
.
split
())
if
img_filepath
:
if
img_filepath
:
load_material_image
(
context_material
,
context_material_name
,
img_filepath
,
'
Bump
'
)
load_material_image
(
context_material
,
context_material_name
,
img_filepath
,
'
Bump
'
)
...
...
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