[Bf-blender-cvs] [ba1e23b] gooseberry: Merge branch 'master' into gooseberry

Antony Riakiotakis noreply at git.blender.org
Wed Jul 1 15:44:07 CEST 2015


Commit: ba1e23bf8494b01f6c2ba173a140d11ae7603603
Author: Antony Riakiotakis
Date:   Wed Jul 1 15:43:56 2015 +0200
Branches: gooseberry
https://developer.blender.org/rBba1e23bf8494b01f6c2ba173a140d11ae7603603

Merge branch 'master' into gooseberry

Conflicts:
	source/blender/blenlib/intern/BLI_filelist.c
	source/blender/editors/transform/transform.h
	source/blender/editors/transform/transform_snap.c
	source/blenderplayer/bad_level_call_stubs/stubs.c

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



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

diff --cc source/blender/blenlib/intern/BLI_filelist.c
index f700a12,786eaa7..a305ab3
--- a/source/blender/blenlib/intern/BLI_filelist.c
+++ b/source/blender/blenlib/intern/BLI_filelist.c
@@@ -287,25 -288,23 +288,24 @@@ static void bli_adddirstrings(struct Bu
  		 * will buy us some time until files get bigger than 4GB or until
  		 * everyone starts using __USE_FILE_OFFSET64 or equivalent.
  		 */
- 		file->realsize = file->s.st_size;
+ 		size = (double)file->s.st_size;
++		file->realsize = size;
  
- 		BLI_file_size_string(file->realsize, file->size, sizeof(file->size));
- 	}
- }
- 
- void BLI_file_size_string(off_t st_size, char *size, size_t len)
- {
- 	if (st_size > 1024 * 1024 * 1024) {
- 		BLI_snprintf(size, len, "%.2f GiB", ((double)st_size) / (1024 * 1024 * 1024));
- 	}
- 	else if (st_size > 1024 * 1024) {
- 		BLI_snprintf(size, len, "%.1f MiB", ((double)st_size) / (1024 * 1024));
- 	}
- 	else if (st_size > 1024) {
- 		BLI_snprintf(size, len, "%d KiB", (int)(st_size / 1024));
- 	}
- 	else {
- 		BLI_snprintf(size, len, "%d B", (int)st_size);
+ 		if (size > 1024.0 * 1024.0 * 1024.0 * 1024.0) {
+ 			BLI_snprintf(file->size, sizeof(file->size), "%.1f TiB", size / (1024.0 * 1024.0 * 1024.0 * 1024.0));
+ 		}
+ 		else if (size > 1024.0 * 1024.0 * 1024.0) {
+ 			BLI_snprintf(file->size, sizeof(file->size), "%.1f GiB", size / (1024.0 * 1024.0 * 1024.0));
+ 		}
+ 		else if (size > 1024.0 * 1024.0) {
+ 			BLI_snprintf(file->size, sizeof(file->size), "%.1f MiB", size / (1024.0 * 1024.0));
+ 		}
+ 		else if (size > 1024.0) {
+ 			BLI_snprintf(file->size, sizeof(file->size), "%.1f KiB", size / 1024.0);
+ 		}
+ 		else {
+ 			BLI_snprintf(file->size, sizeof(file->size), "%d B", (int)size);
+ 		}
  	}
  }
  
diff --cc source/blender/editors/transform/transform.c
index 67591f5,ccd57db..c43b9bf
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@@ -2039,35 -2009,6 +2009,7 @@@ void saveTransform(bContext *C, TransIn
  	}
  }
  
