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
36a8b39d
Commit
36a8b39d
authored
10 years ago
by
Philipp Oeser
Browse files
Options
Downloads
Patches
Plain Diff
Fix T41871: F2 addon throws error if there is a material slot with no
material assigned to it Reviewed By: sergey
parent
3d5cd195
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
mesh_f2.py
+9
-8
9 additions, 8 deletions
mesh_f2.py
with
9 additions
and
8 deletions
mesh_f2.py
+
9
−
8
View file @
36a8b39d
...
@@ -50,14 +50,15 @@ def get_uv_layer(ob, bm, mat_index):
...
@@ -50,14 +50,15 @@ def get_uv_layer(ob, bm, mat_index):
uv
=
me
.
uv_textures
.
active
.
name
uv
=
me
.
uv_textures
.
active
.
name
else
:
else
:
mat
=
ob
.
material_slots
[
mat_index
].
material
mat
=
ob
.
material_slots
[
mat_index
].
material
slot
=
mat
.
texture_slots
[
mat
.
active_texture_index
]
if
mat
is
not
None
:
if
slot
and
slot
.
uv_layer
:
slot
=
mat
.
texture_slots
[
mat
.
active_texture_index
]
uv
=
slot
.
uv_layer
if
slot
and
slot
.
uv_layer
:
else
:
uv
=
slot
.
uv_layer
for
tex_slot
in
mat
.
texture_slots
:
else
:
if
tex_slot
and
tex_slot
.
uv_layer
:
for
tex_slot
in
mat
.
texture_slots
:
uv
=
tex_slot
.
uv_layer
if
tex_slot
and
tex_slot
.
uv_layer
:
break
uv
=
tex_slot
.
uv_layer
break
if
uv
:
if
uv
:
uv_layer
=
bm
.
loops
.
layers
.
uv
.
get
(
uv
)
uv_layer
=
bm
.
loops
.
layers
.
uv
.
get
(
uv
)
...
...
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