[Bf-blender-cvs] [f7957e2] master: Cleanup: tabs in empty lines.

Bastien Montagne noreply at git.blender.org
Fri Oct 10 18:48:41 CEST 2014


Commit: f7957e2f7ebf3a40d3e7265db707fa88592bceab
Author: Bastien Montagne
Date:   Fri Oct 10 18:44:37 2014 +0200
Branches: master
https://developer.blender.org/rBf7957e2f7ebf3a40d3e7265db707fa88592bceab

Cleanup: tabs in empty lines.

===================================================================

M	source/blender/editors/object/object_relations.c

===================================================================

diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 75919e6..f905f0b 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -128,9 +128,9 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
 	BPoint *bp;
 	Object *par;
 	int a, v1 = 0, v2 = 0, v3 = 0, v4 = 0, nr = 1;
-	
+
 	/* we need 1 to 3 selected vertices */
-	
+
 	if (obedit->type == OB_MESH) {
 		Mesh *me = obedit->data;
 		BMEditMesh *em;
@@ -160,7 +160,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
 	}
 	else if (ELEM(obedit->type, OB_SURF, OB_CURVE)) {
 		ListBase *editnurb = object_editcurve_get(obedit);
-		
+
 		cu = obedit->data;
 
 		nu = editnurb->first;
@@ -200,7 +200,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
 	}
 	else if (obedit->type == OB_LATTICE) {
 		Lattice *lt = obedit->data;
-		
+
 		a = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
 		bp = lt->editlatt->latt->def;
 		while (a--) {
@@ -215,24 +215,24 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
 			bp++;
 		}
 	}
-	
+
 	if (v4 || !((v1 && v2 == 0 && v3 == 0) || (v1 && v2 && v3))) {
 		BKE_report(op->reports, RPT_ERROR, "Select either 1 or 3 vertices to parent to");
 		return OPERATOR_CANCELLED;
 	}
-	
+
 	CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
 	{
 		if (ob != obedit) {
 			DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
 			par = obedit->parent;
-			
+
 			if (BKE_object_parent_loop_check(par, ob)) {
 				BKE_report(op->reports, RPT_ERROR, "Loop in parents");
 			}
 			else {
 				Object workob;
-				
+
 				ob->parent = BASACT->object;
 				if (v3) {
 					ob->partype = PARVERT3;
@@ -256,7 +256,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
 		}
 	}
 	CTX_DATA_END;
-	
+
 	DAG_relations_tag_update(bmain);
 
 	WM_event_add_notifier(C, NC_OBJECT, NULL);
@@ -270,12 +270,12 @@ void OBJECT_OT_vertex_parent_set(wmOperatorType *ot)
 	ot->name = "Make Vertex Parent";
 	ot->description = "Parent selected objects to the selected vertices";
 	ot->idname = "OBJECT_OT_vertex_parent_set";
-	
+
 	/* api callbacks */
 	ot->invoke = WM_operator_confirm;
 	ot->poll = vertex_parent_set_poll;
 	ot->exec = vertex_parent_set_exec;
-	
+
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
@@ -287,27 +287,26 @@ static int make_proxy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
 	Scene *scene = CTX_data_scene(C);
 	Object *ob = ED_object_active_context(C);
-	
+
 	/* sanity checks */
 	if (!scene || scene->id.lib || !ob)
 		return OPERATOR_CANCELLED;
-		
+
 	/* Get object to work on - use a menu if we need to... */
 	if (ob->dup_group && ob->dup_group->id.lib) {
 		/* gives menu with list of objects in group */
 		/* proxy_group_objects_menu(C, op, ob, ob->dup_group); */
 		WM_enum_search_invoke(C, op, event);
 		return OPERATOR_CANCELLED;
-
 	}
 	else if (ob->id.lib) {
 		uiPopupMenu *pup = uiPupMenuBegin(C, IFACE_("OK?"), ICON_QUESTION);
 		uiLayout *layout = uiPupMenuLayout(pup);
-		
+
 		/* create operator menu item with relevant properties filled in */
 		uiItemFullO_ptr(layout, op->type, op->type->name, ICON_NONE, NULL,
 		                WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
-		
+
 		/* present the menu and be done... */
 		uiPupMenuEnd(C, pup);
 	}
@@ -315,7 +314,7 @@ static int make_proxy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 		/* error.. cannot continue */
 		BKE_report(op->reports, RPT_ERROR, "Can only make proxy for a referenced object or group");
 	}
-	
+
 	/* this invoke just calls another instance of this operator... */
 	return OPERATOR_CANCELLED;
 }
@@ -335,32 +334,32 @@ static int make_proxy_exec(bContext *C, wmOperator *op)
 		ob = gob;
 		gob = NULL;
 	}
