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:
authorJoshua Leung <aligorith@gmail.com>2010-12-19 04:14:57 +0300
committerJoshua Leung <aligorith@gmail.com>2010-12-19 04:14:57 +0300
commit43af26fa413acbc5514106b71e0fb3c145c9b165 (patch)
tree62259ec794a6201e86f535cb3793aa4fb7e508f9 /source/blender/editors/object
parent555427765de0921451477e004600aa816b2078ea (diff)
Bugfix [#25291] Objects that should not have subsurface modifier have
it (eg cameras) When trying to add a modifier to non-geometry objects, warnings are now shown instead of just adding some (useless) modifiers that cannot be removed later.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_modifier.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index ba1778a6a38..59c9547680e 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -82,14 +82,20 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
{
ModifierData *md=NULL, *new_md=NULL;
ModifierTypeInfo *mti = modifierType_getInfo(type);
-
+
+ /* only geometry objects should be able to get modifiers [#25291] */
+ if(!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
+ BKE_reportf(reports, RPT_WARNING, "Modifiers cannot be added to Object '%s'", ob->id.name+2);
+ return NULL;
+ }
+
if(mti->flags&eModifierTypeFlag_Single) {
if(modifiers_findByType(ob, type)) {
BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed.");
return NULL;
}
}
-
+
if(type == eModifierType_ParticleSystem) {
/* don't need to worry about the new modifier's name, since that is set to the number
* of particle systems which shouldn't have too many duplicates