diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-28 16:11:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-28 16:11:40 +0400 |
commit | d44a2b5b1b782bd89b562843806ccad7af0dd25f (patch) | |
tree | 4f0d9551417a203fc6ee7f784d14cca7d58b3976 /source/blender/makesrna | |
parent | 2a3c1a4cf316e6ebc812078145979a642b2c9698 (diff) |
fix for running rna subclasses own __init__ functions.
- exceptions in the __init__ functions were not being checked for and segfaulting
- avoid creating a new BPy_StructRNA instance per function call, use the existing one if the type matches.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 1797df2abf0..84053c0a181 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -980,7 +980,6 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL); RNA_def_property_ui_text(prop, "Name", ""); - RNA_def_struct_name_property(srna, prop); prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -1001,6 +1000,7 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */ RNA_def_property_flag(prop, PROP_REGISTER); + RNA_def_struct_name_property(srna, prop); prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->name"); @@ -1043,7 +1043,6 @@ static void rna_def_macro_operator(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL); RNA_def_property_ui_text(prop, "Name", ""); - RNA_def_struct_name_property(srna, prop); prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -1056,6 +1055,7 @@ static void rna_def_macro_operator(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */ RNA_def_property_flag(prop, PROP_REGISTER); + RNA_def_struct_name_property(srna, prop); prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->name"); |