manual sync with trunk - pulling in changes where the issues are not bmesh spesific
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 Dec 2011 23:13:28 +0000 (23:13 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 Dec 2011 23:13:28 +0000 (23:13 +0000)
- some merges added lines in multiple times
- removed some NULL checks that were only in bmesh
- enable cycles by default (was disabled because it used not to work)
- make formatting match

33 files changed:
CMakeLists.txt
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/multires.c
source/blender/blenlib/BLI_math_color.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/path_util.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/makesdna/DNA_userdef_types.h

index 3e831c12fe1f5bda2fa3788488628b5e97b41af8..8bc875085af5529f35860a9cb13653f28398bb32 100644 (file)
@@ -215,7 +215,7 @@ endif()
 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
 
 # Cycles
-option(WITH_CYCLES                                     "Enable cycles Render Engine" OFF)
+option(WITH_CYCLES                                     "Enable cycles Render Engine" ON)
 option(WITH_CYCLES_TEST                                "Build cycles test application" OFF)
 option(WITH_CYCLES_CUDA_BINARIES       "Build cycles CUDA binaries" OFF)
 set(CYCLES_CUDA_BINARIES_ARCH          sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build binaries for")
index 1bfe9bb9e29814fd6a92e1353417e5e06ab6eb00..1dd8e372100bf1662fb982274e424d4306fc9d91 100644 (file)
@@ -239,6 +239,7 @@ void *CustomData_get_layer(const struct CustomData *data, int type);
 void *CustomData_get_layer_n(const struct CustomData *data, int type, int n);
 void *CustomData_get_layer_named(const struct CustomData *data, int type,
                                                                 const char *name);
+
 int CustomData_get_layer_index(const struct CustomData *data, int type);
 int CustomData_get_layer_index_n(const struct CustomData *data, int type, int n);
 int CustomData_get_named_layer_index(const struct CustomData *data, int type, const char *name);
index fd80006d71d54d5f73b429d93e5d67c5e27fdfb5..081b79b44d63e674de1aae77f15d937adc7837c0 100644 (file)
@@ -86,7 +86,7 @@ typedef struct SculptSession {
 
        /* Partial redraw */
        int partial_redraw;
-
+       
        /* Used to cache the render of the active texture */
        unsigned int texcache_side, *texcache, texcache_actual;
 
index 6ff3b20049c1ed950bdc108c96545b158705ac34..ba7dc1896c96dcd11e0d4bc1c007024fce0b88be 100644 (file)
@@ -767,12 +767,10 @@ static void *get_orco_coords_dm(Object *ob, BMEditMesh *em, int layer, int *free
                   by a more flexible customdata system, but not simple */
                if(!em) {
                        ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
-                       if (clmd) {
-                               KeyBlock *kb= key_get_keyblock(ob_get_key(ob), clmd->sim_parms->shapekey_rest);
-       
-                               if(kb->data)
-                                       return kb->data;
-                       }
+                       KeyBlock *kb= key_get_keyblock(ob_get_key(ob), clmd->sim_parms->shapekey_rest);
+
+                       if(kb->data)
+                               return kb->data;
                }
 
                return NULL;
@@ -1170,7 +1168,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                 */
                if (deform_r) {
                        *deform_r = CDDM_from_mesh(me, ob);
-                       
+                        
                        if (build_shapekey_layers)
                                add_shapekey_layers(dm, me, ob);
                        
@@ -2240,7 +2238,10 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                attribs->tface[a].array = tfdata->layers[layer].data;
                                attribs->tface[a].emOffset = tfdata->layers[layer].offset;
                                attribs->tface[a].glIndex = gattribs->layer[b].glindex;
-                       } /*else {
+                               /* attribs->tface[a].glTexco = gattribs->layer[b].gltexco; */ /* BMESH_TODO, trunk has this but not bmesh, need to investigate whats going on here - campbell */
+                       }
+                       /* BMESH ONLY, may need to get this working?, otherwise remove */
+                       /* else {
                                int player;
                                CustomData *pdata = dm->getPolyDataLayout(dm);
                                
@@ -2259,7 +2260,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                        attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
                                        
                                }
-                       }*/
+                       }
+                       */
                }
                else if(gattribs->layer[b].type == CD_MCOL) {
                        /* vertex colors */
index 19838a634f8cc62eb0547e01b0470b91789d447d..e7f9e40ec3e7f36f0119075e051db854f1d52a9f 100644 (file)
@@ -652,7 +652,7 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
                                                        copy_v3_v3(co[2], vert[ face[i].v3 ].co);
                                                        if(face[i].v4)
                                                                copy_v3_v3(co[3], vert[ face[i].v4 ].co);
-                               
+                                       
                                                        BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3);
                                                }
                                        }
