[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11032] branches/2-44-stable/blender: Merge form trunk:

Campbell Barton cbarton at metavr.com
Sat Jun 23 17:02:49 CEST 2007


Revision: 11032
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11032
Author:   campbellbarton
Date:     2007-06-23 17:02:49 +0200 (Sat, 23 Jun 2007)

Log Message:
-----------
Merge form trunk:

Edge sharpness was using a while loop when it didnt need to
Revision: 10901
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10901
Author:   campbellbarton

Write the filrname rather then the image name
Revision: 10960
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10960
Author:   hos

Dont modify the mouse cursor if not in UI mode
Revision: 10759
          https://svn.blender.org//revision/?rev=10759&view=rev
Author:   campbellbarton

was missing a call to free a buffer, and python module world was increffing all its colors twice.
Revision: 10778
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bforge-svn&revision=10778
Author:   campbellbarton

Fix a Python memory leak with the armature weakref code.  setup_armature_weakrefs() wasnt't deallocating the old list, instead just adding a new one to the dictionary. 
Revision: 10944
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10944
Author:   khughes

Fix segfault in PyBonesDict_FromPyArmature() caused by uninitialized memory.
Revision: 10781
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10781
Author:   khughes

Fix potential problem with Matrix initializer (can't call Matrix_Identity on non square matrices).
Revision: 10752
          https://svn.blender.org//revision/?rev=10752&view=rev
Author:   theeth

Modified Paths:
--------------
    branches/2-44-stable/blender/release/scripts/help_bpy_api.py
    branches/2-44-stable/blender/release/scripts/import_mdd.py
    branches/2-44-stable/blender/release/scripts/mesh_cleanup.py
    branches/2-44-stable/blender/release/scripts/vrml97_export.py
    branches/2-44-stable/blender/source/blender/blenkernel/intern/CCGSubSurf.c
    branches/2-44-stable/blender/source/blender/blenkernel/intern/packedFile.c
    branches/2-44-stable/blender/source/blender/python/api2_2x/Armature.c
    branches/2-44-stable/blender/source/blender/python/api2_2x/Object.c
    branches/2-44-stable/blender/source/blender/python/api2_2x/Window.c
    branches/2-44-stable/blender/source/blender/python/api2_2x/World.c
    branches/2-44-stable/blender/source/blender/python/api2_2x/doc/Modifier.py
    branches/2-44-stable/blender/source/blender/python/api2_2x/matrix.c

Modified: branches/2-44-stable/blender/release/scripts/help_bpy_api.py
===================================================================
--- branches/2-44-stable/blender/release/scripts/help_bpy_api.py	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/release/scripts/help_bpy_api.py	2007-06-23 15:02:49 UTC (rev 11032)
@@ -38,4 +38,4 @@
 
 import Blender, webbrowser
 version = str(int(Blender.Get('version')))
-webbrowser.open('http://www.blender3d.org/Help/?pg=PyReference&ver='+ version)
+webbrowser.open('http://www.blender.org/documentation/'+ version +'PythonDoc/index.html')

Modified: branches/2-44-stable/blender/release/scripts/import_mdd.py
===================================================================
--- branches/2-44-stable/blender/release/scripts/import_mdd.py	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/release/scripts/import_mdd.py	2007-06-23 15:02:49 UTC (rev 11032)
@@ -26,6 +26,26 @@
 #Please send any fixes,updates,bugs to Slow67_at_Gmail.com
 #Bill Niewuendorp
 
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+
+
+
 try:
 	from struct import unpack
 except:

Modified: branches/2-44-stable/blender/release/scripts/mesh_cleanup.py
===================================================================
--- branches/2-44-stable/blender/release/scripts/mesh_cleanup.py	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/release/scripts/mesh_cleanup.py	2007-06-23 15:02:49 UTC (rev 11032)
@@ -209,6 +209,7 @@
 def fix_nan_uvs(me):
 	rem_nan = 0
 	if me.faceUV:
+		orig_uvlayer = me.activeUVLayer
 		for uvlayer in me.getUVLayerNames():
 			me.activeUVLayer = uvlayer
 			for f in me.faces:
@@ -217,6 +218,7 @@
 						if isnan(uv[i]):
 							uv[i] = 0.0
 							rem_nan += 1
+		me.activeUVLayer = orig_uvlayer
 	return rem_nan
 
 

Modified: branches/2-44-stable/blender/release/scripts/vrml97_export.py
===================================================================
--- branches/2-44-stable/blender/release/scripts/vrml97_export.py	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/release/scripts/vrml97_export.py	2007-06-23 15:02:49 UTC (rev 11032)
@@ -656,10 +656,10 @@
 			self.writeMaterial(mater, self.cleanStr(mater.name,''))
 			if (mater.mode & Blender.Material.Modes['TEXFACE']):
 				if image != None:
-					self.writeImageTexture(image.name)
+					self.writeImageTexture(image.name, image.filename)
 		else:
 			if image != None:
-				self.writeImageTexture(image.name)
+				self.writeImageTexture(image.name, image.filename)
 
 		self.writeIndented("}\n", -1)
 
@@ -837,7 +837,7 @@
 		self.writeIndented("transparency %s\n" % (round(transp,self.cp)))
 		self.writeIndented("}\n",-1)
 
-	def writeImageTexture(self, name):
+	def writeImageTexture(self, name, filename):
 		if self.texNames.has_key(name):
 			self.writeIndented("texture USE %s\n" % self.cleanStr(name))
 			self.texNames[name] += 1
@@ -846,7 +846,7 @@
 			self.writeIndented("texture DEF %s ImageTexture {\n" % \
 							   self.cleanStr(name), 1)
 			self.writeIndented('url "%s"\n' % \
-							   name.split("\\")[-1].split("/")[-1])
+							   filename.split("\\")[-1].split("/")[-1])
 			self.writeIndented("}\n",-1)
 			self.texNames[name] = 1
 

