[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46700] branches/soc-2011-tomato: svn merge ^/trunk/blender -r46684:46699

Campbell Barton ideasman42 at gmail.com
Wed May 16 18:41:51 CEST 2012


Revision: 46700
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46700
Author:   campbellbarton
Date:     2012-05-16 16:41:51 +0000 (Wed, 16 May 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r46684:46699

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

Modified Paths:
--------------
    branches/soc-2011-tomato/CMakeLists.txt
    branches/soc-2011-tomato/intern/cycles/kernel/osl/nodes/node_camera.osl
    branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
    branches/soc-2011-tomato/source/blender/collada/GeometryExporter.cpp
    branches/soc-2011-tomato/source/blender/collada/GeometryExporter.h
    branches/soc-2011-tomato/source/blender/collada/MeshImporter.cpp
    branches/soc-2011-tomato/source/blender/collada/MeshImporter.h
    branches/soc-2011-tomato/source/blender/editors/include/ED_mesh.h
    branches/soc-2011-tomato/source/blender/editors/include/ED_transform.h
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_utils.c
    branches/soc-2011-tomato/source/blender/editors/mesh/mesh_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_edit.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_edit.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/imbuf/intern/IMB_anim.h
    branches/soc-2011-tomato/source/blender/imbuf/intern/IMB_metadata.h
    branches/soc-2011-tomato/source/blender/imbuf/intern/anim_movie.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/bmp.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/cache.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/indexer.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/indexer_dv.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/iris.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/jp2.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/moviecache.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/openexr_multi.h
    branches/soc-2011-tomato/source/blender/imbuf/intern/radiance_hdr.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/scaling.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/thumbs.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/thumbs_blend.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/tiff.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_movieclip_types.h
    branches/soc-2011-tomato/source/blender/makesdna/intern/makesdna.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree.c
    branches/soc-2011-tomato/source/blender/nodes/composite/node_composite_tree.c
    branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_displace.c
    branches/soc-2011-tomato/source/blender/nodes/shader/node_shader_tree.c
    branches/soc-2011-tomato/source/blender/nodes/texture/node_texture_tree.c
    branches/soc-2011-tomato/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h

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


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/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-46684
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/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-46699

Modified: branches/soc-2011-tomato/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/CMakeLists.txt	2012-05-16 16:36:55 UTC (rev 46699)
+++ branches/soc-2011-tomato/CMakeLists.txt	2012-05-16 16:41:51 UTC (rev 46700)
@@ -838,14 +838,16 @@
 			set(GETTEXT_LIBRARIES gnu_gettext)
 		endif()
 		
-		set(LAPACK ${LIBDIR}/lapack)
-		# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
-		set_lib_path(LAPACK_LIBPATH ${LAPACK}/lib)	
-		set(LAPACK_LIBRARIES
-			${LIBDIR}/lapack/lib/libf2c.lib
-			${LIBDIR}/lapack/lib/clapack_nowrap.lib
-			${LIBDIR}/lapack/lib/BLAS_nowrap.lib
-		)
+		if(WITH_MOD_CLOTH_ELTOPO)
+			set(LAPACK ${LIBDIR}/lapack)
+			# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
+			set_lib_path(LAPACK_LIBPATH ${LAPACK}/lib)	
+			set(LAPACK_LIBRARIES
+				${LIBDIR}/lapack/lib/libf2c.lib
+				${LIBDIR}/lapack/lib/clapack_nowrap.lib
+				${LIBDIR}/lapack/lib/BLAS_nowrap.lib
+			)
+		endif()
 
 		set(PNG_LIBRARIES libpng)
 		set(JPEG_LIBRARIES libjpeg)

Modified: branches/soc-2011-tomato/intern/cycles/kernel/osl/nodes/node_camera.osl
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/osl/nodes/node_camera.osl	2012-05-16 16:36:55 UTC (rev 46699)
+++ branches/soc-2011-tomato/intern/cycles/kernel/osl/nodes/node_camera.osl	2012-05-16 16:41:51 UTC (rev 46700)
@@ -26,7 +26,7 @@
 	ViewVector = (vector)transform("world", "camera", P);
 
 	ViewZDepth = fabs(ViewVector[2]);
-	ViewDistance = lenght(ViewVector);
+	ViewDistance = length(ViewVector);
 
 	ViewVector = normalize(ViewVector);
 }

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-05-16 16:36:55 UTC (rev 46699)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-05-16 16:41:51 UTC (rev 46700)
@@ -862,10 +862,15 @@
 	MaskSplinePoint *prev_point, *next_point;
 
 	const char h_back[2] = {point->bezt.h1, point->bezt.h2};