index bf2e12e153352911004a0eca5c08e1586458f7a6..1a82e608795c249105596ce86851555b50e44d1c 100644 (file)
@@ -965,9 +965,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
                                }
 
                                glEnd();
-                       } /*else {
-                               printf("eek in cddm draw mapped faces!\n");
-                       }*/
+                       }
                        
                        if (nors) nors += 3;
                }
index 1bee8eaa0231f040c465c93b399b88d6700c6dc7..0f1c73c59c14ba82ee1c55cc23bbe6cc863d38b5 100644 (file)
@@ -49,7 +49,6 @@
 #include "DNA_key_types.h"  
 #include "DNA_scene_types.h"  
 #include "DNA_vfont_types.h"  
-#include "DNA_meshdata_types.h"  
 #include "DNA_object_types.h"
 
 #include "BKE_animsys.h"
index 40de735e15fc08af0e75e326da1341fe27619ac7..035c7f409c4110251b4339effa8648f517aabbb5 100644 (file)
@@ -132,9 +132,6 @@ MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, int use_fi
 
 static int multires_get_level(Object *ob, MultiresModifierData *mmd, int render)
 {
-       if (!ob || !mmd)
-               return 0;
-       
        if(render)
                return (mmd->modifier.scene)? get_render_subsurf_level(&mmd->modifier.scene->r, mmd->renderlvl): mmd->renderlvl;
        else if(ob->mode == OB_MODE_SCULPT)
index 1463ff90e5ae1403cc38f1e015af59a5eb917cc1..0e33ee2be3fc8966f5406c07e65e165c5fc482cd 100644 (file)
@@ -86,12 +86,6 @@ void linearrgb_to_srgb_rgba_buf(float *col, int tot);
 void srgb_to_linearrgb_rgba_rgba_buf(float *col_to, float *col_from, int tot);
 void linearrgb_to_srgb_rgba_rgba_buf(float *col_to, float *col_from, int tot);
        
-/* rgba buffer convenience functions */
-void srgb_to_linearrgb_rgba_buf(float *col, int tot);
-void linearrgb_to_srgb_rgba_buf(float *col, int tot);
-void srgb_to_linearrgb_rgba_rgba_buf(float *col_to, float *col_from, int tot);
-void linearrgb_to_srgb_rgba_rgba_buf(float *col_to, float *col_from, int tot);
-       
 /************************** Other *************************/
 
 int constrain_rgb(float *r, float *g, float *b);
index 0fb79956282ab76c8858a1e7912449b0d035fbd4..059a167d0732d35b449d5d25b39091f980ae5ed0 100644 (file)
@@ -38,8 +38,6 @@ extern "C" {
 
 #ifdef BLI_MATH_INLINE_H
 #include "intern/math_vector_inline.c"
-#else
-#define MINLINE
 #endif
 
 /************************************* Init ***********************************/
index f6dd28c3151d73a338a4d80008226a3271a2c3de..6f014a859dbd5a5d2e390e1f761378db86e5439e 100644 (file)
@@ -510,7 +510,7 @@ MINLINE float normalize_v3_v3(float r[3], const float a[3])
        return d;
 }
 
-MINLINE double normalize_dv3(double n[3])
+MINLINE double normalize_v3_d(double n[3])
 {
        double d= n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
 
index ebb3937dd913ec8a1d315d205659103a05598f02..e79d850caa582ef0b119496c29c297f32d3d3750 100644 (file)
@@ -35,7 +35,6 @@
 #include <ctype.h>
 #include <string.h>
 #include <stdlib.h>
-#include <stddef.h>
 #include <assert.h>
 
 #include "MEM_guardedalloc.h"
@@ -318,7 +317,7 @@ void BLI_uniquename(ListBase *list, void *vlink, const char defname[], char deli
 
 void BLI_cleanup_path(const char *relabase, char *dir)
 {
-       ptrdiff_t a;
+       short a;
        char *start, *eind;
        if (relabase) {
                BLI_path_abs(dir, relabase);
index b2b151bd34db38eba623f59c37f0b76a0e1bf90c..36e9f2db58f2825712e9b55c928850709cc573e4 100644 (file)
@@ -67,7 +67,6 @@
 
 /* copy the face flags, most importantly selection from the mesh to the final derived mesh,
  * use in object mode when selecting faces (while painting) */
-
 void paintface_flush_flags(Object *ob)
 {
        Mesh *me = get_mesh(ob);
@@ -78,9 +77,8 @@ void paintface_flush_flags(Object *ob)
        int totface, totpoly;
        int i;
        
-       if (me==NULL || dm==NULL) {
+       if(me==NULL || dm==NULL)
                return;
-       }
 
        /*
         * Try to push updated mesh poly flags to three other data sets:
index a1e3b84f8985de542d3a0e26b4cb120d30aced8e..6bee08378194194ee74df4f3d096dad07c52a5c1 100644 (file)
@@ -129,12 +129,10 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
                                break;
                        }
                }
-
                
                /* set index */
                CustomData_set_layer_active(data, type, actindex);
        }
-
        
        if (rndlayerdata != layerdata) {
                /* find index */
@@ -145,12 +143,10 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
                                break;
                        }
                }
-
                
                /* set index */
                CustomData_set_layer_render(data, type, rndindex);
        }
-
        
        if (clonelayerdata != layerdata) {
                /* find index */
@@ -161,12 +157,10 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
                                break;
                        }
                }
-
                
                /* set index */
                CustomData_set_layer_clone(data, type, cloneindex);
        }
-
        
        if (stencillayerdata != layerdata) {
                /* find index */
@@ -177,7 +171,6 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
                                break;
                        }
                }
