diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-06 20:59:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-06 20:59:58 +0400 |
commit | 8695bedda2cb57490bcea957b0a25eb85cb4c9a5 (patch) | |
tree | 4355e0c4f0e9492c53c7a9abf424748141ec320c /source | |
parent | 757f177d9d294451441c95f03dcf8327f59a4b98 (diff) | |
parent | 2bb59bc2734ac682208419e42aebf27285a88d22 (diff) |
svn merge ^/trunk/blender -r40644:40720
Diffstat (limited to 'source')
74 files changed, 1426 insertions, 686 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 8e2d9b47ec0..4ddd2c74f47 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -44,7 +44,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 259 -#define BLENDER_SUBVERSION 3 +#define BLENDER_SUBVERSION 4 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 244fda33a52..08798a6ddf0 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -231,7 +231,7 @@ short fcurve_is_keyframable(struct FCurve *fcu); /* -------- Curve Sanity -------- */ void calchandles_fcurve(struct FCurve *fcu); -void testhandles_fcurve(struct FCurve *fcu); +void testhandles_fcurve(struct FCurve *fcu, const short use_handle); void sort_time_fcurve(struct FCurve *fcu); short test_time_fcurve(struct FCurve *fcu); diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 7e39461a032..b1943fdf97c 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -146,6 +146,11 @@ void object_camera_matrix( float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, float *ycor, float *viewdx, float *viewdy); +void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3], + float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]); + +void camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]); + void object_relink(struct Object *ob); #ifdef __cplusplus diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 19027647537..622ea38a80c 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -742,7 +742,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) MDeformVert *dvert = NULL; Cloth *clothObj = NULL; int numverts; - float goalfac = 0; + /* float goalfac = 0; */ /* UNUSED */ ClothVertex *verts = NULL; if (!clmd || !dm) return; @@ -765,7 +765,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) if (( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_mass-1)) && (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )) { verts->goal = dvert->dw [j].weight; - goalfac= 1.0f; + /* goalfac= 1.0f; */ /* UNUSED */ /* // Kicking goal factor to simplify things...who uses that anyway? diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index fcf9f69ed0c..bb918b3f3f0 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -2365,7 +2365,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl { Cloth *cloth= clmd->clothObject; BVHTree *cloth_bvh= cloth->bvhtree; - unsigned int i=0, numfaces = 0, numverts = 0, k, l, j; + unsigned int i=0, /* numfaces = 0, */ /* UNUSED */ numverts = 0, k, l, j; int rounds = 0; // result counts applied collisions; ic is for debug output; ClothVertex *verts = NULL; int ret = 0, ret2 = 0; @@ -2376,7 +2376,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl return 0; verts = cloth->verts; - numfaces = cloth->numfaces; + /* numfaces = cloth->numfaces; */ /* UNUSED */ numverts = cloth->numverts; //////////////////////////////////////////////////////////// @@ -2478,7 +2478,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl // collisions = 1; verts = cloth->verts; // needed for openMP - numfaces = cloth->numfaces; + /* numfaces = cloth->numfaces; */ /* UNUSED */ numverts = cloth->numverts; verts = cloth->verts; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 61e9daf4138..7747e4750b7 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -361,72 +361,70 @@ void curvemap_sethandle(CurveMap *cuma, int type) static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *next, int UNUSED(mode)) { float *p1,*p2,*p3,pt[3]; - float dx1,dy1, dx,dy, vx,vy, len,len1,len2; - - if(bezt->h1==0 && bezt->h2==0) return; + float len,len_a, len_b; + float dvec_a[2], dvec_b[2]; + + if(bezt->h1==0 && bezt->h2==0) { + return; + } p2= bezt->vec[1]; if(prev==NULL) { p3= next->vec[1]; - pt[0]= 2*p2[0]- p3[0]; - pt[1]= 2*p2[1]- p3[1]; + pt[0]= 2.0f*p2[0] - p3[0]; + pt[1]= 2.0f*p2[1] - p3[1]; p1= pt; } - else p1= prev->vec[1]; + else { + p1= prev->vec[1]; + } if(next==NULL) { p1= prev->vec[1]; - pt[0]= 2*p2[0]- p1[0]; - pt[1]= 2*p2[1]- p1[1]; + pt[0]= 2.0f*p2[0] - p1[0]; + pt[1]= 2.0f*p2[1] - p1[1]; p3= pt; } - else p3= next->vec[1]; - - dx= p2[0]- p1[0]; - dy= p2[1]- p1[1]; + else { + p3= next->vec[1]; + } - len1= (float)sqrt(dx*dx+dy*dy); - - dx1= p3[0]- p2[0]; - dy1= p3[1]- p2[1]; + sub_v2_v2v2(dvec_a, p2, p1); + sub_v2_v2v2(dvec_b, p3, p2); - len2= (float)sqrt(dx1*dx1+dy1*dy1); - - if(len1==0.0f) len1=1.0f; - if(len2==0.0f) len2=1.0f; - - if(bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */ - vx= dx1/len2 + dx/len1; - vy= dy1/len2 + dy/len1; - - len= 2.5614f*(float)sqrt(vx*vx + vy*vy); + len_a= len_v2(dvec_a); + len_b= len_v2(dvec_b); + + if(len_a==0.0f) len_a=1.0f; + if(len_b==0.0f) len_b=1.0f; + + if(bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */ + float tvec[2]; + tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a; + tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a; + + len= len_v2(tvec) * 2.5614f; if(len!=0.0f) { if(bezt->h1==HD_AUTO) { - len1/=len; - *(p2-3)= *p2-vx*len1; - *(p2-2)= *(p2+1)-vy*len1; + len_a/=len; + madd_v2_v2v2fl(p2-3, p2, tvec, -len_a); } if(bezt->h2==HD_AUTO) { - len2/=len; - *(p2+3)= *p2+vx*len2; - *(p2+4)= *(p2+1)+vy*len2; + len_b/=len; + madd_v2_v2v2fl(p2+3, p2, tvec, len_b); } } } if(bezt->h1==HD_VECT) { /* vector */ - dx/=3.0f; - dy/=3.0f; - *(p2-3)= *p2-dx; - *(p2-2)= *(p2+1)-dy; + mul_v2_fl(dvec_a, 1.0f/3.0f); + sub_v2_v2v2(p2-3, p2, dvec_a); } if(bezt->h2==HD_VECT) { - dx1/=3.0f; - dy1/=3.0f; - *(p2+3)= *p2+dx1; - *(p2+4)= *(p2+1)+dy1; + mul_v2_fl(dvec_b, 1.0f/3.0f); + sub_v2_v2v2(p2+3, p2, dvec_b); } } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index c0d2eca9217..3bf3c0f9ed8 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2458,72 +2458,77 @@ void makeBevelList(Object *ob) void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) { float *p1,*p2,*p3, pt[3]; - float dx1,dy1,dz1,dx,dy,dz,vx,vy,vz,len,len1,len2; + float dvec_a[3], dvec_b[3]; + float len, len_a, len_b; const float eps= 1e-5; - if(bezt->h1==0 && bezt->h2==0) return; + if(bezt->h1==0 && bezt->h2==0) { + return; + } p2= bezt->vec[1]; if(prev==NULL) { p3= next->vec[1]; - pt[0]= 2*p2[0]- p3[0]; - pt[1]= 2*p2[1]- p3[1]; - pt[2]= 2*p2[2]- p3[2]; + pt[0]= 2.0f*p2[0] - p3[0]; + pt[1]= 2.0f*p2[1] - p3[1]; + pt[2]= 2.0f*p2[2] - p3[2]; p1= pt; } - else p1= prev->vec[1]; + else { + p1= prev->vec[1]; + } if(next==NULL) { - pt[0]= 2*p2[0]- p1[0]; - pt[1]= 2*p2[1]- p1[1]; - pt[2]= 2*p2[2]- p1[2]; + pt[0]= 2.0f*p2[0] - p1[0]; + pt[1]= 2.0f*p2[1] - p1[1]; + pt[2]= 2.0f*p2[2] - p1[2]; p3= pt; } - else p3= next->vec[1]; + else { + p3= next->vec[1]; + } - dx= p2[0]- p1[0]; - dy= p2[1]- p1[1]; - dz= p2[2]- p1[2]; - - if(mode) len1= dx; - else len1= (float)sqrt(dx*dx+dy*dy+dz*dz); - - dx1= p3[0]- p2[0]; - dy1= p3[1]- p2[1]; - dz1= p3[2]- p2[2]; - - if(mode) len2= dx1; - else len2= (float)sqrt(dx1*dx1+dy1*dy1+dz1*dz1); + sub_v3_v3v3(dvec_a, p2, p1); + sub_v3_v3v3(dvec_b, p3, p2); + + if (mode != 0) { + len_a= dvec_a[0]; + len_b= dvec_b[0]; + } + else { + len_a= len_v3(dvec_a); + len_b= len_v3(dvec_b); + } - if(len1==0.0f) len1=1.0f; - if(len2==0.0f) len2=1.0f; + if(len_a==0.0f) len_a=1.0f; + if(len_b==0.0f) len_b=1.0f; if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* auto */ - vx= dx1/len2 + dx/len1; - vy= dy1/len2 + dy/len1; - vz= dz1/len2 + dz/len1; - len= 2.5614f*(float)sqrt(vx*vx + vy*vy + vz*vz); + float tvec[3]; + tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a; + tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a; + tvec[2]= dvec_b[2]/len_b + dvec_a[2]/len_a; + len= len_v3(tvec) * 2.5614f; + if(len!=0.0f) { int leftviolate=0, rightviolate=0; /* for mode==2 */ - if(len1>5.0f*len2) len1= 5.0f*len2; - if(len2>5.0f*len1) len2= 5.0f*len1; + if(len_a>5.0f*len_b) len_a= 5.0f*len_b; + if(len_b>5.0f*len_a) len_b= 5.0f*len_a; if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) { - len1/=len; - *(p2-3)= *p2-vx*len1; - *(p2-2)= *(p2+1)-vy*len1; - *(p2-1)= *(p2+2)-vz*len1; + len_a/=len; + madd_v3_v3v3fl(p2-3, p2, tvec, -len_a); - if((bezt->h1==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema + if((bezt->h1==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */ float ydiff1= prev->vec[1][1] - bezt->vec[1][1]; float ydiff2= next->vec[1][1] - bezt->vec[1][1]; if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) { bezt->vec[0][1]= bezt->vec[1][1]; } - else { // handles should not be beyond y coord of two others + else { /* handles should not be beyond y coord of two others */ if(ydiff1 <= 0.0f) { if(prev->vec[1][1] > bezt->vec[0][1]) { bezt->vec[0][1]= prev->vec[1][1]; @@ -2540,18 +2545,16 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } } if(ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { - len2/=len; - *(p2+3)= *p2+vx*len2; - *(p2+4)= *(p2+1)+vy*len2; - *(p2+5)= *(p2+2)+vz*len2; + len_b/=len; + madd_v3_v3v3fl(p2+3, p2, tvec, len_b); - if((bezt->h2==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema + if((bezt->h2==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */ float ydiff1= prev->vec[1][1] - bezt->vec[1][1]; float ydiff2= next->vec[1][1] - bezt->vec[1][1]; if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) { bezt->vec[2][1]= bezt->vec[1][1]; } - else { // handles should not be beyond y coord of two others + else { /* andles should not be beyond y coord of two others */ if(ydiff1 <= 0.0f) { if(next->vec[1][1] < bezt->vec[2][1]) { bezt->vec[2][1]= next->vec[1][1]; @@ -2567,25 +2570,25 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } } } - if(leftviolate || rightviolate) { /* align left handle */ + if(leftviolate || rightviolate) { /* align left handle */ float h1[3], h2[3]; + float dot; sub_v3_v3v3(h1, p2-3, p2); sub_v3_v3v3(h2, p2, p2+3); - len1= normalize_v3(h1); - len2= normalize_v3(h2); - vz= dot_v3v3(h1, h2); + len_a= normalize_v3(h1); + len_b= normalize_v3(h2); + + dot= dot_v3v3(h1, h2); if(leftviolate) { - *(p2+3)= *(p2) - vz*len2*h1[0]; - *(p2+4)= *(p2+1) - vz*len2*h1[1]; - *(p2+5)= *(p2+2) - vz*len2*h1[2]; + mul_v3_fl(h1, dot * len_b); + sub_v3_v3v3(p2+3, p2, h1); } else { - *(p2-3)= *(p2) + vz*len1*h2[0]; - *(p2-2)= *(p2+1) + vz*len1*h2[1]; - *(p2-1)= *(p2+2) + vz*len1*h2[2]; + mul_v3_fl(h2, dot * len_a); + add_v3_v3v3(p2-3, p2, h2); } } @@ -2593,60 +2596,52 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } if(bezt->h1==HD_VECT) { /* vector */ - dx/=3.0f; - dy/=3.0f; - dz/=3.0f; - *(p2-3)= *p2-dx; - *(p2-2)= *(p2+1)-dy; - *(p2-1)= *(p2+2)-dz; + mul_v3_fl(dvec_a, 1.0f/3.0f); + sub_v3_v3v3(p2-3, p2, dvec_a); } if(bezt->h2==HD_VECT) { - dx1/=3.0f; - dy1/=3.0f; - dz1/=3.0f; - *(p2+3)= *p2+dx1; - *(p2+4)= *(p2+1)+dy1; - *(p2+5)= *(p2+2)+dz1; + mul_v3_fl(dvec_b, 1.0f/3.0f); + sub_v3_v3v3(p2+3, p2, dvec_b); } - len2= len_v3v3(p2, p2+3); - len1= len_v3v3(p2, p2-3); - if(len1==0.0f) len1= 1.0f; - if(len2==0.0f) len2= 1.0f; + len_b= len_v3v3(p2, p2+3); + len_a= len_v3v3(p2, p2-3); + if(len_a==0.0f) len_a= 1.0f; + if(len_b==0.0f) len_b= 1.0f; if(bezt->f1 & SELECT) { /* order of calculation */ - if(bezt->h2==HD_ALIGN) { /* aligned */ - if(len1>eps) { - len= len2/len1; - p2[3]= p2[0]+len*(p2[0]-p2[-3]); - p2[4]= p2[1]+len*(p2[1]-p2[-2]); - p2[5]= p2[2]+len*(p2[2]-p2[-1]); + if(bezt->h2==HD_ALIGN) { /* aligned */ + if(len_a>eps) { + len= len_b/len_a; + p2[3]= p2[0]+len*(p2[0] - p2[-3]); + p2[4]= p2[1]+len*(p2[1] - p2[-2]); + p2[5]= p2[2]+len*(p2[2] - p2[-1]); } } if(bezt->h1==HD_ALIGN) { - if(len2>eps) { - len= len1/len2; - p2[-3]= p2[0]+len*(p2[0]-p2[3]); - p2[-2]= p2[1]+len*(p2[1]-p2[4]); - p2[-1]= p2[2]+len*(p2[2]-p2[5]); + if(len_b>eps) { + len= len_a/len_b; + p2[-3]= p2[0]+len*(p2[0] - p2[3]); + p2[-2]= p2[1]+len*(p2[1] - p2[4]); + p2[-1]= p2[2]+len*(p2[2] - p2[5]); } } } else { if(bezt->h1==HD_ALIGN) { - if(len2>eps) { - len= len1/len2; - p2[-3]= p2[0]+len*(p2[0]-p2[3]); - p2[-2]= p2[1]+len*(p2[1]-p2[4]); - p2[-1]= p2[2]+len*(p2[2]-p2[5]); + if(len_b>eps) { + len= len_a/len_b; + p2[-3]= p2[0]+len*(p2[0] - p2[3]); + p2[-2]= p2[1]+len*(p2[1] - p2[4]); + p2[-1]= p2[2]+len*(p2[2] - p2[5]); } } if(bezt->h2==HD_ALIGN) { /* aligned */ - if(len1>eps) { - len= len2/len1; - p2[3]= p2[0]+len*(p2[0]-p2[-3]); - p2[4]= p2[1]+len*(p2[1]-p2[-2]); - p2[5]= p2[2]+len*(p2[2]-p2[-1]); + if(len_a>eps) { + len= len_b/len_a; + p2[3]= p2[0]+len*(p2[0] - p2[-3]); + p2[4]= p2[1]+len*(p2[1] - p2[-2]); + p2[5]= p2[2]+len*(p2[2] - p2[-1]); } } } diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 3916d0ca701..8ea80ae9296 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -818,7 +818,7 @@ void calchandles_fcurve (FCurve *fcu) * -> Vector handles: become 'nothing' when (one half selected AND other not) * - PHASE 2: recalculate handles */ -void testhandles_fcurve (FCurve *fcu) +void testhandles_fcurve (FCurve *fcu, const short use_handle) { BezTriple *bezt; unsigned int a; @@ -834,9 +834,16 @@ void testhandles_fcurve (FCurve *fcu) /* flag is initialised as selection status * of beztriple control-points (labelled 0,1,2) */ - if (bezt->f1 & SELECT) flag |= (1<<0); // == 1 if (bezt->f2 & SELECT) flag |= (1<<1); // == 2 - if (bezt->f3 & SELECT) flag |= (1<<2); // == 4 + if(use_handle == FALSE) { + if(flag & 2) { + flag |= (1<<0) | (1<<2); + } + } + else { + if (bezt->f1 & SELECT) flag |= (1<<0); // == 1 + if (bezt->f3 & SELECT) flag |= (1<<2); // == 4 + } /* one or two handles selected only */ if (ELEM(flag, 0, 7)==0) { diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 295669c98c0..cef3eee8c5e 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -913,7 +913,7 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z { // Solves for unknown X in equation AX=B unsigned int conjgrad_loopcount=0, conjgrad_looplimit=100; - float conjgrad_epsilon=0.0001f, conjgrad_lasterror=0; + float conjgrad_epsilon=0.0001f /* , conjgrad_lasterror=0 */ /* UNUSED */; lfVector *q, *d, *tmp, *r; float s, starget, a, s_prev; unsigned int numverts = lA[0].vcount; @@ -964,7 +964,7 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z conjgrad_loopcount++; } - conjgrad_lasterror = s; + /* conjgrad_lasterror = s; */ /* UNUSED */ del_lfvector(q); del_lfvector(d); @@ -1777,7 +1777,7 @@ int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float steps = 55; for (i=0; i<steps; i++) { for (node=cloth->springs; node; node=node->next) { - ClothVertex *cv1, *cv2; + /* ClothVertex *cv1, *cv2; */ /* UNUSED */ int v1, v2; float len, c, l, vec[3]; @@ -1786,8 +1786,8 @@ int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float continue; v1 = spring->ij; v2 = spring->kl; - cv1 = cloth->verts + v1; - cv2 = cloth->verts + v2; + /* cv1 = cloth->verts + v1; */ /* UNUSED */ + /* cv2 = cloth->verts + v2; */ /* UNUSED */ len = len_v3v3(cos[v1], cos[v2]); sub_v3_v3v3(vec, cos[v1], cos[v2]); diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 5df07246b73..48995572117 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -1177,7 +1177,7 @@ static void old_mdisps_convert(MFace *mface, MDisps *mdisp) int nvert = (mface->v4)? 4: 3; int newtotdisp = multires_grid_tot[newlvl]*nvert; int x, y, S; - float (*disps)[3], (*out)[3], u, v; + float (*disps)[3], (*out)[3], u = 0.0f, v = 0.0f; /* Quite gcc barking. */ disps = BLI_cellalloc_calloc(sizeof(float) * 3 * newtotdisp, "multires disps"); diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c index 8a2ec1e5169..04f6ff19564 100644 --- a/source/blender/blenkernel/intern/navmesh_conversion.c +++ b/source/blender/blenkernel/intern/navmesh_conversion.c @@ -328,14 +328,10 @@ struct SortContext const int* trisToFacesMap; }; -/* XXX: not thread-safe, but it's called only from modifiers stack - which isn't threaded. Anyway, better to avoid this in the future */ -static struct SortContext *_qsort_context; - -static int compareByData(const void * a, const void * b) +static int compareByData(void *ctx, const void * a, const void * b) { - return ( _qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)a]] - - _qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)b]] ); + return (((struct SortContext *)ctx)->recastData[((struct SortContext *)ctx)->trisToFacesMap[*(int*)a]] - + ((struct SortContext *)ctx)->recastData[((struct SortContext *)ctx)->trisToFacesMap[*(int*)b]] ); } int buildNavMeshData(const int nverts, const float* verts, @@ -367,8 +363,7 @@ int buildNavMeshData(const int nverts, const float* verts, trisMapping[i]=i; context.recastData = recastData; context.trisToFacesMap = trisToFacesMap; - _qsort_context = &context; - qsort(trisMapping, ntris, sizeof(int), compareByData); + recast_qsort(trisMapping, ntris, sizeof(int), &context, compareByData); //search first valid triangle - triangle of convex polygon validTriStart = -1; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index e7203775a22..13d891dcd64 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3067,6 +3067,82 @@ void object_camera_matrix( } +void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3], + float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]) +{ + float aspx, aspy; + float facx, facy; + float depth; + + /* aspect correcton */ + if (scene) { + aspx= (float) scene->r.xsch*scene->r.xasp; + aspy= (float) scene->r.ysch*scene->r.yasp; + + if(aspx < aspy) { + r_asp[0]= aspx / aspy; + r_asp[1]= 1.0; + } + else { + r_asp[0]= 1.0; + r_asp[1]= aspy / aspx; + } + } + else { + aspx= 1.0f; + aspy= 1.0f; + r_asp[0]= 1.0f; + r_asp[1]= 1.0f; + } + + if(camera->type==CAM_ORTHO) { + facx= 0.5f * camera->ortho_scale * r_asp[0] * scale[0]; + facy= 0.5f * camera->ortho_scale * r_asp[1] * scale[1]; + r_shift[0]= camera->shiftx * camera->ortho_scale * scale[0]; + r_shift[1]= camera->shifty * camera->ortho_scale * scale[1]; + depth= do_clip ? -((camera->clipsta * scale[2]) + 0.1f) : - drawsize * camera->ortho_scale * scale[2]; + + *r_drawsize= 0.5f * camera->ortho_scale; + } + else { + /* that way it's always visible - clipsta+0.1 */ + float fac; + *r_drawsize= drawsize / ((scale[0] + scale[1] + scale[2]) / 3.0f); + + if(do_clip) { + /* fixed depth, variable size (avoids exceeding clipping range) */ + depth = -(camera->clipsta + 0.1f); + fac = depth / (camera->lens/-16.0f * scale[2]); + } + else { + /* fixed size, variable depth (stays a reasonable size in the 3D view) */ + depth= *r_drawsize * camera->lens/-16.0f * scale[2]; + fac= *r_drawsize; + } + + facx= fac * r_asp[0] * scale[0]; + facy= fac * r_asp[1] * scale[1]; + r_shift[0]= camera->shiftx*fac*2 * scale[0]; + r_shift[1]= camera->shifty*fac*2 * scale[1]; + } + + r_vec[0][0]= r_shift[0] + facx; r_vec[0][1]= r_shift[1] + facy; r_vec[0][2]= depth; + r_vec[1][0]= r_shift[0] + facx; r_vec[1][1]= r_shift[1] - facy; r_vec[1][2]= depth; + r_vec[2][0]= r_shift[0] - facx; r_vec[2][1]= r_shift[1] - facy; r_vec[2][2]= depth; + r_vec[3][0]= r_shift[0] - facx; r_vec[3][1]= r_shift[1] + facy; r_vec[3][2]= depth; +} + +void camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3]) +{ + float dummy_asp[2]; + float dummy_shift[2]; + float dummy_drawsize; + const float dummy_scale[3]= {1.0f, 1.0f, 1.0f}; + + camera_view_frame_ex(scene, camera, FALSE, 1.0, dummy_scale, + dummy_asp, dummy_shift, &dummy_drawsize, r_vec); +} + #if 0 static int pc_findindex(ListBase *listbase, int index) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index d8ae36b4ab5..1a72405ad5e 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -526,7 +526,7 @@ Scene *add_scene(const char *name) sce->gm.recastData.agentradius = 0.6f; sce->gm.recastData.edgemaxlen = 12.0f; sce->gm.recastData.edgemaxerror = 1.3f; - sce->gm.recastData.regionminsize = 50.f; + sce->gm.recastData.regionminsize = 8.f; sce->gm.recastData.regionmergesize = 20.f; sce->gm.recastData.vertsperpoly = 6; sce->gm.recastData.detailsampledist = 6.0f; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 2960d8a41e5..784c67d6d77 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1744,12 +1744,12 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], GHash *hash; GHashIterator *ihash; float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3],d_nvect[3], dv1[3],ve[3],avel[3]={0.0,0.0,0.0}, - vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f, - outerforceaccu[3],innerforceaccu[3], - facedist,n_mag,force_mag_norm,minx,miny,minz,maxx,maxy,maxz, - innerfacethickness = -0.5f, outerfacethickness = 0.2f, - ee = 5.0f, ff = 0.1f, fa=1; - int a, deflected=0, cavel=0,ci=0; + vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f, + outerforceaccu[3], innerforceaccu[3], + facedist, /* n_mag, */ /* UNUSED */ force_mag_norm, minx, miny, minz, maxx, maxy, maxz, + innerfacethickness = -0.5f, outerfacethickness = 0.2f, + ee = 5.0f, ff = 0.1f, fa=1; + int a, deflected=0, cavel=0, ci=0; /* init */ *intrusion = 0.0f; hash = vertexowner->soft->scratch->colliderhash; @@ -1869,7 +1869,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */ cross_v3_v3v3(d_nvect, edge2, edge1); - n_mag = normalize_v3(d_nvect); + /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect); facedist = dot_v3v3(dv1,d_nvect); // so rules are // @@ -1906,7 +1906,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */ cross_v3_v3v3(d_nvect, edge2, edge1); - n_mag = normalize_v3(d_nvect); + /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect); facedist = dot_v3v3(dv1,d_nvect); if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){ diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 38165182d83..ea6f6eb702b 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -640,7 +640,11 @@ void default_mtex(MTex *mtex) mtex->size[1]= 1.0; mtex->size[2]= 1.0; mtex->tex= NULL; - mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE; + + /* MTEX_BUMP_FLIPPED is temporary before 2.61 release to prevent flipping normals + when creating file in 2.60, opening it in 2.59, saving and opening in 2.60 again */ + mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE | MTEX_BUMP_FLIPPED; + mtex->colormodel= 0; mtex->r= 1.0; mtex->g= 0.0; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 829e1ddcc76..4ecfc648ebf 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7124,7 +7124,7 @@ void convert_tface_mt(FileData *fd, Main *main) G.main = main; if(!(do_version_tface(main, 1))) { - BKE_report(fd->reports, RPT_ERROR, "Texface conversion problem. Error in console"); + BKE_report(fd->reports, RPT_WARNING, "Texface conversion problem. Error in console"); } //XXX hack, material.c uses G.main allover the place, instead of main @@ -12129,9 +12129,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* put compatibility code here until next subversion bump */ - - { + if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 4)){ { /* Adaptive time step for particle systems */ ParticleSettings *part; @@ -12140,45 +12138,72 @@ static void do_versions(FileData *fd, Library *lib, Main *main) part->time_flag &= ~PART_TIME_AUTOSF; } } + + { + /* set defaults for obstacle avoidance, recast data */ + Scene *sce; + for(sce = main->scene.first; sce; sce = sce->id.next) + { + if (sce->gm.levelHeight == 0.f) + sce->gm.levelHeight = 2.f; + + if(sce->gm.recastData.cellsize == 0.0f) + sce->gm.recastData.cellsize = 0.3f; + if(sce->gm.recastData.cellheight == 0.0f) + sce->gm.recastData.cellheight = 0.2f; + if(sce->gm.recastData.agentmaxslope == 0.0f) + sce->gm.recastData.agentmaxslope = (float)M_PI/4; + if(sce->gm.recastData.agentmaxclimb == 0.0f) + sce->gm.recastData.agentmaxclimb = 0.9f; + if(sce->gm.recastData.agentheight == 0.0f) + sce->gm.recastData.agentheight = 2.0f; + if(sce->gm.recastData.agentradius == 0.0f) + sce->gm.recastData.agentradius = 0.6f; + if(sce->gm.recastData.edgemaxlen == 0.0f) + sce->gm.recastData.edgemaxlen = 12.0f; + if(sce->gm.recastData.edgemaxerror == 0.0f) + sce->gm.recastData.edgemaxerror = 1.3f; + if(sce->gm.recastData.regionminsize == 0.0f) + sce->gm.recastData.regionminsize = 8.f; + if(sce->gm.recastData.regionmergesize == 0.0f) + sce->gm.recastData.regionmergesize = 20.f; + if(sce->gm.recastData.vertsperpoly<3) + sce->gm.recastData.vertsperpoly = 6; + if(sce->gm.recastData.detailsampledist == 0.0f) + sce->gm.recastData.detailsampledist = 6.0f; + if(sce->gm.recastData.detailsamplemaxerror == 0.0f) + sce->gm.recastData.detailsamplemaxerror = 1.0f; + } + } + + { + /* flip normals */ + Material *ma= main->mat.first; + while(ma) { + int a; + for(a= 0; a<MAX_MTEX; a++) { + MTex *mtex= ma->mtex[a]; + + if(mtex) { + if((mtex->texflag&MTEX_BUMP_FLIPPED)==0) { + if((mtex->mapto&MAP_NORM) && mtex->texflag&(MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) { + mtex->norfac= -mtex->norfac; + mtex->texflag|= MTEX_BUMP_FLIPPED; + } + } + } + } + + ma= ma->id.next; + } + } + } - //set defaults for obstacle avoidance, recast data + /* put compatibility code here until next subversion bump */ { - Scene *sce; - for(sce = main->scene.first; sce; sce = sce->id.next) - { - if (sce->gm.levelHeight == 0.f) - sce->gm.levelHeight = 2.f; - - if(sce->gm.recastData.cellsize == 0.0f) - sce->gm.recastData.cellsize = 0.3f; - if(sce->gm.recastData.cellheight == 0.0f) - sce->gm.recastData.cellheight = 0.2f; - if(sce->gm.recastData.agentmaxslope == 0.0f) - sce->gm.recastData.agentmaxslope = (float)M_PI/4; - if(sce->gm.recastData.agentmaxclimb == 0.0f) - sce->gm.recastData.agentmaxclimb = 0.9f; - if(sce->gm.recastData.agentheight == 0.0f) - sce->gm.recastData.agentheight = 2.0f; - if(sce->gm.recastData.agentradius == 0.0f) - sce->gm.recastData.agentradius = 0.6f; - if(sce->gm.recastData.edgemaxlen == 0.0f) - sce->gm.recastData.edgemaxlen = 12.0f; - if(sce->gm.recastData.edgemaxerror == 0.0f) - sce->gm.recastData.edgemaxerror = 1.3f; - if(sce->gm.recastData.regionminsize == 0.0f) - sce->gm.recastData.regionminsize = 50.f; - if(sce->gm.recastData.regionmergesize == 0.0f) - sce->gm.recastData.regionmergesize = 20.f; - if(sce->gm.recastData.vertsperpoly<3) - sce->gm.recastData.vertsperpoly = 6; - if(sce->gm.recastData.detailsampledist == 0.0f) - sce->gm.recastData.detailsampledist = 6.0f; - if(sce->gm.recastData.detailsamplemaxerror == 0.0f) - sce->gm.recastData.detailsamplemaxerror = 1.0f; - } } - + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index bd5935c893c..c982a1d7f86 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -343,6 +343,13 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac) * channel can be kept around). No need to clear channels-flag in order to * keep expander channels with no sub-data out, as those cases should get * dealt with by the recursive detection idiom in place. + * + * Implementation Note: + * YES the _doSubChannels variable is NOT read anywhere. BUT, this is NOT an excuse + * to go steamrolling the logic into a single-line expression as from experience, + * those are notoriously difficult to read + debug when extending later on. The code + * below is purposefully laid out so that each case noted above corresponds clearly to + * one case below. */ #define BEGIN_ANIMFILTER_SUBCHANNELS(expanded_check) \ { \ diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index fa619e4cf44..af78fe739cc 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -51,6 +51,7 @@ #include "DNA_node_types.h" #include "DNA_particle_types.h" #include "DNA_scene_types.h" +#include "DNA_space_types.h" #include "DNA_world_types.h" #include "BKE_fcurve.h" @@ -386,6 +387,9 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac) ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; + /* when not in graph view, don't use handles */ + SpaceIpo *sipo= (ac->spacetype == SPACE_IPO) ? (SpaceIpo *)ac->sl : NULL; + const short use_handle = sipo ? !(sipo->flag & SIPO_NOHANDLES) : FALSE; /* filter animation data */ filter= ANIMFILTER_DATA_VISIBLE; @@ -397,7 +401,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac) /* make sure keyframes in F-Curve are all in order, and handles are in valid positions */ sort_time_fcurve(fcu); - testhandles_fcurve(fcu); + testhandles_fcurve(fcu, use_handle); } /* free temp data */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 4a895472b33..a5781ab7267 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -787,6 +787,7 @@ void UI_buttons_operatortypes(void); /* Helpers for Operators */ void uiContextActiveProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index); +void uiContextActivePropertyHandle(struct bContext *C); void uiContextAnimUpdate(const struct bContext *C); void uiFileBrowseContextProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop); void uiIDContextProperty(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 286906402b9..a3ae39c8440 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -678,6 +678,11 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut SWAP(void *, oldbut->func_argN, but->func_argN) } + /* copy hardmin for list rows to prevent 'sticking' highlight to mouse position + when scrolling without moving mouse (see [#28432]) */ + if(ELEM(oldbut->type, ROW, LISTROW)) + oldbut->hardmax= but->hardmax; + ui_but_update_linklines(block, oldbut, but); BLI_remlink(&block->buttons, but); @@ -746,7 +751,7 @@ static int ui_but_is_rna_undo(uiBut *but) * unforseen conciquences, so best check for ID's we _know_ are not * handled by undo - campbell */ ID *id= but->rnapoin.id.data; - if(ELEM(GS(id->name), ID_SCR, ID_WM)) { + if(ID_CHECK_UNDO(id) == FALSE) { return FALSE; } else { @@ -2467,7 +2472,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, but->pointype= type & BUTPOIN; but->bit= type & BIT; but->bitnr= type & 31; - but->icon = 0; + but->icon = ICON_NONE; but->iconadd=0; but->retval= retval; diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index b65be48f7ee..a40900fb39b 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -466,6 +466,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w { #ifdef WITH_HEADLESS (void)rect; + (void)but; #else ImBuf *ibuf= (ImBuf *)but->poin; //GLint scissor[4]; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 082ddb5b060..929a8bf1dc6 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5089,19 +5089,16 @@ void ui_button_active_free(const bContext *C, uiBut *but) } } -/* helper function for insert keyframe, reset to default, etc operators */ -void uiContextActiveProperty(const bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index) +static uiBut *ui_context_rna_button_active(const bContext *C) { - ARegion *ar= CTX_wm_region(C); + uiBut *rnabut= NULL; - memset(ptr, 0, sizeof(*ptr)); - *prop= NULL; - *index= 0; + ARegion *ar= CTX_wm_region(C); while(ar) { uiBlock *block; uiBut *but, *activebut= NULL; - + /* find active button */ for(block=ar->uiblocks.first; block; block=block->next) { for(but=block->buttons.first; but; but= but->next) { @@ -5115,24 +5112,53 @@ void uiContextActiveProperty(const bContext *C, struct PointerRNA *ptr, struct P if(activebut && activebut->rnapoin.data) { uiHandleButtonData *data= activebut->active; - /* found RNA button */ - *ptr= activebut->rnapoin; - *prop= activebut->rnaprop; - *index= activebut->rnaindex; + rnabut= activebut; /* recurse into opened menu, like colorpicker case */ if(data && data->menu && (ar != data->menu->region)) { ar = data->menu->region; } else { - return; + return rnabut; } } else { /* no active button */ - return; + return rnabut; } } + + return rnabut; +} + +/* helper function for insert keyframe, reset to default, etc operators */ +void uiContextActiveProperty(const bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index) +{ + uiBut *activebut= ui_context_rna_button_active(C); + + memset(ptr, 0, sizeof(*ptr)); + + if(activebut && activebut->rnapoin.data) { + *ptr= activebut->rnapoin; + *prop= activebut->rnaprop; + *index= activebut->rnaindex; + } + else { + *prop= NULL; + *index= 0; + } +} + +void uiContextActivePropertyHandle(bContext *C) +{ + uiBut *activebut= ui_context_rna_button_active(C); + if(activebut) { + /* TODO, look into a better way to handle the button change + * currently this is mainly so reset defaults works for the + * operator redo panel - campbell */ + uiBlock *block= activebut->block; + block->handle_func(C, block->handle_func_arg, 0); + } } /* helper function for insert keyframe, reset to default, etc operators */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index fbad34252e7..24434465f5f 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1018,9 +1018,9 @@ static void ui_id_icon_render(bContext *C, ID *id, int big) { /* create the rect if necessary */ - icon_set_image(C, id, pi, 0); /* icon size */ + icon_set_image(C, id, pi, ICON_SIZE_ICON); /* icon size */ if (big) - icon_set_image(C, id, pi, 1); /* bigger preview size */ + icon_set_image(C, id, pi, ICON_SIZE_PREVIEW); /* bigger preview size */ pi->changed[0] = 0; } @@ -1030,7 +1030,7 @@ static void ui_id_icon_render(bContext *C, ID *id, int big) static void ui_id_brush_render(bContext *C, ID *id) { PreviewImage *pi = BKE_previewimg_get(id); - int i; + enum eIconSizes i; if(!pi) return; diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index fd9386dc5ab..081b528d153 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -295,10 +295,28 @@ static int reset_default_button_exec(bContext *C, wmOperator *op) if(RNA_property_reset(&ptr, prop, (all)? -1: index)) { /* perform updates required for this property */ RNA_property_update(C, &ptr, prop); + + /* as if we pressed the button */ + uiContextActivePropertyHandle(C); + success= 1; } } - + + /* Since we dont want to undo _all_ edits to settings, eg window + * edits on the screen or on operator settings. + * it might be better to move undo's inline - campbell */ + if(success) { + ID *id= ptr.id.data; + if(id && ID_CHECK_UNDO(id)) { + /* do nothing, go ahead with undo */ + } + else { + return OPERATOR_CANCELLED; + } + } + /* end hack */ + return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED; } @@ -314,7 +332,7 @@ static void UI_OT_reset_default_button(wmOperatorType *ot) ot->exec= reset_default_button_exec; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_UNDO; /* properties */ RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array"); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 44aa6d1e090..ff6ef41bfb0 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -415,7 +415,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str BLI_snprintf(str, sizeof(str), "%d", id->us); but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(_("Displays number of users of this data. Click to make a single-user copy"))); + UI_translate_do_tooltip(_("Display number of users of this data (click to make a single-user copy)"))); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable) diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c index 1cd5dcdb241..e4b884744e1 100644 --- a/source/blender/editors/mesh/mesh_navmesh.c +++ b/source/blender/editors/mesh/mesh_navmesh.c @@ -174,7 +174,7 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts struct recast_compactHeightfield* chf; struct recast_contourSet *cset; int width, height, walkableHeight, walkableClimb, walkableRadius; - int minRegionSize, mergeRegionSize, maxEdgeLen; + int minRegionArea, mergeRegionArea, maxEdgeLen; float detailSampleDist, detailSampleMaxError; recast_calcBounds(verts, nverts, bmin, bmax); @@ -183,8 +183,8 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts walkableHeight= (int)ceilf(recastParams->agentheight/ recastParams->cellheight); walkableClimb= (int)floorf(recastParams->agentmaxclimb / recastParams->cellheight); walkableRadius= (int)ceilf(recastParams->agentradius / recastParams->cellsize); - minRegionSize= (int)(recastParams->regionminsize * recastParams->regionminsize); - mergeRegionSize= (int)(recastParams->regionmergesize * recastParams->regionmergesize); + minRegionArea= (int)(recastParams->regionminsize * recastParams->regionminsize); + mergeRegionArea= (int)(recastParams->regionmergesize * recastParams->regionmergesize); maxEdgeLen= (int)(recastParams->edgemaxlen/recastParams->cellsize); detailSampleDist= recastParams->detailsampledist< 0.9f ? 0 : recastParams->cellsize * recastParams->detailsampledist; @@ -212,13 +212,14 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts MEM_freeN(triflags); /* ** Step 3: Filter walkables surfaces ** */ + recast_filterLowHangingWalkableObstacles(walkableClimb, solid); recast_filterLedgeSpans(walkableHeight, walkableClimb, solid); recast_filterWalkableLowHeightSpans(walkableHeight, solid); /* ** Step 4: Partition walkable surface to simple regions ** */ chf= recast_newCompactHeightfield(); - if(!recast_buildCompactHeightfield(walkableHeight, walkableClimb, RECAST_WALKABLE, solid, chf)) { + if(!recast_buildCompactHeightfield(walkableHeight, walkableClimb, solid, chf)) { recast_destroyHeightfield(solid); recast_destroyCompactHeightfield(chf); @@ -226,6 +227,13 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts } recast_destroyHeightfield(solid); + solid = NULL; + + if (!recast_erodeWalkableArea(walkableRadius, chf)) { + recast_destroyCompactHeightfield(chf); + + return 0; + } /* Prepare for region partitioning, by calculating distance field along the walkable surface */ if(!recast_buildDistanceField(chf)) { @@ -235,7 +243,7 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts } /* Partition the walkable surface into simple regions without holes */ - if(!recast_buildRegions(chf, walkableRadius, 0, minRegionSize, mergeRegionSize)) { + if(!recast_buildRegions(chf, 0, minRegionArea, mergeRegionArea)) { recast_destroyCompactHeightfield(chf); return 0; @@ -293,7 +301,8 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, Object* obedit; int createob= base==NULL; int nverts, nmeshes, nvp; - unsigned short *verts, *meshes, *polys; + unsigned short *verts, *polys; + unsigned int *meshes; float bmin[3], cs, ch, *dverts; unsigned char *tris; ModifierData *md; @@ -348,7 +357,7 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, for(i= 0; i<nmeshes; i++) { int uniquevbase= em->totvert; - unsigned short vbase= meshes[4*i+0]; + unsigned int vbase= meshes[4*i+0]; unsigned short ndv= meshes[4*i+1]; unsigned short tribase= meshes[4*i+2]; unsigned short trinum= meshes[4*i+3]; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 2f62e55bcd8..918adcac138 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -1145,7 +1145,7 @@ static int fluid_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event) { /* only one bake job at a time */ if(WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) - return 0; + return OPERATOR_CANCELLED; if(!fluidsimBake(C, op->reports, CTX_data_active_object(C), TRUE)) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 60662334e20..fdf9209c813 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -233,7 +233,8 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, cons /* get data to filter, from Action or Dopesheet */ // XXX: what is sel doing here?! - filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS); + // Commented it, was breaking things (eg. the "auto preview range" tool). + filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_SEL *//*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* set large values to try to override */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 28fd1cd3304..f1593105d5b 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -245,13 +245,15 @@ static short get_active_fcurve_keyframe_edit(FCurve *fcu, BezTriple **bezt, BezT } /* update callback for active keyframe properties - base updates stuff */ -static void graphedit_activekey_update_cb(bContext *UNUSED(C), void *fcu_ptr, void *UNUSED(bezt_ptr)) +static void graphedit_activekey_update_cb(bContext *C, void *fcu_ptr, void *UNUSED(bezt_ptr)) { + SpaceIpo *sipo= CTX_wm_space_graph(C); + const short use_handle = !(sipo->flag & SIPO_NOHANDLES); FCurve *fcu = (FCurve *)fcu_ptr; /* make sure F-Curve and its handles are still valid after this editing */ sort_time_fcurve(fcu); - testhandles_fcurve(fcu); + testhandles_fcurve(fcu, use_handle); } /* update callback for active keyframe properties - handle-editing wrapper */ diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 49d8b6b5da4..673ddaebc5f 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -182,6 +182,10 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) case ND_NLA_ACTCHANGE: ED_region_tag_redraw(ar); break; + case ND_ANIMCHAN: + if(wmn->action==NA_SELECTED) + ED_region_tag_redraw(ar); + break; } break; } diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 89e9a22c9a1..a0999c9a03b 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -134,7 +134,7 @@ void SEQUENCER_OT_select_handles(struct wmOperatorType *ot); void SEQUENCER_OT_select_active_side(struct wmOperatorType *ot); void SEQUENCER_OT_select_border(struct wmOperatorType *ot); void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot); - +void SEQUENCER_OT_select_grouped(struct wmOperatorType *ot); /* sequencer_select.c */ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 5c13b57cca8..b53284136de 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -103,7 +103,8 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_select_handles); WM_operatortype_append(SEQUENCER_OT_select_active_side); WM_operatortype_append(SEQUENCER_OT_select_border); - + WM_operatortype_append(SEQUENCER_OT_select_grouped); + /* sequencer_add.c */ WM_operatortype_append(SEQUENCER_OT_scene_strip_add); WM_operatortype_append(SEQUENCER_OT_movie_strip_add); @@ -165,7 +166,7 @@ void sequencer_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_toggle", TABKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_make", GKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_make", GKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_separate", GKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); @@ -247,6 +248,8 @@ void sequencer_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "SEQUENCER_OT_select_border", BKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "SEQUENCER_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "SEQUENCER_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_menu(keymap, "SEQUENCER_MT_change", CKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 3ea27899128..45dd08e3ece 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -47,6 +47,7 @@ #include "DNA_scene_types.h" #include "BKE_context.h" +#include "BKE_report.h" #include "BKE_sequencer.h" #include "WM_api.h" @@ -882,3 +883,270 @@ void SEQUENCER_OT_select_border(wmOperatorType *ot) /* rna */ WM_operator_properties_gesture_border(ot, FALSE); } + +/* ****** Selected Grouped ****** */ + +static EnumPropertyItem sequencer_prop_select_grouped_types[] = { + {1, "TYPE", 0, "Type", "Shared strip type"}, + {2, "TYPE_BASIC", 0, "Global Type", "All strips of same basic type (Graphical or Sound)"}, + {3, "TYPE_EFFECT", 0, "Effect Type", + "Shared strip effect type (if active strip is not an effect one, select all non-effect strips)"}, + {4, "DATA", 0, "Data", "Shared data (scene, image, sound, etc.)"}, + {5, "EFFECT", 0, "Effect", "Shared effects"}, + {6, "EFFECT_LINK", 0, "Effect/Linked", + "Other strips affected by the active one (sharing some time, and below or effect-assigned)"}, + {7, "OVERLAP", 0, "Overlap", "Overlapping time"}, + {0, NULL, 0, NULL, NULL} +}; + +#define SEQ_IS_SOUND(_seq) ((_seq->type & SEQ_SOUND) && !(_seq->type & SEQ_EFFECT)) + +#define SEQ_IS_EFFECT(_seq) (_seq->type & SEQ_EFFECT) + +#define SEQ_USE_DATA(_seq) (_seq->type == SEQ_SCENE || SEQ_HAS_PATH(_seq)) + +static short select_grouped_type(Editing *ed, Sequence *actseq) +{ + Sequence *seq; + short changed = FALSE; + + SEQP_BEGIN(ed, seq) { + if (seq->type == actseq->type) { + seq->flag |= SELECT; + changed = TRUE; + } + } + SEQ_END; + + return changed; +} + +static short select_grouped_type_basic(Editing *ed, Sequence *actseq) +{ + Sequence *seq; + short changed = FALSE; + short is_sound = SEQ_IS_SOUND(actseq); + + SEQP_BEGIN(ed, seq) { + if (is_sound ? SEQ_IS_SOUND(seq) : !SEQ_IS_SOUND(seq)) { + seq->flag |= SELECT; + changed = TRUE; + } + } + SEQ_END; + + return changed; +} + +static short select_grouped_type_effect(Editing *ed, Sequence *actseq) +{ + Sequence *seq; + short changed = FALSE; + short is_effect = SEQ_IS_EFFECT(actseq); + + SEQP_BEGIN(ed, seq) { + if (is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq)) { + seq->flag |= SELECT; + changed = TRUE; + } + } + SEQ_END; + + return changed; +} + +static short select_grouped_data(Editing *ed, Sequence *actseq) +{ + Sequence *seq; + short changed = FALSE; + Scene *sce = actseq->scene; + char *dir = actseq->strip ? actseq->strip->dir : NULL; + + if (!SEQ_USE_DATA(actseq)) + return changed; + + if (SEQ_HAS_PATH(actseq) && dir) { + SEQP_BEGIN(ed, seq) { + if (SEQ_HAS_PATH(seq) && seq->strip && strcmp(seq->strip->dir, dir) == 0) { + seq->flag |= SELECT; + changed = TRUE; + } + } + SEQ_END; + } + else { + SEQP_BEGIN(ed, seq) { + if (seq->type == SEQ_SCENE && seq->scene == sce) { + seq->flag |= SELECT; + changed = TRUE; + } + } + SEQ_END; + } + + return changed; +} + +static short select_grouped_effect(Editing *ed, Sequence *actseq) +{ + Sequence *seq; + short changed = FALSE; + short effects[SEQ_EFFECT_MAX+1]; + int i; + + for (i = 0; i <= SEQ_EFFECT_MAX; i++) + effects[i] = FALSE; + + SEQP_BEGIN(ed, seq) { + if (ELEM3(actseq, seq->seq1, seq->seq2, seq->seq3)) { + effects[seq->type] = TRUE; + } + } + SEQ_END; + + SEQP_BEGIN(ed, seq) { + if (effects[seq->type]) { + if(seq->seq1) seq->seq1->flag |= SELECT; + if(seq->seq2) seq->seq2->flag |= SELECT; + if(seq->seq3) seq->seq3->flag |= SELECT; + changed = TRUE; + } + } + SEQ_END; + + return changed; +} + +static short select_grouped_time_overlap(Editing *ed, Sequence *actseq) +{ + Sequence *seq; + short changed = FALSE; + + SEQP_BEGIN(ed, seq) { + if (!((seq->startdisp >= actseq->enddisp) || (seq->enddisp < actseq->startdisp))) { + seq->flag |= SELECT; + changed = TRUE; + } + } + SEQ_END; + + return changed; +} + +static short select_grouped_effect_link(Editing *ed, Sequence *actseq) +{ + Sequence *seq = NULL; + short changed = FALSE; + short is_audio = ((actseq->type == SEQ_META) || SEQ_IS_SOUND(actseq)); + int startdisp = actseq->startdisp; + int enddisp = actseq->enddisp; + int machine = actseq->machine; + SeqIterator iter; + + SEQP_BEGIN(ed, seq) { + seq->tmp= NULL; + } + SEQ_END; + + seq->tmp= SET_INT_IN_POINTER(TRUE); + + for(seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) { + seq = iter.seq; + + /* Ignore all seqs already selected! */ + /* Ignore all seqs not sharing some time with active one. */ + /* Ignore all seqs of incompatible types (audio vs video). */ + if ((seq->flag & SELECT) || (seq->startdisp >= enddisp) || (seq->enddisp < startdisp) + || (!is_audio && SEQ_IS_SOUND(seq)) + || (is_audio && !((seq->type == SEQ_META) || SEQ_IS_SOUND(seq)))) + continue; + + /* If the seq is an effect one, we need extra cheking! */ + if (SEQ_IS_EFFECT(seq) && ((seq->seq1 && seq->seq1->tmp) || + (seq->seq2 && seq->seq2->tmp) || + (seq->seq3 && seq->seq3->tmp))) + { + if (startdisp > seq->startdisp) startdisp = seq->startdisp; + if (enddisp < seq->enddisp) enddisp = seq->enddisp; + if (machine < seq->machine) machine = seq->machine; + + seq->tmp= SET_INT_IN_POINTER(TRUE); + + seq->flag |= SELECT; + changed = TRUE; + + /* Unfortunately, we must restart checks from the begining. */ + seq_end(&iter); + seq_begin(ed, &iter, 1); + } + + /* Video strips bellow active one, or any strip for audio (order do no matters here!). */ + else if (seq->machine < machine || is_audio) { + seq->flag |= SELECT; + changed = TRUE; + } + } + seq_end(&iter); + + return changed; +} + +static int sequencer_select_grouped_exec(bContext *C, wmOperator *op) +{ + Scene *scene = CTX_data_scene(C); + Editing *ed = seq_give_editing(scene, 0); + Sequence *seq, *actseq = seq_active_get(scene); + int type = RNA_enum_get(op->ptr, "type"); + short changed = 0, extend; + + extend = RNA_boolean_get(op->ptr, "extend"); + + if (actseq == NULL) { + BKE_report(op->reports, RPT_ERROR, "No Active Sequence!"); + return OPERATOR_CANCELLED; + } + + if (extend == 0) { + SEQP_BEGIN(ed, seq) { + seq->flag &= ~SELECT; + changed = TRUE; + } + SEQ_END; + } + + if(type==1) changed |= select_grouped_type(ed, actseq); + else if(type==2) changed |= select_grouped_type_basic(ed, actseq); + else if(type==3) changed |= select_grouped_type_effect(ed, actseq); + else if(type==4) changed |= select_grouped_data(ed, actseq); + else if(type==5) changed |= select_grouped_effect(ed, actseq); + else if(type==6) changed |= select_grouped_effect_link(ed, actseq); + else if(type==7) changed |= select_grouped_time_overlap(ed, actseq); + + if (changed) { + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); + return OPERATOR_FINISHED; + } + + return OPERATOR_CANCELLED; +} + +void SEQUENCER_OT_select_grouped(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Select Grouped"; + ot->description = "Select all strips grouped by various properties"; + ot->idname = "SEQUENCER_OT_select_grouped"; + + /* api callbacks */ + ot->invoke = WM_menu_invoke; + ot->exec = sequencer_select_grouped_exec; + ot->poll = sequencer_edit_poll; + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); + ot->prop = RNA_def_enum(ot->srna, "type", sequencer_prop_select_grouped_types, 0, "Type", ""); +} + diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index cb7ee18e829..b8fb8934dd9 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1373,15 +1373,12 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob { /* a standing up pyramid with (0,0,0) as top */ Camera *cam; - float vec[8][4], facx, facy, depth, aspx, aspy, caspx, caspy, shx, shy; + float tvec[3]; + float vec[4][3], asp[2], shift[2], scale[3]; int i; float drawsize; const short is_view= (rv3d->persp==RV3D_CAMOB && ob==v3d->camera); - const float scax= 1.0f / len_v3(ob->obmat[0]); - const float scay= 1.0f / len_v3(ob->obmat[1]); - const float scaz= 1.0f / len_v3(ob->obmat[2]); - #ifdef VIEW3D_CAMERA_BORDER_HACK if(is_view && !(G.f & G_PICKSEL)) { glGetFloatv(GL_CURRENT_COLOR, view3d_camera_border_hack_col); @@ -1391,82 +1388,43 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob #endif cam= ob->data; - aspx= (float) scene->r.xsch*scene->r.xasp; - aspy= (float) scene->r.ysch*scene->r.yasp; - if(aspx < aspy) { - caspx= aspx / aspy; - caspy= 1.0; - } - else { - caspx= 1.0; - caspy= aspy / aspx; - } - - glDisable(GL_LIGHTING); - glDisable(GL_CULL_FACE); - - if(cam->type==CAM_ORTHO) { - facx= 0.5f * cam->ortho_scale * caspx * scax; - facy= 0.5f * cam->ortho_scale * caspy * scay; - shx= cam->shiftx * cam->ortho_scale * scax; - shy= cam->shifty * cam->ortho_scale * scay; - depth= is_view ? -((cam->clipsta * scaz) + 0.1f) : - cam->drawsize * cam->ortho_scale * scaz; - - drawsize= 0.5f * cam->ortho_scale; - } - else { - /* that way it's always visible - clipsta+0.1 */ - float fac; - drawsize= cam->drawsize / ((scax + scay + scaz) / 3.0f); + scale[0]= 1.0f / len_v3(ob->obmat[0]); + scale[1]= 1.0f / len_v3(ob->obmat[1]); + scale[2]= 1.0f / len_v3(ob->obmat[2]); - if(is_view) { - /* fixed depth, variable size (avoids exceeding clipping range) */ - depth = -(cam->clipsta + 0.1f); - fac = depth / (cam->lens/-16.0f * scaz); - } - else { - /* fixed size, variable depth (stays a reasonable size in the 3D view) */ - depth= drawsize * cam->lens/-16.0f * scaz; - fac= drawsize; - } + camera_view_frame_ex(scene, cam, cam->drawsize, is_view, scale, + asp, shift, &drawsize, vec); - facx= fac * caspx * scax; - facy= fac * caspy * scay; - shx= cam->shiftx*fac*2 * scax; - shy= cam->shifty*fac*2 * scay; - } - - vec[0][0]= 0.0; vec[0][1]= 0.0; vec[0][2]= 0.0; - vec[1][0]= shx + facx; vec[1][1]= shy + facy; vec[1][2]= depth; - vec[2][0]= shx + facx; vec[2][1]= shy - facy; vec[2][2]= depth; - vec[3][0]= shx - facx; vec[3][1]= shy - facy; vec[3][2]= depth; - vec[4][0]= shx - facx; vec[4][1]= shy + facy; vec[4][2]= depth; + glDisable(GL_LIGHTING); + glDisable(GL_CULL_FACE); /* camera frame */ glBegin(GL_LINE_LOOP); - glVertex3fv(vec[1]); - glVertex3fv(vec[2]); - glVertex3fv(vec[3]); - glVertex3fv(vec[4]); + glVertex3fv(vec[0]); + glVertex3fv(vec[1]); + glVertex3fv(vec[2]); + glVertex3fv(vec[3]); glEnd(); if(is_view) return; + zero_v3(tvec); + /* center point to camera frame */ glBegin(GL_LINE_STRIP); - glVertex3fv(vec[2]); - glVertex3fv(vec[0]); - glVertex3fv(vec[1]); - glVertex3fv(vec[4]); - glVertex3fv(vec[0]); - glVertex3fv(vec[3]); + glVertex3fv(vec[1]); + glVertex3fv(tvec); + glVertex3fv(vec[0]); + glVertex3fv(vec[3]); + glVertex3fv(tvec); + glVertex3fv(vec[2]); glEnd(); /* arrow on top */ - vec[0][2]= depth; + tvec[2]= vec[1][2]; /* copy the depth */ /* draw an outline arrow for inactive cameras and filled @@ -1477,16 +1435,16 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob else if (i==1 && (ob == v3d->camera)) glBegin(GL_TRIANGLES); else break; - vec[0][0]= shx + ((-0.7f * drawsize) * scax); - vec[0][1]= shy + ((drawsize * (caspy + 0.1f)) * scay); - glVertex3fv(vec[0]); /* left */ + tvec[0]= shift[0] + ((-0.7f * drawsize) * scale[0]); + tvec[1]= shift[1] + ((drawsize * (asp[1] + 0.1f)) * scale[1]); + glVertex3fv(tvec); /* left */ - vec[0][0]= shx + ((0.7f * drawsize) * scax); - glVertex3fv(vec[0]); /* right */ + tvec[0]= shift[0] + ((0.7f * drawsize) * scale[0]); + glVertex3fv(tvec); /* right */ - vec[0][0]= shx; - vec[0][1]= shy + ((1.1f * drawsize * (caspy + 0.7f)) * scay); - glVertex3fv(vec[0]); /* top */ + tvec[0]= shift[0]; + tvec[1]= shift[1] + ((1.1f * drawsize * (asp[1] + 0.7f)) * scale[1]); + glVertex3fv(tvec); /* top */ glEnd(); } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 3cb11b95665..7fefc4ae0fe 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -127,7 +127,7 @@ typedef struct { float ob_scale[3]; // need temp space due to linked values float ob_dims[3]; short link_scale; - float ve_median[6]; + float ve_median[7]; int curdef; float *defweightp; } TransformProperties; @@ -139,11 +139,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL; MDeformVert *dvert=NULL; TransformProperties *tfp; - float median[6], ve_median[6]; + float median[7], ve_median[7]; int tot, totw, totweight, totedge, totradius; char defstr[320]; - - median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= 0.0; + + median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= median[6]= 0.0; tot= totw= totweight= totedge= totradius= 0; defstr[0]= 0; @@ -170,10 +170,14 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) { if(BM_TestHFlag(eed, BM_SELECT)) { - float *f = bm_get_cd_float(&bm->edata, eed->head.data, CD_CREASE); + float *f; totedge++; + f = bm_get_cd_float(&bm->edata, eed->head.data, CD_CREASE); median[3]+= f ? *f : 0.0f; + + f = bm_get_cd_float(&bm->edata, eed->head.data, CD_BWEIGHT); + median[6]+= f ? *f : 0.0f; } } @@ -284,7 +288,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float median[0] /= (float)tot; median[1] /= (float)tot; median[2] /= (float)tot; - if(totedge) median[3] /= (float)totedge; + if (totedge) { + median[3] /= (float)totedge; + median[6] /= (float)totedge; + } else if(totw) median[3] /= (float)totw; if(totweight) median[4] /= (float)totweight; if(totradius) median[5] /= (float)totradius; @@ -299,78 +306,82 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiBlockBeginAlign(block); if(tot==1) { - uiDefBut(block, LABEL, 0, "Vertex:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Vertex:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 90, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 70, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); if(totw==1) { - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 50, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, ""); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, ""); uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); + uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); + uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); uiBlockEndAlign(block); if(totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 0, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, ""); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, ""); if(totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); } else { uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); + uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); + uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); uiBlockEndAlign(block); if(totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, ""); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, ""); if(totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 40, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); } } else { - uiDefBut(block, LABEL, 0, "Median:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Median:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 90, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 70, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); + but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); if(totw==tot) { - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 50, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, ""); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, ""); uiBlockEndAlign(block); uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); + uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); + uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); uiBlockEndAlign(block); if(totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 0, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal"); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal"); if(totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); uiBlockEndAlign(block); } else { uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); + uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); + uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values"); uiBlockEndAlign(block); if(totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal"); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal"); if(totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); uiBlockEndAlign(block); } } - - if(totedge==1) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease:", 0, 20, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, ""); - else if(totedge>1) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Crease:", 0, 20, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, ""); - + + if(totedge==1){ + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, ""); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, ""); + } + else if(totedge>1){ + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, ""); + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, ""); + } + } else { // apply memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median)); @@ -384,6 +395,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float median[3]= ve_median[3]-median[3]; median[4]= ve_median[4]-median[4]; median[5]= ve_median[5]-median[5]; + median[6]= ve_median[6]-median[6]; if(ob->type==OB_MESH) { Mesh *me= ob->data; @@ -458,7 +470,54 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float } } } - + if (median[6] != 0.0f) { +#if 0 // BMESH_TODO + EditEdge *eed; + const float fixed_bweight= (ve_median[6] <= 0.0f ? 0.0f : (ve_median[6] >= 1.0f ? 1.0f : FLT_MAX)); + + if(fixed_bweight != FLT_MAX) { + /* simple case */ + + for(eed= em->edges.first; eed; eed= eed->next) { + if(eed->f & SELECT) { + eed->bweight= fixed_bweight; + } + } + } + else { + /* scale crease to target median */ + float median_new= ve_median[6]; + float median_orig= ve_median[6] - median[6]; /* previous median value */ + + /* incase of floating point error */ + CLAMP(median_orig, 0.0f, 1.0f); + CLAMP(median_new, 0.0f, 1.0f); + + if(median_new < median_orig) { + /* scale down */ + const float sca= median_new / median_orig; + + for(eed= em->edges.first; eed; eed= eed->next) { + if(eed->f & SELECT) { + eed->bweight *= sca; + CLAMP(eed->bweight, 0.0f, 1.0f); + } + } + } + else { + /* scale up */ + const float sca= (1.0f - median_new) / (1.0f - median_orig); + + for(eed= em->edges.first; eed; eed= eed->next) { + if(eed->f & SELECT) { + eed->bweight = 1.0f - ((1.0f - eed->bweight) * sca); + CLAMP(eed->bweight, 0.0f, 1.0f); + } + } + } + } +#endif // BMESH_TODO + } EDBM_RecalcNormals(em); } else if(ob->type==OB_CURVE || ob->type==OB_SURF) { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 30436fad772..ea71e89f883 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2322,6 +2322,12 @@ void flushTransNodes(TransInfo *t) } /* *** SEQUENCE EDITOR *** */ + +/* commented _only_ because the meta may have animaion data which + * needs moving too [#28158] */ + +#define SEQ_TX_NESTED_METAS + void flushTransSeq(TransInfo *t) { ListBase *seqbasep= seq_give_editing(t->scene, FALSE)->seqbasep; /* Editing null check already done */ @@ -2347,9 +2353,13 @@ void flushTransSeq(TransInfo *t) switch (tdsq->sel_flag) { case SELECT: +#ifdef SEQ_TX_NESTED_METAS + if ((seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */ + seq->start= new_frame - tdsq->start_offset; +#else if (seq->type != SEQ_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */ seq->start= new_frame - tdsq->start_offset; - +#endif if (seq->depth==0) { seq->machine= (int)floor(td2d->loc[1] + 0.5f); CLAMP(seq->machine, 1, MAXSEQ); @@ -2404,7 +2414,7 @@ void flushTransSeq(TransInfo *t) seq_prev= seq; } - if (t->mode == TFM_TIME_TRANSLATE) { /* originally TFM_TIME_EXTEND, transform changes */ + if (t->mode == TFM_SEQ_SLIDE) { /* originally TFM_TIME_EXTEND, transform changes */ /* Special annoying case here, need to calc metas with TFM_TIME_EXTEND only */ seq= seqbasep->first; @@ -2906,7 +2916,7 @@ static void posttrans_gpd_clean (bGPdata *gpd) /* Called during special_aftertrans_update to make sure selected keyframes replace * any other keyframes which may reside on that frame (that is not selected). */ -static void posttrans_fcurve_clean (FCurve *fcu) +static void posttrans_fcurve_clean (FCurve *fcu, const short use_handle) { float *selcache; /* cache for frame numbers of selected frames (fcu->totvert*sizeof(float)) */ int len, index, i; /* number of frames in cache, item index */ @@ -2955,7 +2965,7 @@ static void posttrans_fcurve_clean (FCurve *fcu) } } - testhandles_fcurve(fcu); + testhandles_fcurve(fcu, use_handle); } /* free cache */ @@ -2986,11 +2996,11 @@ static void posttrans_action_clean (bAnimContext *ac, bAction *act) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - posttrans_fcurve_clean(ale->key_data); + posttrans_fcurve_clean(ale->key_data, FALSE); /* only use handles in graph editor */ ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else - posttrans_fcurve_clean(ale->key_data); + posttrans_fcurve_clean(ale->key_data, FALSE); /* only use handles in graph editor */ } /* free temp data */ @@ -3011,12 +3021,11 @@ static int count_fcurve_keys(FCurve *fcu, char side, float cfra) /* only include points that occur on the right side of cfra */ for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { if (bezt->f2 & SELECT) { - /* fully select the other two keys */ - bezt->f1 |= SELECT; - bezt->f3 |= SELECT; - - if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) + /* no need to adjust the handle selection since they are assumed + * selected (like graph editor with SIPO_NOHANDLES) */ + if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { count += 1; + } } } @@ -3441,9 +3450,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse */ for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { if (FrameOnMouseSide(t->frame_side, bezt->vec[1][0], cfra)) { - const char sel1= use_handle ? bezt->f1 & SELECT : 0; const char sel2= bezt->f2 & SELECT; - const char sel3= use_handle ? bezt->f3 & SELECT : 0; + const char sel1= use_handle ? bezt->f1 & SELECT : sel2; + const char sel3= use_handle ? bezt->f3 & SELECT : sel2; if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) { /* for 'normal' pivots - just include anything that is selected. @@ -3534,9 +3543,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */ for (i=0, bezt= fcu->bezt; i < fcu->totvert; i++, bezt++) { if (FrameOnMouseSide(t->frame_side, bezt->vec[1][0], cfra)) { - const char sel1= use_handle ? bezt->f1 & SELECT : 0; const char sel2= bezt->f2 & SELECT; - const char sel3= use_handle ? bezt->f3 & SELECT : 0; + const char sel1= use_handle ? bezt->f1 & SELECT : sel2; + const char sel3= use_handle ? bezt->f3 & SELECT : sel2; TransDataCurveHandleFlags *hdata = NULL; /* short h1=1, h2=1; */ /* UNUSED */ @@ -3596,7 +3605,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) } /* Sets handles based on the selection */ - testhandles_fcurve(fcu); + testhandles_fcurve(fcu, use_handle); } /* cleanup temp list */ @@ -3800,7 +3809,7 @@ void remake_graph_transdata (TransInfo *t, ListBase *anim_data) sort_time_fcurve(fcu); /* make sure handles are all set correctly */ - testhandles_fcurve(fcu); + testhandles_fcurve(fcu, use_handle); } } } @@ -3958,6 +3967,11 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count else { /* Nested, different rules apply */ +#ifdef SEQ_TX_NESTED_METAS + *flag= (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL); + *count= 1; /* ignore the selection for nested */ + *recursive = (seq->type == SEQ_META ); +#else if (seq->type == SEQ_META) { /* Meta's can only directly be moved between channels since they * dont have their start and length set directly (children affect that) @@ -3972,6 +3986,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count *count= 1; /* ignore the selection for nested */ *recursive = 0; } +#endif } } } @@ -4947,11 +4962,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t) { if (adt) { ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); - posttrans_fcurve_clean(fcu); + posttrans_fcurve_clean(fcu, FALSE); /* only use handles in graph editor */ ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); } else - posttrans_fcurve_clean(fcu); + posttrans_fcurve_clean(fcu, FALSE); /* only use handles in graph editor */ } } @@ -5031,6 +5046,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (t->spacetype == SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first; bAnimContext ac; + const short use_handle = !(sipo->flag & SIPO_NOHANDLES); /* initialise relevant anim-context 'context' data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -5059,11 +5075,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t) { if (adt) { ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0); - posttrans_fcurve_clean(fcu); + posttrans_fcurve_clean(fcu, use_handle); ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 0); } else - posttrans_fcurve_clean(fcu); + posttrans_fcurve_clean(fcu, use_handle); } } diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index c3cbcb61622..a792b51e1cf 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -903,7 +903,7 @@ static void do_material_tex(GPUShadeInput *shi) /*char *lastuvname = NULL;*/ /*UNUSED*/ float one = 1.0f, norfac, ofs[3]; int tex_nr, rgbnor, talpha; - int init_done = 0, iBumpSpacePrev; + int init_done = 0, iBumpSpacePrev = 0; /* Not necessary, quiting gcc warning. */ GPUNodeLink *vNorg, *vNacc, *fPrevMagnitude; int iFirstTimeNMap=1; int found_deriv_map = 0; @@ -1101,7 +1101,12 @@ static void do_material_tex(GPUShadeInput *shi) if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) hScale = hScaleTex; - norfac = hScale * mtex->norfac; + + // The negate on norfac is done because the + // normal in the renderer points inward which corresponds + // to inverting the bump map. Should this ever change + // this negate must be removed. + norfac = -hScale * mtex->norfac; tnorfac = GPU_uniform(&norfac); if(GPU_link_changed(stencil)) diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 3c3cecc0e96..b9500c2f798 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -900,8 +900,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position, long long st_time; struct anim_index * tc_index = 0; AVStream * v_st; - int new_frame_index; - int old_frame_index; + int new_frame_index = 0; /* To quite gcc barking... */ + int old_frame_index = 0; /* To quite gcc barking... */ if (anim == 0) return (0); diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 80fc6f63363..f81a05f5625 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -125,7 +125,7 @@ typedef struct Library { enum eIconSizes { ICON_SIZE_ICON, - ICON_SIZE_PREVIEW, + ICON_SIZE_PREVIEW }; #define NUM_ICON_SIZES (ICON_SIZE_PREVIEW + 1) @@ -204,6 +204,8 @@ typedef struct PreviewImage { #define ID_REAL_USERS(id) (((ID *)id)->us - ((((ID *)id)->flag & LIB_FAKEUSER) ? 1:0)) +#define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM)) + #ifdef GS #undef GS #endif diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 6e850a07d94..d878a759d22 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -466,6 +466,7 @@ typedef struct TexMapping { #define MTEX_5TAP_BUMP 512 #define MTEX_BUMP_OBJECTSPACE 1024 #define MTEX_BUMP_TEXTURESPACE 2048 +#define MTEX_BUMP_FLIPPED 4096 /* temp flag for 2.59/2.60 */ /* blendtype */ #define MTEX_BLEND 0 diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 47ebf111eba..9e94ebfb6e8 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -295,6 +295,7 @@ typedef struct wmKeyConfig { /* wmKeyConfig.flag */ #define KEYCONF_USER (1 << 1) +#define KEYCONF_INIT_DEFAULT (1 << 2) /* this one is the operator itself, stored in files for macros etc */ /* operator + operatortype should be able to redo entirely, but for different contextes */ diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 539005f2142..f51bea9a4ef 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -95,6 +95,7 @@ set(APISRC rna_actuator_api.c rna_animation_api.c rna_armature_api.c + rna_camera_api.c rna_controller_api.c rna_fcurve_api.c rna_image_api.c diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 80352d3f03e..bc45ea4deed 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2432,7 +2432,7 @@ static RNAProcessItem PROCESS_ITEMS[]= { {"rna_armature.c", "rna_armature_api.c", RNA_def_armature}, {"rna_boid.c", NULL, RNA_def_boid}, {"rna_brush.c", NULL, RNA_def_brush}, - {"rna_camera.c", NULL, RNA_def_camera}, + {"rna_camera.c", "rna_camera_api.c", RNA_def_camera}, {"rna_cloth.c", NULL, RNA_def_cloth}, {"rna_color.c", NULL, RNA_def_color}, {"rna_constraint.c", NULL, RNA_def_constraint}, diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index a834fcf820b..75c21e3f47e 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -752,7 +752,7 @@ static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_pointer_sdna(prop, NULL, "act_bone"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Active Bone", "Armatures active bone"); + RNA_def_property_ui_text(prop, "Active Bone", "Armature's active bone"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL); /* todo, redraw */ diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index c9d261e8143..357f613f65f 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -554,7 +554,7 @@ static void rna_def_boid_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); - RNA_def_property_ui_text(prop, "Range", "The maximum distance from which a boid can attack"); + RNA_def_property_ui_text(prop, "Range", "Maximum distance from which a boid can attack"); RNA_def_property_update(prop, 0, "rna_Boids_reset"); /* physical properties */ diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 37912f810fc..9954fdfd88d 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -209,6 +209,9 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + + /* Camera API */ + RNA_api_camera(srna); } #endif diff --git a/source/blender/makesrna/intern/rna_camera_api.c b/source/blender/makesrna/intern/rna_camera_api.c new file mode 100644 index 00000000000..39478713663 --- /dev/null +++ b/source/blender/makesrna/intern/rna_camera_api.c @@ -0,0 +1,88 @@ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/makesrna/intern/rna_camera_api.c + * \ingroup RNA + */ + + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + + +#include "RNA_define.h" +#include "BKE_utildefines.h" + +#ifdef RNA_RUNTIME + +#include "DNA_scene_types.h" +#include "BKE_context.h" +#include "BKE_object.h" + +void rna_camera_view_frame(struct Camera *camera, struct Scene *scene, + float vec1_r[3], float vec2_r[3], float vec3_r[3], float vec4_r[3]) +{ + float vec[4][3]; + + camera_view_frame(scene, camera, vec); + + copy_v3_v3(vec1_r, vec[0]); + copy_v3_v3(vec2_r, vec[1]); + copy_v3_v3(vec3_r, vec[2]); + copy_v3_v3(vec4_r, vec[3]); +} + +#else + +void RNA_api_camera(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *parm; + + func= RNA_def_function(srna, "view_frame", "rna_camera_view_frame"); + RNA_def_function_ui_description(func, "Return 4 points for the cameras frame (before object transformation)"); + + RNA_def_pointer(func, "scene", "Scene", "", "Scene to use for aspect calculation, when omitted 1:1 aspect is used"); + + /* return location and normal */ + parm= RNA_def_float_vector(func, "result_1", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); + RNA_def_property_flag(parm, PROP_THICK_WRAP); + RNA_def_function_output(func, parm); + + parm= RNA_def_float_vector(func, "result_2", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); + RNA_def_property_flag(parm, PROP_THICK_WRAP); + RNA_def_function_output(func, parm); + + parm= RNA_def_float_vector(func, "result_3", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); + RNA_def_property_flag(parm, PROP_THICK_WRAP); + RNA_def_function_output(func, parm); + + parm= RNA_def_float_vector(func, "result_4", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); + RNA_def_property_flag(parm, PROP_THICK_WRAP); + RNA_def_function_output(func, parm); +} + +#endif + diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 78b8c67d92c..cf1be39124e 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -234,6 +234,7 @@ char *rna_TextureSlot_path(struct PointerRNA *ptr); void RNA_api_action(StructRNA *srna); void RNA_api_armature_edit_bone(StructRNA *srna); void RNA_api_bone(StructRNA *srna); +void RNA_api_camera(StructRNA *srna); void RNA_api_drivers(StructRNA *srna); void RNA_api_image(struct StructRNA *srna); void RNA_api_operator(struct StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 0a23010a1b9..21e816ad222 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -670,7 +670,7 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataMaterials"); srna= RNA_def_struct(brna, "BlendDataMaterials", NULL); RNA_def_struct_sdna(srna, "Main"); - RNA_def_struct_ui_text(srna, "Main Material", "Collection of materials"); + RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials"); func= RNA_def_function(srna, "new", "rna_Main_materials_new"); RNA_def_function_ui_description(func, "Add a new material to the main database"); @@ -949,7 +949,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataMetaBalls"); srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL); RNA_def_struct_sdna(srna, "Main"); - RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs"); + RNA_def_struct_ui_text(srna, "Main MetaBalls", "Collection of metaballs"); func= RNA_def_function(srna, "new", "rna_Main_metaballs_new"); RNA_def_function_ui_description(func, "Add a new metaball to the main database"); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index c046c222898..0b137633349 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1680,7 +1680,7 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "use_estimate_matrix", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_ESTIMATEIPO); - RNA_def_property_ui_text(prop, "Estimate matrix", "estimate matrix .. split to COM , ROT ,SCALE "); + RNA_def_property_ui_text(prop, "Estimate matrix", "Estimate matrix... split to COM, ROT, SCALE"); /***********************************************************************************/ @@ -1722,7 +1722,7 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "use_stiff_quads", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons"); + RNA_def_property_ui_text(prop, "Stiff Quads", "Add diagonal springs on 4-gons"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "use_edge_collision", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 1d8a91861d6..8eb25290b18 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -2068,7 +2068,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "courant_target", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 10); RNA_def_property_float_default(prop, 0.2); - RNA_def_property_ui_text(prop, "Adaptive Subframe Threshold", "The relative distance a particle can move before requiring more subframes (target Courant number). 0.1-0.3 is the recommended range"); + RNA_def_property_ui_text(prop, "Adaptive Subframe Threshold", "The relative distance a particle can move before requiring more subframes (target Courant number); 0.1-0.3 is the recommended range"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 8084ddc60f8..2eb095aea3d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1242,7 +1242,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF); - RNA_def_property_ui_text(prop, "Project to Self", "Snap onto its self (editmode)"); + RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)"); RNA_def_property_ui_icon(prop, ICON_ORTHO, 0); RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */ @@ -1874,19 +1874,19 @@ static void rna_def_scene_game_data(BlenderRNA *brna) prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_range(prop, 8, 32); - RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display"); + RNA_def_property_ui_text(prop, "Bits", "Display bit depth of full screen display"); RNA_def_property_update(prop, NC_SCENE, NULL); // Do we need it here ? (since we already have it in World prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "freqplay"); RNA_def_property_range(prop, 4, 2000); - RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display"); + RNA_def_property_ui_text(prop, "Freq", "Display clock frequency of fullscreen display"); RNA_def_property_update(prop, NC_SCENE, NULL); prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0); - RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display"); + RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display"); RNA_def_property_update(prop, NC_SCENE, NULL); /* Framing */ diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 686c8dffcd1..840a24c23f4 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -148,9 +148,9 @@ static void rna_def_area(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL); RNA_def_property_struct_type(prop, "Space"); RNA_def_property_ui_text(prop, "Spaces", - "Spaces contained in this area, the first being the active space. " - "NOTE: Useful for example to restore a previously used 3d view space " - "in a certain area to get the old view orientation"); + "Spaces contained in this area, the first being the active space " + "(NOTE: Useful for example to restore a previously used 3D view space " + "in a certain area to get the old view orientation)"); rna_def_area_spaces(brna, prop); prop= RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index d7e0113f56e..3d81ec24d29 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -559,7 +559,8 @@ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p { Editing *ed= seq_give_editing(scene, FALSE); - free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE); + if(ed) + free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE); } static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) @@ -820,16 +821,14 @@ static void rna_def_strip_proxy(BlenderRNA *brna) PropertyRNA *prop; static const EnumPropertyItem seq_tc_items[]= { - {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""}, + {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""}, {SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", - "use images in the order as they are recorded"}, - {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", - "use global timestamp written by recording device"}, - {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", - 0, "Free Run (rec date)", - "interpolate a global timestamp using the " - "record date and time written by recording " - "device"}, + "Use images in the order as they are recorded"}, + {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", + "Use global timestamp written by recording device"}, + {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", + "Interpolate a global timestamp using the " + "record date and time written by recording device"}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "SequenceProxy", NULL); diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 8ea00530c2f..217d68860f2 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -255,7 +255,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH); - RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness"); + RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE); @@ -305,11 +305,11 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW); - RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation"); + RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation"); prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE); - RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area"); + RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area"); prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index e561065cb09..fa98e07da20 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2068,7 +2068,7 @@ static void rna_def_space_graph(BlenderRNA *brna) prop= RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF); RNA_def_property_ui_text(prop, "Use High Quality Drawing", - "Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance"); + "Draw F-Curves using Anti-Aliasing and other fancy effects (disable for better performance)"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); /* editing */ @@ -2144,7 +2144,7 @@ static void rna_def_space_nla(BlenderRNA *brna) prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES); - RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips"); + RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); /* editing */ @@ -2516,7 +2516,7 @@ static void rna_def_space_node(BlenderRNA *brna) prop= RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_AUTO_RENDER); - RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layer on 3D edits"); + RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layers on 3D edits"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); prop= RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index e2beabf789d..21a426640f2 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -57,20 +57,23 @@ EnumPropertyItem texture_filter_items[] = { EnumPropertyItem texture_type_items[] = { {0, "NONE", 0, "None", ""}, - {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - Creates a ramp texture"}, - {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - Creates a cloud-like fractal noise texture"}, - {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", "Procedural - Noise texture distorted by two noise algorithms"}, - {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", "Creates a render of the environment mapped to a texture"}, - {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allows for images or movies to be used as textures"}, + {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - create a ramp texture"}, + {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - create a cloud-like fractal noise texture"}, + {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, + "Distorted Noise", "Procedural - Noise texture distorted by two noise algorithms"}, + {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, + "Environment Map", "Create a render of the environment mapped to a texture"}, + {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allow for images or movies to be used as textures"}, {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - Color texture based on trigonometric functions"}, {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - Marble-like noise texture with wave generated bands"}, {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - Highly flexible fractal noise texture"}, - {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", "Procedural - Random noise, gives a different result every time, for every frame, for every pixel"}, + {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", + "Procedural - Random noise, gives a different result every time, for every frame, for every pixel"}, //{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */ {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""}, - {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - Creates a fractal noise texture"}, - {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Creates cell-like patterns based on Worley noise"}, - {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Creates a 3d texture based on volumetric data"}, + {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - Create a fractal noise texture"}, + {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Create cell-like patterns based on Worley noise"}, + {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"}, {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - Wave generated bands or rings, with optional noise"}, {0, NULL, 0, NULL, NULL}}; @@ -493,25 +496,26 @@ static void rna_def_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "ofs"); RNA_def_property_ui_range(prop, -10, 10, 10, 2); - RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations"); + RNA_def_property_ui_text(prop, "Offset", "Fine tune of the texture mapping X, Y and Z locations"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_range(prop, -100, 100, 10, 2); - RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes"); + RNA_def_property_ui_text(prop, "Size", "Set scaling for the texture's X, Y and Z sizes"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Color", "The default color for textures that don't return RGB or when RGB to intensity is enabled"); + RNA_def_property_ui_text(prop, "Color", + "Default color for textures that don't return RGB or when RGB to intensity is enabled"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blendtype"); RNA_def_property_enum_items(prop, prop_blend_type_items); - RNA_def_property_ui_text(prop, "Blend Type", "The mode used to apply the texture"); + RNA_def_property_ui_text(prop, "Blend Type", "Mode used to apply the texture"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "use_stencil", PROP_BOOLEAN, PROP_NONE); @@ -521,12 +525,12 @@ static void rna_def_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE); - RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect"); + RNA_def_property_ui_text(prop, "Negate", "Invert the values of the texture to reverse its effect"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "use_rgb_to_intensity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT); - RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values"); + RNA_def_property_ui_text(prop, "RGB to Intensity", "Convert texture RGB values to intensity (gray) values"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE); @@ -567,13 +571,15 @@ static void rna_def_filter_common(StructRNA *srna) prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); - RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower"); + RNA_def_property_ui_text(prop, "Filter Probes", + "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); - RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower"); + RNA_def_property_ui_text(prop, "Filter Eccentricity", + "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE); @@ -662,7 +668,7 @@ static void rna_def_environment_map(BlenderRNA *brna) prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_range(prop, 0, 5); - RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)"); + RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects)"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0); @@ -926,13 +932,13 @@ static void rna_def_texture_blend(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_blend_progression[] = { - {TEX_LIN, "LINEAR", 0, "Linear", "Creates a linear progression"}, - {TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"}, - {TEX_EASE, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"}, - {TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Creates a diagonal progression"}, - {TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Creates a spherical progression"}, - {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"}, - {TEX_RAD, "RADIAL", 0, "Radial", "Creates a radial progression"}, + {TEX_LIN, "LINEAR", 0, "Linear", "Create a linear progression"}, + {TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Create a quadratic progression"}, + {TEX_EASE, "EASING", 0, "Easing", "Create a progression easing from one step to the next"}, + {TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Create a diagonal progression"}, + {TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Create a spherical progression"}, + {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Create a quadratic progression in the shape of a sphere"}, + {TEX_RAD, "RADIAL", 0, "Radial", "Create a radial progression"}, {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem prop_flip_axis_items[]= { @@ -1021,11 +1027,12 @@ static void rna_def_texture_image(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_image_extension[] = { - {TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"}, - {TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"}, - {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"}, - {TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"}, - {TEX_CHECKER, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"}, + {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"}, + {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and sets exterior pixels as transparent"}, + {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube", + "Clip to cubic-shaped area around the image and sets exterior pixels as transparent"}, + {TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"}, + {TEX_CHECKER, "CHECKER", 0, "Checker", "Cause the image to repeat in checker board pattern"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ImageTexture", "Texture"); @@ -1219,11 +1226,15 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_musgrave_type[] = { - {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", "Fractal noise algorithm. Multifractal: Uses Perlin noise as a basis"}, - {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", "Fractal noise algorithm. Ridged Multifractal: Uses Perlin noise with inflection as a basis"}, - {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", "Fractal noise algorithm.Hybrid Multifractal: Uses Perlin noise as a basis, with extended controls"}, + {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", + "Fractal noise algorithm. Multifractal: Uses Perlin noise as a basis"}, + {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", + "Fractal noise algorithm. Ridged Multifractal: Uses Perlin noise with inflection as a basis"}, + {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", + "Fractal noise algorithm.Hybrid Multifractal: Uses Perlin noise as a basis, with extended controls"}, {TEX_FBM, "FBM", 0, "fBM", "Fractal noise algorithm. Fractal Brownian Motion: Uses Brownian noise as a basis"}, - {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Fractal noise algorithm. Hetero Terrain: similar to multifractal"}, + {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", + "Fractal noise algorithm. Hetero Terrain: similar to multifractal"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MusgraveTexture", "Texture"); @@ -1298,13 +1309,28 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_distance_metric_items[] = { - {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", "Algorithm used to calculate distance of sample points to feature points. Actual Distance: sqrt(x*x+y*y+z*z)"}, - {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", "Algorithm used to calculate distance of sample points to feature points. Distance squared: (x*x+y*y+z*z)"}, - {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", "Algorithm used to calculate distance of sample points to feature points. Manhattan: The length of the distance in axial directions"}, - {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", "Algorithm used to calculate distance of sample points to feature points. Chebychev: The length of the longest Axial journey"}, - {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", "Algorithm used to calculate distance of sample points to feature points. Minovsky 1/2: Sets Minkovsky variable to 0.5"}, - {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", "Algorithm used to calculate distance of sample points to feature points. Minkovsky 4: Sets Minkovsky variable to 4"}, - {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", "Algorithm used to calculate distance of sample points to feature points. Minkovsky: Uses the Minkowsky function to calculate distance. Exponent value determines the shape of the boundaries"}, + {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", + "Algorithm used to calculate distance of sample points to feature points; " + "Actual Distance: sqrt(x*x+y*y+z*z)"}, + {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", + "Algorithm used to calculate distance of sample points to feature points; " + "Distance squared: (x*x+y*y+z*z)"}, + {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", + "Algorithm used to calculate distance of sample points to feature points; " + "Manhattan: The length of the distance in axial directions"}, + {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", + "Algorithm used to calculate distance of sample points to feature points; " + "Chebychev: The length of the longest Axial journey"}, + {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", + "Algorithm used to calculate distance of sample points to feature points; " + "Minovsky 1/2: Sets Minkovsky variable to 0.5"}, + {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", + "Algorithm used to calculate distance of sample points to feature points; " + "Minkovsky 4: Sets Minkovsky variable to 4"}, + {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", + "Algorithm used to calculate distance of sample points to feature points; " + "Minkovsky: Uses the Minkowsky function to calculate distance " + "(exponent value determines the shape of the boundaries)"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_coloring_items[] = { @@ -1312,7 +1338,8 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) {TEX_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"}, {TEX_COL1, "POSITION", 0, "Position", "Color cells by position"}, {TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F.1"}, - {TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", "Multiply position and outline by intensity"}, + {TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", + "Multiply position and outline by intensity"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "VoronoiTexture", "Texture"); @@ -1458,14 +1485,16 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) static EnumPropertyItem color_source_items[] = { {TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""}, {TEX_PD_COLOR_PARTAGE, "PARTICLE_AGE", 0, "Particle Age", "Lifetime mapped as 0.0 - 1.0 intensity"}, - {TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed", "Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"}, + {TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed", + "Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"}, {TEX_PD_COLOR_PARTVEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "XYZ velocity mapped to RGB colors"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem turbulence_influence_items[] = { {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"}, {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "Turbulent noise driven by particle velocity"}, - {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", "Turbulent noise driven by the particle's age between birth and death"}, + {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", + "Turbulent noise driven by the particle's age between birth and death"}, {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, {0, NULL, 0, NULL, NULL}}; @@ -1760,17 +1789,17 @@ static void rna_def_texture(BlenderRNA *brna) prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bright"); RNA_def_property_range(prop, 0, 2); - RNA_def_property_ui_text(prop, "Brightness", "Adjusts the brightness of the texture"); + RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 5); - RNA_def_property_ui_text(prop, "Contrast", "Adjusts the contrast of the texture"); + RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 2); - RNA_def_property_ui_text(prop, "Saturation", "Adjusts the saturation of colors in the texture"); + RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); /* RGB Factor */ diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 52c359d79dd..29357362ae2 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -719,7 +719,7 @@ static void rna_def_header(BlenderRNA *brna) prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "layout"); RNA_def_property_struct_type(prop, "UILayout"); - RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the header in the UI"); + RNA_def_property_ui_text(prop, "Layout", "Structure of the header in the UI"); /* registration */ prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); @@ -727,7 +727,7 @@ static void rna_def_header(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_property_ui_text(prop, "ID Name", "If this is set, the header gets a custom ID, otherwise it takes the " - "name of the class used to define the panel. For example, if the " + "name of the class used to define the panel; for example, if the " "class name is \"OBJECT_HT_hello\", and bl_idname is not set by the " "script, then bl_idname = \"OBJECT_HT_hello\""); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b81b370a890..5d2f24e8324 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2003,10 +2003,16 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna) static void rna_def_userdef_view(BlenderRNA *brna) { static EnumPropertyItem timecode_styles[] = { - {USER_TIMECODE_MINIMAL, "MINIMAL", 0, "Minimal Info", "Most compact representation. Uses '+' as separator for sub-second frame numbers, with left and right truncation of the timecode as necessary"}, - {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode. Format is HH:MM:SS:FF"}, - {USER_TIMECODE_SMPTE_MSF, "SMPTE_COMPACT", 0, "SMPTE (Compact)", "SMPTE timecode showing minutes, seconds, and frames only. Hours are also shown if necessary, but not by default"}, - {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", "Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead"}, + {USER_TIMECODE_MINIMAL, "MINIMAL", 0, "Minimal Info", + "Most compact representation, uses '+' as separator for sub-second frame numbers, " + "with left and right truncation of the timecode as necessary"}, + {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode (format is HH:MM:SS:FF)"}, + {USER_TIMECODE_SMPTE_MSF, "SMPTE_COMPACT", 0, "SMPTE (Compact)", + "SMPTE timecode showing minutes, seconds, and frames only - " + "hours are also shown if necessary, but not by default"}, + {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", + "Similar to SMPTE (Compact), except that instead of frames, " + "milliseconds are shown instead"}, {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"}, {0, NULL, 0, NULL, NULL}}; @@ -2036,7 +2042,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL); - RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens"); + RNA_def_property_ui_text(prop, "Global Scene", "Force the current Scene to be displayed in all Screens"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE); @@ -2055,34 +2061,40 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS); - RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back"); + RNA_def_property_ui_text(prop, "Show Playback FPS", + "Show the frames per second screen refresh rate, while animation is played back"); RNA_def_property_update(prop, 0, "rna_userdef_update"); /* menus */ prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO); - RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering"); + RNA_def_property_ui_text(prop, "Open On Mouse Over", + "Open menu buttons and pulldowns automatically when the mouse is hovering"); prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "menuthreshold1"); RNA_def_property_range(prop, 1, 40); - RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening top level menus"); + RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", + "Time delay in 1/10 seconds before automatically opening top level menus"); prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "menuthreshold2"); RNA_def_property_range(prop, 1, 40); - RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening sub level menus"); + RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", + "Time delay in 1/10 seconds before automatically opening sub level menus"); /* Toolbox click-hold delay */ prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse"); RNA_def_property_range(prop, 1, 40); - RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox"); + RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay", + "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox"); prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse"); RNA_def_property_range(prop, 1, 40); - RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox"); + RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay", + "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox"); prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS); @@ -2090,7 +2102,8 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER); - RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction"); + RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", + "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction"); prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND); @@ -2102,17 +2115,22 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT); - RNA_def_property_ui_text(prop, "Camera Parent Lock", "When the camera is locked to the view and in fly mode, transform the parent rather than the camera"); + RNA_def_property_ui_text(prop, "Camera Parent Lock", + "When the camera is locked to the view and in fly mode, " + "transform the parent rather than the camera"); /* view zoom */ prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS); - RNA_def_property_ui_text(prop, "Zoom To Mouse Position", "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center"); + RNA_def_property_ui_text(prop, "Zoom To Mouse Position", + "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center"); /* view rotation */ prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP); - RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views"); + RNA_def_property_ui_text(prop, "Auto Perspective", + "Automatically switch between orthographic and perspective when changing " + "from top/front/side views"); prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION); @@ -2121,30 +2139,30 @@ static void rna_def_userdef_view(BlenderRNA *brna) /* mini axis */ prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON); - RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View"); + RNA_def_property_ui_text(prop, "Show Mini Axes", "Show a small rotating 3D axes in the bottom left corner of the 3D View"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvisize"); RNA_def_property_range(prop, 10, 64); - RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size"); + RNA_def_property_ui_text(prop, "Mini Axes Size", "The axes icon's size"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvibright"); RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon"); + RNA_def_property_ui_text(prop, "Mini Axes Brightness", "Brightness of the icon"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx"); RNA_def_property_range(prop, 0, 1000); - RNA_def_property_ui_text(prop, "Smooth View", "The time to animate the view in milliseconds, zero to disable"); + RNA_def_property_ui_text(prop, "Smooth View", "Time to animate the view in milliseconds, zero to disable"); prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle"); RNA_def_property_range(prop, 0, 90); - RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)"); + RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)"); /* 3D transform widget */ prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); @@ -2182,7 +2200,8 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize"); RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5? - RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports"); + RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", + "Minimum number of pixels between each gridline in 2D Viewports"); RNA_def_property_update(prop, 0, "rna_userdef_update"); // TODO: add a setter for this, so that we can bump up the minimum size as necessary... @@ -2190,7 +2209,8 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_enum_items(prop, timecode_styles); RNA_def_property_enum_sdna(prop, NULL, "timecode_style"); RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL); - RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames"); + RNA_def_property_ui_text(prop, "TimeCode Style", + "Format of Time Codes displayed when not displaying timing in terms of frames"); RNA_def_property_update(prop, 0, "rna_userdef_update"); } @@ -2210,7 +2230,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem object_align_items[]= { - {0, "WORLD", 0, "World", "Align newly added objects to the world coordinates"}, + {0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"}, {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"}, {0, NULL, 0, NULL, NULL}}; @@ -2224,12 +2244,14 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, material_link_items); - RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block"); + RNA_def_property_ui_text(prop, "Material Link To", + "Toggle whether the material is linked to object data or the object block"); prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, object_align_items); - RNA_def_property_ui_text(prop, "Align Object To", "When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates"); + RNA_def_property_ui_text(prop, "Align Object To", + "When adding objects from a 3D View menu, either align them with that view or with the world"); prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE); @@ -2252,22 +2274,26 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO); - RNA_def_property_ui_text(prop, "Global Undo", "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory"); + RNA_def_property_ui_text(prop, "Global Undo", + "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory"); /* auto keyframing */ prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON); - RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)"); + RNA_def_property_ui_text(prop, "Auto Keying Enable", + "Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)"); RNA_def_property_ui_icon(prop, ICON_REC, 0); prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, auto_key_modes); RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL); - RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)"); + RNA_def_property_ui_text(prop, "Auto Keying Mode", + "Mode of automatic keyframe insertion for Objects and Bones " + "(default setting used for new Scenes)"); prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL); - RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves"); + RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available F-Curves"); /* keyframing settings */ prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE); @@ -2280,12 +2306,16 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB); - RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis"); + RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB", + "Color for newly added transformation F-Curves (Location, Rotation, Scale) " + "and also Color is based on the transform axis"); prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items); RNA_def_property_enum_sdna(prop, NULL, "ipo_new"); - RNA_def_property_ui_text(prop, "New Interpolation Type", "Interpolation mode used for first keyframe on newly added F-Curves. Subsequent keyframes take interpolation from preceeding keyframe"); + RNA_def_property_ui_text(prop, "New Interpolation Type", + "Interpolation mode used for first keyframe on newly added F-Curves " + "(subsequent keyframes take interpolation from preceeding keyframe)"); prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, keyframe_handle_type_items); @@ -2306,7 +2336,8 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist"); RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include"); + RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", + "Distance moved by mouse when drawing stroke (in pixels) to include"); prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH); @@ -2459,10 +2490,14 @@ static void rna_def_userdef_system(BlenderRNA *brna) static EnumPropertyItem draw_method_items[] = { {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"}, - {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory"}, + {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", + "Use a third buffer for minimal redraws at the cost of more memory"}, {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"}, - {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip", "Redraw all overlapping regions, minimal memory usage but more redraws (for graphics drivers that do flipping)"}, - {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails"}, + {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip", + "Redraw all overlapping regions, minimal memory usage but more redraws " + "(for graphics drivers that do flipping)"}, + {USER_DRAW_FULL, "FULL", 0, "Full", + "Do a full redraw each time, slow, only use for reference or when everything else fails"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem color_picker_types[] = { @@ -2536,7 +2571,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, language_items); - RNA_def_property_ui_text(prop, "Language", "Language use for translation"); + RNA_def_property_ui_text(prop, "Language", "Language used for translation"); RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update"); prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE); @@ -2563,7 +2598,8 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE); - RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode"); + RNA_def_property_ui_text(prop, "Use Weight Color Range", + "Enable color range used for weight visualization in weight painting mode"); RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update"); prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE); @@ -2580,16 +2616,20 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS); - RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)"); + RNA_def_property_ui_text(prop, "Enable All Codecs", + "Allow user to choose any codec (Windows only, might generate instability)"); prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE); - RNA_def_property_ui_text(prop, "Auto Run Python Scripts", "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)"); + RNA_def_property_ui_text(prop, "Auto Run Python Scripts", + "Allow any .blend file to run scripts automatically " + "(unsafe with blend files from an untrusted source)"); RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update"); prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE); - RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces for new and loaded text files"); + RNA_def_property_ui_text(prop, "Tabs as Spaces", + "Automatically convert all new tabs into spaces for new and loaded text files"); prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "prefetchframes"); @@ -2615,12 +2655,14 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP); - RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)"); + RNA_def_property_ui_text(prop, "Mipmaps", + "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)"); RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update"); prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO); - RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering"); + RNA_def_property_ui_text(prop, "VBOs", + "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering"); prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA); @@ -2630,7 +2672,8 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter"); RNA_def_property_enum_items(prop, anisotropic_items); RNA_def_property_enum_default(prop, 1); - RNA_def_property_ui_text(prop, "Anisotropic Filter", "The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)"); + RNA_def_property_ui_text(prop, "Anisotropic Filter", + "Quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)"); RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update"); prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE); @@ -2642,12 +2685,15 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "textimeout"); RNA_def_property_range(prop, 0, 3600); - RNA_def_property_ui_text(prop, "Texture Time Out", "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated.)"); + RNA_def_property_ui_text(prop, "Texture Time Out", + "Time since last access of a GL texture in seconds after which it is freed " + "(set to 0 to keep textures allocated)"); prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "texcollectrate"); RNA_def_property_range(prop, 1, 3600); - RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector"); + RNA_def_property_ui_text(prop, "Texture Collection Rate", + "Number of seconds between each run of the GL texture garbage collector"); prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod"); @@ -2658,31 +2704,31 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mixbufsize"); RNA_def_property_enum_items(prop, audio_mixing_samples_items); - RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer"); + RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer"); RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "audiodevice"); RNA_def_property_enum_items(prop, audio_device_items); - RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device"); + RNA_def_property_ui_text(prop, "Audio Device", "Audio output device"); RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "audiorate"); RNA_def_property_enum_items(prop, audio_rate_items); - RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate"); + RNA_def_property_ui_text(prop, "Audio Sample Rate", "Audio sample rate"); RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "audioformat"); RNA_def_property_enum_items(prop, audio_format_items); - RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format"); + RNA_def_property_ui_text(prop, "Audio Sample Format", "Audio sample format"); RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "audiochannels"); RNA_def_property_enum_items(prop, audio_channel_items); - RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count"); + RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count"); RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE); @@ -2703,11 +2749,11 @@ static void rna_def_userdef_system(BlenderRNA *brna) #if 0 prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "versemaster"); - RNA_def_property_ui_text(prop, "Verse Master", "The Verse Master-server IP"); + RNA_def_property_ui_text(prop, "Verse Master", "Verse Master-server IP"); prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "verseuser"); - RNA_def_property_ui_text(prop, "Verse Username", "The Verse user name"); + RNA_def_property_ui_text(prop, "Verse Username", "Verse user name"); #endif } @@ -2728,13 +2774,13 @@ static void rna_def_userdef_input(BlenderRNA *brna) static EnumPropertyItem view_zoom_styles[] = { {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"}, - {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement"}, - {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center"}, + {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"}, + {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zoom in and out like scaling the view, mouse movements relative to center"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem view_zoom_axes[] = { - {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"}, - {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"}, + {0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"}, + {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zoom in and out based on horizontal mouse movement"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesInput", NULL); @@ -2746,7 +2792,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, select_mouse_items); RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL); - RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection"); + RNA_def_property_ui_text(prop, "Select Mouse", "Mouse button used for selection"); prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "viewzoom"); @@ -2769,7 +2815,8 @@ static void rna_def_userdef_input(BlenderRNA *brna) prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE); - RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)"); + RNA_def_property_ui_text(prop, "Continuous Grab", + "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)"); /* tweak tablet & mouse preset */ prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE); @@ -2846,15 +2893,16 @@ static void rna_def_userdef_input(BlenderRNA *brna) prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dbl_click_time"); RNA_def_property_range(prop, 1, 1000); - RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click"); + RNA_def_property_ui_text(prop, "Double Click Timeout", "Time/delay (in ms) for a double click"); prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE); - RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)"); + RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", + "Emulate Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)"); prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD); - RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)"); + RNA_def_property_ui_text(prop, "Emulate Numpad", "Main 1 to 0 keys act as the numpad ones (useful for laptops)"); /* middle mouse button */ prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE); @@ -2868,7 +2916,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "wheellinescroll"); RNA_def_property_range(prop, 0, 32); - RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel"); + RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel"); prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "keyconfigstr"); @@ -2897,7 +2945,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT); - RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)"); + RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot (.*)"); prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS); @@ -2945,7 +2993,9 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "pythondir"); - RNA_def_property_ui_text(prop, "Python Scripts Directory", "Alternate script path, matching the default layout with subdirs: startup, addons & modules (requires restart)"); + RNA_def_property_ui_text(prop, "Python Scripts Directory", + "Alternate script path, matching the default layout with subdirs: " + "startup, addons & modules (requires restart)"); /* TODO, editing should reset sys.path! */ prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH); @@ -2976,11 +3026,13 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "versions"); RNA_def_property_range(prop, 0, 32); - RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving"); + RNA_def_property_ui_text(prop, "Save Versions", + "The number of old versions to maintain in the current directory, when manually saving"); prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE); - RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files in temp directory, uses process ID"); + RNA_def_property_ui_text(prop, "Auto Save Temporary Files", + "Automatic saving of temporary files in temp directory, uses process ID"); RNA_def_property_update(prop, 0, "rna_userdef_autosave_update"); prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE); @@ -3006,7 +3058,7 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "Addons"); srna= RNA_def_struct(brna, "Addons", NULL); - RNA_def_struct_ui_text(srna, "User Add-Ons", "Collection of add-ons"); + RNA_def_struct_ui_text(srna, "User Addons", "Collection of addons"); func= RNA_def_function(srna, "new", "rna_userdef_addon_new"); RNA_def_function_flag(func, FUNC_NO_SELF); @@ -3031,7 +3083,7 @@ void RNA_def_userdef(BlenderRNA *brna) {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""}, {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""}, {USER_SECTION_INPUT, "INPUT", 0, "Input", ""}, - {USER_SECTION_ADDONS, "ADDONS", 0, "Add-Ons", ""}, + {USER_SECTION_ADDONS, "ADDONS", 0, "Addons", ""}, {USER_SECTION_THEME, "THEMES", 0, "Themes", ""}, {USER_SECTION_FILE, "FILES", 0, "File", ""}, {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""}, diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 645079ca24e..59461d18f8f 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -558,7 +558,9 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) int *vertpa = MEM_callocN(sizeof(int)*totvert,"explode_vertpa2"); int *facepa = emd->facepa; int *fs, totesplit=0,totfsplit=0,curdupface=0; - int i,j,v1,v2,v3,v4,esplit, v[4], uv[4]; + int i,j,v1,v2,v3,v4,esplit, + v[4] = {0, 0, 0, 0}, /* To quite gcc barking... */ + uv[4] = {0, 0, 0, 0}; /* To quite gcc barking... */ int numlayer; edgehash= BLI_edgehash_new(); diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 04c64bcbd3c..88383ce84d5 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -267,6 +267,18 @@ static int bpy_prop_callback_assign(struct PropertyRNA *prop, PyObject *update_c return 0; } +/* utility function we need for parsing int's in an if statement */ +static int py_long_as_int(PyObject *py_long, int *r_int) +{ + if(PyLong_CheckExact(py_long)) { + *r_int= (int)PyLong_AS_LONG(py_long); + return 0; + } + else { + return -1; + } +} + /* this define runs at the start of each function and deals with * returning a deferred property (to be registered later) */ #define BPY_PROPDEF_HEAD(_func) \ @@ -914,6 +926,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i for(i=0; i<seq_len; i++) { EnumPropertyItem tmp= {0, "", 0, "", ""}; + Py_ssize_t item_size; Py_ssize_t id_str_size; Py_ssize_t name_str_size; Py_ssize_t desc_str_size; @@ -921,13 +934,17 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i item= PySequence_Fast_GET_ITEM(seq_fast, i); if( (PyTuple_CheckExact(item)) && - (PyTuple_GET_SIZE(item) == 3) && + (item_size= PyTuple_GET_SIZE(item)) && + (item_size == 3 || item_size == 4) && (tmp.identifier= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) && (tmp.name= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) && - (tmp.description= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) + (tmp.description= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) && + (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1) /* TODO, number isnt ensured to be unique from the script author */ ) { if(is_enum_flag) { - tmp.value= 1<<i; + if(item_size < 4) { + tmp.value= 1<<i; + } if(def && PySet_Contains(def, PyTuple_GET_ITEM(item, 0))) { *defvalue |= tmp.value; @@ -935,7 +952,9 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i } } else { - tmp.value= i; + if(item_size < 4) { + tmp.value= i; + } if(def && def_used == 0 && strcmp(def_cmp, tmp.identifier)==0) { *defvalue= tmp.value; @@ -950,7 +969,10 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i } else { MEM_freeN(items); - PyErr_SetString(PyExc_TypeError, "EnumProperty(...): expected an tuple containing (identifier, name description)"); + PyErr_SetString(PyExc_TypeError, + "EnumProperty(...): expected an tuple containing " + "(identifier, name description) and optionally a " + "unique number"); return NULL; } @@ -1081,8 +1103,9 @@ BPY_PROPDEF_DESC_DOC " :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE', 'ENUM_FLAG'].\n" " :type options: set\n" " :arg items: sequence of enum items formatted:\n" -" [(identifier, name, description), ...] where the identifier is used\n" +" [(identifier, name, description, number), ...] where the identifier is used\n" " for python access and other values are used for the interface.\n" +" Note the item is optional.\n" " For dynamic values a callback can be passed which returns a list in\n" " the same format as the static list.\n" " This function must take 2 arguments (self, context)\n" diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index cbd6affb117..98aa8c9be35 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -6238,7 +6238,11 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param ParameterIterator iter; PointerRNA funcptr; int err= 0, i, flag, ret_len=0; - int is_static= RNA_function_flag(func) & FUNC_NO_SELF; + const char is_static= (RNA_function_flag(func) & FUNC_NO_SELF) != 0; + + /* annoying!, need to check if the screen gets set to NULL which is a + * hint that the file was actually re-loaded. */ + char is_valid_wm; PropertyRNA *pret_single= NULL; void *retdata_single= NULL; @@ -6265,6 +6269,8 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param if(C==NULL) C= BPy_GetContext(); + is_valid_wm= (CTX_wm_manager(C) != NULL); + bpy_context_set(C, &gilstate); if (!is_static) { @@ -6498,7 +6504,11 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param if(err != 0) { ReportList *reports; /* alert the user, else they wont know unless they see the console. */ - if (!is_static && ptr->data && RNA_struct_is_a(ptr->type, &RNA_Operator)) { + if ( (!is_static) && + (ptr->data) && + (RNA_struct_is_a(ptr->type, &RNA_Operator)) && + (is_valid_wm == (CTX_wm_manager(C) != NULL))) + { wmOperator *op= ptr->data; reports= op->reports; } diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 30f6c02115a..502fa25c872 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -44,9 +44,6 @@ /* support for inter references, currently only needed for corner case */ #define USE_PYRNA_STRUCT_REFERENCE -/* use real collection iterators rather than faking with a list */ -#define USE_PYRNA_ITER - #else /* WITH_PYTHON_SAFETY */ /* default, no defines! */ @@ -67,6 +64,11 @@ * so prefer the leak to the memory bloat for now. */ // #define PYRNA_FREE_SUPPORT +/* use real collection iterators rather than faking with a list + * this is needed so enums can be iterated over without crashing, + * since finishing the iteration frees temp allocated enums */ +#define USE_PYRNA_ITER + /* --- end bpy build options --- */ struct ID; diff --git a/source/blender/quicktime/SConscript b/source/blender/quicktime/SConscript index 24dfab13fd9..82735dc96bd 100644 --- a/source/blender/quicktime/SConscript +++ b/source/blender/quicktime/SConscript @@ -35,5 +35,6 @@ defs=['WITH_QUICKTIME'] if env['WITH_GHOST_COCOA']: defs.append('GHOST_COCOA') - -env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities) + env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities, cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/gcc-4.2') # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet +else: + env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities) diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 0b339d285ce..6d27c7707f0 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -485,7 +485,6 @@ typedef struct VolPrecachePart int res[3]; float bbmin[3]; float voxel[3]; - int working, done; struct Render *re; } VolPrecachePart; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 8d953ccc73d..ae814f67450 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1748,7 +1748,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi, TexResult ttexr = {0, 0, 0, 0, 0, texres->talpha, NULL}; // temp TexResult float tco[3], texv[3], cd, ud, vd, du, dv, idu, idv; const int fromrgb = ((tex->type == TEX_IMAGE) || ((tex->flag & TEX_COLORBAND)!=0)); - const float bf = 0.04f*Tnor*mtex->norfac; + const float bf = -0.04f*Tnor*mtex->norfac; int rgbnor; // disable internal bump eval float* nvec = texres->nor; @@ -1904,7 +1904,14 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T TexResult ttexr = {0, 0, 0, 0, 0, texres->talpha, NULL}; // temp TexResult const int fromrgb = ((tex->type == TEX_IMAGE) || ((tex->flag & TEX_COLORBAND)!=0)); - float Hscale = Tnor*mtex->norfac; + + // The negate on Hscale is done because the + // normal in the renderer points inward which corresponds + // to inverting the bump map. The normals are generated + // this way in calc_vertexnormals(). Should this ever change + // this negate must be removed. + float Hscale = -Tnor*mtex->norfac; + int dimx=512, dimy=512; const int imag_tspace_dimension_x = 1024; // only used for texture space variant float aspect = 1.0f; diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 18132c4a7f3..d6cfcee4ac9 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -477,6 +477,11 @@ static void *vol_precache_part_test(void *data) } #endif +typedef struct VolPrecacheQueue { + ThreadQueue *work; + ThreadQueue *done; +} VolPrecacheQueue; + /* Iterate over the 3d voxel grid, and fill the voxels with scattering information * * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. @@ -485,58 +490,65 @@ static void *vol_precache_part_test(void *data) */ static void *vol_precache_part(void *data) { - VolPrecachePart *pa = (VolPrecachePart *)data; - ObjectInstanceRen *obi = pa->obi; - RayObject *tree = pa->tree; - ShadeInput *shi = pa->shi; - float scatter_col[3] = {0.f, 0.f, 0.f}; - float co[3], cco[3], view[3]; - int x, y, z, i; - int res[3]; - - res[0]= pa->res[0]; - res[1]= pa->res[1]; - res[2]= pa->res[2]; - - for (z= pa->minz; z < pa->maxz; z++) { - co[2] = pa->bbmin[2] + (pa->voxel[2] * (z + 0.5f)); - - for (y= pa->miny; y < pa->maxy; y++) { - co[1] = pa->bbmin[1] + (pa->voxel[1] * (y + 0.5f)); + VolPrecacheQueue *queue = (VolPrecacheQueue*)data; + VolPrecachePart *pa; + + while ((pa = BLI_thread_queue_pop(queue->work))) { + ObjectInstanceRen *obi = pa->obi; + RayObject *tree = pa->tree; + ShadeInput *shi = pa->shi; + float scatter_col[3] = {0.f, 0.f, 0.f}; + float co[3], cco[3], view[3]; + int x, y, z, i; + int res[3]; + + if (pa->re->test_break && pa->re->test_break(pa->re->tbh)) + break; + + res[0]= pa->res[0]; + res[1]= pa->res[1]; + res[2]= pa->res[2]; + + for (z= pa->minz; z < pa->maxz; z++) { + co[2] = pa->bbmin[2] + (pa->voxel[2] * (z + 0.5f)); - for (x=pa->minx; x < pa->maxx; x++) { - co[0] = pa->bbmin[0] + (pa->voxel[0] * (x + 0.5f)); - - if (pa->re->test_break && pa->re->test_break(pa->re->tbh)) - break; + for (y= pa->miny; y < pa->maxy; y++) { + co[1] = pa->bbmin[1] + (pa->voxel[1] * (y + 0.5f)); - /* convert from world->camera space for shading */ - mul_v3_m4v3(cco, pa->viewmat, co); - - i= V_I(x, y, z, res); + for (x=pa->minx; x < pa->maxx; x++) { + co[0] = pa->bbmin[0] + (pa->voxel[0] * (x + 0.5f)); + + if (pa->re->test_break && pa->re->test_break(pa->re->tbh)) + break; + + /* convert from world->camera space for shading */ + mul_v3_m4v3(cco, pa->viewmat, co); + + i= V_I(x, y, z, res); + + // don't bother if the point is not inside the volume mesh + if (!point_inside_obi(tree, obi, cco)) { + obi->volume_precache->data_r[i] = -1.0f; + obi->volume_precache->data_g[i] = -1.0f; + obi->volume_precache->data_b[i] = -1.0f; + continue; + } + + copy_v3_v3(view, cco); + normalize_v3(view); + vol_get_scattering(shi, scatter_col, cco, view); - // don't bother if the point is not inside the volume mesh - if (!point_inside_obi(tree, obi, cco)) { - obi->volume_precache->data_r[i] = -1.0f; - obi->volume_precache->data_g[i] = -1.0f; - obi->volume_precache->data_b[i] = -1.0f; - continue; + obi->volume_precache->data_r[i] = scatter_col[0]; + obi->volume_precache->data_g[i] = scatter_col[1]; + obi->volume_precache->data_b[i] = scatter_col[2]; + } - - copy_v3_v3(view, cco); - normalize_v3(view); - vol_get_scattering(shi, scatter_col, cco, view); - - obi->volume_precache->data_r[i] = scatter_col[0]; - obi->volume_precache->data_g[i] = scatter_col[1]; - obi->volume_precache->data_b[i] = scatter_col[2]; - } } + + BLI_thread_queue_push(queue->done, pa); } - pa->done = 1; - return NULL; } @@ -602,9 +614,6 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob minz = z * sizez; maxz = minz + sizez; maxz = (maxz>res[2])?res[2]:maxz; - - pa->done = 0; - pa->working = 0; pa->re = re; pa->num = i; @@ -630,21 +639,6 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob } } -static VolPrecachePart *precache_get_new_part(Render *re) -{ - VolPrecachePart *pa, *nextpa=NULL; - - for (pa = re->volume_precache_parts.first; pa; pa=pa->next) - { - if (pa->done==0 && pa->working==0) { - nextpa = pa; - break; - } - } - - return nextpa; -} - /* calculate resolution from bounding box in world space */ static int precache_resolution(Render *re, VolumePrecache *vp, ObjectInstanceRen *obi, int res) { @@ -678,14 +672,15 @@ static int precache_resolution(Render *re, VolumePrecache *vp, ObjectInstanceRen static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma) { VolumePrecache *vp; - VolPrecachePart *nextpa, *pa; + VolPrecachePart *pa; RayObject *tree; ShadeInput shi; ListBase threads; + VolPrecacheQueue queue; int parts[3] = {1, 1, 1}, totparts; - int caching=1, counter=0; - int totthread = re->r.threads; + int counter=0; + int totthread = re->r.threads, thread; double time, lasttime= PIL_check_seconds_timer(); @@ -718,34 +713,29 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o precache_init_parts(re, tree, &shi, obi, totthread, parts); totparts = parts[0] * parts[1] * parts[2]; + + /* setup work and done queues */ + queue.work = BLI_thread_queue_init(); + queue.done = BLI_thread_queue_init(); + BLI_thread_queue_nowait(queue.work); + + for(pa= re->volume_precache_parts.first; pa; pa= pa->next) + BLI_thread_queue_push(queue.work, pa); + /* launch threads */ BLI_init_threads(&threads, vol_precache_part, totthread); + + for(thread= 0; thread<totthread; thread++) + BLI_insert_thread(&threads, &queue); - while(caching) { + /* loop waiting for work to be done */ + while(counter < totparts) { + if(re->test_break && re->test_break(re->tbh)) + break; - if(BLI_available_threads(&threads) && !(re->test_break(re->tbh))) { - nextpa = precache_get_new_part(re); - if (nextpa) { - nextpa->working = 1; - BLI_insert_thread(&threads, nextpa); - } - } - else PIL_sleep_ms(50); + if(BLI_thread_queue_pop_timeout(queue.done, 50)) + counter++; - caching=0; - counter=0; - for(pa= re->volume_precache_parts.first; pa; pa= pa->next) { - - if(pa->done) { - counter++; - BLI_remove_thread(&threads, pa); - } else - caching = 1; - } - - if (re->test_break(re->tbh) && BLI_available_threads(&threads)==totthread) - caching=0; - time= PIL_check_seconds_timer(); if(time-lasttime>1.0) { char str[64]; @@ -757,7 +747,10 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o } } + /* free */ BLI_end_threads(&threads); + BLI_thread_queue_free(queue.work); + BLI_thread_queue_free(queue.done); BLI_freelistN(&re->volume_precache_parts); if(tree) { @@ -788,13 +781,22 @@ void volume_precache(Render *re) ObjectInstanceRen *obi; VolumeOb *vo; + re->i.infostr= "Volume preprocessing"; + re->stats_draw(re->sdh, &re->i); + for(vo= re->volumes.first; vo; vo= vo->next) { if (using_lightcache(vo->ma)) { for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->obr == vo->obr) { vol_precache_objectinstance_threads(re, obi, vo->ma); + + if(re->test_break && re->test_break(re->tbh)) + break; } } + + if(re->test_break && re->test_break(re->tbh)) + break; } } diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 9299b50103c..5beb07a1ed0 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -230,6 +230,7 @@ void WM_keymap_init(bContext *C) { wmWindowManager *wm= CTX_wm_manager(C); + /* create standard key configs */ if(!wm->defaultconf) wm->defaultconf= WM_keyconfig_new(wm, "Blender"); if(!wm->addonconf) @@ -237,10 +238,17 @@ void WM_keymap_init(bContext *C) if(!wm->userconf) wm->userconf= WM_keyconfig_new(wm, "Blender User"); + /* initialize only after python init is done, for keymaps that + use python operators */ if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) { - /* create default key config */ - wm_window_keymap(wm->defaultconf); - ED_spacetypes_keymap(wm->defaultconf); + /* create default key config, only initialize once, + it's persistent across sessions */ + if(!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) { + wm_window_keymap(wm->defaultconf); + ED_spacetypes_keymap(wm->defaultconf); + + wm->defaultconf->flag |= KEYCONF_INIT_DEFAULT; + } WM_keyconfig_update_tag(NULL, NULL); WM_keyconfig_update(wm); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index cfeaee18416..596fa35d597 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1223,41 +1223,47 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand retval= ot->modal(C, op, event); OPERATOR_RETVAL_CHECK(retval); - if(ot->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) - wm->op_undo_depth--; + /* when this is _not_ the case the modal modifier may have loaded + * a new blend file (demo mode does this), so we have to assume + * the event, operator etc have all been freed. - campbell */ + if(CTX_wm_manager(C) == wm) { - /* putting back screen context, reval can pass trough after modal failures! */ - if((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) { - CTX_wm_area_set(C, area); - CTX_wm_region_set(C, region); - } - else { - /* this special cases is for areas and regions that get removed */ - CTX_wm_area_set(C, NULL); - CTX_wm_region_set(C, NULL); - } + if(ot->flag & OPTYPE_UNDO) + wm->op_undo_depth--; - if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) - wm_operator_reports(C, op, retval, 0); - - if(retval & OPERATOR_FINISHED) { - wm_operator_finished(C, op, 0); - handler->op= NULL; - } - else if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) { - WM_operator_free(op); - handler->op= NULL; - } - - /* remove modal handler, operator itself should have been cancelled and freed */ - if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) { - WM_cursor_ungrab(CTX_wm_window(C)); + /* putting back screen context, reval can pass trough after modal failures! */ + if((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) { + CTX_wm_area_set(C, area); + CTX_wm_region_set(C, region); + } + else { + /* this special cases is for areas and regions that get removed */ + CTX_wm_area_set(C, NULL); + CTX_wm_region_set(C, NULL); + } - BLI_remlink(handlers, handler); - wm_event_free_handler(handler); - - /* prevent silly errors from operator users */ - //retval &= ~OPERATOR_PASS_THROUGH; + if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) + wm_operator_reports(C, op, retval, 0); + + if(retval & OPERATOR_FINISHED) { + wm_operator_finished(C, op, 0); + handler->op= NULL; + } + else if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) { + WM_operator_free(op); + handler->op= NULL; + } + + /* remove modal handler, operator itself should have been cancelled and freed */ + if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) { + WM_cursor_ungrab(CTX_wm_window(C)); + + BLI_remlink(handlers, handler); + wm_event_free_handler(handler); + + /* prevent silly errors from operator users */ + //retval &= ~OPERATOR_PASS_THROUGH; + } } } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index f862af6173a..76ebeaa9f21 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -226,13 +226,16 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist) oldwm= oldwmlist->first; wm= G.main->wm.first; - /* move addon key configuration to new wm, to preserve their keymaps */ - if(oldwm->addonconf) { - wm->addonconf= oldwm->addonconf; - BLI_remlink(&oldwm->keyconfigs, oldwm->addonconf); - oldwm->addonconf= NULL; - BLI_addtail(&wm->keyconfigs, wm->addonconf); - } + /* preserve key configurations in new wm, to preserve their keymaps */ + wm->keyconfigs= oldwm->keyconfigs; + wm->addonconf= oldwm->addonconf; + wm->defaultconf= oldwm->defaultconf; + wm->userconf= oldwm->userconf; + + oldwm->keyconfigs.first= oldwm->keyconfigs.last= NULL; + oldwm->addonconf= NULL; + oldwm->defaultconf= NULL; + oldwm->userconf= NULL; /* ensure making new keymaps and set space types */ wm->initialized= 0; @@ -286,7 +289,8 @@ static void wm_init_userdef(bContext *C) if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC; else G.f &= ~G_SCRIPT_AUTOEXEC; } - if(U.tempdir[0]) BLI_where_is_temp(btempdir, FILE_MAX, 1); + /* update tempdir from user preferences */ + BLI_where_is_temp(btempdir, FILE_MAX, 1); } @@ -850,14 +854,14 @@ void wm_autosave_location(char *filepath) * BLI_make_file_string will create string that has it most likely on C:\ * through get_default_root(). * If there is no C:\tmp autosave fails. */ - if (!BLI_exists(U.tempdir)) { + if (!BLI_exists(btempdir)) { savedir = BLI_get_folder_create(BLENDER_USER_AUTOSAVE, NULL); BLI_make_file_string("/", filepath, savedir, pidstr); return; } #endif - - BLI_make_file_string("/", filepath, U.tempdir, pidstr); + + BLI_make_file_string("/", filepath, btempdir, pidstr); } void WM_autosave_init(wmWindowManager *wm) @@ -915,7 +919,7 @@ void wm_autosave_delete(void) if(BLI_exists(filename)) { char str[FILE_MAXDIR+FILE_MAXFILE]; - BLI_make_file_string("/", str, U.tempdir, "quit.blend"); + BLI_make_file_string("/", str, btempdir, "quit.blend"); /* if global undo; remove tempsave, otherwise rename */ if(U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, 0, 0); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 296cd1b86d8..4639e2a0514 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -428,6 +428,8 @@ void WM_exit_ext(bContext *C, const short do_python) * the pyDriver bug can be fixed if it happens again we can deal with it then */ BPY_python_end(); } +#else + (void)do_python; #endif GPU_global_buffer_pool_free(); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 841198c0664..b980b45bae4 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1208,9 +1208,6 @@ static int wm_resource_check_prev(void) static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(arg)) { - extern char datatoc_splash_png[]; - extern int datatoc_splash_png_size; - uiBlock *block; uiBut *but; uiLayout *layout, *split, *col; @@ -1219,9 +1216,17 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar int i; MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE); char url[96]; - /* hardcoded to splash, loading and freeing every draw, eek! */ + +#ifndef WITH_HEADLESS + extern char datatoc_splash_png[]; + extern int datatoc_splash_png_size; + ImBuf *ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect); - +#else + ImBuf *ibuf= NULL; +#endif + + #ifdef WITH_BUILDINFO int ver_width, rev_width; char *version_str = NULL; diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp index 5747d8641d0..0ee1ca20234 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp +++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp @@ -518,7 +518,7 @@ void KX_NavMeshObject::DrawNavMesh(NavMeshRenderMode renderMode) else v = m_navMesh->getDetailVertex(pd->vbase+(t[k]-p->nv)); float pos[3]; - vcopy(pos, v); + rcVcopy(pos, v); flipAxes(pos); tri[k].setValue(pos); } diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index a0a2e148c1e..1edecdf44d2 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -325,9 +325,9 @@ inline float vdot2(const float* a, const float* b) static bool barDistSqPointToTri(const float* p, const float* a, const float* b, const float* c) { float v0[3], v1[3], v2[3]; - vsub(v0, c,a); - vsub(v1, b,a); - vsub(v2, p,a); + rcVsub(v0, c,a); + rcVsub(v1, b,a); + rcVsub(v2, p,a); const float dot00 = vdot2(v0, v0); const float dot01 = vdot2(v0, v1); |