[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46075] branches/soc-2011-tomato: Merging r46062 through r46073 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Sun Apr 29 16:10:14 CEST 2012


Revision: 46075
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46075
Author:   nazgul
Date:     2012-04-29 14:10:13 +0000 (Sun, 29 Apr 2012)
Log Message:
-----------
Merging r46062 through r46073 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46062
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46073

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/cycles/util/util_math.h
    branches/soc-2011-tomato/intern/cycles/util/util_types.h
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_view3d.py
    branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c
    branches/soc-2011-tomato/source/blender/blenlib/BLI_math_vector.h
    branches/soc-2011-tomato/source/blender/blenlib/intern/math_vector.c
    branches/soc-2011-tomato/source/blender/bmesh/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_opdefines.c
    branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_operators_private.h
    branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_queries.c
    branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_queries.h
    branches/soc-2011-tomato/source/blender/bmesh/operators/bmo_inset.c
    branches/soc-2011-tomato/source/blender/editors/include/ED_clip.h
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2011-tomato/source/blender/editors/mesh/mesh_intern.h
    branches/soc-2011-tomato/source/blender/editors/mesh/mesh_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_editor.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_graph_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_graph/space_graph.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform_generics.c
    branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_event_system.c

Added Paths:
-----------
    branches/soc-2011-tomato/source/blender/bmesh/operators/bmo_wireframe.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-46061
   + /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-46073

Modified: branches/soc-2011-tomato/intern/cycles/util/util_math.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/util/util_math.h	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/intern/cycles/util/util_math.h	2012-04-29 14:10:13 UTC (rev 46075)
@@ -541,7 +541,7 @@
 #endif
 }
 
-__device_inline float reduce_add(const float3& a)
+__device_inline float reduce_add(const float3 a)
 {
 #ifdef __KERNEL_SSE__
 	return (a.x + a.y + a.z);

Modified: branches/soc-2011-tomato/intern/cycles/util/util_types.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/util/util_types.h	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/intern/cycles/util/util_types.h	2012-04-29 14:10:13 UTC (rev 46075)
@@ -36,7 +36,7 @@
 #define __shared
 #define __constant
 
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(FREE_WINDOWS)
 #define __device_inline static __forceinline
 #define __align(...) __declspec(align(__VA_ARGS__))
 #else

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_view3d.py	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_view3d.py	2012-04-29 14:10:13 UTC (rev 46075)
@@ -1767,6 +1767,7 @@
         layout.operator("mesh.inset")
         layout.operator("mesh.bevel")
         layout.operator("mesh.solidify")
+        layout.operator("mesh.wireframe")
         layout.operator("mesh.sort_faces")
 
         layout.separator()

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c	2012-04-29 14:10:13 UTC (rev 46075)
@@ -1208,9 +1208,8 @@
 		else
 			mult_m4_m4m4(rotscale_mat, parchan->pose_mat, offs_bone);
 
-# if 1
 		/* Compose the loc matrix for this bone. */
-		/* NOTE: That version deos not modify bone's loc when HINGE/NO_SCALE options are set. */
+		/* NOTE: That version does not modify bone's loc when HINGE/NO_SCALE options are set. */
 
 		/* In this case, use the object's space *orientation*. */
 		if (bone->flag & BONE_NO_LOCAL_LOCATION) {
@@ -1236,58 +1235,6 @@
 		/* Else (i.e. default, usual case), just use the same matrix for rotation/scaling, and location. */
 		else
 			copy_m4_m4(loc_mat, rotscale_mat);
-# endif
-# if 0
-		/* Compose the loc matrix for this bone. */
-		/* NOTE: That version modifies bone's loc when HINGE/NO_SCALE options are set. */
-
-		/* In these cases we need to compute location separately */
-		if (bone->flag & (BONE_HINGE|BONE_NO_SCALE|BONE_NO_LOCAL_LOCATION)) {
-			float bone_loc[4][4], bone_rotscale[3][3], tmat4[4][4], tmat3[3][3];
-			unit_m4(bone_loc);
-			unit_m4(loc_mat);
-			unit_m4(tmat4);
-
-			mul_v3_m4v3(bone_loc[3], parchan->pose_mat, offs_bone[3]);
-
-			/* "No local location" is not transformed by bone matrix. */
-			/* This only affects orientations (rotations), as scale is always 1.0 here. */
-			if (bone->flag & BONE_NO_LOCAL_LOCATION)
-				unit_m3(bone_rotscale);
-			else
-				/* We could also use bone->bone_mat directly, here... */
-				copy_m3_m4(bone_rotscale, offs_bone);
-
-			if (bone->flag & BONE_HINGE) {
-				copy_m3_m4(tmat3, parbone->arm_mat);
-				/* for hinge-only, we use armature *rotation*, but pose mat *scale*! */
-				if (!(bone->flag & BONE_NO_SCALE)) {
-					float size[3], tsmat[3][3];
-					mat4_to_size(size, parchan->pose_mat);
-					size_to_mat3(tsmat, size);
-					mul_m3_m3m3(tmat3, tsmat, tmat3);
-				}
-				mul_m3_m3m3(bone_rotscale, tmat3, bone_rotscale);
-			}
-			else if (bone->flag & BONE_NO_SCALE) {
-				/* For no-scale only, normalized parent pose mat is enough! */
-				copy_m3_m4(tmat3, parchan->pose_mat);
-				normalize_m3(tmat3);
-				mul_m3_m3m3(bone_rotscale, tmat3, bone_rotscale);
-			}
-			/* NO_LOCAL_LOCATION only. */
-			else {
-				copy_m3_m4(tmat3, parchan->pose_mat);
-				mul_m3_m3m3(bone_rotscale, tmat3, bone_rotscale);
-			}
-
-			copy_m4_m3(tmat4, bone_rotscale);
-			mult_m4_m4m4(loc_mat, bone_loc, tmat4);
-		}
-		/* Else, just use the same matrix for rotation/scaling, and location. */
-		else
-			copy_m4_m4(loc_mat, rotscale_mat);
-# endif
 	}
 	/* Root bones. */
 	else {
@@ -2438,16 +2385,6 @@
 	/* Construct the posemat based on PoseChannels, that we do before applying constraints. */
 	/* pose_mat(b) = pose_mat(b-1) * yoffs(b-1) * d_root(b) * bone_mat(b) * chan_mat(b) */
 	armature_mat_bone_to_pose(pchan, pchan->chan_mat, pchan->pose_mat);
-#if 0 /* XXX Old code, will remove this later. */
-	{
-		float rotscale_mat[4][4], loc_mat[4][4];
-		pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
-		/* Rotation and scale. */
-		mult_m4_m4m4(pchan->pose_mat, rotscale_mat, pchan->chan_mat);
-		/* Location. */
-		mul_v3_m4v3(pchan->pose_mat[3], loc_mat, pchan->chan_mat[3]);
-	}
-#endif
 
 	/* Only rootbones get the cyclic offset (unless user doesn't want that). */
 	/* XXX That could be a problem for snapping and other "reverse transform" features... */

Modified: branches/soc-2011-tomato/source/blender/blenlib/BLI_math_vector.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenlib/BLI_math_vector.h	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/source/blender/blenlib/BLI_math_vector.h	2012-04-29 14:10:13 UTC (rev 46075)
@@ -186,6 +186,7 @@
 float angle_v3v3(const float a[3], const float b[3]);
 float angle_v3v3v3(const float a[3], const float b[3], const float c[3]);
 float angle_normalized_v3v3(const float v1[3], const float v2[3]);
+float angle_on_axis_v3v3v3_v3(const float v1[3], const float v2[3], const float v3[3], const float axis[3]);
 void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3]);
 void angle_quad_v3(float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
 void angle_poly_v3(float* angles, const float* verts[3], int len);

Modified: branches/soc-2011-tomato/source/blender/blenlib/intern/math_vector.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenlib/intern/math_vector.c	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/source/blender/blenlib/intern/math_vector.c	2012-04-29 14:10:13 UTC (rev 46075)
@@ -217,6 +217,25 @@
 		return 2.0f * (float)saasin(len_v2v2(v2, v1) / 2.0f);
 }
 
