ClangFormat: format '#if 0' code in source/

This commit is contained in:
Campbell Barton 2019-04-17 08:24:14 +02:00
parent 108045faa0
commit 41d4a19865
204 changed files with 1875 additions and 1199 deletions

View File

@ -61,7 +61,10 @@ struct bSound *BKE_sound_new_file_exists(struct Main *bmain, const char *filepat
#if 0 #if 0
struct bSound *BKE_sound_new_buffer(struct Main *bmain, struct bSound *source); struct bSound *BKE_sound_new_buffer(struct Main *bmain, struct bSound *source);
struct bSound *BKE_sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end); struct bSound *BKE_sound_new_limiter(struct Main *bmain,
struct bSound *source,
float start,
float end);
#endif #endif
void BKE_sound_cache(struct bSound *sound); void BKE_sound_cache(struct bSound *sound);

View File

@ -187,7 +187,9 @@ void BKE_undosys_type_free_all(void);
/* ID Accessor */ /* ID Accessor */
#if 0 /* functionality is only used internally for now. */ #if 0 /* functionality is only used internally for now. */
void BKE_undosys_foreach_ID_ref(UndoStack *ustack, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data); void BKE_undosys_foreach_ID_ref(UndoStack *ustack,
UndoTypeForEachIDRefFn foreach_ID_ref_fn,
void *user_data);
#endif #endif
/* Use when the undo step stores many arbitrary pointers. */ /* Use when the undo step stores many arbitrary pointers. */

View File

@ -869,8 +869,7 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph, Object *object,
* around for the time while proxies are evaluating. * around for the time while proxies are evaluating.
*/ */
#if 0 #if 0
bPoseChannel *pchan_from = pose_pchan_get_indexed( bPoseChannel *pchan_from = pose_pchan_get_indexed(object->proxy_from, pchan_index);
object->proxy_from, pchan_index);
#else #else
bPoseChannel *pchan_from = BKE_pose_channel_find_name(object->proxy_from->pose, pchan->name); bPoseChannel *pchan_from = BKE_pose_channel_find_name(object->proxy_from->pose, pchan->name);
#endif #endif

View File

@ -1151,7 +1151,8 @@ void CDDM_calc_normals(DerivedMesh *dm)
CDDerivedMesh *cddm = (CDDerivedMesh *)dm; CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
float(*poly_nors)[3]; float(*poly_nors)[3];
if (dm->numVertData == 0) return; if (dm->numVertData == 0)
return;
/* we don't want to overwrite any referenced layers */ /* we don't want to overwrite any referenced layers */
cddm->mvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData); cddm->mvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData);
@ -1162,8 +1163,14 @@ void CDDM_calc_normals(DerivedMesh *dm)
poly_nors = CustomData_add_layer(&dm->polyData, CD_NORMAL, CD_CALLOC, NULL, dm->numPolyData); poly_nors = CustomData_add_layer(&dm->polyData, CD_NORMAL, CD_CALLOC, NULL, dm->numPolyData);
} }
BKE_mesh_calc_normals_poly(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm), BKE_mesh_calc_normals_poly(cddm->mvert,
dm->numLoopData, dm->numPolyData, poly_nors, false); dm->numVertData,
CDDM_get_loops(dm),
CDDM_get_polys(dm),
dm->numLoopData,
dm->numPolyData,
poly_nors,
false);
cddm->dm.dirty &= ~DM_DIRTY_NORMALS; cddm->dm.dirty &= ~DM_DIRTY_NORMALS;
} }

View File

@ -3064,7 +3064,15 @@ int dynamicPaint_createUVSurface(Scene *scene,
if (tempPoints[index].tri_index != -1) { if (tempPoints[index].tri_index != -1) {
int nidx = tempPoints[index].neighbour_pixel; int nidx = tempPoints[index].neighbour_pixel;
fprintf(dump_file, "%d\t%d,%d\t%u\t%d,%d\t%d\t", fidx, tx, h-1-ty, tempPoints[index].tri_index, nidx<0?-1:(nidx%w), nidx<0?-1:h-1-(nidx/w), ed->flags[fidx]); fprintf(dump_file,
"%d\t%d,%d\t%u\t%d,%d\t%d\t",
fidx,
tx,
h - 1 - ty,
tempPoints[index].tri_index,
nidx < 0 ? -1 : (nidx % w),
nidx < 0 ? -1 : h - 1 - (nidx / w),
ed->flags[fidx]);
for (int i = 0; i < ed->n_num[fidx]; i++) { for (int i = 0; i < ed->n_num[fidx]; i++) {
int tgt = tmp[ed->n_target[ed->n_index[fidx] + i]]; int tgt = tmp[ed->n_target[ed->n_index[fidx] + i]];
fprintf(dump_file, "%s%d,%d", i ? " " : "", tgt % w, h - 1 - tgt / w); fprintf(dump_file, "%s%d,%d", i ? " " : "", tgt % w, h - 1 - tgt / w);

View File

@ -235,22 +235,28 @@ static const char *ob_adrcodes_to_paths(int adrcode, int *array_index)
return "color"; return "color";
#if 0 #if 0
case OB_PD_FSTR: case OB_PD_FSTR:
if (ob->pd) poin = &(ob->pd->f_strength); if (ob->pd)
poin = &(ob->pd->f_strength);
break; break;
case OB_PD_FFALL: case OB_PD_FFALL:
if (ob->pd) poin = &(ob->pd->f_power); if (ob->pd)
poin = &(ob->pd->f_power);
break; break;
case OB_PD_SDAMP: case OB_PD_SDAMP:
if (ob->pd) poin = &(ob->pd->pdef_damp); if (ob->pd)
poin = &(ob->pd->pdef_damp);
break; break;
case OB_PD_RDAMP: case OB_PD_RDAMP:
if (ob->pd) poin = &(ob->pd->pdef_rdamp); if (ob->pd)
poin = &(ob->pd->pdef_rdamp);
break; break;
case OB_PD_PERM: case OB_PD_PERM:
if (ob->pd) poin = &(ob->pd->pdef_perm); if (ob->pd)
poin = &(ob->pd->pdef_perm);
break; break;
case OB_PD_FMAXD: case OB_PD_FMAXD:
if (ob->pd) poin = &(ob->pd->maxdist); if (ob->pd)
poin = &(ob->pd->maxdist);
break; break;
#endif #endif
} }
@ -414,31 +420,44 @@ static const char *mtex_adrcodes_to_paths(int adrcode, int *UNUSED(array_index))
switch (adrcode) { switch (adrcode) {
#if 0 // XXX these are not wrapped in RNA yet! #if 0 // XXX these are not wrapped in RNA yet!
case MAP_OFS_X: case MAP_OFS_X:
poin = &(mtex->ofs[0]); break; poin = &(mtex->ofs[0]);
break;
case MAP_OFS_Y: case MAP_OFS_Y:
poin = &(mtex->ofs[1]); break; poin = &(mtex->ofs[1]);
break;
case MAP_OFS_Z: case MAP_OFS_Z:
poin = &(mtex->ofs[2]); break; poin = &(mtex->ofs[2]);
break;
case MAP_SIZE_X: case MAP_SIZE_X:
poin = &(mtex->size[0]); break; poin = &(mtex->size[0]);
break;
case MAP_SIZE_Y: case MAP_SIZE_Y:
poin = &(mtex->size[1]); break; poin = &(mtex->size[1]);
break;
case MAP_SIZE_Z: case MAP_SIZE_Z:
poin = &(mtex->size[2]); break; poin = &(mtex->size[2]);
break;
case MAP_R: case MAP_R:
poin = &(mtex->r); break; poin = &(mtex->r);
break;
case MAP_G: case MAP_G:
poin = &(mtex->g); break; poin = &(mtex->g);
break;
case MAP_B: case MAP_B:
poin = &(mtex->b); break; poin = &(mtex->b);
break;
case MAP_DVAR: case MAP_DVAR:
poin = &(mtex->def_var); break; poin = &(mtex->def_var);
break;
case MAP_COLF: case MAP_COLF:
poin = &(mtex->colfac); break; poin = &(mtex->colfac);
break;
case MAP_NORF: case MAP_NORF:
poin = &(mtex->norfac); break; poin = &(mtex->norfac);
break;
case MAP_VARF: case MAP_VARF:
poin = &(mtex->varfac); break; poin = &(mtex->varfac);
break;
#endif #endif
case MAP_DISP: case MAP_DISP:
prop = "warp_factor"; prop = "warp_factor";
@ -659,9 +678,11 @@ static const char *camera_adrcodes_to_paths(int adrcode, int *array_index)
#if 0 // XXX these are not defined in RNA #if 0 // XXX these are not defined in RNA
case CAM_YF_APERT: case CAM_YF_APERT:
poin = &(ca->YF_aperture); break; poin = &(ca->YF_aperture);
break;
case CAM_YF_FDIST: case CAM_YF_FDIST:
poin = &(ca->dof_distance); break; poin = &(ca->dof_distance);
break;
#endif // XXX these are not defined in RNA #endif // XXX these are not defined in RNA
case CAM_SHIFT_X: case CAM_SHIFT_X:
@ -837,22 +858,28 @@ static const char *particle_adrcodes_to_paths(int adrcode, int *array_index)
* as the similar object forces */ * as the similar object forces */
#if 0 #if 0
case PART_PD_FSTR: case PART_PD_FSTR:
if (part->pd) poin = &(part->pd->f_strength); if (part->pd)
poin = &(part->pd->f_strength);
break; break;
case PART_PD_FFALL: case PART_PD_FFALL:
if (part->pd) poin = &(part->pd->f_power); if (part->pd)
poin = &(part->pd->f_power);
break; break;
case PART_PD_FMAXD: case PART_PD_FMAXD:
if (part->pd) poin = &(part->pd->maxdist); if (part->pd)
poin = &(part->pd->maxdist);
break; break;
case PART_PD2_FSTR: case PART_PD2_FSTR:
if (part->pd2) poin = &(part->pd2->f_strength); if (part->pd2)
poin = &(part->pd2->f_strength);
break; break;
case PART_PD2_FFALL: case PART_PD2_FFALL:
if (part->pd2) poin = &(part->pd2->f_power); if (part->pd2)
poin = &(part->pd2->f_power);
break; break;
case PART_PD2_FMAXD: case PART_PD2_FMAXD:
if (part->pd2) poin = &(part->pd2->maxdist); if (part->pd2)
poin = &(part->pd2->maxdist);
break; break;
#endif #endif
} }

View File

@ -1240,9 +1240,15 @@ static int foreach_libblock_id_users_callback(void *user_data,
if (*id_p == iter->id) { if (*id_p == iter->id) {
#if 0 #if 0
printf("%s uses %s (refcounted: %d, userone: %d, used_one: %d, used_one_active: %d, indirect_usage: %d)\n", printf(
iter->curr_id->name, iter->id->name, (cb_flag & IDWALK_USER) ? 1 : 0, (cb_flag & IDWALK_USER_ONE) ? 1 : 0, "%s uses %s (refcounted: %d, userone: %d, used_one: %d, used_one_active: %d, "
(iter->id->tag & LIB_TAG_EXTRAUSER) ? 1 : 0, (iter->id->tag & LIB_TAG_EXTRAUSER_SET) ? 1 : 0, "indirect_usage: %d)\n",
iter->curr_id->name,
iter->id->name,
(cb_flag & IDWALK_USER) ? 1 : 0,
(cb_flag & IDWALK_USER_ONE) ? 1 : 0,
(iter->id->tag & LIB_TAG_EXTRAUSER) ? 1 : 0,
(iter->id->tag & LIB_TAG_EXTRAUSER_SET) ? 1 : 0,
(cb_flag & IDWALK_INDIRECT_USAGE) ? 1 : 0); (cb_flag & IDWALK_INDIRECT_USAGE) ? 1 : 0);
#endif #endif
if (cb_flag & IDWALK_CB_INDIRECT_USAGE) { if (cb_flag & IDWALK_CB_INDIRECT_USAGE) {

View File

@ -879,7 +879,8 @@ void BKE_mask_layer_evaluate_animation(MaskLayer *masklay, const float ctime)
__func__, __func__,
(int)ctime, (int)ctime,
BLI_listbase_count(&masklay->splines_shapes), BLI_listbase_count(&masklay->splines_shapes),
masklay_shape_a->frame, masklay_shape_b->frame); masklay_shape_a->frame,
masklay_shape_b->frame);
#endif #endif
BKE_mask_layer_shape_to_mask_interp( BKE_mask_layer_shape_to_mask_interp(
masklay, masklay_shape_a, masklay_shape_b, (ctime - masklay_shape_a->frame) / w); masklay, masklay_shape_a, masklay_shape_b, (ctime - masklay_shape_a->frame) / w);

View File

@ -1212,7 +1212,9 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle,
/* 2D ray test */ /* 2D ray test */
#if 0 #if 0
static float maskrasterize_layer_z_depth_tri(const float pt[2], static float maskrasterize_layer_z_depth_tri(const float pt[2],
const float v1[3], const float v2[3], const float v3[3]) const float v1[3],
const float v2[3],
const float v3[3])
{ {
float w[3]; float w[3];
barycentric_weights_v2(v1, v2, v3, pt, w); barycentric_weights_v2(v1, v2, v3, pt, w);
@ -1240,10 +1242,7 @@ static float maskrasterize_layer_isect(unsigned int *face,
#if 0 #if 0
/* not essential but avoids unneeded extra lookups */ /* not essential but avoids unneeded extra lookups */
if ((cos[0][2] < dist_orig) || if ((cos[0][2] < dist_orig) || (cos[1][2] < dist_orig) || (cos[2][2] < dist_orig)) {
(cos[1][2] < dist_orig) ||
(cos[2][2] < dist_orig))
{
if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) { if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) {
/* we know all tris are close for now */ /* we know all tris are close for now */
return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]); return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]);

View File

@ -431,7 +431,6 @@ static int pbvh_bmesh_node_offset_from_elem(PBVH *bvh, BMElem *ele)
BLI_assert(ele->head.htype == BM_FACE); BLI_assert(ele->head.htype == BM_FACE);
return bvh->cd_face_node_offset; return bvh->cd_face_node_offset;
} }
} }
static int pbvh_bmesh_node_index_from_elem(PBVH *bvh, void *key) static int pbvh_bmesh_node_index_from_elem(PBVH *bvh, void *key)
@ -2106,17 +2105,13 @@ static void pbvh_bmesh_print(PBVH *bvh)
BMIter iter; BMIter iter;
BMFace *f; BMFace *f;
BM_ITER_MESH (f, &iter, bvh->bm, BM_FACES_OF_MESH) { BM_ITER_MESH (f, &iter, bvh->bm, BM_FACES_OF_MESH) {
fprintf(stderr, " %d -> %d\n", fprintf(stderr, " %d -> %d\n", BM_elem_index_get(f), pbvh_bmesh_node_index_from_face(bvh, f));
BM_elem_index_get(f),
pbvh_bmesh_node_index_from_face(bvh, f));
} }
fprintf(stderr, "bm_vert_to_node:\n"); fprintf(stderr, "bm_vert_to_node:\n");
BMVert *v; BMVert *v;
BM_ITER_MESH (v, &iter, bvh->bm, BM_FACES_OF_MESH) { BM_ITER_MESH (v, &iter, bvh->bm, BM_FACES_OF_MESH) {
fprintf(stderr, " %d -> %d\n", fprintf(stderr, " %d -> %d\n", BM_elem_index_get(v), pbvh_bmesh_node_index_from_vert(bvh, v));
BM_elem_index_get(v),
pbvh_bmesh_node_index_from_vert(bvh, v));
} }
for (int n = 0; n < bvh->totnode; n++) { for (int n = 0; n < bvh->totnode; n++) {
@ -2127,16 +2122,13 @@ static void pbvh_bmesh_print(PBVH *bvh)
GSetIterator gs_iter; GSetIterator gs_iter;
fprintf(stderr, "node %d\n faces:\n", n); fprintf(stderr, "node %d\n faces:\n", n);
GSET_ITER (gs_iter, node->bm_faces) GSET_ITER (gs_iter, node->bm_faces)
fprintf(stderr, " %d\n", fprintf(stderr, " %d\n", BM_elem_index_get((BMFace *)BLI_gsetIterator_getKey(&gs_iter)));
BM_elem_index_get((BMFace *)BLI_gsetIterator_getKey(&gs_iter)));
fprintf(stderr, " unique verts:\n"); fprintf(stderr, " unique verts:\n");
GSET_ITER (gs_iter, node->bm_unique_verts) GSET_ITER (gs_iter, node->bm_unique_verts)
fprintf(stderr, " %d\n", fprintf(stderr, " %d\n", BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
fprintf(stderr, " other verts:\n"); fprintf(stderr, " other verts:\n");
GSET_ITER (gs_iter, node->bm_other_verts) GSET_ITER (gs_iter, node->bm_other_verts)
fprintf(stderr, " %d\n", fprintf(stderr, " %d\n", BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
} }
} }

View File

@ -1838,9 +1838,7 @@ static bool foreach_object_particle_ptcache(Object *object,
} }
/* Hair needs to be included in id-list for cache edit mode to work. */ /* Hair needs to be included in id-list for cache edit mode to work. */
#if 0 #if 0
if ((psys->part->type == PART_HAIR) && if ((psys->part->type == PART_HAIR) && (psys->flag & PSYS_HAIR_DYNAMICS) == 0) {
(psys->flag & PSYS_HAIR_DYNAMICS) == 0)
{
continue; continue;
} }
#endif #endif

View File

@ -121,12 +121,23 @@ SequencerDrawView sequencer_view3d_cb = NULL; /* NULL in background mode */
#if 0 /* unused function */ #if 0 /* unused function */
static void printf_strip(Sequence *seq) static void printf_strip(Sequence *seq)
{ {
fprintf(stderr, "name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), " fprintf(stderr,
"name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), "
"(startstill:%d, endstill:%d), machine:%d, (startdisp:%d, enddisp:%d)\n", "(startstill:%d, endstill:%d), machine:%d, (startdisp:%d, enddisp:%d)\n",
seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine, seq->name,
seq->startdisp, seq->enddisp); seq->len,
seq->start,
seq->startofs,
seq->endofs,
seq->startstill,
seq->endstill,
seq->machine,
seq->startdisp,
seq->enddisp);
fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), fprintf(stderr,
"\tseq_tx_set_final_left: %d %d\n\n",
seq_tx_get_final_left(seq, 0),
seq_tx_get_final_right(seq, 0)); seq_tx_get_final_right(seq, 0));
} }
#endif #endif

View File

@ -1822,17 +1822,18 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len
} }
} }
static void dfdx_goal(int ia, int ic, int op, float factor) static void dfdx_goal(int ia, int ic, int op, float factor)
{ {
int i; int i;
for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, op+ic+i, factor); for (i = 0; i < 3; i++)
EIG_linear_solver_matrix_add(ia + i, op + ic + i, factor);
} }
static void dfdv_goal(int ia, int ic, float factor) static void dfdv_goal(int ia, int ic, float factor)
{ {
int i; int i;
for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, ic+i, factor); for (i = 0; i < 3; i++)
EIG_linear_solver_matrix_add(ia + i, ic + i, factor);
} }
#endif /* if 0 */ #endif /* if 0 */
@ -2284,8 +2285,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* old one with homogeneous masses */ /* old one with homogeneous masses */
/* claim a minimum mass for vertex */ /* claim a minimum mass for vertex */
#if 0 #if 0
if (sb->nodemass > 0.009999f) timeovermass = forcetime / sb->nodemass; if (sb->nodemass > 0.009999f)
else timeovermass = forcetime / 0.009999f; timeovermass = forcetime / sb->nodemass;
else
timeovermass = forcetime / 0.009999f;
#endif #endif
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) { for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
@ -2427,7 +2430,6 @@ static void softbody_store_step(Object *ob)
} }
} }
/* used by predictors and correctors */ /* used by predictors and correctors */
static void softbody_store_state(Object *ob, float *ppos, float *pvel) static void softbody_store_state(Object *ob, float *ppos, float *pvel)
{ {

View File

@ -485,12 +485,24 @@ static void studiolight_calculate_radiance_cubemap_buffers(StudioLight *sl)
NULL, colbuf, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE); NULL, colbuf, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE);
#if 0 #if 0
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_POS], "/tmp/studiolight_radiance_left.png", IB_rectfloat); IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_POS],
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_NEG], "/tmp/studiolight_radiance_right.png", IB_rectfloat); "/tmp/studiolight_radiance_left.png",
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_POS], "/tmp/studiolight_radiance_front.png", IB_rectfloat); IB_rectfloat);
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_NEG], "/tmp/studiolight_radiance_back.png", IB_rectfloat); IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_NEG],
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_POS], "/tmp/studiolight_radiance_bottom.png", IB_rectfloat); "/tmp/studiolight_radiance_right.png",
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_NEG], "/tmp/studiolight_radiance_top.png", IB_rectfloat); IB_rectfloat);
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_POS],
"/tmp/studiolight_radiance_front.png",
IB_rectfloat);
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_NEG],
"/tmp/studiolight_radiance_back.png",
IB_rectfloat);
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_POS],
"/tmp/studiolight_radiance_bottom.png",
IB_rectfloat);
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_NEG],
"/tmp/studiolight_radiance_top.png",
IB_rectfloat);
#endif #endif
MEM_freeN(colbuf); MEM_freeN(colbuf);
} }

