Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-07-26 00:59:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-26 00:59:09 +0400
commit1b142434055e2b56b23991f0c9d695b6d4f33390 (patch)
tree8689574221e0d98697af406292b0383c14fc0c3b /source
parentdff9dce1cdcb5250797f529456649510d2396096 (diff)
parent1c00eacca2b084d7189de33cb75e8612cb542030 (diff)
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20937:21899
missing commits from peter 20942, 21165, 21170, 21174, 21597 these files still need manual merging source/blender/makesdna/DNA_sequence_types.h source/blender/src/sequence.c source/blender/src/seqeffects.c source/blender/src/editseq.c source/blender/include/BSE_sequence.h
Diffstat (limited to 'source')
-rw-r--r--source/blender/avi/intern/avi.c7
-rw-r--r--source/blender/blenkernel/BKE_softbody.h4
-rw-r--r--source/blender/blenkernel/intern/mesh.c7
-rw-r--r--source/blender/blenkernel/intern/softbody.c63
-rw-r--r--source/blender/blenloader/intern/readfile.c3
-rw-r--r--source/blender/imbuf/intern/iris.c312
-rw-r--r--source/blender/imbuf/intern/util.c3
-rw-r--r--source/blender/makesdna/DNA_object_force.h16
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c44
-rw-r--r--source/blender/render/intern/source/shadeoutput.c8
-rw-r--r--source/blender/render/intern/source/texture.c42
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp9
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp58
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.h2
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.h1
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_BulletPhysicsController.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_MeshProxy.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp16
-rw-r--r--source/gameengine/PyDoc/API_intro.py2
-rw-r--r--source/gameengine/PyDoc/GameTypes.py7
21 files changed, 473 insertions, 137 deletions
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 386597c6d85..005c05dec1d 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -214,6 +214,7 @@ int AVI_is_avi (char *name) {
AviMovie movie;
AviMainHeader header;
AviBitmapInfoHeader bheader;
+ int movie_tracks = 0;
DEBUG("opening movie\n");
@@ -303,6 +304,7 @@ int AVI_is_avi (char *name) {
fclose(movie.fp);
return 0;
}
+ movie_tracks++;
}
movie.streams[temp].sh.Flags = GET_FCC (movie.fp);
@@ -394,7 +396,10 @@ int AVI_is_avi (char *name) {
MEM_freeN(movie.streams);
fclose(movie.fp);
- return 1;
+
+ /* at least one video track is needed */
+ return (movie_tracks != 0);
+
}
AviError AVI_open_movie (char *name, AviMovie *movie) {
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h
index 05a9bfb0ca9..971ac7a5f01 100644
--- a/source/blender/blenkernel/BKE_softbody.h
+++ b/source/blender/blenkernel/BKE_softbody.h
@@ -44,7 +44,9 @@ typedef struct BodyPoint {
float choke,choke2,frozen;
float colball;
short flag;
- char octantflag;
+ //char octantflag;
+ float mass;
+ float springweight;
} BodyPoint;
/* allocates and initializes general main data */
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 3facf975992..c7454d3b832 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -795,6 +795,8 @@ void nurbs_to_mesh(Object *ob)
dl= cu->disp.first;
while(dl) {
+ int smooth= dl->rt & CU_SMOOTH ? 1 : 0;
+
if(dl->type==DL_SEGM) {
startvert= vertcount;
a= dl->parts*dl->nr;
@@ -811,6 +813,7 @@ void nurbs_to_mesh(Object *ob)
for(b=1; b<dl->nr; b++) {
mface->v1= startvert+ofs+b-1;
mface->v2= startvert+ofs+b;
+ if(smooth) mface->flag |= ME_SMOOTH;
mface++;
}
}
@@ -835,6 +838,7 @@ void nurbs_to_mesh(Object *ob)
mface->v1= startvert+ofs+b;
if(b==dl->nr-1) mface->v2= startvert+ofs;
else mface->v2= startvert+ofs+b+1;
+ if(smooth) mface->flag |= ME_SMOOTH;
mface++;
}
}
@@ -860,6 +864,7 @@ void nurbs_to_mesh(Object *ob)
mface->v4= 0;
test_index_face(mface, NULL, 0, 3);
+ if(smooth) mface->flag |= ME_SMOOTH;
mface++;
index+= 3;
}
@@ -907,6 +912,8 @@ void nurbs_to_mesh(Object *ob)
mface->v4= p2;
mface->mat_nr= (unsigned char)dl->col;
test_index_face(mface, NULL, 0, 4);
+
+ if(smooth) mface->flag |= ME_SMOOTH;
mface++;
p4= p3;
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index bc6b487080c..fe63585ae1c 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -82,7 +82,7 @@ variables on the UI for now
#include "BKE_DerivedMesh.h"
#include "BKE_pointcache.h"
#include "BKE_modifier.h"
-
+#include "BKE_deform.h"
//XXX #include "BIF_editdeform.h"
//XXX #include "BIF_graphics.h"
#include "PIL_time.h"
@@ -2051,7 +2051,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo
BodyPoint *bp1,*bp2;
float dir[3],dvel[3];
- float distance,forcefactor,kd,absvel,projvel;
+ float distance,forcefactor,kd,absvel,projvel,kw;
int ia,ic;
/* prepare depending on which side of the spring we are on */
if (bpi == bs->v1){
@@ -2085,7 +2085,10 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo
forcefactor = iks/bs->len;
else
forcefactor = iks;
- forcefactor *= bs->strength;
+ kw = (bp1->springweight+bp2->springweight)/2.0f;
+ kw = kw * kw;
+ kw = kw * kw;
+ forcefactor *= bs->strength * kw;
Vec3PlusStVec(bp1->force,(bs->len - distance)*forcefactor,dir);
/* do bp1 <--> bp2 viscous */
@@ -2185,14 +2188,14 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
VecMidf(velcenter, bp->vec, obp->vec);
VecSubf(dvel,velcenter,bp->vec);
- VecMulf(dvel,sb->nodemass);
+ VecMulf(dvel,bp->mass);
Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
Vec3PlusStVec(bp->force,sb->balldamp,dvel);
/* exploit force(a,b) == -force(b,a) part2/2 */
VecSubf(dvel,velcenter,obp->vec);
- VecMulf(dvel,sb->nodemass);
+ VecMulf(dvel,bp->mass);
Vec3PlusStVec(obp->force,sb->balldamp,dvel);
Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
@@ -2237,7 +2240,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* gravitation */
if (sb){
float gravity = sb->grav * sb_grav_force_scale(ob);
- bp->force[2]-= gravity*sb->nodemass; /* individual mass of node here */
+ bp->force[2]-= gravity*bp->mass; /* individual mass of node here */
}
/* particle field & vortex */
@@ -2549,7 +2552,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
VecMidf(velcenter, bp->vec, obp->vec);
VecSubf(dvel,velcenter,bp->vec);
- VecMulf(dvel,sb->nodemass);
+ VecMulf(dvel,bp->mass);
Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
Vec3PlusStVec(bp->force,sb->balldamp,dvel);
@@ -2580,7 +2583,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* exploit force(a,b) == -force(b,a) part2/2 */
VecSubf(dvel,velcenter,obp->vec);
- VecMulf(dvel,sb->nodemass);
+ VecMulf(dvel,(bp->mass+obp->mass)/2.0f);
Vec3PlusStVec(obp->force,sb->balldamp,dvel);
Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
@@ -2640,8 +2643,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* gravitation */
- bp->force[2]-= gravity*sb->nodemass; /* individual mass of node here */
- //bp->force[1]-= gravity*sb->nodemass; /* individual mass of node here */
+ bp->force[2]-= gravity*bp->mass; /* individual mass of node here */
/* particle field & vortex */
@@ -2850,11 +2852,20 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f;
aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f;
+ /* old one with homogenous masses */
/* claim a minimum mass for vertex */
+ /*
if (sb->nodemass > 0.009999f) timeovermass = forcetime/sb->nodemass;
else timeovermass = forcetime/0.009999f;
+ */
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+/* now we have individual masses */
+/* claim a minimum mass for vertex */
+ if (bp->mass > 0.009999f) timeovermass = forcetime/bp->mass;
+ else timeovermass = forcetime/0.009999f;
+
+
if(bp->goal < SOFTGOALSNAP){
/* this makes t~ = t */
if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec);
@@ -3228,10 +3239,36 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
/* to proove the concept
this would enable per vertex *mass painting*
- strcpy(name,"SOFTMASS");
- error = get_scalar_from_named_vertexgroup(ob,name, a,&temp);
- if (!error) bp->mass = temp * ob->rangeofmass;
*/
+ /* first set the default */
+ bp->mass = sb->nodemass;
+
+ if (sb->namedVG_Mass[0])
+ {
+ int grp= get_named_vertexgroup_num (ob,sb->namedVG_Mass);
+ /* printf("VGN %s %d \n",sb->namedVG_Mass,grp); */
+ if(grp > -1){
+ get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->mass);
+ bp->mass = bp->mass * sb->nodemass;
+ /* printf("bp->mass %f \n",bp->mass); */
+
+ }
+ }
+ /* first set the default */
+ bp->springweight = 1.0f;
+
+ if (sb->namedVG_Spring_K[0])
+ {
+ int grp= get_named_vertexgroup_num (ob,sb->namedVG_Spring_K);
+ //printf("VGN %s %d \n",sb->namedVG_Spring_K,grp);
+ if(grp > -1){
+ get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->springweight);
+ //printf("bp->springweight %f \n",bp->springweight);
+
+ }
+ }
+
+
}
/* but we only optionally add body edge springs */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index afab6fe608f..7551d902ad8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4126,6 +4126,9 @@ static void direct_link_scene(FileData *fd, Scene *sce)
} else {
seq->strip->color_balance = 0;
}
+ if (seq->strip->color_balance) {
+ // seq->strip->color_balance->gui = 0; // XXX - peter, is this relevant in 2.5?
+ }
}
}
SEQ_END
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index aa3015812fc..7b8c383ddb9 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -104,7 +104,9 @@ static int writetab(FILE *outf, unsigned int *tab, int len);
static void readtab(FILE *inf, unsigned int *tab, int len);
static void expandrow(unsigned char *optr, unsigned char *iptr, int z);
+static void expandrow2(float *optr, unsigned char *iptr, int z);
static void interleaverow(unsigned char *lptr, unsigned char *cptr, int z, int n);
+static void interleaverow2(float *lptr, unsigned char *cptr, int z, int n);
static int compressrow(unsigned char *lbuf, unsigned char *rlebuf, int z, int cnt);
static void lumrow(unsigned char *rgbptr, unsigned char *lumptr, int n);
@@ -233,6 +235,7 @@ static void test_endian_zbuf(struct ImBuf *ibuf)
struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
{
unsigned int *base, *lptr = NULL;
+ float *fbase, *fptr = NULL;
unsigned int *zbase, *zptr;
unsigned char *rledat;
unsigned int *starttab, *lengthtab;
@@ -242,7 +245,6 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
int xsize, ysize, zsize;
int bpp, rle, cur, badorder;
ImBuf * ibuf;
- uchar * rect;
/*printf("new iris\n");*/
@@ -257,8 +259,8 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
rle = ISRLE(image.type);
bpp = BPP(image.type);
- if(bpp != 1 ) {
- fprintf(stderr,"longimagedata: image must have 1 byte per pix chan\n");
+ if(bpp != 1 && bpp != 2) {
+ fprintf(stderr,"longimagedata: image must have 1 or 2 byte per pix chan\n");
return(0);
}
@@ -273,6 +275,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
}
if (rle) {
+
tablen = ysize*zsize*sizeof(int);
starttab = (unsigned int *)malloc(tablen);
lengthtab = (unsigned int *)malloc(tablen);
@@ -280,7 +283,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
readtab(inf,starttab,tablen);
readtab(inf,lengthtab,tablen);
-
+
/* check data order */
cur = 0;
badorder = 0;
@@ -295,99 +298,201 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
if(badorder)
break;
}
-
- ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect, 0);
- if (ibuf->depth > 32) ibuf->depth = 32;
- base = ibuf->rect;
- zbase = (unsigned int *)ibuf->zbuf;
-
- if (badorder) {
- for(z=0; z<zsize; z++) {
+
+ if (bpp == 1) {
+
+ ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect, 0);
+ if (ibuf->depth > 32) ibuf->depth = 32;
+ base = ibuf->rect;
+ zbase = (unsigned int *)ibuf->zbuf;
+
+ if (badorder) {
+ for(z=0; z<zsize; z++) {
+ lptr = base;
+ for(y=0; y<ysize; y++) {
+ file_offset = starttab[y+z*ysize];
+
+ rledat = file_data + file_offset;
+ file_offset += lengthtab[y+z*ysize];
+
+ expandrow((uchar *)lptr, rledat, 3-z);
+ lptr += xsize;
+ }
+ }
+ } else {
lptr = base;
+ zptr = zbase;
for(y=0; y<ysize; y++) {
- file_offset = starttab[y+z*ysize];
-
- rledat = file_data + file_offset;
- file_offset += lengthtab[y+z*ysize];
-
- expandrow((uchar *)lptr, rledat, 3-z);
+
+ for(z=0; z<zsize; z++) {
+
+ file_offset = starttab[y+z*ysize];
+
+ rledat = file_data + file_offset;
+ file_offset += lengthtab[y+z*ysize];
+
+ if(z<4) expandrow((uchar *)lptr, rledat, 3-z);
+ else if(z<8) expandrow((uchar *)zptr, rledat, 7-z);
+ }
lptr += xsize;
+ zptr += xsize;
}
}
- }
- else {
- lptr = base;
- zptr = zbase;
- for(y=0; y<ysize; y++) {
+
+ } else { /* bpp == 2 */
+
+ ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat, 0);
+
+ fbase = ibuf->rect_float;
+
+ if (badorder) {
for(z=0; z<zsize; z++) {
-
- file_offset = starttab[y+z*ysize];
+ fptr = fbase;
+ for(y=0; y<ysize; y++) {
+ file_offset = starttab[y+z*ysize];
+
+ rledat = file_data + file_offset;
+ file_offset += lengthtab[y+z*ysize];
+
+ expandrow2(fptr, rledat, 3-z);
+ fptr += xsize * 4;
+ }
+ }
+ } else {
+ fptr = fbase;
- rledat = file_data + file_offset;
- file_offset += lengthtab[y+z*ysize];
-
- if(z<4) expandrow((uchar *)lptr, rledat, 3-z);
- else if(z<8) expandrow((uchar *)zptr, rledat, 7-z);
+ for(y=0; y<ysize; y++) {
+
+ for(z=0; z<zsize; z++) {
+
+ file_offset = starttab[y+z*ysize];
+
+ rledat = file_data + file_offset;
+ file_offset += lengthtab[y+z*ysize];
+
+ expandrow2(fptr, rledat, 3-z);
+
+ }
+ fptr += xsize * 4;
}
- lptr += xsize;
- zptr += xsize;
}
}
free(starttab);
- free(lengthtab);
- }
- else {
-
- ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect, 0);
- if (ibuf->depth > 32) ibuf->depth = 32;
+ free(lengthtab);
- base = ibuf->rect;
- zbase = (unsigned int *)ibuf->zbuf;
-
- file_offset = 512;
- rledat = file_data + file_offset;
-
- for(z = 0; z < zsize; z++) {
+ } else {
+ if (bpp == 1) {
+
+ ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect, 0);
+ if (ibuf->depth > 32) ibuf->depth = 32;
+
+ base = ibuf->rect;
+ zbase = (unsigned int *)ibuf->zbuf;
- if(z<4) lptr = base;
- else if(z<8) lptr= zbase;
+ file_offset = 512;
+ rledat = file_data + file_offset;
- for(y = 0; y < ysize; y++) {
+ for(z = 0; z < zsize; z++) {
+
+ if(z<4) lptr = base;
+ else if(z<8) lptr= zbase;
+
+ for(y = 0; y < ysize; y++) {
- interleaverow((uchar *)lptr, rledat, 3-z, xsize);
- rledat += xsize;
+ interleaverow((uchar *)lptr, rledat, 3-z, xsize);
+ rledat += xsize;
+
+ lptr += xsize;
+ }
+ }
+
+ } else { /* bpp == 2 */
+
+ ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat, 0);
+
+ fbase = ibuf->rect_float;
+
+ file_offset = 512;
+ rledat = file_data + file_offset;
+
+ for(z = 0; z < zsize; z++) {
+
+ fptr = fbase;
- lptr += xsize;
+ for(y = 0; y < ysize; y++) {
+
+ interleaverow2(fptr, rledat, 3-z, xsize);
+ rledat += xsize * 2;
+
+ fptr += xsize * 4;
+ }
}
+
}
}
- if (image.zsize == 1){
- rect = (uchar *) ibuf->rect;
- for (x = ibuf->x * ibuf->y; x > 0; x--) {
- rect[0] = 255;
- rect[1] = rect[2] = rect[3];
- rect += 4;
+
+ if (bpp == 1) {
+ uchar * rect;
+
+ if (image.zsize == 1){
+ rect = (uchar *) ibuf->rect;
+ for (x = ibuf->x * ibuf->y; x > 0; x--) {
+ rect[0] = 255;
+ rect[1] = rect[2] = rect[3];
+ rect += 4;
+ }
+ } else if (image.zsize == 2){
+ /* grayscale with alpha */
+ rect = (uchar *) ibuf->rect;
+ for (x = ibuf->x * ibuf->y; x > 0; x--) {
+ rect[0] = rect[2];
+ rect[1] = rect[2] = rect[3];
+ rect += 4;
+ }
+ } else if (image.zsize == 3){
+ /* add alpha */
+ rect = (uchar *) ibuf->rect;
+ for (x = ibuf->x * ibuf->y; x > 0; x--) {
+ rect[0] = 255;
+ rect += 4;
+ }
}
- } else if (image.zsize == 2){
- /* grayscale with alpha */
- rect = (uchar *) ibuf->rect;
- for (x = ibuf->x * ibuf->y; x > 0; x--) {
- rect[0] = rect[2];
- rect[1] = rect[2] = rect[3];
- rect += 4;
+
+ } else { /* bpp == 2 */
+
+ if (image.zsize == 1){
+ fbase = ibuf->rect_float;
+ for (x = ibuf->x * ibuf->y; x > 0; x--) {
+ fbase[0] = 1;
+ fbase[1] = fbase[2] = fbase[3];
+ fbase += 4;
+ }
+ } else if (image.zsize == 2){
+ /* grayscale with alpha */
+ fbase = ibuf->rect_float;
+ for (x = ibuf->x * ibuf->y; x > 0; x--) {
+ fbase[0] = fbase[2];
+ fbase[1] = fbase[2] = fbase[3];
+ fbase += 4;
+ }
+ } else if (image.zsize == 3){
+ /* add alpha */
+ fbase = ibuf->rect_float;
+ for (x = ibuf->x * ibuf->y; x > 0; x--) {
+ fbase[0] = 1;
+ fbase += 4;
+ }
}
- } else if (image.zsize == 3){
- /* add alpha */
- rect = (uchar *) ibuf->rect;
- for (x = ibuf->x * ibuf->y; x > 0; x--) {
- rect[0] = 255;
- rect += 4;
+
+ if (flags & IB_rect) {
+ IMB_rect_from_float(ibuf);
}
+
}
-
+
ibuf->ftype = IMAGIC;
if (flags & IB_ttob) IMB_flipy(ibuf);
@@ -412,6 +517,71 @@ static void interleaverow(unsigned char *lptr, unsigned char *cptr, int z, int n
}
}
+static void interleaverow2(float *lptr, unsigned char *cptr, int z, int n)
+{
+ lptr += z;
+ while(n--) {
+ *lptr = ((cptr[0]<<8) | (cptr[1]<<0)) / (float)0xFFFF;
+ cptr += 2;
+ lptr += 4;
+ }
+}
+
+static void expandrow2(float *optr, unsigned char *iptr, int z)
+{
+ unsigned short pixel, count;
+ float pixel_f;
+
+ optr += z;
+ while(1) {
+ pixel = (iptr[0]<<8) | (iptr[1]<<0);
+ iptr += 2;
+
+ if ( !(count = (pixel & 0x7f)) )
+ return;
+ if(pixel & 0x80) {
+ while(count>=8) {
+ optr[0*4] = ((iptr[0]<<8) | (iptr[1]<<0))/(float)0xFFFF;
+ optr[1*4] = ((iptr[2]<<8) | (iptr[3]<<0))/(float)0xFFFF;
+ optr[2*4] = ((iptr[4]<<8) | (iptr[5]<<0))/(float)0xFFFF;
+ optr[3*4] = ((iptr[6]<<8) | (iptr[7]<<0))/(float)0xFFFF;
+ optr[4*4] = ((iptr[8]<<8) | (iptr[9]<<0))/(float)0xFFFF;
+ optr[5*4] = ((iptr[10]<<8) | (iptr[11]<<0))/(float)0xFFFF;
+ optr[6*4] = ((iptr[12]<<8) | (iptr[13]<<0))/(float)0xFFFF;
+ optr[7*4] = ((iptr[14]<<8) | (iptr[15]<<0))/(float)0xFFFF;
+ optr += 8*4;
+ iptr += 8*2;
+ count -= 8;
+ }
+ while(count--) {
+ *optr = ((iptr[0]<<8) | (iptr[1]<<0))/(float)0xFFFF;
+ iptr+=2;
+ optr+=4;
+ }
+ } else {
+ pixel_f = ((iptr[0]<<8) | (iptr[1]<<0))/(float)0xFFFF;
+ iptr += 2;
+
+ while(count>=8) {
+ optr[0*4] = pixel_f;
+ optr[1*4] = pixel_f;
+ optr[2*4] = pixel_f;
+ optr[3*4] = pixel_f;
+ optr[4*4] = pixel_f;
+ optr[5*4] = pixel_f;
+ optr[6*4] = pixel_f;
+ optr[7*4] = pixel_f;
+ optr += 8*4;
+ count -= 8;
+ }
+ while(count--) {
+ *optr = pixel_f;
+ optr+=4;
+ }
+ }
+ }
+}
+
static void expandrow(unsigned char *optr, unsigned char *iptr, int z)
{
unsigned char pixel, count;
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index ffd5d3431af..26434583118 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -401,8 +401,6 @@ int imb_get_anim_type(char * name) {
if (ib_stat(name,&st) == -1) return(0);
if (((st.st_mode) & S_IFMT) != S_IFREG) return(0);
- if (isavi(name)) return (ANIM_AVI);
-
if (ismovie(name)) return (ANIM_MOVIE);
# ifdef WITH_QUICKTIME
if (isqtime(name)) return (ANIM_QTIME);
@@ -410,6 +408,7 @@ int imb_get_anim_type(char * name) {
# ifdef WITH_FFMPEG
if (isffmpeg(name)) return (ANIM_FFMPEG);
# endif
+ if (isavi(name)) return (ANIM_AVI);
#endif
#ifdef WITH_REDCODE
if (isredcode(name)) return (ANIM_REDCODE);
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index d640e37f48d..b5b33610bfe 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -165,12 +165,17 @@ typedef struct SoftBody {
int totpoint, totspring;
struct BodyPoint *bpoint; /* not saved in file */
struct BodySpring *bspring; /* not saved in file */
- float pad;
+ char pad;
+ char msg_lock;
+ short msg_value;
/* part of UI: */
/* general options */
float nodemass; /* softbody mass of *vertex* */
+ char namedVG_Mass[32]; /* along with it introduce mass painting
+ starting to fix old bug .. nastyness that VG are indexes
+ rather find them by name tag to find it -> jow20090613 */
float grav; /* softbody amount of gravitaion to apply */
float mediafrict; /* friction to env */
float rklimit; /* error limit for ODE solver */
@@ -183,13 +188,18 @@ typedef struct SoftBody {
float maxgoal;
float defgoal; /* default goal for vertices without vgroup */
short vertgroup; /* index starting at 1 */
+ char namedVG_Softgoal[32]; /* starting to fix old bug .. nastyness that VG are indexes
+ rather find them by name tag to find it -> jow20090613 */
short fuzzyness; /* */
/* springs */
float inspring; /* softbody inner springs */
float infrict; /* softbody inner springs friction */
-
+ char namedVG_Spring_K[32]; /* along with it introduce Spring_K painting
+ starting to fix old bug .. nastyness that VG are indexes
+ rather find them by name tag to find it -> jow20090613 */
+
/* baking */
int sfra, efra;
int interval;
@@ -291,7 +301,7 @@ typedef struct SoftBody {
#define OB_SB_FACECOLL 1024
#define OB_SB_EDGECOLL 2048
#define OB_SB_COLLFINAL 4096
-//#define OB_SB_PROTECT_CACHE 8192
+#define OB_SB_BIG_UI 8192
#define OB_SB_AERO_ANGLE 16384
/* sb->solverflags */
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c b/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c
index ae3e5875aae..0a46b02e886 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c
@@ -65,18 +65,48 @@ static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float thr
for(x=0; x<sx; x++, out+=4, uv+=3, uvnext+=3, uvprev+=3) {
if(x>0 && x<sx-1 && y>0 && y<sy-1) {
if(uv[2]!=0.0f) {
+ float uv_l, uv_r;
/* adaptive sampling, red (U) channel */
- dx= 0.5f*(fabs(uv[0]-uv[-3]) + fabs(uv[0]-uv[3]));
- dx+= 0.25f*(fabs(uv[0]-uvprev[-3]) + fabs(uv[0]-uvnext[-3]));
- dx+= 0.25f*(fabs(uv[0]-uvprev[+3]) + fabs(uv[0]-uvnext[+3]));
+ /* prevent alpha zero UVs to be used */
+ uv_l= uv[-1]!=0.0f? fabs(uv[0]-uv[-3]) : 0.0f;
+ uv_r= uv[ 5]!=0.0f? fabs(uv[0]-uv[ 3]) : 0.0f;
+
+ //dx= 0.5f*(fabs(uv[0]-uv[-3]) + fabs(uv[0]-uv[3]));
+ dx= 0.5f*(uv_l + uv_r);
+
+ uv_l= uvprev[-1]!=0.0f? fabs(uv[0]-uvprev[-3]) : 0.0f;
+ uv_r= uvnext[-1]!=0.0f? fabs(uv[0]-uvnext[-3]) : 0.0f;
+
+ //dx+= 0.25f*(fabs(uv[0]-uvprev[-3]) + fabs(uv[0]-uvnext[-3]));
+ dx+= 0.25f*(uv_l + uv_r);
+
+ uv_l= uvprev[ 5]!=0.0f? fabs(uv[0]-uvprev[+3]) : 0.0f;
+ uv_r= uvnext[ 5]!=0.0f? fabs(uv[0]-uvnext[+3]) : 0.0f;
+
+ //dx+= 0.25f*(fabs(uv[0]-uvprev[+3]) + fabs(uv[0]-uvnext[+3]));
+ dx+= 0.25f*(uv_l + uv_r);
/* adaptive sampling, green (V) channel */
- dy= 0.5f*(fabs(uv[1]-uv[-row+1]) + fabs(uv[1]-uv[row+1]));
-
- dy+= 0.25f*(fabs(uv[1]-uvprev[+1-3]) + fabs(uv[1]-uvnext[+1-3]));
- dy+= 0.25f*(fabs(uv[1]-uvprev[+1+3]) + fabs(uv[1]-uvnext[+1+3]));
+
+ uv_l= uv[-row+2]!=0.0f? fabs(uv[1]-uv[-row+1]) : 0.0f;
+ uv_r= uv[ row+2]!=0.0f? fabs(uv[1]-uv[ row+1]) : 0.0f;
+
+ //dy= 0.5f*(fabs(uv[1]-uv[-row+1]) + fabs(uv[1]-uv[row+1]));
+ dy= 0.5f*(uv_l + uv_r);
+
+ uv_l= uvprev[-1]!=0.0f? fabs(uv[1]-uvprev[+1-3]) : 0.0f;
+ uv_r= uvnext[-1]!=0.0f? fabs(uv[1]-uvnext[+1-3]) : 0.0f;
+
+ //dy+= 0.25f*(fabs(uv[1]-uvprev[+1-3]) + fabs(uv[1]-uvnext[+1-3]));
+ dy+= 0.25f*(uv_l + uv_r);
+
+ uv_l= uvprev[ 5]!=0.0f? fabs(uv[1]-uvprev[+1+3]) : 0.0f;
+ uv_r= uvnext[ 5]!=0.0f? fabs(uv[1]-uvnext[+1+3]) : 0.0f;
+
+ //dy+= 0.25f*(fabs(uv[1]-uvprev[+1+3]) + fabs(uv[1]-uvnext[+1+3]));
+ dy+= 0.25f*(uv_l + uv_r);
/* UV to alpha threshold */
alpha= 1.0f - threshold*(dx+dy);
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 130cda9f107..2fbd93df0ce 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -61,12 +61,14 @@ extern struct Render R;
static ListBase *get_lights(ShadeInput *shi)
{
+ if(R.r.scemode & R_PREVIEWBUTS)
+ return &R.lights;
if(shi->light_override)
return &shi->light_override->gobject;
- else if(shi->mat && shi->mat->group)
+ if(shi->mat && shi->mat->group)
return &shi->mat->group->gobject;
- else
- return &R.lights;
+
+ return &R.lights;
}
#if 0
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 66175194048..bb491efdaba 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -2571,7 +2571,7 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef
TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
float *co = NULL, *dx = NULL, *dy = NULL, fact, stencilTin=1.0;
float texvec[3], dxt[3], dyt[3], tempvec[3];
- int tex_nr, rgb= 0;
+ int i, tex_nr, rgb= 0;
if (R.r.scemode & R_NO_TEX) return;
tex_nr= 0;
@@ -2647,21 +2647,33 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef
else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
if(shi->osatex) {
- if(mtex->projx) {
- dxt[0]= mtex->size[0]*dx[mtex->projx-1];
- dyt[0]= mtex->size[0]*dy[mtex->projx-1];
- }
- else dxt[0]= 0.0;
- if(mtex->projy) {
- dxt[1]= mtex->size[1]*dx[mtex->projy-1];
- dyt[1]= mtex->size[1]*dy[mtex->projy-1];
- }
- else dxt[1]= 0.0;
- if(mtex->projx) {
- dxt[2]= mtex->size[2]*dx[mtex->projz-1];
- dyt[2]= mtex->size[2]*dy[mtex->projz-1];
+ if (!dx) {
+ for(i=0;i<2;i++) {
+ dxt[i] = dyt[i] = 0.0;
+ }
+ } else {
+ if(mtex->projx) {
+ dxt[0]= mtex->size[0]*dx[mtex->projx-1];
+ dyt[0]= mtex->size[0]*dy[mtex->projx-1];
+ } else {
+ dxt[0]= 0.0;
+ dyt[0]= 0.0;
+ }
+ if(mtex->projy) {
+ dxt[1]= mtex->size[1]*dx[mtex->projy-1];
+ dyt[1]= mtex->size[1]*dy[mtex->projy-1];
+ } else {
+ dxt[1]= 0.0;
+ dyt[1]= 0.0;
+ }
+ if(mtex->projz) {
+ dxt[2]= mtex->size[2]*dx[mtex->projz-1];
+ dyt[2]= mtex->size[2]*dy[mtex->projz-1];
+ } else {
+ dxt[2]= 0.0;
+ dyt[2]= 0.0;
+ }
}
- else dxt[2]= 0.0;
}
/* texture */
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
index ffff7185fe4..8ed36e860b4 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
@@ -261,6 +261,12 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
// couldn't find something to cast the shadow on...
glMultMatrixd(oglmatrix);
}
+ else
+ { // we found the "ground", but the cast matrix doesn't take
+ // scaling in consideration, so we must apply the object scale
+ MT_Vector3 size = gameobj->GetSGNode()->GetLocalScale();
+ glScalef(size[0], size[1], size[2]);
+ }
} else
{
@@ -384,5 +390,4 @@ void KX_BlenderRenderTools::Update2DFilter(vector<STR_String>& propNames, void*
void KX_BlenderRenderTools::Render2DFilters(RAS_ICanvas* canvas)
{
m_filtermanager.RenderFilters(canvas);
-}
-
+} \ No newline at end of file
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index bed99a4f502..30055a717e3 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -805,6 +805,10 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) {
bPoseChannel *pchan;
+ if(m_userpose==NULL && m_pose==NULL) {
+ BL_ArmatureObject *obj = (BL_ArmatureObject*)GetParent();
+ obj->GetPose(&m_pose); /* Get the underlying pose from the armature */
+ }
// get_pose_channel accounts for NULL pose, run on both incase one exists but
// the channel doesnt
@@ -950,14 +954,18 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
obj->GetPose(&m_pose); /* Get the underlying pose from the armature */
if (!m_userpose) {
- obj->GetPose(&m_pose); /* Get the underlying pose from the armature */
+ if(!m_pose)
+ obj->GetPose(&m_pose); /* Get the underlying pose from the armature */
game_copy_pose(&m_userpose, m_pose);
}
- pchan= verify_pose_channel(m_userpose, string); // adds the channel if its not there.
+ // pchan= verify_pose_channel(m_userpose, string); // adds the channel if its not there.
+ pchan= get_pose_channel(m_userpose, string); // adds the channel if its not there.
- VECCOPY (pchan->loc, matrix[3]);
- Mat4ToSize(matrix, pchan->size);
- Mat4ToQuat(matrix, pchan->quat);
+ if(pchan) {
+ VECCOPY (pchan->loc, matrix[3]);
+ Mat4ToSize(matrix, pchan->size);
+ Mat4ToQuat(matrix, pchan->quat);
+ }
}
else {
MT_Vector3 loc;
@@ -969,15 +977,24 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
// same as above
if (!m_userpose) {
- obj->GetPose(&m_pose); /* Get the underlying pose from the armature */
+ if(!m_pose)
+ obj->GetPose(&m_pose); /* Get the underlying pose from the armature */
game_copy_pose(&m_userpose, m_pose);
}
- pchan= verify_pose_channel(m_userpose, string);
+ // pchan= verify_pose_channel(m_userpose, string);
+ pchan= get_pose_channel(m_userpose, string); // adds the channel if its not there.
// for some reason loc.setValue(pchan->loc) fails
- pchan->loc[0]= loc[0]; pchan->loc[1]= loc[1]; pchan->loc[2]= loc[2];
- pchan->size[0]= size[0]; pchan->size[1]= size[1]; pchan->size[2]= size[2];
- pchan->quat[0]= quat[3]; pchan->quat[1]= quat[0]; pchan->quat[2]= quat[1]; pchan->quat[3]= quat[2]; /* notice xyzw -> wxyz is intentional */
+ if(pchan) {
+ pchan->loc[0]= loc[0]; pchan->loc[1]= loc[1]; pchan->loc[2]= loc[2];
+ pchan->size[0]= size[0]; pchan->size[1]= size[1]; pchan->size[2]= size[2];
+ pchan->quat[0]= quat[3]; pchan->quat[1]= quat[0]; pchan->quat[2]= quat[1]; pchan->quat[3]= quat[2]; /* notice xyzw -> wxyz is intentional */
+ }
+ }
+
+ if(pchan==NULL) {
+ PyErr_SetString(PyExc_ValueError, "Channel could not be found, use the 'channelNames' attribute to get a list of valid channels");
+ return NULL;
}
pchan->flag |= POSE_ROT|POSE_LOC|POSE_SIZE;
@@ -1051,6 +1068,7 @@ PyAttributeDef BL_ActionActuator::Attributes[] = {
KX_PYATTRIBUTE_FLOAT_RW("frameEnd", 0, MAXFRAMEF, BL_ActionActuator, m_endframe),
KX_PYATTRIBUTE_FLOAT_RW("blendIn", 0, MAXFRAMEF, BL_ActionActuator, m_blendin),
KX_PYATTRIBUTE_RW_FUNCTION("action", BL_ActionActuator, pyattr_get_action, pyattr_set_action),
+ KX_PYATTRIBUTE_RO_FUNCTION("channelNames", BL_ActionActuator, pyattr_get_channel_names),
KX_PYATTRIBUTE_SHORT_RW("priority", 0, 100, false, BL_ActionActuator, m_priority),
KX_PYATTRIBUTE_FLOAT_RW_CHECK("frame", 0, MAXFRAMEF, BL_ActionActuator, m_localtime, CheckFrame),
KX_PYATTRIBUTE_STRING_RW("propName", 0, 31, false, BL_ActionActuator, m_propname),
@@ -1094,3 +1112,23 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF
return PY_SET_ATTR_SUCCESS;
}
+
+PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
+ PyObject *ret= PyList_New(0);
+ PyObject *item;
+
+ bPose *pose= ((BL_ArmatureObject*)self->GetParent())->GetOrigPose();
+
+ if(pose) {
+ bPoseChannel *pchan;
+ for(pchan= (bPoseChannel *)pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) {
+ item= PyUnicode_FromString(pchan->name);
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ }
+ }
+
+ return ret;
+}
diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h
index e328ce126ca..6003e23e315 100644
--- a/source/gameengine/Converter/BL_ActionActuator.h
+++ b/source/gameengine/Converter/BL_ActionActuator.h
@@ -114,7 +114,7 @@ public:
static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
-
+ static PyObject* pyattr_get_channel_names(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
/* attribute check */
static int CheckFrame(void *self, const PyAttributeDef*)
{
diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h
index e1e176840a6..684d89d492b 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.h
+++ b/source/gameengine/Converter/BL_ArmatureObject.h
@@ -60,6 +60,7 @@ public:
void GetMRDPose(struct bPose **pose);
void GetPose(struct bPose **pose);
void SetPose (struct bPose *pose);
+ struct bPose *GetOrigPose() {return m_pose;} // never edit this, only for accessing names
void ApplyPose();
void RestorePose();
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
index 7cb287d02b2..de820ddaaae 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
@@ -146,7 +146,7 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = {
KX_PYATTRIBUTE_STRING_RW("propName", 0, 100, false, KX_NetworkMessageActuator, m_toPropName),
KX_PYATTRIBUTE_STRING_RW("subject", 0, 100, false, KX_NetworkMessageActuator, m_subject),
KX_PYATTRIBUTE_BOOL_RW("usePropBody", KX_NetworkMessageActuator, m_bPropBody),
- KX_PYATTRIBUTE_STRING_RW("body", 0, 100, false, KX_NetworkMessageActuator, m_body),
+ KX_PYATTRIBUTE_STRING_RW("body", 0, 16384, false, KX_NetworkMessageActuator, m_body),
{ NULL } //Sentinel
};
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
index 748b0667061..db1595db36f 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
@@ -402,6 +402,8 @@ void KX_BulletPhysicsController::RestoreDynamics()
btRigidBody *body = GetRigidBody();
if (body && m_suspended)
{
+ // before make sure any position change that was done in this logic frame are accounted for
+ SetTransform();
GetPhysicsEnvironment()->updateCcdPhysicsController(this,
m_savedMass,
m_savedCollisionFlags,
diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp
index 96e8f61e4c8..606ba0e16c2 100644
--- a/source/gameengine/Ketsji/KX_MeshProxy.cpp
+++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp
@@ -328,7 +328,7 @@ bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none
KX_MeshProxy *kx_mesh = static_cast<KX_MeshProxy*>BGE_PROXY_REF(value);
/* sets the error */
- if (*object==NULL) {
+ if (kx_mesh==NULL) {
PyErr_Format(PyExc_SystemError, "%s, " BGE_PROXY_ERROR_MSG, error_prefix);
return false;
}
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 673f42283dd..39381182944 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -104,7 +104,8 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
// do nothing on negative events, otherwise sounds are played twice!
bool bNegativeEvent = IsNegativeEvent();
-
+ bool bPositiveEvent = m_posevent;
+
RemoveAllEvents();
if (!m_soundObject)
@@ -153,8 +154,17 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
// remember that we tried to stop the actuator
m_isplaying = false;
}
- else
- {
+
+#if 1
+ // Warning: when de-activating the actuator, after a single negative event this runs again with...
+ // m_posevent==false && m_posevent==false, in this case IsNegativeEvent() returns false
+ // and assumes this is a positive event.
+ // check that we actually have a positive event so as not to play sounds when being disabled.
+ else if(bPositiveEvent) { // <- added since 2.49
+#else
+ else { // <- works in most cases except a loop-end sound will never stop unless
+ // the negative pulse is done continuesly
+#endif
if (!m_isplaying)
{
switch (m_type)
diff --git a/source/gameengine/PyDoc/API_intro.py b/source/gameengine/PyDoc/API_intro.py
index 578b56eb2b0..0a687088627 100644
--- a/source/gameengine/PyDoc/API_intro.py
+++ b/source/gameengine/PyDoc/API_intro.py
@@ -24,7 +24,7 @@ The Blender Game Engine Python API Reference
Additional Modules:
-------------------
- These modules have no GameEngine spesific functionality but are useful in many cases.
+ These modules have no GameEngine specific functionality but are useful in many cases.
- L{Mathutils}
- L{Geometry}
diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py
index 63dd1a7fabf..35d8cd63c44 100644
--- a/source/gameengine/PyDoc/GameTypes.py
+++ b/source/gameengine/PyDoc/GameTypes.py
@@ -310,6 +310,8 @@ class BL_ActionActuator(SCA_IActuator):
@ivar action: The name of the action to set as the current action.
@type action: string
+ @ivar channelNames: A list of channel names that may be used with L{setChannel} and L{getChannel}
+ @type channelNames: list of strings
@ivar frameStart: Specifies the starting frame of the animation.
@type frameStart: float
@ivar frameEnd: Specifies the ending frame of the animation.
@@ -340,7 +342,8 @@ class BL_ActionActuator(SCA_IActuator):
"""
Alternative to the 2 arguments, 4 arguments (channel, matrix, loc, size, quat) are also supported.
- @param channel: A string specifying the name of the bone channel, created if missing.
+ @note: These values are relative to the bones rest position, currently the api has no way to get this info (which is annoying), but can be worked around by using bones with a rest pose that has no translation.
+ @param channel: A string specifying the name of the bone channel, error raised if not in L{channelNames}.
@type channel: string
@param matrix: A 4x4 matrix specifying the overriding transformation
as an offset from the bone's rest position.
@@ -349,7 +352,7 @@ class BL_ActionActuator(SCA_IActuator):
def getChannel(channel):
"""
- @param channel: A string specifying the name of the bone channel. error raised if missing.
+ @param channel: A string specifying the name of the bone channel. error raised if not in L{channelNames}.
@type channel: string
@rtype: tuple
@return: (loc, size, quat)