Marge with trunk: svn merge -r 12050:12057 https://svn.blender.org/svnroot/bf-blender...
authorDaniel Genrich <daniel.genrich@gmx.net>
Mon, 17 Sep 2007 11:10:23 +0000 (11:10 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Mon, 17 Sep 2007 11:10:23 +0000 (11:10 +0000)
22 files changed:
intern/elbeem/SConscript
intern/elbeem/intern/attributes.cpp
intern/elbeem/intern/paraloop.h
intern/elbeem/intern/paraloopend.h
intern/elbeem/intern/paraloopstart.h
intern/elbeem/intern/particletracer.cpp
source/blender/imbuf/intern/thumbs.c
source/blender/python/BPY_interface.c
source/blender/python/api2_2x/Mesh.c
source/blender/python/api2_2x/Noise.c
source/blender/python/api2_2x/Pose.c
source/blender/python/api2_2x/bpy_data.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/texture.c
source/blender/src/buttons_scene.c
source/blender/src/buttons_shading.c
source/blender/src/editmesh_mods.c
source/blender/src/editnla.c
source/blender/src/editscreen.c
source/blender/src/filelist.c
source/blender/src/transform.c
source/blender/src/transform_generics.c

index bb6637ba32d1109cf2cd431cb6edbe3eba1b5a85..75d9b98c82a4360af85b839b722f723e47e2c1f4 100644 (file)
@@ -5,7 +5,7 @@ Import('env')
 
 sources = env.Glob('intern/*.cpp')
 
-defs = 'NOGUI ELBEEM_BLENDER=1'
+defs = 'PARALLEL NOGUI ELBEEM_BLENDER=1'
 if env['OURPLATFORM']=='win32-vc':
     defs += ' USE_MSVC6FIXES'
 incs = env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] + ' ' +env['BF_SDL_INC']
index 890d6e75c9ee75d8d918ab126a808c0648a22af9..8e337a92a4e61648629372332d84d488b4b3e4f2 100644 (file)
@@ -103,6 +103,7 @@ void AttributeList::readMat4Gfx(string name, ntlMat4Gfx defaultValue, string sou
 
 // set that a parameter can be given, and will be ignored...
 bool AttributeList::ignoreParameter(string name, string source) {
+       name=source=(""); // remove warning
        return false;
 }
                
index e8bef648a8ded9e12ec288ec48eaf9d9e8c5ff0e..fba0ae44b91583bab268b32e1716cdf5d239ac12 100644 (file)
@@ -32,7 +32,6 @@ mpParticles->addFullParticle( x ); } \
        { \
        jend = mLevel[mMaxRefine].lSizey-gridLoopBound; \
        } \
-       if(jstart<1) jstart = 1; \
        LbmFloat *ccel = NULL, *tcel = NULL; \
        CellFlagType *pFlagSrc=NULL, *pFlagDst=NULL; \
        if(mLevel[mMaxRefine].setCurr==1) { \
@@ -43,7 +42,7 @@ mpParticles->addFullParticle( x ); } \
        temp = id; /* dummy remove warning */ \
 } \
 
-
+// if(jstart<1) jstart = 1; 
 
 #define unused_GRID_REGION_END() \
 } /* main_region */  \
index 6ea636e8d23aada44b0ed6ed5eefaba5a517bcb3..889e29308182e8b720f91d09774dada618c56e2c 100644 (file)
@@ -3,9 +3,8 @@
        int i=0; 
        ADVANCE_POINTERS(2*gridLoopBound); 
 } /* j */ 
-       /* COMPRESSGRIDS!=1 */ 
 #pragma omp barrier 
-
+       /* COMPRESSGRIDS!=1 */ 
        /* int i=0;  */ 
        /* ADVANCE_POINTERS(mLevel[lev].lSizex*2);  */ 
 } /* all cell loop k,j,i */ 
