Origin to Geometry uses bounding box while set to Median Center
Open, ConfirmedPublic

Description

System Information
Manjaro Linux x64
GeForce GT 640

Blender Version
Broken: 2.78c, 2.79RC1, 2.75a

Description
When the Pivot Point is set to anything else than Median Point, the Origin to Geometry operator uses the bounding box even though it's set to Median Center by default. We have to switch to Bounds Center and back to Median Center to solve that (or have the Pivot Point set to Median at the first place).

Exact steps for others to reproduce the error
Open this file :

  1. do an Object > Transform > Origin to Geometry : the origin is at the center of the bounding box
  2. in the Tool Shelf or F6 menu, set center to Bounds Center
  3. switch back to Median Center
  4. the origin is now positioned at the median center.

This doesn't happen when the pivot point is set to Median Point but happens in any other Pivot Point setting.

Details

Type
Bug
Caetano (Caetano) updated the task description. (Show Details)

Apparently, the initial value, if not set, is overwritten by the enum item that defines the current center of rotation and scaling of selected objects.
I don't see why.
Possible solution:

@@ -765,12 +765,10 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 	}
 	else {
 		/* get the view settings if 'around' isn't set and the view is available */
 		View3D *v3d = CTX_wm_view3d(C);
 		copy_v3_v3(cursor, ED_view3d_cursor3d_get(scene, v3d));
-		if (v3d && !RNA_struct_property_is_set(op->ptr, "center"))
-			around = v3d->around;
 	}
 
 	zero_v3(cent);
 
 	if (obedit) {