forked from bartvdbraak/blender
style cleanup, brackets in else/if, some indentation.
This commit is contained in:
parent
7b7214c722
commit
31d2ee9bf7
@ -2460,14 +2460,12 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
|
||||
MFace * mface = dm->getTessFaceArray(dm);
|
||||
MTFace * mtface = dm->getTessFaceDataArray(dm, CD_MTFACE);
|
||||
|
||||
if(mtface)
|
||||
{
|
||||
if(mtface) {
|
||||
double dsum = 0.0;
|
||||
int nr_accumulated = 0;
|
||||
int f;
|
||||
|
||||
for ( f=0; f<totface; f++ )
|
||||
{
|
||||
for ( f=0; f < totface; f++ ) {
|
||||
{
|
||||
float * verts[4], * tex_coords[4];
|
||||
const int nr_verts = mface[f].v4!=0 ? 4 : 3;
|
||||
@ -2490,32 +2488,33 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
|
||||
}
|
||||
|
||||
// verify last vertex as well if this is a quad
|
||||
if ( is_degenerate==0 && nr_verts==4 )
|
||||
{
|
||||
if( equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) ||
|
||||
if (is_degenerate == 0 && nr_verts == 4) {
|
||||
if (equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) ||
|
||||
equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2]) )
|
||||
{
|
||||
is_degenerate = 1;
|
||||
}
|
||||
|
||||
// verify the winding is consistent
|
||||
if ( is_degenerate==0 )
|
||||
{
|
||||
if (is_degenerate == 0) {
|
||||
float prev_edge[2];
|
||||
int is_signed = 0;
|
||||
sub_v2_v2v2(prev_edge, tex_coords[0], tex_coords[3]);
|
||||
|
||||
i = 0;
|
||||
while ( is_degenerate==0 && i<4 )
|
||||
{
|
||||
while (is_degenerate == 0 && i < 4) {
|
||||
float cur_edge[2], signed_area;
|
||||
sub_v2_v2v2(cur_edge, tex_coords[(i+1)&0x3], tex_coords[i]);
|
||||
signed_area = prev_edge[0]*cur_edge[1] - prev_edge[1]*cur_edge[0];
|
||||
if ( i==0 ) is_signed = signed_area<0.0f ? 1 : 0;
|
||||
else if((is_signed!=0)!=(signed_area<0.0f)) is_degenerate=1;
|
||||
|
||||
if ( is_degenerate==0 )
|
||||
{
|
||||
if (i == 0 ) {
|
||||
is_signed = (signed_area < 0.0f) ? 1 : 0;
|
||||
}
|
||||
else if((is_signed != 0) != (signed_area < 0.0f)) {
|
||||
is_degenerate = 1;
|
||||
}
|
||||
|
||||
if (is_degenerate == 0) {
|
||||
copy_v2_v2(prev_edge, cur_edge);
|
||||
++i;
|
||||
}
|
||||
@ -2524,13 +2523,11 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
|
||||
}
|
||||
|
||||
// proceed if not a degenerate face
|
||||
if ( is_degenerate==0 )
|
||||
{
|
||||
if (is_degenerate == 0) {
|
||||
int nr_tris_to_pile=0;
|
||||
// quads split at shortest diagonal
|
||||
int offs = 0; // initial triangulation is 0,1,2 and 0, 2, 3
|
||||
if ( nr_verts==4 )
|
||||
{
|
||||
if (nr_verts == 4) {
|
||||
float pos_len_diag0, pos_len_diag1;
|
||||
float vtmp[3];
|
||||
sub_v3_v3v3(vtmp, verts[2], verts[0]);
|
||||
@ -2538,10 +2535,10 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
|
||||
sub_v3_v3v3(vtmp, verts[3], verts[1]);
|
||||
pos_len_diag1 = dot_v3v3(vtmp, vtmp);
|
||||
|
||||
if(pos_len_diag1<pos_len_diag0)
|
||||
if(pos_len_diag1<pos_len_diag0) {
|
||||
offs=1; // alter split
|
||||
else if(pos_len_diag0==pos_len_diag1) // do UV check instead
|
||||
{
|
||||
}
|
||||
else if(pos_len_diag0==pos_len_diag1) { /* do UV check instead */
|
||||
float tex_len_diag0, tex_len_diag1;
|
||||
|
||||
sub_v2_v2v2(vtmp, tex_coords[2], tex_coords[0]);
|
||||
@ -2549,15 +2546,13 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
|
||||
sub_v2_v2v2(vtmp, tex_coords[3], tex_coords[1]);
|
||||
tex_len_diag1 = dot_v2v2(vtmp, vtmp);
|
||||
|
||||
if(tex_len_diag1<tex_len_diag0)
|
||||
{
|
||||
offs=1; // alter split
|
||||
if (tex_len_diag1<tex_len_diag0) {
|
||||
offs=1; /* alter split */
|
||||
}
|
||||
}
|
||||
}
|
||||
nr_tris_to_pile = nr_verts - 2;
|
||||
if ( nr_tris_to_pile==1 || nr_tris_to_pile==2 )
|
||||
{
|
||||
if (nr_tris_to_pile==1 || nr_tris_to_pile==2) {
|
||||
const int indices[] = {offs+0, offs+1, offs+2, offs+0, offs+2, (offs+3)&0x3 };
|
||||
int t;
|
||||
for ( t=0; t<nr_tris_to_pile; t++ )
|
||||
@ -2598,8 +2593,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
|
||||
dm->auto_bump_scale = use_as_render_bump_scale;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dm->auto_bump_scale = 1.0f;
|
||||
}
|
||||
}
|
||||
|
@ -250,8 +250,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
|
||||
}
|
||||
|
||||
//check boids in own system
|
||||
if(acbr->options & BRULE_ACOLL_WITH_BOIDS)
|
||||
{
|
||||
if (acbr->options & BRULE_ACOLL_WITH_BOIDS) {
|
||||
neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
|
||||
if(neighbors > 1) for(n=1; n<neighbors; n++) {
|
||||
copy_v3_v3(co1, pa->prev_state.co);
|
||||
|
@ -288,8 +288,7 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving)
|
||||
|
||||
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, (mfaces->v4 ? 4 : 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, (mfaces->v4 ? 4 : 3));
|
||||
}
|
||||
|
||||
@ -332,8 +331,7 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
|
||||
|
||||
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, 1);
|
||||
}
|
||||
|
||||
@ -1096,8 +1094,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
|
||||
BLI_linklist_prepend ( &cloth->springs, spring );
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
cloth_free_errorsprings(cloth, edgehash, edgelist);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2543,8 +2543,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
|
||||
ret = 1;
|
||||
ret2 += ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// check for approximated time collisions
|
||||
}
|
||||
}
|
||||
|
@ -426,8 +426,7 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
|
||||
if(col->ob == eff->ob)
|
||||
continue;
|
||||
|
||||
if(collmd->bvhtree)
|
||||
{
|
||||
if (collmd->bvhtree) {
|
||||
BVHTreeRayHit hit;
|
||||
|
||||
hit.index = -1;
|
||||
|
@ -1873,15 +1873,13 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
|
||||
lastbezt= prevbezt + a;
|
||||
|
||||
/* evaluation time at or past endpoints? */
|
||||
if (prevbezt->vec[1][0] >= evaltime)
|
||||
{
|
||||
if (prevbezt->vec[1][0] >= evaltime) {
|
||||
/* before or on first keyframe */
|
||||
if ( (fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (prevbezt->ipo != BEZT_IPO_CONST) &&
|
||||
!(fcu->flag & FCURVE_DISCRETE_VALUES) )
|
||||
{
|
||||
/* linear or bezier interpolation */
|
||||
if (prevbezt->ipo==BEZT_IPO_LIN)
|
||||
{
|
||||
if (prevbezt->ipo==BEZT_IPO_LIN) {
|
||||
/* Use the next center point instead of our own handle for
|
||||
* linear interpolated extrapolate
|
||||
*/
|
||||
@ -1981,8 +1979,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
|
||||
cvalue= lastbezt->vec[1][1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* evaltime occurs somewhere in the middle of the curve */
|
||||
for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++)
|
||||
{
|
||||
@ -1991,8 +1988,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
|
||||
cvalue= bezt->vec[1][1];
|
||||
}
|
||||
/* evaltime occurs within the interval defined by these two keyframes */
|
||||
else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime))
|
||||
{
|
||||
else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime)) {
|
||||
/* value depends on interpolation mode */
|
||||
if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES))
|
||||
{
|
||||
@ -2012,8 +2008,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
|
||||
else
|
||||
cvalue= prevbezt->vec[1][1];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* bezier interpolation */
|
||||
/* v1,v2 are the first keyframe and its 2nd handle */
|
||||
v1[0]= prevbezt->vec[1][0];
|
||||
|
@ -165,8 +165,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
|
||||
pf= vfont->packedfile;
|
||||
|
||||
// We need to copy a tmp font to memory unless it is already there
|
||||
if(!tmpfnt)
|
||||
{
|
||||
if(!tmpfnt) {
|
||||
tpf= MEM_callocN(sizeof(*tpf), "PackedFile");
|
||||
tpf->data= MEM_mallocN(pf->size, "packFile");
|
||||
tpf->size= pf->size;
|
||||
@ -178,11 +177,11 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
|
||||
tmpfnt->vfont= vfont;
|
||||
BLI_addtail(&ttfdata, tmpfnt);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
|
||||
|
||||
if(!tmpfnt)
|
||||
{
|
||||
if (!tmpfnt) {
|
||||
tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
|
||||
|
||||
// Add temporary packed file to globals
|
||||
@ -257,8 +256,7 @@ VFont *load_vfont(Main *bmain, const char *name)
|
||||
}
|
||||
|
||||
// Do not add FO_BUILTIN_NAME to temporary listbase
|
||||
if(strcmp(filename, FO_BUILTIN_NAME))
|
||||
{
|
||||
if (strcmp(filename, FO_BUILTIN_NAME)) {
|
||||
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
|
||||
tmpfnt->pf= tpf;
|
||||
tmpfnt->vfont= vfont;
|
||||
|
@ -66,8 +66,7 @@ static void icon_free(void *val)
|
||||
{
|
||||
Icon* icon = val;
|
||||
|
||||
if (icon)
|
||||
{
|
||||
if (icon) {
|
||||
if (icon->drawinfo_free) {
|
||||
icon->drawinfo_free(icon->drawinfo);
|
||||
}
|
||||
@ -236,8 +235,7 @@ void BKE_icon_changed(int id)
|
||||
|
||||
icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(id));
|
||||
|
||||
if (icon)
|
||||
{
|
||||
if (icon) {
|
||||
PreviewImage *prv = BKE_previewimg_get((ID*)icon->obj);
|
||||
|
||||
/* all previews changed */
|
||||
@ -302,8 +300,7 @@ void BKE_icon_set(int icon_id, struct Icon* icon)
|
||||
|
||||
old_icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
|
||||
|
||||
if (old_icon)
|
||||
{
|
||||
if (old_icon) {
|
||||
printf("BKE_icon_set: Internal error, icon already set: %d\n", icon_id);
|
||||
return;
|
||||
}
|
||||
|
@ -202,12 +202,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int
|
||||
int x, y;
|
||||
float blend_half= blend * 0.5f;
|
||||
|
||||
for(y= 0; y < height; y++)
|
||||
{
|
||||
for(x= 0; x < width; x++)
|
||||
{
|
||||
if( ( (y/size)%2 == 1 && (x/size)%2 == 1 ) || ( (y/size)%2 == 0 && (x/size)%2 == 0 ) )
|
||||
{
|
||||
for (y= 0; y < height; y++) {
|
||||
for (x= 0; x < width; x++) {
|
||||
if (((y / size) % 2 == 1 && (x / size) % 2 == 1 ) || ( (y / size) % 2 == 0 && (x / size) % 2 == 0 )) {
|
||||
if (rect) {
|
||||
rect[0]= (char)BLEND_CHAR(rect[0], blend);
|
||||
rect[1]= (char)BLEND_CHAR(rect[1], blend);
|
||||
@ -251,12 +248,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int
|
||||
static void checker_board_grid_fill(unsigned char *rect, float *rect_float, int width, int height, float blend)
|
||||
{
|
||||
int x, y;
|
||||
for(y= 0; y < height; y++)
|
||||
{
|
||||
for(x= 0; x < width; x++)
|
||||
{
|
||||
if( ((y % 32) == 0) || ((x % 32) == 0) || x == 0 )
|
||||
{
|
||||
for(y= 0; y < height; y++) {
|
||||
for(x= 0; x < width; x++) {
|
||||
if (((y % 32) == 0) || ((x % 32) == 0) || x == 0) {
|
||||
if (rect) {
|
||||
rect[0]= BLEND_CHAR(rect[0], blend);
|
||||
rect[1]= BLEND_CHAR(rect[1], blend);
|
||||
|
@ -248,8 +248,7 @@ int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
|
||||
//move to next edge
|
||||
edge = (edge+1)%3;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//move to next tri
|
||||
int twinedge = -1;
|
||||
for (k=0; k<3; k++)
|
||||
|
@ -352,8 +352,7 @@ NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker)
|
||||
* otherwise default to length of 10 frames
|
||||
*/
|
||||
#ifdef WITH_AUDASPACE
|
||||
if (speaker->sound)
|
||||
{
|
||||
if (speaker->sound) {
|
||||
AUD_SoundInfo info = AUD_getInfo(speaker->sound->playback_handle);
|
||||
|
||||
strip->end = (float)ceil((double)info.length * FPS);
|
||||
@ -1395,8 +1394,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
|
||||
* is directly followed/preceeded by another strip, forming an
|
||||
* 'island' of continuous strips
|
||||
*/
|
||||
if ( (ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0) )
|
||||
{
|
||||
if ((ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0)) {
|
||||
/* start overlaps - pick the largest overlap */
|
||||
if ( ((ps && ns) && (*ps > *ns)) || (ps) )
|
||||
nls->blendin= *ps - nls->start;
|
||||
@ -1406,8 +1404,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
|
||||
else /* no overlap allowed/needed */
|
||||
nls->blendin= 0.0f;
|
||||
|
||||
if ( (pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0) )
|
||||
{
|
||||
if ((pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0)) {
|
||||
/* end overlaps - pick the largest overlap */
|
||||
if ( ((pe && ne) && (*pe > *ne)) || (pe) )
|
||||
nls->blendout= nls->end - *pe;
|
||||
|
@ -435,8 +435,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
|
||||
ocr->disp[0] = INTERP(oc->_disp_x);
|
||||
ocr->disp[2] = INTERP(oc->_disp_z);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ocr->disp[0] = 0.0;
|
||||
ocr->disp[2] = 0.0;
|
||||
}
|
||||
@ -479,8 +478,7 @@ void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i,int j)
|
||||
ocr->disp[0] = oc->_disp_x[i*oc->_N+j];
|
||||
ocr->disp[2] = oc->_disp_z[i*oc->_N+j];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ocr->disp[0] = 0.0f;
|
||||
ocr->disp[2] = 0.0f;
|
||||
}
|
||||
|
@ -543,11 +543,9 @@ void psys_free(Object *ob, ParticleSystem * psys)
|
||||
}
|
||||
|
||||
// check if we are last non-visible particle system
|
||||
for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
|
||||
if(tpsys->part)
|
||||
{
|
||||
if(ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR))
|
||||
{
|
||||
for (tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
|
||||
if (tpsys->part) {
|
||||
if (ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) {
|
||||
nr++;
|
||||
break;
|
||||
}
|
||||
@ -3487,16 +3485,14 @@ void object_remove_particle_system(Scene *scene, Object *ob)
|
||||
return;
|
||||
|
||||
/* clear all other appearances of this pointer (like on smoke flow modifier) */
|
||||
if((md = modifiers_findByType(ob, eModifierType_Smoke)))
|
||||
{
|
||||
if ((md = modifiers_findByType(ob, eModifierType_Smoke))) {
|
||||
SmokeModifierData *smd = (SmokeModifierData *)md;
|
||||
if((smd->type == MOD_SMOKE_TYPE_FLOW) && smd->flow && smd->flow->psys)
|
||||
if(smd->flow->psys == psys)
|
||||
smd->flow->psys = NULL;
|
||||
}
|
||||
|
||||
if((md = modifiers_findByType(ob, eModifierType_DynamicPaint)))
|
||||
{
|
||||
if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) {
|
||||
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
|
||||
if(pmd->brush && pmd->brush->psys)
|
||||
if(pmd->brush->psys == psys)
|
||||
|
@ -236,8 +236,7 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
|
||||
|
||||
hit_tmp.dist *= mat4_to_scale( ((SpaceTransform*)transf)->local2target );
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
co = vert;
|
||||
no = dir;
|
||||
}
|
||||
@ -303,8 +302,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
|
||||
{
|
||||
if(calc->vert == NULL) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//The code supports any axis that is a combination of X,Y,Z
|
||||
//although currently UI only allows to set the 3 different axis
|
||||
if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f;
|
||||
@ -355,8 +353,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
|
||||
copy_v3_v3(tmp_no, proj_axis);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
copy_v3_v3(tmp_co, co);
|
||||
copy_v3_v3(tmp_no, proj_axis);
|
||||
}
|
||||
@ -439,12 +436,10 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
|
||||
if(weight == 0.0f) continue;
|
||||
|
||||
//Convert the vertex to tree coordinates
|
||||
if(calc->vert)
|
||||
{
|
||||
if(calc->vert) {
|
||||
copy_v3_v3(tmp_co, calc->vert[i].co);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
copy_v3_v3(tmp_co, co);
|
||||
}
|
||||
space_transform_apply(&calc->local2target, tmp_co);
|
||||
@ -469,8 +464,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
|
||||
//Make the vertex stay on the front side of the face
|
||||
madd_v3_v3v3fl(tmp_co, nearest.co, nearest.no, calc->keepDist);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
|
||||
float dist = sasqrt( nearest.dist );
|
||||
if(dist > FLT_EPSILON)
|
||||
|
@ -211,8 +211,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
|
||||
smd->domain->res[1] = (int)(size[1] * scale + 0.5);
|
||||
smd->domain->res[2] = (int)(size[2] * scale + 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
scale = res / size[2];
|
||||
smd->domain->dx = size[2] / res;
|
||||
smd->domain->res[2] = res;
|
||||
@ -220,8 +219,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
|
||||
smd->domain->res[1] = (int)(size[1] * scale + 0.5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if(size[1] > size[2])
|
||||
{
|
||||
scale = res / size[1];
|
||||
@ -230,8 +228,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
|
||||
smd->domain->res[0] = (int)(size[0] * scale + 0.5);
|
||||
smd->domain->res[2] = (int)(size[2] * scale + 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
scale = res / size[2];
|
||||
smd->domain->dx = size[2] / res;
|
||||
smd->domain->res[2] = res;
|
||||
@ -378,8 +375,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
|
||||
sub_v3_v3v3(side1, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
|
||||
sub_v3_v3v3(side2, mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
sub_v3_v3v3(side1, mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co);
|
||||
sub_v3_v3v3(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
|
||||
}
|
||||
@ -410,8 +406,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
|
||||
copy_v3_v3(p2, mvert[ mface[i].v3 ].co);
|
||||
copy_v3_v3(p3, mvert[ mface[i].v4 ].co);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
copy_v3_v3(p2, mvert[ mface[i].v2 ].co);
|
||||
copy_v3_v3(p3, mvert[ mface[i].v3 ].co);
|
||||
}
|
||||
@ -1073,8 +1068,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
|
||||
if(psys->particles[p].flag & (PARS_NO_DISP|PARS_UNEXIST))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* handle child particle */
|
||||
ChildParticle *cpa = &psys->child[p - totpart];
|
||||
|
||||
@ -1272,8 +1266,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/*
|
||||
for()
|
||||
{
|
||||
@ -1630,14 +1623,12 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int
|
||||
sub_v3_v3v3(tmp, pos, p0);
|
||||
mul_v3_fl(tmp, 1.0 / dx);
|
||||
|
||||
if(correct)
|
||||
{
|
||||
if (correct) {
|
||||
cell[0] = MIN2(res[0] - 1, MAX2(0, (int)floor(tmp[0])));
|
||||
cell[1] = MIN2(res[1] - 1, MAX2(0, (int)floor(tmp[1])));
|
||||
cell[2] = MIN2(res[2] - 1, MAX2(0, (int)floor(tmp[2])));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
cell[0] = (int)floor(tmp[0]);
|
||||
cell[1] = (int)floor(tmp[1]);
|
||||
cell[2] = (int)floor(tmp[2]);
|
||||
@ -1687,8 +1678,7 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa
|
||||
// we're ouside
|
||||
get_cell(p0, res, dx, pos, cell, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// we're inside
|
||||
get_cell(p0, res, dx, light, cell, 1);
|
||||
}
|
||||
|
@ -628,19 +628,16 @@ void sound_seek_scene(struct Main *bmain, struct Scene *scene)
|
||||
AUD_resume(scene->sound_scene_handle);
|
||||
if (scene->sound_scrub_handle && AUD_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID)
|
||||
AUD_seek(scene->sound_scrub_handle, 0);
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (scene->sound_scrub_handle)
|
||||
AUD_stop(scene->sound_scrub_handle);
|
||||
scene->sound_scrub_handle = AUD_pauseAfter(scene->sound_scene_handle, 1 / FPS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (scene->audio.flag & AUDIO_SYNC)
|
||||
AUD_seekSequencer(scene->sound_scene_handle, CFRA / FPS);
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (status == AUD_STATUS_PLAYING)
|
||||
AUD_seek(scene->sound_scene_handle, CFRA / FPS);
|
||||
}
|
||||
@ -731,14 +728,12 @@ void sound_update_scene(struct Scene* scene)
|
||||
{
|
||||
if (speaker->sound)
|
||||
AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0);
|
||||
else
|
||||
{
|
||||
else {
|
||||
AUD_removeSequence(scene->sound_scene, strip->speaker_handle);
|
||||
strip->speaker_handle = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (speaker->sound)
|
||||
{
|
||||
strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0);
|
||||
|
@ -689,8 +689,7 @@ void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int syste
|
||||
|
||||
/* find and substitute all units */
|
||||
for (unit= usys->units; unit->name; unit++) {
|
||||
if (len_max > 0 && (unit->name_alt || unit == unit_def))
|
||||
{
|
||||
if (len_max > 0 && (unit->name_alt || unit == unit_def)) {
|
||||
const char *found= unit_find_str(orig_str, unit->name_short);
|
||||
if (found) {
|
||||
int offset= (int)(found - orig_str);
|
||||
|
@ -627,8 +627,7 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
|
||||
|
||||
if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
|
||||
audio_input_samples = audio_outbuf_size * 8 / c->bits_per_coded_sample / c->channels;
|
||||
else
|
||||
{
|
||||
else {
|
||||
audio_input_samples = c->frame_size;
|
||||
if(c->frame_size * c->channels * sizeof(int16_t) * 4 > audio_outbuf_size)
|
||||
audio_outbuf_size = c->frame_size * c->channels * sizeof(int16_t) * 4;
|
||||
@ -994,8 +993,7 @@ void end_ffmpeg(void)
|
||||
}*/
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
if(audio_mixdown_device)
|
||||
{
|
||||
if (audio_mixdown_device) {
|
||||
AUD_closeReadDevice(audio_mixdown_device);
|
||||
audio_mixdown_device = 0;
|
||||
}
|
||||
|
@ -237,8 +237,7 @@ void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg)
|
||||
{
|
||||
bArgument *a = lookUp(ba, arg, -1, -1);
|
||||
|
||||
if (a)
|
||||
{
|
||||
if (a) {
|
||||
bArgDoc *d = a->doc;
|
||||
|
||||
internalDocPrint(d);
|
||||
@ -251,10 +250,8 @@ void BLI_argsPrintOtherDoc(struct bArgs *ba)
|
||||
{
|
||||
bArgDoc *d;
|
||||
|
||||
for( d = ba->docs.first; d; d = d->next)
|
||||
{
|
||||
if (d->done == 0)
|
||||
{
|
||||
for (d = ba->docs.first; d; d = d->next) {
|
||||
if (d->done == 0) {
|
||||
internalDocPrint(d);
|
||||
}
|
||||
}
|
||||
|
@ -94,8 +94,7 @@ void *BLI_memarena_alloc(MemArena *ma, int size)
|
||||
if (size>ma->cursize) {
|
||||
unsigned char *tmp;
|
||||
|
||||
if(size > ma->bufsize - (ma->align - 1))
|
||||
{
|
||||
if(size > ma->bufsize - (ma->align - 1)) {
|
||||
ma->cursize = PADUP(size+1, ma->align);
|
||||
}
|
||||
else ma->cursize = ma->bufsize;
|
||||
|
@ -99,8 +99,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
|
||||
err= FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP);
|
||||
|
||||
// If loading succeeded, convert the FT glyph to the internal format
|
||||
if(!err)
|
||||
{
|
||||
if(!err) {
|
||||
int *npoints;
|
||||
int *onpoints;
|
||||
|
||||
@ -162,9 +161,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
|
||||
if(k == 0) m = l;
|
||||
|
||||
//virtual conic on-curve points
|
||||
if(k < npoints[j] - 1 )
|
||||
{
|
||||
if( ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) {
|
||||
if (k < npoints[j] - 1) {
|
||||
if (ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) {
|
||||
dx = (ftoutline.points[l].x + ftoutline.points[l+1].x)* scale / 2.0f;
|
||||
dy = (ftoutline.points[l].y + ftoutline.points[l+1].y)* scale / 2.0f;
|
||||
|
||||
@ -291,8 +289,7 @@ static int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode)
|
||||
if(!tf) return FALSE;
|
||||
|
||||
// Load the font to memory
|
||||
if(tf->pf)
|
||||
{
|
||||
if (tf->pf) {
|
||||
err= FT_New_Memory_Face( library,
|
||||
tf->pf->data,
|
||||
tf->pf->size,
|
||||
@ -369,17 +366,14 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
|
||||
lcode= charcode= FT_Get_First_Char(face, &glyph_index);
|
||||
|
||||
// No charmap found from the ttf so we need to figure it out
|
||||
if(glyph_index == 0)
|
||||
{
|
||||
if (glyph_index == 0) {
|
||||
FT_CharMap found = NULL;
|
||||
FT_CharMap charmap;
|
||||
int n;
|
||||
|
||||
for ( n = 0; n < face->num_charmaps; n++ )
|
||||
{
|
||||
for (n = 0; n < face->num_charmaps; n++) {
|
||||
charmap = face->charmaps[n];
|
||||
if (charmap->encoding == FT_ENCODING_APPLE_ROMAN)
|
||||
{
|
||||
if (charmap->encoding == FT_ENCODING_APPLE_ROMAN) {
|
||||
found = charmap;
|
||||
break;
|
||||
}
|
||||
|
@ -182,10 +182,8 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *))
|
||||
if (cmp == NULL) return;
|
||||
if (listbase == NULL) return;
|
||||
|
||||
if (listbase->first != listbase->last)
|
||||
{
|
||||
for( previous = listbase->first, current = previous->next; current; current = next )
|
||||
{
|
||||
if (listbase->first != listbase->last) {
|
||||
for (previous = listbase->first, current = previous->next; current; current = next) {
|
||||
next = current->next;
|
||||
previous = current->prev;
|
||||
|
||||
|
@ -957,8 +957,7 @@ int isect_sweeping_sphere_tri_v3(
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
float t0=(-a+radius)/nordotv;
|
||||
float t1=(-a-radius)/nordotv;
|
||||
|
||||
@ -1279,13 +1278,11 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float
|
||||
|
||||
return 1; /* intersection found */
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -468,8 +468,7 @@ void BLI_path_rel(char *file, const char *relfile)
|
||||
/* the last slash in the file indicates where the path part ends */
|
||||
lslash = BLI_last_slash(temp);
|
||||
|
||||
if (lslash)
|
||||
{
|
||||
if (lslash) {
|
||||
/* find the prefix of the filename that is equal for both filenames.
|
||||
* This is replaced by the two slashes at the beginning */
|
||||
char *p= temp;
|
||||
@ -838,8 +837,7 @@ const char *BLI_getDefaultDocumentFolder(void)
|
||||
*/
|
||||
hResult = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, documentfolder);
|
||||
|
||||
if (hResult == S_OK)
|
||||
{
|
||||
if (hResult == S_OK) {
|
||||
if (BLI_is_dir(documentfolder)) return documentfolder;
|
||||
}
|
||||
|
||||
|
@ -464,12 +464,10 @@ ThreadedWorker *BLI_create_worker(void *(*do_thread)(void *), int tot, int sleep
|
||||
|
||||
worker = MEM_callocN(sizeof(ThreadedWorker), "threadedworker");
|
||||
|
||||
if (tot > RE_MAX_THREAD)
|
||||
{
|
||||
if (tot > RE_MAX_THREAD) {
|
||||
tot = RE_MAX_THREAD;
|
||||
}
|
||||
else if (tot < 1)
|
||||
{
|
||||
else if (tot < 1) {
|
||||
tot= 1;
|
||||
}
|
||||
|
||||
@ -498,25 +496,20 @@ void BLI_insert_work(ThreadedWorker *worker, void *param)
|
||||
WorkParam *p = MEM_callocN(sizeof(WorkParam), "workparam");
|
||||
int index;
|
||||
|
||||
if (BLI_available_threads(&worker->threadbase) == 0)
|
||||
{
|
||||
if (BLI_available_threads(&worker->threadbase) == 0) {
|
||||
index = worker->total;
|
||||
while(index == worker->total)
|
||||
{
|
||||
while(index == worker->total) {
|
||||
PIL_sleep_ms(worker->sleep_time);
|
||||
|
||||
for (index = 0; index < worker->total; index++)
|
||||
{
|
||||
if (worker->busy[index] == 0)
|
||||
{
|
||||
for (index = 0; index < worker->total; index++) {
|
||||
if (worker->busy[index] == 0) {
|
||||
BLI_remove_thread_index(&worker->threadbase, index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
index = BLI_available_thread_index(&worker->threadbase);
|
||||
}
|
||||
|
||||
|
@ -10818,8 +10818,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
sAct->sound3D.min_gain = sound->min_gain;
|
||||
sAct->sound3D.rolloff_factor = sound->attenuation;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
sAct->sound3D.reference_distance = 1.0f;
|
||||
sAct->volume = 1.0f;
|
||||
sAct->sound3D.max_gain = 1.0f;
|
||||
|
@ -362,8 +362,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
|
||||
float co[3];
|
||||
|
||||
if (BMO_elem_flag_test(bm, l->e, BEVEL_FLAG)) {
|
||||
if (BMO_elem_flag_test(bm, l->prev->e, BEVEL_FLAG))
|
||||
{
|
||||
if (BMO_elem_flag_test(bm, l->prev->e, BEVEL_FLAG)) {
|
||||
tag = tags + BM_elem_index_get(l);
|
||||
calc_corner_co(bm, l, fac, co, do_dist, do_even);
|
||||
tag->newv = BM_vert_create(bm, co, l->v);
|
||||
|
@ -2600,8 +2600,7 @@ short ANIM_channel_setting_get (bAnimContext *ac, bAnimListElem *ale, int settin
|
||||
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
|
||||
|
||||
/* 1) check that the setting exists for the current context */
|
||||
if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
|
||||
{
|
||||
if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) {
|
||||
/* 2) get pointer to check for flag in, and the flag to check for */
|
||||
short negflag, ptrsize;
|
||||
int flag;
|
||||
@ -2678,8 +2677,7 @@ void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting
|
||||
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
|
||||
|
||||
/* 1) check that the setting exists for the current context */
|
||||
if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
|
||||
{
|
||||
if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) {
|
||||
/* 2) get pointer to check for flag in, and the flag to check for */
|
||||
short negflag, ptrsize;
|
||||
int flag;
|
||||
@ -2831,8 +2829,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float
|
||||
UI_DrawString(offset, ytext, name);
|
||||
|
||||
/* draw red underline if channel is disabled */
|
||||
if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED))
|
||||
{
|
||||
if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) {
|
||||
// FIXME: replace hardcoded color here, and check on extents!
|
||||
glColor3f(1.0f, 0.0f, 0.0f);
|
||||
glLineWidth(2.0);
|
||||
|
@ -541,8 +541,7 @@ void ANIM_fcurve_delete_from_animdata (bAnimContext *ac, AnimData *adt, FCurve *
|
||||
/* XXX: there's a problem where many actions could build up in the file if multiple
|
||||
* full add/delete cycles are performed on the same objects, but assume that this is rare
|
||||
*/
|
||||
if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON)==0)
|
||||
{
|
||||
if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON)==0) {
|
||||
id_us_min(&adt->action->id);
|
||||
adt->action = NULL;
|
||||
}
|
||||
|
@ -367,18 +367,15 @@ void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, s
|
||||
float ANIM_unit_mapping_get_factor (Scene *scene, ID *id, FCurve *fcu, short restore)
|
||||
{
|
||||
/* sanity checks */
|
||||
if (id && fcu && fcu->rna_path)
|
||||
{
|
||||
if (id && fcu && fcu->rna_path) {
|
||||
PointerRNA ptr, id_ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* get RNA property that F-Curve affects */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop))
|
||||
{
|
||||
if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
|
||||
/* rotations: radians <-> degrees? */
|
||||
if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION)
|
||||
{
|
||||
if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION) {
|
||||
/* if the radians flag is not set, default to using degrees which need conversions */
|
||||
if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) {
|
||||
if (restore)
|
||||
|
@ -1038,8 +1038,7 @@ static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDope
|
||||
* but to do this, we need to check that the group doesn't have it's not-visible flag set preventing
|
||||
* all its sub-curves to be shown
|
||||
*/
|
||||
if ( !(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE) )
|
||||
{
|
||||
if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE)) {
|
||||
/* group must be editable for its children to be editable (if we care about this) */
|
||||
if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) {
|
||||
/* get first F-Curve which can be used here */
|
||||
|
@ -83,13 +83,13 @@ static ListBase *context_get_markers(Scene *scene, ScrArea *sa)
|
||||
/* local markers can only be shown when there's only a single active action to grab them from
|
||||
* - flag only takes effect when there's an action, otherwise it can get too confusing?
|
||||
*/
|
||||
if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && (saction->action))
|
||||
{
|
||||
if (saction->flag & SACTION_POSEMARKERS_SHOW)
|
||||
if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && (saction->action)) {
|
||||
if (saction->flag & SACTION_POSEMARKERS_SHOW) {
|
||||
return &saction->action->markers;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* default to using the scene's markers */
|
||||
return &scene->markers;
|
||||
@ -851,8 +851,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
|
||||
float vec[3];
|
||||
char str_tx[256];
|
||||
|
||||
if (handleNumInput(&mm->num, evt))
|
||||
{
|
||||
if (handleNumInput(&mm->num, evt)) {
|
||||
applyNumInput(&mm->num, vec);
|
||||
outputNumInput(&mm->num, str_tx);
|
||||
|
||||
|
@ -105,8 +105,7 @@ short ANIM_get_keyframing_flags (Scene *scene, short incl_mode)
|
||||
}
|
||||
|
||||
/* only if including settings from the autokeying mode... */
|
||||
if (incl_mode)
|
||||
{
|
||||
if (incl_mode) {
|
||||
/* keyframing mode - only replace existing keyframes */
|
||||
if (IS_AUTOKEY_MODE(scene, EDITKEYS))
|
||||
flag |= INSERTKEY_REPLACE;
|
||||
|
@ -2533,8 +2533,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
|
||||
curBone->temp = eBone;
|
||||
eBone->temp = curBone;
|
||||
|
||||
if (name != NULL)
|
||||
{
|
||||
if (name != NULL) {
|
||||
BLI_strncpy(eBone->name, name, sizeof(eBone->name));
|
||||
}
|
||||
|
||||
@ -5557,8 +5556,7 @@ void transform_armature_mirror_update(Object *obedit)
|
||||
eboflip->roll= -ebo->roll;
|
||||
|
||||
/* Also move connected parent, in case parent's name isn't mirrored properly */
|
||||
if (eboflip->parent && eboflip->flag & BONE_CONNECTED)
|
||||
{
|
||||
if (eboflip->parent && eboflip->flag & BONE_CONNECTED) {
|
||||
EditBone *parent = eboflip->parent;
|
||||
copy_v3_v3(parent->tail, eboflip->head);
|
||||
parent->rad_tail = ebo->rad_head;
|
||||
@ -5589,8 +5587,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode
|
||||
bArmature *arm= obedit->data;
|
||||
EditBone *lastBone = NULL;
|
||||
|
||||
if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE)
|
||||
{
|
||||
if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE) {
|
||||
ReebArcIterator arc_iter;
|
||||
BArcIterator *iter = (BArcIterator*)&arc_iter;
|
||||
float *previous = NULL, *current = NULL;
|
||||
@ -5624,8 +5621,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode
|
||||
len1 = normalize_v3(vec1);
|
||||
len2 = normalize_v3(vec2);
|
||||
|
||||
if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit)
|
||||
{
|
||||
if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit) {
|
||||
copy_v3_v3(parent->tail, previous);
|
||||
|
||||
child = ED_armature_edit_bone_add(arm, "Bone");
|
||||
@ -5641,8 +5637,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode
|
||||
/* If the bone wasn't subdivided, delete it and return NULL
|
||||
* to let subsequent subdivision methods do their thing.
|
||||
* */
|
||||
if (parent == root)
|
||||
{
|
||||
if (parent == root) {
|
||||
if(parent==arm->act_edbone) arm->act_edbone= NULL;
|
||||
ED_armature_edit_bone_remove(arm, parent);
|
||||
parent = NULL;
|
||||
@ -5658,8 +5653,7 @@ EditBone * test_subdivideByCorrelation(Scene *scene, Object *obedit, ReebArc *ar
|
||||
{
|
||||
EditBone *lastBone = NULL;
|
||||
|
||||
if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION)
|
||||
{
|
||||
if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION) {
|
||||
float invmat[4][4]= MAT4_UNITY;
|
||||
float tmat[3][3]= MAT3_UNITY;
|
||||
ReebArcIterator arc_iter;
|
||||
@ -5682,19 +5676,16 @@ float arcLengthRatio(ReebArc *arc)
|
||||
|
||||
arcLength = len_v3v3(arc->head->p, arc->tail->p);
|
||||
|
||||
if (arc->bcount > 0)
|
||||
{
|
||||
if (arc->bcount > 0) {
|
||||
/* Add the embedding */
|
||||
for ( i = 1; i < arc->bcount; i++)
|
||||
{
|
||||
for ( i = 1; i < arc->bcount; i++) {
|
||||
embedLength += len_v3v3(arc->buckets[i - 1].p, arc->buckets[i].p);
|
||||
}
|
||||
/* Add head and tail -> embedding vectors */
|
||||
embedLength += len_v3v3(arc->head->p, arc->buckets[0].p);
|
||||
embedLength += len_v3v3(arc->tail->p, arc->buckets[arc->bcount - 1].p);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
embedLength = arcLength;
|
||||
}
|
||||
|
||||
@ -5734,8 +5725,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
|
||||
|
||||
src = scene->basact->object;
|
||||
|
||||
if (obedit != NULL)
|
||||
{
|
||||
if (obedit != NULL) {
|
||||
ED_armature_from_edit(obedit);
|
||||
ED_armature_edit_free(obedit);
|
||||
}
|
||||
@ -5773,31 +5763,27 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
|
||||
*/
|
||||
|
||||
/* if arc is a symmetry axis, internal bones go up the tree */
|
||||
if (arc->symmetry_level == 1 && arc->tail->degree != 1)
|
||||
{
|
||||
if (arc->symmetry_level == 1 && arc->tail->degree != 1) {
|
||||
head = arc->tail;
|
||||
tail = arc->head;
|
||||
|
||||
arc->flag = -1; /* mark arc direction */
|
||||
}
|
||||
/* Bones point AWAY from the symmetry axis */
|
||||
else if (arc->head->symmetry_level == 1)
|
||||
{
|
||||
else if (arc->head->symmetry_level == 1) {
|
||||
head = arc->head;
|
||||
tail = arc->tail;
|
||||
|
||||
arc->flag = 1; /* mark arc direction */
|
||||
}
|
||||
else if (arc->tail->symmetry_level == 1)
|
||||
{
|
||||
else if (arc->tail->symmetry_level == 1) {
|
||||
head = arc->tail;
|
||||
tail = arc->head;
|
||||
|
||||
arc->flag = -1; /* mark arc direction */
|
||||
}
|
||||
/* otherwise, always go from low weight to high weight */
|
||||
else
|
||||
{
|
||||
else {
|
||||
head = arc->head;
|
||||
tail = arc->tail;
|
||||
|
||||
@ -5805,10 +5791,8 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
|
||||
}
|
||||
|
||||
/* Loop over subdivision methods */
|
||||
for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++)
|
||||
{
|
||||
switch(scene->toolsettings->skgen_subdivisions[i])
|
||||
{
|
||||
for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++) {
|
||||
switch(scene->toolsettings->skgen_subdivisions[i]) {
|
||||
case SKGEN_SUB_LENGTH:
|
||||
lastBone = test_subdivideByLength(scene, obedit, arc, head, tail);
|
||||
break;
|
||||
@ -5821,8 +5805,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
|
||||
}
|
||||
}
|
||||
|
||||
if (lastBone == NULL)
|
||||
{
|
||||
if (lastBone == NULL) {
|
||||
EditBone *bone;
|
||||
bone = ED_armature_edit_bone_add(obedit->data, "Bone");
|
||||
bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
|
||||
@ -5843,20 +5826,18 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
|
||||
ReebArc *incomingArc = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < node->degree; i++)
|
||||
{
|
||||
for (i = 0; i < node->degree; i++) {
|
||||
arc = (ReebArc*)node->arcs[i];
|
||||
|
||||
/* if arc is incoming into the node */
|
||||
if ((arc->head == node && arc->flag == -1) || (arc->tail == node && arc->flag == 1))
|
||||
{
|
||||
if (incomingArc == NULL)
|
||||
if ((arc->head == node && arc->flag == -1) ||
|
||||
(arc->tail == node && arc->flag == 1))
|
||||
{
|
||||
if (incomingArc == NULL) {
|
||||
incomingArc = arc;
|
||||
/* loop further to make sure there's only one incoming arc */
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* skip this node if more than one incomingArc */
|
||||
incomingArc = NULL;
|
||||
break; /* No need to look further, we are skipping already */
|
||||
@ -5864,8 +5845,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
|
||||
}
|
||||
}
|
||||
|
||||
if (incomingArc != NULL)
|
||||
{
|
||||
if (incomingArc != NULL) {
|
||||
EditBone *parentBone = BLI_ghash_lookup(arcBoneMap, incomingArc);
|
||||
|
||||
/* Look for outgoing arcs and parent their bones */
|
||||
@ -5874,8 +5854,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
|
||||
arc = node->arcs[i];
|
||||
|
||||
/* if arc is outgoing from the node */
|
||||
if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1))
|
||||
{
|
||||
if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1)) {
|
||||
EditBone *childBone = BLI_ghash_lookup(arcBoneMap, arc);
|
||||
|
||||
/* find the root bone */
|
||||
|
@ -2901,12 +2901,10 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg)
|
||||
char *num_string = scene->toolsettings->skgen_num_string;
|
||||
int free_template = 0;
|
||||
|
||||
if (template_rigg)
|
||||
{
|
||||
if (template_rigg) {
|
||||
ob = template_rigg->ob;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
free_template = 1;
|
||||
ob = obedit;
|
||||
template_rigg = armatureSelectedToGraph(C, ob, ob->data);
|
||||
|
@ -189,8 +189,7 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short dfl
|
||||
glVertex2fv(co);
|
||||
glEnd();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* draw filled circle as is done in circf (but without the matrix push/pops which screwed things up) */
|
||||
GLUquadricObj *qobj = gluNewQuadric();
|
||||
|
||||
@ -289,8 +288,7 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s
|
||||
/* tessellation code - draw stroke as series of connected quads with connection
|
||||
* edges rotated to minimise shrinking artifacts, and rounded endcaps
|
||||
*/
|
||||
else
|
||||
{
|
||||
else {
|
||||
bGPDspoint *pt1, *pt2;
|
||||
float pm[2];
|
||||
int i;
|
||||
@ -384,8 +382,8 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s
|
||||
mt[1]= mb[1] * pthick;
|
||||
athick= len_v2(mt);
|
||||
dfac= pthick - (athick * 2);
|
||||
if ( ((athick * 2.0f) < pthick) && (IS_EQF(athick, pthick)==0) )
|
||||
{
|
||||
|
||||
if (((athick * 2.0f) < pthick) && (IS_EQF(athick, pthick)==0)) {
|
||||
mt[0] += (mb[0] * dfac);
|
||||
mt[1] += (mb[1] * dfac);
|
||||
}
|
||||
|
@ -194,8 +194,7 @@ static void gp_get_3d_reference (tGPsdata *p, float vec[3])
|
||||
|
||||
/* the reference point used depends on the owner... */
|
||||
#if 0 // XXX: disabled for now, since we can't draw relative to the owner yet
|
||||
if (p->ownerPtr.type == &RNA_Object)
|
||||
{
|
||||
if (p->ownerPtr.type == &RNA_Object) {
|
||||
Object *ob= (Object *)p->ownerPtr.data;
|
||||
|
||||
/* active Object
|
||||
@ -517,10 +516,8 @@ static void gp_stroke_simplify (tGPsdata *p)
|
||||
pressure += old_points[offs].pressure * sfac; \
|
||||
}
|
||||
|
||||
for (i = 0, j = 0; i < num_points; i++)
|
||||
{
|
||||
if (i - j == 3)
|
||||
{
|
||||
for (i = 0, j = 0; i < num_points; i++) {
|
||||
if (i - j == 3) {
|
||||
float co[2], pressure;
|
||||
int mco[2];
|
||||
|
||||
@ -1855,8 +1852,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
|
||||
/* handle mode-specific events */
|
||||
if (p->status == GP_STATUS_PAINTING) {
|
||||
/* handle painting mouse-movements? */
|
||||
if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (p->flags & GP_PAINTFLAG_FIRSTRUN))
|
||||
{
|
||||
if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (p->flags & GP_PAINTFLAG_FIRSTRUN)) {
|
||||
/* handle drawing event */
|
||||
//printf("\t\tGP - add point\n");
|
||||
gpencil_draw_apply_event(op, event);
|
||||
|
@ -557,24 +557,21 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
||||
|
||||
// Set the font to be either unicode or FO_BUILTIN_NAME
|
||||
wstr[0] = cs;
|
||||
if(strcmp(G.selfont->name, FO_BUILTIN_NAME))
|
||||
{
|
||||
if (strcmp(G.selfont->name, FO_BUILTIN_NAME)) {
|
||||
BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(G.ui_international == TRUE)
|
||||
{
|
||||
else {
|
||||
if (G.ui_international == TRUE) {
|
||||
BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ustr[0] = cs;
|
||||
ustr[1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if((G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) || (G.selfont && !strcmp(G.selfont->name, FO_BUILTIN_NAME) && G.ui_international == TRUE))
|
||||
if ((G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) ||
|
||||
(G.selfont && !strcmp(G.selfont->name, FO_BUILTIN_NAME) && G.ui_international == TRUE))
|
||||
{
|
||||
float wid;
|
||||
float llx, lly, llz, urx, ury, urz;
|
||||
@ -595,8 +592,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
|
||||
ui_rasterpos_safe(px, py, but->aspect);
|
||||
FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect);
|
||||
UI_DrawString(but->font, (char *) ustr, 0);
|
||||
}
|
||||
|
@ -4193,8 +4193,7 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut
|
||||
if(che > G.charmax)
|
||||
che = 0;
|
||||
|
||||
if(G.obedit)
|
||||
{
|
||||
if(G.obedit) {
|
||||
do_textedit(0,0,che);
|
||||
}
|
||||
|
||||
@ -4227,10 +4226,8 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut
|
||||
return WM_UI_HANDLER_BREAK;
|
||||
}
|
||||
else if(ELEM(event->type, WHEELDOWNMOUSE, PAGEDOWNKEY)) {
|
||||
for(but= block->buttons.first; but; but= but->next)
|
||||
{
|
||||
if(but->type == CHARTAB)
|
||||
{
|
||||
for(but= block->buttons.first; but; but= but->next) {
|
||||
if(but->type == CHARTAB) {
|
||||
G.charstart = G.charstart + (12*6);
|
||||
if(G.charstart > (0xffff - 12*6))
|
||||
G.charstart = 0xffff - (12*6);
|
||||
|
@ -1015,8 +1015,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
|
||||
|
||||
static void ui_id_preview_image_render_size(bContext *C, ID *id, PreviewImage *pi, int size)
|
||||
{
|
||||
if ((pi->changed[size] ||!pi->rect[size])) /* changed only ever set by dynamic icons */
|
||||
{
|
||||
if ((pi->changed[size] ||!pi->rect[size])) { /* changed only ever set by dynamic icons */
|
||||
/* create the rect if necessary */
|
||||
icon_set_image(C, id, pi, size);
|
||||
|
||||
|
@ -774,8 +774,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
|
||||
}
|
||||
|
||||
if (ob->type==OB_MESH) {
|
||||
if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
|
||||
{
|
||||
if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex)) {
|
||||
/* -- convert to rna ? */
|
||||
but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
|
||||
TIP_("Apply modifier to editing cage during Editmode"));
|
||||
|
@ -514,8 +514,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
|
||||
if (event->val==KM_PRESS) {
|
||||
float value;
|
||||
|
||||
if (handleNumInput(&lcd->num, event))
|
||||
{
|
||||
if (handleNumInput(&lcd->num, event)) {
|
||||
applyNumInput(&lcd->num, &value);
|
||||
|
||||
cuts= CLAMPIS(value, 1, 32);
|
||||
|
@ -391,8 +391,7 @@ static void test_constraints (Object *owner, bPoseChannel *pchan)
|
||||
/* if the number of points does not match the amount required by the chain length,
|
||||
* free the points array and request a rebind...
|
||||
*/
|
||||
if ((data->points == NULL) || (data->numpoints != data->chainlen+1))
|
||||
{
|
||||
if ((data->points == NULL) || (data->numpoints != data->chainlen+1)) {
|
||||
/* free the points array */
|
||||
if (data->points) {
|
||||
MEM_freeN(data->points);
|
||||
|
@ -319,13 +319,11 @@ static int make_proxy_exec (bContext *C, wmOperator *op)
|
||||
GroupObject *go;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
||||
if (gob->dup_group != NULL)
|
||||
{
|
||||
if (gob->dup_group != NULL) {
|
||||
go= BLI_findlink(&gob->dup_group->gobject, RNA_enum_get(op->ptr, "object"));
|
||||
ob= go->ob;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ob= gob;
|
||||
gob = NULL;
|
||||
}
|
||||
@ -598,8 +596,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
|
||||
|
||||
/* BUT, to keep the deforms, we need a modifier, and then we need to set the object that it uses */
|
||||
// XXX currently this should only happen for meshes, curves, surfaces, and lattices - this stuff isn't available for metas yet
|
||||
if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE))
|
||||
{
|
||||
if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
|
||||
ModifierData *md;
|
||||
|
||||
switch (partype) {
|
||||
|
@ -252,9 +252,8 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) {
|
||||
if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
|
||||
{
|
||||
else if (pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) {
|
||||
if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) {
|
||||
pset->flag |= PE_FADE_TIME;
|
||||
// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
|
||||
PE_create_particle_edit(scene, ob, pid->cache, NULL);
|
||||
@ -262,9 +261,8 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
|
||||
edit = pid->cache->edit;
|
||||
break;
|
||||
}
|
||||
else if(pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) {
|
||||
if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
|
||||
{
|
||||
else if (pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) {
|
||||
if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) {
|
||||
pset->flag |= PE_FADE_TIME;
|
||||
// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
|
||||
PE_create_particle_edit(scene, ob, pid->cache, NULL);
|
||||
@ -3632,10 +3630,10 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
|
||||
PE_update_object(scene, ob, 1);
|
||||
}
|
||||
|
||||
if(edit->psys)
|
||||
if (edit->psys) {
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
|
||||
else
|
||||
{
|
||||
}
|
||||
else {
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
}
|
||||
|
@ -860,8 +860,7 @@ static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *r
|
||||
|
||||
curFrame++;
|
||||
|
||||
if((exists = BLI_exists(targetFile)))
|
||||
{
|
||||
if ((exists = BLI_exists(targetFile))) {
|
||||
BLI_delete(targetFile, 0, 0);
|
||||
BLI_delete(targetFileVel, 0, 0);
|
||||
BLI_delete(previewFile, 0, 0);
|
||||
|
@ -2907,10 +2907,13 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
|
||||
else if (sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0;
|
||||
else sync= (scene->flag & SCE_FRAME_DROP);
|
||||
|
||||
if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene)))
|
||||
scene->r.cfra = (double)time * FPS + 0.5;
|
||||
else
|
||||
if ((scene->audio.flag & AUDIO_SYNC) &&
|
||||
(sad->flag & ANIMPLAY_FLAG_REVERSE) == FALSE &&
|
||||
finite(time = sound_sync_scene(scene)))
|
||||
{
|
||||
scene->r.cfra = (double)time * FPS + 0.5;
|
||||
}
|
||||
else {
|
||||
if (sync) {
|
||||
int step = floor(wt->duration * FPS);
|
||||
/* skip frames */
|
||||
|
@ -1543,8 +1543,7 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
|
||||
|
||||
unode= sculpt_undo_push_node(ob, nodes[n]);
|
||||
origco=unode->co;
|
||||
if(!unode->layer_disp)
|
||||
{
|
||||
if (!unode->layer_disp) {
|
||||
#pragma omp critical
|
||||
unode->layer_disp= MEM_callocN(sizeof(float)*unode->totvert, "layer disp");
|
||||
}
|
||||
|
@ -414,8 +414,7 @@ static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op)
|
||||
if (data->timer) {
|
||||
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), data->timer);
|
||||
}
|
||||
if (data->elementMap)
|
||||
{
|
||||
if (data->elementMap) {
|
||||
EDBM_free_uv_element_map(data->elementMap);
|
||||
}
|
||||
if (data->uv) {
|
||||
|
@ -345,8 +345,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
|
||||
result = AUD_mixdown(scene->sound_scene, SFRA * specs.rate / FPS, (EFRA - SFRA) * specs.rate / FPS,
|
||||
accuracy, filename, specs, container, codec, bitrate);
|
||||
|
||||
if(result)
|
||||
{
|
||||
if (result) {
|
||||
BKE_report(op->reports, RPT_ERROR, result);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -215,8 +215,7 @@ static FileSelect file_select(bContext* C, const rcti* rect, FileSelType select,
|
||||
if (sel.first != sel.last) select = 0;
|
||||
|
||||
/* Do we have a valid selection and are we actually selecting */
|
||||
if ( (sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE)) )
|
||||
{
|
||||
if ((sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE))) {
|
||||
/* Check last selection, if selected, act on the file or dir */
|
||||
if (filelist_is_selected(sfile->files, sel.last, check_type)) {
|
||||
retval = file_select_do(C, sel.last);
|
||||
@ -1171,9 +1170,8 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused))
|
||||
{
|
||||
SpaceFile *sfile= CTX_wm_space_file(C);
|
||||
|
||||
if(sfile->params) {
|
||||
if (file_select_match(sfile, sfile->params->file))
|
||||
{
|
||||
if (sfile->params) {
|
||||
if (file_select_match(sfile, sfile->params->file)) {
|
||||
sfile->params->file[0] = '\0';
|
||||
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
|
||||
}
|
||||
|
@ -334,8 +334,8 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
|
||||
continue;
|
||||
|
||||
FSRefMakePath(&dir, path, FILE_MAX);
|
||||
if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net"))
|
||||
{ /* /net and /home are meaningless on OSX, home folders are stored in /Users */
|
||||
if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net")) {
|
||||
/* /net and /home are meaningless on OSX, home folders are stored in /Users */
|
||||
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0);
|
||||
}
|
||||
}
|
||||
|
@ -196,8 +196,8 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
|
||||
filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT);
|
||||
filelist_setfilter(sfile->files, params->flag & FILE_FILTER ? params->filter : 0);
|
||||
filelist_setfilter_types(sfile->files, params->filter_glob);
|
||||
if (filelist_empty(sfile->files))
|
||||
{
|
||||
|
||||
if (filelist_empty(sfile->files)) {
|
||||
thumbnails_stop(sfile->files, C);
|
||||
filelist_readdir(sfile->files);
|
||||
if(params->sort!=FILE_SORT_NONE) {
|
||||
|
@ -292,8 +292,7 @@ static void draw_fcurve_vertices (SpaceIpo *sipo, ARegion *ar, FCurve *fcu, shor
|
||||
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
|
||||
|
||||
/* draw the two handles first (if they're shown, the curve doesn't have just a single keyframe, and the curve is being edited) */
|
||||
if (do_handles)
|
||||
{
|
||||
if (do_handles) {
|
||||
set_fcurve_vertex_color(fcu, 0);
|
||||
draw_fcurve_vertices_handles(fcu, sipo, v2d, 0, sel_handle_only);
|
||||
|
||||
@ -327,8 +326,7 @@ static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -368,8 +366,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
|
||||
fp= bezt->vec[0];
|
||||
|
||||
/* only draw first handle if previous segment had handles */
|
||||
if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) )
|
||||
{
|
||||
if ((!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ))) {
|
||||
UI_GetThemeColor3ubv(basecol + bezt->h1, col);
|
||||
col[3]= drawFCurveFade(fcu) * 255;
|
||||
glColor4ubv((GLubyte *)col);
|
||||
@ -378,8 +375,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
|
||||
}
|
||||
|
||||
/* only draw second handle if this segment is bezier */
|
||||
if (bezt->ipo == BEZT_IPO_BEZ)
|
||||
{
|
||||
if (bezt->ipo == BEZT_IPO_BEZ) {
|
||||
UI_GetThemeColor3ubv(basecol + bezt->h2, col);
|
||||
col[3]= drawFCurveFade(fcu) * 255;
|
||||
glColor4ubv((GLubyte *)col);
|
||||
|
@ -1006,14 +1006,12 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, const int mval[2],
|
||||
/* handles - only do them if they're visible */
|
||||
if (fcurve_handle_sel_check(sipo, bezt1) && (fcu->totvert > 1)) {
|
||||
/* first handle only visible if previous segment had handles */
|
||||
if ( (!prevbezt && (bezt1->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) )
|
||||
{
|
||||
if ((!prevbezt && (bezt1->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ))) {
|
||||
nearest_fcurve_vert_store(matches, v2d, fcu, bezt1, NULL, NEAREST_HANDLE_LEFT, mval);
|
||||
}
|
||||
|
||||
/* second handle only visible if this segment is bezier */
|
||||
if (bezt1->ipo == BEZT_IPO_BEZ)
|
||||
{
|
||||
if (bezt1->ipo == BEZT_IPO_BEZ) {
|
||||
nearest_fcurve_vert_store(matches, v2d, fcu, bezt1, NULL, NEAREST_HANDLE_RIGHT, mval);
|
||||
}
|
||||
}
|
||||
|
@ -1359,9 +1359,10 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
|
||||
uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19,
|
||||
ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value");
|
||||
}
|
||||
else if(ps->type == SENS_PROP_CHANGED);
|
||||
else
|
||||
{
|
||||
else if(ps->type == SENS_PROP_CHANGED) {
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19,
|
||||
ps->value, 0, MAX_NAME, 0, 0, "check for value");
|
||||
}
|
||||
@ -1511,14 +1512,12 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
|
||||
&raySens->mode, 0.0, 0.0, 0, 0,
|
||||
"Toggle collision on material or property");
|
||||
|
||||
if (raySens->mode & SENS_COLLISION_MATERIAL)
|
||||
{
|
||||
if (raySens->mode & SENS_COLLISION_MATERIAL) {
|
||||
uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
|
||||
&raySens->matname, 0, MAX_NAME, 0, 0,
|
||||
"Only look for Objects with this material");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
|
||||
&raySens->propname, 0, MAX_NAME, 0, 0,
|
||||
"Only look for Objects with this property");
|
||||
@ -1878,12 +1877,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
wval = (width-100)/3;
|
||||
if (oa->type == ACT_OBJECT_NORMAL)
|
||||
{
|
||||
if ( ob->gameflag & OB_DYNAMIC )
|
||||
{
|
||||
if (ob->gameflag & OB_DYNAMIC) {
|
||||
ysize= 175;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ysize= 72;
|
||||
}
|
||||
|
||||
@ -2031,12 +2028,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
&aa->end_reset, 0.0, 0.0, 0, 0, "Restore last frame when switching on/off, otherwise play from the start each time");
|
||||
|
||||
|
||||
if(aa->type == ACT_ACTION_FROM_PROP)
|
||||
{
|
||||
if(aa->type == ACT_ACTION_FROM_PROP) {
|
||||
uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
uiDefButF(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame");
|
||||
uiDefButF(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame");
|
||||
}
|
||||
@ -2048,8 +2043,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
|
||||
|
||||
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
|
||||
if(aa->type == ACT_ACTION_MOTION)
|
||||
{
|
||||
if (aa->type == ACT_ACTION_MOTION) {
|
||||
uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action");
|
||||
}
|
||||
#endif
|
||||
@ -2185,8 +2179,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
12.0, 0, 0, "Sets the pitch of this sound");
|
||||
uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19,
|
||||
&sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space");
|
||||
if(sa->flag & ACT_SND_3D_SOUND)
|
||||
{
|
||||
if(sa->flag & ACT_SND_3D_SOUND) {
|
||||
uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19,
|
||||
&sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0,
|
||||
"The minimum gain of the sound, no matter how far it is away");
|
||||
@ -2395,14 +2388,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
&coa->flag, 0.0, 0.0, 0, 0, "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
|
||||
uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
|
||||
&coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
|
||||
if (coa->flag & ACT_CONST_MATERIAL)
|
||||
{
|
||||
if (coa->flag & ACT_CONST_MATERIAL) {
|
||||
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
|
||||
coa->matprop, 0, MAX_NAME, 0, 0,
|
||||
"Ray detects only Objects with this material");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
|
||||
coa->matprop, 0, MAX_NAME, 0, 0,
|
||||
"Ray detect only Objects with this property");
|
||||
@ -2454,14 +2445,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
&coa->flag, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes");
|
||||
uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
|
||||
&coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
|
||||
if (coa->flag & ACT_CONST_MATERIAL)
|
||||
{
|
||||
if (coa->flag & ACT_CONST_MATERIAL) {
|
||||
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
|
||||
coa->matprop, 0, MAX_NAME, 0, 0,
|
||||
"Ray detects only Objects with this material");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
|
||||
coa->matprop, 0, MAX_NAME, 0, 0,
|
||||
"Ray detect only Objects with this property");
|
||||
@ -2549,8 +2538,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
case ACT_GAME:
|
||||
{
|
||||
gma = act->data;
|
||||
if (gma->type == ACT_GAME_LOAD)
|
||||
{
|
||||
if (gma->type == ACT_GAME_LOAD) {
|
||||
//ysize = 68;
|
||||
ysize = 48;
|
||||
glRects(xco, yco-ysize, xco+width, yco);
|
||||
@ -2807,15 +2795,14 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
&ma->bodyType, 0.0, 0.0, 0, 0,
|
||||
"Toggle message type: either Text or a PropertyName");
|
||||
|
||||
if (ma->bodyType == ACT_MESG_MESG)
|
||||
{
|
||||
if (ma->bodyType == ACT_MESG_MESG) {
|
||||
/* line 3: Message Body */
|
||||
uiDefBut(block, TEX, 1, "Body: ",
|
||||
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
|
||||
&ma->body, 0, MAX_NAME, 0, 0,
|
||||
"Optional message body Text");
|
||||
} else
|
||||
{
|
||||
}
|
||||
else {
|
||||
/* line 3: Property body (set by property) */
|
||||
uiDefBut(block, TEX, 1, "Propname: ",
|
||||
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
|
||||
@ -2829,8 +2816,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
tdfa = act->data;
|
||||
|
||||
ysize = 50;
|
||||
if(tdfa->type == ACT_2DFILTER_CUSTOMFILTER)
|
||||
{
|
||||
if (tdfa->type == ACT_2DFILTER_CUSTOMFILTER) {
|
||||
ysize +=20;
|
||||
}
|
||||
glRects( xco, yco-ysize, xco+width, yco );
|
||||
@ -2839,13 +2825,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
||||
switch(tdfa->type)
|
||||
{
|
||||
case ACT_2DFILTER_MOTIONBLUR:
|
||||
if(!tdfa->flag)
|
||||
{
|
||||
if (!tdfa->flag) {
|
||||
uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur");
|
||||
uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur");
|
||||
}
|
||||
break;
|
||||
@ -4187,11 +4171,11 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
|
||||
case ACT_PROP_COPY:
|
||||
row = uiLayoutRow(layout, 0);
|
||||
uiItemR(row, ptr, "object", 0, NULL, ICON_NONE);
|
||||
if(ob_from){
|
||||
if (ob_from) {
|
||||
RNA_pointer_create((ID *)ob_from, &RNA_GameObjectSettings, ob_from, &obj_settings_ptr);
|
||||
uiItemPointerR(row, ptr, "object_property", &obj_settings_ptr, "properties", NULL, ICON_NONE);
|
||||
}else
|
||||
{
|
||||
}
|
||||
else {
|
||||
sub= uiLayoutRow(row, 0);
|
||||
uiLayoutSetActive(sub, 0);
|
||||
uiItemR(sub, ptr, "object_property", 0, NULL, ICON_NONE);
|
||||
@ -4325,8 +4309,7 @@ static void draw_actuator_sound(uiLayout *layout, PointerRNA *ptr, bContext *C)
|
||||
uiLayout *row, *col;
|
||||
|
||||
uiTemplateID(layout, C, ptr, "sound", NULL, "SOUND_OT_open", NULL);
|
||||
if (!RNA_pointer_get(ptr, "sound").data)
|
||||
{
|
||||
if (!RNA_pointer_get(ptr, "sound").data) {
|
||||
uiItemL(layout, "Select a sound from the list or load a new one", ICON_NONE);
|
||||
return;
|
||||
}
|
||||
@ -4402,21 +4385,18 @@ static void draw_actuator_steering(uiLayout *layout, PointerRNA *ptr)
|
||||
uiItemR(col, ptr, "facing", 0, NULL, 0);
|
||||
col = uiLayoutColumn(row, 0);
|
||||
uiItemR(col, ptr, "facing_axis", 0, NULL, 0);
|
||||
if (!RNA_boolean_get(ptr, "facing"))
|
||||
{
|
||||
if (!RNA_boolean_get(ptr, "facing")) {
|
||||
uiLayoutSetActive(col, 0);
|
||||
}
|
||||
col = uiLayoutColumn(row, 0);
|
||||
uiItemR(col, ptr, "normal_up", 0, NULL, 0);
|
||||
if (!RNA_pointer_get(ptr, "navmesh").data)
|
||||
{
|
||||
if (!RNA_pointer_get(ptr, "navmesh").data) {
|
||||
uiLayoutSetActive(col, 0);
|
||||
}
|
||||
|
||||
row = uiLayoutRow(layout, 0);
|
||||
uiItemR(row, ptr, "self_terminated", 0, NULL, 0);
|
||||
if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING)
|
||||
{
|
||||
if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING) {
|
||||
uiItemR(row, ptr, "update_period", 0, NULL, 0);
|
||||
row = uiLayoutRow(layout, 0);
|
||||
}
|
||||
@ -5040,8 +5020,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
||||
uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Sensor settings");
|
||||
|
||||
ycoo= yco;
|
||||
if(sens->flag & SENS_SHOW)
|
||||
{
|
||||
if (sens->flag & SENS_SHOW) {
|
||||
uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type");
|
||||
but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name");
|
||||
uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0);
|
||||
|
@ -692,8 +692,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
|
||||
|
||||
/* if this track is active and we're tweaking it, don't draw these toggles */
|
||||
// TODO: need a special macro for this...
|
||||
if ( ((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0 )
|
||||
{
|
||||
if (((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0) {
|
||||
if (nlt->flag & NLATRACK_MUTED)
|
||||
mute = ICON_MUTE_IPO_ON;
|
||||
else
|
||||
|
@ -1282,8 +1282,7 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op)
|
||||
if ((nlt->strips.first == nlt->strips.last) && (nlt->strips.first != NULL)) {
|
||||
NlaStrip *mstrip = (NlaStrip *)nlt->strips.first;
|
||||
|
||||
if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2))
|
||||
{
|
||||
if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2)) {
|
||||
/* remove this temp meta, so that we can see the strips inside */
|
||||
BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
|
||||
}
|
||||
|
@ -3389,8 +3389,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
|
||||
ntemp.type = -1;
|
||||
|
||||
/* check input variables */
|
||||
if (RNA_struct_property_is_set(op->ptr, "filepath"))
|
||||
{
|
||||
if (RNA_struct_property_is_set(op->ptr, "filepath")) {
|
||||
char path[FILE_MAX];
|
||||
RNA_string_get(op->ptr, "filepath", path);
|
||||
|
||||
|
@ -171,8 +171,7 @@ static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x
|
||||
* x2 the end x value, same for y1 and y2
|
||||
* stepsize is width of a pixel.
|
||||
*/
|
||||
if(seq->flag & SEQ_AUDIO_DRAW_WAVEFORM)
|
||||
{
|
||||
if(seq->flag & SEQ_AUDIO_DRAW_WAVEFORM) {
|
||||
int i, j, pos;
|
||||
int length = floor((x2-x1)/stepsize)+1;
|
||||
float ymid = (y1+y2)/2;
|
||||
|
@ -1132,8 +1132,8 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
if(type == TO_TABS) // Converting to tabs
|
||||
{ //start over from the beginning
|
||||
if (type == TO_TABS) { // Converting to tabs
|
||||
//start over from the beginning
|
||||
tmp = text->lines.first;
|
||||
|
||||
while(tmp) {
|
||||
|
@ -355,8 +355,9 @@ static short UNUSED_FUNCTION(do_texttools)(SpaceText *st, char ascii, unsigned s
|
||||
}
|
||||
}
|
||||
|
||||
if(draw)
|
||||
{}; // XXX redraw_alltext();
|
||||
if (draw) {
|
||||
// XXX redraw_alltext();
|
||||
}
|
||||
|
||||
return swallow;
|
||||
}
|
||||
@ -540,8 +541,9 @@ static short UNUSED_FUNCTION(do_textmarkers)(SpaceText *st, char ascii, unsigned
|
||||
}
|
||||
}
|
||||
|
||||
if(draw)
|
||||
{}; // XXX redraw_alltext();
|
||||
if (draw) {
|
||||
// XXX redraw_alltext();
|
||||
}
|
||||
|
||||
return swallow;
|
||||
}
|
||||
|
@ -4493,8 +4493,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
|
||||
drawn = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
state.time=cfra;
|
||||
if (psys_get_particle_state(&sim,a,&state,0)) {
|
||||
float pixsize;
|
||||
@ -6769,12 +6768,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
SmokeModifierData *smd = (SmokeModifierData *)md;
|
||||
|
||||
// draw collision objects
|
||||
if ((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll)
|
||||
{
|
||||
if ((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll) {
|
||||
#if 0
|
||||
SmokeCollSettings *scs = smd->coll;
|
||||
if (scs->points)
|
||||
{
|
||||
if (scs->points) {
|
||||
size_t i;
|
||||
|
||||
glLoadMatrixf(rv3d->viewmat);
|
||||
@ -6805,8 +6802,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
}
|
||||
|
||||
// only draw domains
|
||||
if (smd->domain && smd->domain->fluid)
|
||||
{
|
||||
if (smd->domain && smd->domain->fluid) {
|
||||
if (CFRA < smd->domain->point_cache[0]->startframe)
|
||||
; /* don't show smoke before simulation starts, this could be made an option in the future */
|
||||
else if (!smd->domain->wt || !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG))
|
||||
@ -6842,8 +6838,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
float tmp[3];
|
||||
int index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z);
|
||||
|
||||
if (density[index] > FLT_EPSILON)
|
||||
{
|
||||
if (density[index] > FLT_EPSILON) {
|
||||
float color[3];
|
||||
copy_v3_v3(tmp, smd->domain->p0);
|
||||
tmp[0] += smd->domain->dx * x + smd->domain->dx * 0.5;
|
||||
@ -6864,8 +6859,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
if (col) cpack(col);
|
||||
#endif
|
||||
}
|
||||
else if (smd->domain->wt && (smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG))
|
||||
{
|
||||
else if (smd->domain->wt && (smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
|
||||
smd->domain->tex = NULL;
|
||||
GPU_create_smoke(smd, 1);
|
||||
draw_volume(ar, smd->domain->tex,
|
||||
@ -6878,12 +6872,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
}
|
||||
|
||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
|
||||
|
||||
bConstraint *con;
|
||||
for (con=ob->constraints.first; con; con= con->next)
|
||||
{
|
||||
if (con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT)
|
||||
{
|
||||
|
||||
for (con=ob->constraints.first; con; con= con->next) {
|
||||
if (con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) {
|
||||
bRigidBodyJointConstraint *data = (bRigidBodyJointConstraint*)con->data;
|
||||
if (data->flag&CONSTRAINT_DRAW_PIVOT)
|
||||
drawRBpivot(data);
|
||||
@ -6907,7 +6899,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
if (dtx & OB_BOUNDBOX) {
|
||||
draw_bounding_volume(scene, ob, ob->boundtype);
|
||||
}
|
||||
if (dtx & OB_TEXSPACE) drawtexspace(ob);
|
||||
if (dtx & OB_TEXSPACE) {
|
||||
drawtexspace(ob);
|
||||
}
|
||||
if (dtx & OB_DRAWNAME) {
|
||||
/* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
|
||||
/* but, we also dont draw names for sets or duplicators */
|
||||
@ -6922,13 +6916,16 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
}
|
||||
}
|
||||
/*if (dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/
|
||||
if ((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, rv3d, ob);
|
||||
if ((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) {
|
||||
drawWireExtra(scene, rv3d, ob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dt<=OB_SOLID && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
|
||||
if ((ob->gameflag & OB_DYNAMIC) ||
|
||||
((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) {
|
||||
((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE)))
|
||||
{
|
||||
float imat[4][4], vec[3]= {0.0f, 0.0f, 0.0f};
|
||||
|
||||
invert_m4_m4(imat, rv3d->viewmatob);
|
||||
@ -6945,11 +6942,16 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
|
||||
glLoadMatrixf(rv3d->viewmat);
|
||||
|
||||
if (zbufoff) glDisable(GL_DEPTH_TEST);
|
||||
if (zbufoff) {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (warning_recursive) return;
|
||||
if (base->flag & OB_FROMDUPLI) return;
|
||||
if (v3d->flag2 & V3D_RENDER_OVERRIDE) return;
|
||||
if ((warning_recursive) ||
|
||||
(base->flag & OB_FROMDUPLI) ||
|
||||
(v3d->flag2 & V3D_RENDER_OVERRIDE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* object centers, need to be drawn in viewmat space for speed, but OK for picking select */
|
||||
if (!is_obact || !(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
|
||||
|
@ -339,8 +339,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
|
||||
// printf("i: %d\n", i);
|
||||
// printf("point %f, %f, %f\n", cv[i][0], cv[i][1], cv[i][2]);
|
||||
|
||||
if (GL_TRUE == glewIsSupported("GL_ARB_fragment_program"))
|
||||
{
|
||||
if (GL_TRUE == glewIsSupported("GL_ARB_fragment_program")) {
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
glGenProgramsARB(1, &prog);
|
||||
|
||||
@ -406,12 +405,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
|
||||
copy_v3_v3(p0, points);
|
||||
|
||||
// sort points to get a convex polygon
|
||||
for (i = 1; i < numpoints - 1; i++)
|
||||
{
|
||||
for (j = i + 1; j < numpoints; j++)
|
||||
{
|
||||
if (!convex(p0, viewnormal, &points[j * 3], &points[i * 3]))
|
||||
{
|
||||
for (i = 1; i < numpoints - 1; i++) {
|
||||
for (j = i + 1; j < numpoints; j++) {
|
||||
if (!convex(p0, viewnormal, &points[j * 3], &points[i * 3])) {
|
||||
float tmp2[3];
|
||||
copy_v3_v3(tmp2, &points[j * 3]);
|
||||
copy_v3_v3(&points[j * 3], &points[i * 3]);
|
||||
@ -441,8 +437,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
|
||||
GPU_texture_unbind(tex_shadow);
|
||||
GPU_texture_unbind(tex);
|
||||
|
||||
if (GLEW_ARB_fragment_program)
|
||||
{
|
||||
if (GLEW_ARB_fragment_program) {
|
||||
glDisable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
glDeleteProgramsARB(1, &prog);
|
||||
}
|
||||
@ -450,10 +445,11 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
|
||||
|
||||
MEM_freeN(points);
|
||||
|
||||
if (!gl_blend)
|
||||
if (!gl_blend) {
|
||||
glDisable(GL_BLEND);
|
||||
if (gl_depth)
|
||||
{
|
||||
}
|
||||
|
||||
if (gl_depth) {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_TRUE);
|
||||
}
|
||||
|
@ -1827,8 +1827,7 @@ int transformEnd(bContext *C, TransInfo *t)
|
||||
exit_code = OPERATOR_CANCELLED;
|
||||
restoreTransObjects(t); // calls recalcData()
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
exit_code = OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@ -2447,8 +2446,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
|
||||
initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE);
|
||||
t->customData = (void*)1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE);
|
||||
t->customData = NULL;
|
||||
}
|
||||
@ -2732,8 +2730,7 @@ int Resize(TransInfo *t, const int mval[2])
|
||||
{
|
||||
ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ratio = t->values[0];
|
||||
}
|
||||
|
||||
@ -3451,10 +3448,8 @@ static void applyTranslation(TransInfo *t, float vec[3])
|
||||
continue;
|
||||
|
||||
/* handle snapping rotation before doing the translation */
|
||||
if (usingSnappingNormal(t))
|
||||
{
|
||||
if (validSnappingNormal(t))
|
||||
{
|
||||
if (usingSnappingNormal(t)) {
|
||||
if (validSnappingNormal(t)) {
|
||||
float *original_normal = td->axismtx[2];
|
||||
float axis[3];
|
||||
float quat[4];
|
||||
@ -3470,8 +3465,7 @@ static void applyTranslation(TransInfo *t, float vec[3])
|
||||
|
||||
ElementRotation(t, td, mat, V3D_LOCAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
float mat[3][3];
|
||||
|
||||
unit_m3(mat);
|
||||
@ -4174,12 +4168,10 @@ int BoneSize(TransInfo *t, const int mval[2])
|
||||
|
||||
// TRANSFORM_FIX_ME MOVE TO MOUSE INPUT
|
||||
/* for manipulator, center handle, the scaling can't be done relative to center */
|
||||
if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0)
|
||||
{
|
||||
if ((t->flag & T_USES_MANIPULATOR) && t->con.mode==0) {
|
||||
ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ratio = t->values[0];
|
||||
}
|
||||
|
||||
@ -5103,8 +5095,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
|
||||
|
||||
ED_area_headerprint(t->sa, str);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
size[0] = size[1] = size[2] = 1;
|
||||
|
||||
size_to_mat3( mat,size);
|
||||
|
@ -721,8 +721,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
|
||||
copy_m4_m4(tmat, rv3d->viewmat);
|
||||
invert_m4_m4(imat, tmat);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
unit_m4(tmat);
|
||||
unit_m4(imat);
|
||||
}
|
||||
|
@ -721,8 +721,7 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb)
|
||||
{
|
||||
bone->flag |= BONE_TRANSFORM_CHILD;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
bone->flag &= ~BONE_TRANSFORM;
|
||||
}
|
||||
|
||||
@ -1132,8 +1131,7 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
if (ebo->flag & BONE_SELECTED)
|
||||
t->total++;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (ebo->flag & BONE_TIPSEL)
|
||||
t->total++;
|
||||
if (ebo->flag & BONE_ROOTSEL)
|
||||
@ -1201,8 +1199,7 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
td->val= &ebo->dist;
|
||||
td->ival= ebo->dist;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// abusive storage of scale in the loc pointer :)
|
||||
td->loc= &ebo->xwidth;
|
||||
copy_v3_v3(td->iloc, td->loc);
|
||||
@ -1243,8 +1240,7 @@ static void createTransArmatureVerts(TransInfo *t)
|
||||
td++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (ebo->flag & BONE_TIPSEL)
|
||||
{
|
||||
copy_v3_v3(td->iloc, ebo->tail);
|
||||
|
@ -797,8 +797,7 @@ static void recalcData_view3d(TransInfo *t)
|
||||
rotation_between_vecs_to_quat(qrot, td->axismtx[1], vec);
|
||||
mul_qt_v3(qrot, up_axis);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
mul_m3_v3(t->mat, up_axis);
|
||||
}
|
||||
|
||||
@ -811,8 +810,7 @@ static void recalcData_view3d(TransInfo *t)
|
||||
transform_armature_mirror_update(t->obedit);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if(t->state != TRANS_CANCEL) {
|
||||
applyProject(t);
|
||||
}
|
||||
@ -993,8 +991,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
copy_v2_v2_int(t->imval, event->mval);
|
||||
t->event_type = event->type;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->imval[0] = 0;
|
||||
t->imval[1] = 0;
|
||||
}
|
||||
@ -1074,8 +1071,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
t->current_orientation = V3D_MANIP_GLOBAL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->current_orientation = v3d->twmode;
|
||||
}
|
||||
|
||||
@ -1121,8 +1117,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
t->view = &ar->v2d;
|
||||
t->around = sipo->around;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if(ar) {
|
||||
// XXX for now, get View2D from the active region
|
||||
t->view = &ar->v2d;
|
||||
@ -1141,10 +1136,8 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
t->flag |= T_RELEASE_CONFIRM;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (U.flag & USER_RELEASECONFIRM)
|
||||
{
|
||||
else {
|
||||
if (U.flag & USER_RELEASECONFIRM) {
|
||||
t->flag |= T_RELEASE_CONFIRM;
|
||||
}
|
||||
}
|
||||
@ -1181,22 +1174,18 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* use settings from scene only if modal */
|
||||
if (t->flag & T_MODAL)
|
||||
{
|
||||
if ((t->options & CTX_NO_PET) == 0)
|
||||
{
|
||||
if (t->obedit && ts->proportional != PROP_EDIT_OFF)
|
||||
{
|
||||
if (t->flag & T_MODAL) {
|
||||
if ((t->options & CTX_NO_PET) == 0) {
|
||||
if (t->obedit && ts->proportional != PROP_EDIT_OFF) {
|
||||
t->flag |= T_PROP_EDIT;
|
||||
|
||||
if(ts->proportional == PROP_EDIT_CONNECTED)
|
||||
if (ts->proportional == PROP_EDIT_CONNECTED) {
|
||||
t->flag |= T_PROP_CONNECTED;
|
||||
}
|
||||
else if (t->obedit == NULL && ts->proportional_objects)
|
||||
{
|
||||
}
|
||||
else if (t->obedit == NULL && ts->proportional_objects) {
|
||||
t->flag |= T_PROP_EDIT;
|
||||
}
|
||||
}
|
||||
@ -1207,8 +1196,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
t->prop_size = RNA_float_get(op->ptr, "proportional_size");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->prop_size = ts->proportional_size;
|
||||
}
|
||||
|
||||
@ -1224,8 +1212,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
t->prop_mode = RNA_enum_get(op->ptr, "proportional_edit_falloff");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->prop_mode = ts->prop_mode;
|
||||
}
|
||||
}
|
||||
|
@ -44,16 +44,14 @@
|
||||
static void InputVector(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
|
||||
{
|
||||
float vec[3], dvec[3];
|
||||
if(mi->precision)
|
||||
{
|
||||
if (mi->precision) {
|
||||
/* calculate the main translation and the precise one separate */
|
||||
convertViewVec(t, dvec, (mval[0] - mi->precision_mval[0]), (mval[1] - mi->precision_mval[1]));
|
||||
mul_v3_fl(dvec, 0.1f);
|
||||
convertViewVec(t, vec, (mi->precision_mval[0] - t->imval[0]), (mi->precision_mval[1] - t->imval[1]));
|
||||
add_v3_v3v3(output, vec, dvec);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
convertViewVec(t, output, (mval[0] - t->imval[0]), (mval[1] - t->imval[1]));
|
||||
}
|
||||
|
||||
@ -62,8 +60,7 @@ static void InputVector(TransInfo *t, MouseInput *mi, const int mval[2], float o
|
||||
static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3])
|
||||
{
|
||||
float ratio, precise_ratio, dx, dy;
|
||||
if(mi->precision)
|
||||
{
|
||||
if (mi->precision) {
|
||||
/* calculate ratio for shiftkey pos, and for total, and blend these for precision */
|
||||
dx = (float)(mi->center[0] - mi->precision_mval[0]);
|
||||
dy = (float)(mi->center[1] - mi->precision_mval[1]);
|
||||
@ -75,8 +72,7 @@ static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
|
||||
|
||||
ratio = (ratio + (precise_ratio - ratio) / 10.0f) / mi->factor;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dx = (float)(mi->center[0] - mval[0]);
|
||||
dy = (float)(mi->center[1] - mval[1]);
|
||||
ratio = (float)sqrt( dx*dx + dy*dy) / mi->factor;
|
||||
@ -101,13 +97,11 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const int mval[2], flo
|
||||
static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3])
|
||||
{
|
||||
|
||||
if(mi->precision)
|
||||
{
|
||||
if (mi->precision) {
|
||||
output[0] = ( mi->imval[1] - mi->precision_mval[1] ) + ( mi->precision_mval[1] - mval[1] ) * 0.1f;
|
||||
output[1] = ( mi->precision_mval[0] - mi->imval[0] ) + ( mval[0] - mi->precision_mval[0] ) * 0.1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
output[0] = (float)( mi->imval[1] - mval[1] );
|
||||
output[1] = (float)( mval[0] - mi->imval[0] );
|
||||
}
|
||||
@ -122,8 +116,7 @@ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2]
|
||||
|
||||
pad = t->ar->winx / 10;
|
||||
|
||||
if (mi->precision)
|
||||
{
|
||||
if (mi->precision) {
|
||||
/* deal with Shift key by adding motion / 10 to motion before shift press */
|
||||
x = mi->precision_mval[0] + (float)(mval[0] - mi->precision_mval[0]) / 10.0f;
|
||||
}
|
||||
@ -249,9 +242,8 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
|
||||
* approximate the angle with the opposite side of the normalized triangle
|
||||
* This is a good approximation here since the smallest acos value seems to be around
|
||||
* 0.02 degree and lower values don't even have a 0.01% error compared to the approximation
|
||||
* */
|
||||
if (dphi == 0)
|
||||
{
|
||||
*/
|
||||
if (dphi == 0) {
|
||||
double dx, dy;
|
||||
|
||||
dx2 /= A;
|
||||
@ -267,11 +259,12 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
|
||||
if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
|
||||
}
|
||||
|
||||
if(mi->precision) dphi = dphi/30.0f;
|
||||
if (mi->precision) {
|
||||
dphi = dphi/30.0f;
|
||||
}
|
||||
|
||||
/* if no delta angle, don't update initial position */
|
||||
if (dphi != 0)
|
||||
{
|
||||
if (dphi != 0) {
|
||||
mi->imval[0] = mval[0];
|
||||
mi->imval[1] = mval[1];
|
||||
}
|
||||
@ -385,13 +378,11 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float [3])
|
||||
|
||||
void applyMouseInput(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
|
||||
{
|
||||
if (mi->apply != NULL)
|
||||
{
|
||||
if (mi->apply != NULL) {
|
||||
mi->apply(t, mi, mval, output);
|
||||
}
|
||||
|
||||
if (mi->post)
|
||||
{
|
||||
if (mi->post) {
|
||||
mi->post(t, output);
|
||||
}
|
||||
}
|
||||
@ -404,16 +395,14 @@ int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event)
|
||||
{
|
||||
case LEFTSHIFTKEY:
|
||||
case RIGHTSHIFTKEY:
|
||||
if (event->val==KM_PRESS)
|
||||
{
|
||||
if (event->val == KM_PRESS) {
|
||||
t->modifiers |= MOD_PRECISION;
|
||||
/* shift is modifier for higher precision transform
|
||||
* store the mouse position where the normal movement ended */
|
||||
copy_v2_v2_int(mi->precision_mval, event->mval);
|
||||
mi->precision = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->modifiers &= ~MOD_PRECISION;
|
||||
mi->precision = 0;
|
||||
}
|
||||
|
@ -202,8 +202,7 @@ static int test_rotmode_euler(short rotmode)
|
||||
int gimbal_axis(Object *ob, float gmat[][3])
|
||||
{
|
||||
if (ob) {
|
||||
if(ob->mode & OB_MODE_POSE)
|
||||
{
|
||||
if (ob->mode & OB_MODE_POSE) {
|
||||
bPoseChannel *pchan= get_active_posechannel(ob);
|
||||
|
||||
if(pchan) {
|
||||
@ -222,8 +221,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
|
||||
/* apply bone transformation */
|
||||
mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat);
|
||||
|
||||
if (pchan->parent)
|
||||
{
|
||||
if (pchan->parent) {
|
||||
float parent_mat[3][3];
|
||||
|
||||
copy_m3_m4(parent_mat, pchan->parent->pose_mat);
|
||||
@ -233,8 +231,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
|
||||
copy_m3_m4(obmat, ob->obmat);
|
||||
mul_m3_m3m3(gmat, obmat, mat);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* needed if object transformation isn't identity */
|
||||
copy_m3_m4(obmat, ob->obmat);
|
||||
mul_m3_m3m3(gmat, obmat, tmat);
|
||||
@ -255,8 +252,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ob->parent)
|
||||
{
|
||||
if (ob->parent) {
|
||||
float parent_mat[3][3];
|
||||
copy_m3_m4(parent_mat, ob->parent->obmat);
|
||||
normalize_m3(parent_mat);
|
||||
|
@ -276,12 +276,10 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[],
|
||||
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
|
||||
TransformOrientation *ts = NULL;
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
if (overwrite) {
|
||||
ts = findOrientationName(transform_spaces, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
uniqueOrientationName(transform_spaces, name);
|
||||
}
|
||||
|
||||
@ -537,8 +535,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
|
||||
break;
|
||||
|
||||
case V3D_MANIP_VIEW:
|
||||
if (t->ar->regiontype == RGN_TYPE_WINDOW)
|
||||
{
|
||||
if (t->ar->regiontype == RGN_TYPE_WINDOW) {
|
||||
RegionView3D *rv3d = t->ar->regiondata;
|
||||
float mat[3][3];
|
||||
|
||||
@ -547,8 +544,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
|
||||
normalize_m3(mat);
|
||||
copy_m3_m3(t->spacemtx, mat);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
unit_m3(t->spacemtx);
|
||||
}
|
||||
break;
|
||||
@ -609,10 +605,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (em->bm->totfacesel >= 1)
|
||||
{
|
||||
else {
|
||||
if (em->bm->totfacesel >= 1) {
|
||||
BMFace *efa;
|
||||
BMIter iter;
|
||||
|
||||
@ -752,18 +746,14 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
while(a--)
|
||||
{
|
||||
/* exception */
|
||||
if ( (bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT )
|
||||
{
|
||||
if ((bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT) {
|
||||
sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(bezt->f1)
|
||||
{
|
||||
else {
|
||||
if (bezt->f1) {
|
||||
sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[1]);
|
||||
}
|
||||
if(bezt->f2)
|
||||
{
|
||||
if (bezt->f2) {
|
||||
sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[2]);
|
||||
}
|
||||
if(bezt->f3)
|
||||
@ -792,12 +782,10 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
for (ml = editelems.first; ml; ml = ml->next)
|
||||
{
|
||||
if (ml->flag & SELECT) {
|
||||
if (ml_sel == NULL)
|
||||
{
|
||||
if (ml_sel == NULL) {
|
||||
ml_sel = ml;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ml_sel = NULL;
|
||||
break;
|
||||
}
|
||||
@ -845,21 +833,18 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
normalize_v3(normal);
|
||||
normalize_v3(plane);
|
||||
|
||||
if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0)
|
||||
{
|
||||
if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0) {
|
||||
result = ORIENTATION_EDGE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Vectors from edges don't need the special transpose inverse multiplication */
|
||||
if (result == ORIENTATION_EDGE)
|
||||
{
|
||||
if (result == ORIENTATION_EDGE) {
|
||||
mul_mat3_m4_v3(ob->obmat, normal);
|
||||
mul_mat3_m4_v3(ob->obmat, plane);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
mul_m3_v3(mat, normal);
|
||||
mul_m3_v3(mat, plane);
|
||||
}
|
||||
@ -933,33 +918,28 @@ void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[]
|
||||
switch (type)
|
||||
{
|
||||
case ORIENTATION_NORMAL:
|
||||
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0)
|
||||
{
|
||||
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {
|
||||
type = ORIENTATION_NONE;
|
||||
}
|
||||
break;
|
||||
case ORIENTATION_VERT:
|
||||
if (createSpaceNormal(orientation_mat, normal) == 0)
|
||||
{
|
||||
if (createSpaceNormal(orientation_mat, normal) == 0) {
|
||||
type = ORIENTATION_NONE;
|
||||
}
|
||||
break;
|
||||
case ORIENTATION_EDGE:
|
||||
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0)
|
||||
{
|
||||
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {
|
||||
type = ORIENTATION_NONE;
|
||||
}
|
||||
break;
|
||||
case ORIENTATION_FACE:
|
||||
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0)
|
||||
{
|
||||
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {
|
||||
type = ORIENTATION_NONE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (type == ORIENTATION_NONE)
|
||||
{
|
||||
if (type == ORIENTATION_NONE) {
|
||||
unit_m3(orientation_mat);
|
||||
}
|
||||
}
|
||||
|
@ -388,8 +388,7 @@ static void initSnappingMode(TransInfo *t)
|
||||
Scene *scene = t->scene;
|
||||
|
||||
/* force project off when not supported */
|
||||
if (ts->snap_mode != SCE_SNAP_MODE_FACE)
|
||||
{
|
||||
if (ts->snap_mode != SCE_SNAP_MODE_FACE) {
|
||||
t->tsnap.project = 0;
|
||||
}
|
||||
|
||||
@ -404,12 +403,10 @@ static void initSnappingMode(TransInfo *t)
|
||||
(obedit != NULL && ELEM4(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE)) ) // Temporary limited to edit mode meshes, armature, curves
|
||||
{
|
||||
/* Exclude editmesh if using proportional edit */
|
||||
if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT))
|
||||
{
|
||||
if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT)) {
|
||||
t->tsnap.modeSelect = SNAP_NOT_OBEDIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->tsnap.modeSelect = t->tsnap.snap_self ? SNAP_ALL : SNAP_NOT_OBEDIT;
|
||||
}
|
||||
}
|
||||
@ -425,14 +422,12 @@ static void initSnappingMode(TransInfo *t)
|
||||
{
|
||||
t->tsnap.modeSelect = SNAP_NOT_SELECTED;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* Grid if snap is not possible */
|
||||
t->tsnap.mode = SCE_SNAP_MODE_INCREMENT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/* Always grid outside of 3D view */
|
||||
t->tsnap.mode = SCE_SNAP_MODE_INCREMENT;
|
||||
}
|
||||
@ -831,23 +826,20 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
}
|
||||
}
|
||||
/* otherwise, pair first with second and so on */
|
||||
else
|
||||
{
|
||||
else {
|
||||
for (p2 = p1->next; p2 && p2->ob != p1->ob; p2 = p2->next)
|
||||
{
|
||||
/* nothing to do here */
|
||||
}
|
||||
}
|
||||
|
||||
if (p2)
|
||||
{
|
||||
if (p2) {
|
||||
p2->flag = 1;
|
||||
|
||||
add_v3_v3v3(vec, p1->p, p2->p);
|
||||
mul_v3_fl(vec, 0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
copy_v3_v3(vec, p1->p);
|
||||
}
|
||||
|
||||
@ -860,8 +852,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
|
||||
new_dist = len_v3v3(last_p, vec);
|
||||
|
||||
if (new_dist < max_dist)
|
||||
{
|
||||
if (new_dist < max_dist) {
|
||||
copy_v3_v3(p, vec);
|
||||
max_dist = new_dist;
|
||||
}
|
||||
@ -880,13 +871,11 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
|
||||
BLI_freelistN(&depth_peels);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
found = snapObjectsTransform(t, mval, &dist, loc, no, t->tsnap.modeSelect);
|
||||
}
|
||||
|
||||
if (found == 1)
|
||||
{
|
||||
if (found == 1) {
|
||||
float tangent[3];
|
||||
|
||||
sub_v3_v3v3(tangent, loc, t->tsnap.snapPoint);
|
||||
@ -902,8 +891,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
|
||||
t->tsnap.status |= POINT_INIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->tsnap.status &= ~POINT_INIT;
|
||||
}
|
||||
}
|
||||
@ -923,8 +911,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
|
||||
|
||||
t->tsnap.status |= POINT_INIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->tsnap.status &= ~POINT_INIT;
|
||||
}
|
||||
}
|
||||
@ -977,8 +964,7 @@ static void TargetSnapActive(TransInfo *t)
|
||||
t->tsnap.status |= TARGET_INIT;
|
||||
}
|
||||
/* No active, default to median */
|
||||
else
|
||||
{
|
||||
else {
|
||||
t->tsnap.target = SCE_SNAP_TARGET_MEDIAN;
|
||||
t->tsnap.targetSnap = TargetSnapMedian;
|
||||
TargetSnapMedian(t);
|
||||
@ -1043,8 +1029,7 @@ static void TargetSnapClosest(TransInfo *t)
|
||||
|
||||
dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint);
|
||||
|
||||
if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
|
||||
{
|
||||
if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist)) {
|
||||
copy_v3_v3(t->tsnap.snapTarget, loc);
|
||||
closest = td;
|
||||
t->tsnap.dist = dist;
|
||||
@ -1052,8 +1037,7 @@ static void TargetSnapClosest(TransInfo *t)
|
||||
}
|
||||
}
|
||||
/* use element center otherwise */
|
||||
else
|
||||
{
|
||||
else {
|
||||
float loc[3];
|
||||
float dist;
|
||||
|
||||
@ -1070,11 +1054,9 @@ static void TargetSnapClosest(TransInfo *t)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
int i;
|
||||
for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++)
|
||||
{
|
||||
for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++) {
|
||||
float loc[3];
|
||||
float dist;
|
||||
|
||||
@ -1446,21 +1428,17 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
|
||||
|
||||
if (em != NULL)
|
||||
{
|
||||
if (index_array)
|
||||
{
|
||||
if (index_array) {
|
||||
index = index_array[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
index = i;
|
||||
}
|
||||
|
||||
if (index == ORIGINDEX_NONE)
|
||||
{
|
||||
if (index == ORIGINDEX_NONE) {
|
||||
test = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
efa = EDBM_get_face_for_index(em, index);
|
||||
|
||||
if (efa && BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
|
||||
@ -1528,23 +1506,18 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
|
||||
|
||||
test = 1; /* reset for every vert */
|
||||
|
||||
if (em != NULL)
|
||||
{
|
||||
if (index_array)
|
||||
{
|
||||
if (em != NULL) {
|
||||
if (index_array) {
|
||||
index = index_array[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
index = i;
|
||||
}
|
||||
|
||||
if (index == ORIGINDEX_NONE)
|
||||
{
|
||||
if (index == ORIGINDEX_NONE) {
|
||||
test = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
eve = EDBM_get_vert_for_index(em, index);
|
||||
|
||||
if (eve && (BM_elem_flag_test(eve, BM_ELEM_HIDDEN) || BM_elem_flag_test(eve, BM_ELEM_SELECT)))
|
||||
@ -1590,21 +1563,17 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
|
||||
|
||||
if (em != NULL)
|
||||
{
|
||||
if (index_array)
|
||||
{
|
||||
if (index_array) {
|
||||
index = index_array[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
index = i;
|
||||
}
|
||||
|
||||
if (index == ORIGINDEX_NONE)
|
||||
{
|
||||
if (index == ORIGINDEX_NONE) {
|
||||
test = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
eed = EDBM_get_edge_for_index(em, index);
|
||||
|
||||
if (eed && (BM_elem_flag_test(eed, BM_ELEM_HIDDEN) ||
|
||||
@ -1647,14 +1616,12 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo
|
||||
BMEditMesh *em;
|
||||
DerivedMesh *dm;
|
||||
|
||||
if (editobject)
|
||||
{
|
||||
if (editobject) {
|
||||
em = BMEdit_FromObject(ob);
|
||||
/* dm = editbmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH); */
|
||||
dm = editbmesh_get_derived_base(ob, em); /* limitation, em & dm MUST have the same number of faces */
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
em = NULL;
|
||||
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
|
||||
}
|
||||
@ -1938,14 +1905,12 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
|
||||
DerivedMesh *dm = NULL;
|
||||
int val;
|
||||
|
||||
if (dob != obedit)
|
||||
{
|
||||
if (dob != obedit) {
|
||||
dm = mesh_get_derived_final(scene, dob, CD_MASK_BAREMESH);
|
||||
|
||||
val = peelDerivedMesh(dob, dm, dob->obmat, ray_start, ray_normal, mval, depth_peels);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
em = ((Mesh *)dob->data)->edit_mesh;
|
||||
dm = editmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH);
|
||||
|
||||
@ -1967,14 +1932,12 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
|
||||
DerivedMesh *dm = NULL;
|
||||
int val;
|
||||
|
||||
if (ob != obedit)
|
||||
{
|
||||
if (ob != obedit) {
|
||||
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
|
||||
|
||||
val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
em = BMEdit_FromObject(ob);
|
||||
dm = editbmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH);
|
||||
|
||||
|
@ -148,12 +148,10 @@ void applyNumInput(NumInput *n, float *vec)
|
||||
vec[j] = 0.0001f;
|
||||
}
|
||||
else {
|
||||
if (n->inv[i])
|
||||
{
|
||||
if (n->inv[i]) {
|
||||
vec[j] = 1.0f / n->val[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
vec[j] = n->val[i];
|
||||
}
|
||||
}
|
||||
|
@ -185,8 +185,7 @@ static StitchPreviewer * stitch_preview_init(void)
|
||||
/* destructor...yeah this should be C++ :) */
|
||||
static void stitch_preview_delete(void)
|
||||
{
|
||||
if(_stitch_preview)
|
||||
{
|
||||
if(_stitch_preview) {
|
||||
if(_stitch_preview->preview_polys){
|
||||
MEM_freeN(_stitch_preview->preview_polys);
|
||||
_stitch_preview->preview_polys = NULL;
|
||||
@ -507,8 +506,7 @@ static void stitch_set_face_preview_buffer_position(BMFace *efa, StitchPreviewer
|
||||
{
|
||||
int index = BM_elem_index_get(efa);
|
||||
|
||||
if(preview_position[index].data_position == STITCH_NO_PREVIEW)
|
||||
{
|
||||
if(preview_position[index].data_position == STITCH_NO_PREVIEW) {
|
||||
preview_position[index].data_position = preview->preview_uvs*2;
|
||||
preview_position[index].polycount_position = preview->num_polys++;
|
||||
preview->preview_uvs += efa->len;
|
||||
@ -1294,8 +1292,7 @@ static void stitch_select(bContext *C, Scene *scene, wmEvent *event, StitchState
|
||||
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
|
||||
uv_find_nearest_vert(scene, ima, stitch_state->em, co, NULL, &hit);
|
||||
|
||||
if(hit.efa)
|
||||
{
|
||||
if (hit.efa) {
|
||||
/* Add vertex to selection, deselect all common uv's of vert other
|
||||
* than selected and update the preview. This behavior was decided so that
|
||||
* you can do stuff like deselect the opposite stitchable vertex and the initial still gets deselected */
|
||||
|
@ -631,8 +631,7 @@ static char *code_generate_vertex(ListBase *nodes)
|
||||
for (node=nodes->first; node; node=node->next)
|
||||
for (input=node->inputs.first; input; input=input->next)
|
||||
if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
|
||||
if(input->attribtype == CD_TANGENT) /* silly exception */
|
||||
{
|
||||
if(input->attribtype == CD_TANGENT) { /* silly exception */
|
||||
BLI_dynstr_appendf(ds, "\tvar%d.xyz = normalize((gl_ModelViewMatrix * vec4(att%d.xyz, 0)).xyz);\n", input->attribid, input->attribid);
|
||||
BLI_dynstr_appendf(ds, "\tvar%d.w = att%d.w;\n", input->attribid, input->attribid);
|
||||
}
|
||||
|
@ -278,8 +278,7 @@ static GLenum gpu_get_mipmap_filter(int mag)
|
||||
/* Anisotropic filtering settings */
|
||||
void GPU_set_anisotropic(float value)
|
||||
{
|
||||
if (GTS.anisotropic != value)
|
||||
{
|
||||
if (GTS.anisotropic != value) {
|
||||
GPU_free_images();
|
||||
|
||||
/* Clamp value to the maximum value the graphics card supports */
|
||||
@ -875,8 +874,7 @@ int GPU_update_image_time(Image *ima, double time)
|
||||
|
||||
void GPU_free_smoke(SmokeModifierData *smd)
|
||||
{
|
||||
if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain)
|
||||
{
|
||||
if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) {
|
||||
if(smd->domain->tex)
|
||||
GPU_texture_free(smd->domain->tex);
|
||||
smd->domain->tex = NULL;
|
||||
@ -1301,8 +1299,7 @@ void GPU_end_object_materials(void)
|
||||
GMS.alphablend= NULL;
|
||||
|
||||
/* resetting the texture matrix after the glScale needed for tiled textures */
|
||||
if(GTS.tilemode)
|
||||
{
|
||||
if(GTS.tilemode) {
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
@ -335,10 +335,11 @@ cineonGetRowBytes(CineonFile* cineon, unsigned short* row, int y) {
|
||||
|
||||
longsRead = logimage_fread(cineon->lineBuffer, 4, cineon->lineBufferLength, cineon);
|
||||
if (longsRead != cineon->lineBufferLength) {
|
||||
if (verbose)
|
||||
{ d_printf("Couldn't read line %d length %d\n", y, cineon->lineBufferLength * 4);
|
||||
if (verbose) {
|
||||
d_printf("Couldn't read line %d length %d\n", y, cineon->lineBufferLength * 4);
|
||||
perror("cineonGetRowBytes");
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
|
||||
/* decode the stream and fill the image structure */
|
||||
image = opj_decode(dinfo, cio);
|
||||
|
||||
if(!image) {
|
||||
if (!image) {
|
||||
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
|
||||
opj_destroy_decompress(dinfo);
|
||||
opj_cio_close(cio);
|
||||
@ -157,8 +157,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
|
||||
opj_cio_close(cio);
|
||||
|
||||
|
||||
if((image->numcomps * image->x1 * image->y1) == 0)
|
||||
{
|
||||
if((image->numcomps * image->x1 * image->y1) == 0) {
|
||||
fprintf(stderr,"\nError: invalid raw image parameters\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -177,8 +177,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t
|
||||
{
|
||||
my_src_ptr src;
|
||||
|
||||
if (cinfo->src == NULL)
|
||||
{ /* first time for this JPEG object? */
|
||||
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
||||
cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)
|
||||
((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(my_source_mgr));
|
||||
}
|
||||
|
@ -183,8 +183,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags)
|
||||
unsigned char* ptr;
|
||||
char oriY[80], oriX[80];
|
||||
|
||||
if (imb_is_a_hdr((void*)mem))
|
||||
{
|
||||
if (imb_is_a_hdr((void *)mem)) {
|
||||
/* find empty line, next line is resolution info */
|
||||
for (x=1;x<size;x++) {
|
||||
if ((mem[x-1]=='\n') && (mem[x]=='\n')) {
|
||||
|
@ -215,12 +215,10 @@ static int isqtime (const char *name)
|
||||
|
||||
void silence_log_ffmpeg(int quiet)
|
||||
{
|
||||
if (quiet)
|
||||
{
|
||||
if (quiet) {
|
||||
av_log_set_level(AV_LOG_QUIET);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
|
@ -981,8 +981,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
|
||||
}
|
||||
|
||||
/* FOR DEBUG */
|
||||
if (debugSDNA > 1)
|
||||
{
|
||||
if (debugSDNA > 1) {
|
||||
int a,b;
|
||||
/* short *elem; */
|
||||
short num_types;
|
||||
|
@ -124,8 +124,8 @@ void rna_Actuator_name_set(PointerRNA *ptr, const char *value)
|
||||
static void rna_Actuator_type_set(struct PointerRNA *ptr, int value)
|
||||
{
|
||||
bActuator *act = (bActuator *)ptr->data;
|
||||
if (value != act->type)
|
||||
{
|
||||
|
||||
if (value != act->type) {
|
||||
act->type = value;
|
||||
init_actuator(act);
|
||||
}
|
||||
@ -135,8 +135,8 @@ static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value)
|
||||
{
|
||||
bActuator *act = (bActuator *)ptr->data;
|
||||
bConstraintActuator *ca = act->data;
|
||||
if (value != ca->type)
|
||||
{
|
||||
|
||||
if (value != ca->type) {
|
||||
ca->type = value;
|
||||
switch (ca->type) {
|
||||
case ACT_CONST_TYPE_ORI:
|
||||
@ -364,8 +364,7 @@ static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value)
|
||||
{
|
||||
bActuator *act = (bActuator *)ptr->data;
|
||||
bObjectActuator *oa = act->data;
|
||||
if (value != oa->type)
|
||||
{
|
||||
if (value != oa->type) {
|
||||
oa->type = value;
|
||||
switch (oa->type) {
|
||||
case ACT_OBJECT_NORMAL:
|
||||
|
@ -91,8 +91,8 @@ void rna_Constroller_name_set(PointerRNA *ptr, const char *value)
|
||||
static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
|
||||
{
|
||||
bController *cont = (bController *)ptr->data;
|
||||
if (value != cont->type)
|
||||
{
|
||||
|
||||
if (value != cont->type) {
|
||||
cont->type = value;
|
||||
init_controller(cont);
|
||||
}
|
||||
@ -104,8 +104,7 @@ static void rna_Controller_mode_set(struct PointerRNA *ptr, int value)
|
||||
bPythonCont *pycon = (bPythonCont *)cont->data;
|
||||
|
||||
/* if mode changed and previous mode were Script */
|
||||
if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT)
|
||||
{
|
||||
if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) {
|
||||
/* clear script to avoid it to get linked with the controller */
|
||||
pycon->text = NULL;
|
||||
}
|
||||
|
@ -272,8 +272,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
if (ob->type == OB_MESH && !psys) {
|
||||
/* add particle system */
|
||||
psmd = (ParticleSystemModifierData *)object_add_particle_system(scene, ob, NULL);
|
||||
if (psmd)
|
||||
{
|
||||
if (psmd) {
|
||||
psys = psmd->psys;
|
||||
part = psys->part;
|
||||
part->lifetime = 1.0f;
|
||||
|
@ -934,8 +934,7 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
|
||||
ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
|
||||
|
||||
/* assume triangle mesh, if no bounds chosen for soft body */
|
||||
if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_TRIANGLE_MESH))
|
||||
{
|
||||
if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_TRIANGLE_MESH)) {
|
||||
ob->boundtype = OB_BOUND_TRIANGLE_MESH;
|
||||
}
|
||||
/* create a BulletSoftBody structure if not already existing */
|
||||
|
@ -1247,8 +1247,7 @@ static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
|
||||
scene->audio.flag &= ~AUDIO_SYNC;
|
||||
scene->flag |= SCE_FRAME_DROP;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
scene->audio.flag &= ~AUDIO_SYNC;
|
||||
scene->flag &= ~SCE_FRAME_DROP;
|
||||
}
|
||||
|
@ -255,8 +255,7 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P
|
||||
ts = transform_spaces->first;
|
||||
}
|
||||
|
||||
if (ts)
|
||||
{
|
||||
if (ts) {
|
||||
RNA_enum_item_add_separator(&item, &totitem);
|
||||
|
||||
for (; ts; ts = ts->next) {
|
||||
|
@ -586,9 +586,11 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type)
|
||||
mat= (Material**)MEM_mallocN(sizeof(Material*)*maxmat, "NewBooleanMeshMat");
|
||||
|
||||
/* put some checks in for nice user feedback */
|
||||
if (dm == NULL || dm_select == NULL) return 0;
|
||||
if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select))
|
||||
{
|
||||
if (dm == NULL || dm_select == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select)) {
|
||||
MEM_freeN(mat);
|
||||
return -1;
|
||||
}
|
||||
|
@ -75,8 +75,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
|
||||
DerivedMesh *result=NULL;
|
||||
|
||||
/* check for alloc failing */
|
||||
if(!clmd->sim_parms || !clmd->coll_parms)
|
||||
{
|
||||
if (!clmd->sim_parms || !clmd->coll_parms) {
|
||||
initData(md);
|
||||
|
||||
if(!clmd->sim_parms || !clmd->coll_parms)
|
||||
@ -101,24 +100,18 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
|
||||
dm->release(dm);
|
||||
}
|
||||
|
||||
static void updateDepgraph(
|
||||
ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
|
||||
DagNode *obNode)
|
||||
static void updateDepgraph(ModifierData *md, DagForest *forest, Scene *scene, Object *ob, DagNode *obNode)
|
||||
{
|
||||
ClothModifierData *clmd = (ClothModifierData*) md;
|
||||
|
||||
Base *base;
|
||||
|
||||
if(clmd)
|
||||
{
|
||||
for(base = scene->base.first; base; base= base->next)
|
||||
{
|
||||
if(clmd) {
|
||||
for(base = scene->base.first; base; base= base->next) {
|
||||
Object *ob1= base->object;
|
||||
if(ob1 != ob)
|
||||
{
|
||||
if (ob1 != ob) {
|
||||
CollisionModifierData *coll_clmd = (CollisionModifierData *)modifiers_findByType(ob1, eModifierType_Collision);
|
||||
if(coll_clmd)
|
||||
{
|
||||
if (coll_clmd) {
|
||||
DagNode *curNode = dag_get_node(forest, ob1);
|
||||
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Cloth Collision");
|
||||
}
|
||||
@ -175,8 +168,7 @@ static void freeData(ModifierData *md)
|
||||
{
|
||||
ClothModifierData *clmd = (ClothModifierData*) md;
|
||||
|
||||
if (clmd)
|
||||
{
|
||||
if (clmd) {
|
||||
if(G.rt > 0)
|
||||
printf("clothModifier_freeData\n");
|
||||
|
||||
|
@ -207,12 +207,10 @@ static void deformVerts(ModifierData *md, Object *ob,
|
||||
}
|
||||
|
||||
/* happens on file load (ONLY when i decomment changes in readfile.c) */
|
||||
if(!collmd->bvhtree)
|
||||
{
|
||||
if (!collmd->bvhtree) {
|
||||
collmd->bvhtree = bvhtree_build_from_mvert(collmd->mfaces, collmd->numfaces, collmd->current_x, numverts, ob->pd->pdef_sboft);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// recalc static bounding boxes
|
||||
bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 );
|
||||
}
|
||||
@ -225,14 +223,11 @@ static void deformVerts(ModifierData *md, Object *ob,
|
||||
}
|
||||
|
||||
}
|
||||
else if(current_time < collmd->time_xnew)
|
||||
{
|
||||
else if(current_time < collmd->time_xnew) {
|
||||
freeData((ModifierData *)collmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(numverts != collmd->numverts)
|
||||
{
|
||||
else {
|
||||
if (numverts != collmd->numverts) {
|
||||
freeData((ModifierData *)collmd);
|
||||
}
|
||||
}
|
||||
|
@ -99,12 +99,10 @@ static int dependsOnTime(ModifierData *md)
|
||||
{
|
||||
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
|
||||
|
||||
if(dmd->texture)
|
||||
{
|
||||
if(dmd->texture) {
|
||||
return BKE_texture_dependsOnTime(dmd->texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -119,15 +119,13 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
|
||||
DynamicPaintModifierData *pmd = (DynamicPaintModifierData*) md;
|
||||
|
||||
/* add relation from canvases to all brush objects */
|
||||
if(pmd && pmd->canvas)
|
||||
{
|
||||
if (pmd && pmd->canvas) {
|
||||
Base *base = scene->base.first;
|
||||
|
||||
for(; base; base = base->next) {
|
||||
for (; base; base = base->next) {
|
||||
DynamicPaintModifierData *pmd2 = (DynamicPaintModifierData *)modifiers_findByType(base->object, eModifierType_DynamicPaint);
|
||||
|
||||
if(pmd2 && pmd2->brush && ob!=base->object)
|
||||
{
|
||||
if (pmd2 && pmd2->brush && ob!=base->object) {
|
||||
DagNode *brushNode = dag_get_node(forest, base->object);
|
||||
dag_add_relation(forest, brushNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Dynamic Paint Brush");
|
||||
}
|
||||
|
@ -818,13 +818,13 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
||||
vertpahash= BLI_edgehash_new();
|
||||
|
||||
for (i=0; i<totface; i++) {
|
||||
if(facepa[i]!=totpart)
|
||||
{
|
||||
pa=pars+facepa[i];
|
||||
if (facepa[i] != totpart) {
|
||||
pa = pars + facepa[i];
|
||||
|
||||
if((pa->alive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0)
|
||||
|| (pa->alive==PARS_ALIVE && (emd->flag&eExplodeFlag_Alive)==0)
|
||||
|| (pa->alive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0)) {
|
||||
if ((pa->alive == PARS_UNBORN && (emd->flag & eExplodeFlag_Unborn) == 0) ||
|
||||
(pa->alive == PARS_ALIVE && (emd->flag & eExplodeFlag_Alive) == 0) ||
|
||||
(pa->alive == PARS_DEAD && (emd->flag & eExplodeFlag_Dead) == 0))
|
||||
{
|
||||
delface++;
|
||||
continue;
|
||||
}
|
||||
@ -915,8 +915,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
||||
MFace source;
|
||||
int orig_v4;
|
||||
|
||||
if(facepa[i]!=totpart)
|
||||
{
|
||||
if (facepa[i]!=totpart) {
|
||||
pa=pars+facepa[i];
|
||||
|
||||
if(pa->alive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0) continue;
|
||||
|
@ -85,13 +85,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
DerivedMesh *result = NULL;
|
||||
|
||||
/* check for alloc failing */
|
||||
if(!fluidmd->fss)
|
||||
{
|
||||
if(!fluidmd->fss) {
|
||||
initData(md);
|
||||
|
||||
if(!fluidmd->fss)
|
||||
if (!fluidmd->fss) {
|
||||
return dm;
|
||||
}
|
||||
}
|
||||
|
||||
result= fluidsimModifier_do(fluidmd, md->scene, ob, dm, useRenderParams, isFinalCalc);
|
||||
|
||||
@ -105,20 +105,15 @@ static void updateDepgraph(
|
||||
FluidsimModifierData *fluidmd= (FluidsimModifierData*) md;
|
||||
Base *base;
|
||||
|
||||
if(fluidmd && fluidmd->fss)
|
||||
{
|
||||
if(fluidmd->fss->type == OB_FLUIDSIM_DOMAIN)
|
||||
{
|
||||
for(base = scene->base.first; base; base= base->next)
|
||||
{
|
||||
if(fluidmd && fluidmd->fss) {
|
||||
if(fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) {
|
||||
for(base = scene->base.first; base; base= base->next) {
|
||||
Object *ob1= base->object;
|
||||
if(ob1 != ob)
|
||||
{
|
||||
if(ob1 != ob) {
|
||||
FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim);
|
||||
|
||||
// only put dependancies from NON-DOMAIN fluids in here
|
||||
if(fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type!=OB_FLUIDSIM_DOMAIN))
|
||||
{
|
||||
if(fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type!=OB_FLUIDSIM_DOMAIN)) {
|
||||
DagNode *curNode = dag_get_node(forest, ob1);
|
||||
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Fluidsim Object");
|
||||
}
|
||||
|
@ -506,12 +506,10 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
|
||||
// load vertex velocities, if they exist...
|
||||
// TODO? use generate flag as loading flag as well?
|
||||
// warning, needs original .bobj.gz mesh loading filename
|
||||
if(displaymode==3)
|
||||
{
|
||||
if (displaymode==3) {
|
||||
fluidsim_read_vel_cache(fluidmd, dm, targetFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if(fss->meshVelocities)
|
||||
MEM_freeN(fss->meshVelocities);
|
||||
|
||||
@ -548,8 +546,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
|
||||
// clmd->sim_parms->timescale= timescale;
|
||||
|
||||
// support reversing of baked fluid frames here
|
||||
if((fss->flag & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0))
|
||||
{
|
||||
if ((fss->flag & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0)) {
|
||||
framenr = fss->lastgoodframe - framenr + 1;
|
||||
CLAMP(framenr, 1, fss->lastgoodframe);
|
||||
}
|
||||
|
@ -85,12 +85,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
|
||||
{
|
||||
MaskModifierData *mmd = (MaskModifierData *)md;
|
||||
|
||||
if (mmd->ob_arm)
|
||||
{
|
||||
if (mmd->ob_arm) {
|
||||
DagNode *armNode = dag_get_node(forest, mmd->ob_arm);
|
||||
|
||||
dag_add_relation(forest, armNode, obNode,
|
||||
DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Mask Modifier");
|
||||
dag_add_relation(forest, armNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Mask Modifier");
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,8 +138,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
}
|
||||
|
||||
/* if mode is to use selected armature bones, aggregate the bone groups */
|
||||
if (mmd->mode == MOD_MASK_MODE_ARM) /* --- using selected bones --- */
|
||||
{
|
||||
if (mmd->mode == MOD_MASK_MODE_ARM) { /* --- using selected bones --- */
|
||||
GHash *vgroupHash;
|
||||
Object *oba= mmd->ob_arm;
|
||||
bPoseChannel *pchan;
|
||||
@ -156,10 +153,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
|
||||
bone_select_array= MEM_mallocN(defbase_tot * sizeof(char), "mask array");
|
||||
|
||||
for (i = 0, def = ob->defbase.first; def; def = def->next, i++)
|
||||
{
|
||||
if (((pchan= get_pose_channel(oba->pose, def->name)) && pchan->bone && (pchan->bone->flag & BONE_SELECTED)))
|
||||
{
|
||||
for (i = 0, def = ob->defbase.first; def; def = def->next, i++) {
|
||||
pchan = get_pose_channel(oba->pose, def->name);
|
||||
if (pchan && pchan->bone && (pchan->bone->flag & BONE_SELECTED)) {
|
||||
bone_select_array[i]= TRUE;
|
||||
bone_select_tot++;
|
||||
}
|
||||
@ -179,8 +175,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
BLI_ghash_insert(vgroupHash, def->name, SET_INT_IN_POINTER(i));
|
||||
|
||||
/* if no bones selected, free hashes and return original mesh */
|
||||
if (bone_select_tot == 0)
|
||||
{
|
||||
if (bone_select_tot == 0) {
|
||||
BLI_ghash_free(vgroupHash, NULL, NULL);
|
||||
MEM_freeN(bone_select_array);
|
||||
|
||||
@ -189,8 +184,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
|
||||
/* repeat the previous check, but for dverts */
|
||||
dvert= dm->getVertDataArray(dm, CD_MDEFORMVERT);
|
||||
if (dvert == NULL)
|
||||
{
|
||||
if (dvert == NULL) {
|
||||
BLI_ghash_free(vgroupHash, NULL, NULL);
|
||||
MEM_freeN(bone_select_array);
|
||||
|
||||
@ -311,8 +305,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
}
|
||||
|
||||
/* all verts must be available */
|
||||
if (ok)
|
||||
{
|
||||
if (ok) {
|
||||
BLI_ghash_insert(polyHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numPolys));
|
||||
loop_mapping[numPolys] = numLoops;
|
||||
numPolys++;
|
||||
|
@ -74,8 +74,7 @@ static void simpleDeform_taper(const float factor, const float dcut[3], float *c
|
||||
co[1] = y + y*scale;
|
||||
co[2] = z;
|
||||
|
||||
if(dcut)
|
||||
{
|
||||
if (dcut) {
|
||||
co[0] += dcut[0];
|
||||
co[1] += dcut[1];
|
||||
co[2] += dcut[2];
|
||||
@ -93,9 +92,7 @@ static void simpleDeform_stretch(const float factor, const float dcut[3], float
|
||||
co[1] = y*scale;
|
||||
co[2] = z*(1.0f+factor);
|
||||
|
||||
|
||||
if(dcut)
|
||||
{
|
||||
if (dcut) {
|
||||
co[0] += dcut[0];
|
||||
co[1] += dcut[1];
|
||||
co[2] += dcut[2];
|
||||
@ -115,8 +112,7 @@ static void simpleDeform_twist(const float factor, const float *dcut, float *co)
|
||||
co[1] = x*sint + y*cost;
|
||||
co[2] = z;
|
||||
|
||||
if(dcut)
|
||||
{
|
||||
if(dcut) {
|
||||
co[0] += dcut[0];
|
||||
co[1] += dcut[1];
|
||||
co[2] += dcut[2];
|
||||
@ -132,16 +128,13 @@ static void simpleDeform_bend(const float factor, const float dcut[3], float *co
|
||||
sint = sin(theta);
|
||||
cost = cos(theta);
|
||||
|
||||
if(fabsf(factor) > 1e-7f)
|
||||
{
|
||||
if (fabsf(factor) > 1e-7f) {
|
||||
co[0] = -(y-1.0f/factor)*sint;
|
||||
co[1] = (y-1.0f/factor)*cost + 1.0f/factor;
|
||||
co[2] = z;
|
||||
}
|
||||
|
||||
|
||||
if(dcut)
|
||||
{
|
||||
if (dcut) {
|
||||
co[0] += cost*dcut[0];
|
||||
co[1] += sint*dcut[0];
|
||||
co[2] += dcut[2];
|
||||
@ -176,12 +169,10 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
|
||||
{
|
||||
transf = &tmp_transf;
|
||||
|
||||
if(smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL)
|
||||
{
|
||||
if (smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL) {
|
||||
space_transform_from_matrixs(transf, ob->obmat, smd->origin->obmat);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
copy_m4_m4(transf->local2target, smd->origin->obmat);
|
||||
invert_m4_m4(transf->target2local, transf->local2target);
|
||||
}
|
||||
@ -230,17 +221,17 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
|
||||
{
|
||||
float weight = defvert_array_find_weight_safe(dvert, i, vgroup);
|
||||
|
||||
if(weight != 0.0f)
|
||||
{
|
||||
if (weight != 0.0f) {
|
||||
float co[3], dcut[3] = {0.0f, 0.0f, 0.0f};
|
||||
|
||||
if(transf) space_transform_apply(transf, vertexCos[i]);
|
||||
if(transf) {
|
||||
space_transform_apply(transf, vertexCos[i]);
|
||||
}
|
||||
|
||||
copy_v3_v3(co, vertexCos[i]);
|
||||
|
||||
//Apply axis limits
|
||||
if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) //Bend mode shoulnt have any lock axis
|
||||
{
|
||||
/* Apply axis limits */
|
||||
if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) { /* Bend mode shoulnt have any lock axis */
|
||||
if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_X) axis_limit(0, lock_axis, co, dcut);
|
||||
if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_Y) axis_limit(1, lock_axis, co, dcut);
|
||||
}
|
||||
|
@ -109,21 +109,16 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
|
||||
{
|
||||
SmokeModifierData *smd = (SmokeModifierData *) md;
|
||||
|
||||
if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
|
||||
{
|
||||
if(smd->domain->fluid_group)
|
||||
{
|
||||
if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
|
||||
if (smd->domain->fluid_group) {
|
||||
GroupObject *go = NULL;
|
||||
|
||||
for(go = smd->domain->fluid_group->gobject.first; go; go = go->next)
|
||||
{
|
||||
if(go->ob)
|
||||
{
|
||||
for (go = smd->domain->fluid_group->gobject.first; go; go = go->next) {
|
||||
if (go->ob) {
|
||||
SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(go->ob, eModifierType_Smoke);
|
||||
|
||||
// check for initialized smoke object
|
||||
if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll)))
|
||||
{
|
||||
if (smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) {
|
||||
DagNode *curNode = dag_get_node(forest, go->ob);
|
||||
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
|
||||
}
|
||||
@ -133,11 +128,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
|
||||
else {
|
||||
Base *base = scene->base.first;
|
||||
|
||||
for(; base; base = base->next) {
|
||||
for ( ; base; base = base->next) {
|
||||
SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(base->object, eModifierType_Smoke);
|
||||
|
||||
if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll)))
|
||||
{
|
||||
if (smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) {
|
||||
DagNode *curNode = dag_get_node(forest, base->object);
|
||||
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
|
||||
}
|
||||
|
@ -60,8 +60,7 @@ static void freeData(ModifierData *md)
|
||||
{
|
||||
SurfaceModifierData *surmd = (SurfaceModifierData*) md;
|
||||
|
||||
if (surmd)
|
||||
{
|
||||
if (surmd) {
|
||||
if(surmd->bvhtree) {
|
||||
free_bvhtree_from_mesh(surmd->bvhtree);
|
||||
MEM_freeN(surmd->bvhtree);
|
||||
@ -102,14 +101,12 @@ static void deformVerts(ModifierData *md, Object *ob,
|
||||
if(derivedData) surmd->dm = CDDM_copy(derivedData);
|
||||
else surmd->dm = get_dm(ob, NULL, NULL, NULL, 0);
|
||||
|
||||
if(!ob->pd)
|
||||
{
|
||||
if (!ob->pd) {
|
||||
printf("SurfaceModifier deformVerts: Should not happen!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if(surmd->dm)
|
||||
{
|
||||
if(surmd->dm) {
|
||||
unsigned int numverts = 0, i = 0;
|
||||
int init = 0;
|
||||
float *vec;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user