Merging r48257 through r48263 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 25 Jun 2012 10:56:48 +0000 (10:56 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 25 Jun 2012 10:56:48 +0000 (10:56 +0000)
1  2 
CMakeLists.txt
source/blender/editors/space_node/drawnode.c
source/blender/makesdna/DNA_node_types.h
source/blender/makesrna/intern/rna_nodetree.c

diff --combined CMakeLists.txt
index 0aa3b1dad209c99828378f6557c276790c6829b0,0fb635d45d58dc95145bb660e4b632549d434331..65a2894b4226bdfbaaaed6721accab9589c0e7e1
@@@ -130,7 -130,6 +130,7 @@@ option(WITH_FFTW3         "Enable FFTW
  option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
  option(WITH_GAMEENGINE    "Enable Game Engine" ON)
  option(WITH_PLAYER        "Build Player" OFF)
 +option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ON)
  
  # GHOST Windowing Library Options
  option(WITH_GHOST_DEBUG   "Enable debugging output for the GHOST library" OFF)
@@@ -677,24 -676,6 +677,24 @@@ if(UNIX AND NOT APPLE
                endif()
        endif()
  
 +      if(WITH_OPENCOLORIO)
 +              # use lib dir if available and nothing else specified
 +              if(LIBDIR AND NOT OPENCOLORIO_ROOT_DIR)
 +                      set(OPENCOLORIO_ROOT_DIR ${LIBDIR}/ocio)
 +              endif()
 +
 +              find_package(OpenColorIO)
 +
 +              set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES})
 +              set(OPENCOLORIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
 +              set(OPENCOLORIO_DEFINITIONS)
 +
 +              if(NOT OPENCOLORIO_FOUND)
 +                      set(WITH_OPENCOLORIO OFF)
 +                      message(STATUS "OpenColorIO not found")
 +              endif()
 +      endif()
 +
        # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
        set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
  
@@@ -1041,14 -1022,6 +1041,14 @@@ elseif(WIN32
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
  
 +              if(WITH_OPENCOLORIO)
 +                      set(OPENCOLORIO ${LIBDIR}/opencolorio)
 +                      set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
 +                      set(OPENCOLORIO_LIBRARIES OpenColorIO)
 +                      set_lib_path(OPENCOLORIO_LIBPATH "opencolorio/lib")
 +                      set(OPENCOLORIO_DEFINITIONS)
 +              endif()
 +
                set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
  
                # MSVC only, Mingw doesnt need
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
                
 +              if(WITH_OPENCOLORIO)
 +                      set(OPENCOLORIO ${LIBDIR}/opencolorio)
 +                      set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
 +                      set(OPENCOLORIO_LIBRARIES OpenColorIO)
 +                      set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
 +                      set(OPENCOLORIO_DEFINITIONS)
 +              endif()
 +
                set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
  
                ## DISABLE - causes linking errors 
@@@ -1472,14 -1437,6 +1472,14 @@@ elseif(APPLE
                set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
        endif()
  
 +      if(WITH_OPENCOLORIO)
 +              set(OPENCOLORIO ${LIBDIR}/opencolorio)
 +              set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
 +              set(OPENCOLORIO_LIBRARIES OpenColorIO)
 +              set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
 +              set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
 +      endif()
 +
        set(EXETYPE MACOSX_BUNDLE)
  
        set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
@@@ -1766,6 -1723,7 +1766,7 @@@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS
  # better not set includes here but this debugging option is off by default.
  if(WITH_CXX_GUARDEDALLOC)
        include_directories(${CMAKE_SOURCE_DIR}/intern/guardedalloc)
+       add_definitions(-DWITH_CXX_GUARDEDALLOC)
  endif()
  
  if(WITH_ASSERT_ABORT)
index 0cedab0ca7f9af87d8f5972f59adff2490e1259c,69f2867535a5d8a6e44aec748d5b8d2433161f5e..1190ac304e452fc555d91811199027300fd07789
@@@ -52,7 -52,6 +52,7 @@@
  #include "BKE_library.h"
  #include "BKE_main.h"
  #include "BKE_node.h"
 +#include "BKE_tracking.h"
  
  #include "BLF_api.h"
  #include "BLF_translation.h"
@@@ -2483,44 -2482,11 +2483,46 @@@ static void node_composit_buts_keying(u
        uiItemR(layout, ptr, "clip_black", 0, NULL, ICON_NONE);
        uiItemR(layout, ptr, "clip_white", 0, NULL, ICON_NONE);
        uiItemR(layout, ptr, "dilate_distance", 0, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "feather_falloff", 0, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "feather_distance", 0, NULL, ICON_NONE);
        uiItemR(layout, ptr, "blur_post", 0, NULL, ICON_NONE);
  }
  
 +static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRNA *ptr)
 +{
 +      bNode *node= ptr->data;
 +
 +      uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL);
 +
 +      if (node->id) {
 +              MovieClip *clip = (MovieClip *) node->id;
 +              MovieTracking *tracking = &clip->tracking;
 +              MovieTrackingObject *object;
 +              uiLayout *col;
 +              PointerRNA tracking_ptr;
 +              NodeTrackPosData *data = node->storage;
 +
 +              RNA_pointer_create(&clip->id, &RNA_MovieTracking, tracking, &tracking_ptr);
 +
 +              col = uiLayoutColumn(layout, 0);
 +              uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
 +
 +              object = BKE_tracking_object_get_named(tracking, data->tracking_object);
 +              if (object) {
 +                      PointerRNA object_ptr;
 +
 +                      RNA_pointer_create(&clip->id, &RNA_MovieTrackingObject, object, &object_ptr);
 +
 +                      uiItemPointerR(col, ptr, "track_name", &object_ptr, "tracks", "", ICON_ANIM_DATA);
 +              }
 +              else {
 +                      uiItemR(layout, ptr, "track_name", 0, "", ICON_ANIM_DATA);
 +              }
 +
 +              uiItemR(layout, ptr, "use_relative", 0, NULL, ICON_NONE);
 +      }
 +}
 +
  /* only once called */
  static void node_composit_set_butfunc(bNodeType *ntype)
  {
                case CMP_NODE_KEYING:
                        ntype->uifunc = node_composit_buts_keying;
                        break;
 +              case CMP_NODE_TRACKPOS:
 +                      ntype->uifunc = node_composit_buts_trackpos;
 +                      break;
                default:
                        ntype->uifunc = NULL;
        }
index 35a204c9946f98407eacbf9b69620cda3d2dbc19,15641d9770996e0e9a04756257b7e685274f43b1..23413bce1bc4b26b4f8a7e496f9667ba9683913e
@@@ -655,14 -655,11 +655,16 @@@ typedef struct NodeKeyingData 
        float edge_kernel_tolerance;
        float clip_black, clip_white;
        int dilate_distance;
+       int feather_distance;
+       int feather_falloff;
        int blur_pre, blur_post;
  } NodeKeyingData;
  
 +typedef struct NodeTrackPosData {
 +      char tracking_object[64];
 +      char track_name[64];
 +} NodeTrackPosData;
 +
  /* frame node flags */
  #define NODE_FRAME_SHRINK             1       /* keep the bounding box minimal */
  #define NODE_FRAME_RESIZEABLE 2       /* test flag, if frame can be resized by user */