View File

@ -1563,7 +1563,8 @@ static void dump_buffer(TextUndoBuf *utxt)
{ {
int i = 0; int i = 0;
while (i++ < utxt->undo_pos) printf("%d: %d %c\n", i, utxt->buf[i], utxt->buf[i]); while (i++ < utxt->undo_pos)
printf("%d: %d %c\n", i, utxt->buf[i], utxt->buf[i]);
} }
/* Note: this function is outdated and must be updated if needed for future use */ /* Note: this function is outdated and must be updated if needed for future use */
@ -1646,27 +1647,38 @@ void txt_print_undo(Text *text)
i++; i++;
printf(" - Char is "); printf(" - Char is ");
switch (op) { switch (op) {
case UNDO_INSERT_1: case UNDO_BS_1: case UNDO_DEL_1: case UNDO_INSERT_1:
case UNDO_BS_1:
case UNDO_DEL_1:
printf("%c", utxt->buf[i]); printf("%c", utxt->buf[i]);
i++; i++;
break; break;
case UNDO_INSERT_2: case UNDO_BS_2: case UNDO_DEL_2: case UNDO_INSERT_2:
case UNDO_BS_2:
case UNDO_DEL_2:
printf("%c%c", utxt->buf[i], utxt->buf[i + 1]); printf("%c%c", utxt->buf[i], utxt->buf[i + 1]);
i += 2; i += 2;
break; break;
case UNDO_INSERT_3: case UNDO_BS_3: case UNDO_DEL_3: case UNDO_INSERT_3:
case UNDO_BS_3:
case UNDO_DEL_3:
printf("%c%c%c", utxt->buf[i], utxt->buf[i + 1], utxt->buf[i + 2]); printf("%c%c%c", utxt->buf[i], utxt->buf[i + 1], utxt->buf[i + 2]);
i += 3; i += 3;
break; break;
case UNDO_INSERT_4: case UNDO_BS_4: case UNDO_DEL_4: case UNDO_INSERT_4:
{ case UNDO_BS_4:
case UNDO_DEL_4: {
unsigned int uc; unsigned int uc;
char c[BLI_UTF8_MAX + 1]; char c[BLI_UTF8_MAX + 1];
size_t c_len; size_t c_len;
uc = utxt->buf[i]; i++; uc = utxt->buf[i];
uc = uc + (utxt->buf[i] << 8); i++; i++;
uc = uc + (utxt->buf[i] << 16); i++; uc = uc + (utxt->buf[i] << 8);
uc = uc + (utxt->buf[i] << 24); i++; i++;
uc = uc + (utxt->buf[i] << 16);
i++;
uc = uc + (utxt->buf[i] << 24);
i++;
c_len = BLI_str_utf8_from_unicode(uc, c); c_len = BLI_str_utf8_from_unicode(uc, c);
c[c_len] = '\0'; c[c_len] = '\0';
puts(c); puts(c);
@ -1677,44 +1689,65 @@ void txt_print_undo(Text *text)
else if (op == UNDO_DBLOCK || op == UNDO_IBLOCK) { else if (op == UNDO_DBLOCK || op == UNDO_IBLOCK) {
i++; i++;
linep = utxt->buf[i]; i++; linep = utxt->buf[i];
linep = linep + (utxt->buf[i] << 8); i++; i++;
linep = linep + (utxt->buf[i] << 16); i++; linep = linep + (utxt->buf[i] << 8);
linep = linep + (utxt->buf[i] << 24); i++; i++;
linep = linep + (utxt->buf[i] << 16);
i++;
linep = linep + (utxt->buf[i] << 24);
i++;
printf(" (length %d) <", linep); printf(" (length %d) <", linep);
while (linep > 0) { while (linep > 0) {
putchar(utxt->buf[i]); putchar(utxt->buf[i]);
linep--; i++; linep--;
i++;
} }
linep = utxt->buf[i]; i++; linep = utxt->buf[i];
linep = linep + (utxt->buf[i] << 8); i++; i++;
linep = linep + (utxt->buf[i] << 16); i++; linep = linep + (utxt->buf[i] << 8);
linep = linep + (utxt->buf[i] << 24); i++; i++;
linep = linep + (utxt->buf[i] << 16);
i++;
linep = linep + (utxt->buf[i] << 24);
i++;
printf("> (%d)", linep); printf("> (%d)", linep);
} }
else if (op == UNDO_INDENT || op == UNDO_UNINDENT) { else if (op == UNDO_INDENT || op == UNDO_UNINDENT) {
i++; i++;
charp = utxt->buf[i]; i++; charp = utxt->buf[i];
charp = charp + (utxt->buf[i] << 8); i++; i++;
charp = charp + (utxt->buf[i] << 8);
i++;
linep = utxt->buf[i]; i++; linep = utxt->buf[i];
linep = linep + (utxt->buf[i] << 8); i++; i++;
linep = linep + (utxt->buf[i] << 16); i++; linep = linep + (utxt->buf[i] << 8);
linep = linep + (utxt->buf[i] << 24); i++; i++;
linep = linep + (utxt->buf[i] << 16);
i++;
linep = linep + (utxt->buf[i] << 24);
i++;
printf("to <%d, %d> ", linep, charp); printf("to <%d, %d> ", linep, charp);
charp = utxt->buf[i]; i++; charp = utxt->buf[i];
charp = charp + (utxt->buf[i] << 8); i++; i++;
charp = charp + (utxt->buf[i] << 8);
i++;
linep = utxt->buf[i]; i++; linep = utxt->buf[i];
linep = linep + (utxt->buf[i] << 8); i++; i++;
linep = linep + (utxt->buf[i] << 16); i++; linep = linep + (utxt->buf[i] << 8);
linep = linep + (utxt->buf[i] << 24); i++; i++;
linep = linep + (utxt->buf[i] << 16);
i++;
linep = linep + (utxt->buf[i] << 24);
i++;
printf("from <%d, %d>", linep, charp); printf("from <%d, %d>", linep, charp);
} }

View File

@ -608,11 +608,9 @@ static void *bli_mempool_iternext(BLI_mempool_iter *iter)
if (iter->curchunk == NULL) { if (iter->curchunk == NULL) {
return ret; return ret;
} }
if (atomic_cas_ptr( if (atomic_cas_ptr((void **)iter->curchunk_threaded_shared,
(void **)iter->curchunk_threaded_shared,
iter->curchunk, iter->curchunk,
iter->curchunk->next) == iter->curchunk) iter->curchunk->next) == iter->curchunk) {
{
break; break;
} }
} }

View File

@ -828,14 +828,9 @@ void dist_squared_to_projected_aabb_precalc(struct DistProjectedAABBPrecalc *pre
float projmat_trans[4][4]; float projmat_trans[4][4];
transpose_m4_m4(projmat_trans, projmat); transpose_m4_m4(projmat_trans, projmat);
if (!isect_plane_plane_plane_v3( if (!isect_plane_plane_plane_v3(
projmat_trans[0], projmat_trans[1], projmat_trans[3], projmat_trans[0], projmat_trans[1], projmat_trans[3], precalc->ray_origin)) {
precalc->ray_origin))
{
/* Orthographic projection. */ /* Orthographic projection. */
isect_plane_plane_v3( isect_plane_plane_v3(px, py, precalc->ray_origin, precalc->ray_direction);
px, py,
precalc->ray_origin,
precalc->ray_direction);
} }
else { else {
/* Perspective projection. */ /* Perspective projection. */
@ -1908,8 +1903,7 @@ bool isect_ray_tri_watertight_v3(const float ray_origin[3],
* otherwise we won't match any of the other intersect functions here... * otherwise we won't match any of the other intersect functions here...
* which would be confusing */ * which would be confusing */
#if 0 #if 0
|| || (sign_T > *r_lambda * xor_signmask(det, sign_mask))
(sign_T > *r_lambda * xor_signmask(det, sign_mask))
#endif #endif
) { ) {
return false; return false;
@ -1945,10 +1939,14 @@ bool isect_ray_tri_watertight_v3_simple(const float ray_origin[3],
* A version of #isect_ray_tri_v3 which takes a threshold argument * A version of #isect_ray_tri_v3 which takes a threshold argument
* so rays slightly outside the triangle to be considered as intersecting. * so rays slightly outside the triangle to be considered as intersecting.
*/ */
bool isect_ray_tri_threshold_v3( bool isect_ray_tri_threshold_v3(const float ray_origin[3],
const float ray_origin[3], const float ray_direction[3], const float ray_direction[3],
const float v0[3], const float v1[3], const float v2[3], const float v0[3],
float *r_lambda, float r_uv[2], const float threshold) const float v1[3],
const float v2[3],
float *r_lambda,
float r_uv[2],
const float threshold)
{ {
const float epsilon = 0.00000001f; const float epsilon = 0.00000001f;
float p[3], s[3], e1[3], e2[3], q[3]; float p[3], s[3], e1[3], e2[3], q[3];
@ -1960,14 +1958,16 @@ bool isect_ray_tri_threshold_v3(
cross_v3_v3v3(p, ray_direction, e2); cross_v3_v3v3(p, ray_direction, e2);
a = dot_v3v3(e1, p); a = dot_v3v3(e1, p);
if ((a > -epsilon) && (a < epsilon)) return false; if ((a > -epsilon) && (a < epsilon))
return false;
f = 1.0f / a; f = 1.0f / a;
sub_v3_v3v3(s, ray_origin, v0); sub_v3_v3v3(s, ray_origin, v0);
cross_v3_v3v3(q, s, e1); cross_v3_v3v3(q, s, e1);
*r_lambda = f * dot_v3v3(e2, q); *r_lambda = f * dot_v3v3(e2, q);
if ((*r_lambda < 0.0f)) return false; if ((*r_lambda < 0.0f))
return false;
u = f * dot_v3v3(s, p); u = f * dot_v3v3(s, p);
v = f * dot_v3v3(ray_direction, q); v = f * dot_v3v3(ray_direction, q);
@ -1978,13 +1978,19 @@ bool isect_ray_tri_threshold_v3(
dv = v - t; dv = v - t;
} }
else { else {
if (u < 0) du = u; if (u < 0)
else if (u > 1) du = u - 1; du = u;
else du = 0.0f; else if (u > 1)
du = u - 1;
else
du = 0.0f;
if (v < 0) dv = v; if (v < 0)
else if (v > 1) dv = v - 1; dv = v;
else dv = 0.0f; else if (v > 1)
dv = v - 1;
else
dv = 0.0f;
} }
mul_v3_fl(e1, du); mul_v3_fl(e1, du);
@ -5255,9 +5261,9 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
vangle = vacosf(vcos); vangle = vacosf(vcos);
/* dot */ /* dot */
vresult.v = (vec_splat_float(n[0]) * gx + vresult.v = (vec_splat_float(n[0]) * gx + vec_splat_float(n[1]) * gy +
vec_splat_float(n[1]) * gy + vec_splat_float(n[2]) * gz) *
vec_splat_float(n[2]) * gz) * vangle; vangle;
result = (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3]) * (0.5f / (float)M_PI); result = (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3]) * (0.5f / (float)M_PI);
result = MAX2(result, 0.0f); result = MAX2(result, 0.0f);

View File

@ -54,10 +54,8 @@ static float P(float k)
static float P(float k) static float P(float k)
{ {
return (float)(1.0f / 6.0f) * return (float)(1.0f / 6.0f) *
(pow(MAX2(k + 2.0f, 0), 3.0f) - 4.0f * (pow(MAX2(k + 2.0f, 0), 3.0f) - 4.0f * pow(MAX2(k + 1.0f, 0), 3.0f) +
pow(MAX2(k + 1.0f, 0), 3.0f) + 6.0f * 6.0f * pow(MAX2(k, 0), 3.0f) - 4.0f * pow(MAX2(k - 1.0f, 0), 3.0f));
pow(MAX2(k, 0), 3.0f) - 4.0f *
pow(MAX2(k - 1.0f, 0), 3.0f));
} }
#endif #endif

View File

@ -3724,7 +3724,8 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
bNodeInstanceHash *new_previews = BKE_node_instance_hash_new("node previews"); bNodeInstanceHash *new_previews = BKE_node_instance_hash_new("node previews");
bNodeInstanceHashIterator iter; bNodeInstanceHashIterator iter;
NODE_INSTANCE_HASH_ITER(iter, ntree->previews) { NODE_INSTANCE_HASH_ITER(iter, ntree->previews)
{
bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter); bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter);
if (preview) { if (preview) {
bNodePreview *new_preview = newimaadr(fd, preview); bNodePreview *new_preview = newimaadr(fd, preview);

View File

@ -1156,9 +1156,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
/* Copy over the settings stored in the GP datablock linked to the scene, for minimal disruption */ /* Copy over the settings stored in the GP datablock linked to the scene, for minimal disruption */
ts->gpencil_v3d_align = 0; ts->gpencil_v3d_align = 0;
if (gpd->flag & GP_DATA_VIEWALIGN) ts->gpencil_v3d_align |= GP_PROJECT_VIEWSPACE; if (gpd->flag & GP_DATA_VIEWALIGN)
if (gpd->flag & GP_DATA_DEPTH_VIEW) ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_VIEW; ts->gpencil_v3d_align |= GP_PROJECT_VIEWSPACE;
if (gpd->flag & GP_DATA_DEPTH_STROKE) ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE; if (gpd->flag & GP_DATA_DEPTH_VIEW)
ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_VIEW;
if (gpd->flag & GP_DATA_DEPTH_STROKE)
ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE;
if (gpd->flag & GP_DATA_DEPTH_STROKE_ENDPOINTS) if (gpd->flag & GP_DATA_DEPTH_STROKE_ENDPOINTS)
ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE_ENDPOINTS; ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE_ENDPOINTS;

View File

@ -1125,11 +1125,9 @@ void bm_log_print(const BMLog *log, const char *description)
int i; int i;
printf("%s:\n", description); printf("%s:\n", description);
printf(" % 2d: [ initial ]%s\n", 0, printf(" % 2d: [ initial ]%s\n", 0, (!log->current_entry) ? current : "");
(!log->current_entry) ? current : "");
for (entry = log->entries.first, i = 1; entry; entry = entry->next, i++) { for (entry = log->entries.first, i = 1; entry; entry = entry->next, i++) {
printf(" % 2d: [%p]%s\n", i, entry, printf(" % 2d: [%p]%s\n", i, entry, (entry == log->current_entry) ? current : "");
(entry == log->current_entry) ? current : "");
} }
} }
#endif #endif

View File

@ -1026,9 +1026,13 @@ static void bm_mesh_loops_calc_normals_no_autosmooth(BMesh *bm,
* Updates the loop normals of a mesh. Assumes vertex and face normals are valid (else call BM_mesh_normals_update() * Updates the loop normals of a mesh. Assumes vertex and face normals are valid (else call BM_mesh_normals_update()
* first)! * first)!
*/ */
void BM_mesh_loop_normals_update( void BM_mesh_loop_normals_update(BMesh *bm,
BMesh *bm, const bool use_split_normals, const float split_angle, float (*r_lnos)[3], const bool use_split_normals,
MLoopNorSpaceArray *r_lnors_spacearr, short (*clnors_data)[2], const int cd_loop_clnors_offset) const float split_angle,
float (*r_lnos)[3],
MLoopNorSpaceArray *r_lnors_spacearr,
short (*clnors_data)[2],
const int cd_loop_clnors_offset)
{ {
const bool has_clnors = clnors_data || (cd_loop_clnors_offset != -1); const bool has_clnors = clnors_data || (cd_loop_clnors_offset != -1);
@ -1038,7 +1042,8 @@ void BM_mesh_loop_normals_update(
bm_mesh_edges_sharp_tag(bm, NULL, NULL, has_clnors ? (float)M_PI : split_angle, r_lnos); bm_mesh_edges_sharp_tag(bm, NULL, NULL, has_clnors ? (float)M_PI : split_angle, r_lnos);
/* Finish computing lnos by accumulating face normals in each fan of faces defined by sharp edges. */ /* Finish computing lnos by accumulating face normals in each fan of faces defined by sharp edges. */
bm_mesh_loops_calc_normals(bm, NULL, NULL, r_lnos, r_lnors_spacearr, clnors_data, cd_loop_clnors_offset); bm_mesh_loops_calc_normals(
bm, NULL, NULL, r_lnos, r_lnors_spacearr, clnors_data, cd_loop_clnors_offset);
} }
else { else {
BLI_assert(!r_lnors_spacearr); BLI_assert(!r_lnors_spacearr);
@ -1839,8 +1844,13 @@ void BM_mesh_elem_index_validate(
/* dirty may have been incorrectly set */ /* dirty may have been incorrectly set */
fprintf(stderr, fprintf(stderr,
"Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are correct, '%s', '%s'\n", "Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are "
location, func, type_names[i], msg_a, msg_b); "correct, '%s', '%s'\n",
location,
func,
type_names[i],
msg_a,
msg_b);
#endif #endif
} }
} }
@ -1848,9 +1858,7 @@ void BM_mesh_elem_index_validate(
#if 0 /* mostly annoying, even in debug mode */ #if 0 /* mostly annoying, even in debug mode */
# ifdef DEBUG # ifdef DEBUG
if (is_any_error == 0) { if (is_any_error == 0) {
fprintf(stderr, fprintf(stderr, "Valid Index Success: at %s, %s, '%s', '%s'\n", location, func, msg_a, msg_b);
"Valid Index Success: at %s, %s, '%s', '%s'\n",
location, func, msg_a, msg_b);
} }
# endif # endif
#endif #endif

View File

@ -538,7 +538,8 @@ BMEdge *BM_vert_collapse_edge(
BMVert *tv2 = BM_edge_other_vert(e2, v_kill); BMVert *tv2 = BM_edge_other_vert(e2, v_kill);
if (tv2) { if (tv2) {
/* only action, other calls here only get the edge to return */ /* only action, other calls here only get the edge to return */
e_new = bmesh_kernel_join_edge_kill_vert(bm, e_kill, v_kill, do_del, true, kill_degenerate_faces); e_new = bmesh_kernel_join_edge_kill_vert(
bm, e_kill, v_kill, do_del, true, kill_degenerate_faces);
} }
} }
} }
@ -748,7 +749,8 @@ bool BM_face_validate(BMFace *face, FILE *err)
} }
BLI_array_grow_items(verts, face->len); BLI_array_grow_items(verts, face->len);
BM_ITER_ELEM_INDEX (l, &iter, face, BM_LOOPS_OF_FACE, i) { BM_ITER_ELEM_INDEX(l, &iter, face, BM_LOOPS_OF_FACE, i)
{
verts[i] = l->v; verts[i] = l->v;
if (l->e->v1 == l->e->v2) { if (l->e->v1 == l->e->v2) {
fprintf(err, "Found bmesh edge with identical verts!\n"); fprintf(err, "Found bmesh edge with identical verts!\n");

View File

@ -741,7 +741,8 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd)
if (slot->len >= slot->size) { if (slot->len >= slot->size) {
slot->size = (slot->size + 1 + totadd) * 2; slot->size = (slot->size + 1 + totadd) * 2;
allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * slot->size; allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] *
slot->size;
tmp = slot->data.buf; tmp = slot->data.buf;
slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array"); slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array");
@ -756,7 +757,8 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd)
slot->len += totadd; slot->len += totadd;
slot->size = slot->len + 2; slot->size = slot->len + 2;
allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * slot->len; allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] *
slot->len;
tmp = slot->data.buf; tmp = slot->data.buf;
slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array"); slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array");

View File

@ -1917,7 +1917,6 @@ BMEdge *BM_edge_exists(BMVert *v_a, BMVert *v_b)
BMIter iter; BMIter iter;
BMEdge *e; BMEdge *e;
BLI_assert(v_a != v_b); BLI_assert(v_a != v_b);
BLI_assert(v_a->head.htype == BM_VERT && v_b->head.htype == BM_VERT); BLI_assert(v_a->head.htype == BM_VERT && v_b->head.htype == BM_VERT);

View File

@ -209,14 +209,13 @@ static void *bmw_VertShellWalker_step(BMWalker *walker)
BMW_state_remove(walker); BMW_state_remove(walker);
/* find the next edge whose other vertex has not been visite */ /* find the next edge whose other vertex has not been visite */
curedge = shellWalk.curedge; curedge = shellWalk.curedge;
do { do {
if (!BLI_gset_haskey(walker->visit_set, curedge)) { if (!BLI_gset_haskey(walker->visit_set, curedge)) {
if (!walker->restrictflag || if (!walker->restrictflag ||
(walker->restrictflag && BMO_edge_flag_test(walker->bm, curedge, walker->restrictflag))) (walker->restrictflag &&
{ BMO_edge_flag_test(walker->bm, curedge, walker->restrictflag))) {
BMwShellWalker *newstate; BMwShellWalker *newstate;
v_old = BM_edge_other_vert(curedge, shellWalk.base); v_old = BM_edge_other_vert(curedge, shellWalk.base);

View File

@ -66,15 +66,24 @@ static int erot_gsetutil_cmp(const void *a, const void *b)
{ {
const EdRotState *e_state_a = (const EdRotState *)a; const EdRotState *e_state_a = (const EdRotState *)a;
const EdRotState *e_state_b = (const EdRotState *)b; const EdRotState *e_state_b = (const EdRotState *)b;
if (e_state_a->v1 < e_state_b->v1) return -1; if (e_state_a->v1 < e_state_b->v1)
else if (e_state_a->v1 > e_state_b->v1) return 1; return -1;
else if (e_state_a->v2 < e_state_b->v2) return -1; else if (e_state_a->v1 > e_state_b->v1)
else if (e_state_a->v2 > e_state_b->v2) return 1; return 1;
else if (e_state_a->f1 < e_state_b->f1) return -1; else if (e_state_a->v2 < e_state_b->v2)
else if (e_state_a->f1 > e_state_b->f1) return 1; return -1;
else if (e_state_a->f2 < e_state_b->f2) return -1; else if (e_state_a->v2 > e_state_b->v2)
else if (e_state_a->f2 > e_state_b->f2) return 1; return 1;
else return 0; else if (e_state_a->f1 < e_state_b->f1)
return -1;
else if (e_state_a->f1 > e_state_b->f1)
return 1;
else if (e_state_a->f2 < e_state_b->f2)
return -1;
else if (e_state_a->f2 > e_state_b->f2)
return 1;
else
return 0;
} }
#endif #endif
static GSet *erot_gset_new(void) static GSet *erot_gset_new(void)

View File

@ -351,7 +351,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
std::vector<FCurve *> &rot_fcurves = fcurves_actionGroup_map[grp]; std::vector<FCurve *> &rot_fcurves = fcurves_actionGroup_map[grp];
if (rot_fcurves.size() > 3) continue; if (rot_fcurves.size() > 3)
continue;
for (i = 0; i < rot_fcurves.size(); i++) for (i = 0; i < rot_fcurves.size(); i++)
eulcu[rot_fcurves[i]->array_index] = rot_fcurves[i]; eulcu[rot_fcurves[i]->array_index] = rot_fcurves[i];
@ -366,7 +367,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
create_fcurve(0, rna_path), create_fcurve(0, rna_path),
create_fcurve(1, rna_path), create_fcurve(1, rna_path),
create_fcurve(2, rna_path), create_fcurve(2, rna_path),
create_fcurve(3, rna_path) create_fcurve(3, rna_path),
}; };
bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, grp->name); bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, grp->name);
@ -379,7 +380,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
FCurve *cu = eulcu[i]; FCurve *cu = eulcu[i];
if (!cu) continue; if (!cu)
continue;
for (int j = 0; j < cu->totvert; j++) { for (int j = 0; j < cu->totvert; j++) {
float frame = cu->bezt[j].vec[1][0]; float frame = cu->bezt[j].vec[1][0];
@ -387,7 +389,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
float eul[3] = { float eul[3] = {
eulcu[0] ? evaluate_fcurve(eulcu[0], frame) : 0.0f, eulcu[0] ? evaluate_fcurve(eulcu[0], frame) : 0.0f,
eulcu[1] ? evaluate_fcurve(eulcu[1], frame) : 0.0f, eulcu[1] ? evaluate_fcurve(eulcu[1], frame) : 0.0f,
eulcu[2] ? evaluate_fcurve(eulcu[2], frame) : 0.0f eulcu[2] ? evaluate_fcurve(eulcu[2], frame) : 0.0f,
}; };
// make eul relative to bone rest pose // make eul relative to bone rest pose
@ -410,7 +412,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
// now replace old Euler curves // now replace old Euler curves
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (!eulcu[i]) continue; if (!eulcu[i])
continue;
action_groups_remove_channel(act, eulcu[i]); action_groups_remove_channel(act, eulcu[i]);
free_fcurve(eulcu[i]); free_fcurve(eulcu[i]);
@ -579,7 +582,6 @@ void AnimationImporter::Assign_transform_animations(
COLLADABU::Math::Matrix4 mat4 = mat->getMatrix(); COLLADABU::Math::Matrix4 mat4 = mat->getMatrix();
switch (binding->animationClass) { switch (binding->animationClass) {
case COLLADAFW::AnimationList::TRANSFORM: case COLLADAFW::AnimationList::TRANSFORM:
} }
} }
#endif #endif
@ -2045,7 +2047,8 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root,
#if 0 #if 0
// recursively evaluates joint tree until end is found, mat then is world-space matrix of end // recursively evaluates joint tree until end is found, mat then is world-space matrix of end
// mat must be identity on enter, node must be root // mat must be identity on enter, node must be root
bool AnimationImporter::evaluate_joint_world_transform_at_frame(float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra) bool AnimationImporter::evaluate_joint_world_transform_at_frame(
float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra)
{ {
float m[4][4]; float m[4][4];
if (par) { if (par) {

View File

@ -238,7 +238,8 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
#if 0 #if 0
// recursively evaluates joint tree until end is found, mat then is world-space matrix of end // recursively evaluates joint tree until end is found, mat then is world-space matrix of end
// mat must be identity on enter, node must be root // mat must be identity on enter, node must be root
bool evaluate_joint_world_transform_at_frame(float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra); bool evaluate_joint_world_transform_at_frame(
float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra);
#endif #endif
void add_bone_fcurve(Object *ob, COLLADAFW::Node *node, FCurve *fcu); void add_bone_fcurve(Object *ob, COLLADAFW::Node *node, FCurve *fcu);

View File

@ -119,12 +119,12 @@ bool ArmatureExporter::add_instance_controller(Object *ob)
void ArmatureExporter::operator()(Object *ob) void ArmatureExporter::operator()(Object *ob)
{ {
Object *ob_arm = bc_get_assigned_armature(ob); Object *ob_arm = bc_get_assigned_armature(ob);
} }
bool ArmatureExporter::already_written(Object *ob_arm) bool ArmatureExporter::already_written(Object *ob_arm)
{ {
return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) != written_armatures.end(); return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) !=
written_armatures.end();
} }
void ArmatureExporter::wrote(Object *ob_arm) void ArmatureExporter::wrote(Object *ob_arm)
@ -132,7 +132,9 @@ void ArmatureExporter::wrote(Object *ob_arm)
written_armatures.push_back(ob_arm); written_armatures.push_back(ob_arm);
} }
void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce) void ArmatureExporter::find_objects_using_armature(Object *ob_arm,
std::vector<Object *> &objects,
Scene *sce)
{ {
objects.clear(); objects.clear();

View File

@ -78,8 +78,8 @@ JointData *ArmatureImporter::get_joint_data(COLLADAFW::Node *node);
const COLLADAFW::UniqueId &joint_id = node->getUniqueId(); const COLLADAFW::UniqueId &joint_id = node->getUniqueId();
if (joint_id_to_joint_index_map.find(joint_id) == joint_id_to_joint_index_map.end()) { if (joint_id_to_joint_index_map.find(joint_id) == joint_id_to_joint_index_map.end()) {
fprintf(stderr, "Cannot find a joint index by joint id for %s.\n", fprintf(
node->getOriginalId().c_str()); stderr, "Cannot find a joint index by joint id for %s.\n", node->getOriginalId().c_str());
return NULL; return NULL;
} }
@ -430,12 +430,14 @@ Object *ArmatureImporter::get_empty_for_leaves()
Object *ArmatureImporter::find_armature(COLLADAFW::Node *node) Object *ArmatureImporter::find_armature(COLLADAFW::Node *node)
{ {
JointData *jd = get_joint_data(node); JointData *jd = get_joint_data(node);
if (jd) return jd->ob_arm; if (jd)
return jd->ob_arm;
COLLADAFW::NodePointerArray &children = node->getChildNodes(); COLLADAFW::NodePointerArray &children = node->getChildNodes();
for (int i = 0; i < children.getCount(); i++) { for (int i = 0; i < children.getCount(); i++) {
Object *ob_arm = find_armature(children[i]); Object *ob_arm = find_armature(children[i]);
if (ob_arm) return ob_arm; if (ob_arm)
return ob_arm;
} }
return NULL; return NULL;
@ -446,7 +448,8 @@ ArmatureJoints& ArmatureImporter::get_armature_joints(Object *ob_arm)
// try finding it // try finding it
std::vector<ArmatureJoints>::iterator it; std::vector<ArmatureJoints>::iterator it;
for (it = armature_joints.begin(); it != armature_joints.end(); it++) { for (it = armature_joints.begin(); it != armature_joints.end(); it++) {
if ((*it).ob_arm == ob_arm) return *it; if ((*it).ob_arm == ob_arm)
return *it;
} }
// not found, create one // not found, create one
@ -800,7 +803,9 @@ void ArmatureImporter::make_armatures(bContext *C, std::vector<Object *> &object
#if 0 #if 0
// link with meshes, create vertex groups, assign weights // link with meshes, create vertex groups, assign weights
void ArmatureImporter::link_armature(Object *ob_arm, const COLLADAFW::UniqueId& geom_id, const COLLADAFW::UniqueId& controller_data_id) void ArmatureImporter::link_armature(Object *ob_arm,
const COLLADAFW::UniqueId &geom_id,
const COLLADAFW::UniqueId &controller_data_id)
{ {
Object *ob = mesh_importer->get_object_by_geom_uid(geom_id); Object *ob = mesh_importer->get_object_by_geom_uid(geom_id);

View File

@ -161,7 +161,9 @@ class ArmatureImporter : private TransformReader {
#if 0 #if 0
// link with meshes, create vertex groups, assign weights // link with meshes, create vertex groups, assign weights
void link_armature(Object *ob_arm, const COLLADAFW::UniqueId& geom_id, const COLLADAFW::UniqueId& controller_data_id); void link_armature(Object *ob_arm,
const COLLADAFW::UniqueId &geom_id,
const COLLADAFW::UniqueId &controller_data_id);
#endif #endif
bool write_skin_controller_data(const COLLADAFW::SkinControllerData *data); bool write_skin_controller_data(const COLLADAFW::SkinControllerData *data);

View File

@ -332,8 +332,7 @@ bool BCAnimationSampler::get_object_samples(BCMatrixSampleMap &samples, Object *
animation_type BC_ANIMATION_EXPORT_KEYS: Only take data from matrices for keyframes animation_type BC_ANIMATION_EXPORT_KEYS: Only take data from matrices for keyframes
*/ */
void BCAnimationSampler::add_value_set( void BCAnimationSampler::add_value_set(BCAnimationCurve &curve,
BCAnimationCurve &curve,
BCFrameSampleMap &samples, BCFrameSampleMap &samples,
BC_export_animation_type animation_type) BC_export_animation_type animation_type)
{ {

View File

@ -123,7 +123,8 @@ void ControllerExporter::operator()(Object *ob)
bool ArmatureExporter::already_written(Object *ob_arm) bool ArmatureExporter::already_written(Object *ob_arm)
{ {
return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) != written_armatures.end(); return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) !=
written_armatures.end();
} }
void ArmatureExporter::wrote(Object *ob_arm) void ArmatureExporter::wrote(Object *ob_arm)
@ -131,7 +132,9 @@ void ArmatureExporter::wrote(Object *ob_arm)
written_armatures.push_back(ob_arm); written_armatures.push_back(ob_arm);
} }
void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce) void ArmatureExporter::find_objects_using_armature(Object *ob_arm,
std::vector<Object *> &objects,
Scene *sce)
{ {
objects.clear(); objects.clear();

View File

@ -198,7 +198,8 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
Image *ima = t->tex->ima; Image *ima = t->tex->ima;
// Image not set for texture // Image not set for texture
if (!ima) continue; if (!ima)
continue;
std::string key(id_name(ima)); std::string key(id_name(ima));
key = translate_id(key); key = translate_id(key);
@ -206,8 +207,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// create only one <sampler>/<surface> pair for each unique image // create only one <sampler>/<surface> pair for each unique image
if (im_samp_map.find(key) == im_samp_map.end()) { if (im_samp_map.find(key) == im_samp_map.end()) {
//<newparam> <sampler> <source> //<newparam> <sampler> <source>
COLLADASW::Sampler sampler( COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
COLLADASW::Sampler::SAMPLER_TYPE_2D,
key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX, key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
key + COLLADASW::Sampler::SURFACE_SID_SUFFIX); key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
sampler.setImageId(key); sampler.setImageId(key);
@ -235,7 +235,8 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
key = translate_id(key); key = translate_id(key);
int i = im_samp_map[key]; int i = im_samp_map[key];
std::string uvname = strlen(t->uvname) ? t->uvname : active_uv; std::string uvname = strlen(t->uvname) ? t->uvname : active_uv;
COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)samp_surf[i]; // possibly uninitialised memory ... COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)
samp_surf[i]; // possibly uninitialised memory ...
writeTextures(ep, key, sampler, t, ima, uvname); writeTextures(ep, key, sampler, t, ima, uvname);
} }
#endif #endif

View File

@ -264,13 +264,11 @@ Mesh *bc_get_mesh_copy(BlenderContext &blender_context,
if (apply_modifiers) { if (apply_modifiers) {
#if 0 /* Not supported by new system currently... */ #if 0 /* Not supported by new system currently... */
switch (export_mesh_type) { switch (export_mesh_type) {
case BC_MESH_TYPE_VIEW: case BC_MESH_TYPE_VIEW: {
{
dm = mesh_create_derived_view(depsgraph, scene, ob, &mask); dm = mesh_create_derived_view(depsgraph, scene, ob, &mask);
break; break;
} }
case BC_MESH_TYPE_RENDER: case BC_MESH_TYPE_RENDER: {
{
dm = mesh_create_derived_render(depsgraph, scene, ob, &mask); dm = mesh_create_derived_render(depsgraph, scene, ob, &mask);
break; break;
} }
@ -826,8 +824,7 @@ void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4])
*/ */
static void bc_set_IDProperty(EditBone *ebone, const char *key, float value) static void bc_set_IDProperty(EditBone *ebone, const char *key, float value)
{ {
if (ebone->prop == NULL) if (ebone->prop == NULL) {
{
IDPropertyTemplate val = {0}; IDPropertyTemplate val = {0};
ebone->prop = IDP_New(IDP_GROUP, &val, "RNA_EditBone ID properties"); ebone->prop = IDP_New(IDP_GROUP, &val, "RNA_EditBone ID properties");
} }
@ -837,7 +834,6 @@ static void bc_set_IDProperty(EditBone *ebone, const char *key, float value)
IDProperty *prop = IDP_New(IDP_FLOAT, &val, key); IDProperty *prop = IDP_New(IDP_FLOAT, &val, key);
IDP_Float(prop) = value; IDP_Float(prop) = value;
IDP_AddToGroup(pgroup, prop); IDP_AddToGroup(pgroup, prop);
} }
#endif #endif
@ -1262,7 +1258,10 @@ bNode *bc_add_node(bContext *C, bNodeTree *ntree, int node_type, int locx, int l
#if 0 #if 0
// experimental, probably not used // experimental, probably not used
static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree, bNode *to_node, int to_index, std::string label) static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree,
bNode *to_node,
int to_index,
std::string label)
{ {
bNodeSocket *to_socket = (bNodeSocket *)BLI_findlink(&to_node->inputs, to_index); bNodeSocket *to_socket = (bNodeSocket *)BLI_findlink(&to_node->inputs, to_index);
@ -1278,7 +1277,10 @@ static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree, bNode *to_node,
return newsock; return newsock;
} }
static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree, bNode *from_node, int from_index, std::string label) static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree,
bNode *from_node,
int from_index,
std::string label)
{ {
bNodeSocket *from_socket = (bNodeSocket *)BLI_findlink(&from_node->outputs, from_index); bNodeSocket *from_socket = (bNodeSocket *)BLI_findlink(&from_node->outputs, from_index);
@ -1294,7 +1296,6 @@ static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree, bNode *from_nod
return newsock; return newsock;
} }
void bc_make_group(bContext *C, bNodeTree *ntree, std::map<std::string, bNode *> nmap) void bc_make_group(bContext *C, bNodeTree *ntree, std::map<std::string, bNode *> nmap)
{ {
bNode *gnode = node_group_make_from_selected(C, ntree, "ShaderNodeGroup", "ShaderNodeTree"); bNode *gnode = node_group_make_from_selected(C, ntree, "ShaderNodeGroup", "ShaderNodeTree");

View File

@ -183,7 +183,8 @@ inline bool bc_startswith(std::string const &value, std::string const &starting)
#if 0 /* UNUSED */ #if 0 /* UNUSED */
inline bool bc_endswith(std::string const &value, std::string const &ending) inline bool bc_endswith(std::string const &value, std::string const &ending)
{ {
if (ending.size() > value.size()) return false; if (ending.size() > value.size())
return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
} }
#endif #endif

View File

@ -413,7 +413,8 @@ void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int l
GPU_framebuffer_texture_detach(stl->g_data->minzbuffer); GPU_framebuffer_texture_detach(stl->g_data->minzbuffer);
/* Create lower levels */ /* Create lower levels */
GPU_framebuffer_recursive_downsample(fbl->downsample_fb, stl->g_data->minzbuffer, 8, &min_downsample_cb, vedata); GPU_framebuffer_recursive_downsample(
fbl->downsample_fb, stl->g_data->minzbuffer, 8, &min_downsample_cb, vedata);
DRW_stats_group_end(); DRW_stats_group_end();
#endif #endif
int minmax_size[3], depth_size[3]; int minmax_size[3], depth_size[3];

View File

@ -115,12 +115,12 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h))
static float samples_len = 8192.0f; static float samples_len = 8192.0f;
static float inv_samples_len = 1.0f / 8192.0f; static float inv_samples_len = 1.0f / 8192.0f;
char *lib_str = BLI_string_joinN( char *lib_str = BLI_string_joinN(datatoc_bsdf_common_lib_glsl, datatoc_bsdf_sampling_lib_glsl);
datatoc_bsdf_common_lib_glsl,
datatoc_bsdf_sampling_lib_glsl);
struct GPUShader *sh = DRW_shader_create_with_lib( struct GPUShader *sh = DRW_shader_create_with_lib(datatoc_lightprobe_vert_glsl,
datatoc_lightprobe_vert_glsl, datatoc_lightprobe_geom_glsl, datatoc_bsdf_lut_frag_glsl, lib_str, datatoc_lightprobe_geom_glsl,
datatoc_bsdf_lut_frag_glsl,
lib_str,
"#define HAMMERSLEY_SIZE 8192\n" "#define HAMMERSLEY_SIZE 8192\n"
"#define BRDF_LUT_SIZE 64\n" "#define BRDF_LUT_SIZE 64\n"
"#define NOISE_SIZE 64\n"); "#define NOISE_SIZE 64\n");
@ -151,9 +151,12 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h))
printf("{"); printf("{");
for (int i = 0; i < w * h * 3; i += 3) { for (int i = 0; i < w * h * 3; i += 3) {
printf("%ff, %ff, ", data[i], data[i+1]); i+=3; printf("%ff, %ff, ", data[i], data[i + 1]);
printf("%ff, %ff, ", data[i], data[i+1]); i+=3; i += 3;
printf("%ff, %ff, ", data[i], data[i+1]); i+=3; printf("%ff, %ff, ", data[i], data[i + 1]);
i += 3;
printf("%ff, %ff, ", data[i], data[i + 1]);
i += 3;
printf("%ff, %ff, \n", data[i], data[i + 1]); printf("%ff, %ff, \n", data[i], data[i + 1]);
} }
printf("}"); printf("}");
@ -174,9 +177,7 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
static float inv_samples_len = 1.0f / 8192.0f; static float inv_samples_len = 1.0f / 8192.0f;
char *frag_str = BLI_string_joinN( char *frag_str = BLI_string_joinN(
datatoc_bsdf_common_lib_glsl, datatoc_bsdf_common_lib_glsl, datatoc_bsdf_sampling_lib_glsl, datatoc_btdf_lut_frag_glsl);
datatoc_bsdf_sampling_lib_glsl,
datatoc_btdf_lut_frag_glsl);
struct GPUShader *sh = DRW_shader_create_fullscreen(frag_str, struct GPUShader *sh = DRW_shader_create_fullscreen(frag_str,
"#define HAMMERSLEY_SIZE 8192\n" "#define HAMMERSLEY_SIZE 8192\n"
@ -224,18 +225,26 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
fprintf(f, "\t{\n\t\t"); fprintf(f, "\t{\n\t\t");
for (int i = 0; i < w * h * 3; i += 3) { for (int i = 0; i < w * h * 3; i += 3) {
fprintf(f, "%ff,", data[i]); fprintf(f, "%ff,", data[i]);
if (((i/3)+1) % 12 == 0) fprintf(f, "\n\t\t"); if (((i / 3) + 1) % 12 == 0)
else fprintf(f, " "); fprintf(f, "\n\t\t");
else
fprintf(f, " ");
} }
fprintf(f, "\n\t},\n"); fprintf(f, "\n\t},\n");
# else # else
for (int i = 0; i < w * h * 3; i += 3) { for (int i = 0; i < w * h * 3; i += 3) {
if (data[i] < 0.01) printf(" "); if (data[i] < 0.01)
else if (data[i] < 0.3) printf("."); printf(" ");
else if (data[i] < 0.6) printf("+"); else if (data[i] < 0.3)
else if (data[i] < 0.9) printf("%%"); printf(".");
else printf("#"); else if (data[i] < 0.6)
if ((i/3+1) % 64 == 0) printf("\n"); printf("+");
else if (data[i] < 0.9)
printf("%%");
else
printf("#");
if ((i / 3 + 1) % 64 == 0)
printf("\n");
} }
# endif # endif

View File

@ -165,11 +165,7 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda
#if 0 /* for future high quality blur */ #if 0 /* for future high quality blur */
/* Future matrix */ /* Future matrix */
eevee_motion_blur_camera_get_matrix_at_time( eevee_motion_blur_camera_get_matrix_at_time(
scene, scene, ar, rv3d, v3d, ob_camera_eval, ctime + delta, effects->future_world_to_ndc);
ar, rv3d, v3d,
ob_camera_eval,
ctime + delta,
effects->future_world_to_ndc);
#endif #endif
invert_m4_m4(effects->current_ndc_to_world, effects->current_world_to_ndc); invert_m4_m4(effects->current_ndc_to_world, effects->current_world_to_ndc);
} }

View File

@ -185,9 +185,12 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata, Object *camera)
wpd->dof_blur_tx = DRW_texture_pool_query_2d( wpd->dof_blur_tx = DRW_texture_pool_query_2d(
size[0], size[1], GPU_R11F_G11F_B10F, &draw_engine_workbench_solid); size[0], size[1], GPU_R11F_G11F_B10F, &draw_engine_workbench_solid);
#if 0 #if 0
wpd->coc_temp_tx = DRW_texture_pool_query_2d(shrink_h_size[0], shrink_h_size[1], GPU_RG8, &draw_engine_workbench_solid); wpd->coc_temp_tx = DRW_texture_pool_query_2d(
wpd->coc_tiles_tx[0] = DRW_texture_pool_query_2d(shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid); shrink_h_size[0], shrink_h_size[1], GPU_RG8, &draw_engine_workbench_solid);
wpd->coc_tiles_tx[1] = DRW_texture_pool_query_2d(shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid); wpd->coc_tiles_tx[0] = DRW_texture_pool_query_2d(
shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid);
wpd->coc_tiles_tx[1] = DRW_texture_pool_query_2d(
shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid);
#endif #endif
GPU_framebuffer_ensure_config(&fbl->dof_downsample_fb, GPU_framebuffer_ensure_config(&fbl->dof_downsample_fb,
@ -197,15 +200,18 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata, Object *camera)
GPU_ATTACHMENT_TEXTURE(txl->coc_halfres_tx), GPU_ATTACHMENT_TEXTURE(txl->coc_halfres_tx),
}); });
#if 0 #if 0
GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_h_fb, { GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_h_fb,
{
GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_NONE,
GPU_ATTACHMENT_TEXTURE(wpd->coc_temp_tx), GPU_ATTACHMENT_TEXTURE(wpd->coc_temp_tx),
}); });
GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_v_fb, { GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_v_fb,
{
GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_NONE,
GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[0]), GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[0]),
}); });
GPU_framebuffer_ensure_config(&fbl->dof_coc_dilate_fb, { GPU_framebuffer_ensure_config(&fbl->dof_coc_dilate_fb,
{
GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_NONE,
GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[1]), GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[1]),
}); });
@ -318,12 +324,14 @@ void workbench_dof_create_pass(WORKBENCH_Data *vedata,
} }
#if 0 #if 0
{ {
DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_h_sh, psl->dof_flatten_h_ps); DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_h_sh,
psl->dof_flatten_h_ps);
DRW_shgroup_uniform_texture(grp, "inputCocTex", txl->coc_halfres_tx); DRW_shgroup_uniform_texture(grp, "inputCocTex", txl->coc_halfres_tx);
DRW_shgroup_call_add(grp, quad, NULL); DRW_shgroup_call_add(grp, quad, NULL);
} }
{ {
DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_v_sh, psl->dof_flatten_v_ps); DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_v_sh,
psl->dof_flatten_v_ps);
DRW_shgroup_uniform_texture(grp, "inputCocTex", wpd->coc_temp_tx); DRW_shgroup_uniform_texture(grp, "inputCocTex", wpd->coc_temp_tx);
DRW_shgroup_call_add(grp, quad, NULL); DRW_shgroup_call_add(grp, quad, NULL);
} }

