Revision: 17209
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17209
Author:   campbellbarton
Date:     2008-10-28 19:47:13 +0100 (Tue, 28 Oct 2008)

Log Message:
-----------
added scons option BF_WITH_PYTHON (defined as DISABLE_PYTHON)

Modified Paths:
--------------
    trunk/blender/SConstruct
    trunk/blender/source/blender/SConscript
    trunk/blender/source/blender/blenkernel/SConscript
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/blenkernel/intern/depsgraph.c
    trunk/blender/source/blender/blenkernel/intern/exotic.c
    trunk/blender/source/blender/blenkernel/intern/ipo.c
    trunk/blender/source/blender/blenkernel/intern/material.c
    trunk/blender/source/blender/blenkernel/intern/object.c
    trunk/blender/source/blender/blenkernel/intern/scene.c
    trunk/blender/source/blender/blenkernel/intern/script.c
    trunk/blender/source/blender/blenkernel/intern/text.c
    trunk/blender/source/blender/blenkernel/intern/world.c
    trunk/blender/source/blender/nodes/SConscript
    trunk/blender/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
    trunk/blender/source/blender/src/SConscript
    trunk/blender/source/blender/src/buttons_object.c
    trunk/blender/source/blender/src/drawipo.c
    trunk/blender/source/blender/src/drawscript.c
    trunk/blender/source/blender/src/drawtext.c
    trunk/blender/source/blender/src/drawview.c
    trunk/blender/source/blender/src/editconstraint.c
    trunk/blender/source/blender/src/editface.c
    trunk/blender/source/blender/src/editmesh_add.c
    trunk/blender/source/blender/src/editscreen.c
    trunk/blender/source/blender/src/header_image.c
    trunk/blender/source/blender/src/header_info.c
    trunk/blender/source/blender/src/header_oops.c
    trunk/blender/source/blender/src/header_script.c
    trunk/blender/source/blender/src/header_text.c
    trunk/blender/source/blender/src/header_view3d.c
    trunk/blender/source/blender/src/headerbuttons.c
    trunk/blender/source/blender/src/interface.c
    trunk/blender/source/blender/src/renderwin.c
    trunk/blender/source/blender/src/space.c
    trunk/blender/source/blender/src/toolbox.c
    trunk/blender/source/blender/src/usiblender.c
    trunk/blender/source/creator/SConscript
    trunk/blender/source/creator/creator.c
    trunk/blender/tools/Blender.py
    trunk/blender/tools/btools.py

Modified: trunk/blender/SConstruct
===================================================================
--- trunk/blender/SConstruct    2008-10-28 18:47:01 UTC (rev 17208)
+++ trunk/blender/SConstruct    2008-10-28 18:47:13 UTC (rev 17209)
@@ -277,6 +277,7 @@
     env['WITH_BF_BINRELOC'] = False
     env['BF_BUILDINFO'] = False
     env['BF_NO_ELBEEM'] = True
+    env['WITH_BF_PYTHON'] = False
 
 # lastly we check for root_build_dir ( we should not do before, otherwise we 
might do wrong builddir
 #B.root_build_dir = B.arguments.get('BF_BUILDDIR', 
'..'+os.sep+'build'+os.sep+platform+os.sep)

Modified: trunk/blender/source/blender/SConscript
===================================================================
--- trunk/blender/source/blender/SConscript     2008-10-28 18:47:01 UTC (rev 
17208)
+++ trunk/blender/source/blender/SConscript     2008-10-28 18:47:13 UTC (rev 
17209)
@@ -11,13 +11,17 @@
             'imbuf/SConscript',
             'imbuf/intern/cineon/SConscript',
             'makesdna/SConscript',
-            'python/SConscript',
             'radiosity/SConscript',
             'readblenfile/SConscript',
             'render/SConscript',
             'src/SConscript',
             'nodes/SConscript'])
 
+
+
+if env['WITH_BF_PYTHON']:
+    SConscript(['python/SConscript'])
+
 if env['WITH_BF_YAFRAY']:
     SConscript(['yafray/SConscript'])
 

