Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show All 35 Lines | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_anim_types.h" | #include "DNA_anim_types.h" | ||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_camera_types.h" | #include "DNA_camera_types.h" | ||||
| #include "DNA_constraint_types.h" | #include "DNA_constraint_types.h" | ||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.h" | ||||
| #include "DNA_gpencil_modifier_types.h" | |||||
| #include "DNA_group_types.h" | #include "DNA_group_types.h" | ||||
| #include "DNA_key_types.h" | #include "DNA_key_types.h" | ||||
| #include "DNA_lamp_types.h" | #include "DNA_lamp_types.h" | ||||
| #include "DNA_lattice_types.h" | #include "DNA_lattice_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_meta_types.h" | #include "DNA_meta_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| ▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | |||||
| bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type) | bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type) | ||||
| { | { | ||||
| const ModifierTypeInfo *mti; | const ModifierTypeInfo *mti; | ||||
| mti = modifierType_getInfo(modifier_type); | mti = modifierType_getInfo(modifier_type); | ||||
| /* only geometry objects should be able to get modifiers [#25291] */ | /* only geometry objects should be able to get modifiers [#25291] */ | ||||
| if (!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE, OB_GPENCIL)) { | if (!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (ob->type == OB_GPENCIL) { | |||||
| if (mti->flags & eModifierTypeFlag_GpencilMod) { | |||||
| return true; | |||||
| } | |||||
| else { | |||||
| return false; | |||||
| } | |||||
| } | |||||
| if (ob->type == OB_LATTICE && (mti->flags & eModifierTypeFlag_AcceptsLattice) == 0) { | if (ob->type == OB_LATTICE && (mti->flags & eModifierTypeFlag_AcceptsLattice) == 0) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (!((mti->flags & eModifierTypeFlag_AcceptsCVs) || | if (!((mti->flags & eModifierTypeFlag_AcceptsCVs) || | ||||
| (ob->type == OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh)))) | (ob->type == OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh)))) | ||||
| { | { | ||||
| return false; | return false; | ||||
| ▲ Show 20 Lines • Show All 3,639 Lines • Show Last 20 Lines | |||||