View File

@ -78,12 +78,12 @@ void studiolight_update_world(WORKBENCH_PrivateData *wpd,
mul_v3_v3fl(wd->spherical_harmonics_coefs[0], sl->spherical_harmonics_coefs[0], M_1_PI); mul_v3_v3fl(wd->spherical_harmonics_coefs[0], sl->spherical_harmonics_coefs[0], M_1_PI);
/* Swizzle to make shader code simpler. */ /* Swizzle to make shader code simpler. */
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
copy_v3_fl3( copy_v3_fl3(wd->spherical_harmonics_coefs[i + 1],
wd->spherical_harmonics_coefs[i + 1],
-sl->spherical_harmonics_coefs[3][i], -sl->spherical_harmonics_coefs[3][i],
sl->spherical_harmonics_coefs[2][i], sl->spherical_harmonics_coefs[2][i],
-sl->spherical_harmonics_coefs[1][i]); -sl->spherical_harmonics_coefs[1][i]);
mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */ mul_v3_fl(wd->spherical_harmonics_coefs[i + 1],
M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */
} }
/* Precompute as much as we can. See shader code for derivation. */ /* Precompute as much as we can. See shader code for derivation. */

View File

@ -161,9 +161,13 @@ static void UNUSED_FUNCTION(add_fancy_edge)(GPUVertBuf *vbo,
} }
#if 0 /* UNUSED */ #if 0 /* UNUSED */
static void add_lat_lon_vert( static void add_lat_lon_vert(GPUVertBuf *vbo,
GPUVertBuf *vbo, uint pos_id, uint nor_id, uint pos_id,
uint *v_idx, const float rad, const float lat, const float lon) uint nor_id,
uint *v_idx,
const float rad,
const float lat,
const float lon)
{ {
float pos[3], nor[3]; float pos[3], nor[3];
nor[0] = sinf(lat) * cosf(lon); nor[0] = sinf(lat) * cosf(lon);
@ -179,7 +183,9 @@ static GPUVertBuf *fill_arrows_vbo(const float scale)
{ {
/* Position Only 3D format */ /* Position Only 3D format */
static GPUVertFormat format = {0}; static GPUVertFormat format = {0};
static struct { uint pos; } attr_id; static struct {
uint pos;
} attr_id;
if (format.attr_len == 0) { if (format.attr_len == 0) {
attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
} }
@ -2055,17 +2061,13 @@ static const float bone_octahedral_smooth_normals[6][3] = {
#if 0 /* UNUSED */ #if 0 /* UNUSED */
static const uint bone_octahedral_wire[24] = { static const uint bone_octahedral_wire[24] = {
0, 1, 1, 5, 5, 3, 3, 0, 0, 1, 1, 5, 5, 3, 3, 0, 0, 4, 4, 5, 5, 2, 2, 0, 1, 2, 2, 3, 3, 4, 4, 1,
0, 4, 4, 5, 5, 2, 2, 0,
1, 2, 2, 3, 3, 4, 4, 1,
}; };
/* aligned with bone_octahedral_wire /* aligned with bone_octahedral_wire
* Contains adjacent normal index */ * Contains adjacent normal index */
static const uint bone_octahedral_wire_adjacent_face[24] = { static const uint bone_octahedral_wire_adjacent_face[24] = {
0, 3, 4, 7, 5, 6, 1, 2, 0, 3, 4, 7, 5, 6, 1, 2, 2, 3, 6, 7, 4, 5, 0, 1, 0, 4, 1, 5, 2, 6, 3, 7,
2, 3, 6, 7, 4, 5, 0, 1,
0, 4, 1, 5, 2, 6, 3, 7,
}; };
#endif #endif
@ -2219,17 +2221,13 @@ static const float bone_box_smooth_normals[8][3] = {
#if 0 /* UNUSED */ #if 0 /* UNUSED */
static const uint bone_box_wire[24] = { static const uint bone_box_wire[24] = {
0, 1, 1, 2, 2, 3, 3, 0, 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7,
4, 5, 5, 6, 6, 7, 7, 4,
0, 4, 1, 5, 2, 6, 3, 7,
}; };
/* aligned with bone_octahedral_wire /* aligned with bone_octahedral_wire
* Contains adjacent normal index */ * Contains adjacent normal index */
static const uint bone_box_wire_adjacent_face[24] = { static const uint bone_box_wire_adjacent_face[24] = {
0, 2, 0, 4, 1, 6, 1, 8, 0, 2, 0, 4, 1, 6, 1, 8, 3, 10, 5, 10, 7, 11, 9, 11, 3, 8, 2, 5, 4, 7, 6, 9,
3, 10, 5, 10, 7, 11, 9, 11,
3, 8, 2, 5, 4, 7, 6, 9,
}; };
#endif #endif
@ -2500,7 +2498,9 @@ GPUBatch *DRW_cache_bone_point_get(void)
uint v_idx = 0; uint v_idx = 0;
static GPUVertFormat format = {0}; static GPUVertFormat format = {0};
static struct { uint pos, nor; } attr_id; static struct {
uint pos, nor;
} attr_id;
if (format.attr_len == 0) { if (format.attr_len == 0) {
attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
attr_id.nor = GPU_vertformat_attr_add(&format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); attr_id.nor = GPU_vertformat_attr_add(&format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
@ -2515,14 +2515,16 @@ GPUBatch *DRW_cache_bone_point_get(void)
float lat = 0.0f; float lat = 0.0f;
for (int j = 0; j < lat_res; j++, lat += lat_inc) { for (int j = 0; j < lat_res; j++, lat += lat_inc) {
if (j != lat_res - 1) { /* Pole */ if (j != lat_res - 1) { /* Pole */
add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc); add_lat_lon_vert(
vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc);
add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon); add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon);
add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon); add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon);
} }
if (j != 0) { /* Pole */ if (j != 0) { /* Pole */
add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon + lon_inc); add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon + lon_inc);
add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc); add_lat_lon_vert(
vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc);
add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon); add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon);
} }
} }
@ -2755,10 +2757,14 @@ static float z_axis_name[10][2] = {
#define S_Y 0.007f #define S_Y 0.007f
static float axis_marker[8][2] = { static float axis_marker[8][2] = {
#if 0 /* square */ #if 0 /* square */
{-1.0f * S_X, 1.0f * S_Y}, { 1.0f * S_X, 1.0f * S_Y}, {-1.0f * S_X, 1.0f * S_Y},
{ 1.0f * S_X, 1.0f * S_Y}, { 1.0f * S_X, -1.0f * S_Y}, {1.0f * S_X, 1.0f * S_Y},
{ 1.0f * S_X, -1.0f * S_Y}, {-1.0f * S_X, -1.0f * S_Y}, {1.0f * S_X, 1.0f * S_Y},
{-1.0f * S_X, -1.0f * S_Y}, {-1.0f * S_X, 1.0f * S_Y} {1.0f * S_X, -1.0f * S_Y},
{1.0f * S_X, -1.0f * S_Y},
{-1.0f * S_X, -1.0f * S_Y},
{-1.0f * S_X, -1.0f * S_Y},
{-1.0f * S_X, 1.0f * S_Y}
#else /* diamond */ #else /* diamond */
{-S_X, 0.f}, {-S_X, 0.f},
{0.f, S_Y}, {0.f, S_Y},

View File

@ -3128,7 +3128,8 @@ static void mesh_create_loop_uv_and_tan(MeshRenderData *rdata, GPUVertBuf *vbo)
for (uint i = 0; i < uv_len; i++) { for (uint i = 0; i < uv_len; i++) {
const char *attr_name = mesh_render_data_uv_layer_uuid_get(rdata, i); const char *attr_name = mesh_render_data_uv_layer_uuid_get(rdata, i);
#if 0 /* these are clamped. Maybe use them as an option in the future */ #if 0 /* these are clamped. Maybe use them as an option in the future */
uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_I16, 2, GPU_FETCH_INT_TO_FLOAT_UNIT); uv_id[i] = GPU_vertformat_attr_add(
&format, attr_name, GPU_COMP_I16, 2, GPU_FETCH_INT_TO_FLOAT_UNIT);
#else #else
uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT); uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
#endif #endif
@ -4433,8 +4434,10 @@ BLI_INLINE void edit_uv_preprocess_stretch_angle(float (*auv)[2],
} }
#if 0 /* here for reference, this is done in shader now. */ #if 0 /* here for reference, this is done in shader now. */
BLI_INLINE float edit_uv_get_loop_stretch_angle( BLI_INLINE float edit_uv_get_loop_stretch_angle(const float auv0[2],
const float auv0[2], const float auv1[2], const float av0[3], const float av1[3]) const float auv1[2],
const float av0[3],
const float av1[3])
{ {
float uvang = angle_normalized_v2v2(auv0, auv1); float uvang = angle_normalized_v2v2(auv0, auv1);
float ang = angle_normalized_v3v3(av0, av1); float ang = angle_normalized_v3v3(av0, av1);

View File

@ -498,7 +498,8 @@ static void draw_clipping_setup_from_view(void)
/* Extract Clipping Planes */ /* Extract Clipping Planes */
BoundBox bbox; BoundBox bbox;
#if 0 /* It has accuracy problems. */ #if 0 /* It has accuracy problems. */
BKE_boundbox_init_from_minmax(&bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f}); BKE_boundbox_init_from_minmax(
&bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f});
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
mul_project_m4_v3(projinv, bbox.vec[i]); mul_project_m4_v3(projinv, bbox.vec[i]);
} }