Modified: trunk/blender/source/blender/blenkernel/SConscript
===================================================================
--- trunk/blender/source/blender/blenkernel/SConscript  2008-10-28 18:47:01 UTC 
(rev 17208)
+++ trunk/blender/source/blender/blenkernel/SConscript  2008-10-28 18:47:13 UTC 
(rev 17209)
@@ -19,8 +19,11 @@
 
 defs = ''
 
+if not env['WITH_BF_PYTHON']:
+       defs += 'DISABLE_PYTHON'
+
 if env['WITH_BF_INTERNATIONAL']:
-       defs += 'WITH_FREETYPE2'
+       defs += ' WITH_FREETYPE2'
 
 if env['WITH_BF_VERSE']:
        defs += ' WITH_VERSE'
@@ -49,4 +52,7 @@
 if env['WITH_BF_PLAYER']:
     SConscript(['bad_level_call_stubs/SConscript'])
 
+if env['WITH_BF_PYTHON']:
+       defs += 'DISABLE_PYTHON'
+
 env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = 
Split(incs), defines = Split(defs), libtype=['core','player'], priority = [65, 
20] )

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c 2008-10-28 
18:47:01 UTC (rev 17208)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c 2008-10-28 
18:47:13 UTC (rev 17209)
@@ -64,8 +64,9 @@
 #include "BKE_library.h"
 #include "BKE_idprop.h"
 
-
+#ifndef DISABLE_PYTHON
 #include "BPY_extern.h"
+#endif
 
 #include "blendef.h"
 
@@ -1814,6 +1815,7 @@
        sizelike_evaluate /* evaluate */
 };
 
+
 /* ----------- Python Constraint -------------- */
 
 static void pycon_free (bConstraint *con)
@@ -1888,8 +1890,10 @@
                constraint_target_to_mat4(ct->tar, ct->subtarget, ct->matrix, 
CONSTRAINT_SPACE_WORLD, ct->space, con->headtail);
                
                /* only execute target calculation if allowed */
+#ifndef DISABLE_PYTHON
                if (G.f & G_DOSCRIPTLINKS)
                        BPY_pyconstraint_target(data, ct);
+#endif
        }
        else if (ct)
                Mat4One(ct->matrix);
@@ -1897,6 +1901,9 @@
 
 static void pycon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase 
*targets)
 {
+#ifdef DISABLE_PYTHON
+       return;
+#else
        bPythonConstraint *data= con->data;
        
        /* only evaluate in python if we're allowed to do so */
@@ -1913,6 +1920,7 @@
        
        /* Now, run the actual 'constraint' function, which should only access 
the matrices */
        BPY_pyconstraint_eval(data, cob, targets);
+#endif /* DISABLE_PYTHON */
 }
 
 static bConstraintTypeInfo CTI_PYTHON = {

Modified: trunk/blender/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/depsgraph.c  2008-10-28 
18:47:01 UTC (rev 17208)
+++ trunk/blender/source/blender/blenkernel/intern/depsgraph.c  2008-10-28 
18:47:13 UTC (rev 17209)
@@ -79,7 +79,9 @@
 #include "MEM_guardedalloc.h"
 #include "blendef.h"
 
+#ifndef DISABLE_PYTHON
 #include "BPY_extern.h"
+#endif
 
  #include "depsgraph_private.h"
  
@@ -313,6 +315,7 @@
 
                                if ((icu->driver->flag & 
IPO_DRIVER_FLAG_INVALID) || (icu->driver->name[0] == '\0'))
                                        continue; /* empty or invalid 
expression */
+#ifndef DISABLE_PYTHON
                                else {
                                        /* now we need refs to all objects 
mentioned in this
                                         * pydriver expression, to call 
'dag_add_relation'
@@ -334,6 +337,7 @@
                                                MEM_freeN(obarray);
                                        }
                                }
+#endif /* DISABLE_PYTHON */
                        }
                        else if (icu->driver->ob) {
                                node1 = dag_get_node(dag, icu->driver->ob);

Modified: trunk/blender/source/blender/blenkernel/intern/exotic.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/exotic.c     2008-10-28 
18:47:01 UTC (rev 17208)
+++ trunk/blender/source/blender/blenkernel/intern/exotic.c     2008-10-28 
18:47:13 UTC (rev 17209)
@@ -117,7 +117,9 @@
 #include "BKE_curve.h"
 #include "BKE_customdata.h"
 
+#ifndef DISABLE_PYTHON
 #include "BPY_extern.h"
+#endif
 
 #include "blendef.h"
 
@@ -2427,6 +2429,7 @@
                                                read_stl_mesh_binary(name);
                                        retval = 1;
                                }
+#ifndef DISABLE_PYTHON
                                // TODO: this should not be in the kernel...
                                else { // unknown format, call Python 
importloader 
                                        if (BPY_call_importloader(name)) {
@@ -2436,6 +2439,7 @@
                                        }       
                                
                                }
+#endif /* DISABLE_PYTHON */
                                waitcursor(0);
                        }
                }

