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
This commit is contained in:
Campbell Barton 2011-12-04 23:13:28 +00:00
parent 3267a619f1
commit f07df7287e
33 changed files with 63 additions and 169 deletions

View 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")

View 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);

View 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;

View 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 */

View 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);
}
}

View 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;
}

View 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"

View 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)

View 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);

View File

@ -38,8 +38,6 @@ extern "C" {
#ifdef BLI_MATH_INLINE_H
#include "intern/math_vector_inline.c"
#else
#define MINLINE
#endif
/************************************* Init ***********************************/

View 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];

View 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);

View 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:

View 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) {

View 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);

View 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;

View 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;
}
}
}

View 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))

View 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;

View 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;

View 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);

View 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();

View File

@ -39,8 +39,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
#include "bmesh.h"
#include "UI_interface.h"
#include "UI_view2d.h"

View 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);

View 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

View 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);
}

View 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"));

View File

@ -66,6 +66,7 @@
#include "BKE_object.h"
#include "BKE_tracking.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"

View 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);

View 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 */

View 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;
}

View 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 */

View 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;