Merge from trunk -r 23968:24181.
authorArystanbek Dyussenov <arystan.d@gmail.com>
Mon, 2 Nov 2009 16:41:57 +0000 (16:41 +0000)
committerArystanbek Dyussenov <arystan.d@gmail.com>
Mon, 2 Nov 2009 16:41:57 +0000 (16:41 +0000)
1  2 
CMakeLists.txt
release/scripts/ui/space_info.py
source/blender/editors/include/ED_object.h
source/blender/windowmanager/intern/wm_operators.c
source/creator/CMakeLists.txt
tools/Blender.py
tools/btools.py

diff --combined CMakeLists.txt
index 5cb14f373050eb36da2395d4fd988991000940b2,963601dd94ac2a2722dcaf0807ee84eaf81d108c..a649a5e0a8df8d2df1f97d5ecc94d11f2c21d859
@@@ -80,7 -80,6 +80,7 @@@ OPTION(WITH_LZMA          "Enable best 
  OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
  OPTION(WITH_BUILDINFO     "Include extra build details" ON)
  OPTION(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
 +OPTION(WITH_OPENCOLLADA               "Enable OpenCollada Support (http://www.opencollada.org/)"      ON)
  
  IF (APPLE)
  OPTION(WITH_COCOA       "Use Cocoa framework instead of deprecated Carbon" ON)
@@@ -91,19 -90,6 +91,19 @@@ IF(NOT WITH_GAMEENGINE AND WITH_PLAYER
        MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
  ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
  
 +IF (WITH_OPENCOLLADA)
 +SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
 +SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA})
 +SET(OPENCOLLADA_LIB OpenCollada)
 +SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
 +SET(PCRE_LIBPATH ${PCRE}/lib)
 +SET(PCRE_LIB pcre)
 +SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
 +SET(EXPAT_LIBPATH ${EXPAT}/lib)
 +SET(EXPAT_LIB expat)
 +
 +ENDIF (WITH_OPENCOLLADA)
 +
  # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
  # On Unix: 
  #   cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
@@@ -549,15 -535,27 +549,27 @@@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux"
  
  
  # buildinfo
- IF(UNIX)
-       IF(WITH_BUILDINFO)
+ IF(WITH_BUILDINFO)
+       # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
+       IF(UNIX)
                EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
                EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)  
-               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
-               # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
-       ENDIF(WITH_BUILDINFO)
- ENDIF(UNIX)
+               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV RETURN_VALUE BUILD_REV_RETURN)
+               IF(BUILD_REV_RETURN)
+                       SET(BUILD_REV "unknown")
+               ENDIF(BUILD_REV_RETURN)
+       ENDIF(UNIX)
+       
+       IF(WIN32)
+               EXEC_PROGRAM("cmd /c date /t" OUTPUT_VARIABLE BUILD_DATE)
+               EXEC_PROGRAM("cmd /c time /t" OUTPUT_VARIABLE BUILD_TIME)  
+               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV RETURN_VALUE BUILD_REV_RETURN)
+               IF(BUILD_REV_RETURN)
+                       SET(BUILD_REV "unknown")
+               ENDIF(BUILD_REV_RETURN)
+       ENDIF(WIN32)
+ ENDIF(WITH_BUILDINFO)
+       
  #-----------------------------------------------------------------------------
  # Common.
  
index a30d77a575ac19cdaa78a01bc4df2e6c795724e1,083b6f07fbc6bd97bae67d57b1a270e65d3c7ba7..d4fcbbcdd4d498b5a9c0806f1468243733f0e920
@@@ -39,7 -39,8 +39,8 @@@ class INFO_HT_header(bpy.types.Header)
                layout.template_running_jobs()
  
                layout.itemL(text=scene.statistics())
+               
+               layout.itemO("wm.window_fullscreen_toggle", icon='ICON_ARROW_LEFTRIGHT', text="")
  
  class INFO_MT_file(bpy.types.Menu):
        __label__ = "File"
@@@ -53,6 -54,7 +54,7 @@@
                layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
                layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
                layout.itemO("wm.recover_last_session")
+               layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
  
                layout.itemS()
  
