[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12181] branches/cloth/blender: Merge with trunk: svn merge -r 12151:12179 https://svn.blender.org/svnroot /bf-blender/trunk/blender

Daniel Genrich daniel.genrich at gmx.net
Mon Oct 1 23:36:39 CEST 2007


Revision: 12181
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12181
Author:   genscher
Date:     2007-10-01 23:36:39 +0200 (Mon, 01 Oct 2007)

Log Message:
-----------
Merge with trunk: svn merge -r 12151:12179 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/cloth/blender/config/linux2-config.py
    branches/cloth/blender/extern/SConscript
    branches/cloth/blender/source/blender/blenkernel/intern/constraint.c
    branches/cloth/blender/source/blender/blenlib/BLI_editVert.h
    branches/cloth/blender/source/blender/include/BIF_drawseq.h
    branches/cloth/blender/source/blender/include/BIF_editsima.h
    branches/cloth/blender/source/blender/include/BIF_space.h
    branches/cloth/blender/source/blender/include/BIF_spacetypes.h
    branches/cloth/blender/source/blender/include/BSE_editipo.h
    branches/cloth/blender/source/blender/include/BSE_sequence.h
    branches/cloth/blender/source/blender/include/transform.h
    branches/cloth/blender/source/blender/makesdna/DNA_userdef_types.h
    branches/cloth/blender/source/blender/python/api2_2x/Modifier.c
    branches/cloth/blender/source/blender/python/api2_2x/doc/Modifier.py
    branches/cloth/blender/source/blender/src/buttons_editing.c
    branches/cloth/blender/source/blender/src/drawimage.c
    branches/cloth/blender/source/blender/src/drawobject.c
    branches/cloth/blender/source/blender/src/drawseq.c
    branches/cloth/blender/source/blender/src/drawview.c
    branches/cloth/blender/source/blender/src/editipo.c
    branches/cloth/blender/source/blender/src/editmesh.c
    branches/cloth/blender/source/blender/src/editmesh_mods.c
    branches/cloth/blender/source/blender/src/editmesh_tools.c
    branches/cloth/blender/source/blender/src/editscreen.c
    branches/cloth/blender/source/blender/src/editsima.c
    branches/cloth/blender/source/blender/src/header_image.c
    branches/cloth/blender/source/blender/src/header_ipo.c
    branches/cloth/blender/source/blender/src/header_seq.c
    branches/cloth/blender/source/blender/src/header_view3d.c
    branches/cloth/blender/source/blender/src/interface_draw.c
    branches/cloth/blender/source/blender/src/seqaudio.c
    branches/cloth/blender/source/blender/src/sequence.c
    branches/cloth/blender/source/blender/src/space.c
    branches/cloth/blender/source/blender/src/spacetypes.c
    branches/cloth/blender/source/blender/src/transform.c
    branches/cloth/blender/source/blender/src/transform_conversions.c
    branches/cloth/blender/source/blender/src/transform_generics.c
    branches/cloth/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
    branches/cloth/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
    branches/cloth/blender/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
    branches/cloth/blender/source/gameengine/GamePlayer/common/GPC_RenderTools.h
    branches/cloth/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
    branches/cloth/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
    branches/cloth/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
    branches/cloth/blender/source/gameengine/Rasterizer/RAS_IRenderTools.h
    branches/cloth/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
    branches/cloth/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

Added Paths:
-----------
    branches/cloth/blender/extern/ffmpeg/SConscript

Modified: branches/cloth/blender/config/linux2-config.py
===================================================================
--- branches/cloth/blender/config/linux2-config.py	2007-10-01 20:19:22 UTC (rev 12180)
+++ branches/cloth/blender/config/linux2-config.py	2007-10-01 21:36:39 UTC (rev 12181)
@@ -115,11 +115,14 @@
 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
 
 # enable ffmpeg  support