Modified: trunk/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ipo.c        2008-10-28 
18:47:01 UTC (rev 17208)
+++ trunk/blender/source/blender/blenkernel/intern/ipo.c        2008-10-28 
18:47:13 UTC (rev 17209)
@@ -73,7 +73,10 @@
 #include "BKE_main.h"
 #include "BKE_mesh.h"
 #include "BKE_object.h"
+
+#ifndef DISABLE_PYTHON
 #include "BPY_extern.h" /* for BPY_pydriver_eval() */
+#endif
 
 #define SMALL -1.0e-10
 
@@ -1008,6 +1011,7 @@
  */
 static float eval_driver (IpoDriver *driver, float ipotime)
 {
+#ifndef DISABLE_PYTHON
        /* currently, drivers are either PyDrivers (evaluating a PyExpression, 
or Object/Pose-Channel transforms) */
        if (driver->type == IPO_DRIVER_TYPE_PYTHON) {
                /* check for empty or invalid expression */
@@ -1022,7 +1026,10 @@
                 */
                return BPY_pydriver_eval(driver);
        }
-       else {
+       else
+#endif /* DISABLE_PYTHON */
+       {
+
                Object *ob= driver->ob;
                
                /* must have an object to evaluate */

Modified: trunk/blender/source/blender/blenkernel/intern/material.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/material.c   2008-10-28 
18:47:01 UTC (rev 17208)
+++ trunk/blender/source/blender/blenkernel/intern/material.c   2008-10-28 
18:47:13 UTC (rev 17209)
@@ -59,7 +59,9 @@
 #include "BKE_node.h"
 #include "BKE_utildefines.h"
 
+#ifndef DISABLE_PYTHON
 #include "BPY_extern.h"
+#endif
 
 #include "GPU_material.h"
 
@@ -78,7 +80,9 @@
        MTex *mtex;
        int a;
 
+#ifndef DISABLE_PYTHON
        BPY_free_scriptlink(&ma->scriptlink);
+#endif
        
        for(a=0; a<MAX_MTEX; a++) {
                mtex= ma->mtex[a];
@@ -201,8 +205,10 @@
                        id_us_plus((ID *)man->mtex[a]->tex);
                }
        }
-       
+
+#ifndef DISABLE_PYTHON 
        BPY_copy_scriptlink(&ma->scriptlink);
+#endif
        
        if(ma->ramp_col) man->ramp_col= MEM_dupallocN(ma->ramp_col);
        if(ma->ramp_spec) man->ramp_spec= MEM_dupallocN(ma->ramp_spec);

Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c     2008-10-28 
18:47:01 UTC (rev 17208)
+++ trunk/blender/source/blender/blenkernel/intern/object.c     2008-10-28 
18:47:13 UTC (rev 17209)
@@ -111,7 +111,9 @@
 
 #include "LBM_fluidsim.h"
 
+#ifndef DISABLE_PYTHON
 #include "BPY_extern.h"
+#endif
 
 #include "GPU_material.h"
 
@@ -269,8 +271,10 @@
        free_constraints(&ob->constraints);
        free_constraint_channels(&ob->constraintChannels);
        free_nlastrips(&ob->nlastrips);
-       
+
+#ifndef DISABLE_PYTHON 
        BPY_free_scriptlink(&ob->scriptlink);
+#endif
        
        if(ob->pd){
                if(ob->pd->tex)
@@ -637,9 +641,9 @@
        
        camn= copy_libblock(cam);
        id_us_plus((ID *)camn->ipo);
-
+#ifndef DISABLE_PYTHON
        BPY_copy_scriptlink(&camn->scriptlink);
-       
+#endif 
        return camn;
 }
 
@@ -786,9 +790,9 @@
        id_us_plus((ID *)lan->ipo);
 
        if (la->preview) lan->preview = BKE_previewimg_copy(la->preview);
-
+#ifndef DISABLE_PYTHON
        BPY_copy_scriptlink(&la->scriptlink);
-       
+#endif
        return lan;
 }
 
@@ -846,7 +850,9 @@
 
 void free_camera(Camera *ca)
 {
+#ifndef DISABLE_PYTHON
        BPY_free_scriptlink(&ca->scriptlink);
+#endif
 }
 
 void free_lamp(Lamp *la)
@@ -855,8 +861,9 @@
        int a;
 
        /* scriptlinks */
-               
+#ifndef DISABLE_PYTHON
        BPY_free_scriptlink(&la->scriptlink);
+#endif
 
        for(a=0; a<MAX_MTEX; a++) {
                mtex= la->mtex[a];
@@ -1202,9 +1209,9 @@
                modifier_copyData(md, nmd);
                BLI_addtail(&obn->modifiers, nmd);
        }
-       
+#ifndef DISABLE_PYTHON 
        BPY_copy_scriptlink(&ob->scriptlink);
-       
+#endif
        obn->prop.first = obn->prop.last = NULL;
        copy_properties(&obn->prop, &ob->prop);
        
@@ -1918,10 +1925,11 @@
                
                constraints_clear_evalob(cob);
        }