index 50ec8dd1683ec9f0cbba4a618457d10698730b74,33eb755a96d10a2419d06c1c5d6f42283d7f9c98..dea1d8c593159e361d65e2209463a294d7e86704
@@@ -3620,37 -3620,20 +3620,49 @@@ static void def_cmp_keying(StructRNA *s
        RNA_def_property_range(prop, 0.0f, 1.0f);
        RNA_def_property_ui_text(prop, "Edge Kernel Tolerance", "Tolerance to pixels inside kernel which are treating as belonging to the same plane");
        RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+       prop = RNA_def_property(srna, "feather_falloff", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "feather_falloff");
+       RNA_def_property_enum_items(prop, proportional_falloff_curve_only_items);
+       RNA_def_property_ui_text(prop, "Feather Falloff", "Falloff type the feather");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+       prop = RNA_def_property(srna, "feather_distance", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "feather_distance");
+       RNA_def_property_range(prop, -100, 100);
+       RNA_def_property_ui_text(prop, "Feather Distance", "Distance to grow/shrink the feather");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }
  
 +static void def_cmp_trackpos(StructRNA *srna)
 +{
 +      PropertyRNA *prop;
 +
 +      prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_pointer_sdna(prop, NULL, "id");
 +      RNA_def_property_struct_type(prop, "MovieClip");
 +      RNA_def_property_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Movie Clip", "");
 +      RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 +
 +      prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
 +      RNA_def_property_ui_text(prop, "Relative", "Return relative position to first track's marker");
 +      RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 +
 +      RNA_def_struct_sdna_from(srna, "NodeTrackPosData", "storage");
 +
 +      prop = RNA_def_property(srna, "tracking_object", PROP_STRING, PROP_NONE);
 +      RNA_def_property_string_sdna(prop, NULL, "tracking_object");
 +      RNA_def_property_ui_text(prop, "Tracking Object", "");
 +      RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 +
 +      prop = RNA_def_property(srna, "track_name", PROP_STRING, PROP_NONE);
 +      RNA_def_property_string_sdna(prop, NULL, "track_name");
 +      RNA_def_property_ui_text(prop, "Track", "");
 +      RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 +}
 +
  /* -- Texture Nodes --------------------------------------------------------- */
  
  static void def_tex_output(StructRNA *srna)