svn merge -r 12691:12716 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorDaniel Genrich <daniel.genrich@gmx.net>
Thu, 29 Nov 2007 12:40:53 +0000 (12:40 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Thu, 29 Nov 2007 12:40:53 +0000 (12:40 +0000)
69 files changed:
projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj
projectfiles_vc7/blender/imbuf/BL_imbuf.vcproj
projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj
release/scripts/flt_export.py
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/bad_level_call_stubs/stubs.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/texture.c
source/blender/blenloader/intern/readfile.c
source/blender/include/BDR_editobject.h
source/blender/include/BIF_editdeform.h
source/blender/include/BIF_editparticle.h
source/blender/include/BSE_editipo.h
source/blender/include/blendef.h
source/blender/include/butspace.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_image_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_glare.c
source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c
source/blender/python/api2_2x/Blender.c
source/blender/python/api2_2x/Constraint.c
source/blender/python/api2_2x/Object.c
source/blender/python/api2_2x/doc/Blender.py
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/extern/include/RE_raytrace.h
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/raytrace.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/texture.c
source/blender/src/SConscript
source/blender/src/buttons_editing.c
source/blender/src/buttons_object.c
source/blender/src/buttons_scene.c
source/blender/src/buttons_shading.c
source/blender/src/drawipo.c
source/blender/src/drawmesh.c
source/blender/src/drawnode.c
source/blender/src/drawobject.c
source/blender/src/drawseq.c
source/blender/src/drawview.c
source/blender/src/editarmature.c
source/blender/src/editdeform.c
source/blender/src/editipo.c
source/blender/src/editkey.c
source/blender/src/editobject.c
source/blender/src/editparticle.c
source/blender/src/header_ipo.c
source/blender/src/meshlaplacian.c
source/blender/src/meshtools.c
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
tools/btools.py

index 8f473c85976599ee4e91c601481abe78c0bdf9c5..15614f52fdf951910af3e852065cddedb3419708 100644 (file)
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
                                PreprocessorDefinitions="_DEBUG,WIN32,_LIB,WITH_FREETYPE2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="1"
                        <Tool
                                Name="VCCLCompilerTool"
                                InlineFunctionExpansion="1"
-                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
                                PreprocessorDefinitions="NDEBUG,WIN32,_LIB,WITH_FREETYPE2,UNWRAPPER"
                                StringPooling="TRUE"
                                RuntimeLibrary="0"
                        <File
                                RelativePath="..\..\..\source\blender\blenkernel\BKE_packedFile.h">
                        </File>
+                       <File
+                               RelativePath="..\..\..\source\blender\blenkernel\BKE_particle.h">
+                       </File>
                        <File
                                RelativePath="..\..\..\source\blender\blenkernel\BKE_plugin_types.h">
                        </File>
index 0951c40d89184b3ccd9fb741a591a21f52b9d5a0..b42642c774f938cdb89d70e7663021b059033a48 100644 (file)
                        <File
                                RelativePath="..\..\..\source\blender\blenlib\intern\BLI_heap.c">
                        </File>
+                       <File
+                               RelativePath="..\..\..\source\blender\blenlib\intern\BLI_kdtree.c">
+                       </File>
                        <File
                                RelativePath="..\..\..\source\blender\blenlib\intern\BLI_linklist.c">
                        </File>
                        <File
                                RelativePath="..\..\..\source\blender\blenlib\BLI_jitter.h">
                        </File>
+                       <File
+                               RelativePath="..\..\..\source\blender\blenlib\BLI_kdtree.h">
+                       </File>
                        <File
                                RelativePath="..\..\..\source\blender\blenlib\BLI_linklist.h">
                        </File>
index b7518c0bc823d2a5dc102c82ae2439824e9b432e..b4daf386c26f7bfb154f37b88103d42d24669a5e 100644 (file)
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr"
-                               PreprocessorDefinitions="_DEBUG,WIN32,_LIB,WITH_QUICKTIME"
+                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
+                               PreprocessorDefinitions="_DEBUG,WIN32,_LIB,WITH_QUICKTIME,WITH_DDS"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="1"
                                DefaultCharIsUnsigned="TRUE"
                        <Tool
                                Name="VCCLCompilerTool"
                                InlineFunctionExpansion="1"
-                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr"
-                               PreprocessorDefinitions="NDEBUG,WIN32,_LIB,WITH_QUICKTIME"
+                               AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
+                               PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_DDS"
                                StringPooling="TRUE"
                                RuntimeLibrary="0"
                                EnableFunctionLevelLinking="TRUE"
index f8d88f8640edd528a07c0a2836cdf2c725ef3b16..20d787112d4cd3dd2817db4584ae749a86f08b48 100644 (file)
@@ -525,6 +525,9 @@ DNA_makesdna.exe dna.c
                        <File
                                RelativePath="..\..\..\source\blender\makesdna\DNA_packedFile_types.h">
                        </File>
+                       <File
+                               RelativePath="..\..\..\source\blender\makesdna\DNA_particle_types.h">
+                       </File>
                        <File
                                RelativePath="..\..\..\source\blender\makesdna\DNA_property_types.h">
                        </File>
index d2e90bc27b8cb6ef98cd6ea6c954b1818b2f1246..033a03f1163af10c777daf4cfa6aea9e400434f1 100644 (file)
@@ -1352,7 +1352,8 @@ def dbexport():
                                #Get original Blender file name
                                origpath = Blender.sys.expandpath(Blender.Image.Get(imgname).getFilename())
                                #copy original to new
-                               shutil.copyfile(origpath,tex_files[imgname])
+                               if os.path.exists(origpath):
+                                       shutil.copyfile(origpath,tex_files[imgname])
        
        #optional: Write attribute files
        if options.write_attrib_files:
index 5cd905d07ac7c8b74befef11ba63bb9e0958318c..075405b1097cf84abd3cf95ffbef9b135d9ee32d 100644 (file)
@@ -44,7 +44,7 @@ struct ListBase;
 struct MemFile;
 
 #define BLENDER_VERSION                        245
-#define BLENDER_SUBVERSION             8
+#define BLENDER_SUBVERSION             9
 
 #define BLENDER_MINVERSION             240
 #define BLENDER_MINSUBVERSION  0
index 2add4b9508006aa301f60f1adcc9e78e685ef6e0..0c93e4e32a2868433d3c35d79652d218fd3416d1 100644 (file)
@@ -57,6 +57,9 @@ struct ID *material_from(struct Object *ob, int act);
 void assign_material(struct Object *ob, struct Material *ma, int act);
 void new_material_to_objectdata(struct Object *ob);
 
+int find_material_index(struct Object *ob, struct Material *ma);
+
+
 void init_render_material(struct Material *, int, float *);
 void init_render_materials(int, float *);
 void end_render_material(struct Material *);
index 7e1aca3bb204eddb1002ff557894e520ad5231ba..55931b50462ae97a51aebb0e089edd1f3da80cc8 100644 (file)
@@ -262,7 +262,7 @@ void RE_FreeRender(Render *re) {}
 void RE_shade_external(Render *re, ShadeInput *shi, ShadeResult *shr) {}
 void RE_DataBase_GetView(Render *re, float mat[][4]) {}
 struct Render *RE_NewRender(const char *name) {return (struct Render *)NULL;}
-void RE_Database_Baking(struct Render *re, struct Scene *scene, int make_faces) {};
+void RE_Database_Baking(struct Render *re, struct Scene *scene, int type, struct Object *actob) {};
 
 
 /* node_composite.c */
index 59786afd999ebedb3571547cc8bd12c11967e32f..ab15770c3df6de06208867692ffd39dde32093df 100644 (file)
@@ -2083,6 +2083,9 @@ static void where_is_pose_bone(Object *ob, bPoseChannel *pchan, float ctime)
        if (pchan->constraints.first) {
                bConstraintOb *cob;
                
+               /* local constraints */
+               do_constraint_channels(&pchan->constraints, NULL, ctime, 0);
+               
                /* make a copy of location of PoseChannel for later */
                VECCOPY(vec, pchan->pose_mat[3]);
                
index 2dc488f83773875890e472f49abd36a603b8c17b..3d565c2a5a307c44238eafc73b5af5a1f59285eb 100644 (file)
@@ -142,9 +142,11 @@ bConstraintChannel *get_constraint_channel (ListBase *list, const char name[])
 {
        bConstraintChannel *chan;
 
-       for (chan = list->first; chan; chan=chan->next) {
-               if (!strcmp(name, chan->name)) {
-                       return chan;
+       if(list) {
+               for (chan = list->first; chan; chan=chan->next) {
+                       if (!strcmp(name, chan->name)) {
+                               return chan;
+                       }
                }
        }
        
@@ -175,17 +177,24 @@ bConstraintChannel *verify_constraint_channel (ListBase *list, const char name[]
 void do_constraint_channels (ListBase *conbase, ListBase *chanbase, float ctime, short onlydrivers)
 {
        bConstraint *con;
-       bConstraintChannel *chan;
-       IpoCurve *icu= NULL;
        
        /* for each Constraint, calculate its Influence from the corresponding ConstraintChannel */
        for (con=conbase->first; con; con=con->next) {
-               chan = get_constraint_channel(chanbase, con->name);
+               Ipo *ipo= NULL;
+               
+               if(con->flag & CONSTRAINT_OWN_IPO)
+                       ipo= con->ipo;
+               else {
+                       bConstraintChannel *chan = get_constraint_channel(chanbase, con->name);
+                       if(chan) ipo= chan->ipo;
+               }
                
-               if (chan && chan->ipo) {
-                       calc_ipo(chan->ipo, ctime);
+               if (ipo) {
+                       IpoCurve *icu;
+                       
+                       calc_ipo(ipo, ctime);
                        
-                       for (icu=chan->ipo->curve.first; icu; icu=icu->next) {
+                       for (icu=ipo->curve.first; icu; icu=icu->next) {
                                if (!onlydrivers || icu->driver) {
                                        switch (icu->adrcode) {
                                                case CO_ENFORCE:
index 924f544285ef3fc082b6a73547731120bb19e23a..1c5ec61a22e2b8fdb97d3119fcbe8946fca8297c 100644 (file)
@@ -2180,6 +2180,21 @@ void DAG_pose_sort(Object *ob)
                        ListBase targets = {NULL, NULL};
                        bConstraintTarget *ct;
                        
+                       if(con->ipo) {
+                               IpoCurve *icu;
+                               for(icu= con->ipo->curve.first; icu; icu= icu->next) {
+                                       if(icu->driver && icu->driver->ob==ob) {
+                                               bPoseChannel *target= get_pose_channel(ob->pose, icu->driver->name);
+                                               if(target) {
+                                                       node2 = dag_get_node(dag, target);
+                                                       dag_add_relation(dag, node2, node, 0);
+                                                       dag_add_parent_relation(dag, node2, node, 0);
+                                                       cti= NULL;      /* trick to get next loop skipped */
+                                               }
+                                       }
+                               }
+                       }
+                       
                        if (cti && cti->get_constraint_targets) {
                                cti->get_constraint_targets(con, &targets);
                                
index f410167c2ac2195d9eeaa829f20b3af86be2dee6..6248e01432eb0baefd6dab4eec456bbf531674a9 100644 (file)
@@ -296,7 +296,7 @@ static Render *fastshade_get_render(void)
        if(re==NULL) {
                re= RE_NewRender("_Shade View_");
        
-               RE_Database_Baking(re, G.scene, 0);     /* 0= no faces */
+               RE_Database_Baking(re, G.scene, 0, 0);  /* 0= no faces */
        }
        return re;
 }
index bb60c2218398ad3cbdb43ca203c08f89be09faa7..be63ce734beef0555190d162819dd0c364c68956 100644 (file)
@@ -1560,6 +1560,9 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
                        if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK))
                                ima->packedfile = newPackedFile(str);
                }
+               
+               if(ima->flag & IMA_DO_PREMUL)
+                       converttopremul(ibuf);
        }
        else
                ima->ok= 0;
index 49d3021090e821728d52937408d2a01a9a4b5352..0699e3b865516d055a26baec3677ca1a08d9ad1e 100644 (file)
@@ -581,6 +581,26 @@ void assign_material(Object *ob, Material *ma, int act)
        test_object_materials(ob->data);
 }
 
+int find_material_index(Object *ob, Material *ma)
+{
+       Material ***matarar;
+       short a, *totcolp;
+       
+       if(ma==NULL) return 0;
+       
+       totcolp= give_totcolp(ob);
+       matarar= give_matarar(ob);
+       
+       if(totcolp==NULL || matarar==NULL) return 0;
+       
+       for(a=0; a<*totcolp; a++)
+               if((*matarar)[a]==ma)
+                  break;
+       if(a<*totcolp)
+               return a+1;
+       return 0;          
+}
+
 void new_material_to_objectdata(Object *ob)
 {
        Material *ma;
@@ -609,7 +629,7 @@ void new_material_to_objectdata(Object *ob)
 static void do_init_render_material(Material *ma, int r_mode, float *amb)
 {
        MTex *mtex;
-       int a, needuv=0;
+       int a, needuv=0, needtang=0;
        
        if(ma->flarec==0) ma->flarec= 1;
 
@@ -633,8 +653,14 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb)
                        if(ma->texco & (TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM|TEXCO_STRAND|TEXCO_STRESS)) needuv= 1;
                        else if(ma->texco & (TEXCO_GLOB|TEXCO_UV|TEXCO_OBJECT|TEXCO_SPEED)) needuv= 1;
                        else if(ma->texco & (TEXCO_LAVECTOR|TEXCO_VIEW|TEXCO_STICKY)) needuv= 1;
+
+                       if((ma->mapto & MAP_NORM) && (mtex->normapspace == MTEX_NSPACE_TANGENT))
+                               needtang= 1;
                }
        }
+
+       if(needtang) ma->mode |= MA_NORMAP_TANG;
+       else ma->mode &= ~MA_NORMAP_TANG;
        
        if(r_mode & R_RADIO)
                if(ma->mode & MA_RADIO) needuv= 1;
index 4db6adce6f272d7d9844c5cd13f6447d4d3cac11..4fbe714d45c8c3e277e9e0186ee940d71d088489 100644 (file)
@@ -645,12 +645,12 @@ void psys_particle_on_dm(Object *ob, DerivedMesh *dm, int from, int index, int i
                /* this works for meshes with deform verts only - constructive modifiers wont work properly*/
                float temp1[3];
 
-               if(index >= dm->getNumFaces(dm)) {
-                       PARTICLE_ERROR(nor, vec);
-                       return;
-               }
-
                if(from == PART_FROM_VERT) {
+                       if(index >= dm->getNumVerts(dm)) {
+                               PARTICLE_ERROR(nor, vec);
+                               return;
+                       }
+       
                        dm->getVertCo(dm,index,vec);
                        if(nor){
                                dm->getVertNo(dm,index,nor);
@@ -658,10 +658,19 @@ void psys_particle_on_dm(Object *ob, DerivedMesh *dm, int from, int index, int i
                        }
                }
                else { /* PART_FROM_FACE / PART_FROM_VOLUME */
-                       MFace *mface=dm->getFaceData(dm,index,CD_MFACE);
+                       MFace *mface;
                        MTFace *mtface=0;
-                       MVert *mvert=dm->getVertDataArray(dm,CD_MVERT);
-                       int uv_index=CustomData_get_active_layer_index(&dm->faceData,CD_MTFACE);
+                       MVert *mvert;
+                       int uv_index;
+
+                       if(index >= dm->getNumFaces(dm)) {
+                               PARTICLE_ERROR(nor, vec);
+                               return;
+                       }
+                       
+                       mface=dm->getFaceData(dm,index,CD_MFACE);
+                       mvert=dm->getVertDataArray(dm,CD_MVERT);
+                       uv_index=CustomData_get_active_layer_index(&dm->faceData,CD_MTFACE);
 
                        if(uv_index>=0){
                                CustomDataLayer *layer=&dm->faceData.layers[uv_index];
@@ -1637,6 +1646,9 @@ void psys_cache_child_paths(Object *ob, ParticleSystem *psys, float cfra, int ed
                                else
                                        check_path_length(0,0,0,0,pa_length,0);
                        }
+
+                       if(part->draw & PART_DRAW_MAT_COL)
+                               VECCOPY(state->col, &ma->r)
                }
        }
        /* now let's finalise the interpolated parents that we might have left half done before */
@@ -1683,6 +1695,8 @@ void psys_cache_paths(Object *ob, ParticleSystem *psys, float cfra, int editupda
        SoftBody *soft = 0;
        BodyPoint *bp[2] = {NULL, NULL};
        
+       Material *ma;
+       
        float birthtime = 0.0, dietime = 0.0;
        float t, time, keytime, dfra = 1.0, frs_sec = G.scene->r.frs_sec;
        float col[3] = {0.5f, 0.5f, 0.5f};
@@ -1738,6 +1752,9 @@ void psys_cache_paths(Object *ob, ParticleSystem *psys, float cfra, int editupda
                soft = psys->soft;
        
        psys->lattice = psys_get_lattice(ob, psys);
+       ma= give_current_material(ob, psys->part->omat);
+       if(psys->part->draw & PART_DRAW_MAT_COL)
+               VECCOPY(col, &ma->r)
 
        /*---first main loop: create all actual particles' paths---*/
        for(i=0,pa=psys->particles; i<totpart; i++, pa++){
@@ -1922,7 +1939,6 @@ void psys_cache_paths(Object *ob, ParticleSystem *psys, float cfra, int editupda
 
                        }
 
-
                        /* selection coloring in edit mode */
                        if(edit){
                                if(pset->brushtype==PE_BRUSH_WEIGHT){
index aa9c489044aa0f343dabfedb43a709ab413a3977..ff7b429845d4ea16425175cecd251492c72ecb72 100644 (file)
@@ -206,6 +206,7 @@ Scene *add_scene(char *name)
        sce->r.bake_filter= 2;
        sce->r.bake_osa= 5;
        sce->r.bake_flag= R_BAKE_CLEAR;
+       sce->r.bake_normal_space= R_BAKE_SPACE_TANGENT;
        
        sce->r.xplay= 640;
        sce->r.yplay= 480;
index baa6fae6fc8396728f0dbf52390816a5cca9b19e..d4a085ff8bd8e5a234b5459a7383dd8b7a596dfe 100644 (file)
@@ -517,6 +517,7 @@ void default_mtex(MTex *mtex)
        mtex->norfac= 0.5;
        mtex->varfac= 1.0;
        mtex->dispfac=0.2;
+       mtex->normapspace= MTEX_NSPACE_TANGENT;
 }
 
 
index 35562a11db5b6e0ac14ef3bfdbc0278854872679..81ae152a17ccfbbeafda6345c1ed21d575065162 100644 (file)
@@ -1621,7 +1621,9 @@ static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist)
                if(con->data==NULL) {
                        con->type= CONSTRAINT_TYPE_NULL;
                }
-
+               /* own ipo, all constraints have it */
+               con->ipo= newlibadr(fd, id->lib, con->ipo);
+               
                switch (con->type) {
                case CONSTRAINT_TYPE_PYTHON:
                        {
@@ -2998,7 +3000,8 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
 
                        psmd->dm=0;
                        psmd->psys=newdataadr(fd, psmd->psys);
-                       psmd->flag|=eParticleSystemFlag_Loaded;
+                       psmd->flag |= eParticleSystemFlag_Loaded;
+                       psmd->flag &= ~eParticleSystemFlag_psys_updated;
                } else if (md->type==eModifierType_Explode) {
                        ExplodeModifierData *psmd = (ExplodeModifierData*) md;
 
@@ -7189,6 +7192,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                }
        }
+       if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 9)) {
+               Material *ma;
+               int a;
+
+               for(ma=main->mat.first; ma; ma= ma->id.next)
+                       if(ma->mode & MA_NORMAP_TANG)
+                               for(a=0; a<MAX_MTEX; a++)
+                                       if(ma->mtex[a] && ma->mtex[a]->tex)
+                                               ma->mtex[a]->normapspace = MTEX_NSPACE_TANGENT;
+       }
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
 
index 2fb0ad5aa88210fa0f84fadf1be4aabc2f957e73..51638b258b3a3a2435e6b50930b27fa2d4937b25 100644 (file)
@@ -119,6 +119,7 @@ void add_hook(void);
 void hook_select(struct HookModifierData *hmd);
 int hook_getIndexArray(int *tot, int **indexar, char *name, float *cent_r);
 
+int object_is_libdata(struct Object *ob);
 int object_data_is_libdata(struct Object *ob); 
 void hide_objects(int select);
 void show_objects(void);
index 2a8f43c14e75cce5fb568d89bceafd66ce611a0a..62b850f9094d38ce5e667c294bf461ceb9855624 100644 (file)
@@ -61,6 +61,8 @@ void add_vert_to_defgroup (struct Object *ob, struct bDeformGroup *dg,
                                                   int assignmode);
 void remove_vert_defgroup (struct Object *ob, struct bDeformGroup  *dg, 
                                                   int vertnum);
+float get_vert_defgroup        (struct Object *ob, struct bDeformGroup  *dg,
+                         int vertnum);
 void create_dverts(ID *id);
 
 void vertexgroup_select_by_name(struct Object *ob, char *name);
index 879bdf19cba81d43031c23fbcfccea7fbf916f19..d4c6a92b8c80e82dc4472e410936e00f52912123 100644 (file)
@@ -56,7 +56,7 @@ struct ParticleEditSettings *PE_settings(void);
 /* update calls */
 void PE_hide_keys_time(struct ParticleSystem *psys, float cfra);
 void PE_update_object(struct Object *ob, int useflag);
-void PE_update_selection(struct Object *ob);
+void PE_update_selection(struct Object *ob, int useflag);
 void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys);
 
 /* selection tools */
index 3dd54d0a5ed3a8e26918d4ff3eacb381dc866ad2..9e95eedc25e005a882eb037b2abeeef118b31410 100644 (file)
@@ -89,8 +89,8 @@ void do_ipo_selectbuttons(void);
 
 
 /* gets ipo curve, creates if needed */
-struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, int);
-struct Ipo *verify_ipo(struct ID *, short, char *, char *);
+struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, char *, int);
+struct Ipo *verify_ipo(struct ID *, short, char *, char *, char *);
 int texchannel_to_adrcode(int channel);
 
 int insert_bezt_icu(struct IpoCurve *icu, struct BezTriple *bezt);
index 4b5506dda309f908baf3b5a34294ba0e9103d508..55fa1fd884042a16db02e138665a29b98a6ff033 100644 (file)
 #define B_IPO_ACTION_KEY       214
 #define B_IPOVIEWCENTER                215
 #define B_IPOVIEWALL           216
-
+#define B_IPOREDRAW                    217
 
 /* OOPS: 250 */
 #define B_OOPSHOME             251
index 3666067ee2ce129bf379695586288e7ecf1b3966..a23ac48d7c24020448757f3b56c87cfeb0710132 100644 (file)
@@ -87,7 +87,6 @@ extern int mod_moveDown(void *ob_v, void *md_v);
 extern void const_moveUp(void *ob_v, void *con_v);
 extern void const_moveDown(void *ob_v, void *con_v);
 extern void del_constr_func (void *ob_v, void *con_v);
-extern void get_constraint_ipo_context(void *ob_v, char *actname);
 
 /* editing */
 extern void editing_panels(void);
@@ -378,6 +377,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
 #define B_DOCENTER             2015
 #define B_DOCENTERNEW          2016
 #define B_DOCENTERCURSOR       2017
+#define B_MATASS_BROWSE        2018
 
        /* 20 values! */
 #define B_OBLAY                        2019
@@ -389,6 +389,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
 #define B_PREVKEY              2045
 #define B_NEXTKEY              2046
 #define B_LOCKKEY              2047
+#define B_MATCOL2              2048
 
 #define B_MESHBUTS             2090
 
index bf512c3faf81e6bf7f2409eed85fca68a92e9dc2..72506b0eb57b8fea731d29255e70e1d8a7888c49 100644 (file)
@@ -41,6 +41,7 @@
 
 struct Action;
 struct Text;
+struct Ipo;
 
 /* channels reside in Object or Action (ListBase) constraintChannels */
 typedef struct bConstraintChannel {
@@ -66,6 +67,7 @@ typedef struct bConstraint {
        float           enforce;        /*      Amount of influence exherted by constraint (0.0-1.0) */
        float           headtail;       /*      Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail*/
        int                     pad;
+       struct Ipo *ipo;                /* local influence ipo or driver */
 } bConstraint;
 
 
@@ -347,7 +349,9 @@ typedef enum B_CONSTRAINT_FLAG {
                /* to indicate which Ipo should be shown, maybe for 3d access later too */      
        CONSTRAINT_ACTIVE =     (1<<4), 
                /* to indicate that the owner's space should only be changed into ownspace, but not out of it */
-       CONSTRAINT_SPACEONCE =  (1<<6)  
+       CONSTRAINT_SPACEONCE =  (1<<6),
+               /* influence ipo is on constraint itself, not in action channel */
+       CONSTRAINT_OWN_IPO      = (1<<7)
 } B_CONSTRAINT_FLAG;
 
 /* bConstraint->ownspace/tarspace */
index 8a5a7ce4a4c5293e49eae58cc9e4c05cfca1cfce..d5e4b7a11420bc844670300ab9e9f0ac0f560a52 100644 (file)
@@ -108,7 +108,7 @@ typedef struct Image {
 #define        IMA_REFLECT             16
 #define IMA_NOCOLLECT   32
 #define IMA_ANTIALI            64
-
+#define IMA_DO_PREMUL  128
 
 /* tpageflag */
 #define IMA_TILES                      1
index 1a1cb1c0f2bc91541cd4b33e914bd942248a75c7..f9418d1fc85fa2eff139083c779a727f448ce7df 100644 (file)
@@ -265,6 +265,8 @@ typedef struct RenderData {
        
        /* Bake Render options */
        short bake_osa, bake_filter, bake_mode, bake_flag;
+       short bake_normal_space, bpad;
+       float bake_maxdist;
        
        /* yafray: global panel params. TODO: move elsewhere */
        short GIquality, GIcache, GImethod, GIphotons, GIdirect;
@@ -605,8 +607,15 @@ typedef struct Scene {
 
 /* bake_mode: same as RE_BAKE_xxx defines */
 /* bake_flag: */
-#define R_BAKE_CLEAR   1
-#define R_BAKE_OSA             2
+#define R_BAKE_CLEAR           1
+#define R_BAKE_OSA                     2
+#define R_BAKE_TO_ACTIVE       4
+
+/* bake_normal_space */
+#define R_BAKE_SPACE_CAMERA     0
+#define R_BAKE_SPACE_WORLD      1
+#define R_BAKE_SPACE_OBJECT     2
+#define R_BAKE_SPACE_TANGENT 3
 
 /* **************** SCENE ********************* */
 #define RAD_PHASE_PATCHES      1
index 10f488c9f612347b921301996ed8f013eaccf9aa..2250e6e43abad9ad90b5584baf6dd0e57315ac3a 100644 (file)
@@ -94,7 +94,7 @@ typedef struct SpaceIpo {
        /* the ipo context we need to store */
        struct Ipo *ipo;
        struct ID *from;
-       char actname[32], constname[32];
+       char actname[32], constname[32], bonename[32];
 
        short totipo, pin;
        short butofs, channel;
index 2de6aba6b6fdaa213dd6bbe3f7af34595d966fc3..14ece2b31b293804d6148fe17db46df3b0f5cff2 100644 (file)
@@ -58,6 +58,7 @@ typedef struct MTex {
        float ofs[3], size[3];
        
        short texflag, colormodel, pmapto, pmaptoneg;
+       short normapspace, pad[3];
        float r, g, b, k;
        float def_var, rt;
        
@@ -157,7 +158,7 @@ typedef struct Tex {
        float cropxmin, cropymin, cropxmax, cropymax;
        short xrepeat, yrepeat;
        short extend;
-       
+
        /* variables disabled, moved to struct iuser */
        short fie_ima;
        int len;
@@ -319,6 +320,12 @@ typedef struct TexMapping {
 #define TEX_COL2               2
 #define TEX_COL3               3
 
+/* mtex->normapspace */
+#define MTEX_NSPACE_CAMERA     0
+#define MTEX_NSPACE_WORLD      1
+#define MTEX_NSPACE_OBJECT     2
+#define MTEX_NSPACE_TANGENT    3
+
 /* wrap */
 #define MTEX_FLAT              0
 #define MTEX_CUBE              1
index d836a8296966ae6436353f14827e954973be6332..6a40018e6592862900bc3e78fe0062ed7e5b8c52 100644 (file)
@@ -89,8 +89,8 @@ static void do_chroma_key(bNode *node, float *out, float *in)
        if(kfg>0.0) {  /* found a pixel that is within key color */
 
                newY=in[0]-(1-c->t3)*kfg;
-               newCb=in[1]-kfg*cosf(theta);
-               newCr=in[2]-kfg*sinf(theta);
+               newCb=in[1]-kfg*cos((double)theta);
+               newCr=in[2]-kfg*sin((double)theta);
                alpha=(kfg+c->fsize)*(c->fstrength);
 
                beta=atan2(newCr,newCb);
index 9943dd2246d5eacaf265b519a0672db91e6ec837..e7b8fd00c938275951b7cb1f14b732c7edc5724f 100644 (file)
@@ -244,12 +244,12 @@ static void streaks(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
        
        for (a=0.f; a<360.f; a+=ang) {
                const float an = (a + (float)ndg->angle_ofs)*(float)M_PI/180.f;
-               const float vx = cosf(an), vy = sinf(an);
+               const float vx = cos((double)an), vy = sin((double)an);
                for (n=0; n<ndg->iter; ++n) {
-                       const float p4 = powf(4.f, n);
+                       const float p4 = pow(4.0, (double)n);
                        const float vxp = vx*p4, vyp = vy*p4;
-                       const float wt = powf(ndg->fade, p4);
-                       const float cmo = 1.f - powf(ndg->colmod, n+1); // colormodulation amount relative to current pass
+                       const float wt = pow((double)ndg->fade, (double)p4);
+                       const float cmo = 1.f - pow((double)ndg->colmod, (double)n+1);  // colormodulation amount relative to current pass
                        float* tdstcol = tdst->rect;
                        for (y=0; y<tsrc->y; ++y) {
                                for (x=0; x<tsrc->x; ++x, tdstcol+=4) {
@@ -408,7 +408,7 @@ static void fglow(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
                        // linear window good enough here, visual result counts, not scientific analysis
                        //w = (1.f-fabs(u))*(1.f-fabs(v));
                        // actually, Hanning window is ok, cos^2 for some reason is slower
-                       w = (0.5f + 0.5f*cosf(u*(float)M_PI))*(0.5f + 0.5f*cosf(v*(float)M_PI));
+                       w = (0.5f + 0.5f*cos((double)u*M_PI))*(0.5f + 0.5f*cos((double)v*M_PI));
                        fRGB_mult(fcol, w);
                        qd_setPixel(ckrn, x, y, fcol);
                }
index cd617eca5c5ef8ee4c7c0a354dbf096698d8fbd9..662d8e8dde907bfc35795701a373e387685745dd 100644 (file)
@@ -50,16 +50,16 @@ static float avgLogLum(CompBuf *src, float* auto_key, float* Lav, float* Cav)
                float L = 0.212671f*bc[0][0] + 0.71516f*bc[0][1] + 0.072169f*bc[0][2];
                *Lav += L;
                fRGB_add(Cav, bc[0]);
-               lsum += logf(MAX2(L, 0.f) + 1e-5f);
+               lsum += (float)log((double)MAX2(L, 0.0) + 1e-5);
                maxl = (L > maxl) ? L : maxl;
                minl = (L < minl) ? L : minl;
                bc++;
        }
        *Lav *= sc;
        fRGB_mult(Cav, sc);
-       maxl = logf(maxl + 1e-5f); minl = logf(minl + 1e-5f); avl = lsum*sc;
+       maxl = log((double)maxl + 1e-5); minl = log((double)minl + 1e-5f); avl = lsum*sc;
        *auto_key = (maxl > minl) ? ((maxl - avl) / (maxl - minl)) : 1.f;
-       return expf(avl);
+       return exp((double)avl);
 }
 
 
@@ -74,8 +74,8 @@ void static tonemap(NodeTonemap* ntm, CompBuf* dst, CompBuf* src)
 
        if (ntm->type == 1) {
                // Reinhard/Devlin photoreceptor
-               const float f = expf(-ntm->f);
-               const float m = (ntm->m > 0.f) ? ntm->m : (0.3f + 0.7f*powf(auto_key, 1.4f));
+               const float f = exp((double)-ntm->f);
+               const float m = (ntm->m > 0.f) ? ntm->m : (0.3f + 0.7f*pow((double)auto_key, 1.4));
                const float ic = 1.f - ntm->c, ia = 1.f - ntm->a;
                if (ntm->m == 0.f) printf("tonemap node, M: %g\n", m); 
                for (y=0; y<src->y; ++y) {
@@ -86,15 +86,15 @@ void static tonemap(NodeTonemap* ntm, CompBuf* dst, CompBuf* src)
                                float I_l = sp[x][0] + ic*(L - sp[x][0]);
                                float I_g = Cav[0] + ic*(Lav - Cav[0]);
                                float I_a = I_l + ia*(I_g - I_l);
-                               dp[x][0] /= (dp[x][0] + powf(f*I_a, m));
+                               dp[x][0] /= (dp[x][0] + pow((double)f*I_a, (double)m));
                                I_l = sp[x][1] + ic*(L - sp[x][1]);
                                I_g = Cav[1] + ic*(Lav - Cav[1]);
                                I_a = I_l + ia*(I_g - I_l);
-                               dp[x][1] /= (dp[x][1] + powf(f*I_a, m));
+                               dp[x][1] /= (dp[x][1] + pow((double)f*I_a,(double)m));
                                I_l = sp[x][2] + ic*(L - sp[x][2]);
                                I_g = Cav[2] + ic*(Lav - Cav[2]);
                                I_a = I_l + ia*(I_g - I_l);
-                               dp[x][2] /= (dp[x][2] + powf(f*I_a, m));
+                               dp[x][2] /= (dp[x][2] + pow((double)f*I_a, (double)m));
                        }
                }
                return;
@@ -114,9 +114,9 @@ void static tonemap(NodeTonemap* ntm, CompBuf* dst, CompBuf* src)
                        dp[x][1] /= ((dg == 0.f) ? 1.f : dg);
                        dp[x][2] /= ((db == 0.f) ? 1.f : db);
                        if (igm != 0.f) {
-                               dp[x][0] = powf(MAX2(dp[x][0], 0.f), igm);
-                               dp[x][1] = powf(MAX2(dp[x][1], 0.f), igm);
-                               dp[x][2] = powf(MAX2(dp[x][2], 0.f), igm);
+                               dp[x][0] = pow((double)MAX2(dp[x][0], 0.), igm);
+                               dp[x][1] = pow((double)MAX2(dp[x][1], 0.), igm);
+                               dp[x][2] = pow((double)MAX2(dp[x][2], 0.), igm);
                        }
                }
        }
index 07384391d273b82f1e333c26b6b973f13ac379e9..6246baa02e839015a6005498f94eb1943a5906b7 100644 (file)
@@ -278,7 +278,19 @@ static PyObject *Blender_Set( PyObject * self, PyObject * args )
                if ( !PyArg_Parse( arg , "s" , &dir ))
                        return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
                BLI_strncpy(U.tempdir, dir, FILE_MAXDIR);
-       } else
+       } else if (StringEqual( name , "compressfile" ) ) {
+               int value = PyObject_IsTrue( arg );
+               
+               if (value==-1)
+                       return EXPP_ReturnPyObjError( PyExc_ValueError,
+                                       "expected an integer" );
+               
+               if (value)              
+                U.flag |= USER_FILECOMPRESS;
+               else
+                U.flag &= ~USER_FILECOMPRESS;
+               
+       }else
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
                                                "value given is not a blender setting" ) );
        Py_RETURN_NONE;
@@ -506,6 +518,10 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
        } /* End 'quick hack' part. */
        else if(StringEqual( str, "version" ))
                ret = PyInt_FromLong( G.version );
+               
+       else if(StringEqual( str, "compressfile" ))
+               ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15  );
+               
        else
                return EXPP_ReturnPyObjError( PyExc_AttributeError, "unknown attribute" );
 
@@ -685,10 +701,16 @@ static PyObject *Blender_Save( PyObject * self, PyObject * args )
 
        disable_where_script( 1 );      /* to avoid error popups in the write_* functions */
 
-       if( BLI_testextensie( fname, ".blend" ) ) {             
+       if( BLI_testextensie( fname, ".blend" ) ) {
+               int writeflags;
                if( G.fileflags & G_AUTOPACK )
                        packAll(  );
-               if( !BLO_write_file( fname, G.fileflags, &error ) ) {
+               
+               writeflags= G.fileflags & ~G_FILE_COMPRESS;
+               if(U.flag & USER_FILECOMPRESS)
+               writeflags |= G_FILE_COMPRESS;
+               
+               if( !BLO_write_file( fname, writeflags, &error ) ) {
                        disable_where_script( 0 );
                        return EXPP_ReturnPyObjError( PyExc_SystemError,
                                                      error );
index 749e05426bd4e84b7ae7ce1c885d512a89646ed5..a47afaba2e6a95d1e600d070c87991817268b0b6 100644 (file)
@@ -440,7 +440,7 @@ static PyObject *Constraint_insertKey( BPy_Constraint * self, PyObject * value )
                return EXPP_ReturnPyObjError( PyExc_RuntimeError,
                                "constraint doesn't belong to anything" );
        }
-       icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, CO_ENFORCE);
+       icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, NULL, CO_ENFORCE);
        
        if (!icu)
                return EXPP_ReturnPyObjError( PyExc_RuntimeError,
index e62f685cdf510133b87b89d1ea721012463d4eb0..6b3735a6cfd35df519d2d8f6584b19bef31f3716 100644 (file)
@@ -2510,7 +2510,7 @@ static PyObject *Object_setConstraintInfluenceForBone( BPy_Object * self,
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                "expects bonename, constraintname, influenceval" );
        
-       icu = verify_ipocurve((ID *)self->object, ID_CO, boneName, constName,
+       icu = verify_ipocurve((ID *)self->object, ID_CO, boneName, constName, NULL,
                        CO_ENFORCE);
        
        if (!icu)
index 51666d0e2118183833160ac564eb0283982bfd5d..088a02c547c9de72c8d5a0870cad78497aeb1971 100644 (file)
@@ -60,6 +60,7 @@ def Set (request, data):
   @type request: string
   @param request: The setting to change:
       - 'curframe': the current animation frame
+      - 'compressfile' : compress file writing a blend file (Use a boolean value True/False).
       - 'uscriptsdir': user scripts dir
       - 'yfexportdir': yafray temp xml storage dir
       - 'fontsdir': font dir
@@ -79,6 +80,7 @@ def Get (request):
   @param request: The setting data to be returned:
       - 'curframe': the current animation frame.
       - 'curtime' : the current animation time.
+      - 'compressfile' : compress setting from the file menu, return  0 for false or 1 for true.
       - 'staframe': the start frame of the animation.
       - 'endframe': the end frame of the animation.
       - 'rt': the value of the 'rt' button for general debugging
index 9abc873172f03c957e097a90adf64c6cd9f3e2c4..a8abf85a28504abb00f50dacef4b69fdd5eb6776 100644 (file)
@@ -37,6 +37,7 @@
 struct Scene;
 struct RenderData;
 struct NodeBlurData;
+struct Object;
 
 /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
 /* this include is what is exposed of render to outside world */
@@ -209,7 +210,7 @@ void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize,
 #define RE_BAKE_AO             2
 #define RE_BAKE_NORMALS        3
 #define RE_BAKE_TEXTURE        4
-void RE_Database_Baking(struct Render *re, struct Scene *scene, int type);
+void RE_Database_Baking(struct Render *re, struct Scene *scene, int type, struct Object *actob);
 
 void RE_DataBase_GetView(struct Render *re, float mat[][4]);
 
index 095ffcf0c18b920cab45215c626f0816e28b52c4..d20e3130fa4bdd95feb53cfafddc6d9ba3703147 100644 (file)
@@ -64,6 +64,9 @@ typedef struct Isect {
        RayFace *facecontr;
        float ddalabda;
        short faceisect;                /* flag if facecontr was done or not */
+
+       /* custom pointer to be used in the RayCheckFunc */
+       void *userdata;
 } Isect;
 
 /* function callbacks for face type abstraction */
@@ -80,6 +83,7 @@ void RE_ray_tree_free(RayTree *tree);
 
 /* intersection with full tree and single face */
 int RE_ray_tree_intersect(RayTree *tree, Isect *is);
+int RE_ray_tree_intersect_check(RayTree *tree, Isect *is, RayCheckFunc check);
 int RE_ray_face_intersection(Isect *is, RayCoordsFunc coordsfunc);
 
 /* retrieve the diameter of the tree structure, for setting intersection
index 052e104ee62ac16fc55d1d5beedaf34cdb576323..7717d6fdc4838a3aee9ba1edbb1e3756091cbe54 100644 (file)
@@ -173,9 +173,10 @@ int        multitex_ext(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osa
 /* shaded view and bake */
 struct Render;
 struct Image;
+struct Object;
 
 void RE_shade_external(struct Render *re, struct ShadeInput *shi, struct ShadeResult *shr);
-int RE_bake_shade_all_selected(struct Render *re, int type);
+int RE_bake_shade_all_selected(struct Render *re, int type, struct Object *actob);
 struct Image *RE_bake_shade_get_image(void);
 
 #endif /* RE_SHADER_EXT_H */
index abcdf417b62a01ebd0967f94d57216179e16b539..c20d27bfcdca157f5cd534500f808f3078fb7bf5 100644 (file)
@@ -181,6 +181,8 @@ struct Render
 
        ListBase customdata_names;
 
+       struct Object *excludeob;
+
        /* arena for allocating data for use during render, for
                * example dynamic TFaces to go in the VlakRen structure.
                */
@@ -394,6 +396,7 @@ typedef struct LampRen {
 #define R_SEC_FIELD            4
 #define R_LAMPHALO             8
 #define R_GLOB_NOPUNOFLIP      16
+#define R_NEED_TANGENT 32
 
 /* vlakren->flag (vlak = face in dutch) char!!! */
 #define R_SMOOTH               1
index dd593d9edcc4e052d4806d56d4fd1a39192f91af..f64ff1501cb46ed88780c0e5a952765929ce07f1 100644 (file)
@@ -447,14 +447,39 @@ static void calc_edge_stress(Render *re, Mesh *me, int startvert, int startvlak)
        MEM_freeN(accum);
 }
 
+void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2, float *co3, float *n, float *tang)
+{
+       float tangv[3], ct[3], e1[3], e2[3], s1, t1, s2, t2, det;
+
+       s1= uv2[0] - uv1[0];
+       s2= uv3[0] - uv1[0];
+       t1= uv2[1] - uv1[1];
+       t2= uv3[1] - uv1[1];
+       det= 1.0f / (s1 * t2 - s2 * t1);
+       
+       /* normals in render are inversed... */
+       VecSubf(e1, co1, co2);
+       VecSubf(e2, co1, co3);
+       tang[0] = (t2*e1[0] - t1*e2[0])*det;
+       tang[1] = (t2*e1[1] - t1*e2[1])*det;
+       tang[2] = (t2*e1[2] - t1*e2[2])*det;
+       tangv[0] = (s1*e2[0] - s2*e1[0])*det;
+       tangv[1] = (s1*e2[1] - s2*e1[1])*det;
+       tangv[2] = (s1*e2[2] - s2*e1[2])*det;
+       Crossf(ct, tang, tangv);
+
+       /* check flip */
+       if ((ct[0]*n[0] + ct[1]*n[1] + ct[2]*n[2]) < 0.0f)
+               VecMulf(tang, -1.0f);
+}
+
 /* gets tangent from tface or orco */
 static void calc_tangent_vector(Render *re, VlakRen *vlr)
 {
        MTFace *tface= RE_vlakren_get_tface(re, vlr, 0, NULL, 0);
        VertRen *v1=vlr->v1, *v2=vlr->v2, *v3=vlr->v3, *v4=vlr->v4;
-       float tang[3], tangv[3], ct[3], e1[3], e2[3], *tav;
+       float tang[3], *tav;
        float *uv1, *uv2, *uv3, *uv4;
-       float s1, s2, t1, t2, det;
        float uv[4][2];
        
        if(tface) {
@@ -472,26 +497,8 @@ static void calc_tangent_vector(Render *re, VlakRen *vlr)
                        spheremap(v4->orco[0], v4->orco[1], v4->orco[2], &uv[3][0], &uv[3][1]);
        }
        else return;
-       
-       s1= uv2[0] - uv1[0];
-       s2= uv3[0] - uv1[0];
-       t1= uv2[1] - uv1[1];
-       t2= uv3[1] - uv1[1];
-       det= 1.0f / (s1 * t2 - s2 * t1);
-       
-       /* normals in render are inversed... */
-       VecSubf(e1, v1->co, v2->co);
-       VecSubf(e2, v1->co, v3->co);
-       tang[0] = (t2*e1[0] - t1*e2[0])*det;
-       tang[1] = (t2*e1[1] - t1*e2[1])*det;
-       tang[2] = (t2*e1[2] - t1*e2[2])*det;
-       tangv[0] = (s1*e2[0] - s2*e1[0])*det;
-       tangv[1] = (s1*e2[1] - s2*e1[1])*det;
-       tangv[2] = (s1*e2[2] - s2*e1[2])*det;
-       Crossf(ct, tang, tangv);
-       /* check flip */
-       if ((ct[0]*vlr->n[0] + ct[1]*vlr->n[1] + ct[2]*vlr->n[2]) < 0.f)
-               VecMulf(tang, -1.f);
+
+       tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, vlr->n, tang);
        
        tav= RE_vertren_get_tangent(re, v1, 1);
        VECADD(tav, tav, tang);
@@ -501,24 +508,7 @@ static void calc_tangent_vector(Render *re, VlakRen *vlr)
        VECADD(tav, tav, tang);
        
        if(v4) {
-               s1= uv3[0] - uv1[0];
-               s2= uv4[0] - uv1[0];
-               t1= uv3[1] - uv1[1];
-               t2= uv4[1] - uv1[1];
-               det= 1.0f / (s1 * t2 - s2 * t1);
-               
-               /* normals in render are inversed... */
-               VecSubf(e1, v1->co, v3->co);
-               VecSubf(e2, v1->co, v4->co);
-               tang[0] = (t2*e1[0] - t1*e2[0])*det;
-               tang[1] = (t2*e1[1] - t1*e2[1])*det;
-               tang[2] = (t2*e1[2] - t1*e2[2])*det;
-               tangv[0] = (s1*e2[0] - s2*e1[0])*det;
-               tangv[1] = (s1*e2[1] - s2*e1[1])*det;
-               tangv[2] = (s1*e2[2] - s2*e1[2])*det;
-               Crossf(ct, tang, tangv);
-               if ((ct[0]*vlr->n[0] + ct[1]*vlr->n[1] + ct[2]*vlr->n[2]) < 0.f)
-                       VecMulf(tang, -1.f);
+               tangent_from_uv(uv1, uv3, uv4, v1->co, v3->co, v4->co, vlr->n, tang);
                
                tav= RE_vertren_get_tangent(re, v1, 1);
                VECADD(tav, tav, tang);
@@ -2627,6 +2617,13 @@ static void init_render_mesh(Render *re, Object *ob, Object *par, int only_verts
                                        do_autosmooth= 1;
                }
        }
+
+       if(re->flag & R_NEED_TANGENT) {
+               /* exception for tangent space baking */
+               need_tangent= 1;
+               if(me->mtface==NULL)
+                       need_orco= 1;
+       }
        
        /* check autosmooth and displacement, we then have to skip only-verts optimize */
        do_autosmooth |= (me->flag & ME_AUTOSMOOTH);
@@ -4781,7 +4778,7 @@ void RE_DataBase_ApplyWindow(Render *re)
    RE_BAKE_AO:     for baking, no lamps, but all objects
    RE_BAKE_TEXTURE:for baking, no lamps, only selected objects
 */
-void RE_Database_Baking(Render *re, Scene *scene, int type)
+void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob)
 {
        Base *base;
        Object *ob;
@@ -4795,8 +4792,12 @@ void RE_Database_Baking(Render *re, Scene *scene, int type)
        re->r= scene->r;
        re->r.mode &= ~R_OSA;
        re->flag |= R_GLOB_NOPUNOFLIP;
+       re->excludeob= actob;
+
+       if(type==RE_BAKE_NORMALS && re->r.bake_normal_space==R_BAKE_SPACE_TANGENT)
+               re->flag |= R_NEED_TANGENT;
        
-       if( ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_NORMALS, RE_BAKE_TEXTURE) ) {
+       if(!actob && ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_NORMALS, RE_BAKE_TEXTURE)) {
                re->r.mode &= ~R_SHADOW;
                re->r.mode &= ~R_RAYTRACE;
        }
@@ -4887,7 +4888,7 @@ void RE_Database_Baking(Render *re, Scene *scene, int type)
                                                init_render_object(re, ob, NULL, 0, 0);
                                }
                                else if(type!=RE_BAKE_LIGHT) {
-                                       if( !ELEM(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE) || (ob->flag & SELECT))
+                                       if( !ELEM(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE) || (ob->flag & SELECT) || (ob == actob) )
                                                init_render_object(re, ob, NULL, 0, 0);
                                }
                        }
@@ -4915,14 +4916,10 @@ void RE_Database_Baking(Render *re, Scene *scene, int type)
                }
        }
 
-       if(type!=RE_BAKE_LIGHT) {
-               /* raytree */
-               if(!re->test_break()) {
-                       if(re->r.mode & R_RAYTRACE) {
-                               makeraytree(re);
-                       }
-               }
-       }
+       /* raytree */
+       if(!re->test_break())
+               if(re->r.mode & R_RAYTRACE)
+                       makeraytree(re);
 }
 
 void RE_DataBase_GetView(Render *re, float mat[][4])
index e7345c106a63d6aa6941f74c8cc09e56a1350ef6..5141841e157ee706acbef605317012e161a7e58f 100644 (file)
@@ -111,15 +111,16 @@ void makeraytree(Render *re)
                else vlr++;
                if(vlr->mat->mode & MA_TRACEBLE) {      
                        if((vlr->mat->mode & MA_WIRE)==0) {     
-                               
-                               DO_MINMAX(vlr->v1->co, min, max);
-                               DO_MINMAX(vlr->v2->co, min, max);
-                               DO_MINMAX(vlr->v3->co, min, max);
-                               if(vlr->v4) {
-                                       DO_MINMAX(vlr->v4->co, min, max);
-                               }
+                               if(!re->excludeob || vlr->ob != re->excludeob) {
+                                       DO_MINMAX(vlr->v1->co, min, max);
+                                       DO_MINMAX(vlr->v2->co, min, max);
+                                       DO_MINMAX(vlr->v3->co, min, max);
+                                       if(vlr->v4) {
+                                               DO_MINMAX(vlr->v4->co, min, max);
+                                       }
 
-                               totface++;
+                                       totface++;
+                               }
                        }
                }
        }
@@ -149,11 +150,10 @@ void makeraytree(Render *re)
                }
                else vlr++;
                
-               if(vlr->mat->mode & MA_TRACEBLE) {
-                       if((vlr->mat->mode & MA_WIRE)==0) {     
-                               RE_ray_tree_add_face(re->raytree, (RayFace*)vlr);
-                       }
-               }
+               if(vlr->mat->mode & MA_TRACEBLE)
+                       if((vlr->mat->mode & MA_WIRE)==0)
+                               if(!re->excludeob || vlr->ob != re->excludeob)
+                                       RE_ray_tree_add_face(re->raytree, (RayFace*)vlr);
        }
 
        RE_ray_tree_done(re->raytree);
index f86032b5d686380f6bd7dad83ef34dc8d80c4b68..002148ed97c84ff7b7c90e6a8e538e8df9f443c1 100644 (file)
@@ -902,7 +902,7 @@ int RE_ray_face_intersection(Isect *is, RayCoordsFunc coordsfunc)
 }
 
 /* check all faces in this node */
-static int testnode(Octree *oc, Isect *is, Node *no, OcVal ocval)
+static int testnode(Octree *oc, Isect *is, Node *no, OcVal ocval, RayCheckFunc checkfunc)
 {
        RayFace *face;
        short nr=0;
@@ -916,7 +916,7 @@ static int testnode(Octree *oc, Isect *is, Node *no, OcVal ocval)
                
                        if(is->faceorig != face) {
 
-                               if(oc->checkfunc(is, face)) {
+                               if(checkfunc(is, face)) {
                                        
                                        ov= no->ov+nr;
                                        if( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) ) { 
@@ -952,7 +952,7 @@ static int testnode(Octree *oc, Isect *is, Node *no, OcVal ocval)
                while(face) {
 
                        if(is->faceorig != face) {
-                               if(oc->checkfunc(is, face)) {
+                               if(checkfunc(is, face)) {
                                        ov= no->ov+nr;
                                        if( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) ) { 
                                                //accepted++;
@@ -1097,9 +1097,16 @@ static int do_coherence_test(int ocx1, int ocx2, int ocy1, int ocy2, int ocz1, i
 
 */
 
+int RE_ray_tree_intersect(RayTree *tree, Isect *is)
+{
+       Octree *oc= (Octree*)tree;
+
+       return RE_ray_tree_intersect_check(tree, is, oc->checkfunc);
+}
+
 /* return 1: found valid intersection */
 /* starts with is->faceorig */
-int RE_ray_tree_intersect(RayTree *tree, Isect *is)    
+int RE_ray_tree_intersect_check(RayTree *tree, Isect *is, RayCheckFunc checkfunc)
 {
        Octree *oc= (Octree*)tree;
        Node *no;
@@ -1123,7 +1130,7 @@ int RE_ray_tree_intersect(RayTree *tree, Isect *is)
        
                /* check with last intersected shadow face */
                if(is->face_last!=NULL && is->face_last!=is->faceorig) {
-                       if(oc->checkfunc(is, is->face_last)) {
+                       if(checkfunc(is, is->face_last)) {
                                is->face= is->face_last;
                                VECSUB(is->vec, is->end, is->start);
                                if(RE_ray_face_intersection(is, oc->coordsfunc)) return 1;
@@ -1193,7 +1200,7 @@ int RE_ray_tree_intersect(RayTree *tree, Isect *is)
                        vec2[0]= ox2; vec2[1]= oy2; vec2[2]= oz2;
                        calc_ocval_ray(&ocval, (float)ocx1, (float)ocy1, (float)ocz1, vec1, vec2);
                        is->ddalabda= 1.0f;
-                       if( testnode(oc, is, no, ocval) ) return 1;
+                       if( testnode(oc, is, no, ocval, checkfunc) ) return 1;
                }
        }
        else {
@@ -1272,7 +1279,7 @@ int RE_ray_tree_intersect(RayTree *tree, Isect *is)
                                calc_ocval_ray(&ocval, (float)xo, (float)yo, (float)zo, vec1, vec2);
                                                           
                                is->ddalabda= ddalabda;
-                               if( testnode(oc, is, no, ocval) ) return 1;
+                               if( testnode(oc, is, no, ocval, checkfunc) ) return 1;
                        }
 
                        labdao= ddalabda;
index 0f91a92fe9c1c7f37a3c6d55d3cdba5819dd9342..636bee32e052ef46baeddb7d2248c5e2e6bf8bc6 100644 (file)
@@ -66,6 +66,7 @@
 #include "shading.h"
 #include "sss.h"
 #include "zbuf.h"
+#include "RE_raytrace.h"
 
 #include "PIL_time.h"
 
@@ -1657,43 +1658,35 @@ typedef struct BakeShade {
        ImBuf *ibuf;
        
        int rectx, recty, quad, type, vdone, ready;
+
+       float dir[3];
+       Object *actob;
        
        unsigned int *rect;
        float *rect_float;
 } BakeShade;
 
-static void do_bake_shade(void *handle, int x, int y, float u, float v)
+static void bake_set_shade_input(VlakRen *vlr, ShadeInput *shi, int quad, int isect, int x, int y, float u, float v)
 {
-       BakeShade *bs= handle;
-       ShadeSample *ssamp= &bs->ssamp;
-       ShadeInput *shi= ssamp->shi;
-       ShadeResult shr;
-       VlakRen *vlr= bs->vlr;
-       float l, *v1, *v2, *v3;
-       
-       /* fast threadsafe break test */
-       if(R.test_break())
-               return;
-       
-       /* setup render coordinates */
-       if(bs->quad) {
-               v1= vlr->v1->co;
-               v2= vlr->v3->co;
-               v3= vlr->v4->co;
+       if(isect) {
+               /* raytrace intersection with different u,v than scanconvert */
+               if(vlr->v4) {
+                       if(quad)
+                               shade_input_set_triangle_i(shi, vlr, 2, 1, 3);
+                       else
+                               shade_input_set_triangle_i(shi, vlr, 0, 1, 3);
+               }
+               else
+                       shade_input_set_triangle_i(shi, vlr, 0, 1, 2);
        }
        else {
-               v1= vlr->v1->co;
-               v2= vlr->v2->co;
-               v3= vlr->v3->co;
+               /* regular scanconvert */
+               if(quad) 
+                       shade_input_set_triangle_i(shi, vlr, 0, 2, 3);
+               else
+                       shade_input_set_triangle_i(shi, vlr, 0, 1, 2);
        }
-       
-       /* renderco */
-       l= 1.0f-u-v;
-       
-       shi->co[0]= l*v3[0]+u*v1[0]+v*v2[0];
-       shi->co[1]= l*v3[1]+u*v1[1]+v*v2[1];
-       shi->co[2]= l*v3[2]+u*v1[2]+v*v2[2];
-       
+               
        /* set up view vector */
        VECCOPY(shi->view, shi->co);
        Normalize(shi->view);
@@ -1704,18 +1697,20 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
        /* cache for shadow */
        shi->samplenr++;
        
-       if(bs->quad) 
-               shade_input_set_triangle_i(shi, vlr, 0, 2, 3);
-       else
-               shade_input_set_triangle_i(shi, vlr, 0, 1, 2);
-       
        shi->u= -u;
        shi->v= -v;
        shi->xs= x;
        shi->ys= y;
        
        shade_input_set_normals(shi);
+}
 
+static void bake_shade(void *handle, Object *ob, VlakRen *vlr, ShadeInput *shi, int quad, int x, int y, float u, float v, float *tvn, float *ttang)
+{
+       BakeShade *bs= handle;
+       ShadeSample *ssamp= &bs->ssamp;
+       ShadeResult shr;
+       
        /* init material vars */
        memcpy(&shi->r, &shi->mat->r, 23*sizeof(float));        // note, keep this synced with render_types.h
        shi->har= shi->mat->har;
@@ -1725,7 +1720,6 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
                ambient_occlusion_to_diffuse(shi, shr.combined);
        }
        else {
-               
                shade_input_set_shade_texco(shi);
                
                shade_samples_do_AO(ssamp);
@@ -1738,9 +1732,39 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
                        shade_material_loop(shi, &shr);
                
                if(bs->type==RE_BAKE_NORMALS) {
-                       shr.combined[0]= shi->vn[0]/2.0f + 0.5f;
-                       shr.combined[1]= 0.5f - shi->vn[1]/2.0f;
-                       shr.combined[2]= shi->vn[2]/2.0f + 0.5f;
+                       float nor[3];
+
+                       VECCOPY(nor, shi->vn);
+
+                       if(R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
+                       else if(R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
+                               float mat[3][3], imat[3][3];
+
+                               /* bitangent */
+                               if(tvn && ttang) {
+                                       VECCOPY(mat[0], ttang);
+                                       Crossf(mat[1], tvn, ttang);
+                                       VECCOPY(mat[2], tvn);
+                               }
+                               else {
+                                       VECCOPY(mat[0], shi->tang);
+                                       Crossf(mat[1], shi->vn, shi->tang);
+                                       VECCOPY(mat[2], shi->vn);
+                               }
+
+                               Mat3Inv(imat, mat);
+                               Mat3MulVecfl(imat, nor);
+                       }
+                       else if(R.r.bake_normal_space == R_BAKE_SPACE_OBJECT)
+                               Mat4Mul3Vecfl(ob->imat, nor); /* ob->imat includes viewinv! */
+                       else if(R.r.bake_normal_space == R_BAKE_SPACE_WORLD)
+                               Mat4Mul3Vecfl(R.viewinv, nor);
+
+                       Normalize(nor); /* in case object has scaling */
+
+                       shr.combined[0]= nor[0]/2.0f + 0.5f;
+                       shr.combined[1]= 0.5f - nor[1]/2.0f;
+                       shr.combined[2]= nor[2]/2.0f + 0.5f;
                }
                else if(bs->type==RE_BAKE_TEXTURE) {
                        shr.combined[0]= shi->r;
@@ -1763,6 +1787,131 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
        }
 }
 
+static int bake_check_intersect(Isect *is, RayFace *face)
+{
+       VlakRen *vlr = (VlakRen*)face;
+       BakeShade *bs = (BakeShade*)is->userdata;
+       
+       /* no direction checking for now, doesn't always improve the result
+        * (INPR(vlr->n, bs->dir) > 0.0f); */
+
+       return (vlr->ob != bs->actob);
+}
+
+static int bake_intersect_tree(RayTree* raytree, Isect* isect, float *dir, float sign, float *hitco)
+{
+       float maxdist;
+       int hit;
+
+       /* might be useful to make a user setting for maxsize*/
+       if(R.r.bake_maxdist > 0.0f)
+               maxdist= R.r.bake_maxdist;
+       else
+               maxdist= RE_ray_tree_max_size(R.raytree);
+
+       isect->end[0] = isect->start[0] + dir[0]*maxdist*sign;
+       isect->end[1] = isect->start[1] + dir[1]*maxdist*sign;
+       isect->end[2] = isect->start[2] + dir[2]*maxdist*sign;
+
+       hit = RE_ray_tree_intersect_check(R.raytree, isect, bake_check_intersect);
+       if(hit) {
+               hitco[0] = isect->start[0] + isect->labda*isect->vec[0];
+               hitco[1] = isect->start[1] + isect->labda*isect->vec[1];
+               hitco[2] = isect->start[2] + isect->labda*isect->vec[2];
+       }
+
+       return hit;
+}
+
+static void do_bake_shade(void *handle, int x, int y, float u, float v)
+{
+       BakeShade *bs= handle;
+       VlakRen *vlr= bs->vlr;
+       Object *ob= vlr->ob;
+       float l, *v1, *v2, *v3, tvn[3], ttang[3];
+       int quad;
+       ShadeSample *ssamp= &bs->ssamp;
+       ShadeInput *shi= ssamp->shi;
+       
+       /* fast threadsafe break test */
+       if(R.test_break())
+               return;
+       
+       /* setup render coordinates */
+       if(bs->quad) {
+               v1= vlr->v1->co;
+               v2= vlr->v3->co;
+               v3= vlr->v4->co;
+       }
+       else {
+               v1= vlr->v1->co;
+               v2= vlr->v2->co;
+               v3= vlr->v3->co;
+       }
+       
+       /* renderco */
+       l= 1.0f-u-v;
+       
+       shi->co[0]= l*v3[0]+u*v1[0]+v*v2[0];
+       shi->co[1]= l*v3[1]+u*v1[1]+v*v2[1];
+       shi->co[2]= l*v3[2]+u*v1[2]+v*v2[2];
+       
+       quad= bs->quad;
+       bake_set_shade_input(vlr, shi, quad, 0, x, y, u, v);
+
+       if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
+               shade_input_set_shade_texco(shi);
+               VECCOPY(tvn, shi->vn);
+               VECCOPY(ttang, shi->tang);
+       }
+
+       /* if we are doing selected to active baking, find point on other face */
+       if(bs->actob) {
+               Isect isec, minisec;
+               float co[3], minco[3];
+               int hit, sign;
+               
+               /* intersect with ray going forward and backward*/
+               hit= 0;
+               memset(&minisec, 0, sizeof(minisec));
+               minco[0]= minco[1]= minco[2]= 0.0f;
+
+               VECCOPY(bs->dir, shi->vn);
+
+               for(sign=-1; sign<=1; sign+=2) {
+                       memset(&isec, 0, sizeof(isec));
+                       VECCOPY(isec.start, shi->co);
+                       isec.mode= RE_RAY_MIRROR;
+                       isec.faceorig= (RayFace*)vlr;
+                       isec.userdata= bs;
+
+                       if(bake_intersect_tree(R.raytree, &isec, shi->vn, sign, co)) {
+                               if(!hit || VecLenf(shi->co, co) < VecLenf(shi->co, minco)) {
+                                       minisec= isec;
+                                       VECCOPY(minco, co);
+                                       hit= 1;
+                               }
+                       }
+               }
+
+               /* if hit, we shade from the new point, otherwise from point one starting face */
+               if(hit) {
+                       vlr= (VlakRen*)minisec.face;
+                       quad= (minisec.isect == 2);
+                       VECCOPY(shi->co, minco);
+
+                       u= -minisec.u;
+                       v= -minisec.v;
+                       bake_set_shade_input(vlr, shi, quad, 1, x, y, u, v);
+               }
+       }
+
+       if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT)
+               bake_shade(handle, ob, vlr, shi, quad, x, y, u, v, tvn, ttang);
+       else
+               bake_shade(handle, ob, vlr, shi, quad, x, y, u, v, 0, 0);
+}
+
 static int get_next_bake_face(BakeShade *bs)
 {
        VlakRen *vlr;
@@ -1780,7 +1929,7 @@ static int get_next_bake_face(BakeShade *bs)
        for(; v<R.totvlak; v++) {
                vlr= RE_findOrAddVlak(&R, v);
                
-               if(vlr->ob->flag & SELECT) {
+               if((bs->actob && bs->actob == vlr->ob) || (!bs->actob && (vlr->ob->flag & SELECT))) {
                        tface= RE_vlakren_get_tface(&R, vlr, 0, NULL, 0);
 
                        if(tface && tface->tpage) {
@@ -1887,7 +2036,7 @@ static void *do_bake_thread(void *bs_v)
 /* using object selection tags, the faces with UV maps get baked */
 /* render should have been setup */
 /* returns 0 if nothing was handled */
-int RE_bake_shade_all_selected(Render *re, int type)
+int RE_bake_shade_all_selected(Render *re, int type, Object *actob)
 {
        BakeShade handles[BLENDER_MAX_THREADS];
        ListBase threads;
@@ -1919,6 +2068,7 @@ int RE_bake_shade_all_selected(Render *re, int type)
                handles[a].ssamp.tot= 1;
                
                handles[a].type= type;
+               handles[a].actob= actob;
                handles[a].zspan= MEM_callocN(sizeof(ZSpan), "zspan for bake");
                
                BLI_insert_thread(&threads, &handles[a]);
index 9dc337c1dc4dfa5cc02841a4e817020b2645a3be..6939e70a71bc181cc305c6e2dbbe64c4feedee6f 100644 (file)
@@ -1018,13 +1018,16 @@ void project_renderdata(Render *re, void (*projectfunc)(float *, float mat[][4],
                if((a & 255)==0) vlr= re->vlaknodes[a>>8].vlak;
                else vlr++;
 
+               if(!re->excludeob || vlr->ob != re->excludeob) {
                        vlr->flag |= R_VISIBLE;
                        if(vlr->v4) {
                                if(vlr->v1->clip & vlr->v2->clip & vlr->v3->clip & vlr->v4->clip) vlr->flag &= ~R_VISIBLE;
                        }
                        else if(vlr->v1->clip & vlr->v2->clip & vlr->v3->clip) vlr->flag &= ~R_VISIBLE;
-
                }
+               else
+                       vlr->flag &= ~R_VISIBLE;
+       }
 
 }
 
index 71b59f7b8bebe9e3920ca93341faa84488cbf9e7..52a65b198249efb35e3c659401390ff318a95a7e 100644 (file)
@@ -538,9 +538,9 @@ void shade_input_set_shade_texco(ShadeInput *shi)
                }
                
                /* qdn: normalmap tangent space */
-               if (mode & (MA_TANGENT_V|MA_NORMAP_TANG)) {
+               if (mode & (MA_TANGENT_V|MA_NORMAP_TANG) || R.flag & R_NEED_TANGENT) {
                        float *s1, *s2, *s3;
-                       
+
                        s1= RE_vertren_get_tangent(&R, v1, 0);
                        s2= RE_vertren_get_tangent(&R, v2, 0);
                        s3= RE_vertren_get_tangent(&R, v3, 0);
@@ -556,7 +556,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
        }
        else {
                /* qdn: normalmap tangent space */
-               if (mode & (MA_TANGENT_V|MA_NORMAP_TANG)) {
+               if (mode & (MA_TANGENT_V|MA_NORMAP_TANG) || R.flag & R_NEED_TANGENT) {
                        /* qdn: flat faces have tangents too,
                           could pick either one, using average here */
                        float *s1 = RE_vertren_get_tangent(&R, v1, 0);
@@ -568,6 +568,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
                                shi->tang[2] = (s1[2] + s2[2] + s3[2]);
                                Normalize(shi->tang);
                        }
+                       else shi->tang[0]= shi->tang[1]= shi->tang[2]= 0.0f;
                }
        }
        
index 7930fc97f2dd981ebc5057e4a0f084a712e238f6..accd39170e4db13ec5f0b08af036bd7a134d6434 100644 (file)
@@ -1706,7 +1706,6 @@ void do_material_tex(ShadeInput *shi)
                        }
                        if( (mtex->mapto & MAP_NORM) ) {
                                if(texres.nor) {
-                                       
                                        if(mtex->maptoneg & MAP_NORM) tex->norfac= -mtex->norfac;
                                        else tex->norfac= mtex->norfac;
                                        
@@ -1723,7 +1722,7 @@ void do_material_tex(ShadeInput *shi)
                                                fact = Tnor*tex->norfac;
                                                if (fact>1.f) fact = 1.f;
                                                facm = 1.f-fact;
-                                               if (shi->mat->mode & MA_NORMAP_TANG) {
+                                               if(mtex->normapspace == MTEX_NSPACE_TANGENT) {
                                                        /* qdn: tangent space */
                                                        float B[3], tv[3];
                                                        Crossf(B, shi->vn, shi->tang);  /* bitangent */
@@ -1736,10 +1735,26 @@ void do_material_tex(ShadeInput *shi)
                                                        shi->vn[2]= facm*shi->vn[2] + fact*tv[2];
                                                }
                                                else {
+                                                       float nor[3];
+
+                                                       VECCOPY(nor, texres.nor);
+
+                                                       if(mtex->normapspace == MTEX_NSPACE_CAMERA);
+                                                       else if(mtex->normapspace == MTEX_NSPACE_WORLD) {
+                                                               Mat4Mul3Vecfl(R.viewmat, nor);
+                                                       }
+                                                       else if(mtex->normapspace == MTEX_NSPACE_OBJECT) {
+                                                               if(shi->vlr && shi->vlr->ob)
+                                                                       Mat4Mul3Vecfl(shi->vlr->ob->obmat, nor);
+                                                               Mat4Mul3Vecfl(R.viewmat, nor);
+                                                       }
+
+                                                       Normalize(nor);
+
                                                        /* qdn: worldspace */
-                                                       shi->vn[0]= facm*shi->vn[0] + fact*texres.nor[0];
-                                                       shi->vn[1]= facm*shi->vn[1] + fact*texres.nor[1];
-                                                       shi->vn[2]= facm*shi->vn[2] + fact*texres.nor[2];
+                                                       shi->vn[0]= facm*shi->vn[0] + fact*nor[0];
+                                                       shi->vn[1]= facm*shi->vn[1] + fact*nor[1];
+                                                       shi->vn[2]= facm*shi->vn[2] + fact*nor[2];
                                                }
                                        }
                                        else {
index ba3e03ea1eb8a4cab7a2aa200185228b02202035..f466798c40c02dbbab91198f093e1a92a609bed1 100644 (file)
@@ -5,6 +5,20 @@ Import ('env')
 
 sources = env.Glob('*.c')
 
+if env['BF_SPLIT_SRC'] == 1:
+       numobj = len(sources)    
+       maxobj = 30      
+
+       numlibs = numobj / maxobj        
+       if (numobj % maxobj):    
+               numlibs = numlibs + 1    
+       subsources = []          
+        
+       if (env['OURPLATFORM'] == 'win32-mingw'):        
+               for i in range(numlibs - 1):     
+                       subsources.append(sources[i*maxobj:(i+1)*maxobj])        
+               subsources.append(sources[(numlibs-1)*maxobj:])
+
 incs = ' #/intern/guardedalloc #/intern/memutil'
 incs += ' ../blenlib ../makesdna ../blenkernel'
 incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include'
@@ -60,5 +74,9 @@ if env['WITH_BF_VERSE']:
 # TODO buildinfo
 if env['BF_BUILDINFO'] == 1:
     defs.append('NAN_BUILDINFO')
-
-env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )
+       
+if (env['BF_SPLIT_SRC'] == 1) and (env['OURPLATFORM'] == 'win32-mingw'):        
+       for i in range(numlibs):         
+               env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )      
+else:
+       env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )
index 83f04110974033e22e732f512776933cb36a8d58..9ffb7578980a94f7b549a8252010f3b9049d6415 100644 (file)
 #include "BKE_DerivedMesh.h"
 #include "BKE_effect.h"
 #include "BKE_font.h"
+#include "BKE_icons.h"
 #include "BKE_image.h"
 #include "BKE_ipo.h"
 #include "BKE_lattice.h"
@@ -388,6 +389,7 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
        EditFace *efa;
        Base *base;
        Object *ob= OBACT;
+       Material *ma;
        Nurb *nu;
        Curve *cu;
        BezTriple *bezt;
@@ -400,8 +402,7 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
        case B_MATWICH:
                if(G.obedit && G.obedit->actcol>0) {
                        if(G.obedit->type == OB_MESH) {
-                               efa= em->faces.first;
-                               while(efa) {
+                               for(efa= em->faces.first; efa; efa= efa->next) {
                                        if(efa->f & SELECT) {
                                                if(index== -1) index= efa->mat_nr;
                                                else if(index!=efa->mat_nr) {
@@ -476,6 +477,30 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
                        BIF_undo_push("Assign material index");
                }
                break;
+       case B_MATASS_BROWSE:
+               /* if slot available, make that index active, and assign */
+               /* else, make new slot, and assign */
+               ma= BLI_findlink(&G.main->mat, G.buts->menunr-1);
+               if(ma) {
+                       ob->actcol= find_material_index(ob, ma);
+                       if(ob->actcol==0) {
+                               assign_material(ob, ma, ob->totcol);
+                               ob->actcol= ob->totcol;
+                       }
+               }
+               else {
+                       do_common_editbuts(B_MATNEW);
+               }
+               do_common_editbuts(B_MATASS);
+               break;
+               
+       case B_MATCOL2:
+               ma= give_current_material(ob, ob->actcol);
+               BKE_icon_changed(BKE_icon_getid((ID *)ma));
+               allqueue(REDRAWVIEW3D, 0);
+               allqueue(REDRAWBUTSEDIT, 0);
+               break;
+               
        case B_MATSEL:
        case B_MATDESEL:
                if(G.obedit) {
@@ -1912,7 +1937,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
                                  "Material value that gives no displacement");
                        uiDefButF(block, NUM, B_MODIFIER_RECALC, "Strength:",
                                  lx, (cy -= 19), buttonWidth, 19, &dmd->strength,
-                                 -1000, 1000, 10, 10,
+                                 -1000, 1000, 10, 0.1,
                                  "Strength of displacement");
                        sprintf(str, "Direction%%t|Normal%%x%d|RGB -> XYZ%%x%d|"
                                "Z%%x%d|Y%%x%d|X%%x%d",
@@ -4919,23 +4944,30 @@ static void editing_panel_links(Object *ob)
        if(ob->totcol) min= 1.0; else min= 0.0;
        ma= give_current_material(ob, ob->actcol);
 
-       if(ma) uiDefBut(block, LABEL, 0, ma->id.name+2, 318,153, 103, 20, 0, 0, 0, 0, 0, "");
+       if(G.obedit) {
+               char *str= NULL;
+               IDnames_to_pupstring(&str, NULL, "ADD NEW %x 32767", &G.main->mat, NULL, NULL);
+               uiDefButS(block, MENU, B_MATASS_BROWSE, str, 292,150,20,20, &G.buts->menunr, 0, 0, 0, 0, "Browses existing choices and assign");
+               MEM_freeN(str);
+       }
+       
+       if(ma) uiDefBut(block, LABEL, 0, ma->id.name+2, 318,150, 103, 20, 0, 0, 0, 0, 0, "");
 
        uiBlockBeginAlign(block);
-       if(ma) uiDefButF(block, COL, B_REDR, "",                        292,123,31,30, &(ma->r), 0, 0, 0, 0, "");
-       uiDefButC(block, NUM, B_ACTCOL, str,            324,123,100,30, &ob->actcol, min, (float)(ob->totcol), 0, 0, "Displays total number of material indices and the current index");
-       uiDefBut(block, BUT,B_MATWICH,  "?",            424,123,30,30, 0, 0, 0, 0, 0, "In EditMode, sets the active material index from selected faces");
+       if(ma) uiDefButF(block, COL, B_MATCOL2, "",     292,113,31,30, &(ma->r), 0, 0, 0, 0, "");
+       uiDefButC(block, NUM, B_ACTCOL, str,            324,113,100,30, &ob->actcol, min, (float)(ob->totcol), 0, 0, "Displays total number of material indices and the current index");
+       uiDefBut(block, BUT,B_MATWICH,  "?",            424,113,30,30, 0, 0, 0, 0, 0, "In EditMode, sets the active material index from selected faces");
 
        uiBlockBeginAlign(block);
-       uiDefBut(block, BUT,B_MATNEW,   "New",          292,98,80,20, 0, 0, 0, 0, 0, "Adds a new Material index");
-       uiDefBut(block, BUT,B_MATDEL,   "Delete",       374,98,80,20, 0, 0, 0, 0, 0, "Deletes this Material index");
-       uiDefBut(block, BUT,B_MATSEL,   "Select",       292,76,80,20, 0, 0, 0, 0, 0, "In EditMode, selects faces that have the active index");
-       uiDefBut(block, BUT,B_MATDESEL, "Deselect",     374,76,80,20, 0, 0, 0, 0, 0, "Deselects everything with current indexnumber");
-       uiDefBut(block, BUT,B_MATASS,   "Assign",       292,47,162,26, 0, 0, 0, 0, 0, "In EditMode, assigns the active index to selected faces");
+       uiDefBut(block, BUT,B_MATNEW,   "New",          292,90,80,20, 0, 0, 0, 0, 0, "Adds a new Material index");
+       uiDefBut(block, BUT,B_MATDEL,   "Delete",       372,90,80,20, 0, 0, 0, 0, 0, "Deletes this Material index");
+       uiDefBut(block, BUT,B_MATSEL,   "Select",       292,70,80,20, 0, 0, 0, 0, 0, "In EditMode, selects faces that have the active index");
+       uiDefBut(block, BUT,B_MATDESEL, "Deselect",     372,70,80,20, 0, 0, 0, 0, 0, "Deselects everything with current indexnumber");
+       uiDefBut(block, BUT,B_MATASS,   "Assign",       292,50,160,20, 0, 0, 0, 0, 0, "In EditMode, assigns the active index to selected faces");
 
        uiBlockBeginAlign(block);
-       uiDefBut(block, BUT,B_SETSMOOTH,"Set Smooth",   291,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'smooth' rendering of selected faces");
-       uiDefBut(block, BUT,B_SETSOLID, "Set Solid",    373,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'solid' rendering of selected faces");
+       uiDefBut(block, BUT,B_SETSMOOTH,"Set Smooth",   292,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'smooth' rendering of selected faces");
+       uiDefBut(block, BUT,B_SETSOLID, "Set Solid",    372,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'solid' rendering of selected faces");
 
        uiBlockEndAlign(block);
 
index 1808618d7b73925a7cee307e71ebe92b6a5919cb..e7a2a654ba1f9e21bf719294d2ce068819e72eea 100644 (file)
@@ -208,7 +208,7 @@ static void add_constraint_to_active(Object *ob, bConstraint *con)
 
 /* returns base ID for Ipo, sets actname to channel if appropriate */
 /* should not make action... */
-void get_constraint_ipo_context(void *ob_v, char *actname)
+static void get_constraint_ipo_context(void *ob_v, char *actname)
 {
        Object *ob= ob_v;
        
@@ -240,8 +240,11 @@ static void enable_constraint_ipo_func (void *ob_v, void *con_v)
        get_constraint_ipo_context(ob, actname);
        
        /* adds ipo & channels & curve if needed */
-       verify_ipo((ID *)ob, ID_CO, actname, con->name);
-       
+       if(con->flag & CONSTRAINT_OWN_IPO)
+               verify_ipo((ID *)ob, ID_CO, NULL, con->name, actname);
+       else
+               verify_ipo((ID *)ob, ID_CO, actname, con->name, NULL);
+               
        /* make sure ipowin shows it */
        ob->ipowin= ID_CO;
        allqueue(REDRAWIPO, ID_CO);
@@ -264,8 +267,11 @@ static void add_influence_key_to_constraint_func (void *ob_v, void *con_v)
        get_constraint_ipo_context(ob, actname);
 
        /* adds ipo & channels & curve if needed */
-       icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, CO_ENFORCE);
-       
+       if(con->flag & CONSTRAINT_OWN_IPO)
+               icu= verify_ipocurve((ID *)ob, ID_CO, NULL, con->name, actname, CO_ENFORCE);
+       else
+               icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, NULL, CO_ENFORCE);
+               
        if (!icu) {
                error("Cannot get a curve from this IPO, may be dealing with linked data");
                return;
@@ -2321,7 +2327,7 @@ static void object_panel_object(Object *ob)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_object", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Object and Links", "Object", 0, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        /* object name */
        uiBlockSetCol(block, TH_BUT_SETTING2);
@@ -2388,7 +2394,7 @@ static void object_panel_anim(Object *ob)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Anim settings", "Object", 320, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        uiBlockBeginAlign(block);
        uiDefButS(block, ROW,B_TRACKBUTS,"TrackX",      24,180,59,19, &ob->trackflag, 12.0, 0.0, 0, 0, "Specify the axis that points to another object");
@@ -2453,7 +2459,7 @@ static void object_panel_draw(Object *ob)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_draw", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Draw", "Object", 640, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        /* LAYERS */
        xco= 120;
@@ -2515,7 +2521,7 @@ void object_panel_constraint(char *context)
        block= uiNewBlock(&curarea->uiblocks, "object_panel_constraint", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Constraints", context, 960, 0, 318, 204)==0) return;
        
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        /* this is a variable height panel, newpanel doesnt force new size on existing panels */
        /* so first we make it default height */
index 2cc24c643cb3eba54b51752ec7ffda5a56587195..9da6cff138706756a4f2c73db0f2cc941a799ca1 100644 (file)
@@ -1246,6 +1246,16 @@ static void render_panel_bake(void)
        
        but= uiDefBut(block, BUT, B_NOP, "BAKE",        10, 150, 190,40, 0, 0, 0, 0, 0, "Start the bake render for selected Objects");
        uiButSetFunc(but, do_bake_func, NULL, NULL);
+
+       uiBlockBeginAlign(block);
+       uiDefButBitS(block, TOG, R_BAKE_TO_ACTIVE, B_DIFF, "Selected to Active", 10,120,190,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Bake shading on the surface of selected objects to the active object");
+       uiDefButF(block, NUM, B_DIFF, "Dist:", 10,100,(G.scene->r.bake_mode == RE_BAKE_NORMALS)? 95: 190,20,&G.scene->r.bake_maxdist, 0.0, 10.0, 1, 0, "Maximum distance from active object to other object");
+
+       if(G.scene->r.bake_mode == RE_BAKE_NORMALS)
+               uiDefButS(block, MENU, B_DIFF, "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3", 
+                       105,100,95,20, &G.scene->r.bake_normal_space, 0, 0, 0, 0, "Choose normal space for baking");
+       uiBlockEndAlign(block);
+
 #if 0  
        uiBlockBeginAlign(block);
        uiDefButBitS(block, TOG, R_BAKE_OSA, B_DIFF, "OSA",             10,120,190,20, &G.scene->r.bake_flag, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
@@ -1255,10 +1265,10 @@ static void render_panel_bake(void)
        uiDefButS(block, ROW,B_DIFF,"16",                       150,100,50,20,&G.scene->r.bake_osa,2.0,16.0, 0, 0, "Sets oversample level to 16");
 #endif 
        uiBlockBeginAlign(block);
-       uiDefButS(block, ROW,B_DIFF,"Full Render",              210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, "");
-       uiDefButS(block, ROW,B_DIFF,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, "");
-       uiDefButS(block, ROW,B_DIFF,"Normals",          210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, "");
-       uiDefButS(block, ROW,B_DIFF,"Textures",         210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, "");
+       uiDefButS(block, ROW,B_REDR,"Full Render",              210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, "");
+       uiDefButS(block, ROW,B_REDR,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, "");
+       uiDefButS(block, ROW,B_REDR,"Normals",          210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, "");
+       uiDefButS(block, ROW,B_REDR,"Textures",         210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, "");
        uiBlockEndAlign(block);
        
        uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear",         210,80,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking");
index 1a071813d8a17a6f3ba7894f4509fcd4228a5d75..f21272f53da66d1c038884b007828f10db916e44 100644 (file)
@@ -1174,9 +1174,12 @@ void uiblock_image_panel(uiBlock *block, Image **ima_pp, ImageUser *iuser,
                 but= uiDefButBitS(block, TOG, IMA_FIELDS, imagechanged, "Fields",      10, 90, 100, 20, &ima->flag, 0, 0, 0, 0, "Click to enable use of fields in Image");
                 uiButSetFunc(but, image_field_test, ima, iuser);
                 uiDefButBitS(block, TOG, IMA_STD_FIELD, B_NOP, "Odd",                  10, 70, 100, 20, &ima->flag, 0, 0, 0, 0, "Standard Field Toggle");
-                uiBlockEndAlign(block);
                 
+                uiBlockBeginAlign(block);
+                uiBlockSetFunc(block, image_reload_cb, ima, iuser);
                 uiDefButBitS(block, TOG, IMA_ANTIALI, B_NOP, "Anti",                   10, 35, 100, 20, &ima->flag, 0, 0, 0, 0, "Toggles Image anti-aliasing, only works with solid colors");
+                uiDefButBitS(block, TOG, IMA_DO_PREMUL, imagechanged, "Premul",                110, 35, 100, 20, &ima->flag, 0, 0, 0, 0, "Toggles premultiplying alpha");
+                uiBlockEndAlign(block);
                 
                 if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
                         sprintf(str, "(%d) Frames:", iuser->framenr);
@@ -1224,7 +1227,7 @@ static void texture_panel_image(Image **ima, ImageUser *iuser)
        uiblock_image_panel(block, ima, iuser, B_REDR, B_IMAGECHANGED);
 }      
 
-static void texture_panel_image_map(Tex *tex)
+static void texture_panel_image_map(Tex *tex, MTex *mtex)
 {
        uiBlock *block;
        
@@ -1246,8 +1249,13 @@ static void texture_panel_image_map(Tex *tex)
 
        uiDefButF(block, NUM, B_TEXPRV, "Filter :",                                             10,120,150,20, &tex->filtersize, 0.1, 25.0, 10, 3, "Sets the filter size used by mipmap and interpol");
        
-       uiDefButBitS(block, TOG, TEX_NORMALMAP, B_NOP, "Normal Map",    160,120,150,20, &tex->imaflag,
+       uiBlockBeginAlign(block);
+       uiDefButBitS(block, TOG, TEX_NORMALMAP, B_NOP, "Normal Map",    160,120,(mtex)? 75: 150,20, &tex->imaflag,
                                        0, 0, 0, 0, "Use image RGB values for normal mapping");
+       if(mtex)
+               uiDefButS(block, MENU, B_DIFF, "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3", 
+                                               235,120,75,20, &mtex->normapspace, 0, 0, 0, 0, "Sets space of normal map image");
+       uiBlockEndAlign(block);
 
        /* crop extend clip */
        
@@ -3780,9 +3788,6 @@ static void material_panel_shading(Material *ma)
                uiBlockSetCol(block, TH_BUT_SETTING1);
                uiDefButBitI(block, TOG, MA_TANGENT_V, B_MATPRV, "Tangent V",   245,180,65,19, &(ma->mode), 0, 0, 0, 0, "Use the tangent vector in V direction for shading");
                
-               /* qdn: normalmap tangents separated from shading */
-               uiDefButBitI(block, TOG, MA_NORMAP_TANG, B_MATPRV, "NMap TS",   245,160,65,19, &(ma->mode), 0, 0, 0, 0, "Enable Tangent Space normal mapping");
-
                uiBlockBeginAlign(block);
                uiDefButBitI(block, TOG, MA_SHADOW, B_MATPRV,   "Shadow",                       245,140,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows");
                uiDefButBitI(block, TOG, MA_SHADOW_TRA, B_MATPRV, "TraShadow",          245,120,65,19, &(ma->mode), 0, 0, 0, 0, "Receives transparent shadows based at material color and alpha");
@@ -4290,7 +4295,7 @@ void texture_panels()
                        switch(tex->type) {
                        case TEX_IMAGE:
                                texture_panel_image(&tex->ima, &tex->iuser);
-                               texture_panel_image_map(tex);
+                               texture_panel_image_map(tex, mtex);
                                break;
                        case TEX_ENVMAP:
                                texture_panel_envmap(tex);
index 9b64d350b9ff09466b528693e6b76d2ebb101fa0..94832561b86831c0ee3e5bb2d55491c2ab3ae31d 100644 (file)
@@ -1899,7 +1899,7 @@ void do_ipobuts(unsigned short event)
                ei= get_active_editipo();
                if(ei) {
                        if(ei->icu==NULL) {
-                               ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, ei->adrcode);
+                               ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode);
                                if (!ei->icu) {
                                        error("Could not add a driver to this curve, may be linked data!");
                                        break;
@@ -1966,7 +1966,7 @@ void do_ipobuts(unsigned short event)
                                }
                                else {
                                        if(driver->ob) {
-                                               if(ob==driver->ob) {
+                                               if(ob==driver->ob && G.sipo->bonename[0]==0) {
                                                        error("Cannot assign a Driver to own Object");
                                                        driver->ob= NULL;
                                                }
index ba20771b17927c2ba762d6e83540b9cd57652313..3c98888ead92c695562fb5271ce5108ba7e409ed 100644 (file)
@@ -1207,8 +1207,6 @@ void draw_mesh_textured(Object *ob, DerivedMesh *dm, int faceselect)
        
        /* in editmode, the blend mode needs to be set incase it was ADD */
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-       dm->release(dm);
 }
 
 void init_realtime_GL(void)
index 4a5dda72b1886f40a01da21085f038979b775607..52372b5116712eb9c083ba9f3873485e014f434d 100644 (file)
@@ -269,7 +269,7 @@ static int node_buts_group(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *
                        sprintf(str1, "%d", node->id->us);
                        bt= uiDefBut(block, BUT, B_NOP, str1, 
                                                 butr->xmax-19, butr->ymin, 19, 19, 
-                                                NULL, 0, 0, 0, 0, "Displays number of users. Click to make a single-user copy.");
+                                                NULL, 0, 0, 0, 0, "Displays number of users.");
                        //uiButSetFunc(bt, node_mat_alone_cb, node, NULL);
                }
                
index e8f14ef73ed4e01846f4426b8a3fbd52e517901f..899fda103bd6bd3dd36c582c250c8792257a1cf1 100644 (file)
@@ -3418,6 +3418,12 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys)
                                glEnableClientState(GL_NORMAL_ARRAY);
                                glEnable(GL_LIGHTING);
 
+                               if(part->draw&PART_DRAW_MAT_COL) {
+                                       glEnableClientState(GL_COLOR_ARRAY);
+                                       glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+                                       glEnable(GL_COLOR_MATERIAL);
+                               }
+
                                if(totchild && (part->draw&PART_DRAW_PARENT)==0)
                                        totpart=0;
 
@@ -3426,6 +3432,8 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys)
                                        path=cache[a];
                                        glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
                                        glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel);
+                                       if(part->draw&PART_DRAW_MAT_COL)
+                                               glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col);
                                        glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1);
                                }
                                
@@ -3434,8 +3442,16 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys)
                                        path=cache[a];
                                        glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
                                        glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel);
+                                       if(part->draw&PART_DRAW_MAT_COL)
+                                               glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col);
                                        glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1);
                                }
+
+                               if(part->draw&PART_DRAW_MAT_COL) {
+                                       glDisable(GL_COLOR_ARRAY);
+                                       glDisable(GL_COLOR_MATERIAL);
+                               }
+
                                if(cdata2)
                                        MEM_freeN(cdata2);
                                cd2=cdata2=0;
@@ -3540,8 +3556,6 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys)
        ParticleCacheKey **path;
        ParticleEditKey *key;
        ParticleEditSettings *pset = PE_settings();
-       /*Mesh *me= (Mesh*)ob->data;*/
-       Material *ma;
        int i, k, totpart = psys->totpart, totchild=0, timed = pset->draw_timed;
        char nosel[4], sel[4];
        float sel_col[3];
@@ -3590,10 +3604,10 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys)
                glDisable(GL_LIGHTING);
        }
 
-       for(i=0, pa=psys->particles, path = psys->pathcache; i<totpart; i++, pa++, path++){
-               /*if(me->mface[pa->num].flag & ME_HIDE)
-                       continue;*/
+       glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+       glEnable(GL_COLOR_MATERIAL);
 
+       for(i=0, pa=psys->particles, path = psys->pathcache; i<totpart; i++, pa++, path++){
                glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co);
                glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel);
                glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col);
@@ -3601,11 +3615,6 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys)
                glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1);
        }
 
-       if(psys->part->draw&PART_DRAW_MAT_COL) {
-               ma= give_current_material(ob,psys->part->omat);
-               glColor3f(ma->r,ma->g,ma->b);
-               glDisableClientState(GL_COLOR_ARRAY);
-       }
        glEnable(GL_LIGHTING);
 
        for(i=0, path=psys->childcache; i<totchild; i++,path++){
@@ -3616,6 +3625,8 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys)
                glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1);
        }
 
+       glDisable(GL_COLOR_MATERIAL);
+
        /* draw edit vertices */
        if(G.scene->selectmode!=SCE_SELECT_PATH){
                glDisableClientState(GL_NORMAL_ARRAY);
index bb04440bd0fefc3afdb55b5707b760a83d7b64b7..9dbac590d306ecb788061889faba0dfb673ed85b 100644 (file)
@@ -851,8 +851,9 @@ static void draw_image_seq(ScrArea *sa)
 
        /* needed for gla draw */
        glaDefine2DArea(&curarea->winrct);
-       glPixelZoom(zoom, zoom);
-
+       
+       glPixelZoom(zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp), zoom);
+       
        glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
        
        glPixelZoom(1.0, 1.0);
index c00c3ddf157c69b3e124ccd1c437d17e8bc28afc..14690b08d480da47a937232d379c9e893c2e3199 100644 (file)
@@ -2258,7 +2258,7 @@ static void view3d_panel_object(short cntrl)      // VIEW3D_HANDLER_OBJECT
                        return;
        }
 
-       uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+       uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
        
        if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) {
                uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER);    // force old style frontbuffer draw
index 24c8382a445bf932316dd66a3ab06de6ff902870..9dcb190509f8faf69803a72f0387f8dbdbeca6bf 100644 (file)
@@ -2552,7 +2552,7 @@ int bone_looper(Object *ob, Bone *bone, void *data,
 }
 
 
-static int bone_skinnable(Object *ob, Bone *bone, void *data)
+static int bone_skinnable(Object *ob, Bone *bone, void *datap)
 {
     /* Bones that are deforming
      * are regarded to be "skinnable" and are eligible for
@@ -2576,16 +2576,26 @@ static int bone_skinnable(Object *ob, Bone *bone, void *data)
      *      pointers to bones that point to all
      *      skinnable bones.
      */
-    Bone ***hbone;
+       Bone ***hbone;
+       int a, segments;
+       struct { Object *armob; void *list; int heat; } *data = datap;
 
        if(!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
                if (!(bone->flag & BONE_NO_DEFORM)) {
-                       if (data != NULL) {
-                               hbone = (Bone ***) data;
-                               **hbone = bone;
-                               ++*hbone;
+                       if(data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
+                               segments = bone->segments;
+                       else
+                               segments = 1;
+
+                       if (data->list != NULL) {
+                               hbone = (Bone ***) &data->list;
+                               
+                               for(a=0; a<segments; a++) {
+                                       **hbone = bone;
+                                       ++*hbone;
+                               }
                        }
-                       return 1;
+                       return segments;
                }
        }
     return 0;
@@ -2606,7 +2616,7 @@ static int add_defgroup_unique_bone(Object *ob, Bone *bone, void *data)
     return 0;
 }
 
-static int dgroup_skinnable(Object *ob, Bone *bone, void *data) 
+static int dgroup_skinnable(Object *ob, Bone *bone, void *datap
 {
     /* Bones that are deforming
      * are regarded to be "skinnable" and are eligible for
@@ -2632,19 +2642,28 @@ static int dgroup_skinnable(Object *ob, Bone *bone, void *data)
      *      of skinnable bones.
      */
     bDeformGroup ***hgroup, *defgroup;
+       int a, segments;
+       struct { Object *armob; void *list; int heat; } *data= datap;
 
        if(!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
           if (!(bone->flag & BONE_NO_DEFORM)) {
-                       if ( !(defgroup = get_named_vertexgroup(ob, bone->name)) ) {
+                       if(data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
+                               segments = bone->segments;
+                       else
+                               segments = 1;
+
+                       if(!(defgroup = get_named_vertexgroup(ob, bone->name)))
                                defgroup = add_defgroup_name(ob, bone->name);
-                       }
 
-                       if (data != NULL) {
-                               hgroup = (bDeformGroup ***) data;
-                               **hgroup = defgroup;
-                               ++*hgroup;
+                       if (data->list != NULL) {
+                               hgroup = (bDeformGroup ***) &data->list;
+
+                               for(a=0; a<segments; a++) {
+                                       **hgroup = defgroup;
+                                       ++*hgroup;
+                               }
                        }
-                       return 1;
+                       return segments;
                }
        }
     return 0;
@@ -2682,7 +2701,7 @@ static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], i
                        /* store the distance-factor from the vertex to the bone */
                        distance = distfactor_to_bone (verts[i], root[j], tip[j],
                                bone->rad_head * scale, bone->rad_tail * scale, bone->dist * scale);
-
+                       
                        /* add the vert to the deform group if weight!=0.0 */
                        if (distance!=0.0)
                                add_vert_to_defgroup (ob, dgroup, i, distance, WEIGHT_REPLACE);
@@ -2713,59 +2732,95 @@ void add_verts_to_dgroups(Object *ob, Object *par, int heat, int mirror)
         * The mesh vertex positions used are either the final deformed coords
         * from the derivedmesh in weightpaint mode, the final subsurf coords
         * when parenting, or simply the original mesh coords.
-     */
+        */
 
-    bArmature *arm;
-    Bone **bonelist, **bonehandle, *bone;
-    bDeformGroup **dgrouplist, **dgroupflip, **dgrouphandle;
+       bArmature *arm;
+       Bone **bonelist, *bone;
+       bDeformGroup **dgrouplist, **dgroupflip;
        bDeformGroup *dgroup, *curdg;
-    Mesh *mesh;
-    float (*root)[3], (*tip)[3], (*verts)[3];
+       bPoseChannel *pchan;
+       Mesh *mesh;
+       Mat4 *bbone = NULL;
+       float (*root)[3], (*tip)[3], (*verts)[3];
        int *selected;
-    int numbones, vertsfilled = 0, i, j;
+       int numbones, vertsfilled = 0, i, j, segments = 0;
        int wpmode = (G.f & G_WEIGHTPAINT);
+       struct { Object *armob; void *list; int heat; } looper_data;
 
-    /* If the parent object is not an armature exit */
-    arm = get_armature(par);
-    if (!arm)
-        return;
+       /* If the parent object is not an armature exit */
+       arm = get_armature(par);
+       if (!arm)
+               return;
+       
+       looper_data.armob = par;
+       looper_data.heat= heat;
+       looper_data.list= NULL;
 
-    /* count the number of skinnable bones */
-    numbones = bone_looper(ob, arm->bonebase.first, NULL, bone_skinnable);
+       /* count the number of skinnable bones */
+       numbones = bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable);
        
        if (numbones == 0)
                return;
        
-    /* create an array of pointer to bones that are skinnable
-     * and fill it with all of the skinnable bones */
-    bonelist = MEM_callocN(numbones*sizeof(Bone *), "bonelist");
-    bonehandle = bonelist;
-    bone_looper(ob, arm->bonebase.first, &bonehandle, bone_skinnable);
+       /* create an array of pointer to bones that are skinnable
+        * and fill it with all of the skinnable bones */
+       bonelist = MEM_callocN(numbones*sizeof(Bone *), "bonelist");
+       looper_data.list= bonelist;
+       bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable);
 
-    /* create an array of pointers to the deform groups that
-     * coorespond to the skinnable bones (creating them
-     * as necessary. */
-    dgrouplist = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgrouplist");
-    dgroupflip = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgroupflip");
+       /* create an array of pointers to the deform groups that
+        * coorespond to the skinnable bones (creating them
+        * as necessary. */
+       dgrouplist = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgrouplist");
+       dgroupflip = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgroupflip");
 
-    dgrouphandle = dgrouplist;
-    bone_looper(ob, arm->bonebase.first, &dgrouphandle, dgroup_skinnable);
+       looper_data.list= dgrouplist;
+       bone_looper(ob, arm->bonebase.first, &looper_data, dgroup_skinnable);
 
-    /* create an array of root and tip positions transformed into
+       /* create an array of root and tip positions transformed into
         * global coords */
-    root = MEM_callocN(numbones*sizeof(float)*3, "root");
-    tip = MEM_callocN(numbones*sizeof(float)*3, "tip");
+       root = MEM_callocN(numbones*sizeof(float)*3, "root");
+       tip = MEM_callocN(numbones*sizeof(float)*3, "tip");
        selected = MEM_callocN(numbones*sizeof(int), "selected");
 
        for (j=0; j < numbones; ++j) {
                bone = bonelist[j];
                dgroup = dgrouplist[j];
 
+               /* handle bbone */
+               if(heat) {
+                       if(segments == 0) {
+                               segments = 1;
+                               bbone = NULL;
+
+                               if(par->pose && (pchan=get_pose_channel(par->pose, bone->name))) {
+                                       if(bone->segments > 1) {
+                                               segments = bone->segments;
+                                               bbone = b_bone_spline_setup(pchan, 1);
+                                       }
+                               }
+                       }
+
+                       segments--;
+               }
+
                /* compute root and tip */
-               VECCOPY(root[j], bone->arm_head);
-               Mat4MulVecfl(par->obmat, root[j]);
+               if(bbone) {
+                       VECCOPY(root[j], bbone[segments].mat[3]);
+                       Mat4MulVecfl(bone->arm_mat, root[j]);
+                       if(segments+1 < bone->segments) {
+                               VECCOPY(tip[j], bbone[segments+1].mat[3])
+                               Mat4MulVecfl(bone->arm_mat, tip[j]);
+                       }
+                       else
+                               VECCOPY(tip[j], bone->arm_tail)
+               }
+               else {
+                       VECCOPY(root[j], bone->arm_head);
+                       VECCOPY(tip[j], bone->arm_tail);
+               }
 
-               VECCOPY(tip[j], bone->arm_tail);
+               Mat4MulVecfl(par->obmat, root[j]);
                Mat4MulVecfl(par->obmat, tip[j]);
 
                /* set selected */
index 6d0c34f2bf8e2d80465ba18d5b4d57cdb8666300..b4206a510aa784aa5722cb0b0a2160638f29f1fa 100644 (file)
@@ -704,6 +704,53 @@ void remove_vert_defgroup (Object *ob, bDeformGroup        *dg, int vertnum)
        remove_vert_def_nr (ob, def_nr, vertnum);
 }
 
+/* for mesh in object mode lattice can be in editmode */
+static float get_vert_def_nr (Object *ob, int def_nr, int vertnum)
+{
+       MDeformVert *dvert= NULL;
+       int i;
+
+       /* get the deform vertices corresponding to the
+        * vertnum
+        */
+       if(ob->type==OB_MESH) {
+               if( ((Mesh*)ob->data)->dvert )
+                       dvert = ((Mesh*)ob->data)->dvert + vertnum;
+       }
+       else if(ob->type==OB_LATTICE) {
+               Lattice *lt= ob->data;
+               
+               if(ob==G.obedit)
+                       lt= editLatt;
+               
+               if(lt->dvert)
+                       dvert = lt->dvert + vertnum;
+       }
+       
+       if(dvert==NULL)
+               return 0.0f;
+       
+       for(i=dvert->totweight-1 ; i>=0 ; i--)
+               if(dvert->dw[i].def_nr == def_nr)
+                       return dvert->dw[i].weight;
+
+       return 0.0f;
+}
+
+/* mesh object mode, lattice can be in editmode */
+float get_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum)
+{
+       int def_nr;
+
+       if(!ob)
+               return 0.0f;
+
+       def_nr = get_defgroup_num(ob, dg);
+       if(def_nr < 0) return 0.0f;
+
+       return get_vert_def_nr (ob, def_nr, vertnum);
+}
+
 /* Only available in editmode */
 /* removes from active defgroup, if allverts==0 only selected vertices */
 void remove_verts_defgroup (int allverts)
index 5873bb9473246bb1a0f135adda46edc83f3c84cd..d0442196bb4d5865bf864ee4cbc632e81a2ece9c 100644 (file)
@@ -1013,7 +1013,8 @@ static void make_editipo(void)
 /* evaluates context in the current UI */
 /* blocktype is type of ipo */
 /* from is the base pointer to find data to change (ob in case of action or pose) */
-static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname, char *constname)
+/* bonename is for local bone ipos (constraint only now) */
+static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname, char *constname, char *bonename)
 {
        Object *ob= OBACT;
        
@@ -1026,25 +1027,37 @@ static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname
                        bConstraint *con= get_active_constraint(ob);
                        
                        if(con) {
-                               BLI_strncpy(constname, con->name, 32);
-                               
-                               chan= get_active_constraint_channel(ob);
-                               if(chan) {
-                                       *ipo= chan->ipo;
-                                       BLI_strncpy(constname, con->name, 32);
-                               }
-                               
                                *from= &ob->id;
                                
-                               /* set actname if in posemode */
-                               if(ob->action) {
+                               BLI_strncpy(constname, con->name, 32);
+                               
+                               /* a bit hackish, but we want con->ipo to work */
+                               if(con->flag & CONSTRAINT_OWN_IPO) {
                                        if(ob->flag & OB_POSEMODE) {
                                                bPoseChannel *pchan= get_active_posechannel(ob);
-                                               if(pchan)
-                                                       BLI_strncpy(actname, pchan->name, 32);
+                                               if(pchan) {
+                                                       BLI_strncpy(bonename, pchan->name, 32);
+                                                       *ipo= con->ipo;
+                                               }
+                                       }
+                               }
+                               else {
+                                       chan= get_active_constraint_channel(ob);
+                                       if(chan) {
+                                               *ipo= chan->ipo;
+                                               BLI_strncpy(constname, con->name, 32);
+                                       }
+                                       
+                                       /* set actname if in posemode */
+                                       if(ob->action) {
+                                               if(ob->flag & OB_POSEMODE) {
+                                                       bPoseChannel *pchan= get_active_posechannel(ob);
+                                                       if(pchan)
+                                                               BLI_strncpy(actname, pchan->name, 32);
+                                               }
+                                               else if(ob->ipoflag & OB_ACTION_OB)
+                                                       strcpy(actname, "Object");
                                        }
-                                       else if(ob->ipoflag & OB_ACTION_OB)
-                                               strcpy(actname, "Object");
                                }
                        }
                }
@@ -1182,9 +1195,9 @@ void test_editipo(int doit)
        if(G.sipo->pin==0) {
                Ipo *ipo;
                ID *from;
-               char actname[32]="", constname[32]="";
+               char actname[32]="", constname[32]="", bonename[32]="";
                
-               get_ipo_context(G.sipo->blocktype, &from, &ipo, actname, constname);
+               get_ipo_context(G.sipo->blocktype, &from, &ipo, actname, constname, bonename);
                
                if(G.sipo->ipo != ipo) {
                        G.sipo->ipo= ipo;
@@ -1203,6 +1216,12 @@ void test_editipo(int doit)
                        BLI_strncpy(G.sipo->constname, constname, 32);
                        doit= 1;
                }
+               if( strcmp(G.sipo->bonename, bonename)) {
+                       BLI_strncpy(G.sipo->bonename, bonename, 32);
+                       /* urmf; if bonename, then no action */
+                       if(bonename[0]) G.sipo->actname[0]= 0;
+                       doit= 1;
+               }
                
                if(G.sipo->ipo)
                        G.sipo->ipo->cur = G.v2d->cur;
@@ -1751,11 +1770,12 @@ void do_ipo_selectbuttons(void)
 /* arguments define full context;
    - *from has to be set always, to Object in case of Actions
    - blocktype defines available channels of Ipo struct (blocktype ID_OB can be in action too)
-   - if actname, use this to locate action, and optional constname to find the channel 
+   - if actname, use this to locate actionchannel, and optional constname 
+   - if bonename, the constname is the ipo to the constraint
 */
 
 /* note; check header_ipo.c, spaceipo_assign_ipo() too */
-Ipo *verify_ipo(ID *from, short blocktype, char *actname, char *constname)
+Ipo *verify_ipo(ID *from, short blocktype, char *actname, char *constname, char *bonename)
 {
 
        if(from==NULL || from->lib) return NULL;
@@ -1799,13 +1819,30 @@ Ipo *verify_ipo(ID *from, short blocktype, char *actname, char *constname)
                case ID_OB:
                        {
                                Object *ob= (Object *)from;
+                               
                                /* constraint exception */
                                if(blocktype==ID_CO) {
-                                       bConstraintChannel *conchan= verify_constraint_channel(&ob->constraintChannels, constname);
-                                       if(conchan->ipo==NULL) {
-                                               conchan->ipo= add_ipo("CoIpo", ID_CO);  
+                                       /* check the local constraint ipo */
+                                       if(bonename && bonename[0] && ob->pose) {
+                                               bPoseChannel *pchan= get_pose_channel(ob->pose, bonename);
+                                               bConstraint *con;
+                                               for(con= pchan->constraints.first; con; con= con->next)
+                                                       if(strcmp(con->name, constname)==0)
+                                                               break;
+                                               if(con) {
+                                                       if(con->ipo==NULL) {
+                                                               con->ipo= add_ipo("CoIpo", ID_CO);
+                                                       }
+                                                       return con->ipo;
+                                               }
+                                       }
+                                       else { /* the actionchannel */
+                                               bConstraintChannel *conchan= verify_constraint_channel(&ob->constraintChannels, constname);
+                                               if(conchan->ipo==NULL) {
+                                                       conchan->ipo= add_ipo("CoIpo", ID_CO);  
+                                               }
+                                               return conchan->ipo;
                                        }
-                                       return conchan->ipo;
                                }
                                else if(blocktype==ID_OB) {
                                        if(ob->ipo==NULL) {
@@ -1940,14 +1977,14 @@ Ipo *verify_ipo(ID *from, short blocktype, char *actname, char *constname)
 /* returns and creates
  * Make sure functions check for NULL or they will crash!
  *  */
-IpoCurve *verify_ipocurve(ID *from, short blocktype, char *actname, char *constname, int adrcode)
+IpoCurve *verify_ipocurve(ID *from, short blocktype, char *actname, char *constname, char *bonename, int adrcode)
 {
        Ipo *ipo;
        IpoCurve *icu= NULL;
        
        /* return 0 if lib */
        /* creates ipo too */
-       ipo= verify_ipo(from, blocktype, actname, constname);
+       ipo= verify_ipo(from, blocktype, actname, constname, bonename);
        
        if(ipo && ipo->id.lib==NULL && from->lib==NULL) {
                
@@ -1958,6 +1995,8 @@ IpoCurve *verify_ipocurve(ID *from, short blocktype, char *actname, char *constn
                        icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");
 
                        icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
+                       if(ipo->curve.first==NULL) icu->flag |= IPO_ACTIVE;     /* first one added active */
+                       
                        icu->blocktype= blocktype;
                        icu->adrcode= adrcode;
                        
@@ -2111,7 +2150,7 @@ void add_vert_ipo(void)
        
        if(ei->icu==NULL) {
                if(G.sipo->from) {
-                       ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, ei->adrcode);
+                       ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode);
                        if (ei->icu)
                                ei->flag |= ei->icu->flag & IPO_AUTO_HORIZ;     /* new curve could have been added, weak... */
                        else
@@ -2281,7 +2320,7 @@ static void insertkey_nonrecurs(ID *id, int blocktype, char *actname, char *cons
        int matset=0;
        
        if (matset==0) {
-               icu= verify_ipocurve(id, blocktype, actname, constname, adrcode);
+               icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode);
                
                if(icu) {
                        
@@ -2502,7 +2541,7 @@ void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcod
                matset=insertmatrixkey(id, blocktype, actname, constname, adrcode);
        } 
        if (matset==0) {
-               icu= verify_ipocurve(id, blocktype, actname, constname, adrcode);
+               icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode);
                
                if(icu) {
                        
@@ -2544,7 +2583,7 @@ void insertkey_smarter(ID *id, int blocktype, char *actname, char *constname, in
        int vartype;
        int insert_mode;
        
-       icu= verify_ipocurve(id, blocktype, actname, constname, adrcode);
+       icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode);
        
        if(icu) {
                
@@ -2596,7 +2635,7 @@ void insertfloatkey(ID *id, int blocktype, char *actname, char *constname, int a
        float cfra;
        int vartype;
        
-       icu= verify_ipocurve(id, blocktype, actname, constname, adrcode);
+       icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode);
        
        if(icu) {
                
@@ -4270,7 +4309,7 @@ void paste_editipo(void)
                                int i;
                                
                                /* make sure an ipo-curve exists (it may not, as this is an editipo) */
-                               ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, ei->adrcode);
+                               ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode);
                                if (ei->icu == NULL) return;
                                
                                /* Copy selected beztriples from source icu onto this edit-icu,
@@ -4307,10 +4346,11 @@ void paste_editipo(void)
                                icu= icu->next;
                        }
                        
-                       /* otherwise paste entire curve data if selected */
-                       else if (ei->flag & IPO_SELECT) {
+                       /* otherwise paste entire curve data */
+                       else  {
+                               
                                /* make sure an ipo-curve exists (it may not, as this is an editipo) */
-                               ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, ei->adrcode);
+                               ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode);
                                if (ei->icu==NULL) return;
                                
                                /* clear exisiting dynamic memory (keyframes, driver) */
@@ -5405,7 +5445,7 @@ void ipo_record(void)
 
        /* make curves ready, start values */
        if(ei1->icu==NULL) 
-               ei1->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, ei1->adrcode);
+               ei1->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei1->adrcode);
        if(ei1->icu==NULL) return;
        
        poin= get_ipo_poin(G.sipo->from, ei1->icu, &type);
@@ -5415,7 +5455,7 @@ void ipo_record(void)
        
        if(ei2) {
                if(ei2->icu==NULL)
-                       ei2->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, ei2->adrcode);
+                       ei2->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei2->adrcode);
                if(ei2->icu==NULL) return;
                
                poin= get_ipo_poin(G.sipo->from, ei2->icu, &type);
index 671889d6431026a52e38ca98f27cdbcafb565b0e..0d861cda5d091705f7184e8e2ba9b94e1dea257b 100644 (file)
@@ -171,9 +171,9 @@ static void rvk_slider_func(void *voidob, void *voidkeynum)
 
        /* ipo on action or ob? */
        if(ob->ipoflag & OB_ACTION_KEY)
-               icu = verify_ipocurve(&ob->id, ID_KE, "Shape", NULL, keynum);
+               icu = verify_ipocurve(&ob->id, ID_KE, "Shape", NULL, NULL, keynum);
        else 
-               icu = verify_ipocurve(&ob->id, ID_KE, NULL, NULL, keynum);
+               icu = verify_ipocurve(&ob->id, ID_KE, NULL, NULL, NULL, keynum);
 
        if (icu) {
                /* if the ipocurve exists, try to get a bezier
index c904bb2794761f11193b5923624699b47de355d6..597e15154998b58d3992a6fee6beaf035ac9609c 100644 (file)
@@ -5489,6 +5489,18 @@ void hookmenu(void)
        }       
 }
 
+/*
+ * Returns true if the Object is a from an external blend file (libdata)
+ */
+int object_is_libdata(Object *ob)
+{
+       if (!ob) return 0;
+       if (ob->proxy) return 0;
+       if (ob->id.lib) return 1;
+       return 0;
+}
+
+
 /*
  * Returns true if the Object data is a from an external blend file (libdata)
  */
index 08f90e31f67cbff9bb74f0fc5d2f68a5ab921304..e08ca3279d64e5a09b69637496b48967e1eb2a03 100644 (file)
@@ -954,17 +954,25 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
        BLI_kdtree_balance(edit->emitter_field);
 }
 
-void PE_update_selection(Object *ob)
+void PE_update_selection(Object *ob, int useflag)
 {
        ParticleSystem *psys= PE_get_current(ob);
        ParticleEdit *edit= psys->edit;
+       ParticleEditSettings *pset= PE_settings();
+       ParticleSettings *part= psys->part;
        ParticleData *pa;
        HairKey *hkey;
        ParticleEditKey *key;
+       float cfra= CFRA;
        int i, k, totpart;
 
        totpart= psys->totpart;
 
+       /* flag all particles to be updated if not using flag */
+       if(!useflag)
+               LOOP_PARTICLES(i,pa)
+                       pa->flag |= PARS_EDIT_RECALC;
+
        /* flush edit key flag to hair key flag to preserve selection 
         * on save */
        LOOP_PARTICLES(i,pa) {
@@ -974,7 +982,14 @@ void PE_update_selection(Object *ob)
                        hkey->editflag= key->flag;
        }
 
-       psys_cache_paths(ob, psys, CFRA, 0);
+       psys_cache_paths(ob, psys, CFRA, 1);
+
+       if(part->childtype && (pset->flag & PE_SHOW_CHILD))
+               psys_cache_child_paths(ob, psys, cfra, 1);
+
+       /* disable update flag */
+       LOOP_PARTICLES(i,pa)
+               pa->flag &= ~PARS_EDIT_RECALC;
 }
 
 void PE_update_object(Object *ob, int useflag)
@@ -1109,12 +1124,15 @@ void PE_set_particle_edit(void)
 static void select_key(ParticleSystem *psys, int pa_index, int key_index, void *userData)
 {
        struct { short *mval; float rad; rcti* rect; int select; } *data = userData;
+       ParticleData *pa = psys->particles + pa_index;
        ParticleEditKey *key = psys->edit->keys[pa_index] + key_index;
 
        if(data->select)
                key->flag|=PEK_SELECT;
        else
                key->flag&=~PEK_SELECT;
+
+       pa->flag |= PARS_EDIT_RECALC;
 }
 static void select_keys(ParticleSystem *psys, int pa_index, int key_index, void *userData)
 {
@@ -1130,13 +1148,18 @@ static void select_keys(ParticleSystem *psys, int pa_index, int key_index, void
                        key->flag&=~PEK_SELECT;
        }
 
+       pa->flag |= PARS_EDIT_RECALC;
 }
 static void toggle_key_select(ParticleSystem *psys, int pa_index, int key_index, void *userData)
 {
+       ParticleData *pa = psys->particles + pa_index;
+
        if(psys->edit->keys[pa_index][key_index].flag&PEK_SELECT)
                psys->edit->keys[pa_index][key_index].flag&=~PEK_SELECT;
        else
                psys->edit->keys[pa_index][key_index].flag|=PEK_SELECT;
+       
+       pa->flag |= PARS_EDIT_RECALC;
 }
 static void select_root(ParticleSystem *psys, int index, void *userData)
 {
@@ -1234,6 +1257,7 @@ void PE_deselectall(void)
                        if(key->flag&PEK_SELECT){
                                sel = 1;
                                key->flag &= ~PEK_SELECT;
+                               pa->flag |= PARS_EDIT_RECALC;
                        }
                }
        }
@@ -1242,12 +1266,15 @@ void PE_deselectall(void)
                LOOP_PARTICLES(i,pa){
                        if(pa->flag & PARS_HIDE) continue;
                        LOOP_KEYS(k,key){
-                               key->flag |= PEK_SELECT;
+                               if(!(key->flag & PEK_SELECT)) {
+                                       key->flag |= PEK_SELECT;
+                                       pa->flag |= PARS_EDIT_RECALC;
+                               }
                        }
                }
        }
 
-       PE_update_selection(ob);
+       PE_update_selection(ob, 1);
 
        BIF_undo_push("(De)select all keys");
        allqueue(REDRAWVIEW3D, 1);
@@ -1278,7 +1305,10 @@ void PE_mouse_particles(void)
                LOOP_PARTICLES(i,pa){
                        if(pa->flag & PARS_HIDE) continue;
                        LOOP_KEYS(k,key){
-                               key->flag &= ~PEK_SELECT;
+                               if(key->flag & PEK_SELECT) {
+                                       key->flag &= ~PEK_SELECT;
+                                       pa->flag |= PARS_EDIT_RECALC;
+                               }
                        }
                }
 
@@ -1291,7 +1321,7 @@ void PE_mouse_particles(void)
 
        for_mouse_hit_keys(1,psys,toggle_key_select,&data);
 
-       PE_update_selection(ob);
+       PE_update_selection(ob, 1);
 
        rightmouse_transform();
 
@@ -1335,7 +1365,7 @@ void PE_select_linked(void)
 
        for_mouse_hit_keys(1,psys,select_keys,&data);
 
-       PE_update_selection(ob);
+       PE_update_selection(ob, 1);
 
        BIF_undo_push("Select linked keys");
 
@@ -1364,7 +1394,7 @@ void PE_borderselect(void)
 
        for_mouse_hit_keys(0,psys,select_key,&data);
 
-       PE_update_selection(ob);
+       PE_update_selection(ob, 1);
 
        BIF_undo_push("Select keys");
 
@@ -1417,10 +1447,14 @@ void PE_do_lasso_select(short mcords[][2], short moves, short select)
                                Mat4MulVecfl(mat, co);
                                project_short(co,vertco);
                                if(lasso_inside(mcords,moves,vertco[0],vertco[1])){
-                                       if(select)
+                                       if(select && !(key->flag & PEK_SELECT)) {
                                                key->flag|=PEK_SELECT;
-                                       else
+                                               pa->flag |= PARS_EDIT_RECALC;
+                                       }
+                                       else if(key->flag & PEK_SELECT) {
                                                key->flag&=~PEK_SELECT;
+                                               pa->flag |= PARS_EDIT_RECALC;
+                                       }
                                }
                        }
                }
@@ -1431,15 +1465,19 @@ void PE_do_lasso_select(short mcords[][2], short moves, short select)
                        Mat4MulVecfl(mat, co);
                        project_short(co,vertco);
                        if(lasso_inside(mcords,moves,vertco[0],vertco[1])){
-                               if(select)
+                               if(select && !(key->flag & PEK_SELECT)) {
                                        key->flag|=PEK_SELECT;
-                               else
+                                       pa->flag |= PARS_EDIT_RECALC;
+                               }
+                               else if(key->flag & PEK_SELECT) {
                                        key->flag&=~PEK_SELECT;
+                                       pa->flag |= PARS_EDIT_RECALC;
+                               }
                        }
                }
        }
 
-       PE_update_selection(ob);
+       PE_update_selection(ob, 1);
 
        BIF_undo_push("Lasso select particles");
 
@@ -1616,14 +1654,14 @@ static void rekey_element_to_time(int index, float path_time)
 
        pa->flag &= ~PARS_REKEY;
 }
-static void remove_tagged_elements(Object *ob, ParticleSystem *psys)
+static int remove_tagged_elements(Object *ob, ParticleSystem *psys)
 {
        ParticleEdit *edit = psys->edit;
        ParticleEditSettings *pset = PE_settings();
        ParticleData *pa, *npa=0, *new_pars=0;
        ParticleEditKey **key, **nkey=0, **new_keys=0;
        ParticleSystemModifierData *psmd;
-       int i, totpart, new_totpart = psys->totpart;
+       int i, totpart, new_totpart = psys->totpart, removed = 0;
 
        if(pset->flag & PE_X_MIRROR) {
                /* mirror tags */
@@ -1635,9 +1673,12 @@ static void remove_tagged_elements(Object *ob, ParticleSystem *psys)
                                PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
        }
 
-       for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++)
-               if(pa->flag & PARS_TAG)
+       for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
+               if(pa->flag & PARS_TAG) {
                        new_totpart--;
+                       removed++;
+               }
+       }
 
        if(new_totpart != psys->totpart) {
                if(new_totpart) {
@@ -1677,6 +1718,8 @@ static void remove_tagged_elements(Object *ob, ParticleSystem *psys)
 
                edit->totkeys = psys_count_keys(psys);
        }
+
+       return removed;
 }
 static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
 {
@@ -2366,7 +2409,7 @@ int PE_brush_particles(void)
        ParticleBrushData *brush;
        float vec1[3], vec2[3];
        short mval[2], mvalo[2], firsttime = 1, dx, dy;
-       int selected = 0, flip;
+       int selected = 0, flip, removed = 0;
 
        if(!PE_can_edit(psys)) return 0;
 
@@ -2440,7 +2483,7 @@ int PE_brush_particles(void)
                                        else
                                                PE_foreach_element(psys, brush_cut, &data);
 
-                                       remove_tagged_elements(ob, psys);
+                                       removed= remove_tagged_elements(ob, psys);
                                        if(pset->flag & PE_KEEP_LENGTHS)
                                                recalc_lengths(psys);
                                        break;
@@ -2535,8 +2578,8 @@ int PE_brush_particles(void)
                        if((pset->flag & PE_KEEP_LENGTHS)==0)
                                recalc_lengths(psys);
 
-                       if(pset->brushtype == PE_BRUSH_ADD) {
-                               if(pset->flag & PE_X_MIRROR)
+                       if(pset->brushtype == PE_BRUSH_ADD || removed) {
+                               if(pset->brushtype == PE_BRUSH_ADD && (pset->flag & PE_X_MIRROR))
                                        PE_mirror_x(1);
                                PE_recalc_world_cos(ob,psys);
                                DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
index 75a438738bb2977fadb1fcbc7798eeceae9e8b25..4f98e966f8ca998d2f8e2f4824a79724d3ed6f9c 100644 (file)
@@ -65,6 +65,7 @@
 
 #include "BKE_action.h"
 #include "BKE_constraint.h"
+#include "BKE_depsgraph.h"
 #include "BKE_global.h"
 #include "BKE_ipo.h"
 #include "BKE_key.h"
@@ -84,6 +85,7 @@
 #include "BSE_time.h"
 
 #include "BIF_editaction.h"
+#include "BIF_editconstraint.h"
 #include "BIF_interface.h"
 #include "BIF_mainqueue.h"
 #include "BIF_resources.h"
@@ -139,11 +141,27 @@ void spaceipo_assign_ipo(SpaceIpo *si, Ipo *ipo)
                                Object *ob= (Object *)si->from;
                                /* constraint exception */
                                if(si->blocktype==ID_CO) {
-                                       bConstraintChannel *conchan= get_constraint_channel(&ob->constraintChannels, si->constname);
-                                       if(conchan) {
-                                               if(conchan->ipo)
-                                                       conchan->ipo->id.us--;
-                                               conchan->ipo= ipo;
+                                       /* check the local constraint ipo */
+                                       if(si->bonename && si->bonename[0] && ob->pose) {
+                                               bPoseChannel *pchan= get_pose_channel(ob->pose, si->bonename);
+                                               bConstraint *con;
+
+                                               for(con= pchan->constraints.first; con; con= con->next)
+                                                       if(strcmp(con->name, si->constname)==0)
+                                                               break;
+                                               if(con) {
+                                                       if(con->ipo)
+                                                               con->ipo->id.us--;
+                                                       con->ipo= ipo;
+                                               }
+                                       }
+                                       else {
+                                               bConstraintChannel *conchan= get_constraint_channel(&ob->constraintChannels, si->constname);
+                                               if(conchan) {
+                                                       if(conchan->ipo)
+                                                               conchan->ipo->id.us--;
+                                                       conchan->ipo= ipo;
+                                               }
                                        }
                                }
                                else if(si->blocktype==ID_FLUIDSIM) { // NT
@@ -1174,6 +1192,11 @@ void do_ipo_buttons(short event)
                        else                    ei->flag &= ~IPO_VISIBLE;
                }
                break;
+       case B_IPOREDRAW:
+               DAG_object_flush_update(G.scene, ob, OB_RECALC);
+               allqueue(REDRAWVIEW3D, 0);
+               allqueue(REDRAWIPO, 0);
+               break;
        }
 }
 
@@ -1270,11 +1293,14 @@ void ipo_buttons(void)
                }
                else if(G.sipo->blocktype==ID_CO) {
                        
-                       if(G.sipo->from && G.sipo->actname[0]==0)
+                       if(ob->pose==NULL)
                                uiDefIconButBitS(block, TOG, OB_ACTION_OB, B_IPO_ACTION_OB, ICON_ACTION,        xco,0,XIC,YIC, &(ob->ipoflag), 0, 0, 0, 0, "Sets Ipo to be included in an Action or not");
                        else {
-                               uiSetButLock(1, "Pose Constraint Ipo cannot be switched");
-                               uiDefIconButS(block, TOG, 1, ICON_ACTION,       xco,0,XIC,YIC, &fake1, 0, 0, 0, 0, "Ipo is connected to Pose Action");
+                               bConstraint *con= get_active_constraint(ob);
+                               if(con)
+                                       uiDefIconButBitS(block, TOGN, CONSTRAINT_OWN_IPO, B_IPOREDRAW, ICON_ACTION,     xco,0,XIC,YIC, &con->flag, 0, 0, 0, 0, 
+                                                                        (con->flag & CONSTRAINT_OWN_IPO)?"Ipo is connected to Constraint itself":"Ipo is connected to Pose Action"
+                                                                        );
                        }
                        xco+= XIC;
                }
index 5d15dbf47b068365995329a87c6f3e0d2e63f3e8..d711419a9277ff22f0d0307e40afb7d55b21176b 100644 (file)
@@ -407,7 +407,7 @@ static int heat_ray_check_func(Isect *is, RayFace *face)
 
        if(v4) CalcNormFloat4(v1, v2, v3, v4, nor);
        else CalcNormFloat(v1, v2, v3, nor);
-       
+
        return (INPR(nor, is->vec) < 0);
 }
 
@@ -605,8 +605,9 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numbones,
 {
        LaplacianSystem *sys;
        MFace *mface;
-       float solution;
-       int a, aflip, totface, j, thrownerror = 0;
+       float solution, weight;
+       int *vertsflipped = NULL;
+       int a, totface, j, bbone, firstsegment, lastsegment, thrownerror = 0;
 
        /* count triangles */
        for(totface=0, a=0, mface=me->mface; a<me->totface; a++, mface++) {
@@ -628,11 +629,31 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numbones,
 
        laplacian_system_construct_end(sys);
 
+       if(dgroupflip) {
+               vertsflipped = MEM_callocN(sizeof(int)*me->totvert, "vertsflipped");
+               for(a=0; a<me->totvert; a++)
+                       vertsflipped[a] = mesh_get_x_mirror_vert(ob, a);
+       }
+
        /* compute weights per bone */
        for(j=0; j<numbones; j++) {
                if(!selected[j])
                        continue;
 
+               firstsegment= (j == 0 || dgrouplist[j-1] != dgrouplist[j]);
+               lastsegment= (j == numbones-1 || dgrouplist[j] != dgrouplist[j+1]);
+               bbone= !(firstsegment && lastsegment);
+
+               /* clear weights */
+               if(bbone && firstsegment) {
+                       for(a=0; a<me->totvert; a++) {
+                               remove_vert_defgroup(ob, dgrouplist[j], a);
+                               if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0)
+                                       remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
+                       }
+               }
+
+               /* fill right hand side */
                laplacian_begin_solve(sys, -1);
 
                for(a=0; a<me->totvert; a++)
@@ -640,24 +661,39 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numbones,
                                laplacian_add_right_hand_side(sys, a,
                                        sys->heat.H[a]*sys->heat.p[a]);
 
+               /* solve */
                if(laplacian_system_solve(sys)) {
+                       /* load solution into vertex groups */
                        for(a=0; a<me->totvert; a++) {
                                solution= laplacian_system_get_solution(a);
-
-                               if(solution > WEIGHT_LIMIT)
-                                       add_vert_to_defgroup(ob, dgrouplist[j], a, solution,
-                                               WEIGHT_REPLACE);
-                               else
-                                       remove_vert_defgroup(ob, dgrouplist[j], a);
-
-                               /* do same for mirror */
-                               aflip = (dgroupflip)? mesh_get_x_mirror_vert(ob, a): 0;
-                               if (dgroupflip && dgroupflip[j] && aflip >= 0) {
+                               
+                               if(bbone) {
+                                       if(solution > 0.0f)
+                                               add_vert_to_defgroup(ob, dgrouplist[j], a, solution,
+                                                       WEIGHT_ADD);
+                               }
+                               else {
                                        if(solution > WEIGHT_LIMIT)
-                                               add_vert_to_defgroup(ob, dgroupflip[j], aflip,
-                                                       solution, WEIGHT_REPLACE);
+                                               add_vert_to_defgroup(ob, dgrouplist[j], a, solution,
+                                                       WEIGHT_REPLACE);
                                        else
-                                               remove_vert_defgroup(ob, dgroupflip[j], aflip);
+                                               remove_vert_defgroup(ob, dgrouplist[j], a);
+                               }
+
+                               /* do same for mirror */
+                               if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
+                                       if(bbone) {
+                                               if(solution > 0.0f)
+                                                       add_vert_to_defgroup(ob, dgroupflip[j], vertsflipped[a],
+                                                               solution, WEIGHT_ADD);
+                                       }
+                                       else {
+                                               if(solution > WEIGHT_LIMIT)
+                                                       add_vert_to_defgroup(ob, dgroupflip[j], vertsflipped[a],
+                                                               solution, WEIGHT_REPLACE);
+                                               else
+                                                       remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
+                                       }
                                }
                        }
                }
@@ -667,9 +703,26 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numbones,
                        thrownerror= 1;
                        break;
                }
+
+               /* remove too small vertex weights */
+               if(bbone && lastsegment) {
+                       for(a=0; a<me->totvert; a++) {
+                               weight= get_vert_defgroup(ob, dgrouplist[j], a);
+                               if(weight > 0.0f && weight <= WEIGHT_LIMIT)
+                                       remove_vert_defgroup(ob, dgrouplist[j], a);
+
+                               if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
+                                       weight= get_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
+                                       if(weight > 0.0f && weight <= WEIGHT_LIMIT)
+                                               remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
+                               }
+                       }
+               }
        }
 
        /* free */
+       if(vertsflipped) MEM_freeN(vertsflipped);
+
        RE_ray_tree_free(sys->heat.raytree);
        MEM_freeN(sys->heat.vface);
 
index d901644c19f9077ef7c146f6ba7043a68591cac9..d06208ea503bc6bf130c8f1e9336faeaf0933f5d 100644 (file)
@@ -108,6 +108,7 @@ void sort_faces(void);
 #include "PIL_time.h"
 
 #include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
 
 /* from rendercode.c */
 #define VECMUL(dest, f)                  dest[0]*= f; dest[1]*= f; dest[2]*= f
@@ -945,6 +946,7 @@ static ScrArea *biggest_image_area(void)
 
 typedef struct BakeRender {
        Render *re;
+       struct Object *actob;
        int event, tot, ready;
 } BakeRender;
 
@@ -952,7 +954,7 @@ static void *do_bake_render(void *bake_v)
 {
        BakeRender *bkr= bake_v;
        
-       bkr->tot= RE_bake_shade_all_selected(bkr->re, bkr->event);
+       bkr->tot= RE_bake_shade_all_selected(bkr->re, bkr->event, bkr->actob);
        bkr->ready= 1;
        
        return NULL;
@@ -971,6 +973,8 @@ void objects_bake_render_menu(void)
 /* all selected meshes with UV maps are rendered for current scene visibility */
 void objects_bake_render(short event)
 {
+       Object *actob= OBACT;
+       int active= G.scene->r.bake_flag & R_BAKE_TO_ACTIVE;
        short prev_r_raytrace= 0, prev_wo_amb_occ= 0;
        
        if(event==0) event= G.scene->r.bake_mode;
@@ -980,13 +984,16 @@ void objects_bake_render(short event)
                return;  
        }        
        
+       if(active && !actob)
+               return;
+               
        if(event>0) {
                Render *re= RE_NewRender("_Bake View_");
                ScrArea *area= biggest_image_area();
                ListBase threads;
                BakeRender bkr;
                int timer=0, tot, sculptmode= G.f & G_SCULPTMODE;
-               
+
                if(sculptmode) set_sculptmode();
                
                if(event==1) event= RE_BAKE_ALL;
@@ -1001,19 +1008,20 @@ void objects_bake_render(short event)
                        }
 
                        /* If raytracing or AO is disabled, switch it on temporarily for baking. */
-                       prev_r_raytrace = (G.scene->r.mode & R_RAYTRACE) != 0;
                        prev_wo_amb_occ = (G.scene->world->mode & WO_AMB_OCC) != 0;
-
-                       G.scene->r.mode |= R_RAYTRACE;
                        G.scene->world->mode |= WO_AMB_OCC;
                }
+               if(event==RE_BAKE_AO || actob) {
+                       prev_r_raytrace = (G.scene->r.mode & R_RAYTRACE) != 0;
+                       G.scene->r.mode |= R_RAYTRACE;
+               }
                
                waitcursor(1);
                RE_test_break_cb(re, thread_break);
                g_break= 0;
                G.afbreek= 0;   /* blender_test_break uses this global */
                
-               RE_Database_Baking(re, G.scene, event);
+               RE_Database_Baking(re, G.scene, event, actob);
                
                /* baking itself is threaded, cannot use test_break in threads. we also update optional imagewindow */
        
@@ -1021,6 +1029,7 @@ void objects_bake_render(short event)
                bkr.re= re;
                bkr.event= event;
                bkr.ready= 0;
+               bkr.actob= actob;
                BLI_insert_thread(&threads, &bkr);
                
                while(bkr.ready==0) {
@@ -1048,21 +1057,26 @@ void objects_bake_render(short event)
                if(tot==0) error("No Images found to bake to");
                else {
                        Image *ima;
-                       /* force OpenGL reload */
+                       /* force OpenGL reload and mipmap recalc */
                        for(ima= G.main->image.first; ima; ima= ima->id.next) {
                                if(ima->ok==IMA_OK_LOADED) {
                                        ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
-                                       if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
+                                       if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
                                                free_realtime_image(ima); 
+                                               imb_freemipmapImBuf(ibuf);
+                                       }
                                }
                        }
                }
                
-                       /* restore raytrace and AO */
-               if(event==RE_BAKE_AO) {
-                       if( prev_wo_amb_occ == 0) G.scene->world->mode &= ~WO_AMB_OCC;
-                       if( prev_r_raytrace == 0) G.scene->r.mode &= ~R_RAYTRACE;
-               }
+               /* restore raytrace and AO */
+               if(event==RE_BAKE_AO)
+                       if(prev_wo_amb_occ == 0)
+                               G.scene->world->mode &= ~WO_AMB_OCC;
+
+               if(event==RE_BAKE_AO || actob)
+                       if(prev_r_raytrace == 0)
+                               G.scene->r.mode &= ~R_RAYTRACE;
                
                allqueue(REDRAWIMAGE, 0);
                allqueue(REDRAWVIEW3D, 0);
@@ -1072,4 +1086,3 @@ void objects_bake_render(short event)
        }
 }
 
-
index 01289113bf151d380b69bf2f10c56aed1f72b692..0da76e36e22b187a31b8917d69940dfe6b6c16b3 100644 (file)
@@ -553,7 +553,7 @@ extern "C"
 {
        Ipo *add_ipo( char *name, int idcode );
        char *getIpoCurveName( IpoCurve * icu );
-       struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, int);
+       struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, char *, int);
        void testhandles_ipocurve(struct IpoCurve *icu);
        void Mat3ToEul(float tmat[][3], float *eul);
 
@@ -766,27 +766,27 @@ void      KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
 
                                        IpoCurve *icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_LOC_X);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X);
                                        
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_LOC_Y);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y);
                                        
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_LOC_Z);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z);
 
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_ROT_X);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X);
 
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_ROT_Y);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y);
 
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_ROT_Z);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z);
 
 
 