-       
+#ifndef DISABLE_PYTHON
        if(ob->scriptlink.totscript && !during_script()) {
                if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript((ID *)ob, 
SCRIPT_REDRAW);
        }
+#endif
        
        /* set negative scale flag in object */
        Crossf(vec, ob->obmat[0], ob->obmat[1]);
@@ -2288,7 +2296,9 @@
                        }
                        else
                                where_is_object(ob);
+#ifndef DISABLE_PYTHON
                        if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript((ID *)ob, 
SCRIPT_OBJECTUPDATE);
+#endif
                }
                
                if(ob->recalc & OB_RECALC_DATA) {
@@ -2364,7 +2374,9 @@
                                                psys_get_modifier(ob, 
psys)->flag &= ~eParticleSystemFlag_psys_updated;
                                }
                        }
+#ifndef DISABLE_PYTHON
                        if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript((ID *)ob, 
SCRIPT_OBDATAUPDATE);
+#endif
                }
 
                /* the no-group proxy case, we call update */

Modified: trunk/blender/source/blender/blenkernel/intern/scene.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/scene.c      2008-10-28 
18:47:01 UTC (rev 17208)
+++ trunk/blender/source/blender/blenkernel/intern/scene.c      2008-10-28 
18:47:13 UTC (rev 17209)
@@ -82,7 +82,10 @@
 #include "BIF_previewrender.h"
 #include "BIF_editseq.h"
 
+#ifndef DISABLE_PYTHON
 #include "BPY_extern.h"
+#endif
+
 #include "BLI_arithb.h"
 #include "BLI_blenlib.h"
 
@@ -139,7 +142,10 @@

@@ Diff output truncated at 10240 characters. @@

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

Reply via email to