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
a53fabc2
Commit
a53fabc2
authored
13 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
minor syntax change
parent
371c55f5
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
+2
-5
2 additions, 5 deletions
io_scene_obj/import_obj.py
with
2 additions
and
5 deletions
io_scene_obj/import_obj.py
+
2
−
5
View file @
a53fabc2
...
@@ -374,7 +374,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
...
@@ -374,7 +374,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
#Create new materials
#Create new materials
for
name
in
unique_materials
:
# .keys()
for
name
in
unique_materials
:
# .keys()
if
name
!=
None
:
if
name
is
not
None
:
unique_materials
[
name
]
=
bpy
.
data
.
materials
.
new
(
name
.
decode
(
'
utf-8
'
,
"
replace
"
))
unique_materials
[
name
]
=
bpy
.
data
.
materials
.
new
(
name
.
decode
(
'
utf-8
'
,
"
replace
"
))
unique_material_images
[
name
]
=
None
,
False
# assign None to all material images to start with, add to later.
unique_material_images
[
name
]
=
None
,
False
# assign None to all material images to start with, add to later.
...
@@ -396,10 +396,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
...
@@ -396,10 +396,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
pass
pass
elif
line
.
startswith
(
b
'
newmtl
'
):
elif
line
.
startswith
(
b
'
newmtl
'
):
context_material_name
=
line_value
(
line
.
split
())
context_material_name
=
line_value
(
line
.
split
())
if
context_material_name
in
unique_materials
:
context_material
=
unique_materials
.
get
(
context_material_name
)
context_material
=
unique_materials
[
context_material_name
]
else
:
context_material
=
None
elif
context_material
:
elif
context_material
:
# we need to make a material to assign properties to it.
# we need to make a material to assign properties to it.
...
...
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