Merging r49775 through r49807 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 11 Aug 2012 14:39:09 +0000 (14:39 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 11 Aug 2012 14:39:09 +0000 (14:39 +0000)
1  2 
SConstruct
build_files/cmake/macros.cmake
release/scripts/startup/bl_ui/space_sequencer.py

diff --combined SConstruct
index 6cb2da36ccdfcdb08b07a071b28d68c7c9dc1ed2,ff0ec0c31331bacdc7a5ddf37521f999c12f2c05..4d33eb7d6a5e18167f5d16dfc1796769abdbb96e
@@@ -450,8 -450,11 +450,11 @@@ if not os.path.isdir ( B.root_build_dir
  ###################################
  if not os.path.isdir ( B.root_build_dir + 'data_headers'):
      os.makedirs ( B.root_build_dir + 'data_headers' )
+ if not os.path.isdir ( B.root_build_dir + 'data_sources'):
+     os.makedirs ( B.root_build_dir + 'data_sources' )
  # use for includes
  env['DATA_HEADERS'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_headers")
+ env['DATA_SOURCES'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_sources")
  def ensure_data(FILE_FROM, FILE_TO, VAR_NAME):
      if os.sep == "\\":
          FILE_FROM = FILE_FROM.replace("/", "\\")
@@@ -487,6 -490,39 +490,39 @@@ ensure_data("source/blender/compositor/
              B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
              "clkernelstoh_COM_OpenCLKernels_cl")
  
+ ensure_data("./release/datafiles/startup.blend",
+             B.root_build_dir + "data_sources/startup.blend.c",
+             "datatoc_startup_blend")
+ ensure_data("./release/datafiles/preview.blend",
+             B.root_build_dir + "data_sources/preview.blend.c",
+             "datatoc_preview_blend")
+ # --- glsl ---
+ ensure_data("source/blender/gpu/shaders/gpu_shader_material.glsl",
+             B.root_build_dir + "data_sources/gpu_shader_material.glsl.c",
+             "datatoc_gpu_shader_material_glsl")
+ ensure_data("source/blender/gpu/shaders/gpu_shader_vertex.glsl",
+             B.root_build_dir + "data_sources/gpu_shader_vertex.glsl.c",
+             "datatoc_gpu_shader_vertex_glsl")
+ ensure_data("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl",
+             B.root_build_dir + "data_sources/gpu_shader_sep_gaussian_blur_frag.glsl.c",
+             "datatoc_gpu_shader_sep_gaussian_blur_frag_glsl")
+ ensure_data("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl",
+             B.root_build_dir + "data_sources/gpu_shader_sep_gaussian_blur_vert.glsl.c",
+             "datatoc_gpu_shader_sep_gaussian_blur_vert_glsl")
+ ensure_data("source/blender/gpu/shaders/gpu_shader_material.glsl",
+             B.root_build_dir + "data_sources/gpu_shader_material.glsl.c",
+             "datatoc_gpu_shader_material_glsl")
+ ensure_data("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl",
+             B.root_build_dir + "data_sources/gpu_shader_vsm_store_frag.glsl.c",
+             "datatoc_gpu_shader_vsm_store_frag_glsl")
+ ensure_data("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl",
+             B.root_build_dir + "data_sources/gpu_shader_vsm_store_vert.glsl.c",
+             "datatoc_gpu_shader_vsm_store_vert_glsl")
  ##### END DATAFILES ##########
  
  Help(opts.GenerateHelpText(env))
@@@ -656,26 -692,6 +692,26 @@@ if env['OURPLATFORM']!='darwin'
                      cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch)
                      scriptinstall.append(env.Install(dir=dir,source=cubin_file))
  
 +    if env['WITH_BF_OCIO']:
 +        colormanagement = os.path.join('release', 'datafiles', 'colormanagement')
 +
 +        for dp, dn, df in os.walk(colormanagement):
 +            if '.svn' in dn:
 +                dn.remove('.svn')
 +            if '_svn' in dn:
 +                dn.remove('_svn')
 +
 +            dir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'datafiles')
 +            dir += os.sep + os.path.basename(colormanagement) + dp[len(colormanagement):]
 +
 +            source = [os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
 +
 +            # To ensure empty dirs are created too
 +            if len(source) == 0:
 +                env.Execute(Mkdir(dir))
 +
 +            scriptinstall.append(env.Install(dir=dir,source=source))
 +
      if env['WITH_BF_INTERNATIONAL']:
          internationalpaths=['release' + os.sep + 'datafiles']
  
@@@ -808,9 -824,6 +844,9 @@@ if env['OURPLATFORM'] in ('win32-vc', '
      if env['WITH_BF_OIIO'] and env['OURPLATFORM'] != 'win32-mingw':
          dllsources.append('${LCGDIR}/openimageio/bin/OpenImageIO.dll')
  
 +    if env['WITH_BF_OCIO'] and env['OURPLATFORM'] != 'win32-mingw':
 +        dllsources.append('${LCGDIR}/opencolorio/bin/OpenColorIO.dll')
 +
      dllsources.append('#source/icons/blender.exe.manifest')
  
      windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
index 522a07ff7b23e59a3c1f43f770f333c6979ccab0,af122541ae56c95810fa74ca4c450f57e93f5371..959107d684bc1762c86188fccbf686fce5ad098c
@@@ -212,9 -212,6 +212,9 @@@ macro(SETUP_LIBDIRS
        if(WITH_OPENIMAGEIO)
                link_directories(${OPENIMAGEIO_LIBPATH})
        endif()
 +      if(WITH_OPENCOLORIO)
 +              link_directories(${OPENCOLORIO_LIBPATH})
 +      endif()
        if(WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_OPENJPEG)
                link_directories(${OPENJPEG_LIBPATH})
        endif()
@@@ -310,9 -307,6 +310,9 @@@ macro(setup_liblink
        if(WITH_OPENIMAGEIO)
                target_link_libraries(${target} ${OPENIMAGEIO_LIBRARIES})
        endif()
 +      if(WITH_OPENCOLORIO)
 +              target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
 +      endif()
        if(WITH_BOOST)
                target_link_libraries(${target} ${BOOST_LIBRARIES})
        endif()
@@@ -644,7 -638,7 +644,7 @@@ macro(blender_project_hack_post
        # --------------
        # MINGW HACK END
        if (_reset_standard_libraries)
-               # Must come after project(...)
+               # Must come after projecINCt(...)
                #
                # MINGW workaround for -ladvapi32 being included which surprisingly causes
                # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
@@@ -733,29 -727,48 +733,48 @@@ macro(set_lib_pat
  endmacro()
  
  
- # not highly optimal, may replace with generated C program like makesdna
- function(data_to_c
-          file_from file_to var_name)
+ # TODO, create a C binary and call it instead!, doing this in cmake its slow
+ macro(data_to_c
+       file_from file_to var_name
+       list_to_add)
  
-       file(READ ${file_from} file_from_string HEX)
-       string(LENGTH ${file_from_string} _max_index)
-       math(EXPR size_on_disk ${_max_index}/2)
+       list(APPEND ${list_to_add} ${file_to})
  
-       file(REMOVE ${file_to})
-       file(APPEND ${file_to} "int  ${var_name}_size = ${size_on_disk};\n")
-       file(APPEND ${file_to} "char ${var_name}[] = {")
-       set(_index 0)
-       while(NOT _index EQUAL _max_index)
-               string(SUBSTRING "${file_from_string}" ${_index} 2 _pair)
-               file(APPEND ${file_to} "0x${_pair},")
-               math(EXPR _index ${_index}+2)
-       endwhile()
-       file(APPEND ${file_to} "};\n")
- endfunction()
- # eg
- # data_to_c("/home/guest/test.txt" "/home/guest/test.txt.h" "this_is_data")
+       add_custom_command(
+               OUTPUT ${file_to}
+               COMMAND ${CMAKE_COMMAND}
+                               -DFILE_FROM=${file_from}
+                               -DFILE_TO=${file_to}
+                               -DVAR_NAME=${var_name}
+                               -P ${CMAKE_SOURCE_DIR}/build_files/cmake/data_to_c.cmake
+               DEPENDS ${file_from})
+ endmacro()
  
+ # same as above but generates the var name and output automatic.
+ macro(data_to_c_simple
+       file_from
+       list_to_add)
+     # get var name automatic from name
+     get_filename_component(_file_from_only ${file_from} NAME)
+     string(REPLACE "." "_" _file_from_only ${_file_from_only})
+     set(_var_name "datatoc_${_file_from_only}")
+     # only to avoid confusion
+     set(_file_to ${file_from}.c)
+       list(APPEND ${list_to_add} ${CMAKE_CURRENT_BINARY_DIR}/${_file_to})
+       add_custom_command(
+               OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file_to}
+               COMMAND ${CMAKE_COMMAND}
+                               -DFILE_FROM=${CMAKE_CURRENT_SOURCE_DIR}/${file_from}
+                               -DFILE_TO=${CMAKE_CURRENT_BINARY_DIR}/${_file_to}
+                               -DVAR_NAME=${_var_name}
+                               -P ${CMAKE_SOURCE_DIR}/build_files/cmake/data_to_c.cmake
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file_from})
+     unset(_file_from_only)
+     unset(_var_name)
+     unset(_file_to)
+ endmacro()
index c98e3d47dc841b63d789a8b09a2f61c4da9292a7,7b0715f4b411798117f6d66e2fa7e0c235ccd21e..9c996cc31dc6b22fbe2361922a30c81dc908b34e
@@@ -428,13 -428,19 +428,19 @@@ class SEQUENCER_PT_effect(SequencerButt
      def draw(self, context):
          layout = self.layout
  
+         sequencer = context.scene.sequence_editor
          strip = act_strip(context)
          if strip.input_count > 0:
              col = layout.column()
              col.prop(strip, "input_1")
              if strip.input_count > 1:
                  col.prop(strip, "input_2")
  
+         if strip.is_supports_mask:
+             col = layout.column()
+             col.prop_search(strip, "input_mask", sequencer, "sequences")
          if strip.type == 'COLOR':
              layout.prop(strip, "color")
  
@@@ -765,21 -771,21 +771,21 @@@ class SEQUENCER_PT_filter(SequencerButt
          if strip.use_color_balance and strip.color_balance:  # TODO - need to add this somehow
              col = layout.column()
              col.label(text="Lift:")
-             col.template_color_wheel(strip.color_balance, "lift", value_slider=False, cubic=True)
+             col.template_color_wheel(strip.color_balance, "lift", value_slider=True, cubic=True)
              row = col.row()
              row.prop(strip.color_balance, "lift", text="")
              row.prop(strip.color_balance, "invert_lift", text="Inverse")
  
              col = layout.column()
              col.label(text="Gamma:")
-             col.template_color_wheel(strip.color_balance, "gamma", value_slider=False, lock_luminosity=True, cubic=True)
+             col.template_color_wheel(strip.color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True)
              row = col.row()
              row.prop(strip.color_balance, "gamma", text="")
              row.prop(strip.color_balance, "invert_gamma", text="Inverse")
  
              col = layout.column()
              col.label(text="Gain:")
-             col.template_color_wheel(strip.color_balance, "gain", value_slider=False, lock_luminosity=True, cubic=True)
+             col.template_color_wheel(strip.color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True)
              row = col.row()
              row.prop(strip.color_balance, "gain", text="")
              row.prop(strip.color_balance, "invert_gain", text="Inverse")
@@@ -869,11 -875,5 +875,11 @@@ class SEQUENCER_PT_view(SequencerButton
              col.prop(st, "show_separate_color")
          col.prop(st, "proxy_render_size")
  
 +        col = layout.column()
 +        col.separator()
 +        col.label(text="Color Management:")
 +        col.template_colormanaged_view_settings(st, "view_settings", True)
 +
 +
  if __name__ == "__main__":  # only for live edit.
      bpy.utils.register_module(__name__)