Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-31 16:43:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-31 16:43:41 +0400
commitc74bb09584371520b9b557cbaa8ae13356bf5e1a (patch)
tree1ab1a63110148b10a4a2808e17078075f71eaf66 /source/blender/makesrna
parent5b3bb373432d5b0b9c4ab1135a6f344831cb83a9 (diff)
fix for material slot removal (r38879)
- The object ID was being passed to the data_delete_material_index_id() from object_remove_material_slot(), rather then the object data. (so the material slot fix wouldnt run in that case). - add support for fixing text object materials too.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 6d7fc0ee57b..8d57403ec35 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -35,6 +35,7 @@
#include "DNA_ID.h"
#include "DNA_vfont_types.h"
+#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "WM_types.h"
@@ -416,9 +417,9 @@ static void rna_def_ID_materials(BlenderRNA *brna)
func= RNA_def_function(srna, "pop", "material_pop_id");
RNA_def_function_ui_description(func, "Remove a material from the data block.");
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of material to remove.", 0, INT_MAX);
+ parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove.", 0, MAXMAT);
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_boolean(func, "remove_material_slot", 1, "", "Remove the material slot and assign 1st material to old faces.");
+ RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned.");
parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
RNA_def_function_return(func, parm);
}