-
                
                /* set index */
                CustomData_set_layer_stencil(data, type, stencilindex);
@@ -316,18 +309,16 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
                em= me->edit_btmesh;
 
                layernum = CustomData_number_of_layers(&em->bm->pdata, CD_MTEXPOLY);
-               if (layernum >= MAX_MTFACE) {
+               if (layernum >= MAX_MTFACE)
                        return 0;
-               }
 
                BM_add_data_layer(em->bm, &em->bm->pdata, CD_MTEXPOLY);
                CustomData_set_layer_active(&em->bm->pdata, CD_MTEXPOLY, layernum);
                CustomData_set_layer_name(&em->bm->pdata, CD_MTEXPOLY, layernum, name);
 
                /* copy data from active UV */
-               if (layernum) {
+               if (layernum)
                        copy_editface_active_customdata(em, CD_MTFACE, layernum);
-               }
 
                if (active_set || layernum == 0) {
                        CustomData_set_layer_active(&em->bm->pdata, CD_MTEXPOLY, layernum);
@@ -343,9 +334,8 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
        }
        else {
                layernum = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY);
-               if (layernum >= MAX_MTFACE) {
+               if (layernum >= MAX_MTFACE)
                        return 0;
-               }
 
                if (me->mtpoly) {
                        CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DUPLICATE, me->mtpoly, me->totpoly, name);
@@ -515,7 +505,6 @@ void MESH_OT_uv_texture_add(wmOperatorType *ot)
        ot->name= "Add UV Map";
        ot->description= "Add UV Map";
        ot->idname= "MESH_OT_uv_texture_add";
-
        
        /* api callbacks */
        ot->poll= layers_poll;
@@ -536,19 +525,16 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
        Object *obedit;
        int exitmode= 0;
        char name[32];
-
        
        /* Check context */
        if(base==NULL || base->object->type!=OB_MESH) {
                BKE_report(op->reports, RPT_ERROR, "Not an Object or Mesh");
                return OPERATOR_CANCELLED;
        }
-
        
        /* check input variables */
        if(RNA_property_is_set(op->ptr, "filepath")) {
                char path[FILE_MAX];
-
                
                RNA_string_get(op->ptr, "filepath", path);
                ima= BKE_add_image_file(path);
@@ -557,13 +543,11 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
                RNA_string_get(op->ptr, "name", name);
                ima= (Image *)find_id("IM", name);
        }
-
        
        if(!ima) {
                BKE_report(op->reports, RPT_ERROR, "Not an Image");
                return OPERATOR_CANCELLED;
        }
-
        
        /* put mesh in editmode */
 
@@ -575,7 +559,6 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
        }
        if(me->edit_btmesh==NULL)
                return OPERATOR_CANCELLED;
-
        
        ED_uvedit_assign_image(bmain, scene, obedit, ima, NULL);
 
@@ -589,10 +572,8 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
        /* dummie drop support; ensure view shows a result :) */
        if(v3d)
                v3d->flag2 |= V3D_SOLID_TEX;
-
        
        WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
        
        return OPERATOR_FINISHED;
 }
