Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <michaelw@cowtoolsmedia.co.uk>2011-04-09 12:05:20 +0400
committerMichael Williamson <michaelw@cowtoolsmedia.co.uk>2011-04-09 12:05:20 +0400
commitb5a7f16d83f41913fd7cd5712a448f3480f169e0 (patch)
treecb004fd537988c407a794ad2244c5179a8d1e9a7 /space_view3d_materials_utils.py
parenta215fb30f4dff7b5d1d6d8cec506ef7a6aba89bd (diff)
Indentation fix: if assigning a material already on the object to a selection of faces in edit mode the script would do nothing
Diffstat (limited to 'space_view3d_materials_utils.py')
-rw-r--r--space_view3d_materials_utils.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/space_view3d_materials_utils.py b/space_view3d_materials_utils.py
index 75e53a52..0b984ba8 100644
--- a/space_view3d_materials_utils.py
+++ b/space_view3d_materials_utils.py
@@ -391,16 +391,16 @@ def assign_mat(matname="Default"):
ob.data.materials.append(target)
#now assign the material:
- me =ob.data
- if allfaces:
- for f in me.faces:
+ me =ob.data
+ if allfaces:
+ for f in me.faces:
+ f.material_index = index
+ elif allfaces == False:
+ for f in me.faces:
+ if f.select:
f.material_index = index
- elif allfaces == False:
- for f in me.faces:
- if f.select:
- f.material_index = index
- me.update()
-
+ me.update()
+
#restore the active object
@@ -710,3 +710,4 @@ def unregister():
if __name__ == "__main__":
register()
+ \ No newline at end of file