Mask editing: remove use_parent property and use check if paren't id is set instead
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Jun 2012 07:54:46 +0000 (07:54 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Jun 2012 07:54:46 +0000 (07:54 +0000)
release/scripts/startup/bl_ui/space_clip.py
source/blender/blenkernel/intern/mask.c
source/blender/editors/mask/mask_draw.c
source/blender/editors/mask/mask_relationships.c
source/blender/makesdna/DNA_mask_types.h
source/blender/makesrna/intern/rna_mask.c

index 4bec1ad18ba5678d074265106885f44e0dff3e4b..c87c506d326640bf14d1e0d34816d0de440ac65a 100644 (file)
@@ -716,28 +716,27 @@ class CLIP_PT_active_mask_point(Panel):
         col.prop(point, "handle_type")
 
         col = layout.column()
-        col.prop(parent, "use_parent", text="Parent")
-        if parent.use_parent:
-            # Currently only parenting yo movie clip is allowed, so do not
-            # ver-oplicate things for now and use single template_ID
-            #col.template_any_ID(parent, "id", "id_type", text="")
+        # Currently only parenting yo movie clip is allowed, so do not
+        # ver-oplicate things for now and use single template_ID
+        #col.template_any_ID(parent, "id", "id_type", text="")
 
-            col.template_ID(parent, "id")
+        col.label("Parent:")
+        col.prop(parent, "id", text="")
 
-            if parent.id_type == 'MOVIECLIP' and parent.id:
-                clip = parent.id
-                tracking = clip.tracking
+        if parent.id_type == 'MOVIECLIP' and parent.id:
+            clip = parent.id
+            tracking = clip.tracking
 
-                col.prop_search(parent, "parent", tracking,
-                                "objects", icon='OBJECT_DATA', text="Object:")
+            col.prop_search(parent, "parent", tracking,
+                            "objects", icon='OBJECT_DATA', text="Object:")
 
-                if parent.parent and parent.parent in tracking.objects:
-                    object = tracking.objects[parent.parent]
-                    col.prop_search(parent, "sub_parent", object,
-                                    "tracks", icon='ANIM_DATA', text="Track:")
-                else:
-                    col.prop_search(parent, "sub_parent", tracking,
-                                    "tracks", icon='ANIM_DATA', text="Track:")
+            if parent.parent in tracking.objects:
+                object = tracking.objects[parent.parent]
+                col.prop_search(parent, "sub_parent", object,
+                                "tracks", icon='ANIM_DATA', text="Track:")
+            else:
+                col.prop_search(parent, "sub_parent", tracking,
+                                "tracks", icon='ANIM_DATA', text="Track:")
 
 
 class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel):
index b942b633aeff84793d5192c2193ed3641bc26594..66f10aca6526ca539cfa8fc3685f77e0e166bc1c 100644 (file)
@@ -1143,9 +1143,6 @@ static int BKE_mask_evaluate_parent(MaskParent *parent, float ctime, float r_co[
        if (!parent)
                return FALSE;
 
-       if ((parent->flag & MASK_PARENT_ACTIVE) == 0)
-               return FALSE;
-
        if (parent->id_type == ID_MC) {
                if (parent->id) {
                        MovieClip *clip = (MovieClip *) parent->id;
index a26ae5ea3c0c515979059573bf03895d1d80e2e5..e1efb6d841b1b517c0f6a226dec1ec8e1c020566 100644 (file)
@@ -100,7 +100,7 @@ static void draw_spline_parents(MaskLayer *UNUSED(masklay), MaskSpline *spline)
                MaskSplinePoint *point = &points_array[i];
                BezTriple *bezt = &point->bezt;
 
-               if (point->parent.flag & MASK_PARENT_ACTIVE) {
+               if (point->parent.id) {
                        glVertex2f(bezt->vec[1][0],
                                   bezt->vec[1][1]);
 
index 0e893ee2f9ff24196e0074192f806080ac3e0c93..7c0a598ba9f8a8f9c5c76bf9433c071fc44ee287 100644 (file)
@@ -66,7 +66,7 @@ static int mask_parent_clear_exec(bContext *C, wmOperator *UNUSED(op))
                                MaskSplinePoint *point = &spline->points[i];
 
                                if (MASKPOINT_ISSEL_ANY(point)) {
-                                       point->parent.flag &= ~MASK_PARENT_ACTIVE;
+                                       point->parent.id = NULL;
                                }
                        }
                }
@@ -141,8 +141,6 @@ static int mask_parent_set_exec(bContext *C, wmOperator *UNUSED(op))
                                        strcpy(point->parent.parent, tracking->name);
                                        strcpy(point->parent.sub_parent, track->name);
 
-                                       point->parent.flag |= MASK_PARENT_ACTIVE;
-
                                        copy_v2_v2(point->parent.parent_orig, parmask_pos);
                                }
                        }
index 626242c1a8d8ce3891d767ec95e7929b8da36de8..e4c27a57d855221067472008510d8cd895a866d3 100644 (file)
@@ -51,7 +51,8 @@ typedef struct Mask {
 } Mask;
 
 typedef struct MaskParent {
-       int flag;             /* parenting flags */
+       // int flag;             /* parenting flags */ /* not used */
+       int pad;
        int id_type;          /* type of parenting */
        ID *id;               /* ID block of entity to which mask/spline is parented to
                               * in case of parenting to movie tracking data set to MovieClip datablock */
@@ -130,7 +131,7 @@ typedef struct MaskLayer {
 } MaskLayer;
 
 /* MaskParent->flag */
-#define MASK_PARENT_ACTIVE  (1 << 0)
+/* #define MASK_PARENT_ACTIVE  (1 << 0) */ /* UNUSED */
 
 /* MaskSpline->flag */
 /* reserve (1 << 0) for SELECT */
index f25aba6193bd37ea12643e5af7b182b0ae6eeaf8..42c893eca16d08a6d37e555ddac4e9eb1b99c73a 100644 (file)
@@ -349,13 +349,6 @@ static void rna_def_maskParent(BlenderRNA *brna)
        srna = RNA_def_struct(brna, "MaskParent", NULL);
        RNA_def_struct_ui_text(srna, "Mask Parent", "Parenting settings for masking element");
 
-       /* use_parent */
-       prop = RNA_def_property(srna, "use_parent", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_PARENT_ACTIVE);
-       RNA_def_property_ui_text(prop, "Use Parent", "Use parenting for this layer");
-       RNA_def_property_update(prop, 0, "rna_Mask_update_data");
-
        /* Target Properties - ID-block to Drive */
        prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
        RNA_def_property_struct_type(prop, "ID");