RNA: report an error when the name property is set twice
This helps avoid copy-paste errors which have happened a few times, no functional changes.
This commit is contained in:
parent
66a87fc9f4
commit
ca476a638c
|
@ -566,7 +566,6 @@ static void rna_def_attribute(BlenderRNA *brna)
|
|||
RNA_def_struct_path_func(srna, "rna_Attribute_path");
|
||||
|
||||
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Attribute_name_set");
|
||||
RNA_def_property_editable_func(prop, "rna_Attribute_name_editable");
|
||||
RNA_def_property_ui_text(prop, "Name", "Name of the Attribute");
|
||||
|
|
|
@ -1125,6 +1125,11 @@ void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *pr
|
|||
CLOG_ERROR(&LOG, "\"%s.%s\", must be a string property.", srna->identifier, prop->identifier);
|
||||
DefRNA.error = true;
|
||||
}
|
||||
else if (srna->nameproperty != NULL) {
|
||||
CLOG_ERROR(
|
||||
&LOG, "\"%s.%s\", name property is already set.", srna->identifier, prop->identifier);
|
||||
DefRNA.error = true;
|
||||
}
|
||||
else {
|
||||
srna->nameproperty = prop;
|
||||
}
|
||||
|
|
|
@ -1081,7 +1081,6 @@ static void rna_def_render_pass(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "fullname", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "fullname");
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
|
||||
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "name");
|
||||
|
|
Loading…
Reference in New Issue