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:
authorSebastian Parborg <darkdefende@gmail.com>2019-07-09 15:43:25 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-07-09 15:49:08 +0300
commit977c48b88da75ef8df373921c58a26060030af8d (patch)
tree623ca8334e4e8f34cc5c0fa7d2b7b076d9bdb5ce /source/blender/modifiers
parentdd84ff212aa5c9d6c1a03888583e11f64a978a1a (diff)
Fix T64149: Texture paint can act as a canvas and brush at the same time
I don't know if it was the intended behavior or not, but having brush and canvas data at the same time with dymanic paint, would lead to the object trying to act as a brush and a canvas at the same time. We can't currently handle this with the new depsgraph, and it could legitimately lead to bad feedback loops. So now, to be more consistent with the GUI, I've made it only use the current set type (brush or canvas) as the final type of the object. That is, you can only have a object be a brush or a canvas, not both at the same time.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_dynamicpaint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index ce488a224aa..26ee75140a6 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -112,16 +112,17 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
return mesh;
}
-static bool is_brush_cb(Object *UNUSED(ob), ModifierData *pmd)
+static bool is_brush_cb(Object *UNUSED(ob), ModifierData *md)
{
- return ((DynamicPaintModifierData *)pmd)->brush != NULL;
+ DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
+ return (pmd->brush != NULL && pmd->type == MOD_DYNAMICPAINT_TYPE_BRUSH);
}
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
/* Add relation from canvases to all brush objects. */
- if (pmd->canvas != NULL) {
+ if (pmd->canvas != NULL && pmd->type == MOD_DYNAMICPAINT_TYPE_CANVAS) {
for (DynamicPaintSurface *surface = pmd->canvas->surfaces.first; surface;
surface = surface->next) {
if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP) {