Revision: 16266
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16266
Author:   campbellbarton
Date:     2008-08-27 05:41:29 +0200 (Wed, 27 Aug 2008)

Log Message:
-----------
svn merge -r 16246:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/apricot/CMake/macros.cmake
    branches/apricot/source/Makefile
    branches/apricot/source/blender/blenkernel/intern/effect.c
    branches/apricot/source/blender/blenkernel/intern/particle.c
    branches/apricot/source/blender/blenkernel/intern/particle_system.c
    branches/apricot/source/blender/makesdna/DNA_actuator_types.h
    branches/apricot/source/blender/render/intern/source/convertblender.c
    branches/apricot/source/blender/src/buttons_logic.c
    branches/apricot/source/blender/src/gpencil.c
    branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp
    branches/apricot/source/gameengine/Converter/KX_ConvertSensors.cpp
    branches/apricot/source/gameengine/Expressions/PyObjectPlus.h
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
    branches/apricot/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
    branches/apricot/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
    branches/apricot/source/gameengine/Ketsji/Makefile
    branches/apricot/source/gameengine/Physics/Bullet/Makefile
    branches/apricot/source/gameengine/PyDoc/KX_GameObject.py
    branches/apricot/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py

Modified: branches/apricot/CMake/macros.cmake
===================================================================
--- branches/apricot/CMake/macros.cmake 2008-08-27 03:34:53 UTC (rev 16265)
+++ branches/apricot/CMake/macros.cmake 2008-08-27 03:41:29 UTC (rev 16266)
@@ -38,6 +38,8 @@
 ENDMACRO(BLENDERLIB)
 
 MACRO(SETUP_LIBDIRS)
+  # see "cmake --help-policy CMP0003"
+  CMAKE_POLICY(SET CMP0003 NEW)
   LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} 
${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} 
${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
   IF(WITH_INTERNATIONAL)
     LINK_DIRECTORIES(${GETTEXT_LIBPATH})

Modified: branches/apricot/source/Makefile
===================================================================
--- branches/apricot/source/Makefile    2008-08-27 03:34:53 UTC (rev 16265)
+++ branches/apricot/source/Makefile    2008-08-27 03:41:29 UTC (rev 16266)
@@ -251,6 +251,7 @@
 # but somehow it consistently fails to resolve these symbols... or 
 # can I just not check them? nm claims they aren't...
 SPLIB += 
$(OCGDIR)/blender/blenkernel/blenkernel_blc/$(DEBUG_DIR)libblenkernel_blc.a
+SPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
 
 # These three need to be explicitly mentioned on the cl, because 
 # if they are offered as a lib, they are optimized away. (nzc)

Modified: branches/apricot/source/blender/blenkernel/intern/effect.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/effect.c  2008-08-27 
03:34:53 UTC (rev 16265)
+++ branches/apricot/source/blender/blenkernel/intern/effect.c  2008-08-27 
03:41:29 UTC (rev 16266)
@@ -406,12 +406,15 @@
                        else
                                VecCopyf(mag_vec,vec_to_part);
 
+                       Normalize(mag_vec);
+
                        VecMulf(mag_vec,force_val*falloff);
                        VecAddf(field,field,mag_vec);
                        break;
 
                case PFIELD_VORTEX:
                        Crossf(mag_vec,eff_vel,vec_to_part);
+
                        Normalize(mag_vec);
 
                        VecMulf(mag_vec,force_val*distance*falloff);
@@ -425,6 +428,8 @@
                                /* magnetic field of a moving charge */
                                Crossf(temp,eff_vel,vec_to_part);
 
+                       Normalize(temp);
+
                        Crossf(temp2,velocity,temp);
                        VecAddf(mag_vec,mag_vec,temp2);
 
@@ -437,6 +442,8 @@
                        else
                                VecCopyf(mag_vec,vec_to_part);
 
+                       Normalize(mag_vec);
+
                        VecMulf(mag_vec,force_val*falloff);
                        VecSubf(field,field,mag_vec);
 
@@ -451,6 +458,8 @@
                        else
                                VecCopyf(mag_vec,vec_to_part);
 
+                       Normalize(mag_vec);
+
                        VecMulf(mag_vec,charge*force_val*falloff);
                        VecAddf(field,field,mag_vec);
                        break;
@@ -535,10 +544,6 @@
                where_is_object_time(ob,cur_time);
                        
                /* use center of object for distance calculus */
-               obloc= ob->obmat[3];
-               VECSUB(vect_to_vert, obloc, opco);
-               distance = VecLength(vect_to_vert);
-               
                VecSubf(vec_to_part, opco, ob->obmat[3]);
                distance = VecLength(vec_to_part);
 

Modified: branches/apricot/source/blender/blenkernel/intern/particle.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/particle.c        
2008-08-27 03:34:53 UTC (rev 16265)
+++ branches/apricot/source/blender/blenkernel/intern/particle.c        
2008-08-27 03:41:29 UTC (rev 16266)
@@ -379,8 +379,11 @@
 }
 /* free everything */
 void psys_free(Object *ob, ParticleSystem * psys)