@@ -603,16 +584,13 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
        ot->name= "Assign Image to UV Map";
        ot->description= "Assign Image to active UV Map, or create an UV Map";
        ot->idname= "MESH_OT_drop_named_image";
-
        
        /* api callbacks */
        ot->poll= layers_poll;
        ot->invoke= drop_named_image_invoke;
-
        
        /* flags */
        ot->flag= OPTYPE_UNDO;
-
        
        /* properties */
        RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign");
@@ -636,7 +614,6 @@ void MESH_OT_uv_texture_remove(wmOperatorType *ot)
        ot->name= "Remove UV Map";
        ot->description= "Remove UV Map";
        ot->idname= "MESH_OT_uv_texture_remove";
-
        
        /* api callbacks */
        ot->poll= layers_poll;
@@ -666,7 +643,6 @@ void MESH_OT_vertex_color_add(wmOperatorType *ot)
        ot->name= "Add Vertex Color";
        ot->description= "Add vertex color layer";
        ot->idname= "MESH_OT_vertex_color_add";
-
        
        /* api callbacks */
        ot->poll= layers_poll;
@@ -693,7 +669,6 @@ void MESH_OT_vertex_color_remove(wmOperatorType *ot)
        ot->name= "Remove Vertex Color";
        ot->description= "Remove vertex color layer";
        ot->idname= "MESH_OT_vertex_color_remove";
-
        
        /* api callbacks */
        ot->exec= vertex_color_remove_exec;
@@ -729,7 +704,6 @@ void MESH_OT_sticky_add(wmOperatorType *ot)
        ot->name= "Add Sticky";
        ot->description= "Add sticky UV texture layer";
        ot->idname= "MESH_OT_sticky_add";
-
        
        /* api callbacks */
        ot->poll= layers_poll;
@@ -762,7 +736,6 @@ void MESH_OT_sticky_remove(wmOperatorType *ot)
        ot->name= "Remove Sticky";
        ot->description= "Remove sticky UV texture layer";
        ot->idname= "MESH_OT_sticky_remove";
-
        
        /* api callbacks */
        ot->poll= layers_poll;
@@ -889,8 +862,6 @@ static void mesh_add_edges(Mesh *mesh, int len)
        mesh->totedge= totedge;
 }
 
-
-
 static void mesh_add_faces(Mesh *mesh, int len)
 {
        CustomData fdata;
@@ -1012,7 +983,6 @@ void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count)
        mesh_add_edges(mesh, count);
 }
 
-
 void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count)
 {
        if(mesh->edit_btmesh) {
index 1d0e09c17c05d69e7b73a845995b752f88256832..8d5c9dcc8f45dfd59931a6240d6a317f7ac9afb1 100644 (file)
@@ -244,7 +244,7 @@ int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
        return op->type->exec(C, op);
 }
 
-int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, 
+int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
        float *rot, int *enter_editmode, unsigned int *layer, int *is_view_aligned)
 {
        View3D *v3d = CTX_wm_view3d(C);
@@ -308,7 +308,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
 
 /* for object add primitive operators */
 /* do not call undo push in this function (users of this function have to) */
-Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, 
+Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot,
        int enter_editmode, unsigned int layer)
 {
        Main *bmain= CTX_data_main(C);
index 437d2e880c1778d831887bad8756a5a96099ad84..d92b2e726b0917258e3849c456e086111b39d538 100644 (file)
@@ -1143,8 +1143,6 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
        WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, scene);
        WM_event_add_notifier(C, NC_SCENE|ND_LAYER_CONTENT, scene);
 
-       WM_event_add_notifier(C, NC_SCENE|ND_LAYER_CONTENT, scene);
-
        DAG_scene_sort(bmain, scene);
 
        return OPERATOR_FINISHED;
index 6e3fab0385fb74a4d710f51433d2d4cda47b4588..149c73e29806e2899eaaa583b6ce03b3ae82a903 100644 (file)
@@ -101,7 +101,7 @@ int ED_vgroup_object_is_edit_mode(Object *ob)
 bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name)
 {
        bDeformGroup *defgroup;
-       
+
        if(!ob || !OB_TYPE_SUPPORT_VGROUP(ob->type))
                return NULL;
        
@@ -632,8 +632,8 @@ static void vgroup_select_verts(Object *ob, int select)
                                        if(dvert->dw[i].def_nr == (ob->actdef-1)){
                                                if (!BM_TestHFlag(eve, BM_HIDDEN)) {
                                                        BM_Select(em->bm, eve, select);
-                                                       break;
                                                }
+                                               break;
                                        }
                                }
                        }