View File

@ -405,7 +405,9 @@ static bool acf_generic_idfill_name_prop(bAnimListElem *ale, PointerRNA *ptr, Pr
#if 0 #if 0
/* channel type has no settings */ /* channel type has no settings */
static bool acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting) static bool acf_generic_none_setting_valid(bAnimContext *ac,
bAnimListElem *ale,
eAnimChannel_Settings setting)
{ {
return false; return false;
} }
@ -4715,15 +4717,43 @@ void ANIM_channel_draw_widgets(const bContext *C,
RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr); RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
UI_block_align_begin(block); UI_block_align_begin(block);
UI_block_emboss_set(block, RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE); UI_block_emboss_set(block,
uiDefButR(block, UI_BTYPE_COLOR, 1, "", offset, yminc, w, ICON_WIDTH, RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
&ptr, "color", -1, uiDefButR(block,
0, 0, 0, 0, gpl->info); UI_BTYPE_COLOR,
1,
"",
offset,
yminc,
w,
ICON_WIDTH,
&ptr,
"color",
-1,
0,
0,
0,
0,
gpl->info);
UI_block_emboss_set(block, RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE); UI_block_emboss_set(block,
uiDefButR(block, UI_BTYPE_COLOR, 1, "", offset + w, yminc, w, ICON_WIDTH, RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
&ptr, "fill_color", -1, uiDefButR(block,
0, 0, 0, 0, gpl->info); UI_BTYPE_COLOR,
1,
"",
offset + w,
yminc,
w,
ICON_WIDTH,
&ptr,
"fill_color",
-1,
0,
0,
0,
0,
gpl->info);
UI_block_emboss_set(block, UI_EMBOSS_NONE); UI_block_emboss_set(block, UI_EMBOSS_NONE);
UI_block_align_end(block); UI_block_align_end(block);

View File

@ -408,7 +408,10 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
#if 0 #if 0
if (G.debug & G_DEBUG) { if (G.debug & G_DEBUG) {
printf("%s: Unhandled animchannel updates (%d) for type=%d (%p)\n", printf("%s: Unhandled animchannel updates (%d) for type=%d (%p)\n",
__func__, ale->update, ale->type, ale->data); __func__,
ale->update,
ale->type,
ale->data);
} }
#endif #endif
/* Prevent crashes in cases where it can't be handled */ /* Prevent crashes in cases where it can't be handled */

View File

@ -1476,7 +1476,10 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR) if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
if (fabsf(mdb->totalphi[b] - 1.0f) > 1e-4f) if (fabsf(mdb->totalphi[b] - 1.0f) > 1e-4f)
printf("totalphi deficiency [%s|%d] %d: %.10f\n", printf("totalphi deficiency [%s|%d] %d: %.10f\n",
(mdb->tag[b] == MESHDEFORM_TAG_INTERIOR) ? "interior" : "boundary", mdb->semibound[b], mdb->varidx[b], mdb->totalphi[b]); (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR) ? "interior" : "boundary",
mdb->semibound[b],
mdb->varidx[b],
mdb->totalphi[b]);
#endif #endif
/* free */ /* free */

View File

@ -167,7 +167,8 @@ static bool pose_has_protected_selected(Object *ob, short warn)
} }
} }
if (pchan) { if (pchan) {
if (warn) error("Cannot change Proxy protected bones"); if (warn)
error("Cannot change Proxy protected bones");
return 1; return 1;
} }
} }