-
+int i1=999, i2=999;
 	BKE_mask_get_handle_point_adjacent(mask, spline, point,
 	                                   &prev_point, &next_point);
 
+	if (prev_point) i1 = (int)(prev_point - spline->points);
+	if (next_point) i2 = (int)(next_point - spline->points);
+
+printf("found points %d %d : %d\n", i1, i2, (int)(point - spline->points));
+
 	point->bezt.h1 = HD_AUTO;
 	point->bezt.h2 = HD_AUTO;
 	mask_calc_point_handle(point, prev_point, next_point);
@@ -897,6 +902,34 @@
 			enforce_dist_v2_v2fl(point->bezt.vec[2], point->bezt.vec[1], length_average);
 		}
 	}
+
+	mask_calc_point_handle(point, prev_point, next_point);
+
+	// XXX
+	if ((point->bezt.h1 == HD_ALIGN || point->bezt.h2 == HD_ALIGN) ){
+		float vec[2];
+		sub_v2_v2(point->bezt.vec[0], point->bezt.vec[1]);
+		sub_v2_v2(point->bezt.vec[2], point->bezt.vec[1]);
+
+		copy_v2_v2(vec, point->bezt.vec[0]);
+		point->bezt.vec[0][0] =  vec[1];
+		point->bezt.vec[0][0] = -vec[0];
+		add_v2_v2(point->bezt.vec[0], point->bezt.vec[1]);
+
+		copy_v2_v2(vec, point->bezt.vec[2]);
+		point->bezt.vec[2][0] =  vec[1];
+		point->bezt.vec[2][0] = -vec[0];
+		add_v2_v2(point->bezt.vec[2], point->bezt.vec[1]);
+
+		copy_v2_v2(vec, point->bezt.vec[2]);
+		copy_v2_v2(point->bezt.vec[0], vec);
+		copy_v2_v2(point->bezt.vec[2], point->bezt.vec[0]);
+
+
+
+	}
+
+	mask_calc_point_handle(point, prev_point, next_point);
 }
 
 void BKE_mask_calc_handles(Mask *mask)

Modified: branches/soc-2011-tomato/source/blender/collada/GeometryExporter.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/collada/GeometryExporter.cpp	2012-05-16 16:36:55 UTC (rev 46699)
+++ branches/soc-2011-tomato/source/blender/collada/GeometryExporter.cpp	2012-05-16 16:41:51 UTC (rev 46700)
@@ -127,6 +127,7 @@
 		createVertexColorSource(geom_id, me);
 
 	// <vertices>
+
 	COLLADASW::Vertices verts(mSW);
 	verts.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::VERTEX));
 	COLLADASW::InputList &input_list = verts.getInputList();
@@ -134,6 +135,8 @@
 	input_list.push_back(input);
 	verts.add();
 
+	createLooseEdgeList(ob, me, geom_id, norind);
+
 	// XXX slow		
 	if (ob->totcol) {
 		for (int a = 0; a < ob->totcol; a++)	{
@@ -149,7 +152,7 @@
 	if (me->flag & ME_TWOSIDED) {
 		mSW->appendTextBlock("<extra><technique profile=\"MAYA\"><double_sided>1</double_sided></technique></extra>");
 	}
-	
+
 	closeGeometry();
 
 	if (this->export_settings->apply_modifiers)
@@ -157,11 +160,65 @@
 		BKE_libblock_free_us(&(G.main->mesh), me);
 	}
 
+
 #if 0
 	dm->release(dm);
 #endif
 }
 
