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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-03-23 14:00:34 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-03-23 14:00:34 +0300
commit0884c174b3b43cb53b47269cc204f08c0dc68f6a (patch)
tree058382455036a8c15d4fc22c0b65e03e9a6da4f5
parentc451dba550788c745e3c6c96700fc2620a31eb47 (diff)
Make sure matcap icons are within range.
Basically out of range could happen when opening files made in 2.72 when the new icons for texture painting were added. Apparently some more caution is needed here.
-rw-r--r--source/blender/editors/space_view3d/drawobject.c5
-rw-r--r--source/blender/makesrna/intern/rna_space.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 61c9891e201..d4d8db6d6c7 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -7232,8 +7232,11 @@ static void draw_object_matcap_check(View3D *v3d, Object *ob)
v3d->defmaterial->preview = NULL;
}
/* first time users */
- if (v3d->matcap_icon == 0)
+ if (v3d->matcap_icon < ICON_MATCAP_01 ||
+ v3d->matcap_icon > ICON_MATCAP_24)
+ {
v3d->matcap_icon = ICON_MATCAP_01;
+ }
if (v3d->defmaterial->preview == NULL)
v3d->defmaterial->preview = UI_icon_to_preview(v3d->matcap_icon);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index db4b097b9c3..8e262df7e67 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -493,8 +493,11 @@ static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(sce
{
View3D *v3d = (View3D *)(ptr->data);
- if (v3d->matcap_icon == 0)
+ if (v3d->matcap_icon < ICON_MATCAP_01 ||
+ v3d->matcap_icon > ICON_MATCAP_24)
+ {
v3d->matcap_icon = ICON_MATCAP_01;
+ }
}
static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)