[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13550] trunk/blender/source/blender: Added single user ipos option - useful when you make linked duplicates with many objects and want them a unique ipo .

Campbell Barton ideasman42 at gmail.com
Sun Feb 3 22:24:49 CET 2008


Revision: 13550
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13550
Author:   campbellbarton
Date:     2008-02-03 22:24:48 +0100 (Sun, 03 Feb 2008)

Log Message:
-----------
Added single user ipos option - useful when you make linked duplicates with many objects and want them a unique ipo.

Modified Paths:
--------------
    trunk/blender/source/blender/include/BDR_editobject.h
    trunk/blender/source/blender/src/editobject.c
    trunk/blender/source/blender/src/header_view3d.c

Modified: trunk/blender/source/blender/include/BDR_editobject.h
===================================================================
--- trunk/blender/source/blender/include/BDR_editobject.h	2008-02-03 20:57:52 UTC (rev 13549)
+++ trunk/blender/source/blender/include/BDR_editobject.h	2008-02-03 21:24:48 UTC (rev 13550)
@@ -97,6 +97,7 @@
 void new_id_matar(struct Material **matar, int totcol);
 void single_obdata_users(int flag);
 void single_mat_users(int flag);
+void single_ipo_users(int flag);
 void do_single_tex_user(struct Tex **from);
 void single_tex_users_expand(void);
 void single_mat_users_expand(void);

Modified: trunk/blender/source/blender/src/editobject.c
===================================================================
--- trunk/blender/source/blender/src/editobject.c	2008-02-03 20:57:52 UTC (rev 13549)
+++ trunk/blender/source/blender/src/editobject.c	2008-02-03 21:24:48 UTC (rev 13550)
@@ -4337,6 +4337,29 @@
 	}
 }
 
+void single_ipo_users(int flag)
+{
+	Object *ob;
+	Base *base;
+	Ipo *ma, *man;
+	ID *id;
+	
+	base= FIRSTBASE;
+	while(base) {
+		ob= base->object;
+		if(ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
+			ob->recalc= OB_RECALC_DATA;
+			
+			id= (ID *)ob->ipo;
+			if(id && id->us>1 && id->lib==NULL) {
+				ob->ipo= copy_ipo(ob->ipo);
+				id->us--;
+				ipo_idnew(ob->ipo);	/* drivers */
+			}
+		}
+		base= base->next;
+	}
+}
 
 void single_mat_users(int flag)
 {
@@ -4517,7 +4540,7 @@
 
 	clear_id_newpoins();
 	
-	nr= pupmenu("Make Single User%t|Object|Object & ObData|Object & ObData & Materials+Tex|Materials+Tex");
+	nr= pupmenu("Make Single User%t|Object|Object & ObData|Object & ObData & Materials+Tex|Materials+Tex|Ipos");
 	if(nr>0) {
 	
 		if(nr==1) single_object_users(1);
@@ -4535,7 +4558,11 @@
 		else if(nr==4) {
 			single_mat_users(1);
 		}
+		else if(nr==5) {
+			single_ipo_users(1);
+		}
 		
+		
 		clear_id_newpoins();
 
 		countall();

Modified: trunk/blender/source/blender/src/header_view3d.c
===================================================================
--- trunk/blender/source/blender/src/header_view3d.c	2008-02-03 20:57:52 UTC (rev 13549)
+++ trunk/blender/source/blender/src/header_view3d.c	2008-02-03 21:24:48 UTC (rev 13550)
@@ -2086,6 +2086,9 @@
 	case 4: /* Materials+Tex */
 		single_mat_users(1);
 		break;
+	case 5: /* Ipo */
+		single_ipo_users(1);
+		break;
 	}
 	
 	clear_id_newpoins();
@@ -2106,7 +2109,8 @@
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object|U, 1",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData|U, 2",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData & Materials+Tex|U, 3",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials+Tex|U, 4",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials+Tex|U, 4",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Ipos|U, 5",				0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
 	
 	uiBlockSetDirection(block, UI_RIGHT);
 	uiTextBoundsBlock(block, 60);





More information about the Bf-blender-cvs mailing list