[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14780] branches/apricot: merge 14760:HEAD

Campbell Barton ideasman42 at gmail.com
Sat May 10 19:32:31 CEST 2008


Revision: 14780
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14780
Author:   campbellbarton
Date:     2008-05-10 19:32:31 +0200 (Sat, 10 May 2008)

Log Message:
-----------
merge 14760:HEAD

Modified Paths:
--------------
    branches/apricot/release/Makefile
    branches/apricot/release/scripts/bpymodules/BPyAddMesh.py
    branches/apricot/release/scripts/object_apply_def.py
    branches/apricot/release/scripts/render_save_layers.py
    branches/apricot/release/scripts/vrml97_export.py
    branches/apricot/source/blender/blenkernel/intern/depsgraph.c
    branches/apricot/source/blender/blenkernel/intern/modifier.c
    branches/apricot/source/blender/blenlib/BLI_arithb.h
    branches/apricot/source/blender/blenlib/intern/arithb.c
    branches/apricot/source/blender/include/BIF_drawseq.h
    branches/apricot/source/blender/makesdna/DNA_particle_types.h
    branches/apricot/source/blender/nodes/intern/CMP_nodes/CMP_displace.c
    branches/apricot/source/blender/python/BPY_interface.c
    branches/apricot/source/blender/render/intern/source/imagetexture.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/drawimage.c
    branches/apricot/source/blender/src/drawobject.c
    branches/apricot/source/blender/src/drawseq.c
    branches/apricot/source/blender/src/editdeform.c
    branches/apricot/source/blender/src/editmesh_lib.c
    branches/apricot/source/blender/src/header_image.c
    branches/apricot/source/blender/src/header_seq.c
    branches/apricot/source/blender/src/space.c
    branches/apricot/source/blender/src/toets.c

Modified: branches/apricot/release/Makefile
===================================================================
--- branches/apricot/release/Makefile	2008-05-10 14:05:35 UTC (rev 14779)
+++ branches/apricot/release/Makefile	2008-05-10 17:32:31 UTC (rev 14780)
@@ -118,7 +118,6 @@
     ifneq ($(OS), darwin)
 	@[ ! -d $(OCGDIR)/bin/.blender ] || \
 		cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
-	@rm -rf $(DISTDIR)/.svn $(DISTDIR)/*/.svn $(DISTDIR)/*/*/.svn
 	@cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
 	@cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
     endif
@@ -144,8 +143,7 @@
 	@cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
 	@chmod 755 $(DISTDIR)/plugins/bmake
 	@$(MAKE) -C $(DISTDIR)/plugins all  > /dev/null || exit 1;
-	@rm -fr $(DISTDIR)/plugins/.svn $(DISTDIR)/plugins/*/.svn \
-             $(DISTDIR)/plugins/*/*.o
+	@rm -f $(DISTDIR)/plugins/*/*.o
 
 #on OS X the plugins move to the installation directory
     ifneq ($(OS),darwin)
@@ -158,7 +156,6 @@
 
 	@echo "----> Copy python infrastructure"
 	@[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
-	@[ ! -d $(CONFDIR)/scripts ] || rm -fr $(CONFDIR)/scripts/.svn $(CONFDIR)/scripts/*/.svn $(CONFDIR)/scripts/*/*/.svn
 
     ifeq ($(OS),darwin)
 	@echo "----> Move .blender to .app/Contents/MacOS/"
@@ -180,6 +177,8 @@
 	@[ ! -x $(CONFIG_GUESS)/specific.sh ] || (\
 	    echo "**--> Execute specific.sh in $(CONFIG_GUESS)/" && \
 	    cd $(CONFIG_GUESS) && ./specific.sh )
+	@echo "----> Cleaning .svn metadata directories"
+	@find $(DISTDIR) -type d -name ".svn" | xargs rm -fr
 
 pkg: install
 	@echo "----> Create distribution file $(BLENDNAME)$(EXT1)"

Modified: branches/apricot/release/scripts/bpymodules/BPyAddMesh.py
===================================================================
--- branches/apricot/release/scripts/bpymodules/BPyAddMesh.py	2008-05-10 14:05:35 UTC (rev 14779)
+++ branches/apricot/release/scripts/bpymodules/BPyAddMesh.py	2008-05-10 17:32:31 UTC (rev 14780)
@@ -68,11 +68,7 @@
 		else:
 			# Mesh with no data, unlikely
 			me.edges.extend(edges)
-			me.faces.extend(faces)
-
-		if is_editmode or Blender.Get('add_editmode'):
-			EditMode(1)
-		
+			me.faces.extend(faces)		
 	else:
 		
 		# Object mode add new
@@ -95,11 +91,15 @@
 			ob_act.setMatrix(mat)
 		
 		ob_act.loc = cursor
