[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25302] trunk/blender: [#20288] FBX exporter fails

Campbell Barton ideasman42 at gmail.com
Fri Dec 11 01:51:15 CET 2009


Revision: 25302
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25302
Author:   campbellbarton
Date:     2009-12-11 01:51:14 +0100 (Fri, 11 Dec 2009)

Log Message:
-----------
[#20288] FBX exporter fails
* disallow registering operators that have properties starting with an underscore which caused this problem.

Modified Paths:
--------------
    trunk/blender/release/scripts/io/export_fbx.py
    trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/release/scripts/io/export_fbx.py
===================================================================
--- trunk/blender/release/scripts/io/export_fbx.py	2009-12-11 00:09:58 UTC (rev 25301)
+++ trunk/blender/release/scripts/io/export_fbx.py	2009-12-11 00:51:14 UTC (rev 25302)
@@ -3363,10 +3363,10 @@
 	
 	EXP_OBS_SELECTED = BoolProperty(name="Selected Objects", description="Export selected objects on visible layers", default=True)
 # 	EXP_OBS_SCENE = BoolProperty(name="Scene Objects", description="Export all objects in this scene", default=True)
-	_SCALE = FloatProperty(name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0)
-	_XROT90 = BoolProperty(name="Rot X90", description="Rotate all objects 90 degrese about the X axis", default=True)
-	_YROT90 = BoolProperty(name="Rot Y90", description="Rotate all objects 90 degrese about the Y axis", default=False)
-	_ZROT90 = BoolProperty(name="Rot Z90", description="Rotate all objects 90 degrese about the Z axis", default=False)
+	TX_SCALE = FloatProperty(name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0)
+	TX_XROT90 = BoolProperty(name="Rot X90", description="Rotate all objects 90 degrese about the X axis", default=True)
+	TX_YROT90 = BoolProperty(name="Rot Y90", description="Rotate all objects 90 degrese about the Y axis", default=False)
+	TX_ZROT90 = BoolProperty(name="Rot Z90", description="Rotate all objects 90 degrese about the Z axis", default=False)
 	EXP_EMPTY = BoolProperty(name="Empties", description="Export empty objects", default=True)
 	EXP_CAMERA = BoolProperty(name="Cameras", description="Export camera objects", default=True)
 	EXP_LAMP = BoolProperty(name="Lamps", description="Export lamp objects", default=True)
@@ -3397,10 +3397,10 @@
 			raise Exception("path not set")
 
 		GLOBAL_MATRIX = mtx4_identity
-		GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties._SCALE
-		if self.properties._XROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_x90n
-		if self.properties._YROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_y90n
-		if self.properties._ZROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_z90n
+		GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties.TX_SCALE
+		if self.properties.TX_XROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_x90n
+		if self.properties.TX_YROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_y90n
+		if self.properties.TX_ZROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_z90n
 			
 		write(self.properties.path,
 			  None, # XXX

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c	2009-12-11 00:09:58 UTC (rev 25301)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c	2009-12-11 00:51:14 UTC (rev 25302)
@@ -3719,11 +3719,15 @@
 	if(PyTuple_CheckExact(item) && PyTuple_GET_SIZE(item)==2) {
 
 		PyObject *py_func_ptr, *py_kw, *py_srna_cobject, *py_ret;
+		PyObject *(*pyfunc)(PyObject *, PyObject *, PyObject *);
 
 		if(PyArg_ParseTuple(item, "O!O!", &PyCObject_Type, &py_func_ptr, &PyDict_Type, &py_kw)) {
 
-			PyObject *(*pyfunc)(PyObject *, PyObject *, PyObject *);
-
+			if(*_PyUnicode_AsString(key)=='_') {
+				PyErr_Format(PyExc_ValueError, "StructRNA \"%.200s\" registration error: %.200s could not register because the property starts with an '_'\n", RNA_struct_identifier(srna), _PyUnicode_AsString(key));
+				Py_DECREF(dummy_args);
+				return -1;
+			}
 			pyfunc = PyCObject_AsVoidPtr(py_func_ptr);
 			py_srna_cobject = PyCObject_FromVoidPtr(srna, NULL);
 





More information about the Bf-blender-cvs mailing list