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:
authorDaniel Dunbar <daniel@zuster.org>2005-07-22 11:37:15 +0400
committerDaniel Dunbar <daniel@zuster.org>2005-07-22 11:37:15 +0400
commite546e81762b2214eaf2439c04eea4d339901c2b5 (patch)
tree683f67adc43738e0226e9cc92a6ec96a5cbb7979 /source/blender/blenkernel/BKE_modifier.h
parent5e34b80e1b2e36a3304802a373a1cebec5b25ba3 (diff)
- added data arguments to deformer modifiers, in case someone wants
to write one that is based on geometry (and not just vertex position) - added editmode versions of modifier deform/apply calls and flag to tag modifiers that support editmode - added isFinalCalc param to applyModifier, basically a switch to let subsurf know if it is calc'ng orco or not (so it can deal with cache appropriately). This is kinda hacky and perhaps I can come up with a better solution (its also a waste to do a complete subdivide just to get vertex locations). - changed ccgsubsurf to not preallocate hash's to be approximately correct size... this was probably not a big performance savings but means that the order of faces returned by the iterator can vary after the first call, this messes up orco calculation so dropped for time being. - minor bug fix, meshes with only key didn't get vertex normals correctly calc'd - updated editmesh derivedmesh to support auxiliary locations - changed mesh_calc_modifiers to alloc deformVerts on demand - added editmesh_calc_modifiers for calculating editmesh cage and final derivedmesh's - bug fix, update shadedisplist to always calc colors (even if totvert==0) - changed load_editMesh and make_edge to build me->medge even if totedge==0 (incremental subsurf checks this) todo: add drawFacesTex for ccgderivedmesh So, modifiers in editmode are back (which means auto-mirror in edit mode works now) although still not finished. Currently no cage is computed, the cage is always the base mesh (in other words, Optimal edge style editing is off), and the final mesh currently includes all modifiers that work in edit mode (including lattice and curve). At some point there will be toggles for which modifiers affect the final/cage editmode derivedmesh's. Also, very nice new feature is that incremental subsurf in object mode returns a ccgderivedmesh object instead of copying to a new displistmesh. This can make a *huge* speed difference, and is very nice for working with deformed armatures (esp. with only small per frame changes).
Diffstat (limited to 'source/blender/blenkernel/BKE_modifier.h')
-rw-r--r--source/blender/blenkernel/BKE_modifier.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index a09ee20b385..e079b2f2e30 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -58,6 +58,7 @@ typedef enum {
eModifierTypeFlag_AcceptsMesh = (1<<0),
eModifierTypeFlag_AcceptsCVs = (1<<1),
eModifierTypeFlag_SupportsMapping = (1<<2),
+ eModifierTypeFlag_SupportsEditmode = (1<<3),
} ModifierTypeFlag;
typedef struct ModifierTypeInfo {
@@ -112,9 +113,14 @@ typedef struct ModifierTypeInfo {
int (*dependsOnTime)(struct ModifierData *md);
/* Only for deform types, should apply the deformation
- * to the given vertex array.
+ * to the given vertex array. If the deformer requires information from
+ * the object it can obtain it from the _derivedData_ argument if non-NULL,
+ * and otherwise the _ob_ argument.
*/
- void (*deformVerts)(struct ModifierData *md, struct Object *ob, float (*vertexCos)[3], int numVerts);
+ void (*deformVerts)(struct ModifierData *md, struct Object *ob, void *derivedData, float (*vertexCos)[3], int numVerts);
+
+ /* Like deformVerts but called during editmode (for supporting modifiers) */
+ void (*deformVertsEM)(struct ModifierData *md, struct Object *ob, void *editData, void *derivedData, float (*vertexCos)[3], int numVerts);
/* For non-deform types: apply the modifier and return a new derived
* data object (type is dependent on object type). If the _derivedData_
@@ -130,10 +136,23 @@ typedef struct ModifierTypeInfo {
* The _useRenderParams_ 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 is expected to release (or reuse) the _derivedData_ argument
* if non-NULL. The modifier *MAY NOT* share the _vertexCos_ argument.
*/
- void *(*applyModifier)(struct ModifierData *md, struct Object *ob, void *derivedData, float (*vertexCos)[3], int useRenderParams);
+ void *(*applyModifier)(struct ModifierData *md, struct Object *ob, void *derivedData, float (*vertexCos)[3], int useRenderParams, int isFinalCalc);
+
+ /* Like applyModifier but called during editmode (for supporting modifiers).
+ *
+ * The derived object that is returned must support the operations that are expected
+ * from editmode objects. The same qualifications regarding _derivedData_ and _vertexCos_
+ * apply as for applyModifier.
+ */
+ void *(*applyModifierEM)(struct ModifierData *md, struct Object *ob, void *editData, void *derivedData, float (*vertexCos)[3]);
} ModifierTypeInfo;
ModifierTypeInfo *modifierType_get_info(ModifierType type);