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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-16 11:32:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-16 11:32:57 +0400
commitbb1a7e4d8722fda09a3294eea56a537b6f043dd3 (patch)
treed498dc9f4a294f1f5b1780dd23219525da100a66 /source
parentd7c46c5d16c24e431c504148706ee3b5c68a2fd7 (diff)
Code Cleanup: simplify matcaps checks and quiet warning
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/library.c2
-rw-r--r--source/blender/bmesh/tools/bmesh_edgenet.c2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c83
3 files changed, 43 insertions, 44 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index ac5c387efca..516bcf77ad6 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -786,10 +786,8 @@ void BKE_libblock_copy_data(ID *id, const ID *id_from, const bool do_action)
void *BKE_libblock_copy_ex(Main *bmain, ID *id)
{
ID *idn;
- ListBase *lb;
size_t idn_len;
- lb = which_libbase(bmain, GS(id->name));
idn = BKE_libblock_alloc(bmain, GS(id->name), id->name + 2);
assert(idn != NULL);
diff --git a/source/blender/bmesh/tools/bmesh_edgenet.c b/source/blender/bmesh/tools/bmesh_edgenet.c
index 3b70d0e6406..37a748c238e 100644
--- a/source/blender/bmesh/tools/bmesh_edgenet.c
+++ b/source/blender/bmesh/tools/bmesh_edgenet.c
@@ -42,7 +42,7 @@
#include "BLI_strict_flags.h" /* keep last */
-/* Data for one end of an edge involved in a bevel */
+/* Struct for storing a path of verts walked over */
typedef struct VertNetInfo {
BMVert *prev; /* previous vertex */
int pass; /* path scanning pass value, for internal calculation */
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index daf406461e6..7d51e0eac75 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -6572,32 +6572,28 @@ static void draw_object_wire_color(Scene *scene, Base *base, unsigned char r_ob_
r_ob_wire_col[3] = 255;
}
-static void draw_object_matcap_check(Scene *scene, View3D *v3d, Object *ob)
+static void draw_object_matcap_check(View3D *v3d, Object *ob)
{
/* fixed rule, active object draws as matcap */
- if (ob == OBACT) {
- if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))
- return;
-
- if (v3d->defmaterial == NULL) {
- extern Material defmaterial;
-
- v3d->defmaterial = MEM_mallocN(sizeof(Material), "matcap material");
- *(v3d->defmaterial) = defmaterial;
- v3d->defmaterial->gpumaterial.first = v3d->defmaterial->gpumaterial.last = NULL;
- v3d->defmaterial->preview = NULL;
- }
- /* first time users */
- if (v3d->matcap_icon == 0)
- v3d->matcap_icon = ICON_MATCAP_01;
-
- if (v3d->defmaterial->preview == NULL)
- v3d->defmaterial->preview = UI_icon_to_preview(v3d->matcap_icon);
-
- /* signal to all material checks, gets cleared below */
- v3d->flag2 |= V3D_SHOW_SOLID_MATCAP;
+ BLI_assert((ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) == 0);
+
+ if (v3d->defmaterial == NULL) {
+ extern Material defmaterial;
+
+ v3d->defmaterial = MEM_mallocN(sizeof(Material), "matcap material");
+ *(v3d->defmaterial) = defmaterial;
+ v3d->defmaterial->gpumaterial.first = v3d->defmaterial->gpumaterial.last = NULL;
+ v3d->defmaterial->preview = NULL;
}
+ /* first time users */
+ if (v3d->matcap_icon == 0)
+ v3d->matcap_icon = ICON_MATCAP_01;
+
+ if (v3d->defmaterial->preview == NULL)
+ v3d->defmaterial->preview = UI_icon_to_preview(v3d->matcap_icon);
+ /* signal to all material checks, gets cleared below */
+ v3d->flag2 |= V3D_SHOW_SOLID_MATCAP;
}
static void draw_rigidbody_shape(Object *ob)
@@ -6754,34 +6750,39 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
dt = MIN2(dt, ob->dt);
if (v3d->zbuf == 0 && dt > OB_WIRE) dt = OB_WIRE;
dtx = 0;
-
- /* matcap check */
- if (dt == OB_SOLID && (v3d->flag2 & V3D_SOLID_MATCAP))
- draw_object_matcap_check(scene, v3d, ob);
+
/* faceselect exception: also draw solid when (dt == wire), except in editmode */
- if (is_obact && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) {
- if (ob->type == OB_MESH) {
- if (dt < OB_SOLID) {
- zbufoff = 1;
- dt = OB_SOLID;
- }
+ if (is_obact) {
+ if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) {
+ if (ob->type == OB_MESH) {
+ if (dt < OB_SOLID) {
+ zbufoff = 1;
+ dt = OB_SOLID;
+ }
- if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) {
- dt = OB_PAINT;
- }
+ if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) {
+ dt = OB_PAINT;
+ }
- glEnable(GL_DEPTH_TEST);
+ glEnable(GL_DEPTH_TEST);
+ }
+ else {
+ if (dt < OB_SOLID) {
+ dt = OB_SOLID;
+ glEnable(GL_DEPTH_TEST);
+ zbufoff = 1;
+ }
+ }
}
else {
- if (dt < OB_SOLID) {
- dt = OB_SOLID;
- glEnable(GL_DEPTH_TEST);
- zbufoff = 1;
+ /* matcap check - only when not painting color */
+ if ((v3d->flag2 & V3D_SOLID_MATCAP) && (dt == OB_SOLID)) {
+ draw_object_matcap_check(v3d, ob);
}
}
}
-
+
/* draw-extra supported for boundbox drawmode too */
if (dt >= OB_BOUNDBOX) {
dtx = ob->dtx;