Patch 5105 by Joshua Leung (Aligorith), slightly modified by me
authorNathan Letwory <nathan@letworyinteractive.com>
Wed, 18 Oct 2006 05:45:47 +0000 (05:45 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Wed, 18 Oct 2006 05:45:47 +0000 (05:45 +0000)
* Add WITH_BF_YAFRAY, which per default is 'true', so no visible changes for developers (and users).

Set WITH_BF_YAFRAY to 'false', and you'll save some major compile time :) Also handy if you're strapped for memory and compilation fails on yafray compilation due
 to this.

- this commit also has a few whitespace changes and
- made BF_NO_ELBEEM a proper BoolOption. This will be renamed to WITH_BF_ELBEEM in the near future...

16 files changed:
SConstruct
config/darwin-config.py
config/linux2-config.py
config/linuxcross-config.py
config/openbsd3-config.py
config/sunos5-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
intern/SConscript
source/blender/SConscript
source/blender/render/SConscript
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/src/SConscript
source/blender/src/buttons_scene.c
tools/btools.py

index 46a563300ecad9477a683b959d063d986c40dbfe..017fed45921d57d7a4c08cb541f62c1f9cb9f7fe 100644 (file)
@@ -92,10 +92,10 @@ quickie = B.arguments.get('BF_QUICK', None)
 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
 
 if quickdebug:
-       B.quickdebug=string.split(quickdebug, ',')
+    B.quickdebug=string.split(quickdebug, ',')
 else:
-       B.quickdebug=[]
-               
+    B.quickdebug=[]
+
 if quickie:
     B.quickie=string.split(quickie,',')
 else:
@@ -120,9 +120,9 @@ env.SConscriptChdir(0)
 cc = B.arguments.get('CC', None)
 cxx = B.arguments.get('CXX', None)
 if cc:
-       env['CC'] = cc
+    env['CC'] = cc
 if cxx:
-       env['CXX'] = cxx
+    env['CXX'] = cxx
 
 if env['CC'] in ['cl', 'cl.exe'] and sys.platform=='win32':
     platform = 'win32-vc'
@@ -161,15 +161,15 @@ opts = btools.read_opts(optfiles, B.arguments)
 opts.Update(env)
 
 # disable elbeem (fluidsim) compilation?
-if env['BF_NO_ELBEEM'] == 'true':
-       env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
-       env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
-       env['CCFLAGS'].append('-DDISABLE_ELBEEM')
+if env['BF_NO_ELBEEM'] == 1:
+    env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
+    env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
+    env['CCFLAGS'].append('-DDISABLE_ELBEEM')
 
 #check for additional debug libnames
 
 if env.has_key('BF_DEBUG_LIBS'):
-       B.quickdebug += env['BF_DEBUG_LIBS']
+    B.quickdebug += env['BF_DEBUG_LIBS']
 
 printdebug = B.arguments.get('BF_LISTDEBUG', 0)
 
@@ -181,8 +181,8 @@ if env['OURPLATFORM'] == 'linux2' :
         #include "AL/alut.h"
         int main(int argc, char **argv)
         {
-               alutGetMajorVersion();
-               return 0;
+            alutGetMajorVersion();
+            return 0;
         }
         """
 
index 7257485d8c73195264f9f22ccbf936e63c14befa..0d4bc5c0be01b58316eb357707480f172b4883d5 100644 (file)
@@ -82,6 +82,8 @@ BF_SOLID = '#extern/solid'
 BF_SOLID_INC = '${BF_SOLID}'
 BF_SOLID_LIB = 'extern_solid'
 
+WITH_BF_YAFRAY = 'true'
+
 #WITH_BF_NSPR = 'true'
 #BF_NSPR = $(LIBDIR)/nspr
 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
index f77ffe47b22726eb5212cf5227141ecc0a45cede..f7d84d228f3ecc66eebbafe38e4768a64847e3ed 100644 (file)
@@ -75,6 +75,8 @@ BF_SOLID = '#extern/solid'
 BF_SOLID_INC = '${BF_SOLID}'
 BF_SOLID_LIB = 'extern_solid'
 
+WITH_BF_YAFRAY = 'true'
+
 #WITH_BF_NSPR = 'true'
 #BF_NSPR = $(LIBDIR)/nspr
 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
index fba10bbb089767c9127757569f8f0aa13fc18782..2d833d2fcfc954eb8d4c60d2b3604658d3a0d3b1 100644 (file)
@@ -4,6 +4,8 @@ LIBDIR = '${LCGDIR}'
 WITH_BF_VERSE = 'false'
 BF_VERSE_INCLUDE = "#extern/verse/dist"
 
+WITH_BF_YAFRAY = 'true'
+
 BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '2.4'
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
index abeb9186bb8ffd3d78e9687d3a1657ea74b6c7db..b44e79eb2a6e437645484fae354cfbbaa48572a4 100644 (file)
@@ -76,6 +76,8 @@ BF_SOLID = '#extern/solid'
 BF_SOLID_INC = '${BF_SOLID}'
 BF_SOLID_LIB = 'extern_solid'
 
+WITH_BF_YAFRAY = 'true'
+
 #WITH_BF_NSPR = 'true'
 #BF_NSPR = $(LIBDIR)/nspr
 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
index 436217c1be1ef06fc5194a4ec9c877d2c5ce77a0..de342c40158a306ea9a3db06a18d89965b2314cd 100644 (file)
@@ -78,6 +78,8 @@ BF_SOLID = '#extern/solid'
 BF_SOLID_INC = '${BF_SOLID}'
 BF_SOLID_LIB = 'extern_solid'
 
+WITH_BF_YAFRAY = 'true'
+
 #WITH_BF_NSPR = 'true'
 #BF_NSPR = $(LIBDIR)/nspr
 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
index 6208c266b5b33bdf754dce6c937760169f57b6f3..e23e6436c5912e30ad2e3fb48709b72725a027f8 100644 (file)
@@ -91,6 +91,8 @@ BF_SOLID = '#extern/solid'
 BF_SOLID_INC = '${BF_SOLID}'
 BF_SOLID_LIB = 'extern_solid'
 
+WITH_BF_YAFRAY = 'true'
+
 #WITH_BF_NSPR = 'true'
 #BF_NSPR = $(LIBDIR)/nspr
 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
index b3edcab7e2b56f01d54572962c329c5e6aecd691..cbed1ccbc5ee6c7ba7fff5db8bd0d1d1d4345897 100644 (file)
@@ -92,6 +92,8 @@ BF_SOLID = '#extern/solid'
 BF_SOLID_INC = '${BF_SOLID}'
 BF_SOLID_LIB = 'extern_solid'
 
+WITH_BF_YAFRAY = 'true'
+
 #WITH_BF_NSPR = 'true'
 #BF_NSPR = $(LIBDIR)/nspr
 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
index ecb7f29fab6b9ea22bdbd5d76bc5c7a9ca5d7a6b..f6092b7bd0299dc078f2bd94492217aeb48c20e9 100644 (file)
@@ -20,10 +20,10 @@ SConscript(['SoundSystem/SConscript',
 # perhaps get rid of intern/csg?
 NEW_CSG='false'
 
-if env['BF_NO_ELBEEM'] == 'false':
-       SConscript(['elbeem/SConscript'])
+if env['BF_NO_ELBEEM'] == 0:
+    SConscript(['elbeem/SConscript'])
 
 if NEW_CSG=='false':
-       SConscript(['bsp/SConscript'])
+    SConscript(['bsp/SConscript'])
 else:
-       SConscript(['csg/SConscript'])
+    SConscript(['csg/SConscript'])
index 9ead445aab16206a2dea34d78ac124bb1a0e4502..75bd5d34822c91964d97becb59534c2aed57a43b 100644 (file)
@@ -15,8 +15,10 @@ SConscript(['avi/SConscript',
             'radiosity/SConscript',
             'readblenfile/SConscript',
             'render/SConscript',
-            'src/SConscript',
-            'yafray/SConscript'])
+            'src/SConscript'])
+
+if env['WITH_BF_YAFRAY'] == 1:
+    SConscript(['yafray/SConscript'])
 
 if env['WITH_BF_INTERNATIONAL'] == 1:
     SConscript (['ftfont/SConscript'])
index 6c1f67d69dfc143d54fda5fe758df79e0ee3aae8..b1bc9673f23310cbabd9a9de2dbe460ca5b87a29 100644 (file)
@@ -6,10 +6,15 @@ sources = env.Glob('intern/source/*.c')
 
 incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna'
 incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
-incs += ' ../quicktime ../include ../../kernel/gen_messaging ../yafray'
+incs += ' ../quicktime ../include ../../kernel/gen_messaging'
 
 defs = []
 
+if env['WITH_BF_YAFRAY'] == 1:
+    incs += ' ../yafray'
+else:
+    defs.append('DISABLE_YAFRAY')
+
 if env['WITH_BF_QUICKTIME'] == 1:
     defs.append('WITH_QUICKTIME')
     incs += ' ' + env['BF_QUICKTIME_INC']
index aedb5aa13c0268d8677b4f7a3147a39599308a00..8d23269166c8a9f562379909517ebab322cc879a 100644 (file)
 #include "texture.h"
 #include "zbuf.h"
 
+#ifndef DISABLE_YAFRAY /* disable yafray */
+
 #include "YafRay_Api.h"
 
 /* yafray: Identity transform 'hack' removed, exporter now transforms vertices back to world.
  * The main changes are in RE_rotateBlenderScene().
  */
 
+#endif /* disable yafray */
+
 /* ------------------------------------------------------------------------- */
 /* Local functions                                                           */
 /* ------------------------------------------------------------------------- */
@@ -2294,6 +2298,7 @@ static LampRen *add_render_lamp(Render *re, Object *ob)
        }
        else lar->ray_totsamp= 0;
        
+#ifndef DISABLE_YAFRAY
        /* yafray: photonlight and other params */
        if (re->r.renderer==R_YAFRAY) {
                lar->YF_numphotons = la->YF_numphotons;
@@ -2307,6 +2312,7 @@ static LampRen *add_render_lamp(Render *re, Object *ob)
                lar->YF_glowofs = la->YF_glowofs;
                lar->YF_glowtype = la->YF_glowtype;
        }
+#endif /* disable yafray */
 
        lar->spotsi= la->spotsize;
        if(lar->mode & LA_HALO) {
@@ -3258,6 +3264,7 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                
                /* OB_DONE means the object itself got duplicated, so was already converted */
                if (ob->flag & OB_DONE) {
+#ifndef DISABLE_YAFRAY
                        /* yafray: for some reason this part was removed, but yafray really needs it...
                           Dupliverts objects are treated as instances of an original 'sourceobject',
                           which needs to be included in the renderlist here.
@@ -3270,11 +3277,13 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                                init_render_object(re, ob, NULL, 0, 0);
                                ob->flag |= OB_DONE;
                        }
+#endif /* disable yafray */
                }
                else if( (base->lay & lay) || (ob->type==OB_LAMP && (base->lay & re->scene->lay)) ) {
                        if(ob->transflag & OB_DUPLI) {
                                
                                /* exception: mballs! */
+#ifndef DISABLE_YAFRAY
                                /* yafray: except for mballs, include at least one copy of a dupliframe object in the renderlist. */
                                if (re->r.renderer==R_YAFRAY) {
                                        if ((ob->type!=OB_MBALL) && ((ob->transflag & OB_DUPLIFRAMES)!=0)) {
@@ -3282,6 +3291,7 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                                                init_render_object(re, ob, NULL, 0, 0);
                                        }
                                }
+#endif /* disable yafray */
                                /* before make duplis, update particle for current frame */
                                if(ob->transflag & OB_DUPLIVERTS) {
                                        PartEff *paf= give_parteff(ob);
@@ -3303,6 +3313,7 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                                                Mat4CpyMat4(obd->obmat, dob->mat);
                                                
                                                if(obd->type!=OB_MBALL) {
+#ifndef DISABLE_YAFRAY
                                                        /* yafray: special case handling of duplivert/dupligroup objects.
                                                           Only one copy included in renderlist(see above), all others treated as instance of that.
                                                           So only need to store name and matrix. Exception are lamps. lattices, armatures and camera's */
@@ -3321,6 +3332,9 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                                                                else init_render_object(re, obd, ob, dob->index, 0);
                                                        }
                                                        else init_render_object(re, obd, ob, dob->index, 0);
+#else
+                                                       init_render_object(re, obd, ob, dob->index, 0);
+#endif /* disable yafray */
                                                }
                                                
                                                if(re->test_break()) break;
@@ -3329,6 +3343,7 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                                }
                        }
                        else {
+#ifndef DISABLE_YAFRAY
                                /* yafray: linked data objects treated similarly to dupliverts,
                                   If object not known yet (not in renderlist), include in the renderlist,
                                   otherwise treat as instance of it, so only name and matrix are stored 
@@ -3350,6 +3365,9 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                                                init_render_object(re, ob, NULL, 0, 0);
                                }
                                else init_render_object(re, ob, NULL, 0, 0);
+#else
+                               init_render_object(re, ob, NULL, 0, 0);
+#endif /* disable yafray */
                        }
 
                }
index 5bbc3174a3c8a1562a67997a6c7cecb27523acd0..f21ee9c0c1abb820e0f702fe4f621b6df518601b 100644 (file)
 
 #include "BSE_sequence.h"  /* <----------------- bad!!! */
 
+#ifndef DISABLE_YAFRAY
 /* yafray: include for yafray export/render */
 #include "YafRay_Api.h"
 
+#endif /* disable yafray */
+
 /* internal */
 #include "render_types.h"
 #include "renderpipeline.h"
@@ -1675,7 +1678,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
        re->display_draw(re->result, NULL);
 }
 
-
+#ifndef DISABLE_YAFRAY
 /* yafray: main yafray render/export call */
 static void yafrayRender(Render *re)
 {
@@ -1734,6 +1737,8 @@ static void yafrayRender(Render *re)
        RE_Database_Free(re);
 }
 
+#endif /* disable yafray */
+
 
 /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
 
@@ -1753,10 +1758,14 @@ static void do_render_all_options(Render *re)
                
        }
        else {
+#ifndef DISABLE_YAFRAY
                if(re->r.renderer==R_YAFRAY)
                        yafrayRender(re);
                else
                        do_render_composite_fields_blur_3d(re);
+#else
+               do_render_composite_fields_blur_3d(re);
+#endif
        }
        
        re->i.lastframetime= PIL_check_seconds_timer()- re->i.starttime;
index 0663cb01c5d83ad6c5e972f39d593ab1db4bf70e..2e0f632ca85190804d93ff75e911e3c89bf35588 100644 (file)
@@ -20,6 +20,9 @@ incs += ' ' + env['BF_OPENGL_INC']
 
 defs = []
 
+if env['WITH_BF_YAFRAY'] == 0:
+    defs.append('DISABLE_YAFRAY')
+
 if env['WITH_BF_INTERNATIONAL'] == 1:
     incs += ' ../ftfont'
     defs.append('INTERNATIONAL')
@@ -37,8 +40,8 @@ if env['WITH_BF_FFMPEG'] == 1:
     incs += ' ' + env['BF_FFMPEG_INC']
 
 if env['WITH_BF_VERSE']:
-       defs.append('WITH_VERSE')
-       incs += ' ' + env['BF_VERSE_INCLUDE']
+    defs.append('WITH_VERSE')
+    incs += ' ' + env['BF_VERSE_INCLUDE']
 
 # TODO buildinfo
 if env['BF_BUILDINFO'] == 1:
index f5f19cbc09f003e48ca459accd95c84df077a660..af20302189848eadeab53dbc0b093daa63bf01ab 100644 (file)
@@ -1210,9 +1210,14 @@ static void render_panel_render(void)
 
        uiBlockBeginAlign(block);
        uiDefBut(block, BUT,B_DORENDER,"RENDER",        369, 164, 191,37, 0, 0, 0, 0, 0, "Start the rendering");
+#ifndef DISABLE_YAFRAY
        /* yafray: on request, render engine menu is back again, and moved to Render panel */
        uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0|YafRay %x1", 
                                                                                                369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine");        
+#else
+       uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0", 
+                                                                                               369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine");        
+#endif /* disable yafray */
 
        uiBlockBeginAlign(block);
        uiDefButBitI(block, TOG, R_OSA, 0, "OSA",               369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
index 796d0b1955246c8b014c2bbb4b1d0be905d25e55..6b4dfd0cb46649398be8b8e64675221cf75d9f8a 100755 (executable)
@@ -32,6 +32,7 @@ def validate_arguments(args, bc):
             'WITH_BF_ODE', 'BF_ODE', 'BF_ODE_INC', 'BF_ODE_LIB',
             'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
             'BF_SOLID', 'BF_SOLID_INC',
+            'WITH_BF_YAFRAY',
             'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
             'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
             'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC', 'BF_OPENGL_LINKFLAGS',
@@ -129,7 +130,8 @@ def read_opts(cfg, args):
         ('BF_PYTHON_LIB', 'Python library', ''),
         ('BF_PYTHON_LIBPATH', 'Library path', ''),
         ('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
-        ('BF_NO_ELBEEM', 'Disable Fluid Sim', 'false'),
+        (BoolOption('BF_NO_ELBEEM', 'Disable Fluid Sim', 'false')),
+        (BoolOption('WITH_BF_YAFRAY', 'Enable Yafray', 'true')),
         (BoolOption('WITH_BF_OPENAL', 'Use OpenAL if true', '')),
         ('BF_OPENAL', 'base path for OpenAL', ''),
         ('BF_OPENAL_INC', 'include path for python headers', ''),