View File

@ -1834,9 +1834,15 @@ void POSELIB_OT_browse_interactive(wmOperatorType *ot)
// XXX: percentage vs factor? // XXX: percentage vs factor?
/* not used yet */ /* not used yet */
#if 0 #if 0
RNA_def_float_factor( RNA_def_float_factor(ot->srna,
ot->srna, "blend_factor", 1.0f, 0.0f, 1.0f, "Blend Factor", "blend_factor",
"Amount that the pose is applied on top of the existing poses", 0.0f, 1.0f); 1.0f,
0.0f,
1.0f,
"Blend Factor",
"Amount that the pose is applied on top of the existing poses",
0.0f,
1.0f);
#endif #endif
} }

View File

@ -104,11 +104,13 @@ void printknots(Object *obedit)
if (ED_curve_nurb_select_check(nu) && nu->type == CU_NURBS) { if (ED_curve_nurb_select_check(nu) && nu->type == CU_NURBS) {
if (nu->knotsu) { if (nu->knotsu) {
num = KNOTSU(nu); num = KNOTSU(nu);
for (a = 0; a < num; a++) printf("knotu %d: %f\n", a, nu->knotsu[a]); for (a = 0; a < num; a++)
printf("knotu %d: %f\n", a, nu->knotsu[a]);
} }
if (nu->knotsv) { if (nu->knotsv) {
num = KNOTSV(nu); num = KNOTSV(nu);
for (a = 0; a < num; a++) printf("knotv %d: %f\n", a, nu->knotsv[a]); for (a = 0; a < num; a++)
printf("knotv %d: %f\n", a, nu->knotsv[a]);
} }
} }
} }

View File

@ -2429,7 +2429,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* event doesn't need to be handled */ /* event doesn't need to be handled */
#if 0 #if 0
printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n", printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n",
event->type, event->type == MIDDLEMOUSE, event->type==MOUSEMOVE); event->type,
event->type == MIDDLEMOUSE,
event->type == MOUSEMOVE);
#endif #endif
break; break;
} }

View File

@ -388,8 +388,7 @@ static int gp_set_filling_texture(Image *image, short flag)
} }
GPU_create_gl_tex( GPU_create_gl_tex(
bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, false, false, image);
false, false, image);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@ -452,7 +451,8 @@ static void gp_draw_stroke_fill(bGPdata *gpd,
immUniform1i("t_flip", (gp_style->flag & GP_STYLE_COLOR_FLIP_FILL) != 0); immUniform1i("t_flip", (gp_style->flag & GP_STYLE_COLOR_FLIP_FILL) != 0);
#if 0 /* GPXX disabled, not used in annotations */ #if 0 /* GPXX disabled, not used in annotations */
/* image texture */ /* image texture */
if ((gp_style->fill_style == GP_STYLE_FILL_STYLE_TEXTURE) || (gp_style->flag & GP_STYLE_COLOR_TEX_MIX)) { if ((gp_style->fill_style == GP_STYLE_FILL_STYLE_TEXTURE) ||
(gp_style->flag & GP_STYLE_COLOR_TEX_MIX)) {
gp_set_filling_texture(gp_style->ima, gp_style->flag); gp_set_filling_texture(gp_style->ima, gp_style->flag);
} }
#endif #endif

View File

@ -3748,7 +3748,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* event doesn't need to be handled */ /* event doesn't need to be handled */
#if 0 #if 0
printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n", printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n",
event->type, event->type == MIDDLEMOUSE, event->type == MOUSEMOVE); event->type,
event->type == MIDDLEMOUSE,
event->type == MOUSEMOVE);
#endif #endif
break; break;
} }

View File

@ -707,7 +707,10 @@ void ED_scene_draw_fps(struct Scene *scene, int xoffset, int *yoffset);
#if 0 #if 0
void ED_view3d_operator_properties_viewmat(struct wmOperatorType *ot); void ED_view3d_operator_properties_viewmat(struct wmOperatorType *ot);
void ED_view3d_operator_properties_viewmat_set(struct bContext *C, struct wmOperator *op); void ED_view3d_operator_properties_viewmat_set(struct bContext *C, struct wmOperator *op);
void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx, int *winy, float persmat[4][4]); void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op,
int *winx,
int *winy,
float persmat[4][4]);
#endif #endif
/* render */ /* render */

View File

@ -417,7 +417,15 @@ void UI_draw_roundbox_shade_x(bool filled,
#if 0 /* unused */ #if 0 /* unused */
int UI_draw_roundbox_corner_get(void); int UI_draw_roundbox_corner_get(void);
void UI_draw_roundbox_shade_y(bool filled, float minx, float miny, float maxx, float maxy, float rad, float shadeleft, float shaderight, const float col[4]); void UI_draw_roundbox_shade_y(bool filled,
float minx,
float miny,
float maxx,
float maxy,
float rad,
float shadeleft,
float shaderight,
const float col[4]);
#endif #endif
void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, float maxy); void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, float maxy);
@ -587,7 +595,10 @@ void UI_popup_block_ex(struct bContext *C,
void *arg, void *arg,
struct wmOperator *op); struct wmOperator *op);
#if 0 /* UNUSED */ #if 0 /* UNUSED */
void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); void uiPupBlockOperator(struct bContext *C,
uiBlockCreateFunc func,
struct wmOperator *op,
int opcontext);
#endif #endif
void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block); void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block);

View File

@ -1274,7 +1274,8 @@ static bool ui_but_event_property_operator_string(const bContext *C,
#if 0 #if 0
else { else {
printf("ERROR in %s(): Couldn't get path for scene property - %s\n", printf("ERROR in %s(): Couldn't get path for scene property - %s\n",
__func__, RNA_property_identifier(prop)); __func__,
RNA_property_identifier(prop));
} }
#endif #endif
} }

View File