-WITH_BF_FFMPEG = 'false'  # -DWITH_FFMPEG
-BF_FFMPEG = '/usr'
+WITH_BF_FFMPEG = 'true'  # -DWITH_FFMPEG
+BF_FFMPEG = '#extern/ffmpeg'
+BF_FFMPEG_LIB = ''
+# Uncomment the following two lines to use system's ffmpeg
+# BF_FFMPEG = '/usr'
+# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-BF_FFMPEG_LIB = 'avformat avcodec swscale avutil'
 
 # Mesa Libs should go here if your using them as well....
 WITH_BF_STATICOPENGL = 'false'

Modified: branches/cloth/blender/extern/SConscript
===================================================================
--- branches/cloth/blender/extern/SConscript	2007-10-01 20:19:22 UTC (rev 12180)
+++ branches/cloth/blender/extern/SConscript	2007-10-01 21:36:39 UTC (rev 12181)
@@ -14,3 +14,6 @@
 
 if env['WITH_BF_VERSE']:
     SConscript(['verse/dist/SConstruct'])
+
+if env['WITH_BF_FFMPEG'] and env['BF_FFMPEG_LIB'] == '':
+    SConscript(['ffmpeg/SConscript']);

Copied: branches/cloth/blender/extern/ffmpeg/SConscript (from rev 12179, trunk/blender/extern/ffmpeg/SConscript)
===================================================================
--- branches/cloth/blender/extern/ffmpeg/SConscript	                        (rev 0)
+++ branches/cloth/blender/extern/ffmpeg/SConscript	2007-10-01 21:36:39 UTC (rev 12181)
@@ -0,0 +1,145 @@
+#!/usr/bin/python
+
+all_libs = ['libavformat', 'libavcodec', 'libswscale', 'libavutil']
+root = "extern/ffmpeg"
+
+import sys
+import os
+import re
+import shutil
+
+from sets import Set
+
+Import('env')
+
+ff_env = env.Copy();
+ff_env.Replace(CCFLAGS = '')
+ff_env.Replace(BF_DEBUG_FLAGS = '')
+
+makevardef = re.compile('^([a-zA-Z0-9_-]+)[ \t]*(\+?)=(.*)')
+makevarsubst = re.compile('\$\(([^\)]+)\)')
+makeifeq = re.compile('if(n?)eq \(([^,]*),([^\)]*)\)')
+
+def makeparseblock(fp, variables):
+    pendingline = ''
+    while 1:
+        line = fp.readline()
+        if pendingline:
+            line = pendingline + line
+            pendingline = ''
+        if not line:
+            return
+        if line.endswith('\\\n'):
+            pendingline = line[:-2]
+            continue 
+
+        i = line.find('#')
+        if i >= 0:
+            line = line[:i]
+
+        iter = makevarsubst.finditer(line[:])
+        for obj in iter:
+            (name) = obj.group(1)
+            s = ""
+            if name in variables:
+                s = variables[name]
+            line = line.replace('$(' + name + ')', s)
+
+        matchobj = makevardef.match(line)
+        if matchobj:
+            (name, op, value) = matchobj.group(1, 2, 3)
+
+            value = value.rstrip()
+
+            if op == '+' and name in variables:
+                 variables[name] += value
+            else:
+                 variables[name] = value
+            continue
+        matchobj = makeifeq.match(line)
+        if matchobj:
+            (op, name1, name2) = matchobj.group(1, 2, 3)
+            if (op == '' and name1 == name2) or (op == 'n' and name1 != name2):
+                makeparseblock(fp, variables)
+            else:
+                tempvars = {}
+                makeparseblock(fp, tempvars)
+            continue
+        line = line.strip()
+        if line == 'endif':
+            return
+                
+def getmakevars(filenames):
+    variables = { }
+    for filename in filenames:
+       fp = open(filename)
+       print "Processing makefile: " + filename
+       try:
+             makeparseblock(fp, variables)
+       finally:
+             fp.close()
+
+    return variables
+
+print "Configuring ffmpeg..."
+
+if not os.path.isfile(root + "/config.mak"):
+    os.chdir(root);
+    os.system('sh configure --disable-shared --enable-liba52bin --enable-gpl --disable-network --disable-zlib --disable-vhook --disable-ffserver --disable-ffplay --enable-swscaler --enable-pthreads')
+    os.chdir("../..");
+else:
+    print "(skipped, config.mak already exists)"
+    
+if not os.path.isdir(root + "/include"):
+    os.mkdir(root + "/include");
+if not os.path.isdir(root + "/include/ffmpeg"):
+    os.mkdir(root + "/include/ffmpeg");
+
+for lib in all_libs:
+    vars = getmakevars([root + '/config.mak', root + "/" + lib + '/Makefile'])
+    objs = ""
+    if "OBJS-yes" in vars:
+        objs += vars['OBJS-yes']
+    if "OBJS" in vars:
+        objs += vars['OBJS']
+
+    objs += " "
+    objs = objs.replace(".o ", ".c ")
+
+    asm_objs = ""
+    if "ASM_OBJS" in vars:
+        asm_objs += vars["ASM_OBJS"]
+
+    asm_objs += " "
+    asm_objs = asm_objs.replace(".o ", ".S ")
+
+    objs += asm_objs;
+    
+    sources = list(Set(objs.split()))
+    sources = [lib + "/" + x for x in sources]
+
+    defs = "HAVE_AV_CONFIG_H _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE _ISOC9X_SOURCE"
+    cflags = ""
+    
+    if "CFLAGS" in vars:
+        cflags += " " + vars["CFLAGS"]
+    if "OPTFLAGS" in vars:
+        cflags += " " + vars["OPTFLAGS"]
+
+    headers = ""
+    if "HEADERS" in vars:
+        headers += vars["HEADERS"]
+
+    headers = headers.split()
+
+    for h in headers:
+        if not os.path.isfile(root + "/include/ffmpeg/" + h):
+            shutil.copyfile(root + "/" + lib + "/" + h,
+                            root + "/include/ffmpeg/" + h)
+
+    ff_env.BlenderLib (libname="extern_" + lib, sources=sources,
+                    includes=["."] + all_libs,
+                    defines=Split(defs),
+                    libtype=['core', 'intern', 'player'],
+                    priority = [5, 5, 10],
+                    compileflags = Split(cflags))