index b9e9005dd25ad1827fef2a9ab2ce3ab7fab817cb..3993707dbb9ab78c0b8511d7130391091066c4cb 100644 (file)
@@ -2623,7 +2623,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
                        }
                }
 
-               if((point->flag & PEP_TAG) && mirrorfaces && mirrorfaces[pa->num*2] != -1)
+               if((point->flag & PEP_TAG) && mirrorfaces[pa->num*2] != -1)
                        newtotpart++;
        }
 
@@ -2660,7 +2660,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
 
                        if(point->flag & PEP_HIDE)
                                continue;
-                       if(!(point->flag & PEP_TAG) || (mirrorfaces && mirrorfaces[pa->num*2] == -1))
+                       if(!(point->flag & PEP_TAG) || mirrorfaces[pa->num*2] == -1)
                                continue;
 
                        /* duplicate */
@@ -2670,7 +2670,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
                        if(point->keys) newpoint->keys= MEM_dupallocN(point->keys);
 
                        /* rotate weights according to vertex index rotation */
-                       rotation= mirrorfaces ? mirrorfaces[pa->num*2+1] : 0;
+                       rotation= mirrorfaces[pa->num*2+1];
                        newpa->fuv[0]= pa->fuv[2];
                        newpa->fuv[1]= pa->fuv[1];
                        newpa->fuv[2]= pa->fuv[0];
@@ -2682,7 +2682,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
                                        SHIFT3(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2])
 
                        /* assign face inddex */
-                                       newpa->num= mirrorfaces ? mirrorfaces[pa->num*2] : 0;
+                       newpa->num= mirrorfaces[pa->num*2];
                        newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL);
 
                        /* update edit key pointers */
@@ -2704,8 +2704,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
                point->flag &= ~PEP_TAG;
        }
 
-       if (mirrorfaces)
-               MEM_freeN(mirrorfaces);
+       MEM_freeN(mirrorfaces);
 }
 
 static int mirror_exec(bContext *C, wmOperator *UNUSED(op))
index ddf766330d47dbf92f8356da73cc345900a3a0d3..b15278bd5838bd8aaa10e49775765c88a35c5488 100644 (file)
@@ -361,7 +361,6 @@ int ED_operator_uvedit(bContext *C)
 {
        SpaceImage *sima= CTX_wm_space_image(C);
        Object *obedit= CTX_data_edit_object(C);
-
        return ED_space_image_show_uvedit(sima, obedit);
 }
 
@@ -373,8 +372,9 @@ int ED_operator_uvmap(bContext *C)
        if(obedit && obedit->type==OB_MESH)
                em= ((Mesh *)obedit->data)->edit_btmesh;
        
-       if(em && (em->bm->totface))
+       if(em && (em->bm->totface)) {
                return 1;
+       }
        
        return 0;
 }
@@ -2976,7 +2976,7 @@ int ED_screen_animation_play(bContext *C, int sync, int mode)
                        ScreenAnimData *sad= wt->customdata;
                        
                        sad->ar= CTX_wm_region(C);
-                       }
+               }
        }
 
        return OPERATOR_FINISHED;
index c11778a1d154915000edbfa385cb74b48dd00717..fb29bec286407d7346a061a6122e43b23df964c7 100644 (file)
@@ -2999,18 +2999,15 @@ static void project_paint_begin(ProjPaintState *ps)
        }
        
        /* when using subsurf or multires, mface arrays are thrown away, we need to keep a copy */
-       // this seems like a bad check, since some constructive modifiers use cddm? - joeedh
-       if(1) { //ps->dm->type != DM_TYPE_CDDM) {
+       if(ps->dm->type != DM_TYPE_CDDM) {
                ps->dm_mvert= MEM_dupallocN(ps->dm_mvert);
                ps->dm_mface= MEM_dupallocN(ps->dm_mface);
                /* looks like these are ok for now.*/
-               
+               /*
                ps->dm_mtface= MEM_dupallocN(ps->dm_mtface);
-               if (ps->dm_mtface_clone)
-                       ps->dm_mtface_clone= MEM_dupallocN(ps->dm_mtface_clone);
-               if (ps->dm_mtface_stencil)
-                       ps->dm_mtface_stencil= MEM_dupallocN(ps->dm_mtface_stencil);
-                
+               ps->dm_mtface_clone= MEM_dupallocN(ps->dm_mtface_clone);
+               ps->dm_mtface_stencil= MEM_dupallocN(ps->dm_mtface_stencil);
+                */
        }
        
        ps->viewDir[0] = 0.0f;
@@ -3489,8 +3486,7 @@ static void project_paint_end(ProjPaintState *ps)
        }
        
        /* copy for subsurf/multires, so throw away */