+/**
+ * angle between 2 vectors defined by 3 coords, about an axis. */
+float angle_on_axis_v3v3v3_v3(const float v1[3], const float v2[3], const float v3[3], const float axis[3])
+{
+	float v1_proj[3], v2_proj[3], tproj[3];
+
+	sub_v3_v3v3(v1_proj, v1, v2);
+	sub_v3_v3v3(v2_proj, v3, v2);
+
+	/* project the vectors onto the axis */
+	project_v3_v3v3(tproj, v1_proj, axis);
+	sub_v3_v3(v1_proj, tproj);
+
+	project_v3_v3v3(tproj, v2_proj, axis);
+	sub_v3_v3(v2_proj, tproj);
+
+	return angle_v3v3(v1_proj, v2_proj);
+}
+
 void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3])
 {
 	float ed1[3], ed2[3], ed3[3];

Modified: branches/soc-2011-tomato/source/blender/bmesh/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/bmesh/CMakeLists.txt	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/source/blender/bmesh/CMakeLists.txt	2012-04-29 14:10:13 UTC (rev 46075)
@@ -51,6 +51,7 @@
 	operators/bmo_subdivide.h
 	operators/bmo_triangulate.c
 	operators/bmo_utils.c
+	operators/bmo_wireframe.c
 
 	intern/bmesh_construct.c
 	intern/bmesh_construct.h

Modified: branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_opdefines.c
===================================================================
--- branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_opdefines.c	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_opdefines.c	2012-04-29 14:10:13 UTC (rev 46075)
@@ -1109,6 +1109,26 @@
 };
 
 /*
+ * Wire Frame
+ *
+ * Makes a wire copy of faces.
+ */
+static BMOpDefine bmo_wireframe_def = {
+	"wireframe",
+	{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},   /* input faces */
+	 {BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, /* output faces */
+	 {BMO_OP_SLOT_BOOL, "use_boundary"},
+	 {BMO_OP_SLOT_BOOL, "use_even_offset"},
+	 {BMO_OP_SLOT_BOOL, "use_crease"},
+	 {BMO_OP_SLOT_FLT, "thickness"},
+	 {BMO_OP_SLOT_BOOL, "use_relative_offset"},
+	 {BMO_OP_SLOT_FLT, "depth"},
+	 {0} /* null-terminating sentinel */},
+	bmo_wireframe_exec,
+	0
+};
+
+/*
  * Vertex Slide
  *
  * Translates vertes along an edge
@@ -1192,6 +1212,7 @@
 	&bmo_bridge_loops_def,
 	&bmo_solidify_def,
 	&bmo_inset_def,
+	&bmo_wireframe_def,
 	&bmo_vertex_slide_def,
 };
 

Modified: branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_operators_private.h
===================================================================
--- branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_operators_private.h	2012-04-29 13:58:43 UTC (rev 46074)
+++ branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_operators_private.h	2012-04-29 14:10:13 UTC (rev 46075)
@@ -100,5 +100,6 @@
 void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op);
 void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op);
 void bmo_inset_exec(BMesh *bm, BMOperator *op);
+void bmo_wireframe_exec(BMesh *bm, BMOperator *op);
 
 #endif /* __BMESH_OPERATORS_PRIVATE_H__ */

Modified: branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_queries.c

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list