Modified: branches/2-44-stable/blender/source/blender/blenkernel/intern/CCGSubSurf.c
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/intern/CCGSubSurf.c	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/source/blender/blenkernel/intern/CCGSubSurf.c	2007-06-23 15:02:49 UTC (rev 11032)
@@ -483,20 +483,17 @@
 	_edge_free(e, ss);
 }
 
-static float EDGE_getSharpness(CCGEdge *e, int lvl, CCGSubSurf *ss) {
-	float sharpness = e->crease;
-	while (lvl--) {
-		if (sharpness>1.0) {
-			sharpness -= 1.0;
-		} else {
-			sharpness = 0.0;
-		}
-	}
-	return sharpness;
+static float EDGE_getSharpness(CCGEdge *e, int lvl) {
+	if (!lvl)
+		return e->crease;
+	else if (!e->crease)
+		return 0.0;
+	else if (e->crease - lvl < 0.0)
+		return 0.0;
+	else
+		return e->crease - lvl;
 }
 
-/***/
-
 static CCGFace *_face_new(CCGFaceHDL fHDL, CCGVert **verts, CCGEdge **edges, int numVerts, int levels, int dataSize, CCGSubSurf *ss) {
 	int maxGridSize = 1 + (1<<(ss->subdivLevels-1));
 	CCGFace *f = CCGSUBSURF_alloc(ss, sizeof(CCGFace) + sizeof(CCGVert*)*numVerts + sizeof(CCGEdge*)*numVerts + ss->meshIFC.vertDataSize *(1 + numVerts*maxGridSize + numVerts*maxGridSize*maxGridSize) + ss->meshIFC.faceUserSize);
@@ -1194,7 +1191,7 @@
 	for (ptrIdx=0; ptrIdx<numEffectedE; ptrIdx++) {
 		CCGEdge *e = effectedE[ptrIdx];
 		void *co = EDGE_getCo(e, nextLvl, 1);
-		float sharpness = EDGE_getSharpness(e, curLvl, ss);
+		float sharpness = EDGE_getSharpness(e, curLvl);
 
 		if (_edge_isBoundary(e) || sharpness>=1.0) {
 			VertDataCopy(co, VERT_getCo(e->v0, curLvl));
@@ -1233,7 +1230,7 @@
 
 		for (i=0; i<v->numEdges; i++) {
 			CCGEdge *e = v->edges[i];
-			float sharpness = EDGE_getSharpness(e, curLvl, ss);
+			float sharpness = EDGE_getSharpness(e, curLvl);
 
 			if (seam && _edge_isBoundary(e))
 				seamEdges++;
@@ -1307,7 +1304,7 @@
 
 			for (i=0; i<v->numEdges; i++) {
 				CCGEdge *e = v->edges[i];
-				float sharpness = EDGE_getSharpness(e, curLvl, ss);
+				float sharpness = EDGE_getSharpness(e, curLvl);
 
 				if (seam) {
 					if (_edge_isBoundary(e)) {
@@ -1472,7 +1469,7 @@
 			 */
 		for (ptrIdx=0; ptrIdx<numEffectedE; ptrIdx++) {
 			CCGEdge *e = (CCGEdge*) effectedE[ptrIdx];
-			float sharpness = EDGE_getSharpness(e, curLvl, ss);
+			float sharpness = EDGE_getSharpness(e, curLvl);
 
 			if (_edge_isBoundary(e) || sharpness>1.0) {
 				for (x=0; x<edgeSize-1; x++) {
@@ -1531,7 +1528,7 @@
 
 			for (i=0; i<v->numEdges; i++) {
 				CCGEdge *e = v->edges[i];
-				float sharpness = EDGE_getSharpness(e, curLvl, ss);
+				float sharpness = EDGE_getSharpness(e, curLvl);
 
 				if (seam && _edge_isBoundary(e))
 					seamEdges++;
@@ -1607,7 +1604,7 @@
 
 				for (i=0; i<v->numEdges; i++) {
 					CCGEdge *e = v->edges[i];
-					float sharpness = EDGE_getSharpness(e, curLvl, ss);
+					float sharpness = EDGE_getSharpness(e, curLvl);
 
 					if (seam) {
 						if (_edge_isBoundary(e))
@@ -1647,7 +1644,7 @@
 			 */
 		for (ptrIdx=0; ptrIdx<numEffectedE; ptrIdx++) {
 			CCGEdge *e = (CCGEdge*) effectedE[ptrIdx];
-			float sharpness = EDGE_getSharpness(e, curLvl, ss);
+			float sharpness = EDGE_getSharpness(e, curLvl);
 			int sharpCount = 0;
 			float avgSharpness = 0.0;
 

Modified: branches/2-44-stable/blender/source/blender/blenkernel/intern/packedFile.c
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/intern/packedFile.c	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/source/blender/blenkernel/intern/packedFile.c	2007-06-23 15:02:49 UTC (rev 11032)
@@ -286,7 +286,7 @@
 	char tempname[FILE_MAXDIR + FILE_MAXFILE];
 /*  	void * data; */
 	
-	waitcursor(1);
+	if (guimode) waitcursor(1);
 	
 	strcpy(name, filename);
 	BLI_convertstringcode(name, G.sce, G.scene->r.cfra);

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/Armature.c
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/Armature.c	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/Armature.c	2007-06-23 15:02:49 UTC (rev 11032)
@@ -429,6 +429,9 @@
 	if (!py_BonesDict)
 		goto RuntimeError;
 
+	py_BonesDict->bones = NULL;
+	py_BonesDict->editbones.first = py_BonesDict->editbones.last = NULL;
+
 	//create internal dictionaries
 	py_BonesDict->bonesMap = PyDict_New();
 	py_BonesDict->editbonesMap = PyDict_New();

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/Object.c
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/Object.c	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/Object.c	2007-06-23 15:02:49 UTC (rev 11032)
@@ -2992,7 +2992,7 @@
 						"PyList_New() failed" );
 			
 			for(dupob= duplilist->first, index=0; dupob; dupob= dupob->next, index++) {
-				pair = PyTuple_New( 2 );
+				PyObject *pair = PyTuple_New( 2 );
 				
 				PyTuple_SET_ITEM( pair, 0, Object_CreatePyObject(dupob->ob) );
 				PyTuple_SET_ITEM( pair, 1, newMatrixObject((float*)dupob->mat,4,4,Py_NEW) );

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/Window.c
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/Window.c	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/Window.c	2007-06-23 15:02:49 UTC (rev 11032)
@@ -1150,6 +1150,10 @@
 		return EXPP_ReturnPyObjError(PyExc_RuntimeError,
 			"QHandle is not available in background mode");
 
+	if (!G.curscreen)
+		return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+			"No screens available");
+	
 	if( !PyArg_ParseTuple( args, "h", &win ) )
 		return EXPP_ReturnPyObjError( PyExc_TypeError,
 					      "expected an int as argument" );

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/World.c
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/World.c	2007-06-23 12:39:22 UTC (rev 11031)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/World.c	2007-06-23 15:02:49 UTC (rev 11032)
@@ -439,7 +439,8 @@
 							      &World_Type );
 			found_world->world = world_iter;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list