[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13453] branches/cloth/blender: svn merge -r 13415:13452 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

Daniel Genrich daniel.genrich at gmx.net
Tue Jan 29 17:43:02 CET 2008


Revision: 13453
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13453
Author:   genscher
Date:     2008-01-29 17:42:57 +0100 (Tue, 29 Jan 2008)

Log Message:
-----------
svn merge -r 13415:13452 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/cloth/blender/release/scripts/add_mesh_torus.py
    branches/cloth/blender/source/blender/blenkernel/BKE_armature.h
    branches/cloth/blender/source/blender/blenkernel/intern/DerivedMesh.c
    branches/cloth/blender/source/blender/blenkernel/intern/armature.c
    branches/cloth/blender/source/blender/blenkernel/intern/particle_system.c
    branches/cloth/blender/source/blender/blenloader/intern/readfile.c
    branches/cloth/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
    branches/cloth/blender/source/blender/include/BDR_drawaction.h
    branches/cloth/blender/source/blender/include/BIF_editarmature.h
    branches/cloth/blender/source/blender/include/BIF_editdeform.h
    branches/cloth/blender/source/blender/include/BIF_editsima.h
    branches/cloth/blender/source/blender/include/BIF_poseobject.h
    branches/cloth/blender/source/blender/include/BSE_editipo.h
    branches/cloth/blender/source/blender/include/transform.h
    branches/cloth/blender/source/blender/makesdna/DNA_action_types.h
    branches/cloth/blender/source/blender/makesdna/DNA_scene_types.h
    branches/cloth/blender/source/blender/makesdna/DNA_sequence_types.h
    branches/cloth/blender/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
    branches/cloth/blender/source/blender/nodes/intern/CMP_nodes/CMP_idMask.c
    branches/cloth/blender/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c
    branches/cloth/blender/source/blender/python/api2_2x/Mathutils.c
    branches/cloth/blender/source/blender/python/api2_2x/quat.c
    branches/cloth/blender/source/blender/python/api2_2x/sceneRender.c
    branches/cloth/blender/source/blender/python/api2_2x/sceneRender.h
    branches/cloth/blender/source/blender/render/extern/include/RE_pipeline.h
    branches/cloth/blender/source/blender/render/extern/include/RE_shader_ext.h
    branches/cloth/blender/source/blender/render/intern/include/render_types.h
    branches/cloth/blender/source/blender/render/intern/include/rendercore.h
    branches/cloth/blender/source/blender/render/intern/include/renderdatabase.h
    branches/cloth/blender/source/blender/render/intern/include/shading.h
    branches/cloth/blender/source/blender/render/intern/include/strand.h
    branches/cloth/blender/source/blender/render/intern/include/zbuf.h
    branches/cloth/blender/source/blender/render/intern/source/convertblender.c
    branches/cloth/blender/source/blender/render/intern/source/envmap.c
    branches/cloth/blender/source/blender/render/intern/source/occlusion.c
    branches/cloth/blender/source/blender/render/intern/source/pipeline.c
    branches/cloth/blender/source/blender/render/intern/source/pixelblending.c
    branches/cloth/blender/source/blender/render/intern/source/rendercore.c
    branches/cloth/blender/source/blender/render/intern/source/renderdatabase.c
    branches/cloth/blender/source/blender/render/intern/source/shadeinput.c
    branches/cloth/blender/source/blender/render/intern/source/strand.c
    branches/cloth/blender/source/blender/render/intern/source/zbuf.c
    branches/cloth/blender/source/blender/src/buttons_editing.c
    branches/cloth/blender/source/blender/src/buttons_object.c
    branches/cloth/blender/source/blender/src/buttons_scene.c
    branches/cloth/blender/source/blender/src/buttons_shading.c
    branches/cloth/blender/source/blender/src/drawaction.c
    branches/cloth/blender/source/blender/src/drawarmature.c
    branches/cloth/blender/source/blender/src/drawobject.c
    branches/cloth/blender/source/blender/src/drawview.c
    branches/cloth/blender/source/blender/src/edit.c
    branches/cloth/blender/source/blender/src/editaction.c
    branches/cloth/blender/source/blender/src/editarmature.c
    branches/cloth/blender/source/blender/src/editdeform.c
    branches/cloth/blender/source/blender/src/editipo.c
    branches/cloth/blender/source/blender/src/editobject.c
    branches/cloth/blender/source/blender/src/editseq.c
    branches/cloth/blender/source/blender/src/editsima.c
    branches/cloth/blender/source/blender/src/header_action.c
    branches/cloth/blender/source/blender/src/header_image.c
    branches/cloth/blender/source/blender/src/header_view3d.c
    branches/cloth/blender/source/blender/src/poselib.c
    branches/cloth/blender/source/blender/src/poseobject.c
    branches/cloth/blender/source/blender/src/sequence.c
    branches/cloth/blender/source/blender/src/space.c
    branches/cloth/blender/source/blender/src/transform.c
    branches/cloth/blender/source/blender/src/transform_conversions.c

Added Paths:
-----------
    branches/cloth/blender/release/scripts/render_save_layers.py