-{
+{      
        if(psys){
+               int nr = 0;
+               ParticleSystem * tpsys;
+               
                if(ob->particlesystem.first == NULL && G.f & G_PARTICLEEDIT)
                        G.f &= ~G_PARTICLEEDIT;
 
@@ -406,6 +409,21 @@
 
                if(psys->effectors.first)
                        psys_end_effectors(psys);
+               
+               // check if we are last non-visible particle system
+               for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next){
+                       if(tpsys->part)
+                       {
+                               
if(ELEM(tpsys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
+                               {
+                                       nr++;
+                                       break;
+                               }
+                       }
+               }
+               // clear do-not-draw-flag
+               if(!nr)
+                       ob->transflag &= ~OB_DUPLIPARTS;
 
                if(psys->part){
                        psys->part->id.us--;            
@@ -417,7 +435,7 @@
 
                if(psys->pointcache)
                        BKE_ptcache_free(psys->pointcache);
-
+               
                MEM_freeN(psys);
        }
 }

Modified: branches/apricot/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/particle_system.c 
2008-08-27 03:34:53 UTC (rev 16265)
+++ branches/apricot/source/blender/blenkernel/intern/particle_system.c 
2008-08-27 03:41:29 UTC (rev 16266)
@@ -2301,7 +2301,15 @@
                        }
                }
                else if(pd->forcefield)
+               {
                        type |= PSYS_EC_EFFECTOR;
+                       
+                       if(pd->forcefield == PFIELD_WIND)
+                       {
+                               pd->rng = rng_new(1);
+                               rng_srandom(pd->rng, (unsigned 
int)(ceil(PIL_check_seconds_timer()))); // use better seed
+                       }
+               }
        }
        
        if(pd && pd->deflect)
@@ -2413,6 +2421,9 @@
 
                        if(ec->tree)
                                BLI_kdtree_free(ec->tree);
+                       
+                       if(ec->ob->pd && (ec->ob->pd->forcefield == 
PFIELD_WIND))
+                               rng_free(ec->ob->pd->rng);
                }
 
                BLI_freelistN(lb);

Modified: branches/apricot/source/blender/makesdna/DNA_actuator_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_actuator_types.h       
2008-08-27 03:34:53 UTC (rev 16265)
+++ branches/apricot/source/blender/makesdna/DNA_actuator_types.h       
2008-08-27 03:41:29 UTC (rev 16266)
@@ -81,7 +81,9 @@
        struct Mesh *me;
        char name[32];
        float linVelocity[3]; /* initial lin. velocity on creation */
-       short localflag; /* flag for the lin. vel: apply locally   */
+       float angVelocity[3]; /* initial ang. velocity on creation */
+       float pad;
+       short localflag; /* flag for the lin & ang. vel: apply locally   */
        short dyn_operation;
 } bEditObjectActuator;
 
@@ -384,6 +386,9 @@
 #define ACT_EDOB_TRACK_TO              3
 #define ACT_EDOB_DYNAMICS              4
 
+/* editObjectActuator->localflag */
+#define ACT_EDOB_LOCAL_LINV            2
+#define ACT_EDOB_LOCAL_ANGV            4
 
 
 /* editObjectActuator->flag */

Modified: branches/apricot/source/blender/render/intern/source/convertblender.c
===================================================================
--- branches/apricot/source/blender/render/intern/source/convertblender.c       
2008-08-27 03:34:53 UTC (rev 16265)
+++ branches/apricot/source/blender/render/intern/source/convertblender.c       
2008-08-27 03:41:29 UTC (rev 16266)
@@ -1565,7 +1565,7 @@
        float hasize, pa_size, pa_time, r_tilt, 
cfra=bsystem_time(ob,(float)CFRA,0.0);
        float adapt_angle=0.0, adapt_pix=0.0, random, simplify[2];
        int i, a, k, max_k=0, totpart, totuv=0, totcol=0, override_uv=-1, 
dosimplify = 0, dosurfacecache = 0;
-       int path_possible=0, keys_possible=0, baked_keys=0, 
totchild=psys->totchild;
+       int path_possible=0, keys_possible=0, baked_keys=0, totchild=0;
        int seed, path_nbr=0, path=0, orco1=0, adapt=0, uv[3]={0,0,0}, num;
        int totface, *origindex = 0;
        char **uv_name=0;
@@ -1573,6 +1573,8 @@
 /* 1. check that everything is ok & updated */
        if(psys==NULL)
                return 0;