@@@ -80,7 -82,6 +82,6 @@@
                layout.operator_context = "EXEC_AREA"
                layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
  
  # test for expanding menus
  '''
  class INFO_MT_file_more(INFO_MT_file):
@@@ -98,13 -99,13 +99,13 @@@ class INFO_MT_file_import(dynamic_menu.
        __label__ = "Import"
  
        def draw(self, context):
 -              pass # dynamic menu
 +              self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
  
  class INFO_MT_file_export(dynamic_menu.DynMenu):
        __label__ = "Export"
  
        def draw(self, context):
 -              pass # dynamic menu
 +              self.layout.itemO("WM_OT_collada_export", text="COLLADA (.dae)...")
  
  class INFO_MT_file_external_data(bpy.types.Menu):
        __label__ = "External Data"
                layout.itemO("file.report_missing_files")
                layout.itemO("file.find_missing_files")
  
  class INFO_MT_mesh_add(dynamic_menu.DynMenu):
        __label__ = "Mesh"
        def draw(self, context):
                layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
                layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
                layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
-               layout.itemO("mesh.primitive_cylinder_add", icon='ICON_MESH_TUBE', text="Tube")
+               layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
                layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
                layout.itemS()
                layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
@@@ -204,6 -204,11 +204,11 @@@ class INFO_MT_render(bpy.types.Menu)
  
                layout.itemS()
  
+               layout.itemO("screen.opengl_render", text="OpenGL Render Image")
+               layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
+               layout.itemS()
                layout.itemO("screen.render_view_show")
  
  class INFO_MT_help(bpy.types.Menu):
                layout.itemO("help.developer_community", icon='ICON_URL')
                layout.itemO("help.user_community", icon='ICON_URL')
                layout.itemS()
+               layout.itemO("help.report_bug", icon='ICON_URL')
+               layout.itemS()
                layout.itemO("help.operator_cheat_sheet")
  
  bpy.types.register(INFO_HT_header)
@@@ -239,14 -246,8 +246,8 @@@ bpy.types.register(INFO_MT_help
  
  class HelpOperator(bpy.types.Operator):
        def execute(self, context):
-               try: import webbrowser
-               except: webbrowser = None
-               if webbrowser:
-                       webbrowser.open(self.__URL__)
-               else:
-                       raise Exception("Operator requires a full Python installation")
+               import webbrowser
+               webbrowser.open(self.__URL__)
                return ('FINISHED',)
  
  class HELP_OT_manual(HelpOperator):
@@@ -284,6 -285,12 +285,12 @@@ class HELP_OT_user_community(HelpOperat
        __idname__ = "help.user_community"
        __label__ = "User Community"
        __URL__ = 'http://www.blender.org/community/user-community/'
+       
+ class HELP_OT_report_bug(HelpOperator):
+       '''Report a bug in the Blender bug tracker'''
+       __idname__ = "help.report_bug"
+       __label__ = "Report a Bug"
+       __URL__ = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
  
  class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
        __idname__ = "help.operator_cheat_sheet"
@@@ -316,4 -323,5 +323,5 @@@ bpy.ops.add(HELP_OT_blender_website
  bpy.ops.add(HELP_OT_blender_eshop)
  bpy.ops.add(HELP_OT_developer_community)
  bpy.ops.add(HELP_OT_user_community)
+ bpy.ops.add(HELP_OT_report_bug)
  bpy.ops.add(HELP_OT_operator_cheat_sheet)
index d8c25083b9eb9daaf3cc46360bea1fa4fb905d52,b136baa6bdb236ab7cc3d4c2c5282bd9f3d57c1b..a708e20f0e26998d5b781fe4567747f3b58851f5
@@@ -47,7 -47,6 +47,7 @@@ struct ModifierData
  void ED_operatortypes_object(void);
  void ED_operatormacros_object(void);
  void ED_keymap_object(struct wmKeyConfig *keyconf);
 +struct Object *ED_object_add_type(struct bContext *C, int type);
  
  /* generic editmode keys like pet */
  void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet);
@@@ -103,8 -102,6 +103,6 @@@ void mouse_lattice(struct bContext *C, 
  void undo_push_lattice(struct bContext *C, char *name);
  
  /* object_shapekey.c */
- void insert_shapekey(struct Scene *scene, struct Object *ob);
- void delete_key(struct Scene *scene, struct Object *ob);
  void key_to_mesh(struct KeyBlock *kb, struct Mesh *me);
  void mesh_to_key(struct Mesh *me, struct KeyBlock *kb);
  void key_to_latt(struct KeyBlock *kb, struct Lattice *lt);
index 35216e9ec0e81458f9c56505377ba7001f77a201,f82e16b7951dbce7f626743d206b7a918080b856..3006f813d71eed84aea2f2f80cdb5617706fbdc2
@@@ -642,7 -642,6 +642,7 @@@ int WM_operator_redo_popup(bContext *C
        return OPERATOR_CANCELLED;
  }
  
 +
  /* ***************** Debug menu ************************* */
  
  static uiBlock *wm_block_create_menu(bContext *C, ARegion *ar, void *arg_op)
@@@ -973,7 -972,7 +973,7 @@@ static int wm_open_mainfile_exec(bConte
  
        WM_read_file(C, path, op->reports);
        
-       return 0;
+       return OPERATOR_FINISHED;
  }
  
  static void WM_OT_open_mainfile(wmOperatorType *ot)
@@@ -1155,12 -1154,9 +1155,9 @@@ static void WM_OT_link_append(wmOperato
  
  static int wm_recover_last_session_exec(bContext *C, wmOperator *op)
  {
-       char scestr[FILE_MAX], filename[FILE_MAX];
-       int save_over;
+       char filename[FILE_MAX];
  
-       /* back up some values */
-       BLI_strncpy(scestr, G.sce, sizeof(scestr));
-       save_over = G.save_over;
+       G.fileflags |= G_FILE_RECOVER;
  
        // XXX wm in context is not set correctly after WM_read_file -> crash
        // do it before for now, but is this correct with multiple windows?
        BLI_make_file_string("/", filename, btempdir, "quit.blend");
        WM_read_file(C, filename, op->reports);
  
-       /* restore */
-       G.save_over = save_over;
-       BLI_strncpy(G.sce, scestr, sizeof(G.sce));
+       G.fileflags &= ~G_FILE_RECOVER;
  
-       return 0;
+       return OPERATOR_FINISHED;
  }
  
  static void WM_OT_recover_last_session(wmOperatorType *ot)
        ot->poll= WM_operator_winactive;
  }
  
+ /* *************** recover auto save **************** */
+ static int wm_recover_auto_save_exec(bContext *C, wmOperator *op)
+ {
+       char path[FILE_MAX];
+       RNA_string_get(op->ptr, "path", path);
+       G.fileflags |= G_FILE_RECOVER;
+       // XXX wm in context is not set correctly after WM_read_file -> crash
+       // do it before for now, but is this correct with multiple windows?
+       WM_event_add_notifier(C, NC_WINDOW, NULL);
+       /* load file */
+       WM_read_file(C, path, op->reports);
+       G.fileflags &= ~G_FILE_RECOVER;
+       return OPERATOR_FINISHED;
+ }
+ static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, wmEvent *event)
+ {
+       char filename[FILE_MAX];
+       wm_autosave_location(filename);
+       RNA_string_set(op->ptr, "path", filename);
+       WM_event_add_fileselect(C, op);
+       return OPERATOR_RUNNING_MODAL;
+ }
+ static void WM_OT_recover_auto_save(wmOperatorType *ot)
+ {
+       ot->name= "Recover Auto Save";
+       ot->idname= "WM_OT_recover_auto_save";
+       ot->description="Open an automatically saved file to recover it.";
+       
+       ot->exec= wm_recover_auto_save_exec;
+       ot->invoke= wm_recover_auto_save_invoke;
+       ot->poll= WM_operator_winactive;
+       WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER);
+ }
  /* *************** save file as **************** */
  
  static void untitled(char *name)
@@@ -1230,10 -1270,9 +1271,9 @@@ static int wm_save_as_mainfile_invoke(b
  static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
  {
        char path[FILE_MAX];
-       int compress;
+       int fileflags;
  
        save_set_compress(op);
-       compress= RNA_boolean_get(op->ptr, "compress");
        
        if(RNA_property_is_set(op->ptr, "path"))
                RNA_string_get(op->ptr, "path", path);
                untitled(path);
        }
  
-       WM_write_file(C, path, compress, op->reports);
+       fileflags= G.fileflags;
+       /* set compression flag */
+       if(RNA_boolean_get(op->ptr, "compress"))
+               fileflags |= G_FILE_COMPRESS;
+       else
+               fileflags &= ~G_FILE_COMPRESS;
+       WM_write_file(C, path, fileflags, op->reports);
        
        WM_event_add_notifier(C, NC_WM|ND_FILESAVE, NULL);
  
@@@ -1274,8 -1321,12 +1322,12 @@@ static int wm_save_mainfile_invoke(bCon
        BLI_strncpy(name, G.sce, FILE_MAX);
        untitled(name);
        RNA_string_set(op->ptr, "path", name);
-       uiPupMenuSaveOver(C, op, name);
+       
+       if (G.save_over)
+               uiPupMenuSaveOver(C, op, name);
+       else
+               WM_event_add_fileselect(C, op);
+       
        return OPERATOR_RUNNING_MODAL;
  }
  
@@@ -1294,105 -1345,6 +1346,105 @@@ static void WM_OT_save_mainfile(wmOpera
  }
  
  
 +/* XXX: move these collada operators to a more appropriate place */
 +#ifdef WITH_COLLADA
 +
 +#include "../../collada/collada.h"
 +
 +static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *event)
 +{
 +      //char name[FILE_MAX];
 +      //BLI_strncpy(name, G.sce, FILE_MAX);
 +      //untitled(name);
 +
 +      /* RNA_string_set(op->ptr, "path", "/tmp/test.dae"); */
 +      
 +      WM_event_add_fileselect(C, op);
 +
 +      return OPERATOR_RUNNING_MODAL;
 +}
 +
 +/* function used for WM_OT_save_mainfile too */
 +static int wm_collada_export_exec(bContext *C, wmOperator *op)
 +{
 +      char filename[FILE_MAX];
 +      
 +      if(RNA_property_is_set(op->ptr, "path"))
 +              RNA_string_get(op->ptr, "path", filename);
 +      else {
 +              BLI_strncpy(filename, G.sce, FILE_MAX);
 +              untitled(filename);
 +      }
 +      
 +      //WM_write_file(C, filename, op->reports);
 +      collada_export(CTX_data_scene(C), filename);
 +      
 +      /* WM_event_add_notifier(C, NC_WM|ND_FILESAVE, NULL); */
 +
 +      return OPERATOR_FINISHED;
 +}
 +
 +static void WM_OT_collada_export(wmOperatorType *ot)
 +{
 +      ot->name= "Export COLLADA";
 +      ot->idname= "WM_OT_collada_export";
 +      
 +      ot->invoke= wm_collada_export_invoke;
 +      ot->exec= wm_collada_export_exec;
 +      ot->poll= WM_operator_winactive;
 +      
 +      ot->flag= 0;
 +      
 +      RNA_def_property(ot->srna, "path", PROP_STRING, PROP_FILEPATH);
 +}
 +
 +static int wm_collada_import_invoke(bContext *C, wmOperator *op, wmEvent *event)
 +{
 +      /* RNA_string_set(op->ptr, "path", "/tmp/test.dae"); */
 +      
 +      WM_event_add_fileselect(C, op);
 +
 +      return OPERATOR_RUNNING_MODAL;
 +}
 +
 +/* function used for WM_OT_save_mainfile too */
 +static int wm_collada_import_exec(bContext *C, wmOperator *op)
 +{
 +      char filename[FILE_MAX];
 +      
 +      if(RNA_property_is_set(op->ptr, "path"))
 +              RNA_string_get(op->ptr, "path", filename);
 +      else {
 +              BLI_strncpy(filename, G.sce, FILE_MAX);
 +              untitled(filename);
 +      }
 +      
 +      //WM_write_file(C, filename, op->reports);
 +      collada_import(C, filename);
 +      
 +      /* WM_event_add_notifier(C, NC_WM|ND_FILESAVE, NULL); */
 +
 +      return OPERATOR_FINISHED;
 +}
 +
 +static void WM_OT_collada_import(wmOperatorType *ot)
 +{
 +      ot->name= "Import COLLADA";
 +      ot->idname= "WM_OT_collada_import";
 +      
 +      ot->invoke= wm_collada_import_invoke;
 +      ot->exec= wm_collada_import_exec;
 +      ot->poll= WM_operator_winactive;
 +      
 +      ot->flag= 0;
 +      
 +      RNA_def_property(ot->srna, "path", PROP_STRING, PROP_FILEPATH);
 +}
 +
 +#endif
 +
 +
 +
  /* *********************** */
  
  static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot)
@@@ -2132,7 -2084,6 +2184,7 @@@ void WM_OT_radial_control_partial(wmOpe
        RNA_def_int_vector(ot->srna, "initial_mouse", 2, NULL, INT_MIN, INT_MAX, "initial_mouse", "", INT_MIN, INT_MAX);
  }
  
 +
  /* ************************** timer for testing ***************** */
  
  /* uses no type defines, fully local testing function anyway... ;) */
@@@ -2246,7 -2197,22 +2298,22 @@@ static void WM_OT_redraw_timer(wmOperat
  
  }
  
+ /* ************************** memory statistics for testing ***************** */
  
+ static int memory_statistics_exec(bContext *C, wmOperator *op)
+ {
+       MEM_printmemlist_stats();
+       return OPERATOR_FINISHED;
+ }
+ static void WM_OT_memory_statistics(wmOperatorType *ot)
+ {
+       ot->name= "Memory Statistics";
+       ot->idname= "WM_OT_memory_statistics";
+       ot->description= "Print memory statistics to the console.";
+       
+       ot->exec= memory_statistics_exec;
+ }
  
  /* ******************************************************* */
   
@@@ -2274,19 -2240,13 +2341,20 @@@ void wm_operatortype_init(void
        WM_operatortype_append(WM_OT_open_mainfile);
        WM_operatortype_append(WM_OT_link_append);
        WM_operatortype_append(WM_OT_recover_last_session);
-       WM_operatortype_append(WM_OT_jobs_timer);
+       WM_operatortype_append(WM_OT_recover_auto_save);
        WM_operatortype_append(WM_OT_save_as_mainfile);
        WM_operatortype_append(WM_OT_save_mainfile);
        WM_operatortype_append(WM_OT_redraw_timer);
+       WM_operatortype_append(WM_OT_memory_statistics);
        WM_operatortype_append(WM_OT_debug_menu);
        WM_operatortype_append(WM_OT_search_menu);
 +
 +#ifdef WITH_COLLADA
 +      /* XXX: move these */
 +      WM_operatortype_append(WM_OT_collada_export);
 +      WM_operatortype_append(WM_OT_collada_import);
 +#endif
 +
        WM_operatortype_append(WM_OT_call_menu);
  }
  
@@@ -2296,9 -2256,6 +2364,6 @@@ void wm_window_keymap(wmKeyConfig *keyc
        wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0);
        wmKeyMapItem *km;
        
-       /* items to make WM work */
-       WM_keymap_verify_item(keymap, "WM_OT_jobs_timer", TIMERJOBS, KM_ANY, KM_ANY, 0);
-       
        /* note, this doesn't replace existing keymap items */
        WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
        #ifdef __APPLE__
        WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0); 
        WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
        WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "WM_OT_link_append", OKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
+       WM_keymap_add_item(keymap, "WM_OT_link_append", F1KEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
  
        WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
index 4501542c746db517182275ef1ea20df60bb54ad3,fa59324c5dc9279c479a8814a2fa21dd9806b3ba..61c0fe187fd9f9e101576a7e897bb71ce62c8df3
@@@ -243,6 -243,7 +243,7 @@@ IF(WITH_INSTALL
                        TARGET blender POST_BUILD MAIN_DEPENDENCY blender    
                        COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;"
                        COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;"
+                       COMMAND find ${TARGETDIR}/blender.app -name __MACOSX -prune -exec rm -rf {} "\;"
                )
        ENDIF(APPLE)
  
@@@ -377,8 -378,7 +378,8 @@@ IF(UNIX
                bf_cineon 
                bf_openexr 
                bf_dds
 -              bf_readblenfile 
 +              bf_readblenfile
 +              bf_collada
                blender_bop 
                bf_kernel 
                bf_decimation 
diff --combined tools/Blender.py
index e6311418e47c91a46634e177a823c0ee9c9b39b2,8a2ef93bb26bee0e027088a11c02b3bb38acc787..2b3f405ed8b205ad5afb270a52cae9d359687348
@@@ -161,13 -161,6 +161,13 @@@ def setup_staticlibs(lenv)
        if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
                libincs += Split(lenv['BF_PTHREADS_LIBPATH'])
  
 +      if lenv['WITH_BF_COLLADA']:
 +              libincs += Split(lenv['BF_OPENCOLLADA_LIBPATH'])
 +              if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
 +                      libincs += Split(lenv['BF_PCRE_LIBPATH'])
 +                      libincs += Split(lenv['BF_EXPAT_LIBPATH'])
 +
 +
        return statlibs, libincs
  
  def setup_syslibs(lenv):
                syslibs += Split(lenv['BF_OPENGL_LIB'])
        if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
                syslibs += Split(lenv['BF_PTHREADS_LIB'])
 +
        if lenv['WITH_BF_LCMS']:
                syslibs.append(lenv['BF_LCMS_LIB'])
 +      if lenv['WITH_BF_COLLADA']:
 +              syslibs.append(lenv['BF_PCRE_LIB'])
 +              syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
 +              syslibs.append(lenv['BF_EXPAT_LIB'])
  
  
        syslibs += lenv['LLIBS']
@@@ -255,22 -243,12 +255,12 @@@ def buildinfo(lenv, build_type)
  
        obj = []
        if lenv['BF_BUILDINFO']:
-               if sys.platform=='win32':
-                       build_info_file = open("source/creator/winbuildinfo.h", 'w')
-                       build_info_file.write("char *build_date=\"%s\";\n"%build_date)
-                       build_info_file.write("char *build_time=\"%s\";\n"%build_time)
-                       build_info_file.write("char *build_rev=\"%s\";\n"%build_rev)
-                       build_info_file.write("char *build_platform=\"win32\";\n")
-                       build_info_file.write("char *build_type=\"dynamic\";\n")
-                       build_info_file.close()
-                       lenv.Append (CPPDEFINES = ['NAN_BUILDINFO', 'BUILD_DATE'])
-               else:
-                       lenv.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time),
-                                                                               'BUILD_DATE=\'"%s"\''%(build_date),
-                                                                               'BUILD_TYPE=\'"dynamic"\'',
-                                                                               'BUILD_REV=\'"%s"\''%(build_rev),
-                                                                               'NAN_BUILDINFO',
-                                                                               'BUILD_PLATFORM=\'"%s"\''%(sys.platform)])
+               lenv.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time),
+                                                                       'BUILD_DATE=\'"%s"\''%(build_date),
+                                                                       'BUILD_TYPE=\'"dynamic"\'',
+                                                                       'BUILD_REV=\'"%s"\''%(build_rev),
+                                                                       'NAN_BUILDINFO',
+                                                                       'BUILD_PLATFORM=\'"%s"\''%(sys.platform)])
                obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type,
                                                [root_build_dir+'source/creator/buildinfo.c'])]
        return obj
@@@ -478,7 -456,13 +468,13 @@@ def AppIt(target=None, source=None, env
        a = '%s' % (target[0])
        builddir, b = os.path.split(a)
        libdir = env['LCGDIR'][1:]
+       osxarch = env['MACOSX_ARCHITECTURE']
+       print("compiled architecture: %s"%(osxarch))
+       if  libdir == '../lib/darwin-9.x.universal':
+               python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
+       else:
+               python_zip = 'python.zip' # compatibility for darwin8 python.zip
+       print("unzipping to app-bundle: %s"%(python_zip))
        bldroot = env.Dir('.').abspath
        binary = env['BINARYKIND']
         
        cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,builddir, binary, binary)
        commands.getoutput(cmd)
        cmd = 'mkdir %s/%s.app/Contents/MacOS/.blender/'%(builddir, binary)
      print cmd
#     print cmd
        commands.getoutput(cmd)
        cmd = builddir + '/%s.app/Contents/MacOS/.blender'%binary
        shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
        commands.getoutput(cmd) 
        cmd = 'mkdir %s/%s.app/Contents/MacOS/.blender/python/'%(builddir,binary)
        commands.getoutput(cmd) 
-       cmd = 'unzip -q %s/release/python.zip -d %s/%s.app/Contents/MacOS/.blender/python/'%(libdir,builddir,binary)
+       cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/.blender/python/'%(libdir,python_zip,builddir,binary)
        commands.getoutput(cmd) 
        cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
        commands.getoutput(cmd)
        commands.getoutput(cmd)
        cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(builddir, binary)
        commands.getoutput(cmd)
+       cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(builddir, binary)
+       commands.getoutput(cmd)
  
  # extract copy system python, be sure to update other build systems
  # when making changes to the files that are copied.
diff --combined tools/btools.py
index 75c975b1768399e03decc8760a91b71c59a4f56c,cacff349dcfc56c6ab181f0e1c0919e6ed55a342..4f554a6901b55a25f1209d17d64a3e3f82df9f1e
@@@ -53,7 -53,6 +53,7 @@@ def validate_arguments(args, bc)
                        'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
                        'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH',
                        'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
 +                      'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH',
                        'WITH_BF_PLAYER',
                        'WITH_BF_NOBLENDER',
                        'WITH_BF_BINRELOC',
@@@ -64,6 -63,7 +64,7 @@@
                        'WITHOUT_BF_INSTALL',
                        'WITHOUT_BF_PYTHON_INSTALL',
                        'WITH_BF_OPENMP',
+                       'WITH_GHOST_COCOA',
                        'BF_FANCY', 'BF_QUIET',
                        'BF_X264_CONFIG',
                        'BF_XVIDCORE_CONFIG',
@@@ -85,7 -85,7 +86,7 @@@
                        'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
                        'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
                        'C_WARN', 'CC_WARN', 'CXX_WARN',
-                       'LLIBS', 'PLATFORM_LINKFLAGS',
+                       'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE',
        ]
        
        
@@@ -312,6 -312,7 +313,7 @@@ def read_opts(cfg, args)
                ('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
  
                (BoolVariable('WITH_BF_OPENMP', 'Use OpenMP if true', False)),
+               (BoolVariable('WITH_GHOST_COCOA', 'Use Cocoa-framework if true', False)),
  
                (BoolVariable('WITH_BF_QUICKTIME', 'Use QuickTime if true', False)),
                ('BF_QUICKTIME', 'QuickTime base path', ''),
                ('BF_OPENGL_LIBPATH', 'OpenGL library path', ''),
                ('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
                ('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
 +
 +              (BoolVariable('WITH_BF_COLLADA', 'Build COLLADA import/export module if true', True)),
 +              ('BF_COLLADA', 'COLLADA base path', ''),
 +              ('BF_COLLADA_INC', 'COLLADA include path', ''),
 +              ('BF_COLLADA_LIB', 'COLLADA library', ''),
 +              ('BF_OPENCOLLADA', 'OpenCollada base path', ''),
 +              ('BF_OPENCOLLADA_INC', 'OpenCollada base include path', ''),
 +              ('BF_OPENCOLLADA_LIB', 'OpenCollada library', ''),
 +              ('BF_OPENCOLLADA_LIBPATH', 'OpenCollada library path', ''),
 +              ('BF_PCRE', 'PCRE base path', ''),
 +              ('BF_PCRE_LIB', 'PCRE library', ''),
 +              ('BF_PCRE_LIBPATH', 'PCRE library path', ''),
 +              ('BF_EXPAT', 'Expat base path', ''),
 +              ('BF_EXPAT_LIB', 'Expat library', ''),
 +              ('BF_EXPAT_LIBPATH', 'Expat library path', ''),
                
                (BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
                (BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
  
                ('LLIBS', 'Platform libs', ''),
                ('PLATFORM_LINKFLAGS', 'Platform linkflags', ''),
+               ('MACOSX_ARCHITECTURE', 'python_arch.zip select', ''),
  
                (BoolVariable('BF_PROFILE', 'Add profiling information if true', False)),
                ('BF_PROFILE_CFLAGS', 'C only profiling flags', ''),