From fc07b1fce3a6f1d6962840859c763bd192fbdcd7 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 8 Jun 2012 07:54:46 +0000 Subject: Mask editing: remove use_parent property and use check if paren't id is set instead --- release/scripts/startup/bl_ui/space_clip.py | 35 ++++++++++++------------ source/blender/blenkernel/intern/mask.c | 3 -- source/blender/editors/mask/mask_draw.c | 2 +- source/blender/editors/mask/mask_relationships.c | 4 +-- source/blender/makesdna/DNA_mask_types.h | 5 ++-- source/blender/makesrna/intern/rna_mask.c | 7 ----- 6 files changed, 22 insertions(+), 34 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 4bec1ad18ba..c87c506d326 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -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): diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index b942b633aef..66f10aca652 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -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; diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index a26ae5ea3c0..e1efb6d841b 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -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]); diff --git a/source/blender/editors/mask/mask_relationships.c b/source/blender/editors/mask/mask_relationships.c index 0e893ee2f9f..7c0a598ba9f 100644 --- a/source/blender/editors/mask/mask_relationships.c +++ b/source/blender/editors/mask/mask_relationships.c @@ -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); } } diff --git a/source/blender/makesdna/DNA_mask_types.h b/source/blender/makesdna/DNA_mask_types.h index 626242c1a8d..e4c27a57d85 100644 --- a/source/blender/makesdna/DNA_mask_types.h +++ b/source/blender/makesdna/DNA_mask_types.h @@ -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 */ diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c index f25aba6193b..42c893eca16 100644 --- a/source/blender/makesrna/intern/rna_mask.c +++ b/source/blender/makesrna/intern/rna_mask.c @@ -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"); -- cgit v1.2.3