-       // this seems like a bad check, since some constructive modifiers use cddm? - joeedh
-       if(1) { //ps->dm->type != DM_TYPE_CDDM) {
+       if(ps->dm->type != DM_TYPE_CDDM) {
                if(ps->dm_mvert) MEM_freeN(ps->dm_mvert);
                if(ps->dm_mface) MEM_freeN(ps->dm_mface);
                /* looks like these dont need copying */
@@ -4800,20 +4796,9 @@ static int texture_paint_init(bContext *C, wmOperator *op)
        pop->orig_brush_size= brush_size(brush);
 
        if(pop->mode != PAINT_MODE_2D) {
-               Mesh *me;
-
                pop->s.ob = OBACT;
-               if (!pop->ps.ob)
-                       pop->ps.ob = pop->s.ob;
-               
                pop->s.me = get_mesh(pop->s.ob);
                if (!pop->s.me) return 0;
-               
-               me = pop->s.me;
-
-               /* Dont allow brush size below 2 */
-               if (pop->ps.brush && pop->ps.brush->size<=1)
-                       pop->ps.brush->size = 2;
        }
        else {
                pop->s.image = pop->s.sima->image;
index a2ae801e862f0a4d93f88329b9529f624d64ba28..77daa3cdc283aa95ddcc3bb619b6a70ce123e39c 100644 (file)
@@ -338,10 +338,10 @@ static void make_vertexcol(Object *ob)    /* single ob */
        /* copies from shadedisplist to mcol */
        if(!me->mcol)
                CustomData_add_layer(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface);
-       if (!me->mloopcol)
-               CustomData_add_layer(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop);
-       
-       mesh_update_customdata_pointers(me);
+       if (!me->mloopcol) {
+               CustomData_add_layer(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop);   
+               mesh_update_customdata_pointers(me);
+       }
 
        //if(shade)
        //      shadeMeshMCol(scene, ob, me);
index 31316c705d0aaa8d398197d119f56b22fa536521..69ca3b5c23296c5143adbacb73ec59a7486cdaaf 100644 (file)
@@ -203,8 +203,6 @@ typedef struct StrokeCache {
        float mouse[2];
        float bstrength;
        float tex_mouse[2];
-       
-       rctf prect;
 
        /* The rest is temporary storage that isn't saved as a property */
 
@@ -256,15 +254,6 @@ static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
        float bb_min[3], bb_max[3], pmat[4][4];
        int i, j, k;
 
-/*     if (G.rt == 1) {
-               rect->xmin = ob->sculpt->cache->prect.xmin;
-               rect->xmax = ob->sculpt->cache->prect.xmax;
-               rect->ymin = ob->sculpt->cache->prect.ymin;
-               rect->ymax = ob->sculpt->cache->prect.ymax;
-
-               return rect->xmin < rect->xmax && rect->ymin < rect->ymax;;
-       }
-*/
        ED_view3d_ob_project_mat_get(rv3d, ob, pmat);
 
        if(!pbvh)
@@ -319,7 +308,6 @@ void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
        PBVH *pbvh= ob->sculpt->pbvh;
        BoundBox bb;
        bglMats mats;
-       StrokeCache *cache = ob->sculpt->cache;
        rcti rect;
 
        memset(&bb, 0, sizeof(BoundBox));
@@ -348,13 +336,6 @@ void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
        /* clear redraw flag from nodes */
        if(pbvh)
                BLI_pbvh_update(pbvh, PBVH_UpdateRedraw, NULL);
-
-       /*clear prect*/
-       cache->prect.xmin = FLT_MAX;
-       cache->prect.xmax = -FLT_MAX;
-       cache->prect.ymin = FLT_MAX;
-       cache->prect.ymax = -FLT_MAX;
-
 }
 
 /************************ Brush Testing *******************/
@@ -1399,7 +1380,7 @@ static void do_nudge_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
                proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
 
                sculpt_brush_test_init(ss, &test);
-               
+
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, vd.co)) {
                                const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
@@ -2241,6 +2222,7 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
 
        float bstrength = ss->cache->bstrength;
        const float radius = ss->cache->radius;
+
        float an[3];
        float fc[3];
        float offset = get_offset(sd, ss);
@@ -2876,11 +2858,6 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio
        int mode;
 
        ss->cache = cache;
-       
-       cache->prect.xmin = FLT_MAX;
-       cache->prect.xmax = -FLT_MAX;
-       cache->prect.ymin = FLT_MAX;
-       cache->prect.ymax = -FLT_MAX;
 
        /* Set scaling adjustment */
        ss->cache->scale[0] = 1.0f / ob->size[0];
@@ -3498,7 +3475,6 @@ static void sculpt_stroke_done(bContext *C, struct PaintStroke *UNUSED(stroke))
 
                sculpt_cache_free(ss->cache);
                ss->cache = NULL;
-               sculpt_flush_update(C);
 
                sculpt_undo_push_end();
 
index 9fff70fd5abee047c26a917da857ee364e337bf2..fbf8af514b679deeac5996bd5c1a740fff182df5 100644 (file)
@@ -39,8 +39,6 @@
 #include "BKE_context.h"
 #include "BKE_screen.h"
 
-#include "bmesh.h"
-
 #include "UI_interface.h"
 #include "UI_view2d.h"
 
index b420fa6c02f50d77ff7f76979680eddfe783c6da..8f9a743ccf563b112f16af7469eb2bfb6f0bc970 100644 (file)
@@ -1951,10 +1951,10 @@ void mesh_foreachScreenVert(
        data.userData = userData;
        data.clipVerts = clipVerts;
 
-       EDBM_init_index_arrays(vc->em, 1, 0, 0);
        if(clipVerts != V3D_CLIP_TEST_OFF)
                ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
 
+       EDBM_init_index_arrays(vc->em, 1, 0, 0);
        dm->foreachMappedVert(dm, mesh_foreachScreenVert__mapFunc, &data);
        EDBM_free_index_arrays(vc->em);
 
@@ -2044,10 +2044,10 @@ void mesh_foreachScreenEdge(
        data.userData = userData;
        data.clipVerts = clipVerts;
 
-       EDBM_init_index_arrays(vc->em, 0, 1, 0);
        if(clipVerts != V3D_CLIP_TEST_OFF)
                ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
 
+       EDBM_init_index_arrays(vc->em, 0, 1, 0);
        dm->foreachMappedEdge(dm, mesh_foreachScreenEdge__mapFunc, &data);
        EDBM_free_index_arrays(vc->em);
 
@@ -2084,10 +2084,10 @@ void mesh_foreachScreenFace(
        data.func = func;
        data.userData = userData;
 
-       EDBM_init_index_arrays(vc->em, 0, 0, 1);
        //if(clipVerts)
        ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
 
+       EDBM_init_index_arrays(vc->em, 0, 0, 1);
        dm->foreachMappedFaceCenter(dm, mesh_foreachScreenFace__mapFunc, &data);
        EDBM_free_index_arrays(vc->em);
 
@@ -2262,10 +2262,6 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, int sel, BMVert *eve_
        data.sel = sel;
        data.eve_act = eve_act;
        data.em = em;
-       
-       bglBegin(GL_POINTS);
-       dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data);
-       bglEnd();
 
        bglBegin(GL_POINTS);
        dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data);
@@ -2526,7 +2522,7 @@ static void draw_dm_bweights(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
 /* EditMesh drawing routines*/
 
 static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, 
-                               BMEditMesh *em, DerivedMesh *cageDM, BMVert *eve_act)
+                                BMEditMesh *em, DerivedMesh *cageDM, BMVert *eve_act)
 {
        ToolSettings *ts= scene->toolsettings;
        int sel;
@@ -2583,9 +2579,9 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit,
        glPointSize(1.0);
 }
 
-static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d, 
-                               Mesh *me, DerivedMesh *cageDM, short sel_only, 
-                               BMEdge *eed_act)
+static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d,
+                                Mesh *me, DerivedMesh *cageDM, short sel_only,
+                                BMEdge *eed_act)
 {
        ToolSettings *ts= scene->toolsettings;
        int pass;
@@ -2643,8 +2639,8 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d,
        }
 }      
 
