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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-06 13:07:27 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-16 20:55:33 +0300
commit34ab90f546f097cada951b2c9ca22bf271996980 (patch)
treeebcdb3d37120ac1d8fb16462b9104badd1800329 /source/blender/blenkernel/intern/crazyspace.c
parent0c495005dd83913864acb510c1d4194a2275dbb0 (diff)
Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing both risks the depsgraph and evaluation context not matching, and it complicates the Python API where we'd have to expose both which is not so easy to understand. This also removes the global evaluation context in main, which assumed there to be a single active scene and view layer. Differential Revision: https://developer.blender.org/D3152
Diffstat (limited to 'source/blender/blenkernel/intern/crazyspace.c')
-rw-r--r--source/blender/blenkernel/intern/crazyspace.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/crazyspace.c b/source/blender/blenkernel/intern/crazyspace.c
index d2ffbbcf27b..f5795444b7d 100644
--- a/source/blender/blenkernel/intern/crazyspace.c
+++ b/source/blender/blenkernel/intern/crazyspace.c
@@ -100,7 +100,7 @@ static int modifiers_disable_subsurf_temporary(Object *ob)
/* disable subsurf temporal, get mapped cos, and enable it */
float (*BKE_crazyspace_get_mapped_editverts(
- const struct EvaluationContext *eval_ctx, Scene *scene, Object *obedit))[3]
+ struct Depsgraph *depsgraph, Scene *scene, Object *obedit))[3]
{
Mesh *me = obedit->data;
DerivedMesh *dm;
@@ -110,13 +110,13 @@ float (*BKE_crazyspace_get_mapped_editverts(
/* disable subsurf temporal, get mapped cos, and enable it */
if (modifiers_disable_subsurf_temporary(obedit)) {
/* need to make new derivemesh */
- makeDerivedMesh(eval_ctx, scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH, false);
+ makeDerivedMesh(depsgraph, scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH, false);
}
/* now get the cage */
vertexcos = MEM_mallocN(sizeof(*vertexcos) * nverts, "vertexcos map");
- dm = editbmesh_get_derived_cage(eval_ctx, scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH);
+ dm = editbmesh_get_derived_cage(depsgraph, scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH);
mesh_get_mapped_verts_coords(dm, vertexcos, nverts);
@@ -252,7 +252,7 @@ void BKE_crazyspace_set_quats_mesh(Mesh *me, float (*origcos)[3], float (*mapped
/** returns an array of deform matrices for crazyspace correction, and the
* number of modifiers left */
int BKE_crazyspace_get_first_deform_matrices_editbmesh(
- const struct EvaluationContext *eval_ctx, Scene *scene, Object *ob, BMEditMesh *em,
+ struct Depsgraph *depsgraph, Scene *scene, Object *ob, BMEditMesh *em,
float (**deformmats)[3][3], float (**deformcos)[3])
{
ModifierData *md;
@@ -292,7 +292,7 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(
unit_m3(defmats[a]);
}
- mti->deformMatricesEM(md, eval_ctx, ob, em, dm, deformedVerts, defmats,
+ mti->deformMatricesEM(md, depsgraph, ob, em, dm, deformedVerts, defmats,
numVerts);
}
else
@@ -313,7 +313,7 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(
}
int BKE_sculpt_get_first_deform_matrices(
- const struct EvaluationContext *eval_ctx, Scene *scene,
+ struct Depsgraph *depsgraph, Scene *scene,
Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
{
ModifierData *md;
@@ -350,7 +350,7 @@ int BKE_sculpt_get_first_deform_matrices(
unit_m3(defmats[a]);
}
- if (mti->deformMatrices) mti->deformMatrices(md, eval_ctx, ob, dm, deformedVerts, defmats, numVerts);
+ if (mti->deformMatrices) mti->deformMatrices(md, depsgraph, ob, dm, deformedVerts, defmats, numVerts);
else break;
}
}
@@ -373,9 +373,9 @@ int BKE_sculpt_get_first_deform_matrices(
return numleft;
}
-void BKE_crazyspace_build_sculpt(const struct EvaluationContext *eval_ctx, Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
+void BKE_crazyspace_build_sculpt(struct Depsgraph *depsgraph, Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
{
- int totleft = BKE_sculpt_get_first_deform_matrices(eval_ctx, scene, ob, deformmats, deformcos);
+ int totleft = BKE_sculpt_get_first_deform_matrices(depsgraph, scene, ob, deformmats, deformcos);
if (totleft) {
/* there are deformation modifier which doesn't support deformation matrices
@@ -400,7 +400,7 @@ void BKE_crazyspace_build_sculpt(const struct EvaluationContext *eval_ctx, Scene
if (mti->deformMatrices && !deformed)
continue;
- mti->deformVerts(md, eval_ctx, ob, NULL, deformedVerts, me->totvert, 0);
+ mti->deformVerts(md, depsgraph, ob, NULL, deformedVerts, me->totvert, 0);
deformed = 1;
}
}