Baby step towards making overridable materials for objects.
Naughty Collections RNACollection of objects is still to be tamed, but for individual objects should work now....
This commit is contained in:
@@ -227,6 +227,7 @@ void RNA_def_collections(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Object");
|
||||
RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_ui_text(prop, "Objects", "Objects that are directly in this collection");
|
||||
RNA_def_property_collection_funcs(prop, "rna_Collection_objects_begin",
|
||||
"rna_iterator_listbase_next",
|
||||
|
||||
@@ -2690,6 +2690,7 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
|
||||
prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
|
||||
RNA_def_property_struct_type(prop, "Material");
|
||||
RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_ui_text(prop, "Materials", "");
|
||||
RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
|
||||
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
|
||||
|
||||
@@ -1568,7 +1568,7 @@ static void rna_def_material_slot(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Material");
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL, NULL);
|
||||
RNA_def_property_ui_text(prop, "Material", "Material data-block used by this material slot");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update");
|
||||
@@ -1576,6 +1576,7 @@ static void rna_def_material_slot(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, link_items);
|
||||
RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL);
|
||||
RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update");
|
||||
|
||||
@@ -1894,7 +1895,7 @@ static void rna_def_object(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "ID");
|
||||
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL);
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK | PROP_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_ui_text(prop, "Data", "Object data");
|
||||
RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
|
||||
|
||||
@@ -1981,6 +1982,7 @@ static void rna_def_object(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
|
||||
RNA_def_property_struct_type(prop, "MaterialSlot");
|
||||
RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC);
|
||||
/* don't dereference pointer! */
|
||||
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL);
|
||||
RNA_def_property_ui_text(prop, "Material Slots", "Material slots in the object");
|
||||
|
||||
Reference in New Issue
Block a user