- static void initSnappingAspect(TransInfo *t)
- {
- 	if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION)) {
- 		if (t->options & CTX_MASK) {
- 			ED_space_image_get_aspect(t->sa->spacedata.first, t->snap_aspect, t->snap_aspect + 1);
- 		}
- 		else if (t->options & CTX_PAINT_CURVE) {
- 			t->snap_aspect[0] = t->snap_aspect[1] = 1.0;
- 		}
- 		else {
- 			ED_space_image_get_uv_aspect(t->sa->spacedata.first, t->snap_aspect, t->snap_aspect + 1);
- 		}
- 	}
- 	else if ((t->spacetype == SPACE_IPO) && (t->mode == TFM_TRANSLATION)) {
- 		View2D *v2d = &t->ar->v2d;
- 		View2DGrid *grid;
- 		SpaceIpo *sipo = t->sa->spacedata.first;
- 		int unity = V2D_UNIT_VALUES;
- 		int unitx = (sipo->flag & SIPO_DRAWTIME) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMESCALE;
- 
- 		/* grid */
- 		grid = UI_view2d_grid_calc(t->scene, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, t->ar->winx, t->ar->winy);
- 
- 		UI_view2d_grid_size(grid, t->snap_aspect, t->snap_aspect + 1);
- 		UI_view2d_grid_free(grid);
- 	}
- }
- 
 +
  /* note: caller needs to free 't' on a 0 return */
  bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event, int mode)
  {
diff --cc source/blender/editors/transform/transform.h
index 2672df2,b826b7f..431b52c
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@@ -363,7 -365,7 +365,8 @@@ typedef struct TransInfo 
  	short		event_type;		/* event->type used to invoke transform */
  	short       idx_max;		/* maximum index on the input vector	*/
  	float		snap[3];		/* Snapping Gears						*/
- 	float		snap_aspect[3];	/* snapping aspect correction			*/
++
+ 	float		snap_spatial[3]; /* Spatial snapping gears(even when rotating, scaling... etc) */
  	char		frame_side;		/* Mouse side of the cfra, 'L', 'R' or 'B' */
  
  	float		viewmat[4][4];	/* copy from G.vd, prevents feedback,   */
diff --cc source/blender/editors/transform/transform_snap.c
index fae5654,4ccc05b..d548074
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@@ -2449,18 -2436,53 +2436,52 @@@ void snapSequenceBounds(TransInfo *t, c
  
  static void applyGridIncrement(TransInfo *t, float *val, int max_index, const float fac[3], GearsType action)
  {
+ 	float asp_local[3] = {1, 1, 1};
+ 	const bool use_aspect = ELEM(t->mode, TFM_TRANSLATION);
+ 	const float *asp = use_aspect ? t->aspect : asp_local;
  	int i;
  
- 	if (max_index > 2) {
- 		printf("applyGridIncrement: invalid index %d, clamping\n", max_index);
- 		max_index = 2;
- 	}
+ 	BLI_assert(ELEM(t->tsnap.mode, SCE_SNAP_MODE_INCREMENT, SCE_SNAP_MODE_GRID));
+ 	BLI_assert(max_index <= 2);
  
- 	// Early bailing out if no need to snap
- 	if (fac[action] == 0.0f)
+ 	/* Early bailing out if no need to snap */
+ 	if (fac[action] == 0.0f) {
  		return;
 -	}
  
- 	for (i = 0; i <= max_index; i++) {
- 		val[i] = fac[action] * t->snap_aspect[i] * floorf(val[i] / (fac[action] * t->snap_aspect[i]) + 0.5f);
+ 	if (use_aspect) {
+ 		/* custom aspect for fcurve */
+ 		if (t->spacetype == SPACE_IPO) {
+ 			View2D *v2d = &t->ar->v2d;
+ 			View2DGrid *grid;
+ 			SpaceIpo *sipo = t->sa->spacedata.first;
+ 			int unity = V2D_UNIT_VALUES;
+ 			int unitx = (sipo->flag & SIPO_DRAWTIME) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMESCALE;
+ 
+ 			/* grid */
+ 			grid = UI_view2d_grid_calc(t->scene, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, t->ar->winx, t->ar->winy);
+ 
+ 			UI_view2d_grid_size(grid, &asp_local[0], &asp_local[1]);
+ 			UI_view2d_grid_free(grid);
+ 
+ 			asp = asp_local;
+ 		}
+ 	}
+ 
+ 	/* absolute snapping on grid based on global center */
+ 	if ((t->tsnap.mode == SCE_SNAP_MODE_GRID) && (t->mode == TFM_TRANSLATION)) {
+ 		for (i = 0; i <= max_index; i++) {
+ 			/* do not let unconstrained axis jump to absolute grid increments */
+ 			if (!(t->con.mode & CON_APPLY) || t->con.mode & (CON_AXIS0 << i)) {
+ 				const float iter_fac = fac[action] * asp[i];
+ 				val[i] = iter_fac * roundf((val[i] + t->center_global[i]) / iter_fac) - t->center_global[i];
+ 			}
+ 		}
+ 	}
+ 	else {
+ 		/* relative snapping in fixed increments */
+ 		for (i = 0; i <= max_index; i++) {
+ 			const float iter_fac = fac[action] * asp[i];
+ 			val[i] = iter_fac * roundf(val[i] / iter_fac);
+ 		}
  	}
  }
diff --cc source/blenderplayer/bad_level_call_stubs/stubs.c
index 1159374,9c4a331..54de824
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@@ -312,12 -308,7 +312,14 @@@ void WM_cursor_modal_restore(struct wmW
  void WM_cursor_time(struct wmWindow *win, int nr) RET_NONE
  void WM_cursor_warp(struct wmWindow *win, int x, int y) RET_NONE
  
++<<<<<<< HEAD
 +void WM_widgetmap_delete(struct wmWidgetMap *wmap) RET_NONE
 +struct wmWidgetMapType *WM_widgetmaptype_find(const char *idname, int spaceid, int regionid, bool is_3d, bool create) RET_NULL
 +struct wmWidgetGroupType *WM_widgetgrouptype_new(int (*poll)(const struct bContext *, struct wmWidgetGroupType *),
 +                                                 void (*draw)(const struct bContext *, struct wmWidgetGroup *), 
 +                                                 struct Main *bmain, const char *mapidname, short spaceid, short regionid, bool is_3d) RET_NULL
 +void WM_widgetgrouptype_unregister(struct bContext *C, struct Main *bmain, struct wmWidgetGroupType *wgroup) RET_NONE
+ void WM_ndof_deadzone_set(float deadzone) RET_NONE
  
  void                WM_uilisttype_init(void) RET_NONE
  struct uiListType  *WM_uilisttype_find(const char *idname, bool quiet) RET_NULL




More information about the Bf-blender-cvs mailing list