@ -655,12 +655,16 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
#if 0 /* Disabled for now. */ #if 0 /* Disabled for now. */
ot = WM_operatortype_find("UI_OT_override_type_set_button", false); ot = WM_operatortype_find("UI_OT_override_type_set_button", false);
uiItemFullO_ptr( uiItemFullO_ptr(
layout, ot, "Overrides Type", ICON_NONE, layout, ot, "Overrides Type", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
RNA_boolean_set(&op_ptr, "all", true); RNA_boolean_set(&op_ptr, "all", true);
uiItemFullO_ptr( uiItemFullO_ptr(layout,
layout, ot, "Single Override Type", ICON_NONE, ot,
NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr); "Single Override Type",
ICON_NONE,
NULL,
WM_OP_INVOKE_DEFAULT,
0,
&op_ptr);
RNA_boolean_set(&op_ptr, "all", false); RNA_boolean_set(&op_ptr, "all", false);
#endif #endif
uiItemBooleanO(layout, uiItemBooleanO(layout,
@ -678,9 +682,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
} }
else { else {
#if 0 /* Disabled for now. */ #if 0 /* Disabled for now. */
uiItemFullO( uiItemFullO(layout,
layout, "UI_OT_override_type_set_button", "Override Type", ICON_NONE, "UI_OT_override_type_set_button",
NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr); "Override Type",
ICON_NONE,
NULL,
WM_OP_INVOKE_DEFAULT,
0,
&op_ptr);
RNA_boolean_set(&op_ptr, "all", false); RNA_boolean_set(&op_ptr, "all", false);
#endif #endif
uiItemBooleanO(layout, uiItemBooleanO(layout,
@ -896,9 +905,15 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
if (kmi) { if (kmi) {
if (ISKEYBOARD(kmi->type)) { if (ISKEYBOARD(kmi->type)) {
#if 0 /* would rather use a block but, but gets weirdly positioned... */ #if 0 /* would rather use a block but, but gets weirdly positioned... */
uiDefBlockBut( uiDefBlockBut(block,
block, menu_change_shortcut, but, "Change Shortcut", menu_change_shortcut,
0, 0, uiLayoutGetWidth(layout), UI_UNIT_Y, ""); but,
"Change Shortcut",
0,
0,
uiLayoutGetWidth(layout),
UI_UNIT_Y,
"");
#endif #endif
but2 = uiDefIconTextBut(block, but2 = uiDefIconTextBut(block,
@ -1005,9 +1020,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
/* XXX inactive option, not for public! */ /* XXX inactive option, not for public! */
#if 0 #if 0
uiItemFullO( uiItemFullO(layout,
layout, "WM_OT_doc_edit", "Submit Description", ICON_NONE, "WM_OT_doc_edit",
NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr_props); "Submit Description",
ICON_NONE,
NULL,
WM_OP_INVOKE_DEFAULT,
0,
&ptr_props);
RNA_string_set(&ptr_props, "doc_id", buf); RNA_string_set(&ptr_props, "doc_id", buf);
RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop)); RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop));
#endif #endif

View File

@ -167,8 +167,13 @@ void UI_draw_roundbox_4fv(
{ {
#if 0 #if 0
float vec[7][2] = { float vec[7][2] = {
{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, {0.195, 0.02},
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, {0.383, 0.067},
{0.55, 0.169},
{0.707, 0.293},
{0.831, 0.45},
{0.924, 0.617},
{0.98, 0.805},
}; };
int a; int a;
@ -270,7 +275,10 @@ void UI_draw_roundbox_4fv(
} }
#if 0 #if 0
static void round_box_shade_col(uint attr, const float col1[3], float const col2[3], const float fac) static void round_box_shade_col(uint attr,
const float col1[3],
float const col2[3],
const float fac)
{ {
float col[4] = { float col[4] = {
fac * col1[0] + (1.0f - fac) * col2[0], fac * col1[0] + (1.0f - fac) * col2[0],
@ -296,8 +304,13 @@ void UI_draw_roundbox_shade_x(bool filled,
{ {
#if 0 #if 0
float vec[7][2] = { float vec[7][2] = {
{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, {0.195, 0.02},
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, {0.383, 0.067},
{0.55, 0.169},
{0.707, 0.293},
{0.831, 0.45},
{0.924, 0.617},
{0.98, 0.805},
}; };
const float div = maxy - miny; const float div = maxy - miny;
const float idiv = 1.0f / div; const float idiv = 1.0f / div;
@ -440,13 +453,24 @@ void UI_draw_roundbox_shade_x(bool filled,
#if 0 /* unused */ #if 0 /* unused */
/* linear vertical shade within button or in outline */ /* linear vertical shade within button or in outline */
/* view2d scrollers use it */ /* view2d scrollers use it */
void UI_draw_roundbox_shade_y( void UI_draw_roundbox_shade_y(bool filled,
bool filled, float minx, float miny, float maxx, float maxy, float minx,
float rad, float shadeleft, float shaderight, const float col[4]) float miny,
float maxx,
float maxy,
float rad,
float shadeleft,
float shaderight,
const float col[4])
{ {
float vec[7][2] = { float vec[7][2] = {
{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, {0.195, 0.02},
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, {0.383, 0.067},
{0.55, 0.169},
{0.707, 0.293},
{0.831, 0.45},
{0.924, 0.617},
{0.98, 0.805},
}; };
const float div = maxx - minx; const float div = maxx - minx;
const float idiv = 1.0f / div; const float idiv = 1.0f / div;
@ -473,7 +497,6 @@ void UI_draw_roundbox_shade_y(
colRight[1] = max_ff(0.0f, col[1] + shaderight); colRight[1] = max_ff(0.0f, col[1] + shaderight);
colRight[2] = max_ff(0.0f, col[2] + shaderight); colRight[2] = max_ff(0.0f, col[2] + shaderight);
vert_count += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1; vert_count += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1;
vert_count += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1; vert_count += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1;
vert_count += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1; vert_count += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1;
@ -2461,7 +2484,8 @@ void ui_draw_dropshadow(
/* alpha ranges from 2 to 20 or so */ /* alpha ranges from 2 to 20 or so */
#if 0 /* Old Method (pre 2.8) */ #if 0 /* Old Method (pre 2.8) */
float color[4] = {0.0f, 0.0f, 0.0f, calpha}; float color[4] = {0.0f, 0.0f, 0.0f, calpha};
UI_draw_roundbox_4fv(true, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax - 10.0f + a, rad + a, color); UI_draw_roundbox_4fv(
true, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax - 10.0f + a, rad + a, color);
#endif #endif
/* Compute final visibility to match old method result. */ /* Compute final visibility to match old method result. */
/* TODO we could just find a better fit function inside the shader instead of this. */ /* TODO we could just find a better fit function inside the shader instead of this. */

View File

@ -1538,7 +1538,8 @@ void uiItemsFullEnumO(uiLayout *layout,
* introduction of GP editing modes) * introduction of GP editing modes)
*/ */
#if 0 #if 0
RNA_property_enum_items_gettexted_all(block->evil_C, &ptr, prop, &item_array, &totitem, &free); RNA_property_enum_items_gettexted_all(
block->evil_C, &ptr, prop, &item_array, &totitem, &free);
#else #else
RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item_array, &totitem, &free); RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item_array, &totitem, &free);
#endif #endif

View File

@ -2354,8 +2354,14 @@ void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C)
/* Disable for now, doesn't fit well in popover. */ /* Disable for now, doesn't fit well in popover. */
#if 0 #if 0
/* Repeat button with operator name as text. */ /* Repeat button with operator name as text. */
uiItemFullO(layout, "SCREEN_OT_repeat_last", RNA_struct_ui_name(op->type->srna), uiItemFullO(layout,
ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL); "SCREEN_OT_repeat_last",
RNA_struct_ui_name(op->type->srna),
ICON_NONE,
NULL,
WM_OP_INVOKE_DEFAULT,
0,
NULL);
#endif #endif
if (WM_operator_repeat_check(C, op)) { if (WM_operator_repeat_check(C, op)) {

View File

@ -102,8 +102,7 @@ static int validate_undoLatt(void *data, void *edata)
UndoLattice *ult = (UndoLattice *)data; UndoLattice *ult = (UndoLattice *)data;
EditLatt *editlatt = (EditLatt *)edata; EditLatt *editlatt = (EditLatt *)edata;
return (ult->pntsu == editlatt->latt->pntsu && return (ult->pntsu == editlatt->latt->pntsu && ult->pntsv == editlatt->latt->pntsv &&
ult->pntsv == editlatt->latt->pntsv &&
ult->pntsw == editlatt->latt->pntsw); ult->pntsw == editlatt->latt->pntsw);
} }
#endif #endif

View File

@ -86,8 +86,7 @@ static float edbm_rip_edgedist_squared(ARegion *ar,
#if 0 #if 0
static float edbm_rip_linedist( static float edbm_rip_linedist(
ARegion *ar, float mat[4][4], ARegion *ar, float mat[4][4], const float co1[3], const float co2[3], const float mvalf[2])
const float co1[3], const float co2[3], const float mvalf[2])
{ {
float vec1[2], vec2[2]; float vec1[2], vec2[2];

View File

@ -1173,9 +1173,7 @@ bool EDBM_unified_findnearest_from_raycast(ViewContext *vc,
float point[3]; float point[3];
#if 0 #if 0
const float dist_sq_test = dist_squared_ray_to_seg_v3( const float dist_sq_test = dist_squared_ray_to_seg_v3(
ray_origin, ray_direction, ray_origin, ray_direction, e->v1->co, e->v2->co, point, &depth);
e->v1->co, e->v2->co,
point, &depth);
#else #else
if (coords) { if (coords) {
mid_v3_v3v3( mid_v3_v3v3(
@ -1801,7 +1799,8 @@ static bool mouse_mesh_loop(
length_2 = len_squared_v2v2(mvalf, v2_co); length_2 = len_squared_v2v2(mvalf, v2_co);
} }
#if 0 #if 0
printf("mouse to v1: %f\nmouse to v2: %f\n", len_squared_v2v2(mvalf, v1_co), printf("mouse to v1: %f\nmouse to v2: %f\n",
len_squared_v2v2(mvalf, v1_co),
len_squared_v2v2(mvalf, v2_co)); len_squared_v2v2(mvalf, v2_co));
#endif #endif
BM_select_history_store(em->bm, (length_1 < length_2) ? eed->v1 : eed->v2); BM_select_history_store(em->bm, (length_1 < length_2) ? eed->v1 : eed->v2);

View File

@ -363,10 +363,8 @@ void EDBM_mesh_load(Main *bmain, Object *ob)
* cycles. * cycles.
*/ */
#if 0 #if 0
for (Object *other_object = bmain->objects.first; for (Object *other_object = bmain->objects.first; other_object != NULL;
other_object != NULL; other_object = other_object->id.next) {
other_object = other_object->id.next)
{
if (other_object->data == ob->data) { if (other_object->data == ob->data) {
BKE_object_free_derived_caches(other_object); BKE_object_free_derived_caches(other_object);
} }

View File

@ -900,17 +900,15 @@ int ED_mesh_mirror_get_vert(Object *ob, int index)
#if 0 #if 0
static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float *mirrCent, float *face_cent) static float *editmesh_get_mirror_uv(
BMEditMesh *em, int axis, float *uv, float *mirrCent, float *face_cent)
{ {
float vec[2]; float vec[2];
float cent_vec[2]; float cent_vec[2];
float cent[2]; float cent[2];
/* ignore nan verts */ /* ignore nan verts */
if (isnan(uv[0]) || !isfinite(uv[0]) || if (isnan(uv[0]) || !isfinite(uv[0]) || isnan(uv[1]) || !isfinite(uv[1])) {
isnan(uv[1]) || !isfinite(uv[1])
)
{
return NULL; return NULL;
} }
@ -945,7 +943,6 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float
MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
if ((fabsf(luv->uv[0] - vec[0]) < 0.001f) && (fabsf(luv->uv[1] - vec[1]) < 0.001f)) { if ((fabsf(luv->uv[0] - vec[0]) < 0.001f) && (fabsf(luv->uv[1] - vec[1]) < 0.001f)) {
return luv->uv; return luv->uv;
} }
} }
} }

View File

@ -1342,8 +1342,10 @@ static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr))
Scene *sce = (Scene *)BLI_findlink(&bmain->scene, G.curscreen->scenenr - 1); Scene *sce = (Scene *)BLI_findlink(&bmain->scene, G.curscreen->scenenr - 1);
Base *base, *nbase; Base *base, *nbase;
if (sce == NULL) return; if (sce == NULL)
if (sce->id.lib) return; return;
if (sce->id.lib)
return;
for (base = FIRSTBASE; base; base = base->next) { for (base = FIRSTBASE; base; base = base->next) {
if (BASE_SELECTED(v3d, base)) { if (BASE_SELECTED(v3d, base)) {

View File

@ -510,9 +510,11 @@ static bool key_test_depth(const PEData *data, const float co[3], const int scre
/* used to calculate here but all callers have the screen_co already, so pass as arg */ /* used to calculate here but all callers have the screen_co already, so pass as arg */
#if 0 #if 0
if (ED_view3d_project_int_global(data->vc.ar, co, screen_co, if (ED_view3d_project_int_global(data->vc.ar,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) co,
{ screen_co,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN |
V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) {
return 0; return 0;
} }
#endif #endif

View File

@ -530,8 +530,11 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4f(drand48(), drand48(), drand48(), 0.1f); immUniformColor4f(drand48(), drand48(), drand48(), 0.1f);
immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin, immRectf(pos,
ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin); ar->drawrct.xmin - ar->winrct.xmin,
ar->drawrct.ymin - ar->winrct.ymin,
ar->drawrct.xmax - ar->winrct.xmin,
ar->drawrct.ymax - ar->winrct.ymin);
immUnbindProgram(); immUnbindProgram();
GPU_blend(false); GPU_blend(false);
#endif #endif

View File

@ -3660,8 +3660,10 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
RV3D_ORTHO); RV3D_ORTHO);
/* forcing camera is distracting */ /* forcing camera is distracting */
#if 0 #if 0
if (v3d->camera) region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB); if (v3d->camera)
else region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_USER, RV3D_PERSP); region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB);
else
region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_USER, RV3D_PERSP);
#else #else
(void)v3d; (void)v3d;
#endif #endif

View File

@ -89,8 +89,7 @@ static void workspace_change_update(WorkSpace *workspace_new,
/* needs to be done before changing mode! (to ensure right context) */ /* needs to be done before changing mode! (to ensure right context) */
UNUSED_VARS(workspace_old, workspace_new, C, wm); UNUSED_VARS(workspace_old, workspace_new, C, wm);
#if 0 #if 0
Object *ob_act = CTX_data_active_object(C) Object *ob_act = CTX_data_active_object(C) eObjectMode mode_old = workspace_old->object_mode;
eObjectMode mode_old = workspace_old->object_mode;
eObjectMode mode_new = workspace_new->object_mode; eObjectMode mode_new = workspace_new->object_mode;
if (mode_old != mode_new) { if (mode_old != mode_new) {

View File

@ -632,9 +632,15 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
/* duplicate warning, see texpaint_init */ /* duplicate warning, see texpaint_init */
#if 0 #if 0
if (pop->s.warnmultifile) if (pop->s.warnmultifile)
BKE_reportf(op->reports, RPT_WARNING, "Image requires 4 color channels to paint: %s", pop->s.warnmultifile); BKE_reportf(op->reports,
RPT_WARNING,
"Image requires 4 color channels to paint: %s",
pop->s.warnmultifile);
if (pop->s.warnpackedfile) if (pop->s.warnpackedfile)
BKE_reportf(op->reports, RPT_WARNING, "Packed MultiLayer files cannot be painted: %s", pop->s.warnpackedfile); BKE_reportf(op->reports,
RPT_WARNING,
"Packed MultiLayer files cannot be painted: %s",
pop->s.warnpackedfile);
#endif #endif
MEM_freeN(pop); MEM_freeN(pop);
} }

View File

@ -2351,8 +2351,10 @@ static float angle_2d_clockwise(const float p1[2], const float p2[2], const floa
{ {
float v1[2], v2[2]; float v1[2], v2[2];
v1[0] = p1[0] - p2[0]; v1[1] = p1[1] - p2[1]; v1[0] = p1[0] - p2[0];
v2[0] = p3[0] - p2[0]; v2[1] = p3[1] - p2[1]; v1[1] = p1[1] - p2[1];
v2[0] = p3[0] - p2[0];
v2[1] = p3[1] - p2[1];
return -atan2f(v1[0] * v2[1] - v1[1] * v2[0], v1[0] * v2[0] + v1[1] * v2[1]); return -atan2f(v1[0] * v2[1] - v1[1] * v2[0], v1[0] * v2[0] + v1[1] * v2[1]);
} }
@ -3035,8 +3037,7 @@ static void project_paint_face_init(const ProjPaintState *ps,
if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) { if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) {
#if 0 #if 0
project_paint_undo_tiles_init( project_paint_undo_tiles_init(
&bounds_px, ps->projImages + image_index, tmpibuf, &bounds_px, ps->projImages + image_index, tmpibuf, tile_width, threaded, ps->do_masking);
tile_width, threaded, ps->do_masking);
#endif #endif
/* clip face and */ /* clip face and */

View File

@ -417,7 +417,8 @@ static void paint_undosys_step_decode_restore_ids(ImageUndoStep *us)
{ {
ID *image_prev[2] = {NULL}; ID *image_prev[2] = {NULL};
for (UndoImageTile *tile = us->tiles.first; tile; tile = tile->next) { for (UndoImageTile *tile = us->tiles.first; tile; tile = tile->next) {
tile->ima = (Image *)BKE_undosys_ID_map_lookup_with_prev(us->id_map, &tile->ima->id, image_prev); tile->ima = (Image *)BKE_undosys_ID_map_lookup_with_prev(
us->id_map, &tile->ima->id, image_prev);
} }
} }
#endif #endif

View File

@ -479,8 +479,7 @@ static void paint_brush_stroke_add_step(bContext *C,
if (tablet && (pressure >= 0.99f) && if (tablet && (pressure >= 0.99f) &&
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
BKE_brush_use_alpha_pressure(scene, pop->s.brush) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) ||
BKE_brush_use_size_pressure(scene, pop->s.brush))) BKE_brush_use_size_pressure(scene, pop->s.brush))) {
{
return; return;
} }
@ -493,8 +492,7 @@ static void paint_brush_stroke_add_step(bContext *C,
if (tablet && (pressure < 0.0002f) && if (tablet && (pressure < 0.0002f) &&
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
BKE_brush_use_alpha_pressure(scene, pop->s.brush) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) ||
BKE_brush_use_size_pressure(scene, pop->s.brush))) BKE_brush_use_size_pressure(scene, pop->s.brush))) {
{
return; return;
} }
#endif #endif

View File

@ -565,9 +565,11 @@ static void do_weight_paint_normalize_all_locked_try_active(MDeformVert *dvert,
} }
#if 0 /* UNUSED */ #if 0 /* UNUSED */
static bool has_unselected_unlocked_bone_group( static bool has_unselected_unlocked_bone_group(int defbase_tot,
int defbase_tot, bool *defbase_sel, int selected, bool *defbase_sel,
const bool *lock_flags, const bool *vgroup_validmap) int selected,
const bool *lock_flags,
const bool *vgroup_validmap)
{ {
int i; int i;
if (defbase_tot == selected) { if (defbase_tot == selected) {

View File

@ -676,7 +676,10 @@ static float frontface(const Brush *br,
#if 0 #if 0
static bool sculpt_brush_test_cyl(SculptBrushTest *test, float co[3], float location[3], const float area_no[3]) static bool sculpt_brush_test_cyl(SculptBrushTest *test,
float co[3],
float location[3],
const float area_no[3])
{ {
if (sculpt_brush_test_sphere_fast(test, co)) { if (sculpt_brush_test_sphere_fast(test, co)) {
float t1[3], t2[3], t3[3], dist; float t1[3], t2[3], t3[3], dist;

View File

@ -275,8 +275,7 @@ static void box_select_action(bAnimContext *ac, const rcti rect, short mode, sho
/* loop over data selecting */ /* loop over data selecting */
switch (ale->type) { switch (ale->type) {
#if 0 /* XXX: Keyframes are not currently shown here */ #if 0 /* XXX: Keyframes are not currently shown here */
case ANIMTYPE_GPDATABLOCK: case ANIMTYPE_GPDATABLOCK: {
{
bGPdata *gpd = ale->data; bGPdata *gpd = ale->data;
bGPDlayer *gpl; bGPDlayer *gpl;
for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
@ -478,8 +477,7 @@ static void region_select_action_keys(
/* loop over data selecting */ /* loop over data selecting */
switch (ale->type) { switch (ale->type) {
#if 0 /* XXX: Keyframes are not currently shown here */ #if 0 /* XXX: Keyframes are not currently shown here */
case ANIMTYPE_GPDATABLOCK: case ANIMTYPE_GPDATABLOCK: {
{
bGPdata *gpd = ale->data; bGPdata *gpd = ale->data;
bGPDlayer *gpl; bGPDlayer *gpl;
for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {

View File

@ -144,14 +144,12 @@ static void console_lb_debug__internal(ListBase *lb)
for (cl = lb->first; cl; cl = cl->next) for (cl = lb->first; cl; cl = cl->next)
printf("<%s> ", cl->line); printf("<%s> ", cl->line);
printf("\n"); printf("\n");
} }
static void console_history_debug(const bContext *C) static void console_history_debug(const bContext *C)
{ {
SpaceConsole *sc = CTX_wm_space_console(C); SpaceConsole *sc = CTX_wm_space_console(C);
console_lb_debug__internal(&sc->history); console_lb_debug__internal(&sc->history);
} }
#endif #endif

View File

@ -2420,11 +2420,13 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
BLI_assert(filelist->filelist.entries == NULL); BLI_assert(filelist->filelist.entries == NULL);
if (filelist->filelist.root[0] == '/') filelist->filelist.root[0] = '\0'; if (filelist->filelist.root[0] == '/')
filelist->filelist.root[0] = '\0';
if (filelist->filelist.root[0]) { if (filelist->filelist.root[0]) {
idcode = groupname_to_code(filelist->filelist.root); idcode = groupname_to_code(filelist->filelist.root);
if (idcode == 0) filelist->filelist.root[0] = '\0'; if (idcode == 0)
filelist->filelist.root[0] = '\0';
} }
if (filelist->dir[0] == 0) { if (filelist->dir[0] == 0) {
@ -2472,7 +2474,8 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
idcode = groupname_to_code(filelist->filelist.root); idcode = groupname_to_code(filelist->filelist.root);
lb = which_libbase(bmain, idcode); lb = which_libbase(bmain, idcode);
if (lb == NULL) return; if (lb == NULL)
return;
filelist->filelist.nbr_entries = 0; filelist->filelist.nbr_entries = 0;
for (id = lb->first; id; id = id->next) { for (id = lb->first; id; id = id->next) {
@ -2526,7 +2529,8 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
// files->entry->nr = totbl + 1; // files->entry->nr = totbl + 1;
files->entry->poin = id; files->entry->poin = id;
fake = id->flag & LIB_FAKEUSER; fake = id->flag & LIB_FAKEUSER;
if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) { if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO ||
idcode == ID_IM) {
files->typeflag |= FILE_TYPE_IMAGE; files->typeflag |= FILE_TYPE_IMAGE;
} }
// if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us); // if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us);
@ -2535,7 +2539,8 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
// else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us); // else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us);
if (id->lib) { if (id->lib) {
if (totlib == 0) firstlib = files; if (totlib == 0)
firstlib = files;
totlib++; totlib++;
} }

View File

@ -191,7 +191,8 @@ void image_preview_event(int event)
BIF_store_spare(); BIF_store_spare();
/* 1 is do_previews */ /* 1 is do_previews */
ntreeCompositExecTree(scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings); ntreeCompositExecTree(
scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings);
G.scene->nodetree->timecursor = NULL; G.scene->nodetree->timecursor = NULL;
G.scene->nodetree->test_break = NULL; G.scene->nodetree->test_break = NULL;
@ -203,7 +204,6 @@ void image_preview_event(int event)
} }
} }
/* nothing drawn here, we use it to store values */ /* nothing drawn here, we use it to store values */
static void preview_cb(ScrArea *sa, struct uiBlock *block) static void preview_cb(ScrArea *sa, struct uiBlock *block)
{ {
@ -221,7 +221,11 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block)
/* while dragging we need to update the rects, otherwise it doesn't end with correct one */ /* while dragging we need to update the rects, otherwise it doesn't end with correct one */
BLI_rctf_init(&dispf, 15.0f, BLI_rcti_size_x(&block->rect) - 15.0f, 15.0f, (BLI_rctf_size_y(&block->rect)) - 15.0f); BLI_rctf_init(&dispf,
15.0f,
BLI_rcti_size_x(&block->rect) - 15.0f,
15.0f,
(BLI_rctf_size_y(&block->rect)) - 15.0f);
ui_graphics_to_window_rct(sa->win, &dispf, disprect); ui_graphics_to_window_rct(sa->win, &dispf, disprect);
/* correction for gla draw */ /* correction for gla draw */
@ -230,9 +234,11 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block)
calc_image_view(sima, 'p'); calc_image_view(sima, 'p');
// printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax); // printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax);
/* map to image space coordinates */ /* map to image space coordinates */
mval[0] = disprect->xmin; mval[1] = disprect->ymin; mval[0] = disprect->xmin;
mval[1] = disprect->ymin;
areamouseco_to_ipoco(v2d, mval, &dispf.xmin, &dispf.ymin); areamouseco_to_ipoco(v2d, mval, &dispf.xmin, &dispf.ymin);
mval[0] = disprect->xmax; mval[1] = disprect->ymax; mval[0] = disprect->xmax;
mval[1] = disprect->ymax;
areamouseco_to_ipoco(v2d, mval, &dispf.xmax, &dispf.ymax); areamouseco_to_ipoco(v2d, mval, &dispf.xmax, &dispf.ymax);
/* map to render coordinates */ /* map to render coordinates */
@ -246,7 +252,6 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block)
CLAMP(disprect->ymin, 0, winy); CLAMP(disprect->ymin, 0, winy);
CLAMP(disprect->ymax, 0, winy); CLAMP(disprect->ymax, 0, winy);
// printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax); // printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax);
} }
static bool is_preview_allowed(ScrArea *cur) static bool is_preview_allowed(ScrArea *cur)
@ -268,7 +273,6 @@ static bool is_preview_allowed(ScrArea *cur)
return 1; return 1;
} }
static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW
{ {
uiBlock *block; uiBlock *block;
@ -287,10 +291,10 @@ static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PRE
ofsx = -150 + (sa->winx / 2) / sima->blockscale; ofsx = -150 + (sa->winx / 2) / sima->blockscale;
ofsy = -100 + (sa->winy / 2) / sima->blockscale; ofsy = -100 + (sa->winy / 2) / sima->blockscale;
if (uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200) == 0) return; if (uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200) == 0)
return;
UI_but_func_drawextra_set(block, preview_cb); UI_but_func_drawextra_set(block, preview_cb);
} }
#endif #endif
@ -1063,17 +1067,73 @@ void uiTemplateImage(uiLayout *layout,
iuser = ntree_get_active_iuser(scene->nodetree); iuser = ntree_get_active_iuser(scene->nodetree);
if (iuser) { if (iuser) {
UI_block_align_begin(block); UI_block_align_begin(block);
uiDefIconTextBut(block, UI_BTYPE_BUT, B_SIMA_RECORD, ICON_REC, "Record", 10, 120, 100, 20, 0, 0, 0, 0, 0, ""); uiDefIconTextBut(block,
uiDefIconTextBut(block, UI_BTYPE_BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110, 120, 100, 20, 0, 0, 0, 0, 0, ""); UI_BTYPE_BUT,
but = uiDefBut(block, UI_BTYPE_BUT, B_NOP, "Free Cache", 210, 120, 100, 20, 0, 0, 0, 0, 0, ""); B_SIMA_RECORD,
ICON_REC,
"Record",
10,
120,
100,
20,
0,
0,
0,
0,
0,
"");
uiDefIconTextBut(block,
UI_BTYPE_BUT,
B_SIMA_PLAY,
ICON_PLAY,
"Play",
110,
120,
100,
20,
0,
0,
0,
0,
0,
"");
but = uiDefBut(
block, UI_BTYPE_BUT, B_NOP, "Free Cache", 210, 120, 100, 20, 0, 0, 0, 0, 0, "");
UI_but_func_set(but, image_freecache_cb, ima, NULL); UI_but_func_set(but, image_freecache_cb, ima, NULL);
if (iuser->frames) if (iuser->frames)
BLI_snprintf(str, sizeof(str), "(%d) Frames:", iuser->framenr); BLI_snprintf(str, sizeof(str), "(%d) Frames:", iuser->framenr);
else strcpy(str, "Frames:"); else
strcpy(str, "Frames:");
UI_block_align_begin(block); UI_block_align_begin(block);
uiDefButI(block, UI_BTYPE_NUM, imagechanged, str, 10, 90, 150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use"); uiDefButI(block,
uiDefButI(block, UI_BTYPE_NUM, imagechanged, "StartFr:", 160, 90, 150, 20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie"); UI_BTYPE_NUM,
imagechanged,
str,
10,
90,
150,
20,
&iuser->frames,
0.0,
MAXFRAMEF,
0,
0,
"Number of images of a movie to use");
uiDefButI(block,
UI_BTYPE_NUM,
imagechanged,
"StartFr:",
160,
90,
150,
20,
&iuser->sfra,
1.0,
MAXFRAMEF,
0,
0,
"Global starting frame of the movie");
} }
#endif #endif
} }

View File

@ -3650,8 +3650,12 @@ static int image_record_composite_apply(bContext *C, wmOperator *op)
BKE_image_all_free_anim_ibufs(scene->r.cfra); BKE_image_all_free_anim_ibufs(scene->r.cfra);
ntreeCompositTagAnimated(scene->nodetree); ntreeCompositTagAnimated(scene->nodetree);
ntreeCompositExecTree(scene->nodetree, &scene->r, 0, scene->r.cfra != rcd->old_cfra, ntreeCompositExecTree(scene->nodetree,
&scene->view_settings, &scene->display_settings); /* 1 is no previews */ &scene->r,
0,
scene->r.cfra != rcd->old_cfra,
&scene->view_settings,
&scene->display_settings); /* 1 is no previews */
ED_area_tag_redraw(CTX_wm_area(C)); ED_area_tag_redraw(CTX_wm_area(C));
@ -3714,7 +3718,8 @@ static int image_record_composite_exec(bContext *C, wmOperator *op)
if (!image_record_composite_init(C, op)) if (!image_record_composite_init(C, op))
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
while (image_record_composite_apply(C, op)) {} while (image_record_composite_apply(C, op)) {
}
image_record_composite_exit(C, op); image_record_composite_exit(C, op);

View File

@ -745,7 +745,8 @@ static void image_main_region_draw(const bContext *C, ARegion *ar)
/* scrollers? */ /* scrollers? */
#if 0 #if 0
scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); scrollers = UI_view2d_scrollers_calc(
C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
UI_view2d_scrollers_draw(C, v2d, scrollers); UI_view2d_scrollers_draw(C, v2d, scrollers);
UI_view2d_scrollers_free(scrollers); UI_view2d_scrollers_free(scrollers);
#endif #endif

View File

@ -46,11 +46,16 @@ int info_report_mask(SpaceInfo *UNUSED(sinfo))
#if 0 #if 0
int report_mask = 0; int report_mask = 0;
if (sinfo->rpt_mask & INFO_RPT_DEBUG) report_mask |= RPT_DEBUG_ALL; if (sinfo->rpt_mask & INFO_RPT_DEBUG)
if (sinfo->rpt_mask & INFO_RPT_INFO) report_mask |= RPT_INFO_ALL; report_mask |= RPT_DEBUG_ALL;
if (sinfo->rpt_mask & INFO_RPT_OP) report_mask |= RPT_OPERATOR_ALL; if (sinfo->rpt_mask & INFO_RPT_INFO)
if (sinfo->rpt_mask & INFO_RPT_WARN) report_mask |= RPT_WARNING_ALL; report_mask |= RPT_INFO_ALL;
if (sinfo->rpt_mask & INFO_RPT_ERR) report_mask |= RPT_ERROR_ALL; if (sinfo->rpt_mask & INFO_RPT_OP)
report_mask |= RPT_OPERATOR_ALL;
if (sinfo->rpt_mask & INFO_RPT_WARN)
report_mask |= RPT_WARNING_ALL;
if (sinfo->rpt_mask & INFO_RPT_ERR)
report_mask |= RPT_ERROR_ALL;
return report_mask; return report_mask;
#endif #endif
@ -71,10 +76,8 @@ static int report_replay_exec(bContext *C, wmOperator *UNUSED(op))
sc->type = CONSOLE_TYPE_PYTHON; sc->type = CONSOLE_TYPE_PYTHON;
for (report = reports->list.last; report; report = report->prev) { for (report = reports->list.last; report; report = report->prev) {
if ((report->type & report_mask) && if ((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) &&
(report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) && (report->flag & SELECT)) {
(report->flag & SELECT))
{
console_history_add_str(sc, report->message, 0); console_history_add_str(sc, report->message, 0);
WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL); WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL);

View File

@ -204,7 +204,8 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
bNode *node = node_v; bNode *node = node_v;
Tex *tex; Tex *tex;
if (node->menunr < 1) return; if (node->menunr < 1)
return;
if (node->id) { if (node->id) {
id_us_min(node->id); id_us_min(node->id);

View File

@ -804,7 +804,8 @@ static int edit_node_invoke_properties(bContext *C, wmOperator *op)
return 1; return 1;
} }
static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **rnode, bNodeSocket **rsock, int *rin_out) static void edit_node_properties_get(
wmOperator *op, bNodeTree *ntree, bNode **rnode, bNodeSocket **rsock, int *rin_out)
{ {
bNode *node; bNode *node;
bNodeSocket *sock = NULL; bNodeSocket *sock = NULL;
@ -819,8 +820,12 @@ static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **r
sockindex = RNA_int_get(op->ptr, "socket"); sockindex = RNA_int_get(op->ptr, "socket");
switch (in_out) { switch (in_out) {
case SOCK_IN: sock = BLI_findlink(&node->inputs, sockindex); break; case SOCK_IN:
case SOCK_OUT: sock = BLI_findlink(&node->outputs, sockindex); break; sock = BLI_findlink(&node->inputs, sockindex);
break;
case SOCK_OUT:
sock = BLI_findlink(&node->outputs, sockindex);
break;
} }
if (rnode) if (rnode)

View File

@ -1296,8 +1296,8 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot)
#if 0 #if 0
/* find next element that has this name */ /* find next element that has this name */
static TreeElement *outliner_find_name(SpaceOutliner *soops, ListBase *lb, char *name, int flags, static TreeElement *outliner_find_name(
TreeElement *prev, int *prevFound) SpaceOutliner *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
{ {
TreeElement *te, *tes; TreeElement *te, *tes;
@ -1318,14 +1318,16 @@ static TreeElement *outliner_find_name(SpaceOutliner *soops, ListBase *lb, char
} }
tes = outliner_find_name(soops, &te->subtree, name, flags, prev, prevFound); tes = outliner_find_name(soops, &te->subtree, name, flags, prev, prevFound);
if (tes) return tes; if (tes)
return tes;
} }
/* nothing valid found */ /* nothing valid found */
return NULL; return NULL;
} }
static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner *soops, int again, int flags) static void outliner_find_panel(
Scene *UNUSED(scene), ARegion *ar, SpaceOutliner *soops, int again, int flags)
{ {
ReportList *reports = NULL; // CTX_wm_reports(C); ReportList *reports = NULL; // CTX_wm_reports(C);
TreeElement *te = NULL; TreeElement *te = NULL;
@ -1374,7 +1376,8 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner
/* make te->ys center of view */ /* make te->ys center of view */
ytop = (int)(te->ys + BLI_rctf_size_y(&ar->v2d.mask) / 2); ytop = (int)(te->ys + BLI_rctf_size_y(&ar->v2d.mask) / 2);
if (ytop > 0) ytop = 0; if (ytop > 0)
ytop = 0;
ar->v2d.cur.ymax = (float)ytop; ar->v2d.cur.ymax = (float)ytop;
ar->v2d.cur.ymin = (float)(ytop - BLI_rctf_size_y(&ar->v2d.mask)); ar->v2d.cur.ymin = (float)(ytop - BLI_rctf_size_y(&ar->v2d.mask));

View File

@ -372,9 +372,12 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index); soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index);
#if 0 /* disabled as it needs to be reworked for recoded constraints system */ #if 0 /* disabled as it needs to be reworked for recoded constraints system */
target = get_constraint_target(con, &str); target = get_constraint_target(con, &str);
if (str && str[0]) ten1->name = str; if (str && str[0])
else if (target) ten1->name = target->id.name + 2; ten1->name = str;
else ten1->name = con->name; else if (target)
ten1->name = target->id.name + 2;
else
ten1->name = con->name;
#endif #endif
ten1->name = con->name; ten1->name = con->name;
ten1->directdata = con; ten1->directdata = con;
@ -434,9 +437,12 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
ten = outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_CONSTRAINT, a); ten = outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_CONSTRAINT, a);
#if 0 /* disabled due to constraints system targets recode... code here needs review */ #if 0 /* disabled due to constraints system targets recode... code here needs review */
target = get_constraint_target(con, &str); target = get_constraint_target(con, &str);
if (str && str[0]) ten->name = str; if (str && str[0])
else if (target) ten->name = target->id.name + 2; ten->name = str;
else ten->name = con->name; else if (target)
ten->name = target->id.name + 2;
else
ten->name = con->name;
#endif #endif
ten->name = con->name; ten->name = con->name;
ten->directdata = con; ten->directdata = con;
@ -1548,15 +1554,20 @@ static int treesort_obtype_alpha(const void *v1, const void *v2)
else { else {
/* 2nd we check ob type */ /* 2nd we check ob type */
if (x1->idcode == ID_OB && x2->idcode == ID_OB) { if (x1->idcode == ID_OB && x2->idcode == ID_OB) {
if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1; if (((Object *)x1->id)->type > ((Object *)x2->id)->type)
else if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1; return 1;
else return 0; else if (((Object *)x1->id)->type > ((Object *)x2->id)->type)
return -1;
else
return 0;
} }
else { else {
int comp = strcmp(x1->name, x2->name); int comp = strcmp(x1->name, x2->name);
if (comp > 0) return 1; if (comp > 0)
else if (comp < 0) return -1; return 1;
else if (comp < 0)
return -1;
return 0; return 0;
} }
} }

View File

@ -1201,13 +1201,19 @@ void sequencer_draw_maskedit(const bContext *C, Scene *scene, ARegion *ar, Space
width = (scene->r.size * scene->r.xsch) / 100; width = (scene->r.size * scene->r.xsch) / 100;
height = (scene->r.size * scene->r.ysch) / 100; height = (scene->r.size * scene->r.ysch) / 100;
ED_mask_draw_region( ED_mask_draw_region(mask,
mask, ar, ar,
0, 0, 0, /* TODO */ 0,
width, height, 0,
aspx, aspy, 0, /* TODO */
false, true, width,
NULL, C); height,
aspx,
aspy,
false,
true,
NULL,
C);
} }
} }
} }
@ -1623,9 +1629,7 @@ void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq)
recty = (render_size * scene->r.ysch) / 100; recty = (render_size * scene->r.ysch) / 100;
if (sseq->mainb != SEQ_DRAW_SEQUENCE) { if (sseq->mainb != SEQ_DRAW_SEQUENCE) {
give_ibuf_prefetch_request( give_ibuf_prefetch_request(rectx, recty, (scene->r.cfra), sseq->chanshown, proxy_size);
rectx, recty, (scene->r.cfra), sseq->chanshown,
proxy_size);
} }
} }
#endif #endif

View File

@ -1036,22 +1036,22 @@ static void set_filter_seq(Scene *scene)
Sequence *seq; Sequence *seq;
Editing *ed = BKE_sequencer_editing_get(scene, false); Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed == NULL)
return;
if (ed == NULL) return; if (okee("Set Deinterlace") == 0)
return;
if (okee("Set Deinterlace") == 0) return; SEQP_BEGIN (ed, seq) {
SEQP_BEGIN (ed, seq)
{
if (seq->flag & SELECT) { if (seq->flag & SELECT) {
if (seq->type == SEQ_TYPE_MOVIE) { if (seq->type == SEQ_TYPE_MOVIE) {
seq->flag |= SEQ_FILTERY; seq->flag |= SEQ_FILTERY;
BKE_sequence_reload_new_file(scene, seq, false); BKE_sequence_reload_new_file(scene, seq, false);
BKE_sequence_calc(scene, seq); BKE_sequence_calc(scene, seq);
} }
} }
} SEQ_END; }
SEQ_END;
} }
#endif #endif
@ -1228,7 +1228,8 @@ bool sequencer_edit_poll(bContext *C)
bool sequencer_strip_poll(bContext *C) bool sequencer_strip_poll(bContext *C)
{ {
Editing *ed; Editing *ed;
return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), false)) != NULL) && (ed->act_seq != NULL)); return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), false)) != NULL) &&
(ed->act_seq != NULL));
} }
#endif #endif
@ -2886,9 +2887,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
/* Apply aspect, dosnt need to be that accurate */ /* Apply aspect, dosnt need to be that accurate */
imgwidth = (int)(imgwidth * (scene->r.xasp / scene->r.yasp)); imgwidth = (int)(imgwidth * (scene->r.xasp / scene->r.yasp));
if (((imgwidth >= width) || (imgheight >= height)) && if (((imgwidth >= width) || (imgheight >= height)) && ((width > 0) && (height > 0))) {
((width > 0) && (height > 0)))
{
/* Find the zoom value that will fit the image in the image space */ /* Find the zoom value that will fit the image in the image space */
zoomX = ((float)width) / ((float)imgwidth); zoomX = ((float)width) / ((float)imgwidth);
zoomY = ((float)height) / ((float)imgheight); zoomY = ((float)height) / ((float)imgheight);
@ -2967,7 +2966,11 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot)
static const EnumPropertyItem view_type_items[] = { static const EnumPropertyItem view_type_items[] = {
{SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""}, {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
{SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""}, {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
{SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SEQUENCER, "Sequencer and Image Preview", ""}, {SEQ_VIEW_SEQUENCE_PREVIEW,
"SEQUENCER_PREVIEW",
ICON_SEQ_SEQUENCER,
"Sequencer and Image Preview",
""},
{0, NULL, 0, NULL, NULL}, {0, NULL, 0, NULL, NULL},
}; };
#endif #endif
@ -3169,7 +3172,8 @@ static Sequence *sequence_find_parent(Scene *scene, Sequence *child)
Sequence *parent = NULL; Sequence *parent = NULL;
Sequence *seq; Sequence *seq;
if (ed == NULL) return NULL; if (ed == NULL)
return NULL;
for (seq = ed->seqbasep->first; seq; seq = seq->next) { for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if ((seq != child) && seq_is_parent(seq, child)) { if ((seq != child) && seq_is_parent(seq, child)) {

View File

@ -107,7 +107,8 @@ static void txt_format_text(SpaceText *st)
{ {
TextLine *linep; TextLine *linep;
if (!st->text) return; if (!st->text)
return;
for (linep = st->text->lines.first; linep; linep = linep->next) for (linep = st->text->lines.first; linep; linep = linep->next)
txt_format_line(st, linep, 0); txt_format_line(st, linep, 0);
@ -989,18 +990,23 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
int i, br, lines; int i, br, lines;
int boxw, boxh, l, x, y /* , top */ /* UNUSED */; int boxw, boxh, l, x, y /* , top */ /* UNUSED */;
if (!st || !st->text) return; if (!st || !st->text)
if (!texttool_text_is_active(st->text)) return; return;
if (!texttool_text_is_active(st->text))
return;
docs = texttool_docs_get(); docs = texttool_docs_get();
if (!docs) return; if (!docs)
return;
text_draw_context_init(st, &tdc); text_draw_context_init(st, &tdc);
/* Count the visible lines to the cursor */ /* Count the visible lines to the cursor */
for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) ; for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++)
if (l < 0) return; ;
if (l < 0)
return;
if (st->showlinenrs) { if (st->showlinenrs) {
x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET + TEXTXLOC - 4; x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET + TEXTXLOC - 4;
@ -1017,7 +1023,8 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
boxh = (DOC_HEIGHT + 1) * (st->lheight_dpi + TXT_LINE_SPACING); boxh = (DOC_HEIGHT + 1) * (st->lheight_dpi + TXT_LINE_SPACING);
/* Draw panel */ /* Draw panel */
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformThemeColor(TH_BACK); immUniformThemeColor(TH_BACK);
@ -1044,9 +1051,12 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
UI_FontThemeColor(tdc.font_id, TH_TEXT); UI_FontThemeColor(tdc.font_id, TH_TEXT);
i = 0; br = DOC_WIDTH; lines = 0; // XXX -doc_scroll; i = 0;
br = DOC_WIDTH;
lines = 0; // XXX -doc_scroll;
for (p = docs; *p; p++) { for (p = docs; *p; p++) {
if (*p == '\r' && *(++p) != '\n') *(--p) = '\n'; /* Fix line endings */ if (*p == '\r' && *(++p) != '\n')
*(--p) = '\n'; /* Fix line endings */
if (*p == ' ' || *p == '\t') if (*p == ' ' || *p == '\t')
br = i; br = i;
else if (*p == '\n') { else if (*p == '\n') {
@ -1055,7 +1065,9 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
y -= st->lheight_dpi; y -= st->lheight_dpi;
text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL); text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL);
} }
i = 0; br = DOC_WIDTH; lines++; i = 0;
br = DOC_WIDTH;
lines++;
} }
buf[i++] = *p; buf[i++] = *p;
if (i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */ if (i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */
@ -1065,9 +1077,12 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL); text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL);
} }
p -= i - br - 1; /* Rewind pointer to last break */ p -= i - br - 1; /* Rewind pointer to last break */
i = 0; br = DOC_WIDTH; lines++; i = 0;
br = DOC_WIDTH;
lines++;
} }
if (lines >= DOC_HEIGHT) break; if (lines >= DOC_HEIGHT)
break;
} }
} }
#endif #endif

View File

@ -195,13 +195,30 @@ void TEXT_OT_start_find(wmOperatorType *ot)
uiPopupMenu *pup; uiPopupMenu *pup;
pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE); pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"), uiItemEnumO(layout,
0, "type", FILE_TOP); "TEXT_OT_move",
uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"), CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
0, "type", FILE_BOTTOM); 0,
uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"), 0, "type", PREV_PAGE); "type",
uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"), FILE_TOP);
0, "type", NEXT_PAGE); uiItemEnumO(layout,
"TEXT_OT_move",
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"),
0,
"type",
FILE_BOTTOM);
uiItemEnumO(layout,
"TEXT_OT_move",
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"),
0,
"type",
PREV_PAGE);
uiItemEnumO(layout,
"TEXT_OT_move",
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"),
0,
"type",
NEXT_PAGE);
UI_popup_menu_end(C, pup); UI_popup_menu_end(C, pup);
} }
#endif #endif

