[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30677] trunk/blender/source/blender/ editors/object/object_transform.c: bugfix [#22941] set object center/ origin on a linked duplicate causes linked copied to become unselectable in viewport

Campbell Barton ideasman42 at gmail.com
Sat Jul 24 01:48:22 CEST 2010


Revision: 30677
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30677
Author:   campbellbarton
Date:     2010-07-24 01:48:21 +0200 (Sat, 24 Jul 2010)

Log Message:
-----------
bugfix [#22941] set object center/origin on a linked duplicate causes linked copied to become unselectable in viewport

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_transform.c

Modified: trunk/blender/source/blender/editors/object/object_transform.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_transform.c	2010-07-23 21:08:27 UTC (rev 30676)
+++ trunk/blender/source/blender/editors/object/object_transform.c	2010-07-23 23:48:21 UTC (rev 30677)
@@ -205,7 +205,7 @@
 						eulO_to_axis_angle( ob->rotAxis, &ob->rotAngle,eul, EULER_ORDER_DEFAULT);
 					}
 					else {
-						VECCOPY(ob->rot, eul);
+						copy_v3_v3(ob->rot, eul);
 					}
 				}
 			}						 // Duplicated in source/blender/editors/armature/editarmature.c
@@ -340,10 +340,7 @@
 			v3= ob->parentinv[3];
 			
 			copy_m3_m4(mat, ob->parentinv);
-			VECCOPY(v3, v1);
-			v3[0]= -v3[0];
-			v3[1]= -v3[1];
-			v3[2]= -v3[2];
+			negate_v3_v3(v3, v1);
 			mul_m3_v3(mat, v3);
 		}
 		ob->recalc |= OB_RECALC_OB;
@@ -712,6 +709,7 @@
 	ScrArea *sa= CTX_wm_area(C);
 	View3D *v3d= sa->spacedata.first;
 	Object *obedit= CTX_data_edit_object(C);
+	Object *tob;
 	Mesh *me, *tme;
 	Curve *cu;
 /*	BezTriple *bezt;
@@ -779,9 +777,10 @@
 			ob->flag &= ~OB_DONE;
 	}
 	CTX_DATA_END;
-	
-	for (me= G.main->mesh.first; me; me= me->id.next) {
-		me->flag &= ~ME_ISDONE;
+
+	for (tob= G.main->object.first; tob; tob= tob->id.next) {
+		if(tob->data)
+			((ID *)tob->data)->flag &= ~LIB_DOIT;
 	}
 	
 	CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
@@ -823,13 +822,14 @@
 							}
 						}
 					}
+
+					tot_change++;
+					me->id.flag |= LIB_DOIT;
 						
-					me->flag |= ME_ISDONE;
-						
 					if(centermode) {
 						copy_m3_m4(omat, ob->obmat);
 						
-						VECCOPY(centn, cent);
+						copy_v3_v3(centn, cent);
 						mul_m3_v3(omat, centn);
 						ob->loc[0]+= centn[0];
 						ob->loc[1]+= centn[1];
@@ -849,7 +849,7 @@
 									ob_other->recalc= OB_RECALC_OB|OB_RECALC_DATA;
 
 									copy_m3_m4(omat, ob_other->obmat);
-									VECCOPY(centn, cent);
+									copy_v3_v3(centn, cent);
 									mul_m3_v3(omat, centn);
 									ob_other->loc[0]+= centn[0];
 									ob_other->loc[1]+= centn[1];
@@ -858,7 +858,7 @@
 									where_is_object(scene, ob_other);
 									ignore_parent_tx(bmain, scene, ob_other);
 									
-									if(tme && (tme->flag & ME_ISDONE)==0) {
+									if(!(tme->id.flag & LIB_DOIT)) {
 										mvert= tme->mvert;
 										for(a=0; a<tme->totvert; a++, mvert++) {
 											sub_v3_v3(mvert->co, cent);
@@ -874,15 +874,15 @@
 												}
 											}
 										}
-										
-										tme->flag |= ME_ISDONE;
+
+										tot_change++;
+										tme->id.flag |= LIB_DOIT;
 									}
 								}
 							}
 						}
 						CTX_DATA_END;
 					}
-					tot_change++;
 				}
 			}
 			else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
@@ -903,7 +903,7 @@
 					tot_lib_error++;
 				} else {
 					if(centermode==2) {
-						VECCOPY(cent, give_cursor(scene, v3d));
+						copy_v3_v3(cent, give_cursor(scene, v3d));
 						invert_m4_m4(ob->imat, ob->obmat);
 						mul_m4_v3(ob->imat, cent);
 
@@ -956,6 +956,8 @@
 					}
 					
 					tot_change++;
+					cu->id.flag |= LIB_DOIT;
+
 					if(obedit) {
 						if (centermode==0) {
 							DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
@@ -982,6 +984,7 @@
 					cu->yof /= cu->fsize;
 
 					tot_change++;
+					cu->id.flag |= LIB_DOIT;
 				}
 			}
 			else if(ob->type==OB_ARMATURE) {
@@ -998,7 +1001,9 @@
 					 * Bone + object locations are handled there.
 					 */
 					docenter_armature(scene, v3d, ob, centermode);
+
 					tot_change++;
+					cu->id.flag |= LIB_DOIT;
 					
 					where_is_object(scene, ob);
 					ignore_parent_tx(bmain, scene, ob);
@@ -1007,10 +1012,15 @@
 						break;
 				}
 			}
-			ob->recalc= OB_RECALC_OB|OB_RECALC_DATA;
 		}
 	}
 	CTX_DATA_END;
+
+	for (tob= G.main->object.first; tob; tob= tob->id.next) {
+		if(tob->data && (((ID *)tob->data)->flag & LIB_DOIT)) {
+			tob->recalc= OB_RECALC_OB|OB_RECALC_DATA;
+		}
+	}
 	
 	if (tot_change) {
 		DAG_ids_flush_update(0);





More information about the Bf-blender-cvs mailing list