+	
+	if is_editmode or Blender.Get('add_editmode'):
+		EditMode(1)
+	else: # adding in object mode means we need to calc normals
+		me.calcNormals()
+		
+			
 
-		if is_editmode or Blender.Get('add_editmode'):
-			EditMode(1)
 
-
 def write_mesh_script(filepath, me):
 	'''
 	filepath - path to py file
@@ -112,7 +112,7 @@
 	file.write('#!BPY\n')
 	file.write('"""\n')
 	file.write('Name: \'%s\'\n' % name)
-	file.write('Blender: 243\n')
+	file.write('Blender: 245\n')
 	file.write('Group: \'AddMesh\'\n')
 	file.write('"""\n\n')
 	file.write('import BPyAddMesh\n')

Modified: branches/apricot/release/scripts/object_apply_def.py
===================================================================
--- branches/apricot/release/scripts/object_apply_def.py	2008-05-10 14:05:35 UTC (rev 14779)
+++ branches/apricot/release/scripts/object_apply_def.py	2008-05-10 17:32:31 UTC (rev 14780)
@@ -77,7 +77,11 @@
 		for vgroupname in vgroups:
 			target_me.addVertGroup(vgroupname)
 			if len(target_me.verts) == len(source_me.verts):
-				vlist = source_me.getVertsFromGroup(vgroupname, True)
+				try: # in rare cases this can raise an 'no deform groups assigned to mesh' error
+					vlist = source_me.getVertsFromGroup(vgroupname, True)
+				except:
+					vlist = []
+				
 				try:
 					for vpair in vlist:
 						target_me.assignVertsToGroup(vgroupname, [vpair[0]], vpair[1], ADD)
@@ -171,4 +175,4 @@
 	Blender.Window.RedrawAll()
 
 if __name__=='__main__':
-	apply_deform()
\ No newline at end of file
+	apply_deform()

Modified: branches/apricot/release/scripts/render_save_layers.py
===================================================================
--- branches/apricot/release/scripts/render_save_layers.py	2008-05-10 14:05:35 UTC (rev 14779)
+++ branches/apricot/release/scripts/render_save_layers.py	2008-05-10 17:32:31 UTC (rev 14780)
@@ -47,9 +47,13 @@
 
 # default filename: theme's name + '_theme.py' in user's scripts dir:
 default_fname = Blender.Get("scriptsdir")
-default_fname = Blender.sys.join(default_fname, sce.name + '_renderlayer.py')
-default_fname = default_fname.replace(' ','_')
+if not default_fname:
+	default_fname = Blender.Get("uscriptsdir")
 
+if default_fname:
+	default_fname = Blender.sys.join(default_fname, sce.name + '_renderlayer.py')
+	default_fname = default_fname.replace(' ','_')
+
 def write_renderlayers(filename):
 	"Write the current renderlayer as a bpython script"
 	
@@ -113,4 +117,4 @@
 	except:
 		Blender.Draw.PupMenu("Warning - check console!%t|Menus could not be automatically updated")
 
-FileSelector(write_renderlayers, "Save RenderLayers", default_fname)
\ No newline at end of file
+FileSelector(write_renderlayers, "Save RenderLayers", default_fname)

Modified: branches/apricot/release/scripts/vrml97_export.py
===================================================================
--- branches/apricot/release/scripts/vrml97_export.py	2008-05-10 14:05:35 UTC (rev 14779)
+++ branches/apricot/release/scripts/vrml97_export.py	2008-05-10 17:32:31 UTC (rev 14780)
@@ -3,6 +3,9 @@
 Name: 'VRML97 (.wrl)...'
 Blender: 241
 Group: 'Export'
+Submenu: 'All Objects...' all
+Submenu: 'All Objects compressed...' comp
+Submenu: 'Selected Objects...' selected
 Tooltip: 'Export to VRML97 file (.wrl)'
 """
 
@@ -52,7 +55,7 @@
 
 import Blender
 from Blender import Object, Mesh, Lamp, Draw, BGL, \
-	 Image, Text, sys, Mathutils, Registry
+	 Image, Text, sys, Mathutils
 from Blender.Scene import Render
 
 import math
@@ -67,9 +70,8 @@
 filename = Blender.Get('filename')
 _safeOverwrite = True
 extension = ''
+ARG=''
 
-# Matrices below are used only when export_rotate_z_to_y.val:
-#
 # Blender is Z up, VRML is Y up, both are right hand coordinate
 # systems, so to go from Blender coords to VRML coords we rotate
 # by 90 degrees around the X axis. In matrix notation, we have a
@@ -631,10 +633,12 @@
 		meshVertexList = me.verts
 
 		for vertex in meshVertexList:
-			vrmlvert = vertex.co
-			if export_rotate_z_to_y.val:
-				vrmlvert = M_blen2vrml * vrmlvert
-			self.writeUnindented("%s %s %s\n " % (vrmlvert[0], vrmlvert[1], vrmlvert[2]))
+			blenvert = Mathutils.Vector(vertex.co)
+			vrmlvert = M_blen2vrml * blenvert
+			self.writeUnindented("%s %s %s\n " % \
+								 (vrmlvert[0], \
+								  vrmlvert[1], \
+								  vrmlvert[2]))
 		self.writeIndented("]\n", -1)
 		self.writeIndented("}\n", -1)
 		self.writeIndented("\n")
@@ -1012,10 +1016,7 @@
 			return
 
 		ob_matrix = Mathutils.Matrix(ob.getMatrix('worldspace'))
-		if export_rotate_z_to_y.val:
-			matrix = M_blen2vrml * ob_matrix * M_vrml2blen
-		else:
-			matrix = ob_matrix
+		matrix = M_blen2vrml * ob_matrix * M_vrml2blen
 		e      = matrix.rotationPart().toEuler()
 
 		v = matrix.translationPart()
@@ -1088,7 +1089,7 @@
 		self.writeFog()
 		self.proto = 0
 		allObj = []
-		if export_selection_only.val:
+		if ARG == 'selected':
 			allObj = list(scene.objects.context)
 		else:
 			allObj = list(scene.objects)
@@ -1097,7 +1098,7 @@
 		for thisObj in allObj:
 			self.writeObject(thisObj)
 
-		if not export_selection_only.val:
+		if ARG != 'selected':
 			self.writeScript()
 		self.cleanup()
 
@@ -1212,58 +1213,26 @@
 	wrlexport=VRML2Export(filename)
 	wrlexport.export(scene, world, worldmat)
 
-#########################################################
-# UI and Registry utilities
-#########################################################
 
-export_selection_only = Draw.Create(0)
-export_rotate_z_to_y = Draw.Create(0)
-export_compressed = Draw.Create(0)
-
-def save_to_registry():
-	d = {}
-	d['selection_only'] = export_selection_only.val
-	d['rotate_z_to_y'] = export_rotate_z_to_y.val
-	d['compressed'] = export_compressed.val
-	Registry.SetKey('vrml97_export', d, True)
-
-def load_from_registry():
-	d = Registry.GetKey('vrml97_export', True)
-	if d:
-		try:
-			export_selection_only.val = d['selection_only']
-			export_rotate_z_to_y.val = d['rotate_z_to_y']
-			export_compressed.val = d['compressed']
-		except: save_to_registry() # If data is not valid, rewrite it.
-
-def show_popup():
-	pup_block = [
-		('Selection Only', export_selection_only, 'Only export objects in visible selection. Else export whole scene.'),
-		('Rotate +Z to +Y', export_rotate_z_to_y, 'Rotate such that +Z axis (Blender up) becomes +Y (VRML up).'),
-		('Compress', export_compressed, 'Generate a .wrz file (normal VRML compressed by gzip).')
-		]
-	return Draw.PupBlock('Export VRML 97...', pup_block) 
-
 #########################################################
 # main routine
 #########################################################
 
-load_from_registry()
+try:
+	ARG = __script__['arg'] # user selected argument
+except:
+	print "older version"
 
-# Note that show_popup must be done before Blender.Window.FileSelector,
-# because export_compressed affects the suggested extension of resulting
-# file.
-
-if show_popup():
-	save_to_registry()
-	if export_compressed.val:
-		try:
-			extension=".wrz"
-			from gzip import *
-		except:
-			print "could not import gzip, file will be exported uncompressed"
-			pass
+if Blender.Get('version') < 235:
+	print "Warning: VRML97 export failed, wrong blender version!"
+	print " You aren't running blender version 2.35 or greater"
+	print " download a newer version from http://blender3d.org/"
+else:
+	if ARG == 'comp':
+		extension=".wrz"
+		from gzip import *
 	else:
 		extension=".wrl"
 	Blender.Window.FileSelector(select_file, "Export VRML97", \
 								sys.makename(ext=extension))
+

Modified: branches/apricot/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/depsgraph.c	2008-05-10 14:05:35 UTC (rev 14779)
+++ branches/apricot/source/blender/blenkernel/intern/depsgraph.c	2008-05-10 17:32:31 UTC (rev 14780)
@@ -346,6 +346,24 @@
 	}
 }
 
+static void dag_add_collision_field_relation(DagForest *dag, Object *ob, DagNode *node)
+{
+	Base *base;
+	DagNode *node2;
+
+	// would be nice to have a list of colliders here
+	// so for now walk all objects in scene check 'same layer rule'
+	for(base = G.scene->base.first; base; base= base->next) {
+		if((base->lay & ob->lay) && base->object->pd) {

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list