diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-05 03:13:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-05 03:13:28 +0400 |
commit | f07df7287e60ede904993572fe9bfef2c3a324af (patch) | |
tree | 205c89f1890164ad384dcd3e5d09547d44287ee3 | |
parent | 3267a619f1e1a5b5508e38cbc665da79f450b2e3 (diff) |
manual sync with trunk - pulling in changes where the issues are not bmesh spesific
- 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, 63 insertions, 169 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e831c12fe1..8bc875085af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 1bfe9bb9e29..1dd8e372100 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -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); diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index fd80006d71d..081b79b44d6 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -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; diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 6ff3b20049c..ba7dc1896c9 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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 */ diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 19838a634f8..e7f9e40ec3e 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -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); } } diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index bf2e12e1533..1a82e608795 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -965,9 +965,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, } glEnd(); - } /*else { - printf("eek in cddm draw mapped faces!\n"); - }*/ + } if (nors) nors += 3; } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 1bee8eaa023..0f1c73c59c1 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -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" diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 40de735e15f..035c7f409c4 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -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) diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 1463ff90e5a..0e33ee2be3f 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -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); diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 0fb79956282..059a167d073 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -38,8 +38,6 @@ extern "C" { #ifdef BLI_MATH_INLINE_H #include "intern/math_vector_inline.c" -#else -#define MINLINE #endif /************************************* Init ***********************************/ diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index f6dd28c3151..6f014a859db 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -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]; diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index ebb3937dd91..e79d850caa5 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -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); diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index b2b151bd34d..36e9f2db58f 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -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: diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index a1e3b84f898..6bee0837819 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -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) { diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 1d0e09c17c0..8d5c9dcc8f4 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -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); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 437d2e880c1..d92b2e726b0 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -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; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 6e3fab0385f..149c73e2980 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -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; } } } diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index b9e9005dd25..3993707dbb9 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -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)) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index ddf766330d4..b15278bd583 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -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; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index c11778a1d15..fb29bec2864 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -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; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index a2ae801e862..77daa3cdc28 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -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); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 31316c705d0..69ca3b5c232 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -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(); diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 9fff70fd5ab..fbf8af514b6 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -39,8 +39,6 @@ #include "BKE_context.h" #include "BKE_screen.h" -#include "bmesh.h" - #include "UI_interface.h" #include "UI_view2d.h" diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index b420fa6c02f..8f9a743ccf5 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -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); diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index df3e83fed15..29ab1723381 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -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 diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 218b7ce4dbf..c493e4af944 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -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); } diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index cc85770ac8b..739e7f186fe 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -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")); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index a4c7749dc8e..23874ea47b0 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -66,6 +66,7 @@ #include "BKE_object.h" #include "BKE_tracking.h" + #include "BIF_gl.h" #include "BIF_glutil.h" diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 1a5e86aee71..fe8b53f83b3 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -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); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index d349dfac2fe..d4a68ff8bfc 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -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 */ diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index e6c72ce1393..174f8d00c00 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -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; } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 81c81d2d35e..a151275e109 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -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 */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index e5393089bf0..4f6c7e22f5e 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -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; |