@@ -922,27 +922,27 @@ void      KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
 
                                        IpoCurve *icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_LOC_X);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X);
                                        
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_LOC_Y);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y);
                                        
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_LOC_Z);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z);
 
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_ROT_X);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X);
 
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_ROT_Y);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y);
 
                                        icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ");
                                        if (!icu1)
-                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, OB_ROT_Z);
+                                               icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z);
 
 
 
index 1b91a3343dcbc7dc1f9543fead7cb5cf62605bc4..488b434c58abed4ebc98eb2c9004a3092753a2d0 100755 (executable)
@@ -54,7 +54,7 @@ def validate_arguments(args, bc):
             'BF_PROFILE_FLAGS', 'LCGDIR', 'WITH_BF_VERSE', 
             'BF_VERSE_INCLUDE',
             'VERSE_BUILD_BINARY', 'VERSE_BUILD_DIR', 'VERSE_REGEN_PROTO',
-            'BF_TWEAK_MODE',
+            'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
             'WITHOUT_BF_INSTALL',
             'WITH_BF_OPENMP'
            ]
@@ -300,6 +300,7 @@ def read_opts(cfg, args):
         (BoolOption('BF_BUILDINFO', 'Buildtime in splash if true', 'true')),
 
         (BoolOption('BF_TWEAK_MODE', 'Enable tweak mode if true', 'false')),
+               (BoolOption('BF_SPLIT_SRC', 'Split src lib into several chunks if true', 'false')),
         (BoolOption('WITHOUT_BF_INSTALL', 'dont install if true', 'false')),
 
     ) # end of opts.AddOptions()