Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/DerivedMesh.c
| Show First 20 Lines • Show All 895 Lines • ▼ Show 20 Lines | static void mesh_calc_modifiers(struct Depsgraph *depsgraph, | ||||
| Mesh *mesh_orco_cloth = NULL; | Mesh *mesh_orco_cloth = NULL; | ||||
| /* Modifier evaluation modes. */ | /* Modifier evaluation modes. */ | ||||
| const bool use_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); | const bool use_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); | ||||
| const int required_mode = use_render ? eModifierMode_Render : eModifierMode_Realtime; | const int required_mode = use_render ? eModifierMode_Render : eModifierMode_Realtime; | ||||
| /* Sculpt can skip certain modifiers. */ | /* Sculpt can skip certain modifiers. */ | ||||
| MultiresModifierData *mmd = get_multires_modifier(scene, ob, 0); | MultiresModifierData *mmd = get_multires_modifier(scene, ob, 0); | ||||
| const bool has_multires = (mmd && BKE_multires_sculpt_level_get(mmd) != 0); | const bool has_multires = (mmd && mmd->sculptlvl != 0); | ||||
| bool multires_applied = false; | bool multires_applied = false; | ||||
| const bool sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt && !use_render; | const bool sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt && !use_render; | ||||
| const bool sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm) && !use_render; | const bool sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm) && !use_render; | ||||
| /* Modifier evaluation contexts for different types of modifiers. */ | /* Modifier evaluation contexts for different types of modifiers. */ | ||||
| ModifierApplyFlag apply_render = use_render ? MOD_APPLY_RENDER : 0; | ModifierApplyFlag apply_render = use_render ? MOD_APPLY_RENDER : 0; | ||||
| ModifierApplyFlag apply_cache = use_cache ? MOD_APPLY_USECACHE : 0; | ModifierApplyFlag apply_cache = use_cache ? MOD_APPLY_USECACHE : 0; | ||||
| const ModifierEvalContext mectx = {depsgraph, ob, apply_render | apply_cache}; | const ModifierEvalContext mectx = {depsgraph, ob, apply_render | apply_cache}; | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | if ((mti->flags & eModifierTypeFlag_RequiresOriginalData) && | ||||
| have_non_onlydeform_modifiers_appled) { | have_non_onlydeform_modifiers_appled) { | ||||
| modifier_setError(md, "Modifier requires original data, bad stack position"); | modifier_setError(md, "Modifier requires original data, bad stack position"); | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (sculpt_mode && (!has_multires || multires_applied || sculpt_dyntopo)) { | if (sculpt_mode && (!has_multires || multires_applied || sculpt_dyntopo)) { | ||||
| bool unsupported = false; | bool unsupported = false; | ||||
| if (md->type == eModifierType_Multires && | if (md->type == eModifierType_Multires && ((MultiresModifierData *)md)->sculptlvl == 0) { | ||||
| BKE_multires_sculpt_level_get((MultiresModifierData *)md) == 0) { | |||||
| /* If multires is on level 0 skip it silently without warning message. */ | /* If multires is on level 0 skip it silently without warning message. */ | ||||
| if (!sculpt_dyntopo) { | if (!sculpt_dyntopo) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| if (sculpt_dyntopo) { | if (sculpt_dyntopo) { | ||||
| unsupported = true; | unsupported = true; | ||||
| ▲ Show 20 Lines • Show All 1,380 Lines • Show Last 20 Lines | |||||