View File

@ -1646,7 +1646,8 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
#if 0 #if 0
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM); WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM); WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE); WM_modalkeymap_add_item(
keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
#endif #endif
/* assign map to operators */ /* assign map to operators */

View File

@ -498,7 +498,10 @@ void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3],
/* very similar to ED_view3d_win_to_3d() but has no advantage, de-duplicating */ /* very similar to ED_view3d_win_to_3d() but has no advantage, de-duplicating */
#if 0 #if 0
bool view3d_get_view_aligned_coordinate(ARegion *ar, float fp[3], const int mval[2], const bool do_fallback) bool view3d_get_view_aligned_coordinate(ARegion *ar,
float fp[3],
const int mval[2],
const bool do_fallback)
{ {
RegionView3D *rv3d = ar->regiondata; RegionView3D *rv3d = ar->regiondata;
float dvec[3]; float dvec[3];
@ -508,8 +511,7 @@ bool view3d_get_view_aligned_coordinate(ARegion *ar, float fp[3], const int mval
ret = ED_view3d_project_int_global(ar, fp, mval_cpy, V3D_PROJ_TEST_NOP); ret = ED_view3d_project_int_global(ar, fp, mval_cpy, V3D_PROJ_TEST_NOP);
if (ret == V3D_PROJ_RET_OK) { if (ret == V3D_PROJ_RET_OK) {
const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]), const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]), (float)(mval_cpy[1] - mval[1])};
(float)(mval_cpy[1] - mval[1])};
const float zfac = ED_view3d_calc_zfac(rv3d, fp, NULL); const float zfac = ED_view3d_calc_zfac(rv3d, fp, NULL);
ED_view3d_win_to_delta(ar, mval_f, dvec, zfac); ED_view3d_win_to_delta(ar, mval_f, dvec, zfac);
sub_v3_v3(fp, dvec); sub_v3_v3(fp, dvec);