index 9f13eb3207bc0228877283cd2397751da11e111d..e5940815dc808f77d9012672a8e5828b69532e68 100644 (file)
@@ -1,3 +1,3 @@
 
-#pragma omp parallel section num_threads(MAX_THREADS) \
-reduction(+: calcCurrentMass, calcCurrentVolume, calcCellsFilled, calcCellsEmptied, calcNumUsedCells)
+#pragma omp parallel num_threads(MAX_THREADS) \
+reduction(+: calcCurrentMass, calcCurrentVolume, calcCellsFilled, calcCellsEmptied, calcNumUsedCells) 
index c537a893c27248ce6f8d33fb7aa50206b752d6ef..c9da808543a0a9f8acc77430a9c71e43fa1f31f2 100644 (file)
@@ -325,6 +325,7 @@ void ParticleTracer::getTriangles(double time, vector<ntlTriangle> *triangles,
        // suppress warnings...
        vertices = NULL; triangles = NULL;
        normals = NULL; objectId = 0;
+       time = 0.0;
 #else // ELBEEM_PLUGIN
        int pcnt = 0;
        // currently not used in blender
index 944abb6968cf6586fe954facb01bd194a0acc938..c2e30b091c240193f4d3e82ddf6c9045aa1b70bf 100644 (file)
@@ -48,6 +48,7 @@
 #include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */
 #include "BLI_winstuff.h"
 #include <process.h> /* getpid */
+#include <direct.h> /* chdir */
 #else
 #include <unistd.h>
 #endif
@@ -64,8 +65,6 @@
 
 static int get_thumb_dir( char* dir , ThumbSize size)
 {
-       char* home;
-
 #ifdef WIN32
        /* yes, applications shouldn't store data there, but so does GIMP :)*/
        SHGetSpecialFolderPath(0, dir, CSIDL_PROFILE, 0);
@@ -120,7 +119,7 @@ static const unsigned char acceptable[96] = {
   0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x3F,0x20
 };
 
-static const char hex[16] = "0123456789abcdef";
+static const char hex[17] = "0123456789abcdef";
 
 /* Note: This escape function works on file: URIs, but if you want to
  * escape something else, please read RFC-2396 */
@@ -180,7 +179,7 @@ static int uri_from_filename( const char *dir, const char *file, char *uri )
                        return 0;
                }
                /* on windows, using always uppercase drive/volume letter in uri */
-               vol[0] = toupper(dir[0]);
+               vol[0] = (unsigned char)toupper(dir[0]);
                vol[1] = ':';
                vol[2] = '\0';
                strcat(orig_uri, vol);
index 2b723f2444d6ca82c407c063e9eb7a4d74a98332..97d9f221ab99ee35bde0fdbf19c6c246420bdbe8 100644 (file)
@@ -273,25 +273,32 @@ void BPY_end_python( void )
 
 void syspath_append( char *dirname )
 {
-       PyObject *mod_sys, *dict, *path, *dir;
-
+       PyObject *mod_sys= NULL, *dict= NULL, *path= NULL, *dir= NULL;
+       short ok=1;
        PyErr_Clear(  );
 
        dir = Py_BuildValue( "s", dirname );
 
        mod_sys = PyImport_ImportModule( "sys" );       /* new ref */
-       dict = PyModule_GetDict( mod_sys );     /* borrowed ref */
-       path = PyDict_GetItemString( dict, "path" );    /* borrowed ref */
-
-       if( !PyList_Check( path ) )
-               return;
+       
+       if (mod_sys) {
+               dict = PyModule_GetDict( mod_sys );     /* borrowed ref */
+               path = PyDict_GetItemString( dict, "path" );    /* borrowed ref */
+               if ( !PyList_Check( path ) ) {
+                       ok = 0;
+               }
+       } else {
+               /* cant get the sys module */
+               ok = 0;
+       }
 
-       PyList_Append( path, dir );
+       if (ok && PyList_Append( path, dir ) != 0)
+               ok = 0; /* append failed */
 
-       if( PyErr_Occurred(  ) )
-               Py_FatalError( "could not build sys.path" );
+       if( (ok==0) || PyErr_Occurred(  ) )
+               Py_FatalError( "could import or build sys.path, can't continue" );
 
-       Py_DECREF( mod_sys );
+       Py_XDECREF( mod_sys );
 }
 
 void init_syspath( int first_time )
index 6967b64da7216ba25e8b9aac47e931d3b6c7b0e9..d2cc1edf3c3cc480363c3f745447be1027338b23 100644 (file)
@@ -1345,8 +1345,8 @@ static PyObject *Mesh_getProperty_internal(CustomData *data, int eindex, PyObjec
 static PyObject *Mesh_setProperty_internal(CustomData *data, int eindex, PyObject *args)
 {
        CustomDataLayer *layer;
-       int i,index, type = -1;
-       float f;
+       int i = 0, index, type = -1;
+       float f = 0.0f;
        char *s=NULL, *name=NULL;
        MFloatProperty *pf;
        MIntProperty  *pi;
index 5253ea810b0ccda7245e3b9cad83ef250676799d..c1a41d46714f71cfc82ed12b71bd465c4f0aeb52 100644 (file)
@@ -199,7 +199,7 @@ static PyObject *Noise_random( PyObject * self )
 
 static PyObject *Noise_randuvec( PyObject * self )
 {
-       float v[3];
+       float v[3] = {0.0f, 0.0f, 0.0f};
        randuvec( v );
        return Py_BuildValue( "[fff]", v[0], v[1], v[2] );
 }
index ed25c15c9f592f64e18e3ce8e556a376326f5e00..47ae96b2286939533027f1fcde99431ced7f2f66 100644 (file)
@@ -693,9 +693,12 @@ static int PoseBone_setLocalMatrix(BPy_PoseBone *self, PyObject *value, void *cl
        }
 
        //get loc
-       if (matsize == 4){
+       if (matsize == 4) {
                VECCOPY(loc, matrix->matrix[3]);
        }
+       else {
+               loc[0]= loc[1]= loc[2]= 0.0f;
+       }
 
        //copy new attributes
        VECCOPY(self->posechannel->size, size);
index b775c0a82363153489591cd39a682f1fdb7749ed..edb894bd982a73564f25958cb407d0149dab5884 100644 (file)
@@ -407,7 +407,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
                static char *kwlist[] = {"name", "filename", NULL};
                
                if(PyArg_ParseTupleAndKeywords(args, kwd, "|ss", kwlist, &name, &filename) && filename ) {
-                       PyObject *ret;
+                       PyObject *ret= NULL;
                        
                        if (strlen(filename) > FILE_MAXDIR + FILE_MAXFILE - 1)
                                        return ( EXPP_ReturnPyObjError( PyExc_IOError,
index 40f5dcc54f6f1d0821d9115be85b33a5d7e4ce9f..03f5fb03fea3009695fd719d949c32ad0cf6ef0a 100644 (file)
@@ -850,21 +850,6 @@ static int adaptive_sample_variance(int samples, float *col, float *colsq, float
                return 0;
 }
 
-static int adaptive_sample_contrast(int samples, float *prevcol, float *curcol, float thresh)
-{
-       /* if the last sample's contribution to the total  colour was below a small threshold
-        * (i.e. the samples taken are very similar), then taking more samples that are probably 
-        * going to be the same is wasting effort */
-       if ( (fabs( prevcol[0]/(float)(samples-1) - curcol[0]/(float)(samples) ) < thresh) &&
-               (fabs( prevcol[1]/(float)(samples-1) - curcol[1]/(float)(samples) ) < thresh) &&
-               (fabs( prevcol[2]/(float)(samples-1) - curcol[2]/(float)(samples) ) < thresh) ) 
-       {
-               return 1;
-       }
-       else
-               return 0;
-}
-
 static int adaptive_sample_contrast_val(int samples, float prev, float val, float thresh)
 {
        /* if the last sample's contribution to the total value was below a small threshold
index 814309e9e31aeb15a8b869710b77d625b8e35a51..8c366593034e879c3bb02bbec434794f87a7f28e 100644 (file)
@@ -1390,7 +1390,7 @@ void do_material_tex(ShadeInput *shi)
        TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
        float *co = NULL, *dx = NULL, *dy = NULL;
        float fact, facm, factt, facmm, stencilTin=1.0;
-       float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3], warpvec[3], Tnor=1.0;
+       float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3], warpvec[3]={0.0f, 0.0f, 0.0f}, Tnor=1.0;
        int tex_nr, rgbnor= 0, warpdone=0;
 
        if (R.r.scemode & R_NO_TEX) return;
index 561e4e458f580f8a7bad7f80091d3a2d704a7091..f9e94a6be375c5de9ae54b40a01f15dfa3021a35 100644 (file)
@@ -1636,7 +1636,7 @@ static void render_panel_format(void)
        uiBlockEndAlign(block);
 }
 
-
+#ifndef DISABLE_YAFRAY /* disable yafray stuff */
 /* yafray: global illumination options panel */
 static void render_panel_yafrayGI()
 {
@@ -1739,7 +1739,7 @@ static void render_panel_yafrayGlobal()
                uiDefButF(block, NUMSLI, B_DIFF, "Thr ", 160,90,150,20, &G.scene->r.YF_AAthreshold, 0.000001, 1.0, 0, 0, "AA threshold");
        }
 }
-
+#endif /* disable yafray stuff */
 
 static void layer_copy_func(void *lay_v, void *lay_p)
 {
index b11e3bc006dc1d28fc24d683a6fe249cb74879cb..a26ef722a1056871a0c6581368a2edf60d2d6a88 100644 (file)
@@ -4023,9 +4023,10 @@ void material_panels()
 void lamp_panels()
 {
        Object *ob= OBACT;
-       Lamp *la = ob->data;
+       Lamp *la;
        
        if(ob==NULL || ob->type!= OB_LAMP) return;
+       la= ob->data;
 
        lamp_panel_preview(ob, ob->data);
        lamp_panel_lamp(ob, ob->data);
@@ -4038,14 +4039,13 @@ void lamp_panels()
                lamp_panel_spot(ob, ob->data);
        else {
                /* init vars */
-               Lamp* lp = ob->data;
-               if (lp->YF_numphotons==0) lp->YF_numphotons=1000;
-               if (lp->YF_numsearch==0) lp->YF_numsearch=10;
-               if (lp->YF_phdepth==0) lp->YF_phdepth=1;
-               if (lp->YF_causticblur==0.0) lp->YF_causticblur=0.001;
-               if (lp->YF_bufsize==0) lp->YF_bufsize=128;
+               if (la->YF_numphotons==0) la->YF_numphotons=1000;
+               if (la->YF_numsearch==0) la->YF_numsearch=10;
+               if (la->YF_phdepth==0) la->YF_phdepth=1;
+               if (la->YF_causticblur==0.0) la->YF_causticblur=0.001;
+               if (la->YF_bufsize==0) la->YF_bufsize=128;
                /* spherelight radius default is zero, so nothing to do */
-               lamp_panel_yafray(ob, lp);
+               lamp_panel_yafray(ob, la);
        }
        lamp_panel_texture(ob, ob->data);
        lamp_panel_mapto(ob, ob->data);
index ffe4bc61764419d659cc2199284c1dc4f91929b6..c117fd514d77148b499e360eba443b3652058f02 100644 (file)
@@ -1538,7 +1538,7 @@ void mesh_copy_menu(void)
                                error("mesh has no color layers");
                                return;
                        } else {
-                               /* guess teh 4th color if needs be */
+                               /* guess the 4th color if needs be */
                                float val =- 1;
                                
                                if (!efa_act->v4) {
index 2233db6e3461922b585650d1cb5bcbb9f6684742..9115665afa0420b5084fe838db355401f61f56f6 100644 (file)
@@ -980,7 +980,7 @@ void transform_nlachannel_keys(int mode, int dummy)
        bActionChannel *chan;
        bActionStrip *strip;
        bConstraintChannel *conchan;
-       float   sval[2], cval[2], lastcval[2];
+       float   sval[2], cval[2], lastcval[2]= {0.0f, 0.0f};
        float   fac=0.0F;
        float   deltax, startx;
        int i;
@@ -1077,7 +1077,7 @@ void transform_nlachannel_keys(int mode, int dummy)
                                for (chan=base->object->action->chanbase.first; chan; chan=chan->next){
                                        if (EDITABLE_ACHAN(chan)) {
                                                tvtot=add_trans_ipo_keys(chan->ipo, tv, tvtot);
-
+                                               
                                                /* Manipulate action constraint ipos */
                                                if (EXPANDED_ACHAN(chan) && FILTER_CON_ACHAN(chan)) {
                                                        for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) {
index b877915b1d6fe35af805f8286acfb405f3f3f607..9ae46998cbc6f3e8cd5ed3e9034f68b8e6a2ccff 100644 (file)
@@ -3074,7 +3074,7 @@ static void splitarea_interactive(ScrArea *area, ScrEdge *onedge)
        ScrArea *scr, *sa= area;
        float fac= 0.0;
        unsigned short event;
-       short ok= 0, val, split = 0, mval[2], mvalo[2], first= 1;
+       short ok= 0, val, split = 0, mval[2], mvalo[2]= {-1, -1}, first= 1;
        char dir;
        
        if(sa->win==0) return;
index 95bce704d3c70df12be32770a090acd41ddfff7d..23a5e73f7cdc4c63dedb6f3ccb0a16e76d4d829c 100644 (file)
@@ -265,9 +265,7 @@ static int compare_extension(const void *a1, const void *a2) {
 
 void BIF_filelist_filter(FileList* filelist)
 {
-       int num_files = 0;
        int num_filtered = 0;
-       struct direntry *old_filelist;
        int i, j;
 
        if (!filelist->filelist)
@@ -483,7 +481,7 @@ void BIF_filelist_loadimage(struct FileList* filelist, int index)
                                        scaledy =  ( (float)imb->y/(float)imb->x )*imgwidth;
                                }
                                else {
-                                       scaledy = imgheight;
+                                       scaledy = (float)imgheight;
                                        scaledx =  ( (float)imb->x/(float)imb->y )*imgheight;
                                }
                                ex = (short)scaledx;
@@ -561,7 +559,7 @@ int BIF_filelist_find(struct FileList* filelist, char *file)
        int fidx = -1;
        
        if (!filelist->fidx) 
-               return;
+               return fidx;
 
        
        for (i = 0; i < filelist->numfiles; ++i) {
index b3814831ddf9551f7329d0dfd26f7f8eaa6caea6..e8512d08d04027bc2adb09428b8082a66e8cad10 100644 (file)
@@ -1972,6 +1972,9 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
        if (t->around == V3D_LOCAL) {
                VECCOPY(center, t->center);
        }
+       else {
+               center[0] = center[1] = center[2] = 0.0f;
+       }
 
        VecRotToMat3(axis, angle, mat);
        
index ae65b1d9fa61af02dd8c79842f028492869a28be..9e8992b4e1e36f72e0c82c716cecc079d1359f9a 100644 (file)
@@ -140,7 +140,7 @@ void getViewVector(float coord[3], float vec[3])
 static void clipMirrorModifier(TransInfo *t, Object *ob)
 {
        ModifierData *md= ob->modifiers.first;
-       float tolerance[3];
+       float tolerance[3] = {0.0f, 0.0f, 0.0f};
        int axis = 0;
 
        for (; md; md=md->next) {