2005-07-19 22:14:17 +02:00
|
|
|
/**
|
|
|
|
*
|
2005-07-20 06:14:21 +02:00
|
|
|
* $Id$
|
2005-07-19 22:14:17 +02:00
|
|
|
*
|
2008-04-17 00:40:48 +02:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2005-07-19 22:14:17 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-17 00:40:48 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2005-07-19 22:14:17 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-04-17 00:40:48 +02:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2005-07-19 22:14:17 +02:00
|
|
|
*/
|
|
|
|
#ifndef BKE_MODIFIER_H
|
|
|
|
#define BKE_MODIFIER_H
|
|
|
|
|
2006-12-23 12:56:22 +01:00
|
|
|
#include "DNA_modifier_types.h" /* needed for all enum typdefs */
|
2006-12-05 18:42:03 +01:00
|
|
|
#include "BKE_customdata.h"
|
|
|
|
|
2009-07-31 03:40:15 +02:00
|
|
|
struct ID;
|
2006-08-28 03:12:36 +02:00
|
|
|
struct EditMesh;
|
2005-07-19 22:14:17 +02:00
|
|
|
struct DerivedMesh;
|
2005-07-20 01:04:34 +02:00
|
|
|
struct DagForest;
|
|
|
|
struct DagNode;
|
2005-07-19 22:14:17 +02:00
|
|
|
struct Object;
|
2009-01-04 15:14:06 +01:00
|
|
|
struct Scene;
|
2005-08-11 05:31:33 +02:00
|
|
|
struct ListBase;
|
2006-12-05 18:42:03 +01:00
|
|
|
struct LinkNode;
|
2006-06-21 17:14:44 +02:00
|
|
|
struct bArmature;
|
2006-12-23 12:56:22 +01:00
|
|
|
struct ModifierData;
|
2009-05-18 10:46:04 +02:00
|
|
|
struct BMEditMesh;
|
2005-07-19 22:14:17 +02:00
|
|
|
|
|
|
|
typedef enum {
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Should not be used, only for None modifier type */
|
2005-07-19 22:14:17 +02:00
|
|
|
eModifierTypeType_None,
|
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Modifier only does deformation, implies that modifier
|
|
|
|
* type should have a valid deformVerts function. OnlyDeform
|
|
|
|
* style modifiers implicitly accept either mesh or CV
|
|
|
|
* input but should still declare flags appropriately.
|
|
|
|
*/
|
2005-07-19 22:14:17 +02:00
|
|
|
eModifierTypeType_OnlyDeform,
|
|
|
|
|
|
|
|
eModifierTypeType_Constructive,
|
|
|
|
eModifierTypeType_Nonconstructive,
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
|
|
|
|
/* both deformVerts & applyModifier are valid calls
|
|
|
|
* used for particles modifier that doesn't actually modify the object
|
|
|
|
* unless it's a mesh and can be exploded -> curve can also emit particles
|
|
|
|
*/
|
2009-07-02 21:41:31 +02:00
|
|
|
eModifierTypeType_DeformOrConstruct,
|
2005-07-19 22:14:17 +02:00
|
|
|
} ModifierTypeType;
|
|
|
|
|
|
|
|
typedef enum {
|
2006-08-28 03:12:36 +02:00
|
|
|
eModifierTypeFlag_AcceptsMesh = (1<<0),
|
|
|
|
eModifierTypeFlag_AcceptsCVs = (1<<1),
|
|
|
|
eModifierTypeFlag_SupportsMapping = (1<<2),
|
|
|
|
eModifierTypeFlag_SupportsEditmode = (1<<3),
|
|
|
|
|
|
|
|
/* For modifiers that support editmode this determines if the
|
|
|
|
* modifier should be enabled by default in editmode. This should
|
|
|
|
* only be used by modifiers that are relatively speedy and
|
|
|
|
* also generally used in editmode, otherwise let the user enable
|
|
|
|
* it by hand.
|
|
|
|
*/
|
|
|
|
eModifierTypeFlag_EnableInEditmode = (1<<4),
|
|
|
|
|
|
|
|
/* For modifiers that require original data and so cannot
|
|
|
|
* be placed after any non-deformative modifier.
|
|
|
|
*/
|
- added eModifierTypeFlag_RequiresOriginalData for modifiers that
can only follow deform (for example, they store mesh vertex
indices)
- added ModifierType.foreachObjectLink for iterating over Object
links inside modifier data (used for file load, relinking, etc)
- switched various modifiers_ functions to take object argument
instead of ListBase
- added user editable name field to modifiers
- bug fix, duplicate and make single user didn't relink object
pointers in modifier data
- added modifiers to outliner, needs icon
- added armature, hook, and softbody modifiers (softbody doesn't
do anything atm). added conversion of old hooks to modifiers.
NOTE-THE-FIRST: User name field is not initialized on loading 2.38 files
so if you have saved stuff with a cvs blender you will see blank names.
NOTE-THE-SECOND: Since modifiers aren't evaluated yet for non-Mesh
objects, hooks for lattices and curves are broken. Don't updated if
you actually, say, *use* Blender.
NOTE-THE-THIRD: Old hooks used a quirky weighting system during
deformation which can't be extended to modifiers. On the upside,
I doubt anyone relied on the old quirky system and the new system
makes much more sense. (Although the way falloff works is still
quite stupid I think).
2005-08-11 00:05:52 +02:00
|
|
|
eModifierTypeFlag_RequiresOriginalData = (1<<5),
|
2007-11-30 11:38:59 +01:00
|
|
|
|
|
|
|
/* For modifiers that support pointcache, so we can check to see if it has files we need to deal with
|
|
|
|
*/
|
|
|
|
eModifierTypeFlag_UsesPointCache = (1<<6),
|
2009-07-02 21:41:31 +02:00
|
|
|
|
|
|
|
/* For physics modifiers, max one per type */
|
2009-08-21 04:51:56 +02:00
|
|
|
eModifierTypeFlag_Single = (1<<7),
|
|
|
|
|
|
|
|
/* Some modifier can't be added manually by user */
|
|
|
|
eModifierTypeFlag_NoUserAdd = (1<<8)
|
2005-07-19 22:14:17 +02:00
|
|
|
} ModifierTypeFlag;
|
|
|
|
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin);
|
|
|
|
typedef void (*IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin);
|
2006-08-28 03:12:36 +02:00
|
|
|
|
2005-07-19 22:14:17 +02:00
|
|
|
typedef struct ModifierTypeInfo {
|
2006-08-28 03:12:36 +02:00
|
|
|
/* The user visible name for this modifier */
|
- shuffled editmesh derived function name/function
- added ModifierTypeInfo.freeData function
- added modifier_{new,free] utility function
- added ccgSubSurf_getUseAgeCounts to query info
- removed subsurf modifier faking (ME_SUBSURF flag is no
longer valid). subsurf modifier gets converted on file load
although there is obscure linked mesh situation where this
can go wrong, will fix shortly. this also means that some
places in the code that test/copy subsurf settings are broken
for the time being.
- shuffled modifier calculation to be simpler. note that
all modifiers are currently disabled in editmode (including
subsurf). don't worry, will return shortly.
- bug fix, build modifier didn't randomize meshes with only verts
- cleaned up subsurf_ccg and adapted for future editmode modifier
work
- added editmesh.derived{Cage,Final}, not used yet
- added SubsurfModifierData.{mCache,emCache}, will be used to cache
subsurf instead of caching in derivedmesh itself
- removed old subsurf buttons
- added do_modifiers_buttons to handle modifier events
- removed count_object counting of modifier (subsurfed) objects...
this would be nice to add back at some point but requires care.
probably requires rewrite of counting system.
New feature: Incremental Subsurf in Object Mode
The previous release introduce incremental subsurf calculation during
editmode but it was not turned on during object mode. In general it
does not make sense to have it always enabled during object mode because
it requires caching a fair amount of information about the mesh which
is a waste of memory unless the mesh is often recalculated.
However, for mesh's that have subsurfed armatures for example, or that
have other modifiers so that the mesh is essentially changing on every
frame, it makes a lot of sense to keep the subsurf'd object around and
that is what the new incremental subsurf modifier toggle is for. The
intent is that the user will enable this option for (a) a mesh that is
currently under active editing or (b) a mesh that is heavily updated
in the scene, such as a character.
I will try to write more about this feature for release, because it
has advantages and disadvantages that are not immediately obvious (the
first user reaction will be to turn it on for ever object, which is
probably not correct).
2005-07-21 22:30:33 +02:00
|
|
|
char name[32];
|
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* The DNA struct name for the modifier data type, used to
|
|
|
|
* write the DNA data out.
|
|
|
|
*/
|
- shuffled editmesh derived function name/function
- added ModifierTypeInfo.freeData function
- added modifier_{new,free] utility function
- added ccgSubSurf_getUseAgeCounts to query info
- removed subsurf modifier faking (ME_SUBSURF flag is no
longer valid). subsurf modifier gets converted on file load
although there is obscure linked mesh situation where this
can go wrong, will fix shortly. this also means that some
places in the code that test/copy subsurf settings are broken
for the time being.
- shuffled modifier calculation to be simpler. note that
all modifiers are currently disabled in editmode (including
subsurf). don't worry, will return shortly.
- bug fix, build modifier didn't randomize meshes with only verts
- cleaned up subsurf_ccg and adapted for future editmode modifier
work
- added editmesh.derived{Cage,Final}, not used yet
- added SubsurfModifierData.{mCache,emCache}, will be used to cache
subsurf instead of caching in derivedmesh itself
- removed old subsurf buttons
- added do_modifiers_buttons to handle modifier events
- removed count_object counting of modifier (subsurfed) objects...
this would be nice to add back at some point but requires care.
probably requires rewrite of counting system.
New feature: Incremental Subsurf in Object Mode
The previous release introduce incremental subsurf calculation during
editmode but it was not turned on during object mode. In general it
does not make sense to have it always enabled during object mode because
it requires caching a fair amount of information about the mesh which
is a waste of memory unless the mesh is often recalculated.
However, for mesh's that have subsurfed armatures for example, or that
have other modifiers so that the mesh is essentially changing on every
frame, it makes a lot of sense to keep the subsurf'd object around and
that is what the new incremental subsurf modifier toggle is for. The
intent is that the user will enable this option for (a) a mesh that is
currently under active editing or (b) a mesh that is heavily updated
in the scene, such as a character.
I will try to write more about this feature for release, because it
has advantages and disadvantages that are not immediately obvious (the
first user reaction will be to turn it on for ever object, which is
probably not correct).
2005-07-21 22:30:33 +02:00
|
|
|
char structName[32];
|
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* The size of the modifier data type, used by allocation. */
|
- shuffled editmesh derived function name/function
- added ModifierTypeInfo.freeData function
- added modifier_{new,free] utility function
- added ccgSubSurf_getUseAgeCounts to query info
- removed subsurf modifier faking (ME_SUBSURF flag is no
longer valid). subsurf modifier gets converted on file load
although there is obscure linked mesh situation where this
can go wrong, will fix shortly. this also means that some
places in the code that test/copy subsurf settings are broken
for the time being.
- shuffled modifier calculation to be simpler. note that
all modifiers are currently disabled in editmode (including
subsurf). don't worry, will return shortly.
- bug fix, build modifier didn't randomize meshes with only verts
- cleaned up subsurf_ccg and adapted for future editmode modifier
work
- added editmesh.derived{Cage,Final}, not used yet
- added SubsurfModifierData.{mCache,emCache}, will be used to cache
subsurf instead of caching in derivedmesh itself
- removed old subsurf buttons
- added do_modifiers_buttons to handle modifier events
- removed count_object counting of modifier (subsurfed) objects...
this would be nice to add back at some point but requires care.
probably requires rewrite of counting system.
New feature: Incremental Subsurf in Object Mode
The previous release introduce incremental subsurf calculation during
editmode but it was not turned on during object mode. In general it
does not make sense to have it always enabled during object mode because
it requires caching a fair amount of information about the mesh which
is a waste of memory unless the mesh is often recalculated.
However, for mesh's that have subsurfed armatures for example, or that
have other modifiers so that the mesh is essentially changing on every
frame, it makes a lot of sense to keep the subsurf'd object around and
that is what the new incremental subsurf modifier toggle is for. The
intent is that the user will enable this option for (a) a mesh that is
currently under active editing or (b) a mesh that is heavily updated
in the scene, such as a character.
I will try to write more about this feature for release, because it
has advantages and disadvantages that are not immediately obvious (the
first user reaction will be to turn it on for ever object, which is
probably not correct).
2005-07-21 22:30:33 +02:00
|
|
|
int structSize;
|
|
|
|
|
2005-07-19 22:14:17 +02:00
|
|
|
ModifierTypeType type;
|
|
|
|
ModifierTypeFlag flags;
|
|
|
|
|
- shuffled editmesh derived function name/function
- added ModifierTypeInfo.freeData function
- added modifier_{new,free] utility function
- added ccgSubSurf_getUseAgeCounts to query info
- removed subsurf modifier faking (ME_SUBSURF flag is no
longer valid). subsurf modifier gets converted on file load
although there is obscure linked mesh situation where this
can go wrong, will fix shortly. this also means that some
places in the code that test/copy subsurf settings are broken
for the time being.
- shuffled modifier calculation to be simpler. note that
all modifiers are currently disabled in editmode (including
subsurf). don't worry, will return shortly.
- bug fix, build modifier didn't randomize meshes with only verts
- cleaned up subsurf_ccg and adapted for future editmode modifier
work
- added editmesh.derived{Cage,Final}, not used yet
- added SubsurfModifierData.{mCache,emCache}, will be used to cache
subsurf instead of caching in derivedmesh itself
- removed old subsurf buttons
- added do_modifiers_buttons to handle modifier events
- removed count_object counting of modifier (subsurfed) objects...
this would be nice to add back at some point but requires care.
probably requires rewrite of counting system.
New feature: Incremental Subsurf in Object Mode
The previous release introduce incremental subsurf calculation during
editmode but it was not turned on during object mode. In general it
does not make sense to have it always enabled during object mode because
it requires caching a fair amount of information about the mesh which
is a waste of memory unless the mesh is often recalculated.
However, for mesh's that have subsurfed armatures for example, or that
have other modifiers so that the mesh is essentially changing on every
frame, it makes a lot of sense to keep the subsurf'd object around and
that is what the new incremental subsurf modifier toggle is for. The
intent is that the user will enable this option for (a) a mesh that is
currently under active editing or (b) a mesh that is heavily updated
in the scene, such as a character.
I will try to write more about this feature for release, because it
has advantages and disadvantages that are not immediately obvious (the
first user reaction will be to turn it on for ever object, which is
probably not correct).
2005-07-21 22:30:33 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/********************* Non-optional functions *********************/
|
|
|
|
|
|
|
|
/* Copy instance data for this modifier type. Should copy all user
|
|
|
|
* level settings to the target modifier.
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
void (*copyData)(struct ModifierData *md, struct ModifierData *target);
|
2005-07-27 22:16:41 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/********************* 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 derivedData argument if non-NULL,
|
|
|
|
* and otherwise the ob argument.
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
void (*deformVerts)(struct ModifierData *md, struct Object *ob,
|
2006-08-28 03:12:36 +02:00
|
|
|
struct DerivedMesh *derivedData,
|
2009-05-31 19:20:57 +02:00
|
|
|
float (*vertexCos)[3], int numVerts,
|
|
|
|
int useRenderParams, int isFinalCalc);
|
2006-08-28 03:12:36 +02:00
|
|
|
|
|
|
|
/* Like deformVerts but called during editmode (for supporting modifiers)
|
|
|
|
*/
|
|
|
|
void (*deformVertsEM)(
|
2006-12-23 12:56:22 +01:00
|
|
|
struct ModifierData *md, struct Object *ob,
|
2009-05-18 10:46:04 +02:00
|
|
|
struct BMEditMesh *editData, struct DerivedMesh *derivedData,
|
2006-08-28 03:12:36 +02:00
|
|
|
float (*vertexCos)[3], int numVerts);
|
|
|
|
|
2007-07-28 23:04:30 +02:00
|
|
|
/* Set deform matrix per vertex for crazyspace correction */
|
|
|
|
void (*deformMatricesEM)(
|
|
|
|
struct ModifierData *md, struct Object *ob,
|
2009-05-18 10:46:04 +02:00
|
|
|
struct BMEditMesh *editData, struct DerivedMesh *derivedData,
|
2007-07-28 23:04:30 +02:00
|
|
|
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts);
|
2006-08-28 03:12:36 +02:00
|
|
|
|
|
|
|
/********************* Non-deform modifier functions *********************/
|
|
|
|
|
|
|
|
/* For non-deform types: apply the modifier and return a derived
|
|
|
|
* data object (type is dependent on object type).
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
struct DerivedMesh *(*applyModifier)(
|
2006-12-23 12:56:22 +01:00
|
|
|
struct ModifierData *md, struct Object *ob,
|
2006-08-28 03:12:36 +02:00
|
|
|
struct DerivedMesh *derivedData,
|
|
|
|
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 apply as for applyModifier.
|
|
|
|
*/
|
|
|
|
struct DerivedMesh *(*applyModifierEM)(
|
2006-12-23 12:56:22 +01:00
|
|
|
struct ModifierData *md, struct Object *ob,
|
2009-05-18 10:46:04 +02:00
|
|
|
struct BMEditMesh *editData,
|
2006-08-28 03:12:36 +02:00
|
|
|
struct DerivedMesh *derivedData);
|
|
|
|
|
|
|
|
|
|
|
|
/********************* Optional functions *********************/
|
|
|
|
|
|
|
|
/* Initialize new instance data for this modifier type, this function
|
|
|
|
* should set modifier variables to their default values.
|
|
|
|
*
|
|
|
|
* This function is optional.
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
void (*initData)(struct ModifierData *md);
|
2006-08-28 03:12:36 +02:00
|
|
|
|
2006-12-05 18:42:03 +01:00
|
|
|
/* Should return a CustomDataMask indicating what data this
|
|
|
|
* modifier needs. If (mask & (1 << (layer type))) != 0, this modifier
|
|
|
|
* needs that custom data layer. This function's return value can change
|
|
|
|
* depending on the modifier's settings.
|
|
|
|
*
|
|
|
|
* Note that this means extra data (e.g. vertex groups) - it is assumed
|
|
|
|
* that all modifiers need mesh data and deform modifiers need vertex
|
|
|
|
* coordinates.
|
|
|
|
*
|
|
|
|
* Note that this limits the number of custom data layer types to 32.
|
|
|
|
*
|
|
|
|
* If this function is not present or it returns 0, it is assumed that
|
|
|
|
* no extra data is needed.
|
|
|
|
*
|
|
|
|
* This function is optional.
|
|
|
|
*/
|
2009-06-15 13:48:42 +02:00
|
|
|
CustomDataMask (*requiredDataMask)(struct Object *ob, struct ModifierData *md);
|
2006-12-05 18:42:03 +01:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Free internal modifier data variables, this function should
|
|
|
|
* not free the md variable itself.
|
|
|
|
*
|
|
|
|
* This function is optional.
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
void (*freeData)(struct ModifierData *md);
|
2005-07-19 22:14:17 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Return a boolean value indicating if this modifier is able to be
|
|
|
|
* calculated based on the modifier data. This is *not* regarding the
|
|
|
|
* md->flag, that is tested by the system, this is just if the data
|
|
|
|
* validates (for example, a lattice will return false if the lattice
|
|
|
|
* object is not defined).
|
|
|
|
*
|
|
|
|
* This function is optional (assumes never disabled if not present).
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
int (*isDisabled)(struct ModifierData *md);
|
2005-07-19 22:14:17 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Add the appropriate relations to the DEP graph depending on the
|
|
|
|
* modifier data.
|
|
|
|
*
|
|
|
|
* This function is optional.
|
|
|
|
*/
|
2009-01-04 15:14:06 +01:00
|
|
|
void (*updateDepgraph)(struct ModifierData *md, struct DagForest *forest, struct Scene *scene,
|
2006-08-28 03:12:36 +02:00
|
|
|
struct Object *ob, struct DagNode *obNode);
|
2005-07-20 06:14:21 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Should return true if the modifier needs to be recalculated on time
|
|
|
|
* changes.
|
|
|
|
*
|
|
|
|
* This function is optional (assumes false if not present).
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
int (*dependsOnTime)(struct ModifierData *md);
|
2005-07-19 22:14:17 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Should call the given walk function on with a pointer to each Object
|
|
|
|
* pointer that the modifier data stores. This is used for linking on file
|
|
|
|
* load and for unlinking objects or forwarding object references.
|
|
|
|
*
|
|
|
|
* This function is optional.
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
void (*foreachObjectLink)(struct ModifierData *md, struct Object *ob,
|
2006-08-28 03:12:36 +02:00
|
|
|
ObjectWalkFunc walk, void *userData);
|
2005-07-19 22:14:17 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Should call the given walk function with a pointer to each ID
|
|
|
|
* pointer (i.e. each datablock pointer) that the modifier data
|
|
|
|
* stores. This is used for linking on file load and for
|
|
|
|
* unlinking datablocks or forwarding datablock references.
|
|
|
|
*
|
|
|
|
* This function is optional. If it is not present, foreachObjectLink
|
|
|
|
* will be used.
|
- shuffled editmesh derived function name/function
- added ModifierTypeInfo.freeData function
- added modifier_{new,free] utility function
- added ccgSubSurf_getUseAgeCounts to query info
- removed subsurf modifier faking (ME_SUBSURF flag is no
longer valid). subsurf modifier gets converted on file load
although there is obscure linked mesh situation where this
can go wrong, will fix shortly. this also means that some
places in the code that test/copy subsurf settings are broken
for the time being.
- shuffled modifier calculation to be simpler. note that
all modifiers are currently disabled in editmode (including
subsurf). don't worry, will return shortly.
- bug fix, build modifier didn't randomize meshes with only verts
- cleaned up subsurf_ccg and adapted for future editmode modifier
work
- added editmesh.derived{Cage,Final}, not used yet
- added SubsurfModifierData.{mCache,emCache}, will be used to cache
subsurf instead of caching in derivedmesh itself
- removed old subsurf buttons
- added do_modifiers_buttons to handle modifier events
- removed count_object counting of modifier (subsurfed) objects...
this would be nice to add back at some point but requires care.
probably requires rewrite of counting system.
New feature: Incremental Subsurf in Object Mode
The previous release introduce incremental subsurf calculation during
editmode but it was not turned on during object mode. In general it
does not make sense to have it always enabled during object mode because
it requires caching a fair amount of information about the mesh which
is a waste of memory unless the mesh is often recalculated.
However, for mesh's that have subsurfed armatures for example, or that
have other modifiers so that the mesh is essentially changing on every
frame, it makes a lot of sense to keep the subsurf'd object around and
that is what the new incremental subsurf modifier toggle is for. The
intent is that the user will enable this option for (a) a mesh that is
currently under active editing or (b) a mesh that is heavily updated
in the scene, such as a character.
I will try to write more about this feature for release, because it
has advantages and disadvantages that are not immediately obvious (the
first user reaction will be to turn it on for ever object, which is
probably not correct).
2005-07-21 22:30:33 +02:00
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
void (*foreachIDLink)(struct ModifierData *md, struct Object *ob,
|
2006-08-28 03:12:36 +02:00
|
|
|
IDWalkFunc walk, void *userData);
|
|
|
|
} ModifierTypeInfo;
|
2005-08-11 04:23:52 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
ModifierTypeInfo *modifierType_getInfo (ModifierType type);
|
2005-08-11 04:23:52 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
/* Modifier utility calls, do call through type pointer and return
|
|
|
|
* default values if pointer is optional.
|
|
|
|
*/
|
2006-12-23 12:56:22 +01:00
|
|
|
struct ModifierData *modifier_new(int type);
|
|
|
|
void modifier_free(struct ModifierData *md);
|
2005-08-11 04:23:52 +02:00
|
|
|
|
2006-12-23 12:56:22 +01:00
|
|
|
void modifier_copyData(struct ModifierData *md, struct ModifierData *target);
|
|
|
|
int modifier_dependsOnTime(struct ModifierData *md);
|
|
|
|
int modifier_supportsMapping(struct ModifierData *md);
|
|
|
|
int modifier_couldBeCage(struct ModifierData *md);
|
2007-07-28 23:04:30 +02:00
|
|
|
int modifier_isDeformer(struct ModifierData *md);
|
2009-06-15 13:48:42 +02:00
|
|
|
int modifier_isEnabled(struct ModifierData *md, int required_mode);
|
2006-12-23 12:56:22 +01:00
|
|
|
void modifier_setError(struct ModifierData *md, char *format, ...);
|
2005-07-27 22:16:41 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
void modifiers_foreachObjectLink(struct Object *ob,
|
|
|
|
ObjectWalkFunc walk,
|
|
|
|
void *userData);
|
|
|
|
void modifiers_foreachIDLink(struct Object *ob,
|
|
|
|
IDWalkFunc walk,
|
|
|
|
void *userData);
|
2006-12-23 12:56:22 +01:00
|
|
|
struct ModifierData *modifiers_findByType(struct Object *ob, ModifierType type);
|
2006-08-28 03:12:36 +02:00
|
|
|
void modifiers_clearErrors(struct Object *ob);
|
|
|
|
int modifiers_getCageIndex(struct Object *ob,
|
|
|
|
int *lastPossibleCageIndex_r);
|
2005-08-11 05:31:33 +02:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
int modifiers_isSoftbodyEnabled(struct Object *ob);
|
2008-01-29 22:01:12 +01:00
|
|
|
int modifiers_isClothEnabled(struct Object *ob);
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
int modifiers_isParticleEnabled(struct Object *ob);
|
2008-01-29 22:01:12 +01:00
|
|
|
|
2006-08-28 03:12:36 +02:00
|
|
|
struct Object *modifiers_isDeformedByArmature(struct Object *ob);
|
2006-12-23 12:56:22 +01:00
|
|
|
struct Object *modifiers_isDeformedByLattice(struct Object *ob);
|
2006-08-28 03:12:36 +02:00
|
|
|
int modifiers_usesArmature(struct Object *ob, struct bArmature *arm);
|
2009-01-07 15:46:50 +01:00
|
|
|
int modifiers_isDeformed(struct Scene *scene, struct Object *ob);
|
2007-12-17 12:47:24 +01:00
|
|
|
void modifier_freeTemporaryData(struct ModifierData *md);
|
2005-09-18 15:27:12 +02:00
|
|
|
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
int modifiers_indexInObject(struct Object *ob, struct ModifierData *md);
|
|
|
|
|
2006-12-05 18:42:03 +01:00
|
|
|
/* Calculates and returns a linked list of CustomDataMasks indicating the
|
|
|
|
* data required by each modifier in the stack pointed to by md for correct
|
|
|
|
* evaluation, assuming the data indicated by dataMask is required at the
|
|
|
|
* end of the stack.
|
|
|
|
*/
|
2009-06-15 13:48:42 +02:00
|
|
|
struct LinkNode *modifiers_calcDataMasks(struct Object *ob,
|
|
|
|
struct ModifierData *md,
|
|
|
|
CustomDataMask dataMask,
|
|
|
|
int required_mode);
|
2006-12-23 12:56:22 +01:00
|
|
|
struct ModifierData *modifiers_getVirtualModifierList(struct Object *ob);
|
2005-09-18 15:27:12 +02:00
|
|
|
|
2005-07-19 22:14:17 +02:00
|
|
|
#endif
|
|
|
|
|