disable material index clamping, fbx importer doesn't know the total number of materials when meshes are loading,

also, its possible to have values outside this range by removing materials (though not from the UI)
This commit is contained in:
Campbell Barton 2013-08-20 12:48:44 +00:00
parent 605f7f4b9f
commit bc845765a7

@ -1108,12 +1108,15 @@ static void rna_MeshPoly_vertices_set(PointerRNA *ptr, const int *values)
}
}
/* disabling, some importers don't know the total material count when assigning materials */
#if 0
static void rna_MeshPoly_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
Mesh *me = rna_mesh(ptr);
*min = 0;
*max = max_ii(0, me->totcol - 1);
}
#endif
static int rna_MeshVertex_index_get(PointerRNA *ptr)
{
@ -1773,7 +1776,9 @@ 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", "");
#if 0
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshPoly_material_index_range"); /* reuse for tessface is ok */
#endif
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
@ -1870,7 +1875,9 @@ static void rna_def_mpolygon(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", "");
#if 0
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshPoly_material_index_range");
#endif
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);