-	
+
 	if (ob) {
 		Object *newob;
 		Base *newbase, *oldbase = BASACT;
 		char name[MAX_ID_NAME + 4];
-		
+
 		/* Add new object for the proxy */
 		newob = BKE_object_add(bmain, scene, OB_EMPTY);
 
 		BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name + 2);
 
 		rename_id(&newob->id, name);
-		
+
 		/* set layers OK */
 		newbase = BASACT;    /* BKE_object_add sets active... */
 		newbase->lay = oldbase->lay;
 		newob->lay = newbase->lay;
-		
+
 		/* remove base, leave user count of object, it gets linked in BKE_object_make_proxy */
 		if (gob == NULL) {
 			BKE_scene_base_unlink(scene, oldbase);
 			MEM_freeN(oldbase);
 		}
-		
+
 		BKE_object_make_proxy(newob, ob, gob);
-		
+
 		/* depsgraph flushes are needed for the new data */
 		DAG_relations_tag_update(bmain);
 		DAG_id_tag_update(&newob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
@@ -370,7 +369,7 @@ static int make_proxy_exec(bContext *C, wmOperator *op)
 		BKE_report(op->reports, RPT_ERROR, "No object to make proxy for");
 		return OPERATOR_CANCELLED;
 	}
-	
+
 	return OPERATOR_FINISHED;
 }
 
@@ -408,15 +407,15 @@ void OBJECT_OT_proxy_make(wmOperatorType *ot)
 	ot->name = "Make Proxy";
 	ot->idname = "OBJECT_OT_proxy_make";
 	ot->description = "Add empty object to become local replacement data of a library-linked object";
-	
+
 	/* callbacks */
 	ot->invoke = make_proxy_invoke;
 	ot->exec = make_proxy_exec;
 	ot->poll = ED_operator_object_active;
