[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47597] trunk/blender: Mask editing: remove use_parent property and use check if paren't id is set instead

Sergey Sharybin sergey.vfx at gmail.com
Fri Jun 8 09:55:00 CEST 2012


Revision: 47597
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47597
Author:   nazgul
Date:     2012-06-08 07:54:46 +0000 (Fri, 08 Jun 2012)
Log Message:
-----------
Mask editing: remove use_parent property and use check if paren't id is set instead

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_clip.py
    trunk/blender/source/blender/blenkernel/intern/mask.c
    trunk/blender/source/blender/editors/mask/mask_draw.c
    trunk/blender/source/blender/editors/mask/mask_relationships.c
    trunk/blender/source/blender/makesdna/DNA_mask_types.h
    trunk/blender/source/blender/makesrna/intern/rna_mask.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_clip.py	2012-06-08 07:15:38 UTC (rev 47596)
+++ trunk/blender/release/scripts/startup/bl_ui/space_clip.py	2012-06-08 07:54:46 UTC (rev 47597)
@@ -716,28 +716,27 @@
         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):

Modified: trunk/blender/source/blender/blenkernel/intern/mask.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask.c	2012-06-08 07:15:38 UTC (rev 47596)
+++ trunk/blender/source/blender/blenkernel/intern/mask.c	2012-06-08 07:54:46 UTC (rev 47597)
@@ -1143,9 +1143,6 @@
 	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;

Modified: trunk/blender/source/blender/editors/mask/mask_draw.c
===================================================================
--- trunk/blender/source/blender/editors/mask/mask_draw.c	2012-06-08 07:15:38 UTC (rev 47596)
+++ trunk/blender/source/blender/editors/mask/mask_draw.c	2012-06-08 07:54:46 UTC (rev 47597)
@@ -100,7 +100,7 @@
 		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]);
 

Modified: trunk/blender/source/blender/editors/mask/mask_relationships.c
===================================================================
--- trunk/blender/source/blender/editors/mask/mask_relationships.c	2012-06-08 07:15:38 UTC (rev 47596)
+++ trunk/blender/source/blender/editors/mask/mask_relationships.c	2012-06-08 07:54:46 UTC (rev 47597)
@@ -66,7 +66,7 @@
 				MaskSplinePoint *point = &spline->points[i];
 
 				if (MASKPOINT_ISSEL_ANY(point)) {
-					point->parent.flag &= ~MASK_PARENT_ACTIVE;
+					point->parent.id = NULL;
 				}
 			}
 		}
@@ -141,8 +141,6 @@
 					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);
 				}
 			}

Modified: trunk/blender/source/blender/makesdna/DNA_mask_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_mask_types.h	2012-06-08 07:15:38 UTC (rev 47596)
+++ trunk/blender/source/blender/makesdna/DNA_mask_types.h	2012-06-08 07:54:46 UTC (rev 47597)
@@ -51,7 +51,8 @@
 } 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 @@
 } MaskLayer;
 
 /* MaskParent->flag */
-#define MASK_PARENT_ACTIVE  (1 << 0)
+/* #define MASK_PARENT_ACTIVE  (1 << 0) */ /* UNUSED */
 
 /* MaskSpline->flag */
 /* reserve (1 << 0) for SELECT */

Modified: trunk/blender/source/blender/makesrna/intern/rna_mask.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_mask.c	2012-06-08 07:15:38 UTC (rev 47596)
+++ trunk/blender/source/blender/makesrna/intern/rna_mask.c	2012-06-08 07:54:46 UTC (rev 47597)
@@ -349,13 +349,6 @@
 	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");




More information about the Bf-blender-cvs mailing list