-static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, 
-                                 Object *ob, BMEditMesh *em, UnitSettings *unit)
+static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d,
+                                  Object *ob, BMEditMesh *em, UnitSettings *unit)
 {
        Mesh *me= ob->data;
        float v1[3], v2[3], v3[3], vmid[3], fvec[3];
@@ -6992,7 +6988,7 @@ static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, f
 
 /* two options, facecolors or black */
 static void bbs_mesh_solid_EM(BMEditMesh *em, Scene *scene, View3D *v3d,
-                             Object *ob, DerivedMesh *dm, int facecol)
+                              Object *ob, DerivedMesh *dm, int facecol)
 {
        void *ptrs[2] = {em, NULL}; //second one being null means to draw black
        cpack(0);
index df3e83fed156a09c1622932246257b94ce710bfa..29ab1723381a3ce220cf1978d73bf18571144135 100644 (file)
@@ -44,7 +44,6 @@
 #include "BLI_editVert.h"
 #include "BLI_edgehash.h"
 #include "BLI_rand.h"
-#include "BLI_utildefines.h"
 
 #include "BKE_curve.h"
 #include "BKE_constraint.h" // for the get_constraint_target function
index 218b7ce4dbf7b0ec251b9557baf7e6e60b4bba77..c493e4af944c72cb947d51dbce45d59f6ca9feb4 100644 (file)
@@ -489,7 +489,6 @@ static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
        if( ED_view3d_give_base_under_cursor(C, event->mval) ) {
                return 0;
        }
-
        return view3d_ima_drop_poll(C, drag, event);
 }
 