-	
+
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-	
+
 	/* properties */
 	/* XXX, relies on hard coded ID at the moment */
 	prop = RNA_def_enum(ot->srna, "object", DummyRNA_DEFAULT_items, 0, "Proxy Object",
@@ -449,13 +448,13 @@ static void object_remove_parent_deform_modifiers(Object *ob, const Object *par)
 {
 	if (ELEM(par->type, OB_ARMATURE, OB_LATTICE, OB_CURVE)) {
 		ModifierData *md, *mdn;
-		
+
 		/* assume that we only need to remove the first instance of matching deform modifier here */
 		for (md = ob->modifiers.first; md; md = mdn) {
 			bool free = false;
-			
+
 			mdn = md->next;
-			
+
 			/* need to match types (modifier + parent) and references */
 			if ((md->type == eModifierType_Armature) && (par->type == OB_ARMATURE)) {
 				ArmatureModifierData *amd = (ArmatureModifierData *)md;
@@ -475,7 +474,7 @@ static void object_remove_parent_deform_modifiers(Object *ob, const Object *par)
 					free = true;
 				}
 			}
-			
+
 			/* free modifier if match */
 			if (free) {
 				BLI_remlink(&ob->modifiers, md);
@@ -489,13 +488,13 @@ void ED_object_parent_clear(Object *ob, const int type)
 {
 	if (ob->parent == NULL)
 		return;
-	
+
 	switch (type) {
 		case CLEAR_PARENT_ALL:
 		{
 			/* for deformers, remove corresponding modifiers to prevent a large number of modifiers building up */
 			object_remove_parent_deform_modifiers(ob, ob->parent);
-			
+
 			/* clear parenting relationship completely */
 			ob->parent = NULL;
 			break;
@@ -514,10 +513,10 @@ void ED_object_parent_clear(Object *ob, const int type)
 			break;
 		}
 	}
-	
+
 	/* Always clear parentinv matrix for sake of consistency, see T41950. */
 	unit_m4(ob->parentinv);
-	
+
 	DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
 }
 
@@ -545,16 +544,16 @@ void OBJECT_OT_parent_clear(wmOperatorType *ot)
 	ot->name = "Clear Parent";
 	ot->description = "Clear the object's parenting";
 	ot->idname = "OBJECT_OT_parent_clear";
-	
+
 	/* api callbacks */
 	ot->invoke = WM_menu_invoke;
 	ot->exec = parent_clear_exec;
-	
+
 	ot->poll = ED_operator_object_active_editable;
-	
+
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-	
+
 	ot->prop = RNA_def_enum(ot->srna, "type", prop_clear_parent_types, CLEAR_PARENT_ALL, "Type", "");
 }
 
@@ -603,16 +602,16 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
 {
 	bPoseChannel *pchan = NULL;
 	const bool pararm = ELEM(partype, PAR_ARMATURE, PAR_ARMATURE_NAME, PAR_ARMATURE_ENVELOPE, PAR_ARMATURE_AUTO);
-	
+
 	DAG_id_tag_update(&par->id, OB_RECALC_OB);
-	
+
 	/* preconditions */
 	if (partype == PAR_FOLLOW || partype == PAR_PATH_CONST) {
 		if (par->type != OB_CURVE)
 			return 0;
 		else {
 			Curve *cu = par->data;
-			
+
 			if ((cu->flag & CU_PATH) == 0) {
 				cu->flag |= CU_PATH | CU_FOLLOW;
 				BKE_displist_make_curveTypes(scene, par, 0);  /* force creation of path data */
@@ -626,12 +625,12 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
 				/* get or create F-Curve */
 				bAction *act = verify_adt_action(&cu->id, 1);
 				FCurve *fcu = verify_fcurve(act, NULL, NULL, "eval_time", 0, 1);
-				
+
 				/* setup dummy 'generator' modifier here to get 1-1 correspondence still working */
 				if (!fcu->bezt && !fcu->fpt && !fcu->modifiers.first)
 					add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR);
 			}
-			
+
 			/* fall back on regular parenting now (for follow only) */
 			if (partype == PAR_FOLLOW)
 				partype = PAR_OBJECT;
@@ -639,13 +638,13 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
 	}
 	else if (ELEM(partype, PAR_BONE, PAR_BONE_RELATIVE)) {
 		pchan = BKE_pose_channel_active(par);
-		
+
 		if (pchan == NULL) {
 			BKE_report(reports, RPT_ERROR, "No active bone");
 			return false;
 		}
 	}
-	
+
 	if (ob != par) {
 		if (BKE_object_parent_loop_check(par, ob)) {
 			BKE_report(reports, RPT_ERROR, "Loop in parents");
@@ -667,13 +666,13 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
 				/* Always clear parentinv matrix for sake of consistency, see T41950. */
 				unit_m4(ob->parentinv);
 			}
-			
+
 			/* handle types */
 			if (pchan)
 				BLI_strncpy(ob->parsubstr, pchan->name, sizeof(ob->parsubstr));
 			else
 				ob->parsubstr[0] = 0;
-				
+
 			if (partype == PAR_PATH_CONST) {
 				/* don't do anything here, since this is not technically "parenting" */
 			}
@@ -681,17 +680,18 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
 				/* partype is now set to PAROBJECT so that invisible 'virtual' modifiers don't need to be created
 				 * NOTE: the old (2.4x) method was to set ob->partype = PARSKEL, creating the virtual modifiers
 				 */
-				ob->partype = PAROBJECT; /* note, dna define, not operator property */
-

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list