Modified: branches/cloth/blender/release/scripts/add_mesh_torus.py
===================================================================
--- branches/cloth/blender/release/scripts/add_mesh_torus.py	2008-01-29 16:32:42 UTC (rev 13452)
+++ branches/cloth/blender/release/scripts/add_mesh_torus.py	2008-01-29 16:42:57 UTC (rev 13453)
@@ -51,9 +51,9 @@
 
 	if not Draw.PupBlock('Add Torus', [\
 	('Major Radius:', PREF_MAJOR_RAD,  0.01, 100, 'Radius for the main ring of the torus'),\
-	('Minor Radius:', PREF_MINOR_RAD,  0.01, 100, 'Radius for the minor ring of the torus setting the thickness of the ring.'),\
-	('Major Segments:', PREF_MAJOR_SEG,  3, 256, 'Radius for the main ring of the torus'),\
-	('Minor Segments:', PREF_MINOR_SEG,  3, 256, 'Radius for the minor ring of the torus setting the thickness of the ring.'),\
+	('Minor Radius:', PREF_MINOR_RAD,  0.01, 100, 'Radius for the minor ring of the torus setting the thickness of the ring'),\
+	('Major Segments:', PREF_MAJOR_SEG,  3, 256, 'Number of segments for the main ring of the torus'),\
+	('Minor Segments:', PREF_MINOR_SEG,  3, 256, 'Number of segments for the minor ring of the torus'),\
 	]):
 		return
 	
@@ -61,4 +61,5 @@
 	
 	BPyAddMesh.add_mesh_simple('Torus', verts, [], faces)
 
-main()
\ No newline at end of file
+main()
+

Copied: branches/cloth/blender/release/scripts/render_save_layers.py (from rev 13452, trunk/blender/release/scripts/render_save_layers.py)
===================================================================
--- branches/cloth/blender/release/scripts/render_save_layers.py	                        (rev 0)
+++ branches/cloth/blender/release/scripts/render_save_layers.py	2008-01-29 16:42:57 UTC (rev 13453)
@@ -0,0 +1,116 @@
+#!BPY
+
+"""
+Name: 'Save Render Layers...'
+Blender: 245
+Group: 'Render'
+Tooltip: 'Save current renderlayers as a BPython script'
+"""
+
+__author__ = "Campbell Barton"
+__url__ = ("blender", "elysiun")
+__version__ = "1.0"
+
+__bpydoc__ = """\
+"""
+
+# --------------------------------------------------------------------------
+# The scripts generated by this script are put under Public Domain by
+# default, but you are free to edit the ones you generate with this script
+# and change their license to another one of your choice.
+# --------------------------------------------------------------------------
+# ***** 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 *****
+# --------------------------------------------------------------------------
+
+import Blender
+from Blender.Window import Theme, FileSelector
+from Blender import Scene
+
+sce = Scene.GetCurrent()
+rend = sce.render
+
+# 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(' ','_')
+
+def write_renderlayers(filename):
+	"Write the current renderlayer as a bpython script"
+	
+	if not filename.endswith('.py'): filename += '.py'
+
+	fout = file(filename, "w")
+
+	fout.write("""#!BPY
+
+# \"\"\"
+# Name: '%s'
+# Blender: 245
+# Group: 'Render'
+# Tooltip: ''
+# \"\"\"
+
+__%s__ = "????"
+__%s__ = "2.43"
+__%s__ = ["blender"]
+__%s__ = \"\"\"\\
+You can edit this section to write something about your script that can
+be read then with the Scripts Help Browser script in Blender.
+
+Remember to also set author, version and possibly url(s) above.  You can also
+define an __email__ tag, check some bundled script's source for examples.
+\"\"\"
+
+# This script was automatically generated by the save_theme.py bpython script.
+# By default, these generated scripts are released as Public Domain, but you
+# are free to change the license of the scripts you generate with
+# save_theme.py before releasing them.
+
+import Blender
+from Blender import Scene
+
+sce = Scene.GetCurrent()
+rend = sce.render
+""" % (sce.name, "author", "version", "url", "bpydoc"))
+
+	for lay in rend.renderLayers: # 
+		fout.write("\nlay = rend.addRenderLayer()\n")
+		fout.write("lay.name = \"%s\"\n" % lay.name)
+		
+		exec("vars = dir(lay)")
+
+		for var in vars:
+			if var.startswith('_'):
+				continue
+				
+			v = "lay.%s" % var
+			exec("value = %s" % v)
+			if type(value) == str:
+				fout.write("%s = '%s'\n" % (v, value))
+			else:
+				fout.write("%s = %s\n" % (v, value))
+
+	fout.write('\nBlender.Redraw(-1)')
+	fout.close()
+	try:
+		Blender.UpdateMenus()
+	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

Modified: branches/cloth/blender/source/blender/blenkernel/BKE_armature.h
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/BKE_armature.h	2008-01-29 16:32:42 UTC (rev 13452)
+++ branches/cloth/blender/source/blender/blenkernel/BKE_armature.h	2008-01-29 16:42:57 UTC (rev 13453)
@@ -78,7 +78,9 @@
 void free_armature(struct bArmature *arm);
 void make_local_armature(struct bArmature *arm);
 struct bArmature *copy_armature(struct bArmature *arm);
