ClangFormat: format '#if 0' code in source/
This commit is contained in:
parent
108045faa0
commit
41d4a19865
|
@ -61,7 +61,10 @@ struct bSound *BKE_sound_new_file_exists(struct Main *bmain, const char *filepat
|
|||
#if 0
|
||||
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
|
||||
|
||||
void BKE_sound_cache(struct bSound *sound);
|
||||
|
|
|
@ -187,7 +187,9 @@ void BKE_undosys_type_free_all(void);
|
|||
|
||||
/* ID Accessor */
|
||||
#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
|
||||
|
||||
/* Use when the undo step stores many arbitrary pointers. */
|
||||
|
|
|
@ -869,8 +869,7 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph, Object *object,
|
|||
* around for the time while proxies are evaluating.
|
||||
*/
|
||||
#if 0
|
||||
bPoseChannel *pchan_from = pose_pchan_get_indexed(
|
||||
object->proxy_from, pchan_index);
|
||||
bPoseChannel *pchan_from = pose_pchan_get_indexed(object->proxy_from, pchan_index);
|
||||
#else
|
||||
bPoseChannel *pchan_from = BKE_pose_channel_find_name(object->proxy_from->pose, pchan->name);
|
||||
#endif
|
||||
|
|
|
@ -1149,9 +1149,10 @@ void CDDM_calc_normals_mapping(DerivedMesh *dm)
|
|||
void CDDM_calc_normals(DerivedMesh *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 */
|
||||
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);
|
||||
}
|
||||
|
||||
BKE_mesh_calc_normals_poly(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm),
|
||||
dm->numLoopData, dm->numPolyData, poly_nors, false);
|
||||
BKE_mesh_calc_normals_poly(cddm->mvert,
|
||||
dm->numVertData,
|
||||
CDDM_get_loops(dm),
|
||||
CDDM_get_polys(dm),
|
||||
dm->numLoopData,
|
||||
dm->numPolyData,
|
||||
poly_nors,
|
||||
false);
|
||||
|
||||
cddm->dm.dirty &= ~DM_DIRTY_NORMALS;
|
||||
}
|
||||
|
|
|
@ -3064,10 +3064,18 @@ int dynamicPaint_createUVSurface(Scene *scene,
|
|||
|
||||
if (tempPoints[index].tri_index != -1) {
|
||||
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++) {
|
||||
int tgt = tmp[ed->n_target[ed->n_index[fidx]+i]];
|
||||
fprintf(dump_file, "%s%d,%d", i?" ":"", tgt%w, h-1-tgt/w);
|
||||
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, "\n");
|
||||
}
|
||||
|
|
|
@ -235,22 +235,28 @@ static const char *ob_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
return "color";
|
||||
#if 0
|
||||
case OB_PD_FSTR:
|
||||
if (ob->pd) poin = &(ob->pd->f_strength);
|
||||
if (ob->pd)
|
||||
poin = &(ob->pd->f_strength);
|
||||
break;
|
||||
case OB_PD_FFALL:
|
||||
if (ob->pd) poin = &(ob->pd->f_power);
|
||||
if (ob->pd)
|
||||
poin = &(ob->pd->f_power);
|
||||
break;
|
||||
case OB_PD_SDAMP:
|
||||
if (ob->pd) poin = &(ob->pd->pdef_damp);
|
||||
if (ob->pd)
|
||||
poin = &(ob->pd->pdef_damp);
|
||||
break;
|
||||
case OB_PD_RDAMP:
|
||||
if (ob->pd) poin = &(ob->pd->pdef_rdamp);
|
||||
if (ob->pd)
|
||||
poin = &(ob->pd->pdef_rdamp);
|
||||
break;
|
||||
case OB_PD_PERM:
|
||||
if (ob->pd) poin = &(ob->pd->pdef_perm);
|
||||
if (ob->pd)
|
||||
poin = &(ob->pd->pdef_perm);
|
||||
break;
|
||||
case OB_PD_FMAXD:
|
||||
if (ob->pd) poin = &(ob->pd->maxdist);
|
||||
if (ob->pd)
|
||||
poin = &(ob->pd->maxdist);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
@ -414,31 +420,44 @@ static const char *mtex_adrcodes_to_paths(int adrcode, int *UNUSED(array_index))
|
|||
switch (adrcode) {
|
||||
#if 0 // XXX these are not wrapped in RNA yet!
|
||||
case MAP_OFS_X:
|
||||
poin = &(mtex->ofs[0]); break;
|
||||
poin = &(mtex->ofs[0]);
|
||||
break;
|
||||
case MAP_OFS_Y:
|
||||
poin = &(mtex->ofs[1]); break;
|
||||
poin = &(mtex->ofs[1]);
|
||||
break;
|
||||
case MAP_OFS_Z:
|
||||
poin = &(mtex->ofs[2]); break;
|
||||
poin = &(mtex->ofs[2]);
|
||||
break;
|
||||
case MAP_SIZE_X:
|
||||
poin = &(mtex->size[0]); break;
|
||||
poin = &(mtex->size[0]);
|
||||
break;
|
||||
case MAP_SIZE_Y:
|
||||
poin = &(mtex->size[1]); break;
|
||||
poin = &(mtex->size[1]);
|
||||
break;
|
||||
case MAP_SIZE_Z:
|
||||
poin = &(mtex->size[2]); break;
|
||||
poin = &(mtex->size[2]);
|
||||
break;
|
||||
case MAP_R:
|
||||
poin = &(mtex->r); break;
|
||||
poin = &(mtex->r);
|
||||
break;
|
||||
case MAP_G:
|
||||
poin = &(mtex->g); break;
|
||||
poin = &(mtex->g);
|
||||
break;
|
||||
case MAP_B:
|
||||
poin = &(mtex->b); break;
|
||||
poin = &(mtex->b);
|
||||
break;
|
||||
case MAP_DVAR:
|
||||
poin = &(mtex->def_var); break;
|
||||
poin = &(mtex->def_var);
|
||||
break;
|
||||
case MAP_COLF:
|
||||
poin = &(mtex->colfac); break;
|
||||
poin = &(mtex->colfac);
|
||||
break;
|
||||
case MAP_NORF:
|
||||
poin = &(mtex->norfac); break;
|
||||
poin = &(mtex->norfac);
|
||||
break;
|
||||
case MAP_VARF:
|
||||
poin = &(mtex->varfac); break;
|
||||
poin = &(mtex->varfac);
|
||||
break;
|
||||
#endif
|
||||
case MAP_DISP:
|
||||
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
|
||||
case CAM_YF_APERT:
|
||||
poin = &(ca->YF_aperture); break;
|
||||
poin = &(ca->YF_aperture);
|
||||
break;
|
||||
case CAM_YF_FDIST:
|
||||
poin = &(ca->dof_distance); break;
|
||||
poin = &(ca->dof_distance);
|
||||
break;
|
||||
#endif // XXX these are not defined in RNA
|
||||
|
||||
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 */
|
||||
#if 0
|
||||
case PART_PD_FSTR:
|
||||
if (part->pd) poin = &(part->pd->f_strength);
|
||||
if (part->pd)
|
||||
poin = &(part->pd->f_strength);
|
||||
break;
|
||||
case PART_PD_FFALL:
|
||||
if (part->pd) poin = &(part->pd->f_power);
|
||||
if (part->pd)
|
||||
poin = &(part->pd->f_power);
|
||||
break;
|
||||
case PART_PD_FMAXD:
|
||||
if (part->pd) poin = &(part->pd->maxdist);
|
||||
if (part->pd)
|
||||
poin = &(part->pd->maxdist);
|
||||
break;
|
||||
case PART_PD2_FSTR:
|
||||
if (part->pd2) poin = &(part->pd2->f_strength);
|
||||
if (part->pd2)
|
||||
poin = &(part->pd2->f_strength);
|
||||
break;
|
||||
case PART_PD2_FFALL:
|
||||
if (part->pd2) poin = &(part->pd2->f_power);
|
||||
if (part->pd2)
|
||||
poin = &(part->pd2->f_power);
|
||||
break;
|
||||
case PART_PD2_FMAXD:
|
||||
if (part->pd2) poin = &(part->pd2->maxdist);
|
||||
if (part->pd2)
|
||||
poin = &(part->pd2->maxdist);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1240,9 +1240,15 @@ static int foreach_libblock_id_users_callback(void *user_data,
|
|||
|
||||
if (*id_p == iter->id) {
|
||||
#if 0
|
||||
printf("%s uses %s (refcounted: %d, userone: %d, used_one: %d, used_one_active: %d, 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,
|
||||
printf(
|
||||
"%s uses %s (refcounted: %d, userone: %d, used_one: %d, used_one_active: %d, "
|
||||
"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);
|
||||
#endif
|
||||
if (cb_flag & IDWALK_CB_INDIRECT_USAGE) {
|
||||
|
|
|
@ -879,7 +879,8 @@ void BKE_mask_layer_evaluate_animation(MaskLayer *masklay, const float ctime)
|
|||
__func__,
|
||||
(int)ctime,
|
||||
BLI_listbase_count(&masklay->splines_shapes),
|
||||
masklay_shape_a->frame, masklay_shape_b->frame);
|
||||
masklay_shape_a->frame,
|
||||
masklay_shape_b->frame);
|
||||
#endif
|
||||
BKE_mask_layer_shape_to_mask_interp(
|
||||
masklay, masklay_shape_a, masklay_shape_b, (ctime - masklay_shape_a->frame) / w);
|
||||
|
|
|
@ -1212,7 +1212,9 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle,
|
|||
/* 2D ray test */
|
||||
#if 0
|
||||
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];
|
||||
barycentric_weights_v2(v1, v2, v3, pt, w);
|
||||
|
@ -1240,10 +1242,7 @@ static float maskrasterize_layer_isect(unsigned int *face,
|
|||
|
||||
#if 0
|
||||
/* not essential but avoids unneeded extra lookups */
|
||||
if ((cos[0][2] < dist_orig) ||
|
||||
(cos[1][2] < dist_orig) ||
|
||||
(cos[2][2] < dist_orig))
|
||||
{
|
||||
if ((cos[0][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]])) {
|
||||
/* we know all tris are close for now */
|
||||
return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]);
|
||||
|
|
|
@ -1119,7 +1119,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon *common_data, LoopSpli
|
|||
|
||||
MLoopNorSpace *lnor_space = data->lnor_space;
|
||||
#if 0 /* Not needed for 'fan' loops. */
|
||||
float (*lnor)[3] = data->lnor;
|
||||
float(*lnor)[3] = data->lnor;
|
||||
#endif
|
||||
const MLoop *ml_curr = data->ml_curr;
|
||||
const MLoop *ml_prev = data->ml_prev;
|
||||
|
|
|
@ -431,7 +431,6 @@ static int pbvh_bmesh_node_offset_from_elem(PBVH *bvh, BMElem *ele)
|
|||
BLI_assert(ele->head.htype == BM_FACE);
|
||||
return bvh->cd_face_node_offset;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static int pbvh_bmesh_node_index_from_elem(PBVH *bvh, void *key)
|
||||
|
@ -543,7 +542,7 @@ static int pbvh_bmesh_node_vert_use_count(PBVH *bvh, PBVHNode *node, BMVert *v)
|
|||
BMFace *f;
|
||||
int count = 0;
|
||||
|
||||
BM_FACES_OF_VERT_ITER_BEGIN(f, v) {
|
||||
BM_FACES_OF_VERT_ITER_BEGIN (f, v) {
|
||||
PBVHNode *f_node = pbvh_bmesh_node_from_face(bvh, f);
|
||||
if (f_node == node) {
|
||||
count++;
|
||||
|
@ -2105,18 +2104,14 @@ static void pbvh_bmesh_print(PBVH *bvh)
|
|||
|
||||
BMIter iter;
|
||||
BMFace *f;
|
||||
BM_ITER_MESH(f, &iter, bvh->bm, BM_FACES_OF_MESH) {
|
||||
fprintf(stderr, " %d -> %d\n",
|
||||
BM_elem_index_get(f),
|
||||
pbvh_bmesh_node_index_from_face(bvh, f));
|
||||
BM_ITER_MESH (f, &iter, bvh->bm, BM_FACES_OF_MESH) {
|
||||
fprintf(stderr, " %d -> %d\n", BM_elem_index_get(f), pbvh_bmesh_node_index_from_face(bvh, f));
|
||||
}
|
||||
|
||||
fprintf(stderr, "bm_vert_to_node:\n");
|
||||
BMVert *v;
|
||||
BM_ITER_MESH(v, &iter, bvh->bm, BM_FACES_OF_MESH) {
|
||||
fprintf(stderr, " %d -> %d\n",
|
||||
BM_elem_index_get(v),
|
||||
pbvh_bmesh_node_index_from_vert(bvh, v));
|
||||
BM_ITER_MESH (v, &iter, bvh->bm, BM_FACES_OF_MESH) {
|
||||
fprintf(stderr, " %d -> %d\n", BM_elem_index_get(v), pbvh_bmesh_node_index_from_vert(bvh, v));
|
||||
}
|
||||
|
||||
for (int n = 0; n < bvh->totnode; n++) {
|
||||
|
@ -2127,16 +2122,13 @@ static void pbvh_bmesh_print(PBVH *bvh)
|
|||
GSetIterator gs_iter;
|
||||
fprintf(stderr, "node %d\n faces:\n", n);
|
||||
GSET_ITER (gs_iter, node->bm_faces)
|
||||
fprintf(stderr, " %d\n",
|
||||
BM_elem_index_get((BMFace *)BLI_gsetIterator_getKey(&gs_iter)));
|
||||
fprintf(stderr, " %d\n", BM_elem_index_get((BMFace *)BLI_gsetIterator_getKey(&gs_iter)));
|
||||
fprintf(stderr, " unique verts:\n");
|
||||
GSET_ITER (gs_iter, node->bm_unique_verts)
|
||||
fprintf(stderr, " %d\n",
|
||||
BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
|
||||
fprintf(stderr, " %d\n", BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
|
||||
fprintf(stderr, " other verts:\n");
|
||||
GSET_ITER (gs_iter, node->bm_other_verts)
|
||||
fprintf(stderr, " %d\n",
|
||||
BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
|
||||
fprintf(stderr, " %d\n", BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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. */
|
||||
#if 0
|
||||
if ((psys->part->type == PART_HAIR) &&
|
||||
(psys->flag & PSYS_HAIR_DYNAMICS) == 0)
|
||||
{
|
||||
if ((psys->part->type == PART_HAIR) && (psys->flag & PSYS_HAIR_DYNAMICS) == 0) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -121,12 +121,23 @@ SequencerDrawView sequencer_view3d_cb = NULL; /* NULL in background mode */
|
|||
#if 0 /* unused function */
|
||||
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",
|
||||
seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine,
|
||||
seq->startdisp, seq->enddisp);
|
||||
seq->name,
|
||||
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));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1804,35 +1804,36 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len
|
|||
float m, delta_ij;
|
||||
int i, j;
|
||||
if (L < len) {
|
||||
for (i=0;i<3;i++) {
|
||||
for (j=0;j<3;j++) {
|
||||
delta_ij = (i==j ? (1.0f): (0.0f));
|
||||
m=factor*(dir[i]*dir[j] + (1-L/len)*(delta_ij - dir[i]*dir[j]));
|
||||
EIG_linear_solver_matrix_add(ia+i, op+ic+j, m);
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
delta_ij = (i == j ? (1.0f) : (0.0f));
|
||||
m = factor * (dir[i] * dir[j] + (1 - L / len) * (delta_ij - dir[i] * dir[j]));
|
||||
EIG_linear_solver_matrix_add(ia + i, op + ic + j, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i=0;i<3;i++) {
|
||||
for (j=0;j<3;j++) {
|
||||
m=factor*dir[i]*dir[j];
|
||||
EIG_linear_solver_matrix_add(ia+i, op+ic+j, m);
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
m = factor * dir[i] * dir[j];
|
||||
EIG_linear_solver_matrix_add(ia + i, op + ic + j, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void dfdx_goal(int ia, int ic, int op, float factor)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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 */
|
||||
|
||||
|
@ -1852,16 +1853,16 @@ static void sb_spring_force(
|
|||
bp1 = &sb->bpoint[bs->v1];
|
||||
bp2 = &sb->bpoint[bs->v2];
|
||||
#if 0 /* UNUSED */
|
||||
ia =3*bs->v1;
|
||||
ic =3*bs->v2;
|
||||
ia = 3 * bs->v1;
|
||||
ic = 3 * bs->v2;
|
||||
#endif
|
||||
}
|
||||
else if (bpi == bs->v2) {
|
||||
bp1 = &sb->bpoint[bs->v2];
|
||||
bp2 = &sb->bpoint[bs->v1];
|
||||
#if 0 /* UNUSED */
|
||||
ia =3*bs->v2;
|
||||
ic =3*bs->v1;
|
||||
ia = 3 * bs->v2;
|
||||
ic = 3 * bs->v1;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
|
@ -2284,8 +2285,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
|
|||
/* old one with homogeneous masses */
|
||||
/* claim a minimum mass for vertex */
|
||||
#if 0
|
||||
if (sb->nodemass > 0.009999f) timeovermass = forcetime / sb->nodemass;
|
||||
else timeovermass = forcetime / 0.009999f;
|
||||
if (sb->nodemass > 0.009999f)
|
||||
timeovermass = forcetime / sb->nodemass;
|
||||
else
|
||||
timeovermass = forcetime / 0.009999f;
|
||||
#endif
|
||||
|
||||
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
|
||||
|
@ -2339,11 +2342,11 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
|
|||
|
||||
/* the freezer coming sooner or later */
|
||||
#if 0
|
||||
if ((dot_v3v3(dx, dx)<freezeloc )&&(dot_v3v3(bp->force, bp->force)<freezeforce )) {
|
||||
bp->frozen /=2;
|
||||
if ((dot_v3v3(dx, dx) < freezeloc) && (dot_v3v3(bp->force, bp->force) < freezeforce)) {
|
||||
bp->frozen /= 2;
|
||||
}
|
||||
else {
|
||||
bp->frozen = min_ff(bp->frozen*1.05f, 1.0f);
|
||||
bp->frozen = min_ff(bp->frozen * 1.05f, 1.0f);
|
||||
}
|
||||
mul_v3_fl(dx, bp->frozen);
|
||||
#endif
|
||||
|
@ -2417,73 +2420,72 @@ static void softbody_restore_prev_step(Object *ob)
|
|||
#if 0
|
||||
static void softbody_store_step(Object *ob)
|
||||
{
|
||||
SoftBody *sb= ob->soft; /* is supposed to be there*/
|
||||
SoftBody *sb = ob->soft; /* is supposed to be there*/
|
||||
BodyPoint *bp;
|
||||
int a;
|
||||
|
||||
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
|
||||
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
|
||||
copy_v3_v3(bp->prevvec, bp->vec);
|
||||
copy_v3_v3(bp->prevpos, bp->pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* used by predictors and correctors */
|
||||
static void softbody_store_state(Object *ob, float *ppos, float *pvel)
|
||||
{
|
||||
SoftBody *sb= ob->soft; /* is supposed to be there*/
|
||||
SoftBody *sb = ob->soft; /* is supposed to be there*/
|
||||
BodyPoint *bp;
|
||||
int a;
|
||||
float *pp=ppos, *pv=pvel;
|
||||
float *pp = ppos, *pv = pvel;
|
||||
|
||||
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
|
||||
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
|
||||
|
||||
copy_v3_v3(pv, bp->vec);
|
||||
pv+=3;
|
||||
pv += 3;
|
||||
|
||||
copy_v3_v3(pp, bp->pos);
|
||||
pp+=3;
|
||||
pp += 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* used by predictors and correctors */
|
||||
static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
|
||||
{
|
||||
SoftBody *sb= ob->soft; /* is supposed to be there*/
|
||||
SoftBody *sb = ob->soft; /* is supposed to be there*/
|
||||
BodyPoint *bp;
|
||||
int a;
|
||||
float *pp=ppos, *pv=pvel;
|
||||
float *pp = ppos, *pv = pvel;
|
||||
|
||||
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
|
||||
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
|
||||
|
||||
copy_v3_v3(bp->vec, pv);
|
||||
pv+=3;
|
||||
pv += 3;
|
||||
|
||||
copy_v3_v3(bp->pos, pp);
|
||||
pp+=3;
|
||||
pp += 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* used by predictors and correctors */
|
||||
static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
|
||||
{
|
||||
SoftBody *sb= ob->soft; /* is supposed to be there*/
|
||||
SoftBody *sb = ob->soft; /* is supposed to be there*/
|
||||
BodyPoint *bp;
|
||||
int a;
|
||||
float *pp=ppos, *pv=pvel;
|
||||
float *pp = ppos, *pv = pvel;
|
||||
float temp[3];
|
||||
|
||||
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
|
||||
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
|
||||
|
||||
copy_v3_v3(temp, bp->vec);
|
||||
copy_v3_v3(bp->vec, pv);
|
||||
copy_v3_v3(pv, temp);
|
||||
pv+=3;
|
||||
pv += 3;
|
||||
|
||||
copy_v3_v3(temp, bp->pos);
|
||||
copy_v3_v3(bp->pos, pp);
|
||||
copy_v3_v3(pp, temp);
|
||||
pp+=3;
|
||||
pp += 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -485,12 +485,24 @@ static void studiolight_calculate_radiance_cubemap_buffers(StudioLight *sl)
|
|||
NULL, colbuf, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE);
|
||||
|
||||
#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_NEG], "/tmp/studiolight_radiance_right.png", 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);
|
||||
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_POS],
|
||||
"/tmp/studiolight_radiance_left.png",
|
||||
IB_rectfloat);
|
||||
IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_NEG],
|
||||
"/tmp/studiolight_radiance_right.png",
|
||||
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
|
||||
MEM_freeN(colbuf);
|
||||
}
|
||||
|
|
|
@ -1563,7 +1563,8 @@ static void dump_buffer(TextUndoBuf *utxt)
|
|||
{
|
||||
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 */
|
||||
|
@ -1646,27 +1647,38 @@ void txt_print_undo(Text *text)
|
|||
i++;
|
||||
printf(" - Char is ");
|
||||
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]);
|
||||
i++;
|
||||
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]);
|
||||
i += 2;
|
||||
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]);
|
||||
i += 3;
|
||||
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;
|
||||
char c[BLI_UTF8_MAX + 1];
|
||||
size_t c_len;
|
||||
uc = utxt->buf[i]; i++;
|
||||
uc = uc + (utxt->buf[i] << 8); i++;
|
||||
uc = uc + (utxt->buf[i] << 16); i++;
|
||||
uc = uc + (utxt->buf[i] << 24); i++;
|
||||
uc = utxt->buf[i];
|
||||
i++;
|
||||
uc = uc + (utxt->buf[i] << 8);
|
||||
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[c_len] = '\0';
|
||||
puts(c);
|
||||
|
@ -1677,44 +1689,65 @@ void txt_print_undo(Text *text)
|
|||
else if (op == UNDO_DBLOCK || op == UNDO_IBLOCK) {
|
||||
i++;
|
||||
|
||||
linep = utxt->buf[i]; i++;
|
||||
linep = linep + (utxt->buf[i] << 8); i++;
|
||||
linep = linep + (utxt->buf[i] << 16); i++;
|
||||
linep = linep + (utxt->buf[i] << 24); i++;
|
||||
linep = utxt->buf[i];
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 8);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 16);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 24);
|
||||
i++;
|
||||
|
||||
printf(" (length %d) <", linep);
|
||||
|
||||
while (linep > 0) {
|
||||
putchar(utxt->buf[i]);
|
||||
linep--; i++;
|
||||
linep--;
|
||||
i++;
|
||||
}
|
||||
|
||||
linep = utxt->buf[i]; i++;
|
||||
linep = linep + (utxt->buf[i] << 8); i++;
|
||||
linep = linep + (utxt->buf[i] << 16); i++;
|
||||
linep = linep + (utxt->buf[i] << 24); i++;
|
||||
linep = utxt->buf[i];
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 8);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 16);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 24);
|
||||
i++;
|
||||
printf("> (%d)", linep);
|
||||
}
|
||||
else if (op == UNDO_INDENT || op == UNDO_UNINDENT) {
|
||||
i++;
|
||||
|
||||
charp = utxt->buf[i]; i++;
|
||||
charp = charp + (utxt->buf[i] << 8); i++;
|
||||
charp = utxt->buf[i];
|
||||
i++;
|
||||
charp = charp + (utxt->buf[i] << 8);
|
||||
i++;
|
||||
|
||||
linep = utxt->buf[i]; i++;
|
||||
linep = linep + (utxt->buf[i] << 8); i++;
|
||||
linep = linep + (utxt->buf[i] << 16); i++;
|
||||
linep = linep + (utxt->buf[i] << 24); i++;
|
||||
linep = utxt->buf[i];
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 8);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 16);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 24);
|
||||
i++;
|
||||
|
||||
printf("to <%d, %d> ", linep, charp);
|
||||
|
||||
charp = utxt->buf[i]; i++;
|
||||
charp = charp + (utxt->buf[i] << 8); i++;
|
||||
charp = utxt->buf[i];
|
||||
i++;
|
||||
charp = charp + (utxt->buf[i] << 8);
|
||||
i++;
|
||||
|
||||
linep = utxt->buf[i]; i++;
|
||||
linep = linep + (utxt->buf[i] << 8); i++;
|
||||
linep = linep + (utxt->buf[i] << 16); i++;
|
||||
linep = linep + (utxt->buf[i] << 24); i++;
|
||||
linep = utxt->buf[i];
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 8);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 16);
|
||||
i++;
|
||||
linep = linep + (utxt->buf[i] << 24);
|
||||
i++;
|
||||
|
||||
printf("from <%d, %d>", linep, charp);
|
||||
}
|
||||
|
|
|
@ -608,11 +608,9 @@ static void *bli_mempool_iternext(BLI_mempool_iter *iter)
|
|||
if (iter->curchunk == NULL) {
|
||||
return ret;
|
||||
}
|
||||
if (atomic_cas_ptr(
|
||||
(void **)iter->curchunk_threaded_shared,
|
||||
if (atomic_cas_ptr((void **)iter->curchunk_threaded_shared,
|
||||
iter->curchunk,
|
||||
iter->curchunk->next) == iter->curchunk)
|
||||
{
|
||||
iter->curchunk->next) == iter->curchunk) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -828,14 +828,9 @@ void dist_squared_to_projected_aabb_precalc(struct DistProjectedAABBPrecalc *pre
|
|||
float projmat_trans[4][4];
|
||||
transpose_m4_m4(projmat_trans, projmat);
|
||||
if (!isect_plane_plane_plane_v3(
|
||||
projmat_trans[0], projmat_trans[1], projmat_trans[3],
|
||||
precalc->ray_origin))
|
||||
{
|
||||
projmat_trans[0], projmat_trans[1], projmat_trans[3], precalc->ray_origin)) {
|
||||
/* Orthographic projection. */
|
||||
isect_plane_plane_v3(
|
||||
px, py,
|
||||
precalc->ray_origin,
|
||||
precalc->ray_direction);
|
||||
isect_plane_plane_v3(px, py, precalc->ray_origin, precalc->ray_direction);
|
||||
}
|
||||
else {
|
||||
/* 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...
|
||||
* which would be confusing */
|
||||
#if 0
|
||||
||
|
||||
(sign_T > *r_lambda * xor_signmask(det, sign_mask))
|
||||
|| (sign_T > *r_lambda * xor_signmask(det, sign_mask))
|
||||
#endif
|
||||
) {
|
||||
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
|
||||
* so rays slightly outside the triangle to be considered as intersecting.
|
||||
*/
|
||||
bool isect_ray_tri_threshold_v3(
|
||||
const float ray_origin[3], const float ray_direction[3],
|
||||
const float v0[3], const float v1[3], const float v2[3],
|
||||
float *r_lambda, float r_uv[2], const float threshold)
|
||||
bool isect_ray_tri_threshold_v3(const float ray_origin[3],
|
||||
const float ray_direction[3],
|
||||
const float v0[3],
|
||||
const float v1[3],
|
||||
const float v2[3],
|
||||
float *r_lambda,
|
||||
float r_uv[2],
|
||||
const float threshold)
|
||||
{
|
||||
const float epsilon = 0.00000001f;
|
||||
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);
|
||||
a = dot_v3v3(e1, p);
|
||||
if ((a > -epsilon) && (a < epsilon)) return false;
|
||||
if ((a > -epsilon) && (a < epsilon))
|
||||
return false;
|
||||
f = 1.0f / a;
|
||||
|
||||
sub_v3_v3v3(s, ray_origin, v0);
|
||||
|
||||
cross_v3_v3v3(q, s, e1);
|
||||
*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);
|
||||
v = f * dot_v3v3(ray_direction, q);
|
||||
|
@ -1978,13 +1978,19 @@ bool isect_ray_tri_threshold_v3(
|
|||
dv = v - t;
|
||||
}
|
||||
else {
|
||||
if (u < 0) du = u;
|
||||
else if (u > 1) du = u - 1;
|
||||
else du = 0.0f;
|
||||
if (u < 0)
|
||||
du = u;
|
||||
else if (u > 1)
|
||||
du = u - 1;
|
||||
else
|
||||
du = 0.0f;
|
||||
|
||||
if (v < 0) dv = v;
|
||||
else if (v > 1) dv = v - 1;
|
||||
else dv = 0.0f;
|
||||
if (v < 0)
|
||||
dv = v;
|
||||
else if (v > 1)
|
||||
dv = v - 1;
|
||||
else
|
||||
dv = 0.0f;
|
||||
}
|
||||
|
||||
mul_v3_fl(e1, du);
|
||||
|
@ -5212,20 +5218,20 @@ typedef union {
|
|||
|
||||
static vFloat vec_splat_float(float val)
|
||||
{
|
||||
return (vFloat) {val, val, val, val};
|
||||
return (vFloat){val, val, val, val};
|
||||
}
|
||||
|
||||
static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3)
|
||||
{
|
||||
vFloat vcos, rlen, vrx, vry, vrz, vsrx, vsry, vsrz, gx, gy, gz, vangle;
|
||||
vUInt8 rotate = (vUInt8) {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3};
|
||||
vUInt8 rotate = (vUInt8){4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3};
|
||||
vFloatResult vresult;
|
||||
float result;
|
||||
|
||||
/* compute r* */
|
||||
vrx = (vFloat) {q0[0], q1[0], q2[0], q3[0]} -vec_splat_float(p[0]);
|
||||
vry = (vFloat) {q0[1], q1[1], q2[1], q3[1]} -vec_splat_float(p[1]);
|
||||
vrz = (vFloat) {q0[2], q1[2], q2[2], q3[2]} -vec_splat_float(p[2]);
|
||||
vrx = (vFloat){q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
|
||||
vry = (vFloat){q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
|
||||
vrz = (vFloat){q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
|
||||
|
||||
/* normalize r* */
|
||||
rlen = vec_rsqrte(vrx * vrx + vry * vry + vrz * vrz + vec_splat_float(1e-16f));
|
||||
|
@ -5255,9 +5261,9 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
|
|||
vangle = vacosf(vcos);
|
||||
|
||||
/* dot */
|
||||
vresult.v = (vec_splat_float(n[0]) * gx +
|
||||
vec_splat_float(n[1]) * gy +
|
||||
vec_splat_float(n[2]) * gz) * vangle;
|
||||
vresult.v = (vec_splat_float(n[0]) * gx + vec_splat_float(n[1]) * gy +
|
||||
vec_splat_float(n[2]) * gz) *
|
||||
vangle;
|
||||
|
||||
result = (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3]) * (0.5f / (float)M_PI);
|
||||
result = MAX2(result, 0.0f);
|
||||
|
|
|
@ -54,10 +54,8 @@ static float P(float k)
|
|||
static float P(float k)
|
||||
{
|
||||
return (float)(1.0f / 6.0f) *
|
||||
(pow(MAX2(k + 2.0f, 0), 3.0f) - 4.0f *
|
||||
pow(MAX2(k + 1.0f, 0), 3.0f) + 6.0f *
|
||||
pow(MAX2(k, 0), 3.0f) - 4.0f *
|
||||
pow(MAX2(k - 1.0f, 0), 3.0f));
|
||||
(pow(MAX2(k + 2.0f, 0), 3.0f) - 4.0f * pow(MAX2(k + 1.0f, 0), 3.0f) +
|
||||
6.0f * pow(MAX2(k, 0), 3.0f) - 4.0f * pow(MAX2(k - 1.0f, 0), 3.0f));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3724,7 +3724,8 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
|
|||
bNodeInstanceHash *new_previews = BKE_node_instance_hash_new("node previews");
|
||||
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);
|
||||
if (preview) {
|
||||
bNodePreview *new_preview = newimaadr(fd, preview);
|
||||
|
|
|
@ -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 */
|
||||
ts->gpencil_v3d_align = 0;
|
||||
|
||||
if (gpd->flag & GP_DATA_VIEWALIGN) ts->gpencil_v3d_align |= GP_PROJECT_VIEWSPACE;
|
||||
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_VIEWALIGN)
|
||||
ts->gpencil_v3d_align |= GP_PROJECT_VIEWSPACE;
|
||||
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)
|
||||
ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE_ENDPOINTS;
|
||||
|
|
|
@ -1125,11 +1125,9 @@ void bm_log_print(const BMLog *log, const char *description)
|
|||
int i;
|
||||
|
||||
printf("%s:\n", description);
|
||||
printf(" % 2d: [ initial ]%s\n", 0,
|
||||
(!log->current_entry) ? current : "");
|
||||
printf(" % 2d: [ initial ]%s\n", 0, (!log->current_entry) ? current : "");
|
||||
for (entry = log->entries.first, i = 1; entry; entry = entry->next, i++) {
|
||||
printf(" % 2d: [%p]%s\n", i, entry,
|
||||
(entry == log->current_entry) ? current : "");
|
||||
printf(" % 2d: [%p]%s\n", i, entry, (entry == log->current_entry) ? current : "");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -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()
|
||||
* first)!
|
||||
*/
|
||||
void BM_mesh_loop_normals_update(
|
||||
BMesh *bm, const bool use_split_normals, const float split_angle, float (*r_lnos)[3],
|
||||
MLoopNorSpaceArray *r_lnors_spacearr, short (*clnors_data)[2], const int cd_loop_clnors_offset)
|
||||
void BM_mesh_loop_normals_update(BMesh *bm,
|
||||
const bool use_split_normals,
|
||||
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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
/* 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 {
|
||||
BLI_assert(!r_lnors_spacearr);
|
||||
|
@ -1839,8 +1844,13 @@ void BM_mesh_elem_index_validate(
|
|||
|
||||
/* dirty may have been incorrectly set */
|
||||
fprintf(stderr,
|
||||
"Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are correct, '%s', '%s'\n",
|
||||
location, func, type_names[i], msg_a, msg_b);
|
||||
"Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are "
|
||||
"correct, '%s', '%s'\n",
|
||||
location,
|
||||
func,
|
||||
type_names[i],
|
||||
msg_a,
|
||||
msg_b);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -1848,9 +1858,7 @@ void BM_mesh_elem_index_validate(
|
|||
#if 0 /* mostly annoying, even in debug mode */
|
||||
# ifdef DEBUG
|
||||
if (is_any_error == 0) {
|
||||
fprintf(stderr,
|
||||
"Valid Index Success: at %s, %s, '%s', '%s'\n",
|
||||
location, func, msg_a, msg_b);
|
||||
fprintf(stderr, "Valid Index Success: at %s, %s, '%s', '%s'\n", location, func, msg_a, msg_b);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -538,7 +538,8 @@ BMEdge *BM_vert_collapse_edge(
|
|||
BMVert *tv2 = BM_edge_other_vert(e2, v_kill);
|
||||
if (tv2) {
|
||||
/* 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);
|
||||
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;
|
||||
if (l->e->v1 == l->e->v2) {
|
||||
fprintf(err, "Found bmesh edge with identical verts!\n");
|
||||
|
|
|
@ -741,7 +741,8 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd)
|
|||
if (slot->len >= slot->size) {
|
||||
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;
|
||||
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->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;
|
||||
slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array");
|
||||
|
|
|
@ -1917,7 +1917,6 @@ BMEdge *BM_edge_exists(BMVert *v_a, BMVert *v_b)
|
|||
BMIter iter;
|
||||
BMEdge *e;
|
||||
|
||||
|
||||
BLI_assert(v_a != v_b);
|
||||
BLI_assert(v_a->head.htype == BM_VERT && v_b->head.htype == BM_VERT);
|
||||
|
||||
|
|
|
@ -209,14 +209,13 @@ static void *bmw_VertShellWalker_step(BMWalker *walker)
|
|||
|
||||
BMW_state_remove(walker);
|
||||
|
||||
|
||||
/* find the next edge whose other vertex has not been visite */
|
||||
curedge = shellWalk.curedge;
|
||||
do {
|
||||
if (!BLI_gset_haskey(walker->visit_set, curedge)) {
|
||||
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;
|
||||
|
||||
v_old = BM_edge_other_vert(curedge, shellWalk.base);
|
||||
|
|
|
@ -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_b = (const EdRotState *)b;
|
||||
if (e_state_a->v1 < e_state_b->v1) return -1;
|
||||
else if (e_state_a->v1 > e_state_b->v1) return 1;
|
||||
else if (e_state_a->v2 < e_state_b->v2) return -1;
|
||||
else if (e_state_a->v2 > e_state_b->v2) return 1;
|
||||
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;
|
||||
if (e_state_a->v1 < e_state_b->v1)
|
||||
return -1;
|
||||
else if (e_state_a->v1 > e_state_b->v1)
|
||||
return 1;
|
||||
else if (e_state_a->v2 < e_state_b->v2)
|
||||
return -1;
|
||||
else if (e_state_a->v2 > e_state_b->v2)
|
||||
return 1;
|
||||
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
|
||||
static GSet *erot_gset_new(void)
|
||||
|
|
|
@ -351,7 +351,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
|
|||
|
||||
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++)
|
||||
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(1, 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);
|
||||
|
@ -379,7 +380,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
|
|||
|
||||
FCurve *cu = eulcu[i];
|
||||
|
||||
if (!cu) continue;
|
||||
if (!cu)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < cu->totvert; j++) {
|
||||
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] = {
|
||||
eulcu[0] ? evaluate_fcurve(eulcu[0], 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
|
||||
|
@ -410,7 +412,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
|
|||
// now replace old Euler curves
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (!eulcu[i]) continue;
|
||||
if (!eulcu[i])
|
||||
continue;
|
||||
|
||||
action_groups_remove_channel(act, eulcu[i]);
|
||||
free_fcurve(eulcu[i]);
|
||||
|
@ -575,11 +578,10 @@ void AnimationImporter::Assign_transform_animations(
|
|||
case COLLADAFW::Transformation::MATRIX:
|
||||
#if 0
|
||||
{
|
||||
COLLADAFW::Matrix *mat = (COLLADAFW::Matrix*)transform;
|
||||
COLLADAFW::Matrix *mat = (COLLADAFW::Matrix *)transform;
|
||||
COLLADABU::Math::Matrix4 mat4 = mat->getMatrix();
|
||||
switch (binding->animationClass) {
|
||||
case COLLADAFW::AnimationList::TRANSFORM:
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2045,7 +2047,8 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root,
|
|||
#if 0
|
||||
// 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
|
||||
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];
|
||||
if (par) {
|
||||
|
@ -2062,7 +2065,7 @@ bool AnimationImporter::evaluate_joint_world_transform_at_frame(float mat[4][4],
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
COLLADAFW::NodePointerArray& children = node->getChildNodes();
|
||||
COLLADAFW::NodePointerArray &children = node->getChildNodes();
|
||||
for (int i = 0; i < children.getCount(); i++) {
|
||||
if (evaluate_joint_world_transform_at_frame(mat, m, children[i], end, fra))
|
||||
return true;
|
||||
|
|
|
@ -238,7 +238,8 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
|
|||
#if 0
|
||||
// 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
|
||||
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
|
||||
|
||||
void add_bone_fcurve(Object *ob, COLLADAFW::Node *node, FCurve *fcu);
|
||||
|
|
|
@ -119,12 +119,12 @@ bool ArmatureExporter::add_instance_controller(Object *ob)
|
|||
void ArmatureExporter::operator()(Object *ob)
|
||||
{
|
||||
Object *ob_arm = bc_get_assigned_armature(ob);
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
|
@ -132,11 +132,13 @@ void ArmatureExporter::wrote(Object *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();
|
||||
|
||||
Base *base = (Base *) sce->base.first;
|
||||
Base *base = (Base *)sce->base.first;
|
||||
while (base) {
|
||||
Object *ob = base->object;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class ArmatureExporter : public COLLADASW::LibraryControllers,
|
|||
|
||||
void wrote(Object *ob_arm);
|
||||
|
||||
void find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce);
|
||||
void find_objects_using_armature(Object *ob_arm, std::vector<Object *> &objects, Scene *sce);
|
||||
#endif
|
||||
|
||||
// Scene, SceneExporter and the list of child_objects
|
||||
|
|
|
@ -75,11 +75,11 @@ ArmatureImporter::~ArmatureImporter()
|
|||
#if 0
|
||||
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()) {
|
||||
fprintf(stderr, "Cannot find a joint index by joint id for %s.\n",
|
||||
node->getOriginalId().c_str());
|
||||
fprintf(
|
||||
stderr, "Cannot find a joint index by joint id for %s.\n", node->getOriginalId().c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ void ArmatureImporter::set_leaf_bone_shapes(Object *ob_arm)
|
|||
|
||||
std::vector<LeafBone>::iterator it;
|
||||
for (it = leaf_bones.begin(); it != leaf_bones.end(); it++) {
|
||||
LeafBone& leaf = *it;
|
||||
LeafBone &leaf = *it;
|
||||
|
||||
bPoseChannel *pchan = BKE_pose_channel_find_name(pose, leaf.name);
|
||||
if (pchan) {
|
||||
|
@ -396,7 +396,7 @@ void ArmatureImporter::set_euler_rotmode()
|
|||
std::map<COLLADAFW::UniqueId, SkinInfo>::iterator sit;
|
||||
|
||||
for (sit = skin_by_data_uid.begin(); sit != skin_by_data_uid.end(); sit++) {
|
||||
SkinInfo& skin = sit->second;
|
||||
SkinInfo &skin = sit->second;
|
||||
|
||||
if (skin.uses_joint_or_descendant(joint)) {
|
||||
bPoseChannel *pchan = skin.get_pose_channel_from_node(joint);
|
||||
|
@ -430,23 +430,26 @@ Object *ArmatureImporter::get_empty_for_leaves()
|
|||
Object *ArmatureImporter::find_armature(COLLADAFW::Node *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++) {
|
||||
Object *ob_arm = find_armature(children[i]);
|
||||
if (ob_arm) return ob_arm;
|
||||
if (ob_arm)
|
||||
return ob_arm;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ArmatureJoints& ArmatureImporter::get_armature_joints(Object *ob_arm)
|
||||
ArmatureJoints &ArmatureImporter::get_armature_joints(Object *ob_arm)
|
||||
{
|
||||
// try finding it
|
||||
std::vector<ArmatureJoints>::iterator 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
|
||||
|
@ -800,7 +803,9 @@ void ArmatureImporter::make_armatures(bContext *C, std::vector<Object *> &object
|
|||
|
||||
#if 0
|
||||
// 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);
|
||||
|
||||
|
@ -814,7 +819,7 @@ void ArmatureImporter::link_armature(Object *ob_arm, const COLLADAFW::UniqueId&
|
|||
return;
|
||||
}
|
||||
|
||||
SkinInfo& skin = skin_by_data_uid[conroller_data_id];
|
||||
SkinInfo &skin = skin_by_data_uid[conroller_data_id];
|
||||
|
||||
// create vertex groups
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class ArmatureImporter : private TransformReader {
|
|||
#if 0
|
||||
struct ArmatureJoints {
|
||||
Object *ob_arm;
|
||||
std::vector<COLLADAFW::Node*> root_joints;
|
||||
std::vector<COLLADAFW::Node *> root_joints;
|
||||
};
|
||||
std::vector<ArmatureJoints> armature_joints;
|
||||
#endif
|
||||
|
@ -133,7 +133,7 @@ class ArmatureImporter : private TransformReader {
|
|||
#if 0
|
||||
Object *find_armature(COLLADAFW::Node *node);
|
||||
|
||||
ArmatureJoints& get_armature_joints(Object *ob_arm);
|
||||
ArmatureJoints &get_armature_joints(Object *ob_arm);
|
||||
#endif
|
||||
|
||||
Object *create_armature_bones(Main *bmain, SkinInfo &skin);
|
||||
|
@ -161,7 +161,9 @@ class ArmatureImporter : private TransformReader {
|
|||
|
||||
#if 0
|
||||
// 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
|
||||
|
||||
bool write_skin_controller_data(const COLLADAFW::SkinControllerData *data);
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
void BCAnimationSampler::add_value_set(
|
||||
BCAnimationCurve &curve,
|
||||
void BCAnimationSampler::add_value_set(BCAnimationCurve &curve,
|
||||
BCFrameSampleMap &samples,
|
||||
BC_export_animation_type animation_type)
|
||||
{
|
||||
|
|
|
@ -123,7 +123,8 @@ void ControllerExporter::operator()(Object *ob)
|
|||
|
||||
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)
|
||||
|
@ -131,11 +132,13 @@ void ArmatureExporter::wrote(Object *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();
|
||||
|
||||
Base *base = (Base *) sce->base.first;
|
||||
Base *base = (Base *)sce->base.first;
|
||||
while (base) {
|
||||
Object *ob = base->object;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ class ControllerExporter : public COLLADASW::LibraryControllers,
|
|||
|
||||
void wrote(Object *ob_arm);
|
||||
|
||||
void find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce);
|
||||
void find_objects_using_armature(Object *ob_arm, std::vector<Object *> &objects, Scene *sce);
|
||||
#endif
|
||||
|
||||
std::string get_controller_id(Object *ob_arm, Object *ob);
|
||||
|
|
|
@ -198,7 +198,8 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
|
|||
Image *ima = t->tex->ima;
|
||||
|
||||
// Image not set for texture
|
||||
if (!ima) continue;
|
||||
if (!ima)
|
||||
continue;
|
||||
|
||||
std::string key(id_name(ima));
|
||||
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
|
||||
if (im_samp_map.find(key) == im_samp_map.end()) {
|
||||
//<newparam> <sampler> <source>
|
||||
COLLADASW::Sampler sampler(
|
||||
COLLADASW::Sampler::SAMPLER_TYPE_2D,
|
||||
COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
|
||||
key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
|
||||
key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
|
||||
sampler.setImageId(key);
|
||||
|
@ -235,7 +235,8 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
|
|||
key = translate_id(key);
|
||||
int i = im_samp_map[key];
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -264,13 +264,11 @@ Mesh *bc_get_mesh_copy(BlenderContext &blender_context,
|
|||
if (apply_modifiers) {
|
||||
#if 0 /* Not supported by new system currently... */
|
||||
switch (export_mesh_type) {
|
||||
case BC_MESH_TYPE_VIEW:
|
||||
{
|
||||
case BC_MESH_TYPE_VIEW: {
|
||||
dm = mesh_create_derived_view(depsgraph, scene, ob, &mask);
|
||||
break;
|
||||
}
|
||||
case BC_MESH_TYPE_RENDER:
|
||||
{
|
||||
case BC_MESH_TYPE_RENDER: {
|
||||
dm = mesh_create_derived_render(depsgraph, scene, ob, &mask);
|
||||
break;
|
||||
}
|
||||
|
@ -826,18 +824,16 @@ 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)
|
||||
{
|
||||
if (ebone->prop == NULL)
|
||||
{
|
||||
IDPropertyTemplate val = { 0 };
|
||||
if (ebone->prop == NULL) {
|
||||
IDPropertyTemplate val = {0};
|
||||
ebone->prop = IDP_New(IDP_GROUP, &val, "RNA_EditBone ID properties");
|
||||
}
|
||||
|
||||
IDProperty *pgroup = (IDProperty *)ebone->prop;
|
||||
IDPropertyTemplate val = { 0 };
|
||||
IDPropertyTemplate val = {0};
|
||||
IDProperty *prop = IDP_New(IDP_FLOAT, &val, key);
|
||||
IDP_Float(prop) = value;
|
||||
IDP_AddToGroup(pgroup, prop);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1262,7 +1258,10 @@ bNode *bc_add_node(bContext *C, bNodeTree *ntree, int node_type, int locx, int l
|
|||
|
||||
#if 0
|
||||
// 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);
|
||||
|
||||
|
@ -1278,7 +1277,10 @@ static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree, bNode *to_node,
|
|||
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);
|
||||
|
||||
|
@ -1294,7 +1296,6 @@ static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree, bNode *from_nod
|
|||
return newsock;
|
||||
}
|
||||
|
||||
|
||||
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");
|
||||
|
|
|
@ -181,9 +181,10 @@ inline bool bc_startswith(std::string const &value, std::string const &starting)
|
|||
}
|
||||
|
||||
#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());
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -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);
|
||||
|
||||
/* 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();
|
||||
#endif
|
||||
int minmax_size[3], depth_size[3];
|
||||
|
|
|
@ -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 inv_samples_len = 1.0f / 8192.0f;
|
||||
|
||||
char *lib_str = BLI_string_joinN(
|
||||
datatoc_bsdf_common_lib_glsl,
|
||||
datatoc_bsdf_sampling_lib_glsl);
|
||||
char *lib_str = BLI_string_joinN(datatoc_bsdf_common_lib_glsl, datatoc_bsdf_sampling_lib_glsl);
|
||||
|
||||
struct GPUShader *sh = DRW_shader_create_with_lib(
|
||||
datatoc_lightprobe_vert_glsl, datatoc_lightprobe_geom_glsl, datatoc_bsdf_lut_frag_glsl, lib_str,
|
||||
struct GPUShader *sh = DRW_shader_create_with_lib(datatoc_lightprobe_vert_glsl,
|
||||
datatoc_lightprobe_geom_glsl,
|
||||
datatoc_bsdf_lut_frag_glsl,
|
||||
lib_str,
|
||||
"#define HAMMERSLEY_SIZE 8192\n"
|
||||
"#define BRDF_LUT_SIZE 64\n"
|
||||
"#define NOISE_SIZE 64\n");
|
||||
|
@ -150,11 +150,14 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h))
|
|||
glReadPixels(0, 0, w, h, GL_RGB, GL_FLOAT, data);
|
||||
|
||||
printf("{");
|
||||
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]); i+=3;
|
||||
printf("%ff, %ff, ", data[i], data[i+1]); i+=3;
|
||||
printf("%ff, %ff, \n", data[i], data[i+1]);
|
||||
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]);
|
||||
i += 3;
|
||||
printf("%ff, %ff, ", data[i], data[i + 1]);
|
||||
i += 3;
|
||||
printf("%ff, %ff, \n", data[i], data[i + 1]);
|
||||
}
|
||||
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;
|
||||
|
||||
char *frag_str = BLI_string_joinN(
|
||||
datatoc_bsdf_common_lib_glsl,
|
||||
datatoc_bsdf_sampling_lib_glsl,
|
||||
datatoc_btdf_lut_frag_glsl);
|
||||
datatoc_bsdf_common_lib_glsl, datatoc_bsdf_sampling_lib_glsl, datatoc_btdf_lut_frag_glsl);
|
||||
|
||||
struct GPUShader *sh = DRW_shader_create_fullscreen(frag_str,
|
||||
"#define HAMMERSLEY_SIZE 8192\n"
|
||||
|
@ -222,20 +223,28 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
|
|||
|
||||
# if 1
|
||||
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]);
|
||||
if (((i/3)+1) % 12 == 0) fprintf(f, "\n\t\t");
|
||||
else fprintf(f, " ");
|
||||
if (((i / 3) + 1) % 12 == 0)
|
||||
fprintf(f, "\n\t\t");
|
||||
else
|
||||
fprintf(f, " ");
|
||||
}
|
||||
fprintf(f, "\n\t},\n");
|
||||
# else
|
||||
for (int i = 0; i < w*h * 3; i+=3) {
|
||||
if (data[i] < 0.01) printf(" ");
|
||||
else if (data[i] < 0.3) printf(".");
|
||||
else if (data[i] < 0.6) printf("+");
|
||||
else if (data[i] < 0.9) printf("%%");
|
||||
else printf("#");
|
||||
if ((i/3+1) % 64 == 0) printf("\n");
|
||||
for (int i = 0; i < w * h * 3; i += 3) {
|
||||
if (data[i] < 0.01)
|
||||
printf(" ");
|
||||
else if (data[i] < 0.3)
|
||||
printf(".");
|
||||
else if (data[i] < 0.6)
|
||||
printf("+");
|
||||
else if (data[i] < 0.9)
|
||||
printf("%%");
|
||||
else
|
||||
printf("#");
|
||||
if ((i / 3 + 1) % 64 == 0)
|
||||
printf("\n");
|
||||
}
|
||||
# endif
|
||||
|
||||
|
|
|
@ -165,11 +165,7 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda
|
|||
#if 0 /* for future high quality blur */
|
||||
/* Future matrix */
|
||||
eevee_motion_blur_camera_get_matrix_at_time(
|
||||
scene,
|
||||
ar, rv3d, v3d,
|
||||
ob_camera_eval,
|
||||
ctime + delta,
|
||||
effects->future_world_to_ndc);
|
||||
scene, ar, rv3d, v3d, ob_camera_eval, ctime + delta, effects->future_world_to_ndc);
|
||||
#endif
|
||||
invert_m4_m4(effects->current_ndc_to_world, effects->current_world_to_ndc);
|
||||
}
|
||||
|
|
|
@ -185,9 +185,12 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata, Object *camera)
|
|||
wpd->dof_blur_tx = DRW_texture_pool_query_2d(
|
||||
size[0], size[1], GPU_R11F_G11F_B10F, &draw_engine_workbench_solid);
|
||||
#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_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);
|
||||
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_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
|
||||
|
||||
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),
|
||||
});
|
||||
#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_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_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_TEXTURE(wpd->coc_tiles_tx[1]),
|
||||
});
|
||||
|
@ -318,12 +324,14 @@ void workbench_dof_create_pass(WORKBENCH_Data *vedata,
|
|||
}
|
||||
#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_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_call_add(grp, quad, NULL);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
/* Swizzle to make shader code simpler. */
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
copy_v3_fl3(
|
||||
wd->spherical_harmonics_coefs[i + 1],
|
||||
copy_v3_fl3(wd->spherical_harmonics_coefs[i + 1],
|
||||
-sl->spherical_harmonics_coefs[3][i],
|
||||
sl->spherical_harmonics_coefs[2][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. */
|
||||
|
|
|
@ -161,9 +161,13 @@ static void UNUSED_FUNCTION(add_fancy_edge)(GPUVertBuf *vbo,
|
|||
}
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
static void add_lat_lon_vert(
|
||||
GPUVertBuf *vbo, uint pos_id, uint nor_id,
|
||||
uint *v_idx, const float rad, const float lat, const float lon)
|
||||
static void add_lat_lon_vert(GPUVertBuf *vbo,
|
||||
uint pos_id,
|
||||
uint nor_id,
|
||||
uint *v_idx,
|
||||
const float rad,
|
||||
const float lat,
|
||||
const float lon)
|
||||
{
|
||||
float pos[3], nor[3];
|
||||
nor[0] = sinf(lat) * cosf(lon);
|
||||
|
@ -178,8 +182,10 @@ static void add_lat_lon_vert(
|
|||
static GPUVertBuf *fill_arrows_vbo(const float scale)
|
||||
{
|
||||
/* Position Only 3D format */
|
||||
static GPUVertFormat format = { 0 };
|
||||
static struct { uint pos; } attr_id;
|
||||
static GPUVertFormat format = {0};
|
||||
static struct {
|
||||
uint pos;
|
||||
} attr_id;
|
||||
if (format.attr_len == 0) {
|
||||
attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
|
||||
}
|
||||
|
@ -2039,8 +2045,8 @@ static const float bone_octahedral_verts[6][3] = {
|
|||
static const float bone_octahedral_smooth_normals[6][3] = {
|
||||
{0.0f, -1.0f, 0.0f},
|
||||
#if 0 /* creates problems for outlines when scaled */
|
||||
{ 0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2},
|
||||
{ 0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2},
|
||||
{0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2},
|
||||
{0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2},
|
||||
{-0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2},
|
||||
{-0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2},
|
||||
#else
|
||||
|
@ -2055,17 +2061,13 @@ static const float bone_octahedral_smooth_normals[6][3] = {
|
|||
#if 0 /* UNUSED */
|
||||
|
||||
static const uint bone_octahedral_wire[24] = {
|
||||
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, 1, 1, 5, 5, 3, 3, 0, 0, 4, 4, 5, 5, 2, 2, 0, 1, 2, 2, 3, 3, 4, 4, 1,
|
||||
};
|
||||
|
||||
/* aligned with bone_octahedral_wire
|
||||
* Contains adjacent normal index */
|
||||
static const uint bone_octahedral_wire_adjacent_face[24] = {
|
||||
0, 3, 4, 7, 5, 6, 1, 2,
|
||||
2, 3, 6, 7, 4, 5, 0, 1,
|
||||
0, 4, 1, 5, 2, 6, 3, 7,
|
||||
0, 3, 4, 7, 5, 6, 1, 2, 2, 3, 6, 7, 4, 5, 0, 1, 0, 4, 1, 5, 2, 6, 3, 7,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -2109,10 +2111,10 @@ static const uint bone_octahedral_wire_lines_adjacency[12][4] = {
|
|||
|
||||
#if 0 /* UNUSED */
|
||||
static const uint bone_octahedral_solid_tris_adjacency[8][6] = {
|
||||
{ 0, 12, 1, 10, 2, 3},
|
||||
{ 3, 15, 4, 1, 5, 6},
|
||||
{ 6, 18, 7, 4, 8, 9},
|
||||
{ 9, 21, 10, 7, 11, 0},
|
||||
{0, 12, 1, 10, 2, 3},
|
||||
{3, 15, 4, 1, 5, 6},
|
||||
{6, 18, 7, 4, 8, 9},
|
||||
{9, 21, 10, 7, 11, 0},
|
||||
|
||||
{12, 22, 13, 2, 14, 17},
|
||||
{15, 13, 16, 5, 17, 20},
|
||||
|
@ -2219,17 +2221,13 @@ static const float bone_box_smooth_normals[8][3] = {
|
|||
|
||||
#if 0 /* UNUSED */
|
||||
static const uint bone_box_wire[24] = {
|
||||
0, 1, 1, 2, 2, 3, 3, 0,
|
||||
4, 5, 5, 6, 6, 7, 7, 4,
|
||||
0, 4, 1, 5, 2, 6, 3, 7,
|
||||
0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7,
|
||||
};
|
||||
|
||||
/* aligned with bone_octahedral_wire
|
||||
* Contains adjacent normal index */
|
||||
static const uint bone_box_wire_adjacent_face[24] = {
|
||||
0, 2, 0, 4, 1, 6, 1, 8,
|
||||
3, 10, 5, 10, 7, 11, 9, 11,
|
||||
3, 8, 2, 5, 4, 7, 6, 9,
|
||||
0, 2, 0, 4, 1, 6, 1, 8, 3, 10, 5, 10, 7, 11, 9, 11, 3, 8, 2, 5, 4, 7, 6, 9,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -2274,11 +2272,11 @@ static const uint bone_box_wire_lines_adjacency[12][4] = {
|
|||
|
||||
#if 0 /* UNUSED */
|
||||
static const uint bone_box_solid_tris_adjacency[12][6] = {
|
||||
{ 0, 5, 1, 14, 2, 8},
|
||||
{ 3, 26, 4, 20, 5, 1},
|
||||
{0, 5, 1, 14, 2, 8},
|
||||
{3, 26, 4, 20, 5, 1},
|
||||
|
||||
{ 6, 2, 7, 16, 8, 11},
|
||||
{ 9, 7, 10, 32, 11, 24},
|
||||
{6, 2, 7, 16, 8, 11},
|
||||
{9, 7, 10, 32, 11, 24},
|
||||
|
||||
{12, 0, 13, 22, 14, 17},
|
||||
{15, 13, 16, 30, 17, 6},
|
||||
|
@ -2499,8 +2497,10 @@ GPUBatch *DRW_cache_bone_point_get(void)
|
|||
const float lat_inc = M_PI / lat_res;
|
||||
uint v_idx = 0;
|
||||
|
||||
static GPUVertFormat format = { 0 };
|
||||
static struct { uint pos, nor; } attr_id;
|
||||
static GPUVertFormat format = {0};
|
||||
static struct {
|
||||
uint pos, nor;
|
||||
} attr_id;
|
||||
if (format.attr_len == 0) {
|
||||
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);
|
||||
|
@ -2515,14 +2515,16 @@ GPUBatch *DRW_cache_bone_point_get(void)
|
|||
float lat = 0.0f;
|
||||
for (int j = 0; j < lat_res; j++, lat += lat_inc) {
|
||||
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, lon);
|
||||
}
|
||||
|
||||
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 + 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);
|
||||
}
|
||||
}
|
||||
|
@ -2755,10 +2757,14 @@ static float z_axis_name[10][2] = {
|
|||
#define S_Y 0.007f
|
||||
static float axis_marker[8][2] = {
|
||||
#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 */
|
||||
{-S_X, 0.f},
|
||||
{0.f, S_Y},
|
||||
|
|
|
@ -3128,7 +3128,8 @@ static void mesh_create_loop_uv_and_tan(MeshRenderData *rdata, GPUVertBuf *vbo)
|
|||
for (uint i = 0; i < uv_len; 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 */
|
||||
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
|
||||
uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||
#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. */
|
||||
BLI_INLINE float edit_uv_get_loop_stretch_angle(
|
||||
const float auv0[2], const float auv1[2], const float av0[3], const float av1[3])
|
||||
BLI_INLINE float edit_uv_get_loop_stretch_angle(const float auv0[2],
|
||||
const float auv1[2],
|
||||
const float av0[3],
|
||||
const float av1[3])
|
||||
{
|
||||
float uvang = angle_normalized_v2v2(auv0, auv1);
|
||||
float ang = angle_normalized_v3v3(av0, av1);
|
||||
|
|
|
@ -498,7 +498,8 @@ static void draw_clipping_setup_from_view(void)
|
|||
/* Extract Clipping Planes */
|
||||
BoundBox bbox;
|
||||
#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++) {
|
||||
mul_project_m4_v3(projinv, bbox.vec[i]);
|
||||
}
|
||||
|
|
|
@ -405,7 +405,9 @@ static bool acf_generic_idfill_name_prop(bAnimListElem *ale, PointerRNA *ptr, Pr
|
|||
|
||||
#if 0
|
||||
/* 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;
|
||||
}
|
||||
|
@ -4715,15 +4717,43 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
|||
RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
|
||||
|
||||
UI_block_align_begin(block);
|
||||
UI_block_emboss_set(block, RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
|
||||
uiDefButR(block, 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_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
|
||||
uiDefButR(block,
|
||||
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);
|
||||
uiDefButR(block, 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,
|
||||
RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
|
||||
uiDefButR(block,
|
||||
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_align_end(block);
|
||||
|
||||
|
|
|
@ -408,7 +408,10 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
|
|||
#if 0
|
||||
if (G.debug & G_DEBUG) {
|
||||
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
|
||||
/* Prevent crashes in cases where it can't be handled */
|
||||
|
|
|
@ -1476,7 +1476,10 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
|
|||
if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
|
||||
if (fabsf(mdb->totalphi[b] - 1.0f) > 1e-4f)
|
||||
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
|
||||
|
||||
/* free */
|
||||
|
|
|
@ -167,7 +167,8 @@ static bool pose_has_protected_selected(Object *ob, short warn)
|
|||
}
|
||||
}
|
||||
if (pchan) {
|
||||
if (warn) error("Cannot change Proxy protected bones");
|
||||
if (warn)
|
||||
error("Cannot change Proxy protected bones");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1834,9 +1834,15 @@ void POSELIB_OT_browse_interactive(wmOperatorType *ot)
|
|||
// XXX: percentage vs factor?
|
||||
/* not used yet */
|
||||
#if 0
|
||||
RNA_def_float_factor(
|
||||
ot->srna, "blend_factor", 1.0f, 0.0f, 1.0f, "Blend Factor",
|
||||
"Amount that the pose is applied on top of the existing poses", 0.0f, 1.0f);
|
||||
RNA_def_float_factor(ot->srna,
|
||||
"blend_factor",
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
@ -104,11 +104,13 @@ void printknots(Object *obedit)
|
|||
if (ED_curve_nurb_select_check(nu) && nu->type == CU_NURBS) {
|
||||
if (nu->knotsu) {
|
||||
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) {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2429,7 +2429,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
/* event doesn't need to be handled */
|
||||
#if 0
|
||||
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
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ static int gp_set_filling_texture(Image *image, short flag)
|
|||
ImBuf *ibuf;
|
||||
uint *bind = &image->bindcode[TEXTARGET_TEXTURE_2D];
|
||||
int error = GL_NO_ERROR;
|
||||
ImageUser iuser = { NULL };
|
||||
ImageUser iuser = {NULL};
|
||||
void *lock;
|
||||
|
||||
iuser.ok = true;
|
||||
|
@ -388,8 +388,7 @@ static int gp_set_filling_texture(Image *image, short flag)
|
|||
}
|
||||
|
||||
GPU_create_gl_tex(
|
||||
bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D,
|
||||
false, false, image);
|
||||
bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, false, false, image);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_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);
|
||||
#if 0 /* GPXX disabled, not used in annotations */
|
||||
/* 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);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3748,7 +3748,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
/* event doesn't need to be handled */
|
||||
#if 0
|
||||
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
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -707,7 +707,10 @@ void ED_scene_draw_fps(struct Scene *scene, int xoffset, int *yoffset);
|
|||
#if 0
|
||||
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_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
|
||||
|
||||
/* render */
|
||||
|
|
|
@ -417,7 +417,15 @@ void UI_draw_roundbox_shade_x(bool filled,
|
|||
|
||||
#if 0 /* unused */
|
||||
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
|
||||
|
||||
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,
|
||||
struct wmOperator *op);
|
||||
#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
|
||||
|
||||
void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block);
|
||||
|
|
|
@ -1274,7 +1274,8 @@ static bool ui_but_event_property_operator_string(const bContext *C,
|
|||
#if 0
|
||||
else {
|
||||
printf("ERROR in %s(): Couldn't get path for scene property - %s\n",
|
||||
__func__, RNA_property_identifier(prop));
|
||||
__func__,
|
||||
RNA_property_identifier(prop));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -655,12 +655,16 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
|
|||
#if 0 /* Disabled for now. */
|
||||
ot = WM_operatortype_find("UI_OT_override_type_set_button", false);
|
||||
uiItemFullO_ptr(
|
||||
layout, ot, "Overrides Type", ICON_NONE,
|
||||
NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
|
||||
layout, ot, "Overrides Type", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
|
||||
RNA_boolean_set(&op_ptr, "all", true);
|
||||
uiItemFullO_ptr(
|
||||
layout, ot, "Single Override Type", ICON_NONE,
|
||||
NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
|
||||
uiItemFullO_ptr(layout,
|
||||
ot,
|
||||
"Single Override Type",
|
||||
ICON_NONE,
|
||||
NULL,
|
||||
WM_OP_INVOKE_DEFAULT,
|
||||
0,
|
||||
&op_ptr);
|
||||
RNA_boolean_set(&op_ptr, "all", false);
|
||||
#endif
|
||||
uiItemBooleanO(layout,
|
||||
|
@ -678,9 +682,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
|
|||
}
|
||||
else {
|
||||
#if 0 /* Disabled for now. */
|
||||
uiItemFullO(
|
||||
layout, "UI_OT_override_type_set_button", "Override Type", ICON_NONE,
|
||||
NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
|
||||
uiItemFullO(layout,
|
||||
"UI_OT_override_type_set_button",
|
||||
"Override Type",
|
||||
ICON_NONE,
|
||||
NULL,
|
||||
WM_OP_INVOKE_DEFAULT,
|
||||
0,
|
||||
&op_ptr);
|
||||
RNA_boolean_set(&op_ptr, "all", false);
|
||||
#endif
|
||||
uiItemBooleanO(layout,
|
||||
|
@ -896,9 +905,15 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
|
|||
if (kmi) {
|
||||
if (ISKEYBOARD(kmi->type)) {
|
||||
#if 0 /* would rather use a block but, but gets weirdly positioned... */
|
||||
uiDefBlockBut(
|
||||
block, menu_change_shortcut, but, "Change Shortcut",
|
||||
0, 0, uiLayoutGetWidth(layout), UI_UNIT_Y, "");
|
||||
uiDefBlockBut(block,
|
||||
menu_change_shortcut,
|
||||
but,
|
||||
"Change Shortcut",
|
||||
0,
|
||||
0,
|
||||
uiLayoutGetWidth(layout),
|
||||
UI_UNIT_Y,
|
||||
"");
|
||||
#endif
|
||||
|
||||
but2 = uiDefIconTextBut(block,
|
||||
|
@ -1005,9 +1020,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
|
|||
|
||||
/* XXX inactive option, not for public! */
|
||||
#if 0
|
||||
uiItemFullO(
|
||||
layout, "WM_OT_doc_edit", "Submit Description", ICON_NONE,
|
||||
NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr_props);
|
||||
uiItemFullO(layout,
|
||||
"WM_OT_doc_edit",
|
||||
"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_new", RNA_property_description(but->rnaprop));
|
||||
#endif
|
||||
|
|
|
@ -167,8 +167,13 @@ void UI_draw_roundbox_4fv(
|
|||
{
|
||||
#if 0
|
||||
float vec[7][2] = {
|
||||
{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
|
||||
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805},
|
||||
{0.195, 0.02},
|
||||
{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;
|
||||
|
||||
|
@ -270,7 +275,10 @@ void UI_draw_roundbox_4fv(
|
|||
}
|
||||
|
||||
#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] = {
|
||||
fac * col1[0] + (1.0f - fac) * col2[0],
|
||||
|
@ -296,8 +304,13 @@ void UI_draw_roundbox_shade_x(bool filled,
|
|||
{
|
||||
#if 0
|
||||
float vec[7][2] = {
|
||||
{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
|
||||
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805},
|
||||
{0.195, 0.02},
|
||||
{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 idiv = 1.0f / div;
|
||||
|
@ -440,13 +453,24 @@ void UI_draw_roundbox_shade_x(bool filled,
|
|||
#if 0 /* unused */
|
||||
/* linear vertical shade within button or in outline */
|
||||
/* view2d scrollers use it */
|
||||
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])
|
||||
{
|
||||
float vec[7][2] = {
|
||||
{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
|
||||
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805},
|
||||
{0.195, 0.02},
|
||||
{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 idiv = 1.0f / div;
|
||||
|
@ -473,7 +497,6 @@ void UI_draw_roundbox_shade_y(
|
|||
colRight[1] = max_ff(0.0f, col[1] + shaderight);
|
||||
colRight[2] = max_ff(0.0f, col[2] + shaderight);
|
||||
|
||||
|
||||
vert_count += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1;
|
||||
vert_count += (roundboxtype & UI_CNR_TOP_RIGHT) ? 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 */
|
||||
#if 0 /* Old Method (pre 2.8) */
|
||||
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
|
||||
/* Compute final visibility to match old method result. */
|
||||
/* TODO we could just find a better fit function inside the shader instead of this. */
|
||||
|
|
|
@ -1538,7 +1538,8 @@ void uiItemsFullEnumO(uiLayout *layout,
|
|||
* introduction of GP editing modes)
|
||||
*/
|
||||
#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
|
||||
RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item_array, &totitem, &free);
|
||||
#endif
|
||||
|
|
|
@ -2354,8 +2354,14 @@ void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C)
|
|||
/* Disable for now, doesn't fit well in popover. */
|
||||
#if 0
|
||||
/* Repeat button with operator name as text. */
|
||||
uiItemFullO(layout, "SCREEN_OT_repeat_last", RNA_struct_ui_name(op->type->srna),
|
||||
ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
|
||||
uiItemFullO(layout,
|
||||
"SCREEN_OT_repeat_last",
|
||||
RNA_struct_ui_name(op->type->srna),
|
||||
ICON_NONE,
|
||||
NULL,
|
||||
WM_OP_INVOKE_DEFAULT,
|
||||
0,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
if (WM_operator_repeat_check(C, op)) {
|
||||
|
|
|
@ -102,8 +102,7 @@ static int validate_undoLatt(void *data, void *edata)
|
|||
UndoLattice *ult = (UndoLattice *)data;
|
||||
EditLatt *editlatt = (EditLatt *)edata;
|
||||
|
||||
return (ult->pntsu == editlatt->latt->pntsu &&
|
||||
ult->pntsv == editlatt->latt->pntsv &&
|
||||
return (ult->pntsu == editlatt->latt->pntsu && ult->pntsv == editlatt->latt->pntsv &&
|
||||
ult->pntsw == editlatt->latt->pntsw);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -86,8 +86,7 @@ static float edbm_rip_edgedist_squared(ARegion *ar,
|
|||
|
||||
#if 0
|
||||
static float edbm_rip_linedist(
|
||||
ARegion *ar, float mat[4][4],
|
||||
const float co1[3], const float co2[3], const float mvalf[2])
|
||||
ARegion *ar, float mat[4][4], const float co1[3], const float co2[3], const float mvalf[2])
|
||||
{
|
||||
float vec1[2], vec2[2];
|
||||
|
||||
|
|
|
@ -1173,9 +1173,7 @@ bool EDBM_unified_findnearest_from_raycast(ViewContext *vc,
|
|||
float point[3];
|
||||
#if 0
|
||||
const float dist_sq_test = dist_squared_ray_to_seg_v3(
|
||||
ray_origin, ray_direction,
|
||||
e->v1->co, e->v2->co,
|
||||
point, &depth);
|
||||
ray_origin, ray_direction, e->v1->co, e->v2->co, point, &depth);
|
||||
#else
|
||||
if (coords) {
|
||||
mid_v3_v3v3(
|
||||
|
@ -1801,7 +1799,8 @@ static bool mouse_mesh_loop(
|
|||
length_2 = len_squared_v2v2(mvalf, v2_co);
|
||||
}
|
||||
#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));
|
||||
#endif
|
||||
BM_select_history_store(em->bm, (length_1 < length_2) ? eed->v1 : eed->v2);
|
||||
|
|
|
@ -363,10 +363,8 @@ void EDBM_mesh_load(Main *bmain, Object *ob)
|
|||
* cycles.
|
||||
*/
|
||||
#if 0
|
||||
for (Object *other_object = bmain->objects.first;
|
||||
other_object != NULL;
|
||||
other_object = other_object->id.next)
|
||||
{
|
||||
for (Object *other_object = bmain->objects.first; other_object != NULL;
|
||||
other_object = other_object->id.next) {
|
||||
if (other_object->data == ob->data) {
|
||||
BKE_object_free_derived_caches(other_object);
|
||||
}
|
||||
|
|
|
@ -900,17 +900,15 @@ int ED_mesh_mirror_get_vert(Object *ob, int index)
|
|||
|
||||
#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 cent_vec[2];
|
||||
float cent[2];
|
||||
|
||||
/* ignore nan verts */
|
||||
if (isnan(uv[0]) || !isfinite(uv[0]) ||
|
||||
isnan(uv[1]) || !isfinite(uv[1])
|
||||
)
|
||||
{
|
||||
if (isnan(uv[0]) || !isfinite(uv[0]) || isnan(uv[1]) || !isfinite(uv[1])) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -937,15 +935,14 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float
|
|||
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
uv_poly_center(efa, cent, cd_loop_uv_offset);
|
||||
|
||||
if ( (fabsf(cent[0] - cent_vec[0]) < 0.001f) && (fabsf(cent[1] - cent_vec[1]) < 0.001f) ) {
|
||||
if ((fabsf(cent[0] - cent_vec[0]) < 0.001f) && (fabsf(cent[1] - cent_vec[1]) < 0.001f)) {
|
||||
BMIter liter;
|
||||
BMLoop *l;
|
||||
|
||||
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1339,11 +1339,13 @@ void OBJECT_OT_track_set(wmOperatorType *ot)
|
|||
#if 0
|
||||
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;
|
||||
|
||||
if (sce == NULL) return;
|
||||
if (sce->id.lib) return;
|
||||
if (sce == NULL)
|
||||
return;
|
||||
if (sce->id.lib)
|
||||
return;
|
||||
|
||||
for (base = FIRSTBASE; base; base = base->next) {
|
||||
if (BASE_SELECTED(v3d, base)) {
|
||||
|
|
|
@ -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 */
|
||||
#if 0
|
||||
if (ED_view3d_project_int_global(data->vc.ar, co, screen_co,
|
||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK)
|
||||
{
|
||||
if (ED_view3d_project_int_global(data->vc.ar,
|
||||
co,
|
||||
screen_co,
|
||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN |
|
||||
V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1241,7 +1241,7 @@ static void icon_preview_endjob(void *customdata)
|
|||
if (prv_img->gputexture[i]) {
|
||||
GPU_texture_free(prv_img->gputexture[i]);
|
||||
prv_img->gputexture[i] = NULL;
|
||||
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ip->id);
|
||||
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ip->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
||||
immUniformColor4f(drand48(), drand48(), drand48(), 0.1f);
|
||||
immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin,
|
||||
ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin);
|
||||
immRectf(pos,
|
||||
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();
|
||||
GPU_blend(false);
|
||||
#endif
|
||||
|
|
|
@ -3660,8 +3660,10 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
|
|||
RV3D_ORTHO);
|
||||
/* forcing camera is distracting */
|
||||
#if 0
|
||||
if (v3d->camera) 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);
|
||||
if (v3d->camera)
|
||||
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
|
||||
(void)v3d;
|
||||
#endif
|
||||
|
|
|
@ -89,8 +89,7 @@ static void workspace_change_update(WorkSpace *workspace_new,
|
|||
/* needs to be done before changing mode! (to ensure right context) */
|
||||
UNUSED_VARS(workspace_old, workspace_new, C, wm);
|
||||
#if 0
|
||||
Object *ob_act = CTX_data_active_object(C)
|
||||
eObjectMode mode_old = workspace_old->object_mode;
|
||||
Object *ob_act = CTX_data_active_object(C) eObjectMode mode_old = workspace_old->object_mode;
|
||||
eObjectMode mode_new = workspace_new->object_mode;
|
||||
|
||||
if (mode_old != mode_new) {
|
||||
|
|
|
@ -632,9 +632,15 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
|
|||
/* duplicate warning, see texpaint_init */
|
||||
#if 0
|
||||
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)
|
||||
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
|
||||
MEM_freeN(pop);
|
||||
}
|
||||
|
|
|
@ -2351,8 +2351,10 @@ static float angle_2d_clockwise(const float p1[2], const float p2[2], const floa
|
|||
{
|
||||
float v1[2], v2[2];
|
||||
|
||||
v1[0] = p1[0] - p2[0]; v1[1] = p1[1] - p2[1];
|
||||
v2[0] = p3[0] - p2[0]; v2[1] = p3[1] - p2[1];
|
||||
v1[0] = p1[0] - p2[0];
|
||||
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]);
|
||||
}
|
||||
|
@ -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 0
|
||||
project_paint_undo_tiles_init(
|
||||
&bounds_px, ps->projImages + image_index, tmpibuf,
|
||||
tile_width, threaded, ps->do_masking);
|
||||
&bounds_px, ps->projImages + image_index, tmpibuf, tile_width, threaded, ps->do_masking);
|
||||
#endif
|
||||
/* clip face and */
|
||||
|
||||
|
|
|
@ -417,7 +417,8 @@ static void paint_undosys_step_decode_restore_ids(ImageUndoStep *us)
|
|||
{
|
||||
ID *image_prev[2] = {NULL};
|
||||
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
|
||||
|
|
|
@ -479,8 +479,7 @@ static void paint_brush_stroke_add_step(bContext *C,
|
|||
if (tablet && (pressure >= 0.99f) &&
|
||||
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -493,8 +492,7 @@ static void paint_brush_stroke_add_step(bContext *C,
|
|||
if (tablet && (pressure < 0.0002f) &&
|
||||
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -565,9 +565,11 @@ static void do_weight_paint_normalize_all_locked_try_active(MDeformVert *dvert,
|
|||
}
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
static bool has_unselected_unlocked_bone_group(
|
||||
int defbase_tot, bool *defbase_sel, int selected,
|
||||
const bool *lock_flags, const bool *vgroup_validmap)
|
||||
static bool has_unselected_unlocked_bone_group(int defbase_tot,
|
||||
bool *defbase_sel,
|
||||
int selected,
|
||||
const bool *lock_flags,
|
||||
const bool *vgroup_validmap)
|
||||
{
|
||||
int i;
|
||||
if (defbase_tot == selected) {
|
||||
|
|
|
@ -676,7 +676,10 @@ static float frontface(const Brush *br,
|
|||
|
||||
#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)) {
|
||||
float t1[3], t2[3], t3[3], dist;
|
||||
|
|
|
@ -275,8 +275,7 @@ static void box_select_action(bAnimContext *ac, const rcti rect, short mode, sho
|
|||
/* loop over data selecting */
|
||||
switch (ale->type) {
|
||||
#if 0 /* XXX: Keyframes are not currently shown here */
|
||||
case ANIMTYPE_GPDATABLOCK:
|
||||
{
|
||||
case ANIMTYPE_GPDATABLOCK: {
|
||||
bGPdata *gpd = ale->data;
|
||||
bGPDlayer *gpl;
|
||||
for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
|
||||
|
@ -478,8 +477,7 @@ static void region_select_action_keys(
|
|||
/* loop over data selecting */
|
||||
switch (ale->type) {
|
||||
#if 0 /* XXX: Keyframes are not currently shown here */
|
||||
case ANIMTYPE_GPDATABLOCK:
|
||||
{
|
||||
case ANIMTYPE_GPDATABLOCK: {
|
||||
bGPdata *gpd = ale->data;
|
||||
bGPDlayer *gpl;
|
||||
for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
|
||||
|
|
|
@ -144,14 +144,12 @@ static void console_lb_debug__internal(ListBase *lb)
|
|||
for (cl = lb->first; cl; cl = cl->next)
|
||||
printf("<%s> ", cl->line);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
|
||||
static void console_history_debug(const bContext *C)
|
||||
{
|
||||
SpaceConsole *sc = CTX_wm_space_console(C);
|
||||
|
||||
|
||||
console_lb_debug__internal(&sc->history);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2420,11 +2420,13 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
|
|||
|
||||
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]) {
|
||||
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) {
|
||||
|
@ -2472,7 +2474,8 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
|
|||
idcode = groupname_to_code(filelist->filelist.root);
|
||||
|
||||
lb = which_libbase(bmain, idcode);
|
||||
if (lb == NULL) return;
|
||||
if (lb == NULL)
|
||||
return;
|
||||
|
||||
filelist->filelist.nbr_entries = 0;
|
||||
for (id = lb->first; id; id = id->next) {
|
||||
|
@ -2523,19 +2526,21 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
|
|||
}
|
||||
}
|
||||
# endif
|
||||
// files->entry->nr = totbl + 1;
|
||||
// files->entry->nr = totbl + 1;
|
||||
files->entry->poin = id;
|
||||
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;
|
||||
}
|
||||
// if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us);
|
||||
// else if (id->lib) BLI_snprintf(files->extra, sizeof(files->entry->extra), "L %d", id->us);
|
||||
// else if (fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "F %d", id->us);
|
||||
// else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us);
|
||||
// if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us);
|
||||
// else if (id->lib) BLI_snprintf(files->extra, sizeof(files->entry->extra), "L %d", id->us);
|
||||
// else if (fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "F %d", id->us);
|
||||
// else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us);
|
||||
|
||||
if (id->lib) {
|
||||
if (totlib == 0) firstlib = files;
|
||||
if (totlib == 0)
|
||||
firstlib = files;
|
||||
totlib++;
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,8 @@ void image_preview_event(int event)
|
|||
BIF_store_spare();
|
||||
|
||||
/* 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->test_break = NULL;
|
||||
|
@ -203,7 +204,6 @@ void image_preview_event(int event)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* nothing drawn here, we use it to store values */
|
||||
static void preview_cb(ScrArea *sa, struct uiBlock *block)
|
||||
{
|
||||
|
@ -221,18 +221,24 @@ 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 */
|
||||
|
||||
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);
|
||||
|
||||
/* correction for gla draw */
|
||||
BLI_rcti_translate(disprect, -curarea->winrct.xmin, -curarea->winrct.ymin);
|
||||
|
||||
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 */
|
||||
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);
|
||||
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);
|
||||
|
||||
/* map to render coordinates */
|
||||
|
@ -245,8 +251,7 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block)
|
|||
CLAMP(disprect->xmax, 0, winx);
|
||||
CLAMP(disprect->ymin, 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)
|
||||
|
@ -268,7 +273,6 @@ static bool is_preview_allowed(ScrArea *cur)
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW
|
||||
{
|
||||
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;
|
||||
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);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1063,17 +1067,73 @@ void uiTemplateImage(uiLayout *layout,
|
|||
iuser = ntree_get_active_iuser(scene->nodetree);
|
||||
if (iuser) {
|
||||
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, 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, "");
|
||||
uiDefIconTextBut(block,
|
||||
UI_BTYPE_BUT,
|
||||
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);
|
||||
|
||||
if (iuser->frames)
|
||||
BLI_snprintf(str, sizeof(str), "(%d) Frames:", iuser->framenr);
|
||||
else strcpy(str, "Frames:");
|
||||
else
|
||||
strcpy(str, "Frames:");
|
||||
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, UI_BTYPE_NUM, imagechanged, "StartFr:", 160, 90, 150, 20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie");
|
||||
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,
|
||||
UI_BTYPE_NUM,
|
||||
imagechanged,
|
||||
"StartFr:",
|
||||
160,
|
||||
90,
|
||||
150,
|
||||
20,
|
||||
&iuser->sfra,
|
||||
1.0,
|
||||
MAXFRAMEF,
|
||||
0,
|
||||
0,
|
||||
"Global starting frame of the movie");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -3650,8 +3650,12 @@ static int image_record_composite_apply(bContext *C, wmOperator *op)
|
|||
|
||||
BKE_image_all_free_anim_ibufs(scene->r.cfra);
|
||||
ntreeCompositTagAnimated(scene->nodetree);
|
||||
ntreeCompositExecTree(scene->nodetree, &scene->r, 0, scene->r.cfra != rcd->old_cfra,
|
||||
&scene->view_settings, &scene->display_settings); /* 1 is no previews */
|
||||
ntreeCompositExecTree(scene->nodetree,
|
||||
&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));
|
||||
|
||||
|
@ -3714,7 +3718,8 @@ static int image_record_composite_exec(bContext *C, wmOperator *op)
|
|||
if (!image_record_composite_init(C, op))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
while (image_record_composite_apply(C, op)) {}
|
||||
while (image_record_composite_apply(C, op)) {
|
||||
}
|
||||
|
||||
image_record_composite_exit(C, op);
|
||||
|
||||
|
|
|
@ -745,7 +745,8 @@ static void image_main_region_draw(const bContext *C, ARegion *ar)
|
|||
|
||||
/* scrollers? */
|
||||
#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_free(scrollers);
|
||||
#endif
|
||||
|
|
|
@ -46,11 +46,16 @@ int info_report_mask(SpaceInfo *UNUSED(sinfo))
|
|||
#if 0
|
||||
int report_mask = 0;
|
||||
|
||||
if (sinfo->rpt_mask & INFO_RPT_DEBUG) report_mask |= RPT_DEBUG_ALL;
|
||||
if (sinfo->rpt_mask & INFO_RPT_INFO) report_mask |= RPT_INFO_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;
|
||||
if (sinfo->rpt_mask & INFO_RPT_DEBUG)
|
||||
report_mask |= RPT_DEBUG_ALL;
|
||||
if (sinfo->rpt_mask & INFO_RPT_INFO)
|
||||
report_mask |= RPT_INFO_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;
|
||||
#endif
|
||||
|
@ -71,10 +76,8 @@ static int report_replay_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
sc->type = CONSOLE_TYPE_PYTHON;
|
||||
|
||||
for (report = reports->list.last; report; report = report->prev) {
|
||||
if ((report->type & report_mask) &&
|
||||
(report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) &&
|
||||
(report->flag & SELECT))
|
||||
{
|
||||
if ((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) &&
|
||||
(report->flag & SELECT)) {
|
||||
console_history_add_str(sc, report->message, 0);
|
||||
WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL);
|
||||
|
||||
|
|
|
@ -204,7 +204,8 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
|
|||
bNode *node = node_v;
|
||||
Tex *tex;
|
||||
|
||||
if (node->menunr < 1) return;
|
||||
if (node->menunr < 1)
|
||||
return;
|
||||
|
||||
if (node->id) {
|
||||
id_us_min(node->id);
|
||||
|
|
|
@ -804,7 +804,8 @@ static int edit_node_invoke_properties(bContext *C, wmOperator *op)
|
|||
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;
|
||||
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");
|
||||
switch (in_out) {
|
||||
case SOCK_IN: sock = BLI_findlink(&node->inputs, sockindex); break;
|
||||
case SOCK_OUT: sock = BLI_findlink(&node->outputs, sockindex); break;
|
||||
case SOCK_IN:
|
||||
sock = BLI_findlink(&node->inputs, sockindex);
|
||||
break;
|
||||
case SOCK_OUT:
|
||||
sock = BLI_findlink(&node->outputs, sockindex);
|
||||
break;
|
||||
}
|
||||
|
||||
if (rnode)
|
||||
|
|
|
@ -100,7 +100,7 @@ static void outliner_width(SpaceOutliner *soops, ListBase *lb, int *w)
|
|||
{
|
||||
TreeElement *te = lb->first;
|
||||
while (te) {
|
||||
// TreeStoreElem *tselem = TREESTORE(te);
|
||||
// TreeStoreElem *tselem = TREESTORE(te);
|
||||
|
||||
// XXX fixme... te->xend is not set yet
|
||||
if (!TSELEM_OPEN(tselem, soops)) {
|
||||
|
|
|
@ -1296,8 +1296,8 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot)
|
|||
#if 0
|
||||
|
||||
/* find next element that has this name */
|
||||
static TreeElement *outliner_find_name(SpaceOutliner *soops, ListBase *lb, char *name, int flags,
|
||||
TreeElement *prev, int *prevFound)
|
||||
static TreeElement *outliner_find_name(
|
||||
SpaceOutliner *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
|
||||
{
|
||||
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);
|
||||
if (tes) return tes;
|
||||
if (tes)
|
||||
return tes;
|
||||
}
|
||||
|
||||
/* nothing valid found */
|
||||
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);
|
||||
TreeElement *te = NULL;
|
||||
|
@ -1354,10 +1356,10 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner
|
|||
else {
|
||||
/* pop up panel - no previous, or user didn't want search after previous */
|
||||
name[0] = '\0';
|
||||
// XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) {
|
||||
// te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
|
||||
// }
|
||||
// else return; /* XXX RETURN! XXX */
|
||||
// XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) {
|
||||
// te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
|
||||
// }
|
||||
// else return; /* XXX RETURN! XXX */
|
||||
}
|
||||
|
||||
/* do selection and reveal */
|
||||
|
@ -1374,7 +1376,8 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner
|
|||
|
||||
/* make te->ys center of view */
|
||||
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.ymin = (float)(ytop - BLI_rctf_size_y(&ar->v2d.mask));
|
||||
|
||||
|
|
|
@ -372,9 +372,12 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
|
|||
soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index);
|
||||
#if 0 /* disabled as it needs to be reworked for recoded constraints system */
|
||||
target = get_constraint_target(con, &str);
|
||||
if (str && str[0]) ten1->name = str;
|
||||
else if (target) ten1->name = target->id.name + 2;
|
||||
else ten1->name = con->name;
|
||||
if (str && str[0])
|
||||
ten1->name = str;
|
||||
else if (target)
|
||||
ten1->name = target->id.name + 2;
|
||||
else
|
||||
ten1->name = con->name;
|
||||
#endif
|
||||
ten1->name = con->name;
|
||||
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);
|
||||
#if 0 /* disabled due to constraints system targets recode... code here needs review */
|
||||
target = get_constraint_target(con, &str);
|
||||
if (str && str[0]) ten->name = str;
|
||||
else if (target) ten->name = target->id.name + 2;
|
||||
else ten->name = con->name;
|
||||
if (str && str[0])
|
||||
ten->name = str;
|
||||
else if (target)
|
||||
ten->name = target->id.name + 2;
|
||||
else
|
||||
ten->name = con->name;
|
||||
#endif
|
||||
ten->name = con->name;
|
||||
ten->directdata = con;
|
||||
|
@ -1548,15 +1554,20 @@ static int treesort_obtype_alpha(const void *v1, const void *v2)
|
|||
else {
|
||||
/* 2nd we check ob type */
|
||||
if (x1->idcode == ID_OB && x2->idcode == ID_OB) {
|
||||
if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1;
|
||||
else if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1;
|
||||
else return 0;
|
||||
if (((Object *)x1->id)->type > ((Object *)x2->id)->type)
|
||||
return 1;
|
||||
else if (((Object *)x1->id)->type > ((Object *)x2->id)->type)
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
int comp = strcmp(x1->name, x2->name);
|
||||
|
||||
if (comp > 0) return 1;
|
||||
else if (comp < 0) return -1;
|
||||
if (comp > 0)
|
||||
return 1;
|
||||
else if (comp < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1201,13 +1201,19 @@ void sequencer_draw_maskedit(const bContext *C, Scene *scene, ARegion *ar, Space
|
|||
width = (scene->r.size * scene->r.xsch) / 100;
|
||||
height = (scene->r.size * scene->r.ysch) / 100;
|
||||
|
||||
ED_mask_draw_region(
|
||||
mask, ar,
|
||||
0, 0, 0, /* TODO */
|
||||
width, height,
|
||||
aspx, aspy,
|
||||
false, true,
|
||||
NULL, C);
|
||||
ED_mask_draw_region(mask,
|
||||
ar,
|
||||
0,
|
||||
0,
|
||||
0, /* TODO */
|
||||
width,
|
||||
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;
|
||||
|
||||
if (sseq->mainb != SEQ_DRAW_SEQUENCE) {
|
||||
give_ibuf_prefetch_request(
|
||||
rectx, recty, (scene->r.cfra), sseq->chanshown,
|
||||
proxy_size);
|
||||
give_ibuf_prefetch_request(rectx, recty, (scene->r.cfra), sseq->chanshown, proxy_size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1036,22 +1036,22 @@ static void set_filter_seq(Scene *scene)
|
|||
Sequence *seq;
|
||||
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->type == SEQ_TYPE_MOVIE) {
|
||||
seq->flag |= SEQ_FILTERY;
|
||||
BKE_sequence_reload_new_file(scene, seq, false);
|
||||
BKE_sequence_calc(scene, seq);
|
||||
}
|
||||
|
||||
}
|
||||
} SEQ_END;
|
||||
}
|
||||
SEQ_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1228,7 +1228,8 @@ bool sequencer_edit_poll(bContext *C)
|
|||
bool sequencer_strip_poll(bContext *C)
|
||||
{
|
||||
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
|
||||
|
||||
|
@ -2886,9 +2887,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
/* Apply aspect, dosnt need to be that accurate */
|
||||
imgwidth = (int)(imgwidth * (scene->r.xasp / scene->r.yasp));
|
||||
|
||||
if (((imgwidth >= width) || (imgheight >= height)) &&
|
||||
((width > 0) && (height > 0)))
|
||||
{
|
||||
if (((imgwidth >= width) || (imgheight >= height)) && ((width > 0) && (height > 0))) {
|
||||
/* Find the zoom value that will fit the image in the image space */
|
||||
zoomX = ((float)width) / ((float)imgwidth);
|
||||
zoomY = ((float)height) / ((float)imgheight);
|
||||
|
@ -2967,7 +2966,11 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot)
|
|||
static const EnumPropertyItem view_type_items[] = {
|
||||
{SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
|
||||
{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},
|
||||
};
|
||||
#endif
|
||||
|
@ -3169,7 +3172,8 @@ static Sequence *sequence_find_parent(Scene *scene, Sequence *child)
|
|||
Sequence *parent = NULL;
|
||||
Sequence *seq;
|
||||
|
||||
if (ed == NULL) return NULL;
|
||||
if (ed == NULL)
|
||||
return NULL;
|
||||
|
||||
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
||||
if ((seq != child) && seq_is_parent(seq, child)) {
|
||||
|
|
|
@ -541,12 +541,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
|||
#if 0 // XXX probably need to redo this differently for 2.5
|
||||
if (marker) {
|
||||
int mval[2], xo, yo;
|
||||
// getmouseco_areawin(mval);
|
||||
// getmouseco_areawin(mval);
|
||||
xo = mval[0];
|
||||
yo = mval[1];
|
||||
|
||||
while (get_mbut()) {
|
||||
// getmouseco_areawin(mval);
|
||||
// getmouseco_areawin(mval);
|
||||
if (abs(mval[0] - xo) + abs(mval[1] - yo) > 4) {
|
||||
transform_markers('g', 0);
|
||||
return;
|
||||
|
|
|
@ -107,7 +107,8 @@ static void txt_format_text(SpaceText *st)
|
|||
{
|
||||
TextLine *linep;
|
||||
|
||||
if (!st->text) return;
|
||||
if (!st->text)
|
||||
return;
|
||||
|
||||
for (linep = st->text->lines.first; linep; linep = linep->next)
|
||||
txt_format_line(st, linep, 0);
|
||||
|
@ -989,18 +990,23 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
|
|||
int i, br, lines;
|
||||
int boxw, boxh, l, x, y /* , top */ /* UNUSED */;
|
||||
|
||||
if (!st || !st->text) return;
|
||||
if (!texttool_text_is_active(st->text)) return;
|
||||
if (!st || !st->text)
|
||||
return;
|
||||
if (!texttool_text_is_active(st->text))
|
||||
return;
|
||||
|
||||
docs = texttool_docs_get();
|
||||
|
||||
if (!docs) return;
|
||||
if (!docs)
|
||||
return;
|
||||
|
||||
text_draw_context_init(st, &tdc);
|
||||
|
||||
/* Count the visible lines to the cursor */
|
||||
for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) ;
|
||||
if (l < 0) return;
|
||||
for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++)
|
||||
;
|
||||
if (l < 0)
|
||||
return;
|
||||
|
||||
if (st->showlinenrs) {
|
||||
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);
|
||||
|
||||
/* 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);
|
||||
|
||||
immUniformThemeColor(TH_BACK);
|
||||
|
@ -1044,9 +1051,12 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
|
|||
|
||||
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++) {
|
||||
if (*p == '\r' && *(++p) != '\n') *(--p) = '\n'; /* Fix line endings */
|
||||
if (*p == '\r' && *(++p) != '\n')
|
||||
*(--p) = '\n'; /* Fix line endings */
|
||||
if (*p == ' ' || *p == '\t')
|
||||
br = i;
|
||||
else if (*p == '\n') {
|
||||
|
@ -1055,7 +1065,9 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
|
|||
y -= st->lheight_dpi;
|
||||
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;
|
||||
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);
|
||||
}
|
||||
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
|
||||
|
|
|
@ -195,13 +195,30 @@ void TEXT_OT_start_find(wmOperatorType *ot)
|
|||
uiPopupMenu *pup;
|
||||
|
||||
pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
|
||||
uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
|
||||
0, "type", FILE_TOP);
|
||||
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);
|
||||
uiItemEnumO(layout,
|
||||
"TEXT_OT_move",
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
|
||||
0,
|
||||
"type",
|
||||
FILE_TOP);
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1646,7 +1646,8 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
|
|||
#if 0
|
||||
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, 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
|
||||
|
||||
/* assign map to operators */
|
||||
|
|
|
@ -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 */
|
||||
#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;
|
||||
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);
|
||||
|
||||
if (ret == V3D_PROJ_RET_OK) {
|
||||
const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]),
|
||||
(float)(mval_cpy[1] - mval[1])};
|
||||
const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]), (float)(mval_cpy[1] - mval[1])};
|
||||
const float zfac = ED_view3d_calc_zfac(rv3d, fp, NULL);
|
||||
ED_view3d_win_to_delta(ar, mval_f, dvec, zfac);
|
||||
sub_v3_v3(fp, dvec);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue