Merging r46725 through r46963 from trunk into soc-2011-tomato
[blender.git] / source / blender / makesrna / intern / rna_space.c
index e4d380e..da8a683 100644 (file)
@@ -120,6 +120,7 @@ EnumPropertyItem viewport_shade_items[] = {
 #ifdef RNA_RUNTIME
 
 #include "DNA_anim_types.h"
+#include "DNA_mask_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_screen_types.h"
 
@@ -1037,6 +1038,13 @@ static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
        ED_space_clip_set(NULL, screen, sc, (MovieClip *)value.data);
 }
 
+static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr, PointerRNA value)
+{
+       SpaceClip *sc= (SpaceClip*)(ptr->data);
+
+       ED_space_clip_set_mask(NULL, sc, (Mask*)value.data);
+}
+
 static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        SpaceClip *sc = (SpaceClip *)(ptr->data);
@@ -2969,6 +2977,7 @@ static void rna_def_space_clip(BlenderRNA *brna)
                {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction",
                                         "Show tracking/reconstruction tools"},
                {SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"},
+               {SC_MODE_MASKEDITING, "MASKEDITING", ICON_MOD_MASK, "Mask editing", "Show mask editing tools"},
                {0, NULL, 0, NULL, NULL}
        };
 
@@ -2986,6 +2995,22 @@ static void rna_def_space_clip(BlenderRNA *brna)
                {0, NULL, 0, NULL, NULL}
        };
 
+       static EnumPropertyItem gpencil_source_items[] = {
+               {SC_GPENCIL_SRC_CLIP, "CLIP", 0, "Clip", "Show grease pencil datablock which belongs to movie clip"},
+               {SC_GPENCIL_SRC_TRACK, "TRACK", 0, "Track", "Show grease pencil datablock which belongs to active track"},
+               {0, NULL, 0, NULL, NULL}
+       };
+
+       static EnumPropertyItem pivot_items[] = {
+               {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
+                            "Pivot around bounding box center of selected object(s)"},
+               {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
+                           "Individual Origins", "Pivot around each object's own origin"},
+               {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point",
+                              "Pivot around the median point of selected objects"},
+               {0, NULL, 0, NULL, NULL}
+       };
+
        srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
        RNA_def_struct_sdna(srna, "SpaceClip");
        RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
@@ -3006,6 +3031,13 @@ static void rna_def_space_clip(BlenderRNA *brna)
                                 "Parameters defining which frame of the movie clip is displayed");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL);
 
+       /* mask */
+       prop= RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
+       RNA_def_property_flag(prop, PROP_EDITABLE);
+       RNA_def_property_ui_text(prop, "Mask", "Mask displayed and edited in this space");
+       RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceClipEditor_mask_set", NULL, NULL);
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
+
        /* mode */
        prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "mode");
@@ -3165,6 +3197,20 @@ static void rna_def_space_clip(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
        RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
 
+       /* grease pencil source */
+       prop = RNA_def_property(srna, "grease_pencil_source", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "gpencil_src");
+       RNA_def_property_enum_items(prop, gpencil_source_items);
+       RNA_def_property_ui_text(prop, "Grease Pencil Source", "Where the grease pencil comes from");
+       RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
+
+       /* pivot point */
+       prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "around");
+       RNA_def_property_enum_items(prop, pivot_items);
+       RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL);
+
        /* ** dopesheet ** */
 
        /* dopesheet sort */