+
 void bone_flip_name (char *name, int strip_number);
+void bone_autoside_name (char *name, int strip_number, short axis, float head, float tail);
 
 struct bArmature *get_armature (struct Object *ob);
 struct Bone *get_named_bone (struct bArmature *arm, const char *name);

Modified: branches/cloth/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/DerivedMesh.c	2008-01-29 16:32:42 UTC (rev 13452)
+++ branches/cloth/blender/source/blender/blenkernel/intern/DerivedMesh.c	2008-01-29 16:42:57 UTC (rev 13453)
@@ -2479,7 +2479,7 @@
 			CustomData_free_layer_active(&me->fdata, CD_MCOL, me->totface);
 		} else {
 			mesh_calc_modifiers(ob, NULL, &ob->derivedDeform,
-			                    &ob->derivedFinal, 0, 1,
+			                    &ob->derivedFinal, G.rendering, 1,
 			                    needMapping, dataMask);
 		}
 

Modified: branches/cloth/blender/source/blender/blenkernel/intern/armature.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/armature.c	2008-01-29 16:32:42 UTC (rev 13452)
+++ branches/cloth/blender/source/blender/blenkernel/intern/armature.c	2008-01-29 16:42:57 UTC (rev 13453)
@@ -30,6 +30,8 @@
 #include <math.h>
 #include <string.h>
 #include <stdio.h>
+#include <float.h>
+
 #include "MEM_guardedalloc.h"
 
 #include "nla.h"
@@ -354,7 +356,89 @@
 	sprintf (name, "%s%s%s%s", prefix, replace, suffix, number);
 }
 
+/* Finds the best possible extension to the name on a particular axis. (For renaming, check for unique names afterwards)
+ * This assumes that bone names are at most 32 chars long!
+ * 	strip_number: removes number extensions  (TODO: not used)
+ *	axis: the axis to name on
+ *	head/tail: the head/tail co-ordinate of the bone on the specified axis
+ */
+void bone_autoside_name (char *name, int strip_number, short axis, float head, float tail)
+{
+	int		len;
+	char	basename[32]={""};
+	char 	extension[3]={""};
 
+	len= strlen(name);
+	if (len == 0) return;
+	strcpy(basename, name);
+	
+	/* Figure out extension to append: 
+	 *	- The extension to append is based upon the axis that we are working on.
+	 *	- If head happens to be on 0, then we must consider the tail position as well to decide
+	 *	  which side the bone is on
+	 *		-> If tail is 0, then it's bone is considered to be on axis, so no extension should be added
+	 *		-> Otherwise, extension is added from perspective of object based on which side tail goes to
+	 *	- If head is non-zero, extension is added from perspective of object based on side head is on
+	 */
+	if (axis == 2) {
+		/* z-axis - vertical (top/bottom) */
+		if (IS_EQ(head, 0)) {
+			if (tail < 0)
+				strcpy(extension, ".Bot");
+			else if (tail > 0)
+				strcpy(extension, ".Top");
+		}
+		else {
+			if (head < 0)
+				strcpy(extension, ".Bot");
+			else
+				strcpy(extension, ".Top");
+		}
+	}
+	else if (axis == 1) {
+		/* y-axis - depth (front/back) */
+		if (IS_EQ(head, 0)) {
+			if (tail < 0)
+				strcpy(extension, ".Fr");
+			else if (tail > 0)
+				strcpy(extension, ".Bk");
+		}
+		else {
+			if (head < 0)
+				strcpy(extension, ".Fr");
+			else
+				strcpy(extension, ".Bk");
+		}
+	}
+	else {
+		/* x-axis - horizontal (left/right) */
+		if (IS_EQ(head, 0)) {
+			if (tail < 0)
+				strcpy(extension, ".R");
+			else if (tail > 0)
+				strcpy(extension, ".L");
+		}
+		else {
+			if (head < 0)
+				strcpy(extension, ".R");
+			else if (head > 0)
+				strcpy(extension, ".L");
+		}
+	}
+
+	/* Simple name truncation 
+	 *	- truncate if there is an extension and it wouldn't be able to fit
+	 *	- otherwise, just append to end (TODO: this should really check if there was already a tag there, and remove it)
+	 */
+	if (extension[0]) {
+		if ((32 - len) < strlen(extension)) {
+			strncpy(name, basename, len-strlen(extension));
+		}
+	}
+
+	sprintf(name, "%s%s", basename, extension);
+}
+
 /* ************* B-Bone support ******************* */
 
 #define MAX_BBONE_SUBDIV	32

Modified: branches/cloth/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/particle_system.c	2008-01-29 16:32:42 UTC (rev 13452)
+++ branches/cloth/blender/source/blender/blenkernel/intern/particle_system.c	2008-01-29 16:42:57 UTC (rev 13453)
@@ -780,6 +780,21 @@
 	return 0;
 }
 
+/* not thread safe, but qsort doesn't take userdata argument */
+static int *COMPARE_ORIG_INDEX = NULL;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list