Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-19 14:16:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-19 14:16:30 +0400
commit4e3390437ea9a632339b47d3a99866b6c98f74af (patch)
tree21297caa5f67dcb0f52a79420019804a1d2be8dc /source/blender/python/intern/bpy_operator_wrap.c
parent98140e234e6d88dc301a3d8663ef54b56520020f (diff)
- Properties from base classes are now registered too, this allows class mix-in's to define properties.
An example of how this is useful - an importer mixin could define the filepath properties and a generic invoke function which can run the subclasses exec for each selected file. - Panels and Menus now skip the property check when registering. - renamed _idproperties_ to _idprops_ in function names, function names were getting very long.
Diffstat (limited to 'source/blender/python/intern/bpy_operator_wrap.c')
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 1e521aea438..6d16896fb16 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -34,22 +34,15 @@
static void operator_properties_init(wmOperatorType *ot)
{
PyObject *py_class = ot->ext.data;
- PyObject *item= ((PyTypeObject*)py_class)->tp_dict; /* getattr(..., "__dict__") returns a proxy */
-
RNA_struct_blender_type_set(ot->ext.srna, ot);
- if(item) {
- /* only call this so pyrna_deferred_register_props gives a useful error
- * WM_operatortype_append_ptr will call RNA_def_struct_identifier
- * later */
- RNA_def_struct_identifier(ot->srna, ot->idname);
+ /* only call this so pyrna_deferred_register_class gives a useful error
+ * WM_operatortype_append_ptr will call RNA_def_struct_identifier
+ * later */
+ RNA_def_struct_identifier(ot->srna, ot->idname);
- if(pyrna_deferred_register_props(ot->srna, item) != 0) {
- PyErr_Print(); /* failed to register operator props */
- PyErr_Clear();
- }
- }
- else {
+ if(pyrna_deferred_register_class(ot->srna, py_class) != 0) {
+ PyErr_Print(); /* failed to register operator props */
PyErr_Clear();
}
}