Mask editing: remove use_parent property and use check if paren't id is set instead
[blender.git] / source / blender / editors / mask / mask_relationships.c
index 8a8427c024bec6327c43f6ca936087e5b0e32b4c..7c0a598ba9f8a8f9c5c76bf9433c071fc44ee287 100644 (file)
  *  \ingroup edmask
  */
 
-#include "MEM_guardedalloc.h"
 
-#include "BLI_utildefines.h"
-#include "BLI_listbase.h"
 #include "BLI_math.h"
 
 #include "BKE_context.h"
-#include "BKE_curve.h"
 #include "BKE_depsgraph.h"
 #include "BKE_mask.h"
 #include "BKE_tracking.h"
 
 #include "DNA_mask_types.h"
-#include "DNA_scene_types.h"
 #include "DNA_object_types.h"  /* SELECT */
 
 #include "WM_api.h"
 #include "WM_types.h"
 
 #include "ED_screen.h"
-#include "ED_mask.h"
-#include "ED_clip.h"
-
-#include "RNA_access.h"
-#include "RNA_define.h"
+#include "ED_mask.h"  /* own include */
 
 #include "mask_intern.h"  /* own include */
 
@@ -75,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;
                                }
                        }
                }
@@ -91,13 +82,13 @@ void MASK_OT_parent_clear(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Clear Parent";
-       ot->description = "Clear the masks parenting";
+       ot->description = "Clear the mask's parenting";
        ot->idname = "MASK_OT_parent_clear";
 
        /* api callbacks */
        ot->exec = mask_parent_clear_exec;
 
-       ot->poll = ED_maskediting_mask_poll;
+       ot->poll = ED_maskedit_mask_poll;
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -150,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);
                                }
                        }
@@ -169,14 +158,14 @@ void MASK_OT_parent_set(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Make Parent";
-       ot->description = "Set the masks parenting";
+       ot->description = "Set the mask's parenting";
        ot->idname = "MASK_OT_parent_set";
 
        /* api callbacks */
        //ot->invoke = mask_parent_set_invoke;
        ot->exec = mask_parent_set_exec;
 
-       ot->poll = ED_maskediting_mask_poll;
+       ot->poll = ED_maskedit_mask_poll;
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;