Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_dynamicpaint.c
| Show All 14 Lines | |||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup modifiers | * \ingroup modifiers | ||||
| */ | */ | ||||
| #include <stddef.h> | #include <stddef.h> | ||||
| #include "BLI_blenlib.h" | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_dynamicpaint_types.h" | #include "DNA_dynamicpaint_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_object_force_types.h" | #include "DNA_object_force_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| ▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | static bool is_brush_cb(Object *UNUSED(ob), ModifierData *md) | ||||
| return (pmd->brush != NULL && pmd->type == MOD_DYNAMICPAINT_TYPE_BRUSH); | return (pmd->brush != NULL && pmd->type == MOD_DYNAMICPAINT_TYPE_BRUSH); | ||||
| } | } | ||||
| static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) | static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) | ||||
| { | { | ||||
| DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; | DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; | ||||
| /* Add relation from canvases to all brush objects. */ | /* Add relation from canvases to all brush objects. */ | ||||
| if (pmd->canvas != NULL && pmd->type == MOD_DYNAMICPAINT_TYPE_CANVAS) { | if (pmd->canvas != NULL && pmd->type == MOD_DYNAMICPAINT_TYPE_CANVAS) { | ||||
| for (DynamicPaintSurface *surface = pmd->canvas->surfaces.first; surface; | LISTBASE_FOREACH (DynamicPaintSurface *, surface, &pmd->canvas->surfaces) { | ||||
| surface = surface->next) { | |||||
| if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP) { | if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP) { | ||||
| DEG_add_forcefield_relations( | DEG_add_forcefield_relations( | ||||
| ctx->node, ctx->object, surface->effector_weights, true, 0, "Dynamic Paint Field"); | ctx->node, ctx->object, surface->effector_weights, true, 0, "Dynamic Paint Field"); | ||||
| } | } | ||||
| /* Actual code uses custom loop over group/scene | /* Actual code uses custom loop over group/scene | ||||
| * without layer checks in dynamicPaint_doStep. */ | * without layer checks in dynamicPaint_doStep. */ | ||||
| DEG_add_collision_relations(ctx->node, | DEG_add_collision_relations(ctx->node, | ||||
| ▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines | |||||