+       
+       totchild=psys->totchild;
 
        part=psys->part;
        pars=psys->particles;

Modified: branches/apricot/source/blender/src/buttons_logic.c
===================================================================
--- branches/apricot/source/blender/src/buttons_logic.c 2008-08-27 03:34:53 UTC 
(rev 16265)
+++ branches/apricot/source/blender/src/buttons_logic.c 2008-08-27 03:41:29 UTC 
(rev 16266)
@@ -2022,7 +2022,7 @@
 
                if(eoa->type==ACT_EDOB_ADD_OBJECT) {
                        int wval; /* just a temp width */
-                       ysize = 72;
+                       ysize = 92;
                        glRects(xco, yco-ysize, xco+width, yco);
                        uiEmboss((float)xco, (float)yco-ysize, 
(float)xco+width, (float)yco, 1);
         
@@ -2042,9 +2042,27 @@
                        uiDefButF(block, NUM, 0, "",            xco+45+2*wval, 
yco-68, wval, 19,
                                         eoa->linVelocity+2, -100.0, 100.0, 10, 
0,
                                         "Velocity upon creation, z 
component.");
-                       uiDefButBitS(block, TOG, 2, 0, "L", xco+45+3*wval, 
yco-68, 15, 19,
+                       uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_LINV, 0, "L", 
xco+45+3*wval, yco-68, 15, 19,
                                         &eoa->localflag, 0.0, 0.0, 0, 0,
                                         "Apply the transformation locally");
+                       
+                       
+                       uiDefBut(block, LABEL, 0, "AngV",       xco,           
yco-90,   45, 19,
+                                        NULL, 0, 0, 0, 0,
+                                        "Angular velocity upon creation.");
+                       uiDefButF(block, NUM, 0, "",            xco+45,        
yco-90, wval, 19,
+                                        eoa->angVelocity, -10000.0, 10000.0, 
10, 0,
+                                        "Angular velocity upon creation, x 
component.");
+                       uiDefButF(block, NUM, 0, "",            xco+45+wval,   
yco-90, wval, 19,
+                                        eoa->angVelocity+1, -10000.0, 10000.0, 
10, 0,
+                                        "Angular velocity upon creation, y 
component.");
+                       uiDefButF(block, NUM, 0, "",            xco+45+2*wval, 
yco-90, wval, 19,
+                                        eoa->angVelocity+2, -10000.0, 10000.0, 
10, 0,
+                                        "Angular velocity upon creation, z 
component.");
+                       uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_ANGV, 0, "L", 
xco+45+3*wval, yco-90, 15, 19,
+                                        &eoa->localflag, 0.0, 0.0, 0, 0,
+                                        "Apply the rotation locally");
+                                        
 
                }
                else if(eoa->type==ACT_EDOB_END_OBJECT) {

Modified: branches/apricot/source/blender/src/gpencil.c
===================================================================
--- branches/apricot/source/blender/src/gpencil.c       2008-08-27 03:34:53 UTC 
(rev 16265)
+++ branches/apricot/source/blender/src/gpencil.c       2008-08-27 03:41:29 UTC 
(rev 16266)
@@ -1174,9 +1174,13 @@
                        
                        /* get coordinates */
                        if (gps->flag & GP_STROKE_3DSPACE) {
-                               project_short(&gps->points->x, xyval);
+                               project_short(&pt1->x, xyval);
                                x0= xyval[0];
                                y0= xyval[1];
+                               
+                               project_short(&pt2->x, xyval);
+                               x1= xyval[0];
+                               y1= xyval[1];
                        }
                        else if (gps->flag & GP_STROKE_2DSPACE) {
                                ipoco_to_areaco_noclip(p->v2d, &pt1->x, xyval);

Modified: branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp
===================================================================
--- branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp        
2008-08-27 03:34:53 UTC (rev 16265)
+++ branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp        
2008-08-27 03:41:29 UTC (rev 16266)
@@ -355,22 +355,26 @@
                                
                                if (soundActuatorType != 
KX_SoundActuator::KX_SOUNDACT_NODEF) 
                                {
-                                       SND_SoundObject* sndobj = NULL;
+                                       SND_Scene* soundscene = 
scene->GetSoundScene();
+                                       STR_String samplename = "";
+                                       bool sampleisloaded = false;
                                        
-                                       if (soundact->sound)
-                                       {
-                                               SND_Scene* soundscene = 
scene->GetSoundScene();
-                                               STR_String samplename = 
soundact->sound->name;
+                                       if (soundact->sound) {
+                                               /* Need to convert the 
samplename into absolute path
+                                                * before checking if its 
loaded */
+                                               char 
fullpath[sizeof(soundact->sound->name)];
                                                
-                                               bool sampleisloaded = false;

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to