diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-13 04:40:20 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-13 04:40:20 +0400 |
commit | 26ef6da24b3324fb6f8ab6cfe12f101f0d7dedb4 (patch) | |
tree | 375aa10e98780325086c215454f71cdeaef2de4b /source/blender/makesrna | |
parent | 6fb0181b50461b529bb960950870de941711041e (diff) |
2.5
* Objects now support up to 32767 material slots. It's easy to
increase this further, but I prefer not to increase the memory
usage of mesh faces, it seems unlikely that someone would
create 32767 distinct materials?
* Forward compatibility: the only thing you can potentially lose
reading a 2.5 file in 2.4 is object linking (instead of default
data), though usually that will go fine too. Reading files with
> 32 material slots in 2.4 can start giving issues.
* The ob->colbits variable is deprecated by the array ob->matbits
but I didn't remove the ob->colbits updates in very few places
it is set.
* I hope I changed all the relevant things, various places just
hardcoded the number 16 instead of using the MAXMAT define.
* Join Objects operator back. This is using the version from the
animsys2 branch coded by Joshua, which means it now supports
joining of shape keys.
* Fix for crash reading file saved during render.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 12 |
3 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 91488aa2a49..5c9da19f9b2 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -701,7 +701,6 @@ static void rna_def_curve_nurb(BlenderRNA *brna) prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "mat_nr"); RNA_def_property_ui_text(prop, "Material Index", ""); - RNA_def_property_range(prop, 0, MAXMAT-1); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_material_index_range"); prop= RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 39fa6f36f23..b69a804cf6a 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -879,7 +879,6 @@ static void rna_def_mface(BlenderRNA *brna) prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "mat_nr"); RNA_def_property_ui_text(prop, "Material Index", ""); - RNA_def_property_range(prop, 0, MAXMAT-1); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range"); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 092d15de96e..33e8c1fbd26 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -331,7 +331,7 @@ static int rna_MaterialSlot_link_get(PointerRNA *ptr) Object *ob= (Object*)ptr->id.data; int index= (Material**)ptr->data - ob->mat; - return (ob->colbits & (1<<index)) != 0; + return ob->matbits[index] != 0; } static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) @@ -339,10 +339,14 @@ static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) Object *ob= (Object*)ptr->id.data; int index= (Material**)ptr->data - ob->mat; - if(value) + if(value) { + ob->matbits[index]= 1; ob->colbits |= (1<<index); - else + } + else { + ob->matbits[index]= 0; ob->colbits &= ~(1<<index); + } } static int rna_MaterialSlot_name_length(PointerRNA *ptr) @@ -523,8 +527,8 @@ static void rna_def_material_slot(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem link_items[] = { - {0, "DATA", 0, "Data", ""}, {1, "OBJECT", 0, "Object", ""}, + {0, "DATA", 0, "Data", ""}, {0, NULL, 0, NULL, NULL}}; /* NOTE: there is no MaterialSlot equivalent in DNA, so the internal |