Modified: branches/cloth/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/constraint.c	2007-10-01 20:19:22 UTC (rev 12180)
+++ branches/cloth/blender/source/blender/blenkernel/intern/constraint.c	2007-10-01 21:36:39 UTC (rev 12181)
@@ -1146,56 +1146,58 @@
 		int i, j, count = 0;
 		float co[3], nor[3];
 		
-		
-		/* get the average of all verts with that are in the vertex-group */
-		for (i = 0; i < numVerts; i++, index++) {	
-			for (j = 0; j < dvert[i].totweight; j++) {
-				/* does this vertex belong to nominated vertex group? */
-				if (dvert[i].dw[j].def_nr == dgroup) {
-					dm->getVertCo(dm, i, co);
-					dm->getVertNo(dm, i, nor);
-					VecAddf(vec, vec, co);
-					VecAddf(normal, normal, nor);
-					count++;
-					break;
+		/* check that dvert and index are valid pointers (just in case) */
+		if (dvert && index) {
+			/* get the average of all verts with that are in the vertex-group */
+			for (i = 0; i < numVerts; i++, index++) {	
+				for (j = 0; j < dvert[i].totweight; j++) {
+					/* does this vertex belong to nominated vertex group? */
+					if (dvert[i].dw[j].def_nr == dgroup) {
+						dm->getVertCo(dm, i, co);
+						dm->getVertNo(dm, i, nor);
+						VecAddf(vec, vec, co);
+						VecAddf(normal, normal, nor);
+						count++;
+						break;
+					}
+					
 				}
-				
 			}
+			
+			
+			/* calculate averages of normal and coordinates */
+			if (count > 0) {
+				VecMulf(vec, 1.0f / count);
+				VecMulf(normal, 1.0f / count);
+			}
+			
+			
+			/* derive the rotation from the average normal: 
+			 *		- code taken from transform_manipulator.c, 
+			 *			calc_manipulator_stats, V3D_MANIP_NORMAL case
+			 */
+			/*	we need the transpose of the inverse for a normal... */
+			Mat3CpyMat4(imat, ob->obmat);
+			
+			Mat3Inv(tmat, imat);
+			Mat3Transp(tmat);
+			Mat3MulVecfl(tmat, normal);
+			
+			Normalize(normal);
+			VECCOPY(plane, tmat[1]);
+			
+			VECCOPY(tmat[2], normal);
+			Crossf(tmat[0], normal, plane);
+			Crossf(tmat[1], tmat[2], tmat[0]);
+			
+			Mat4CpyMat3(mat, tmat);
+			Mat4Ortho(mat);
+			
+			
+			/* apply the average coordinate as the new location */
+			VecMat4MulVecfl(tvec, ob->obmat, vec);
+			VECCOPY(mat[3], tvec);
 		}
-		
-		
-		/* calculate averages of normal and coordinates */
-		if (count > 0) {
-			VecMulf(vec, 1.0f / count);
-			VecMulf(normal, 1.0f / count);
-		}
-		
-		
-		/* derive the rotation from the average normal: 
-		 *		- code taken from transform_manipulator.c, 
-		 *			calc_manipulator_stats, V3D_MANIP_NORMAL case
-		 */
-		/*	we need the transpose of the inverse for a normal... */
-		Mat3CpyMat4(imat, ob->obmat);
-		
-		Mat3Inv(tmat, imat);
-		Mat3Transp(tmat);
-		Mat3MulVecfl(tmat, normal);
-
-		Normalize(normal);
-		VECCOPY(plane, tmat[1]);
-		
-		VECCOPY(tmat[2], normal);
-		Crossf(tmat[0], normal, plane);
-		Crossf(tmat[1], tmat[2], tmat[0]);
-		
-		Mat4CpyMat3(mat, tmat);
-		Mat4Ortho(mat);
-		
-		
-		/* apply the average coordinate as the new location */
-		VecMat4MulVecfl(tvec, ob->obmat, vec);
-		VECCOPY(mat[3], tvec);
 	}
 	
 	/* free temporary DerivedMesh created (in EditMode case) */
@@ -1225,6 +1227,7 @@
 	/* get index of vertex group */
 	dgroup = get_named_vertexgroup_num(ob, substring);
 	if (dgroup < 0) return;
+	if (dvert == NULL) return;
 	
 	/* 1. Loop through control-points checking if in nominated vertex-group.
 	 * 2. If it is, add it to vec to find the average point.

Modified: branches/cloth/blender/source/blender/blenlib/BLI_editVert.h
===================================================================
--- branches/cloth/blender/source/blender/blenlib/BLI_editVert.h	2007-10-01 20:19:22 UTC (rev 12180)
+++ branches/cloth/blender/source/blender/blenlib/BLI_editVert.h	2007-10-01 21:36:39 UTC (rev 12181)
@@ -55,9 +55,9 @@
 		struct EditVert *v;
 		struct EditEdge *e;
 		struct EditFace *f;
-		float           *fp;
 		void            *p;
 		long             l;
+		float            fp;
 	} tmp;
 	float no[3]; /*vertex normal */
 	float co[3]; /*vertex location */

Modified: branches/cloth/blender/source/blender/include/BIF_drawseq.h
===================================================================
--- branches/cloth/blender/source/blender/include/BIF_drawseq.h	2007-10-01 20:19:22 UTC (rev 12180)
+++ branches/cloth/blender/source/blender/include/BIF_drawseq.h	2007-10-01 21:36:39 UTC (rev 12181)
@@ -36,6 +36,7 @@
 struct ScrArea;
 struct Sequence;
 
+void drawprefetchseqspace(struct ScrArea *sa, void *spacedata);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list