Cycles: svn merge -r40411:40934 ^/trunk/blender
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 11 Oct 2011 14:30:53 +0000 (14:30 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 11 Oct 2011 14:30:53 +0000 (14:30 +0000)
72 files changed:
1  2 
CMakeLists.txt
build_files/cmake/macros.cmake
release/scripts/startup/bl_ui/properties_data_camera.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/world.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/CMakeLists.txt
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_edit.c
source/blender/editors/render/render_preview.c
source/blender/editors/screen/area.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_material.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/python/intern/CMakeLists.txt
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_texture.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

diff --cc CMakeLists.txt
@@@ -203,17 -201,7 +202,16 @@@ if(UNIX AND NOT APPLE
        option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
  endif()
  option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
- option(WITH_API_INSTALL     "Copy API header files into the blender install folder" ON)
  
 +# Cycles
 +option(WITH_CYCLES                    "Enable Cycles Render Engine" ON)
 +OPTION(WITH_CYCLES_OSL                "Build with Open Shading Language support" OFF)
 +OPTION(WITH_CYCLES_CUDA               "Build with CUDA binaries" OFF)
 +OPTION(WITH_CYCLES_BLENDER    "Build Blender Python extension" ON)
 +OPTION(WITH_CYCLES_PARTIO     "Build with Partio point cloud support (unfinished)" OFF)
 +OPTION(WITH_CYCLES_NETWORK    "Build with network rendering support (unfinished)" OFF)
 +OPTION(WITH_CYCLES_TEST               "Build cycles test application" OFF)
 +
  # disable for now, but plan to support on all platforms eventually
  option(WITH_MEM_JEMALLOC   "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
  mark_as_advanced(WITH_MEM_JEMALLOC)
@@@ -284,18 -272,7 +282,17 @@@ if(WITH_PYTHON_MODULE
        set(WITH_HEADLESS ON)
  endif()
  
- TEST_SSE_SUPPORT()
 +# auto enable openimageio and boost for cycles
 +if(WITH_CYCLES)
 +      set(WITH_OPENIMAGEIO ON)
 +      set(WITH_BOOST ON)
 +endif()
 +
 +if(WITH_OPENIMAGEIO)
 +      set(WITH_BOOST ON)
 +endif()
 +
+ TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
  
  # don't store paths to libs for portable distrobution
  if(WITH_INSTALL_PORTABLE)
Simple merge
@@@ -96,27 -96,22 +96,27 @@@ class DATA_PT_camera(CameraButtonsPanel
          col.prop(cam, "shift_y", text="Y")
  
          col = split.column(align=True)
-         col.label(text=_("Clipping:"))
-         col.prop(cam, "clip_start", text=_("Start"))
-         col.prop(cam, "clip_end", text=_("End"))
+         col.label(text="Clipping:")
+         col.prop(cam, "clip_start", text="Start")
+         col.prop(cam, "clip_end", text="End")
  
 -        layout.label(text="Depth of Field:")
 +class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
 +    bl_label = "Depth of Field"
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +
 +        cam = context.camera
  
          split = layout.split()
          split.prop(cam, "dof_object", text="")
  
          col = split.column()
  
 -        if cam.dof_object is not None:
 -            col.enabled = False
 +        col.active = cam.dof_object is None
-         col.prop(cam, "dof_distance", text=_("Distance"))
+         col.prop(cam, "dof_distance", text="Distance")
  
 -
  class DATA_PT_camera_display(CameraButtonsPanel, Panel):
      bl_label = "Display"
      COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@@ -668,11 -664,11 +664,11 @@@ class DATA_PT_modifiers(ModifierButtons
          # 2 new columns
          split = layout.split()
          col = split.column()
-         col.label(text=_("Texture:"))
+         col.label(text="Texture:")
 -        col.prop(md, "texture", text="")
 +        col.template_ID(md, "texture", new="texture.new")
  
          col = split.column()
-         col.label(text=_("Texture Coordinates:"))
+         col.label(text="Texture Coordinates:")
          col.prop(md, "texture_coords", text="")
  
          if md.texture_coords == 'OBJECT':
@@@ -60,12 -59,8 +59,12 @@@ class PHYSICS_PT_field(PhysicButtonsPan
  
          if field.type not in {'NONE', 'GUIDE', 'TEXTURE'}:
              split = layout.split(percentage=0.2)
-             split.label(text=_("Shape:"))
+             split.label(text="Shape:")
              split.prop(field, "shape", text="")
 +        elif field.type == 'TEXTURE':
 +            split = layout.split(percentage=0.2)
 +            split.label(text="Texture:")
 +            split.row().template_ID(field, "texture", new="texture.new")
  
          split = layout.split()
  
@@@ -2176,15 -2135,16 +2136,15 @@@ class VIEW3D_PT_view3d_display(Panel)
  
          sub = col.column(align=True)
          sub.active = (display_all and view.show_floor)
-         sub.prop(view, "grid_lines", text=_("Lines"))
-         sub.prop(view, "grid_scale", text=_("Scale"))
+         sub.prop(view, "grid_lines", text="Lines")
+         sub.prop(view, "grid_scale", text="Scale")
          subsub = sub.column(align=True)
          subsub.active = scene.unit_settings.system == 'NONE'
-         subsub.prop(view, "grid_subdivisions", text=_("Subdivisions"))
+         subsub.prop(view, "grid_subdivisions", text="Subdivisions")
  
          col = layout.column()
-         col.label(text=_("Shading:"))
+         col.label(text="Shading:")
          col.prop(gs, "material_mode", text="")
 -        col.prop(view, "show_textured_solid")
  
          layout.separator()
  
@@@ -753,12 -749,9 +755,13 @@@ void uiTemplateHeader3D(uiLayout *layou
  void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C);
  void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);
  void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
+ void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
  
  void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, int rows, int maxrows, int type);
 +void uiTemplateNodeLink(uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input);
 +void uiTemplateNodeView(uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input);
 +void uiTemplateTextureUser(uiLayout *layout, struct bContext *C);
 +void uiTemplateTextureShow(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop);
  
  /* items */
  void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname);
@@@ -2548,8 -2540,63 +2545,66 @@@ void uiTemplateReportsBanner(uiLayout *
        uiBlockSetEmboss(block, UI_EMBOSS);
        
        uiDefBut(block, LABEL, 0, report->message, UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
 +
 +      /* XXX linking hack */
 +      uiTemplateNodeView(NULL, NULL, NULL, NULL, NULL);
  }
  
+ /********************************* Keymap *************************************/
+ static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused))
+ {
+       wmKeyMapItem *kmi= (wmKeyMapItem*)kmi_p;
+       WM_keyconfig_update_tag(NULL, kmi);
+ }
+ static void template_keymap_item_properties(uiLayout *layout, const char *title, PointerRNA *ptr)
+ {
+       uiLayout *flow;
+       uiItemS(layout);
+       if(title)
+               uiItemL(layout, title, ICON_NONE);
+       
+       flow= uiLayoutColumnFlow(layout, 2, 0);
+       RNA_STRUCT_BEGIN(ptr, prop) {
+               int flag= RNA_property_flag(prop);
+               if(flag & PROP_HIDDEN)
+                       continue;
+               /* recurse for nested properties */
+               if(RNA_property_type(prop) == PROP_POINTER) {
+                       PointerRNA propptr= RNA_property_pointer_get(ptr, prop);
+                       const char *name= RNA_property_ui_name(prop);
+                       if(propptr.data && RNA_struct_is_a(propptr.type, &RNA_OperatorProperties)) {
+                               template_keymap_item_properties(layout, name, &propptr);
+                               continue;
+                       }
+               }
+               /* add property */
+               uiItemR(flow, ptr, RNA_property_identifier(prop), 0, NULL, ICON_NONE);
+       }
+       RNA_STRUCT_END;
+ }
+ void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
+ {
+       PointerRNA propptr= RNA_pointer_get(ptr, "properties");
+       if(propptr.data) {
+               uiBut *but= uiLayoutGetBlock(layout)->buttons.last;
+               template_keymap_item_properties(layout, NULL, &propptr);
+               /* attach callbacks to compensate for missing properties update,
+                  we don't know which keymap (item) is being modified there */
+               for(; but; but=but->next)
+                       uiButSetFunc(but, keymap_item_modified, ptr->data, NULL);
+       }
+ }
Simple merge
@@@ -2703,12 -2687,10 +2727,10 @@@ static void project_bucket_init(const P
                        face_index = GET_INT_FROM_POINTER(node->link);
                                
                        /* Image context switching */
 -                      tf = ps->dm_mtface+face_index;
 -                      if (tpage_last != tf->tpage) {
 -                              tpage_last = tf->tpage;
 +                      tpage = project_paint_face_image(ps, face_index);
 +                      if (tpage_last != tpage) {
 +                              tpage_last = tpage;
-                               
-                               image_index = -1; /* sanity check */
-                               
                                for (image_index=0; image_index < ps->image_tot; image_index++) {
                                        if (ps->projImages[image_index].ima == tpage_last) {
                                                ibuf = ps->projImages[image_index].ibuf;
Simple merge
Simple merge
Simple merge
@@@ -466,18 -480,8 +480,18 @@@ static void rna_def_ID(BlenderRNA *brna
        prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT);
        RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
-       RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data, (initial state is undefined)");
+       RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data (initial state is undefined)");
  
 +      prop= RNA_def_property(srna, "recalc", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Recalc", "Datablock is tagged for recalculation.");
 +
 +      prop= RNA_def_property(srna, "recalc_data", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC_DATA);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Recalc Data", "Datablock data is tagged for recalculation.");
 +
        prop= RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "lib");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@@ -1762,8 -1794,9 +1796,8 @@@ static void rna_def_object(BlenderRNA *
        static EnumPropertyItem drawtype_items[] = {
                {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounding box of the object"},
                {OB_WIRE, "WIRE", 0, "Wire", "Draw the object as a wireframe"},
-               {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (If solid drawing is enabled in the viewport)"},
-               {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (If textures are enabled in the viewport)"},
+               {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (if solid drawing is enabled in the viewport)"},
 -              // disabled {OB_SHADED, "SHADED", 0, "Shaded", ""},
+               {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (if textures are enabled in the viewport)"},
                {0, NULL, 0, NULL, NULL}};
  
        static EnumPropertyItem boundtype_items[] = {
@@@ -3165,9 -3212,10 +3220,10 @@@ static void rna_def_scene_render_data(B
        /* engine */
        prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, engine_items);
-       RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
+       RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set",
+                                   "rna_RenderSettings_engine_itemf");
        RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
 -      RNA_def_property_update(prop, NC_WINDOW, NULL);
 +      RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
  
        prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
@@@ -2496,14 -2470,10 +2524,15 @@@ static void rna_def_space_node(BlenderR
                {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
                {0, NULL, 0, NULL, NULL}};
  
 +      static EnumPropertyItem shader_type_items[] = {
 +              {SNODE_SHADER_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit shader nodes from Object"},
 +              {SNODE_SHADER_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit shader nodes from World"},
 +              {0, NULL, 0, NULL, NULL}};
 +
        static EnumPropertyItem backdrop_channels_items[] = {
                {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
-               {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
+               {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
+                                 "Draw image with RGB colors and alpha transparency"},
                {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
                {0, NULL, 0, NULL, NULL}};
  
@@@ -428,26 -428,10 +428,30 @@@ void RNA_api_ui_layout(StructRNA *srna
        func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
        RNA_def_function_flag(func, FUNC_USE_CONTEXT);
  
 +      func= RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
 +      parm= RNA_def_pointer(func, "ntree", "NodeTree", "", "");
 +      RNA_def_property_flag(parm, PROP_REQUIRED);
 +      parm= RNA_def_pointer(func, "node", "Node", "", "");
 +      RNA_def_property_flag(parm, PROP_REQUIRED);
 +      parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "");
 +      RNA_def_property_flag(parm, PROP_REQUIRED);
 +
 +      func= RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
 +      RNA_def_function_flag(func, FUNC_USE_CONTEXT);
 +      parm= RNA_def_pointer(func, "ntree", "NodeTree", "", "");
 +      RNA_def_property_flag(parm, PROP_REQUIRED);
 +      parm= RNA_def_pointer(func, "node", "Node", "", "");
 +      RNA_def_property_flag(parm, PROP_REQUIRED);
 +      parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "");
 +      RNA_def_property_flag(parm, PROP_REQUIRED);
 +
 +      func= RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
 +      RNA_def_function_flag(func, FUNC_USE_CONTEXT);
 +
+       func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
+       parm= RNA_def_pointer(func, "item", "KeyMapItem", "", "");
+       RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
        func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
        parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
        RNA_def_function_return(func, parm);
@@@ -95,8 -95,8 +95,12 @@@ if(WITH_AUDASPACE
        add_definitions(-DWITH_AUDASPACE)
  endif()
  
 +if(WITH_CYCLES)
 +      add_definitions(-DWITH_CYCLES)
 +endif()
 +
+ if(WITH_INTERNATIONAL)
+         add_definitions(-DWITH_INTERNATIONAL)
+ endif()
  blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}")
@@@ -369,10 -368,7 +370,11 @@@ void uiTemplateHistogram(struct uiLayou
  void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct wmOperator *op){}
  void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){}
  void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand){}
 +void uiTemplateNodeLink(struct uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input) {}
 +void uiTemplateNodeView(struct uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input) {}
 +void uiTemplateTextureUser(struct uiLayout *layout, struct bContext *C) {}
 +void uiTemplateTextureShow(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop) {}
+ void uiTemplateKeymapItemProperties(struct uiLayout *layout, struct PointerRNA *ptr){}
  
  /* rna render */
  struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;}
@@@ -591,21 -582,13 +582,21 @@@ elseif(WIN32
                        FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
                        DESTINATION ${TARGETDIR}
                )
-       else()
-               install(
-                       FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
-                       DESTINATION ${TARGETDIR}
-               )
        endif()
+               
+       install( # x86 builds can run on x64 Windows, so this is required at all times
+               FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
+               DESTINATION ${TARGETDIR}
+       )       
  
 +      if(WITH_OPENIMAGEIO)
 +              install(
 +                      FILES
 +                              ${LIBDIR}/openimageio/bin/OpenImageIO.dll
 +                      DESTINATION ${TARGETDIR}
 +              )
 +      endif()
 +
  elseif(APPLE)
        set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
        set(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
                        \${TARGETDIR_VER}
                )
        endif()
+       # install blenderplayer bundle - copy of blender.app above. re-using macros et al
+       # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
+       if(WITH_GAMEENGINE AND WITH_PLAYER)
+               set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
+               set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
+               set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
+               # important to make a clean  install each time else old scripts get loaded.
+               install(
+                       CODE
+                       "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
+               )
+               install(
+                       FILES ${PLAYER_SOURCEDIR}/Contents/PkgInfo
+                       DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
+               )
+               install_dir(
+                       ${PLAYER_SOURCEDIR}/Contents/Resources
+                       \${TARGETDIR}/blenderplayer.app/Contents/
+               )
+               # python
+               if(WITH_PYTHON)
+                       add_custom_command(
+                               OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
+                               COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
+                               COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
+                               COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
+                               DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
+                       # copy extracted python files
+                       install_dir(
+                               ${CMAKE_CURRENT_BINARY_DIR}/python
+                               \${PLAYER_TARGETDIR_VER}
+                       )
+               endif()
+       endif()
  endif()
  
 +# install more files XXX pass target dir
 +delayed_do_install(${TARGETDIR_VER})
 +
  unset(BLENDER_TEXT_FILES)
  
  
Simple merge