index cc85770ac8bc2d06109e03c212f0393ce6bfb1b3..739e7f186fe115fca60bb690646f25cbbd8560ba 100644 (file)
@@ -481,16 +481,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
        
        /* mode */
        if(ob) {
-               /*sanity point checkpoint, put here to avoid seeding
-                 this same code in 10 different other places.*/
-               if (!ob->mode)
-                       ob->mode = OB_MODE_OBJECT;
-
                v3d->modeselect = ob->mode;
-       } else {
+       }
+       else {
                v3d->modeselect = OB_MODE_OBJECT;
        }
-       
+
        row= uiLayoutRow(layout, 1);
        uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) , 
                          0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, TIP_("Mode"));
index a4c7749dc8e694b051db569354a23e914f8fcf30..23874ea47b02c50c880d76fe1c491641bb0dd909 100644 (file)
@@ -66,6 +66,7 @@
 #include "BKE_object.h"
 #include "BKE_tracking.h"
 
+
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
index 1a5e86aee71a0aac088b9f3e149d473482821911..fe8b53f83b375725ec60b0f4418dd7fbae3489a9 100644 (file)
@@ -762,9 +762,9 @@ void ED_view3d_project_float(ARegion *ar, const float vec[3], float adr[2], floa
 {
        float vec4[4];
        
+       adr[0]= IS_CLIPPED;
        copy_v3_v3(vec4, vec);
        vec4[3]= 1.0;
-       adr[0]= IS_CLIPPED;
        
        mul_m4_v4(mat, vec4);
        
index d349dfac2fe73b8fe6caf50bf3abacface7adc6b..d4a68ff8bfc98a9025f7a7b2877479ef265d1e23 100644 (file)
@@ -704,7 +704,6 @@ static void recalcData_view3d(TransInfo *t)
                                        calchandlesNurb(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */
                                        nu= nu->next;
                                }
-
                        } 
                        else {
                                /* Normal updating */
index e6c72ce1393a10dbbd4ecf7bc71ffa8169a7f2e5..174f8d00c00f6d0ef9d58c7895c886cf9a743984 100644 (file)
@@ -903,14 +903,6 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                        copy_v3_v3(normal, ob->obmat[2]);
                        copy_v3_v3(plane, ob->obmat[1]);
                }
-               else {
-                       normal[0] = 0.0f;
-                       normal[1] = 0.0f;
-                       normal[2] = 1.0f;
-                       plane[0] = 1.0f;
-                       plane[1] = 0.0f;
-                       plane[2] = 0.0f;
-               }
                result = ORIENTATION_NORMAL;
        }
        
index 81c81d2d35ec630caf8652959c934fe7ce0cb1c0..a151275e109a1068a535957689509dbb4d145f24 100644 (file)
@@ -1885,7 +1885,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
        else {
                sync= 0;
                selectmode= ts->uv_selectmode;
-               sticky= sima->sticky;
+               sticky= (sima)? sima->sticky: 1;
        }
 
        /* find nearest element */
index e5393089bf0d83778924cbce3f9231d785630f5f..4f6c7e22f5eeef496477e1d75de5784b6046ae17 100644 (file)
@@ -408,7 +408,7 @@ typedef struct UserDef {
        struct ColorBand coba_weight;   /* from texture.h */
 
        float sculpt_paint_overlay_col[3];
-       int loopcut_finish_on_release;
+       int pad3;
 
        char author[80];        /* author name for file formats supporting it */
 } UserDef;