View File

@ -1080,8 +1080,7 @@ static void do_lasso_select_node(int mcords[][2], short moves, const eSelectOp s
ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent); ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent);
const bool is_select = node->flag & SELECT; const bool is_select = node->flag & SELECT;
const bool is_inside = ( const bool is_inside = (BLI_rcti_isect_pt_v(&rect, node_cent) &&
BLI_rcti_isect_pt_v(&rect, node_cent) &&
BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1])); BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1]));
const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside); const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside);
if (sel_op_result != -1) { if (sel_op_result != -1) {

View File

@ -739,9 +739,16 @@ void view3d_winmatrix_set(Depsgraph *depsgraph, ARegion *ar, const View3D *v3d,
rv3d->is_persp = !is_ortho; rv3d->is_persp = !is_ortho;
#if 0 #if 0
printf("%s: %d %d %f %f %f %f %f %f\n", __func__, winx, winy, printf("%s: %d %d %f %f %f %f %f %f\n",
viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, __func__,
clipsta, clipend); winx,
winy,
viewplane.xmin,
viewplane.ymin,
viewplane.xmax,
viewplane.ymax,
clipsta,
clipend);
#endif #endif
if (rect) { /* picking */ if (rect) { /* picking */

View File

@ -6731,7 +6731,8 @@ static BMLoop *get_next_loop(
cross_v3_v3v3(vec_accum, l_tmp->f->no, tdir); cross_v3_v3v3(vec_accum, l_tmp->f->no, tdir);
#if 0 #if 0
/* rough guess, we can do better! */ /* rough guess, we can do better! */
normalize_v3_length(vec_accum, (BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f); normalize_v3_length(vec_accum,
(BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f);
#else #else
/* be clever, check the opposite ngon edge to slide into. /* be clever, check the opposite ngon edge to slide into.
* this gives best results */ * this gives best results */

View File

@ -6932,7 +6932,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
#if 0 #if 0
if (ELEM(t->frame_side, 'L', 'R')) { /* TFM_TIME_EXTEND */ if (ELEM(t->frame_side, 'L', 'R')) { /* TFM_TIME_EXTEND */
/* same as below */ /* same as below */
ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side); ED_markers_post_apply_transform(
ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side);
} }
else /* TFM_TIME_TRANSLATE */ else /* TFM_TIME_TRANSLATE */
#endif #endif

View File

@ -587,8 +587,7 @@ static unsigned int bm_mesh_edges_select_get_n(BMesh *bm, BMEdge **elems, const
static unsigned int bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const unsigned int n) static unsigned int bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const unsigned int n)
{ {
return bm_mesh_elems_select_get_n__internal( return bm_mesh_elems_select_get_n__internal(
bm, (BMElem **)elems, min_ii(n, bm->totfacesel), bm, (BMElem **)elems, min_ii(n, bm->totfacesel), BM_FACES_OF_MESH, BM_FACE);
BM_FACES_OF_MESH, BM_FACE);
} }
#endif #endif

View File

@ -2649,8 +2649,10 @@ static int uv_mouse_select_multi(
/* before bmesh */ /* before bmesh */
#if 0 #if 0
if (ts->selectmode != SCE_SELECT_FACE) { if (ts->selectmode != SCE_SELECT_FACE) {
if (flush == 1) EDBM_select_flush(em); if (flush == 1)
else if (flush == -1) EDBM_deselect_flush(em); EDBM_select_flush(em);
else if (flush == -1)
EDBM_deselect_flush(em);
} }
#else #else
if (flush != 0) { if (flush != 0) {

Some files were not shown because too many files have changed in this diff Show More