[Bf-blender-cvs] [06a1a66a9b6] blender2.8: Merge branch 'master' into blender2.8
Campbell Barton
noreply at git.blender.org
Sun Jun 17 17:11:24 CEST 2018
Commit: 06a1a66a9b6f120867d3bbebe3928744ec8e3495
Author: Campbell Barton
Date: Sun Jun 17 17:10:19 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB06a1a66a9b6f120867d3bbebe3928744ec8e3495
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc source/blender/alembic/intern/abc_mesh.h
index e1507bedd01,70d92f894d2..fd6de1001ae
--- a/source/blender/alembic/intern/abc_mesh.h
+++ b/source/blender/alembic/intern/abc_mesh.h
@@@ -72,18 -74,19 +72,18 @@@ private
std::vector<int32_t> &creaseLengths,
std::vector<float> &creaseSharpness);
- DerivedMesh *getFinalMesh();
- void freeMesh(DerivedMesh *dm);
+ struct Mesh *getFinalMesh(bool &r_needsfree);
- void getMaterialIndices(DerivedMesh *dm, std::vector<int32_t> &indices);
+ void getMaterialIndices(struct Mesh *mesh, std::vector<int32_t> &indices);
- void writeArbGeoParams(DerivedMesh *dm);
- void getGeoGroups(DerivedMesh *dm, std::map<std::string, std::vector<int32_t> > &geoGroups);
+ void writeArbGeoParams(struct Mesh *mesh);
+ void getGeoGroups(struct Mesh *mesh, std::map<std::string, std::vector<int32_t> > &geoGroups);
-
+
/* fluid surfaces support */
- void getVelocities(DerivedMesh *dm, std::vector<Imath::V3f> &vels);
+ void getVelocities(struct Mesh *mesh, std::vector<Imath::V3f> &vels);
template <typename Schema>
- void writeFaceSets(DerivedMesh *dm, Schema &schema);
+ void writeFaceSets(struct Mesh *mesh, Schema &schema);
};
/* ************************************************************************** */
diff --cc source/blender/blenkernel/BKE_constraint.h
index 98ba0f6f2a4,d22a3becf37..2bc71c114b7
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@@ -101,10 -99,10 +101,10 @@@ typedef struct bConstraintTypeInfo
int (*get_constraint_targets)(struct bConstraint *con, struct ListBase *list);
/* for single-target constraints only: flush data back to source data, and the free memory used */
void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy);
-
+
/* evaluation */
/* set the ct->matrix for the given constraint target (at the given ctime) */
- void (*get_target_matrix)(struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime);
+ void (*get_target_matrix)(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime);
/* evaluate the constraint for the given time */
void (*evaluate_constraint)(struct bConstraint *con, struct bConstraintOb *cob, struct ListBase *targets);
} bConstraintTypeInfo;
diff --cc source/blender/blenkernel/BKE_modifier.h
index b40d32203f6,e414df1650a..8a9e2f44604
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@@ -202,8 -197,17 +202,8 @@@ typedef struct ModifierTypeInfo
*
* The derivedData argument should always be non-NULL; the modifier
* should read the object data from the derived object instead of the
- * actual object data.
+ * actual object data.
*
- * The useRenderParams argument indicates if the modifier is being
- * applied in the service of the renderer which may alter quality
- * settings.
- *
- * The isFinalCalc parameter indicates if the modifier is being
- * calculated for a final result or for something temporary
- * (like orcos). This is a hack at the moment, it is meant so subsurf
- * can know if it is safe to reuse its internal cache.
- *
* The modifier may reuse the derivedData argument (i.e. return it in
* modified form), but must not release it.
*/
@@@ -217,60 -222,10 +217,60 @@@
* are expected from editmode objects. The same qualifications regarding
* derivedData apply as for applyModifier.
*/
- struct DerivedMesh *(*applyModifierEM)(struct ModifierData *md, struct Object *ob,
- struct BMEditMesh *editData,
- struct DerivedMesh *derivedData,
- ModifierApplyFlag flag);
+ struct DerivedMesh *(*applyModifierEM_DM)(struct ModifierData *md, const struct ModifierEvalContext *ctx,
+ struct BMEditMesh *editData,
+ struct DerivedMesh *derivedData);
+
+
+ /********************* Deform modifier functions *********************/
+
+ /* Only for deform types, should apply the deformation
+ * to the given vertex array. If the deformer requires information from
+ * the object it can obtain it from the mesh argument if non-NULL,
+ * and otherwise the ob argument.
+ */
+ void (*deformVerts)(struct ModifierData *md, const struct ModifierEvalContext *ctx,
+ struct Mesh *mesh, float (*vertexCos)[3], int numVerts);
+
+ /* Like deformMatricesEM but called from object mode (for supporting modifiers in sculpt mode) */
+ void (*deformMatrices)(struct ModifierData *md, const struct ModifierEvalContext *ctx,
+ struct Mesh *mesh, float (*vertexCos)[3], float (*defMats)[3][3], int numVerts);
+
+ /* Like deformVerts but called during editmode (for supporting modifiers)
+ */
+ void (*deformVertsEM)(struct ModifierData *md, const struct ModifierEvalContext *ctx,
+ struct BMEditMesh *editData,
+ struct Mesh *mesh, float (*vertexCos)[3], int numVerts);
+
+ /* Set deform matrix per vertex for crazyspace correction */
+ void (*deformMatricesEM)(struct ModifierData *md, const struct ModifierEvalContext *ctx,
+ struct BMEditMesh *editData,
+ struct Mesh *mesh, float (*vertexCos)[3], float (*defMats)[3][3], int numVerts);
+
+ /********************* Non-deform modifier functions *********************/
+
+ /* For non-deform types: apply the modifier and return a mesh object.
+ *
+ * The mesh argument should always be non-NULL; the modifier
+ * should read the object data from the mesh object instead of the
- * actual object data.
++ * actual object data.
+ *
+ * The modifier may reuse the mesh argument (i.e. return it in
+ * modified form), but must not release it.
+ */
+ struct Mesh *(*applyModifier)(struct ModifierData *md, const struct ModifierEvalContext *ctx,
+ struct Mesh *mesh);
+
+ /* Like applyModifier but called during editmode (for supporting
+ * modifiers).
- *
++ *
+ * The mesh object that is returned must support the operations that
+ * are expected from editmode objects. The same qualifications regarding
+ * mesh apply as for applyModifier.
+ */
+ struct Mesh *(*applyModifierEM)(struct ModifierData *md, const struct ModifierEvalContext *ctx,
+ struct BMEditMesh *editData,
+ struct Mesh *mesh);
/********************* Optional functions *********************/
@@@ -321,9 -284,10 +321,9 @@@
*
* This function is optional.
*/
- /* TODO(sergey): Remove once we finally switched to the new depsgraph. */
void (*updateDepsgraph)(struct ModifierData *md,
const ModifierUpdateDepsgraphContext *ctx);
-
+
/* Should return true if the modifier needs to be recalculated on time
* changes.
*
diff --cc source/blender/blenkernel/BKE_paint.h
index 2ba6446c18f,abb9000b024..6ade14b275c
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -184,10 -181,9 +184,10 @@@ typedef struct SculptSession
int totvert, totpoly;
struct KeyBlock *kb;
float *vmask;
-
+
/* Mesh connectivity */
- const struct MeshElemMap *pmap;
+ struct MeshElemMap *pmap;
+ int *pmap_mem;
/* BMesh for dynamic topology sculpting */
struct BMesh *bm;
diff --cc source/blender/blenkernel/BKE_particle.h
index dcc9c366b44,ddbf4025596..64cf7e8402e
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@@ -61,10 -60,8 +61,10 @@@ struct LinkNode
struct KDTree;
struct RNG;
struct BVHTreeRay;
- struct BVHTreeRayHit;
+ struct BVHTreeRayHit;
struct EdgeHash;
+struct Depsgraph;
+struct ViewLayer;
#define PARTICLE_COLLISION_MAX_COLLISIONS 10
diff --cc source/blender/blenkernel/intern/DerivedMesh.c
index c4904fcaa7c,9c0fc79a358..ebf19a99e58
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@@ -346,8 -347,9 +346,8 @@@ void DM_init
dm->numPolyData = numPolys;
DM_init_funcs(dm);
-
+
dm->needsFree = 1;
- dm->auto_bump_scale = -1.0f;
dm->dirty = 0;
/* don't use CustomData_reset(...); because we dont want to touch customdata */
@@@ -1167,10 -1154,9 +1167,10 @@@ DerivedMesh *mesh_create_derived_for_mo
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
DerivedMesh *dm;
KeyBlock *kb;
+ ModifierEvalContext mectx = {depsgraph, ob, 0};
md->scene = scene;
-
+
if (!(md->mode & eModifierMode_Realtime)) {
return NULL;
}
@@@ -1200,8 -1186,8 +1200,8 @@@
if (build_shapekey_layers)
add_shapekey_layers(tdm, me, ob);
-
+
- dm = modwrap_applyModifier(md, ob, tdm, 0);
+ dm = modwrap_applyModifier(md, &mectx, tdm);
ASSERT_IS_VALID_DM(dm);
if (tdm != dm) tdm->release(tdm);
@@@ -2130,22 -1878,14 +2130,22 @@@ static void mesh_calc_modifiers
* places that wish to use the original mesh but with deformed
* coordinates (vpaint, etc.)
*/
- if (r_deform) {
- *r_deform = CDDM_from_mesh(me);
-
- if (build_shapekey_layers)
- add_shapekey_layers(dm, me, ob);
+ if (r_deform_mesh) {
+ BKE_id_copy_ex(
+ NULL, &me->id, (ID **)r_deform_mesh,
+ (LIB_ID_CREATE_NO_MAIN |
+ LIB_ID_CREATE_NO_USER_REFCOUNT |
+ LIB_ID_CREATE_NO_DEG_TAG |
+ LIB_ID_COPY_CD_REFERENCE),
+ false);
+
+ /* XXX: Is build_shapekey_layers ever even true? This should have crashed long ago... */
+ BLI_assert(!build_shapekey_layers);
+ //if (build_shapekey_layers)
+ // add_shapekey_layers(*r_deform_mesh, me, ob);
-
+
if (deformedVerts) {
- CDDM_apply_vert_coords(*r_deform, deformedVerts);
+ BKE_mesh_apply_vert_coords(*r_deform_mesh, deformedVerts);
}
}
}
@@@ -2159,11 -1899,11 +21
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list