[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14980] branches/apricot: svn merge -r14921:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender/

Campbell Barton ideasman42 at gmail.com
Mon May 26 15:14:19 CEST 2008


Revision: 14980
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14980
Author:   campbellbarton
Date:     2008-05-26 15:14:19 +0200 (Mon, 26 May 2008)

Log Message:
-----------
svn  merge  -r14921:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Modified Paths:
--------------
    branches/apricot/intern/ghost/intern/GHOST_WindowWin32.cpp
    branches/apricot/release/scripts/3ds_import.py
    branches/apricot/release/scripts/export_fbx.py
    branches/apricot/release/scripts/flt_import.py
    branches/apricot/source/blender/blenkernel/BKE_curve.h
    branches/apricot/source/blender/blenkernel/intern/anim.c
    branches/apricot/source/blender/blenkernel/intern/blender.c
    branches/apricot/source/blender/blenkernel/intern/curve.c
    branches/apricot/source/blender/blenkernel/intern/displist.c
    branches/apricot/source/blender/blenkernel/intern/font.c
    branches/apricot/source/blender/blenkernel/intern/modifier.c
    branches/apricot/source/blender/blenkernel/intern/particle.c
    branches/apricot/source/blender/blenkernel/intern/softbody.c
    branches/apricot/source/blender/blenlib/intern/freetypefont.c
    branches/apricot/source/blender/blenlib/intern/psfont.c
    branches/apricot/source/blender/blenloader/intern/readfile.c
    branches/apricot/source/blender/include/BDR_editcurve.h
    branches/apricot/source/blender/makesdna/DNA_object_types.h
    branches/apricot/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
    branches/apricot/source/blender/nodes/intern/Makefile
    branches/apricot/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
    branches/apricot/source/blender/python/api2_2x/Draw.c
    branches/apricot/source/blender/render/intern/source/envmap.c
    branches/apricot/source/blender/render/intern/source/texture.c
    branches/apricot/source/blender/src/buttons_editing.c
    branches/apricot/source/blender/src/buttons_object.c
    branches/apricot/source/blender/src/buttons_shading.c
    branches/apricot/source/blender/src/drawarmature.c
    branches/apricot/source/blender/src/editaction.c
    branches/apricot/source/blender/src/editarmature.c
    branches/apricot/source/blender/src/editconstraint.c
    branches/apricot/source/blender/src/editcurve.c
    branches/apricot/source/blender/src/editseq.c
    branches/apricot/source/blender/src/header_image.c
    branches/apricot/source/blender/src/sequence.c
    branches/apricot/source/blender/src/space.c
    branches/apricot/source/blender/src/transform_conversions.c
    branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
    branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
    branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
    branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.h
    branches/apricot/source/gameengine/Ketsji/KX_Camera.cpp
    branches/apricot/source/gameengine/Ketsji/KX_Camera.h
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
    branches/apricot/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
    branches/apricot/source/gameengine/PyDoc/KX_GameObject.py
    branches/apricot/source/gameengine/Rasterizer/RAS_CameraData.h
    branches/apricot/source/gameengine/Rasterizer/RAS_IRasterizer.h
    branches/apricot/source/gameengine/Rasterizer/RAS_IRenderTools.h
    branches/apricot/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
    branches/apricot/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
    branches/apricot/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

Modified: branches/apricot/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- branches/apricot/intern/ghost/intern/GHOST_WindowWin32.cpp	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/intern/ghost/intern/GHOST_WindowWin32.cpp	2008-05-26 13:14:19 UTC (rev 14980)
@@ -871,12 +871,25 @@
 	for(i=1; i<=n; i++) { /* not the idiom, but it's right */
 		::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
 		w = WeightPixelFormat(pfd);
-		if(w > weight) {
-			weight = w;
-			iPixelFormat = i;
+		// be strict on stereo
+		if (!((sPreferredFormat.dwFlags ^ pfd.dwFlags) & PFD_STEREO))	{
+			if(w > weight) {
+				weight = w;
+				iPixelFormat = i;
+			}
 		}
 	}
-	
+	if (weight == 0) {
+		// we could find the correct stereo setting, just find any suitable format 
+		for(i=1; i<=n; i++) { /* not the idiom, but it's right */
+			::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
+			w = WeightPixelFormat(pfd);
+			if(w > weight) {
+				weight = w;
+				iPixelFormat = i;
+			}
+		}
+	}
 	return iPixelFormat;
 }
 

Modified: branches/apricot/release/scripts/3ds_import.py
===================================================================
--- branches/apricot/release/scripts/3ds_import.py	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/release/scripts/3ds_import.py	2008-05-26 13:14:19 UTC (rev 14980)
@@ -419,7 +419,7 @@
 				ob.setMatrix(contextMatrix_rot)
 			
 			importedObjects.append(ob)
-			
+			bmesh.calcNormals()
 		
 		for matName, faces in myContextMeshMaterials.iteritems():
 			makeMeshMaterialCopy(matName, faces)