+
+void GeometryExporter::createLooseEdgeList(Object *ob,
+					     Mesh   *me,
+					     std::string& geom_id,
+					     std::vector<Face>& norind)
+{
+
+	MEdge *medges = me->medge;
+	int totedges  = me->totedge;
+	int edges_in_linelist = 0;
+	std::vector<unsigned int> edge_list;
+	int index;
+
+	// Find all loose edges in Mesh 
+	// and save vertex indices in edge_list
+	for (index = 0; index < totedges; index++) 
+	{
+		MEdge *edge = &medges[index];
+
+		if (edge->flag & ME_LOOSEEDGE)
+		{
+			edges_in_linelist += 1;
+			edge_list.push_back(edge->v1);
+			edge_list.push_back(edge->v2);
+		}
+	}
+
+	if (edges_in_linelist > 0)
+	{
+		// Create the list of loose edges
+		COLLADASW::Lines lines(mSW);
+
+		lines.setCount(edges_in_linelist);
+
+
+		COLLADASW::InputList &til = lines.getInputList();
+			
+		// creates <input> in <lines> for vertices 
+		COLLADASW::Input input1(COLLADASW::InputSemantic::VERTEX, getUrlBySemantics(geom_id, COLLADASW::InputSemantic::VERTEX), 0);
+		til.push_back(input1);
+
+		lines.prepareToAppendValues();
+
+		for (index = 0; index < edges_in_linelist; index++) 
+		{
+			lines.appendValues(edge_list[2*index+1]);
+			lines.appendValues(edge_list[2*index]);
+		}
+		lines.finish();
+	}
+
+}
+
 // powerful because it handles both cases when there is material and when there's not
 void GeometryExporter::createPolylist(short material_index,
 					bool has_uvs,
@@ -247,6 +304,8 @@
 		
 	// performs the actual writing
 	polylist.prepareToAppendValues();
+	
+
 		
 	// <p>
 	int texindex = 0;

Modified: branches/soc-2011-tomato/source/blender/collada/GeometryExporter.h
===================================================================
--- branches/soc-2011-tomato/source/blender/collada/GeometryExporter.h	2012-05-16 16:36:55 UTC (rev 46699)
+++ branches/soc-2011-tomato/source/blender/collada/GeometryExporter.h	2012-05-16 16:41:51 UTC (rev 46700)
@@ -64,6 +64,11 @@
 
 	void operator()(Object *ob);
 
+	void createLooseEdgeList(Object *ob,
+						     Mesh   *me,
+						     std::string& geom_id,
+						     std::vector<Face>& norind);
+
 	// powerful because it handles both cases when there is material and when there's not
 	void createPolylist(short material_index,
 						bool has_uvs,

Modified: branches/soc-2011-tomato/source/blender/collada/MeshImporter.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/collada/MeshImporter.cpp	2012-05-16 16:36:55 UTC (rev 46699)
+++ branches/soc-2011-tomato/source/blender/collada/MeshImporter.cpp	2012-05-16 16:41:51 UTC (rev 46700)
@@ -52,6 +52,7 @@
 #include "BLI_listbase.h"
 #include "BLI_math.h"
 #include "BLI_string.h"
+#include "BLI_edgehash.h"
 
 #include "MEM_guardedalloc.h"
 }
@@ -262,7 +263,7 @@
 }
 #endif
 
-bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)	// checks if mesh has supported primitive types: polylist, triangles, triangle_fans
+bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)	// checks if mesh has supported primitive types: lines, polylist, triangles, triangle_fans
 {
 	COLLADAFW::MeshPrimitiveArray& prim_arr = mesh->getMeshPrimitives();
 
@@ -291,6 +292,12 @@
 			}
 				
 		}
+
+		else if ( type == COLLADAFW::MeshPrimitive::LINES )
+		{
+			// TODO: Add Checker for line syntax here
+		}
+
 		else if (type != COLLADAFW::MeshPrimitive::TRIANGLES && type!= COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
 			fprintf(stderr, "Primitive type %s is not supported.\n", type_str);
 			return false;
@@ -409,14 +416,202 @@
 	return tottri;
 }
 
+// =====================================================================
+// condition 1: The Primitive has normals
+// condition 2: The number of normals equals the number of faces.
+// return true if both conditions apply.
+// return false otherwise.
+// =====================================================================
+bool MeshImporter::primitive_has_useable_normals(COLLADAFW::MeshPrimitive *mp) {
+
+	bool has_useable_normals = false;
+
+	int normals_count = mp->getNormalIndices().getCount();
+	if (normals_count > 0) {
+		int index_count   = mp->getPositionIndices().getCount();
+		if (index_count == normals_count) 
+			has_useable_normals = true;
+		else {
+			fprintf(stderr,
+				"Warning: Number of normals %d is different from the number of vertices %d, skipping normals\n",
+				normals_count, index_count );	
+		}
+	}
+
+	return has_useable_normals;
+
+}
+
+// =====================================================================
+// Assume that only TRIANGLES, TRIANGLE_FANS, POLYLIST and POLYGONS
+// have faces. (to be verified)
+// =====================================================================
+bool MeshImporter::primitive_has_faces(COLLADAFW::MeshPrimitive *mp) {
+
+	bool has_faces = false;
+	int type = mp->getPrimitiveType();
+	switch (type) {
+		case COLLADAFW::MeshPrimitive::TRIANGLES:
+		case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
+		case COLLADAFW::MeshPrimitive::POLYLIST:

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list