[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59755] trunk/blender/source/blender/ editors/object/object_transform.c: Apply Scale for Empties

Joshua Leung aligorith at gmail.com
Tue Sep 3 00:57:22 CEST 2013


Revision: 59755
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59755
Author:   aligorith
Date:     2013-09-02 22:57:22 +0000 (Mon, 02 Sep 2013)
Log Message:
-----------
Apply Scale for Empties

It is now possible to use "Apply Scale" for Empties. While Empties don't exactly
have any Object data attached to them which can be used for supporting "true"
apply scale (i.e. with non-uniform scaling), they do have a drawsize value which
controls how large the empties are drawn (before scaling). This works by taking
the scale factor on the most-scaled axis, and combines this with the existing
empty drawsize to maintain the correct dimensions on that axis at least.

Core Assumptions:
1) Most scaled empties have uniform scaling anyways (i.e. most empties used for
bone shapes)
2) On balance, preserving non-uniform scaling of empties after apply scale is
not as important as not being able to do it at all

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	2013-09-02 22:28:18 UTC (rev 59754)
+++ trunk/blender/source/blender/editors/object/object_transform.c	2013-09-02 22:57:22 UTC (rev 59755)
@@ -562,6 +562,21 @@
 			if (apply_scale)
 				BKE_tracking_reconstruction_scale(&clip->tracking, ob->size);
 		}
+		else if (ob->type == OB_EMPTY) {
+			/* It's possible for empties too, even though they don't 
+			 * really have obdata, since we can simply apply the maximum
+			 * scaling to the empty's drawsize.
+			 *
+			 * Core Assumptions:
+			 * 1) Most scaled empties have uniform scaling 
+			 *    (i.e. for visibility reasons), AND/OR
+			 * 2) Preserving non-uniform scaling is not that important,
+			 *    and is something that many users would be willing to
+			 *    sacrifice for having an easy way to do this.
+			 */
+			 float max_scale = MAX3(ob->size[0], ob->size[1], ob->size[2]);
+			 ob->empty_drawsize *= max_scale;
+		}
 		else {
 			continue;
 		}




More information about the Bf-blender-cvs mailing list