@@ -664,9 +664,8 @@
 			#print contextLamp.name, 
 			
 		elif (new_chunk.ID==OBJECT_MESH):
-			## @@ PATCH
-			print 'Found an OBJECT_MESH chunk'
-		
+			# print 'Found an OBJECT_MESH chunk'
+			pass
 		elif (new_chunk.ID==OBJECT_VERTICES):
 			'''
 			Worldspace vertex locations

Modified: branches/apricot/release/scripts/export_fbx.py
===================================================================
--- branches/apricot/release/scripts/export_fbx.py	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/release/scripts/export_fbx.py	2008-05-26 13:14:19 UTC (rev 14980)
@@ -1101,12 +1101,12 @@
 		file.write('\n\t\t\tProperty: "ShadingModel", "KString", "", "%s"' % mat_shader)
 		file.write('\n\t\t\tProperty: "MultiLayer", "bool", "",0')
 		file.write('\n\t\t\tProperty: "EmissiveColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_cold) # emit and diffuse color are he same in blender
-		file.write('\n\t\t\tProperty: "EmissiveFactor", "double", "",%.4f' % mat_dif)
+		file.write('\n\t\t\tProperty: "EmissiveFactor", "double", "",%.4f' % mat_emit)
 		
 		file.write('\n\t\t\tProperty: "AmbientColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_colamb)
 		file.write('\n\t\t\tProperty: "AmbientFactor", "double", "",%.4f' % mat_amb)
 		file.write('\n\t\t\tProperty: "DiffuseColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_cold)
-		file.write('\n\t\t\tProperty: "DiffuseFactor", "double", "",%.4f' % mat_emit)
+		file.write('\n\t\t\tProperty: "DiffuseFactor", "double", "",%.4f' % mat_dif)
 		file.write('\n\t\t\tProperty: "Bump", "Vector3D", "",0,0,0')
 		file.write('\n\t\t\tProperty: "TransparentColor", "ColorRGB", "",1,1,1')
 		file.write('\n\t\t\tProperty: "TransparencyFactor", "double", "",%.4f' % (1.0 - mat_alpha))

Modified: branches/apricot/release/scripts/flt_import.py
===================================================================
--- branches/apricot/release/scripts/flt_import.py	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/release/scripts/flt_import.py	2008-05-26 13:14:19 UTC (rev 14980)
@@ -16,7 +16,7 @@
 registered trademark of MultiGen-Paradigm, Inc.
 
 Feature overview and more availible at:
-http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_flt
+http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_fltss
 
 Note: This file is a grab-bag of old and new code. It needs some cleanup still.
 """
@@ -44,6 +44,7 @@
 import BPyImage
 import flt_filewalker 
 import flt_properties
+import sys
 reload(flt_properties)
 from flt_properties import *
 
@@ -1036,8 +1037,9 @@
 			else: # fgon
 				mesh_face_indicies = [i+vert_index for i in xrange(face_len)]
 				tri_ngons= ngon(self.mesh, mesh_face_indicies)
-				new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons])
-				new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ])
+				if len(tri_ngons) != 1:
+					new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons])
+					new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ])
 			
 			vert_index+= face_len
 			FLT_OrigIndex+=1
@@ -2296,7 +2298,6 @@
 		for v in rmesh.verts:
 			v.co = v.co * smat
 	
-	
 def reparent(root,childhash,sce):
 	for child in childhash[root]:
 		reparent(child,childhash,sce)
@@ -2452,7 +2453,7 @@
 			select_file(global_prefs['fltfile'], GRR)
 		except:
 			import traceback
-			FLTWarn = Draw.PupBlock("Export Error", ["See console for output!"])
+			FLTWarn = Draw.PupBlock("Ixport Error", ["See console for output!"])
 			traceback.print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)
 	
 	#choose base path for export

Modified: branches/apricot/source/blender/blenkernel/BKE_curve.h
===================================================================
--- branches/apricot/source/blender/blenkernel/BKE_curve.h	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/source/blender/blenkernel/BKE_curve.h	2008-05-26 13:14:19 UTC (rev 14980)
@@ -39,8 +39,8 @@
 struct BezTriple;
 struct BevList;
 
-#define KNOTSU(nu)	    ( (nu)->orderu+ (nu)->pntsu+ (nu->orderu-1)*((nu)->flagu & 1) )
-#define KNOTSV(nu)	    ( (nu)->orderv+ (nu)->pntsv+ (nu->orderv-1)*((nu)->flagv & 1) )
+#define KNOTSU(nu)	    ( (nu)->orderu+ (nu)->pntsu+ (nu->orderu-1)*((nu)->flagu & CU_CYCLIC) )
+#define KNOTSV(nu)	    ( (nu)->orderv+ (nu)->pntsv+ (nu->orderv-1)*((nu)->flagv & CU_CYCLIC) )
 
 
 void unlink_curve( struct Curve *cu);
@@ -84,5 +84,12 @@
 float (*curve_getVertexCos(struct Curve *cu, struct ListBase *lb, int *numVerts_r))[3];
 void curve_applyVertexCos(struct Curve *cu, struct ListBase *lb, float (*vertexCos)[3]);
 
+/* nurb checks if they can be drawn, also clamp order func */
+int check_valid_nurb_u( struct Nurb *nu);
+int check_valid_nurb_v( struct Nurb *nu);
+
+int clamp_nurb_order_u( struct Nurb *nu);
+int clamp_nurb_order_v( struct Nurb *nu);
+
 #endif
 

Modified: branches/apricot/source/blender/blenkernel/intern/anim.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/anim.c	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/source/blender/blenkernel/intern/anim.c	2008-05-26 13:14:19 UTC (rev 14980)
@@ -889,8 +889,7 @@
 
 				if(part->draw_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) {
 					for(go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) {
-
-						Mat4MulMat4(tmat, obmat, pamat);
+						Mat4MulMat4(tmat, oblist[b]->obmat, pamat);
 						Mat4MulFloat3((float *)tmat, size*scale);
 						if(par_space_mat)
 							Mat4MulMat4(mat, tmat, par_space_mat);
@@ -898,7 +897,7 @@
 							Mat4CpyMat4(mat, tmat);
 
 						dob= new_dupli_object(lb, go->ob, mat, par->lay, counter, OB_DUPLIPARTS, animated);
-						Mat4CpyMat4(dob->omat, oldobmat);
+						Mat4CpyMat4(dob->omat, obcopylist[b].obmat);
 						if(G.rendering)
 							psys_get_dupli_texture(par, part, psmd, pa, cpa, dob->uv, dob->orco);
 					}

Modified: branches/apricot/source/blender/blenkernel/intern/blender.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/blender.c	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/source/blender/blenkernel/intern/blender.c	2008-05-26 13:14:19 UTC (rev 14980)
@@ -651,7 +651,8 @@
 	}
 }
 
-/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */
+/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation
+ * Note, ALWAYS call sound_initialize_sounds after BKE_undo_step() */
 void BKE_undo_step(int step)
 {
 	

Modified: branches/apricot/source/blender/blenkernel/intern/curve.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/curve.c	2008-05-26 12:52:28 UTC (rev 14979)
+++ branches/apricot/source/blender/blenkernel/intern/curve.c	2008-05-26 13:14:19 UTC (rev 14980)
@@ -348,9 +348,9 @@
 	if(nu->bp) MEM_freeN(nu->bp);
 	nu->bp= 0;
 	if(nu->knotsu) MEM_freeN(nu->knotsu);
-	nu->knotsu= 0;
+	nu->knotsu= NULL;
 	if(nu->knotsv) MEM_freeN(nu->knotsv);
-	nu->knotsv= 0;
+	nu->knotsv= NULL;
 	/* if(nu->trim.first) freeNurblist(&(nu->trim)); */
 
 	MEM_freeN(nu);
@@ -393,7 +393,7 @@
 			(BPoint*)MEM_mallocN((len)* sizeof(BPoint),"duplicateNurb3");
 		memcpy(newnu->bp, nu->bp, len*sizeof(BPoint));
 		
-		newnu->knotsu=newnu->knotsv= 0;
+		newnu->knotsu= newnu->knotsv= NULL;
 		
 		if(nu->knotsu) {
 			len= KNOTSU(nu);
@@ -506,6 +506,7 @@
 		}
 	}
 	else if(type==2) {
+		/* Warning, the order MUST be 2 or 4, if this is not enforced, the displist will be corrupt */
 		if(order==4) {
 			k= 0.34;
 			for(a=0;a<t;a++) {
@@ -520,6 +521,9 @@
 				knots[a]= (float)floor(k);
 			}
 		}
+		else {
+			printf("bez nurb curve order is not 3 or 4, should never happen\n");
+		}
 	}
 }
 
@@ -529,8 +533,9 @@
 	int a, b, order2, c;
 
 	if(knots==0) return;
-        order2=order-1;
 
+	order2=order-1;
+
 	/* do first long rows (order -1), remove identical knots at endpoints */
 	if(order>2) {
 		b= pnts+order2;
@@ -549,26 +554,35 @@
 }
 
 
-void makeknots(Nurb *nu, short uv, short type)	/* 0: uniform, 1: endpoints, 2: bezier */
+/* type - 0: uniform, 1: endpoints, 2: bezier, note, cyclic nurbs are always uniform */
+void makeknots(Nurb *nu, short uv, short type)
 {
 	if( (nu->type & 7)==CU_NURBS ) {
-		if(uv & 1) {
+		if(uv == 1) {
 			if(nu->knotsu) MEM_freeN(nu->knotsu);
-			if(nu->pntsu>1) {

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list