tornavis/source/blender/makesdna/DNA_modifier_types.h

793 lines
22 KiB
C
Raw Normal View History

/*
* $Id$
Sorry, three commits in one, became difficult to untangle.. Editors Modules * render/ module added in editors, moved the preview render code there and also shading related operators. * physics/ module made more consistent with other modules. renaming files, making a single physics_ops.c for operators and keymaps. Also move all particle related operators here now. * space_buttons/ now should have only operators relevant to the buttons specificially. Updates & Notifiers * Material/Texture/World/Lamp can now be passed to DAG_id_flush_update, which will go back to a callback in editors. Eventually these should be in the depsgraph itself, but for now this gives a unified call for doing updates. * GLSL materials are now refreshed on changes. There's still various cases missing, * Preview icons now hook into this system, solving various update cases that were missed before. * Also fixes issue in my last commit, where some preview would not render, problem is avoided in the new system. Icon Rendering * On systems with support for non-power of two textures, an OpenGL texture is now used instead of glDrawPixels. This avoids problems with icons get clipped on region borders. On my Linux desktop, this gives an 1.1x speedup, and on my Mac laptop a 2.3x speedup overall in redrawing the full window, with the default setup. The glDrawPixels implementation on Mac seems to have a lot of overhread. * Preview icons are now drawn using proper premul alpha, and never faded so you can see them clearly. * Also tried to fix issue with texture node preview rendering, globals can't be used with threads reliably.
2009-09-29 21:12:12 +02:00
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* 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
* of the License, or (at your option) any later version.
*
* 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,
2010-02-12 14:34:04 +01:00
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Sorry, three commits in one, became difficult to untangle.. Editors Modules * render/ module added in editors, moved the preview render code there and also shading related operators. * physics/ module made more consistent with other modules. renaming files, making a single physics_ops.c for operators and keymaps. Also move all particle related operators here now. * space_buttons/ now should have only operators relevant to the buttons specificially. Updates & Notifiers * Material/Texture/World/Lamp can now be passed to DAG_id_flush_update, which will go back to a callback in editors. Eventually these should be in the depsgraph itself, but for now this gives a unified call for doing updates. * GLSL materials are now refreshed on changes. There's still various cases missing, * Preview icons now hook into this system, solving various update cases that were missed before. * Also fixes issue in my last commit, where some preview would not render, problem is avoided in the new system. Icon Rendering * On systems with support for non-power of two textures, an OpenGL texture is now used instead of glDrawPixels. This avoids problems with icons get clipped on region borders. On my Linux desktop, this gives an 1.1x speedup, and on my Mac laptop a 2.3x speedup overall in redrawing the full window, with the default setup. The glDrawPixels implementation on Mac seems to have a lot of overhread. * Preview icons are now drawn using proper premul alpha, and never faded so you can see them clearly. * Also tried to fix issue with texture node preview rendering, globals can't be used with threads reliably.
2009-09-29 21:12:12 +02:00
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef DNA_MODIFIER_TYPES_H
#define DNA_MODIFIER_TYPES_H
/** \file DNA_modifier_types.h
* \ingroup DNA
*/
#include "DNA_listBase.h"
#define MODSTACK_DEBUG 1
/* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE! */
typedef enum ModifierType {
eModifierType_None = 0,
eModifierType_Subsurf,
eModifierType_Lattice,
eModifierType_Curve,
eModifierType_Build,
eModifierType_Mirror,
eModifierType_Decimate,
eModifierType_Wave,
eModifierType_Armature,
eModifierType_Hook,
eModifierType_Softbody,
eModifierType_Boolean,
eModifierType_Array,
eModifierType_EdgeSplit,
eModifierType_Displace,
eModifierType_UVProject,
eModifierType_Smooth,
eModifierType_Cast,
eModifierType_MeshDeform,
eModifierType_ParticleSystem,
eModifierType_ParticleInstance,
eModifierType_Explode,
eModifierType_Cloth,
eModifierType_Collision,
eModifierType_Bevel,
eModifierType_Shrinkwrap,
eModifierType_Fluidsim,
eModifierType_Mask,
eModifierType_SimpleDeform,
eModifierType_Multires,
eModifierType_Surface,
eModifierType_Smoke,
eModifierType_ShapeKey,
eModifierType_Solidify,
eModifierType_Screw,
eModifierType_Warp,
eModifierType_NgonInterp,
NUM_MODIFIER_TYPES
} ModifierType;
typedef enum ModifierMode {
eModifierMode_Realtime = (1<<0),
eModifierMode_Render = (1<<1),
eModifierMode_Editmode = (1<<2),
eModifierMode_OnCage = (1<<3),
- modifier UI update (aka, find the modifier buttons!!) - moved back to editing buttons, where life is now cramped... switched to constraint style foldout panes, still a WIP. In particular not sure what buttons should be in header (and if current toggles stay in header if they should also be in an expanded pane). Also need new icons for move up/move down (and drag and drop would of course be nice). Finally current plane is to make it so modifiers will expand out in modifier pane for horizontal orientations instead of just going down down down to goblin town. - added error field to modifiers that is displayed in UI, need to have some way for modifiers to return errors back to interface (esp. important for python) - tweaked cage determination and handling, currently the editmode cage is determined by last modifier with OnCage set that is preceeded completely by modifiers that support mapping or are disabled in editmode. it is kinda confusing, but the interface only lets you toggle OnCage for modifiers that support it - it just might not be clear all the time why you can't toggle a certain modifier OnCage. - update displistmesh_copy to only copy edges if non-NULL There is a display bug that already existed but is more obvious with new modifiers where parts of the pane get drawn in a different area after toggling editmode. It has to do with drawing parts of the interface using GL instead of 100% buttons. I try to keep my grubby little toes out of the interface code so this can wait for Ton to return.
2005-08-04 09:25:43 +02:00
eModifierMode_Expanded = (1<<4),
eModifierMode_Virtual = (1<<5),
eModifierMode_ApplyOnSpline = (1<<6),
eModifierMode_DisableTemporary = (1 << 31)
} ModifierMode;
typedef struct ModifierData {
struct ModifierData *next, *prev;
int type, mode;
int stackindex, pad;
char name[32];
/* XXX for timing info set by caller... solve later? (ton) */
struct Scene *scene;
- modifier UI update (aka, find the modifier buttons!!) - moved back to editing buttons, where life is now cramped... switched to constraint style foldout panes, still a WIP. In particular not sure what buttons should be in header (and if current toggles stay in header if they should also be in an expanded pane). Also need new icons for move up/move down (and drag and drop would of course be nice). Finally current plane is to make it so modifiers will expand out in modifier pane for horizontal orientations instead of just going down down down to goblin town. - added error field to modifiers that is displayed in UI, need to have some way for modifiers to return errors back to interface (esp. important for python) - tweaked cage determination and handling, currently the editmode cage is determined by last modifier with OnCage set that is preceeded completely by modifiers that support mapping or are disabled in editmode. it is kinda confusing, but the interface only lets you toggle OnCage for modifiers that support it - it just might not be clear all the time why you can't toggle a certain modifier OnCage. - update displistmesh_copy to only copy edges if non-NULL There is a display bug that already existed but is more obvious with new modifiers where parts of the pane get drawn in a different area after toggling editmode. It has to do with drawing parts of the interface using GL instead of 100% buttons. I try to keep my grubby little toes out of the interface code so this can wait for Ton to return.
2005-08-04 09:25:43 +02:00
char *error;
} ModifierData;
typedef enum {
eSubsurfModifierFlag_Incremental = (1<<0),
eSubsurfModifierFlag_DebugIncr = (1<<1),
eSubsurfModifierFlag_ControlEdges = (1<<2),
eSubsurfModifierFlag_SubsurfUv = (1<<3)
} SubsurfModifierFlag;
/* not a real modifier */
typedef struct MappingInfoModifierData {
ModifierData modifier;
struct Tex *texture;
struct Object *map_object;
char uvlayer_name[32];
int uvlayer_tmp;
int texmapping;
} MappingInfoModifierData;
typedef struct SubsurfModifierData {
ModifierData modifier;
short subdivType, levels, renderLevels, 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
void *emCache, *mCache;
} SubsurfModifierData;
typedef struct LatticeModifierData {
ModifierData modifier;
struct Object *object;
char name[32]; /* optional vertexgroup name */
} LatticeModifierData;
typedef struct CurveModifierData {
ModifierData modifier;
struct Object *object;
char name[32]; /* optional vertexgroup name */
short defaxis; /* axis along which curve deforms */
char pad[6];
} CurveModifierData;
/* CurveModifierData->defaxis */
#define MOD_CURVE_POSX 1
#define MOD_CURVE_POSY 2
#define MOD_CURVE_POSZ 3
#define MOD_CURVE_NEGX 4
#define MOD_CURVE_NEGY 5
#define MOD_CURVE_NEGZ 6
typedef struct BuildModifierData {
ModifierData modifier;
float start, length;
int randomize, seed;
} BuildModifierData;
/* Mask Modifier */
typedef struct MaskModifierData {
ModifierData modifier;
struct Object *ob_arm; /* armature to use to in place of hardcoded vgroup */
char vgroup[32]; /* name of vertex group to use to mask */
int mode; /* using armature or hardcoded vgroup */
int flag; /* flags for various things */
} MaskModifierData;
/* Mask Modifier -> mode */
#define MOD_MASK_MODE_VGROUP 0
#define MOD_MASK_MODE_ARM 1
/* Mask Modifier -> flag */
#define MOD_MASK_INV (1<<0)
typedef struct ArrayModifierData {
ModifierData modifier;
/* the object with which to cap the start of the array */
struct Object *start_cap;
/* the object with which to cap the end of the array */
struct Object *end_cap;
/* the curve object to use for MOD_ARR_FITCURVE */
struct Object *curve_ob;
/* the object to use for object offset */
struct Object *offset_ob;
/* a constant duplicate offset;
1 means the duplicates are 1 unit apart
*/
float offset[3];
/* a scaled factor for duplicate offsets;
1 means the duplicates are 1 object-width apart
*/
float scale[3];
/* the length over which to distribute the duplicates */
float length;
/* the limit below which to merge vertices in adjacent duplicates */
float merge_dist;
/* determines how duplicate count is calculated; one of:
MOD_ARR_FIXEDCOUNT -> fixed
MOD_ARR_FITLENGTH -> calculated to fit a set length
MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
*/
int fit_type;
/* flags specifying how total offset is calculated; binary OR of:
MOD_ARR_OFF_CONST -> total offset += offset
MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
total offset is the sum of the individual enabled offsets
*/
int offset_type;
/* general flags:
MOD_ARR_MERGE -> merge vertices in adjacent duplicates
*/
int flags;
/* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
int count;
} ArrayModifierData;
/* ArrayModifierData->fit_type */
#define MOD_ARR_FIXEDCOUNT 0
#define MOD_ARR_FITLENGTH 1
#define MOD_ARR_FITCURVE 2
/* ArrayModifierData->offset_type */
#define MOD_ARR_OFF_CONST (1<<0)
#define MOD_ARR_OFF_RELATIVE (1<<1)
#define MOD_ARR_OFF_OBJ (1<<2)
/* ArrayModifierData->flags */
#define MOD_ARR_MERGE (1<<0)
#define MOD_ARR_MERGEFINAL (1<<1)
typedef struct MirrorModifierData {
ModifierData modifier;
short axis; /* deprecated, use flag instead */
short flag;
float tolerance;
struct Object *mirror_ob;
} MirrorModifierData;
/* MirrorModifierData->flag */
#define MOD_MIR_CLIPPING (1<<0)
#define MOD_MIR_MIRROR_U (1<<1)
#define MOD_MIR_MIRROR_V (1<<2)
#define MOD_MIR_AXIS_X (1<<3)
#define MOD_MIR_AXIS_Y (1<<4)
#define MOD_MIR_AXIS_Z (1<<5)
#define MOD_MIR_VGROUP (1<<6)
#define MOD_MIR_NO_MERGE (1<<7)
typedef struct EdgeSplitModifierData {
ModifierData modifier;
float split_angle; /* angle above which edges should be split */
int flags;
} EdgeSplitModifierData;
/* EdgeSplitModifierData->flags */
#define MOD_EDGESPLIT_FROMANGLE (1<<1)
#define MOD_EDGESPLIT_FROMFLAG (1<<2)
typedef struct BevelModifierData {
ModifierData modifier;
float value; /* the "raw" bevel value (distance/amount to bevel) */
int res; /* the resolution (as originally coded, it is the number of recursive bevels) */
int pad;
short flags; /* general option flags */
short val_flags; /* flags used to interpret the bevel value */
short lim_flags; /* flags to tell the tool how to limit the bevel */
short e_flags; /* flags to direct how edge weights are applied to verts */
float bevel_angle; /* if the BME_BEVEL_ANGLE is set, this will be how "sharp" an edge must be before it gets beveled */
char defgrp_name[32]; /* if the BME_BEVEL_VWEIGHT option is set, this will be the name of the vert group */
} BevelModifierData;
typedef struct BMeshModifierData {
ModifierData modifier;
float pad;
int type;
} BMeshModifierData;
/* Smoke modifier flags */
#define MOD_SMOKE_TYPE_DOMAIN (1 << 0)
#define MOD_SMOKE_TYPE_FLOW (1 << 1)
#define MOD_SMOKE_TYPE_COLL (1 << 2)
typedef struct SmokeModifierData {
ModifierData modifier;
struct SmokeDomainSettings *domain;
struct SmokeFlowSettings *flow; /* inflow, outflow, smoke objects */
struct SmokeCollSettings *coll; /* collision objects */
float time;
int type; /* domain, inflow, outflow, ... */
} SmokeModifierData;
typedef struct DisplaceModifierData {
ModifierData modifier;
/* keep in sync with MappingInfoModifierData */
struct Tex *texture;
struct Object *map_object;
char uvlayer_name[32];
int uvlayer_tmp;
int texmapping;
int pad10;
/* end MappingInfoModifierData */
float strength;
int direction;
char defgrp_name[32];
float midlevel;
} DisplaceModifierData;
/* DisplaceModifierData->direction */
enum {
MOD_DISP_DIR_X,
MOD_DISP_DIR_Y,
MOD_DISP_DIR_Z,
MOD_DISP_DIR_NOR,
MOD_DISP_DIR_RGB_XYZ,
};
/* DisplaceModifierData->texmapping */
enum {
MOD_DISP_MAP_LOCAL,
MOD_DISP_MAP_GLOBAL,
MOD_DISP_MAP_OBJECT,
MOD_DISP_MAP_UV,
};
typedef struct UVProjectModifierData {
ModifierData modifier;
/* the objects which do the projecting */
struct Object *projectors[10]; /* MOD_UVPROJECT_MAX */
struct Image *image; /* the image to project */
int flags;
int num_projectors;
float aspectx, aspecty;
float scalex, scaley;
char uvlayer_name[32];
int uvlayer_tmp, pad;
} UVProjectModifierData;
#define MOD_UVPROJECT_MAXPROJECTORS 10
/* UVProjectModifierData->flags */
#define MOD_UVPROJECT_OVERRIDEIMAGE (1<<0)
typedef struct DecimateModifierData {
ModifierData modifier;
float percent;
int faceCount;
} DecimateModifierData;
/* Smooth modifier flags */
#define MOD_SMOOTH_X (1<<1)
#define MOD_SMOOTH_Y (1<<2)
#define MOD_SMOOTH_Z (1<<3)
typedef struct SmoothModifierData {
ModifierData modifier;
float fac;
char defgrp_name[32];
short flag, repeat;
} SmoothModifierData;
/* Cast modifier flags */
#define MOD_CAST_X (1<<1)
#define MOD_CAST_Y (1<<2)
#define MOD_CAST_Z (1<<3)
#define MOD_CAST_USE_OB_TRANSFORM (1<<4)
#define MOD_CAST_SIZE_FROM_RADIUS (1<<5)
/* Cast modifier projection types */
#define MOD_CAST_TYPE_SPHERE 0
#define MOD_CAST_TYPE_CYLINDER 1
#define MOD_CAST_TYPE_CUBOID 2
typedef struct CastModifierData {
ModifierData modifier;
struct Object *object;
float fac;
float radius;
float size;
char defgrp_name[32];
short flag, type;
} CastModifierData;
enum {
MOD_WAV_MAP_LOCAL,
MOD_WAV_MAP_GLOBAL,
MOD_WAV_MAP_OBJECT,
MOD_WAV_MAP_UV,
};
/* WaveModifierData.flag */
#define MOD_WAVE_X (1<<1)
#define MOD_WAVE_Y (1<<2)
#define MOD_WAVE_CYCL (1<<3)
#define MOD_WAVE_NORM (1<<4)
#define MOD_WAVE_NORM_X (1<<5)
#define MOD_WAVE_NORM_Y (1<<6)
#define MOD_WAVE_NORM_Z (1<<7)
typedef struct WaveModifierData {
ModifierData modifier;
struct Object *objectcenter;
char defgrp_name[32];
struct Tex *texture;
struct Object *map_object;
short flag, pad;
float startx, starty, height, width;
float narrow, speed, damp, falloff;
int texmapping, uvlayer_tmp;
char uvlayer_name[32];
float timeoffs, lifetime;
float pad1;
} WaveModifierData;
typedef struct ArmatureModifierData {
ModifierData modifier;
short deformflag, multi; /* deformflag replaces armature->deformflag */
int pad2;
struct Object *object;
float *prevCos; /* stored input of previous modifier, for vertexgroup blending */
char defgrp_name[32];
} ArmatureModifierData;
typedef struct HookModifierData {
ModifierData modifier;
struct Object *object;
char subtarget[32]; /* optional name of bone target */
float parentinv[4][4]; /* matrix making current transform unmodified */
float cent[3]; /* visualization of hook */
float falloff; /* if not zero, falloff is distance where influence zero */
int *indexar; /* if NULL, it's using vertexgroup */
int totindex;
float force;
char name[32]; /* optional vertexgroup name */
} HookModifierData;
typedef struct SoftbodyModifierData {
ModifierData modifier;
} SoftbodyModifierData;
typedef struct ClothModifierData {
ModifierData modifier;
struct Scene *scene; /* the context, time etc is here */
struct Cloth *clothObject; /* The internal data structure for cloth. */
struct ClothSimSettings *sim_parms; /* definition is in DNA_cloth_types.h */
struct ClothCollSettings *coll_parms; /* definition is in DNA_cloth_types.h */
struct PointCache *point_cache; /* definition is in DNA_object_force.h */
New point cache file format: - HEADER (beginning of each file) * general header: + 8 char: "BPHYSICS" + 1 int: simulation type (same as PTCacheID->type) * custom header (same for sb, particles and cloth, but can be different for new dynamics) + 1 int: totpoint (number of points) + 1 int: data_types (bit flags for what the stored data is) - DATA (directly after header) *totpoint times the data as specified in data_types flags - simulation type soft body = 0, particles = 1, cloth = 2 - data types (more can be added easily when needed) data flag contains ---------------------------------------- index (1<<0) 1 int (index of current point) location (1<<1) 3 float velocity (1<<2) 3 float rotation (1<<3) 4 float (quaternion) avelocity (1<<4) 3 float (used for particles) xconst (1<<4) 3 float (used for cloth) size (1<<5) 1 float times (1<<6) 3 float (birth, die & lifetime of particle) boids (1<<7) 1 BoidData Notes: - Every frame is not nescessary since data is interpolated for the inbetween frames. - For now every point is needed for every cached frame, the "index" data type is reserved for future usage. - For loading external particle caches only "location" data is necessary, other needed values are determined from the given data. - Non-dynamic data should be written into an info file if external usage is desired. * Info file is named as normal cache files, but with frame number 0; * "Non-dynamic" means data such as particle times. * Written automatically when baking to disk so basically a library of particle simulations should be possible. - Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend. - External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui. Other changes: - Multiple point caches per dynamics system. * In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used. * Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present. - Generalization of point cache baking etc operator & rna code. - Comb brushing particle hair didn't work smoothly.
2009-08-12 11:54:29 +02:00
struct ListBase ptcaches;
} ClothModifierData;
typedef struct CollisionModifierData {
ModifierData modifier;
struct MVert *x; /* position at the beginning of the frame */
struct MVert *xnew; /* position at the end of the frame */
struct MVert *xold; /* unsued atm, but was discussed during sprint */
struct MVert *current_xnew; /* new position at the actual inter-frame step */
struct MVert *current_x; /* position at the actual inter-frame step */
struct MVert *current_v; /* (xnew - x) at the actual inter-frame step */
struct MFace *mfaces; /* object face data */
unsigned int numverts;
unsigned int numfaces;
float time_x, time_xnew; /* cfra time of modifier */
struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */
} CollisionModifierData;
typedef struct SurfaceModifierData {
ModifierData modifier;
Initial code for boids v2 Too many new features to list! But here are the biggies: - Boids can move on air and/or land, or climb a goal object. - Proper interaction with collision objects. * Closest collision object in negative z direction is considered as ground. * Other collision objects are obstacles and boids collide with them. - Boid behavior rules are now added to a dynamic list. * Many new rules and many still not implemented. * Different rule evaluation modes (fuzzy, random, average). - Only particle systems defined by per system "boid relations" are considered for simulation of that system. * This is in addition to the boids own system of course. * Relations define other systems as "neutral", "friend" or "enemy". - All effectors now effect boid physics, not boid brains. * This allows forcing boids somewhere. * Exception to this is new "boid" effector, which defines boid predators (positive strength) and goals (negative strength). Known issue: - Boid health isn't yet stored in pointcache so simulations with "fight" rule are not be read from cache properly. - Object/Group visualization object's animation is not played in "particle time". This is definately the wanted behavior, but isn't possible with the current state of dupliobject code. Other new features: - Particle systems can now be named separately from particle settings. * Default name for particle settings is now "ParticleSettings" instead of "PSys" - Per particle system list of particle effector weights. * Enables different effection strengths for particles from different particle systems with without messing around with effector group setting. Other code changes: - KDTree now supports range search as it's needed for new boids. - "Keyed particle targets" renamed as general "particle targets", as they're needed for boids too. (this might break some files saved with new keyed particles) Bug fixes: - Object & group visualizations didn't work. - Interpolating pointcache didn't do rotation.
2009-07-21 01:52:53 +02:00
struct MVert *x; /* old position */
struct MVert *v; /* velocity */
struct DerivedMesh *dm;
struct BVHTreeFromMesh *bvhtree; /* bounding volume hierarchy of the mesh faces */
Initial code for boids v2 Too many new features to list! But here are the biggies: - Boids can move on air and/or land, or climb a goal object. - Proper interaction with collision objects. * Closest collision object in negative z direction is considered as ground. * Other collision objects are obstacles and boids collide with them. - Boid behavior rules are now added to a dynamic list. * Many new rules and many still not implemented. * Different rule evaluation modes (fuzzy, random, average). - Only particle systems defined by per system "boid relations" are considered for simulation of that system. * This is in addition to the boids own system of course. * Relations define other systems as "neutral", "friend" or "enemy". - All effectors now effect boid physics, not boid brains. * This allows forcing boids somewhere. * Exception to this is new "boid" effector, which defines boid predators (positive strength) and goals (negative strength). Known issue: - Boid health isn't yet stored in pointcache so simulations with "fight" rule are not be read from cache properly. - Object/Group visualization object's animation is not played in "particle time". This is definately the wanted behavior, but isn't possible with the current state of dupliobject code. Other new features: - Particle systems can now be named separately from particle settings. * Default name for particle settings is now "ParticleSettings" instead of "PSys" - Per particle system list of particle effector weights. * Enables different effection strengths for particles from different particle systems with without messing around with effector group setting. Other code changes: - KDTree now supports range search as it's needed for new boids. - "Keyed particle targets" renamed as general "particle targets", as they're needed for boids too. (this might break some files saved with new keyed particles) Bug fixes: - Object & group visualizations didn't work. - Interpolating pointcache didn't do rotation.
2009-07-21 01:52:53 +02:00
int cfra, numverts;
} SurfaceModifierData;
typedef enum {
eBooleanModifierOp_Intersect,
eBooleanModifierOp_Union,
eBooleanModifierOp_Difference,
} BooleanModifierOp;
typedef struct BooleanModifierData {
ModifierData modifier;
struct Object *object;
int operation, pad;
} BooleanModifierData;
#define MOD_MDEF_INVERT_VGROUP (1<<0)
#define MOD_MDEF_DYNAMIC_BIND (1<<1)
#define MOD_MDEF_VOLUME 0
#define MOD_MDEF_SURFACE 1
typedef struct MDefInfluence {
int vertex;
float weight;
} MDefInfluence;
typedef struct MDefCell {
int offset;
int totinfluence;
} MDefCell;
typedef struct MeshDeformModifierData {
ModifierData modifier;
struct Object *object; /* mesh object */
char defgrp_name[32]; /* optional vertexgroup name */
short gridsize, flag, mode, pad;
/* result of static binding */
MDefInfluence *bindinfluences; /* influences */
int *bindoffsets; /* offsets into influences array */
float *bindcagecos; /* coordinates that cage was bound with */
int totvert, totcagevert; /* total vertices in mesh and cage */
/* result of dynamic binding */
MDefCell *dyngrid; /* grid with dynamic binding cell points */
MDefInfluence *dyninfluences; /* dynamic binding vertex influences */
int *dynverts, *pad2; /* is this vertex bound or not? */
int dyngridsize; /* size of the dynamic bind grid */
int totinfluence; /* total number of vertex influences */
float dyncellmin[3]; /* offset of the dynamic bind grid */
float dyncellwidth; /* width of dynamic bind cell */
float bindmat[4][4]; /* matrix of cage at binding time */
/* deprecated storage */
float *bindweights; /* deprecated inefficient storage */
float *bindcos; /* deprecated storage of cage coords */
/* runtime */
void (*bindfunc)(struct Scene *scene,
struct MeshDeformModifierData *mmd,
float *vertexcos, int totvert, float cagemat[][4]);
} MeshDeformModifierData;
typedef enum {
eParticleSystemFlag_Pars = (1<<0),
eParticleSystemFlag_psys_updated = (1<<1),
eParticleSystemFlag_file_loaded = (1<<2),
} ParticleSystemModifierFlag;
typedef struct ParticleSystemModifierData {
ModifierData modifier;
struct ParticleSystem *psys;
struct DerivedMesh *dm;
int totdmvert, totdmedge, totdmface;
short flag, rt;
} ParticleSystemModifierData;
typedef enum {
eParticleInstanceFlag_Parents = (1<<0),
eParticleInstanceFlag_Children = (1<<1),
eParticleInstanceFlag_Path = (1<<2),
eParticleInstanceFlag_Unborn = (1<<3),
eParticleInstanceFlag_Alive = (1<<4),
eParticleInstanceFlag_Dead = (1<<5),
A bunch of fun stuff now possible because of new pointcache code: * Baked normal particles can now use the "Path" visualization. * Path "max length" & "abs length" are now history: - New option to set path start & end times + random variation to length. - Much more flexible (and calculated better) than previous options. - This works with parents, children, hair & normal particles unlike old length option. - Only known issue for now is that children from faces don't get calculated correctly when using path start time. * New option "trails" for "halo", "line" and "billboard" visualizations: - Draws user controllable number of particle instances along particles path backwards from current position. - Works with children too for cool/weird visualizations that weren't possible before. * Normal particle children's velocities are now approximated better when needed so that "line" visualization trails will look nice. * New particle instance modifier options: - "path"-option works better and has controllable (max)position along path (with random variation possible). - "keep shape"-option for hair, keyed, or baked particles allows to place the instances to a single point (with random variation possible) along particle path. - "axis" option to make rotation handling better (still not perfect, but will have to do for now). Some fixes & cleanup done along the way: * Random path length didn't work for non-child particles. * Cached & unborn particles weren't reset to emit locations. * Particle numbers weren't drawn in the correct place. * Setting proper render & draw visualizations was lost somewhere when initializing new particle settings. * Changing child mode wasn't working correctly. * Some cleanup & modularization of particle child effector code and particle drawing & rendering code. * Object & group visualizations didn't work. * Child simplification didn't work.
2009-07-04 05:50:12 +02:00
eParticleInstanceFlag_KeepShape = (1<<6),
eParticleInstanceFlag_UseSize = (1<<7),
} ParticleInstanceModifierFlag;
typedef struct ParticleInstanceModifierData {
ModifierData modifier;
struct Object *ob;
A bunch of fun stuff now possible because of new pointcache code: * Baked normal particles can now use the "Path" visualization. * Path "max length" & "abs length" are now history: - New option to set path start & end times + random variation to length. - Much more flexible (and calculated better) than previous options. - This works with parents, children, hair & normal particles unlike old length option. - Only known issue for now is that children from faces don't get calculated correctly when using path start time. * New option "trails" for "halo", "line" and "billboard" visualizations: - Draws user controllable number of particle instances along particles path backwards from current position. - Works with children too for cool/weird visualizations that weren't possible before. * Normal particle children's velocities are now approximated better when needed so that "line" visualization trails will look nice. * New particle instance modifier options: - "path"-option works better and has controllable (max)position along path (with random variation possible). - "keep shape"-option for hair, keyed, or baked particles allows to place the instances to a single point (with random variation possible) along particle path. - "axis" option to make rotation handling better (still not perfect, but will have to do for now). Some fixes & cleanup done along the way: * Random path length didn't work for non-child particles. * Cached & unborn particles weren't reset to emit locations. * Particle numbers weren't drawn in the correct place. * Setting proper render & draw visualizations was lost somewhere when initializing new particle settings. * Changing child mode wasn't working correctly. * Some cleanup & modularization of particle child effector code and particle drawing & rendering code. * Object & group visualizations didn't work. * Child simplification didn't work.
2009-07-04 05:50:12 +02:00
short psys, flag, axis, rt;
float position, random_position;
} ParticleInstanceModifierData;
typedef enum {
eExplodeFlag_CalcFaces = (1<<0),
eExplodeFlag_PaSize = (1<<1),
eExplodeFlag_EdgeCut = (1<<2),
eExplodeFlag_Unborn = (1<<3),
eExplodeFlag_Alive = (1<<4),
eExplodeFlag_Dead = (1<<5),
} ExplodeModifierFlag;
typedef struct ExplodeModifierData {
ModifierData modifier;
int *facepa;
short flag, vgroup;
float protect;
char uvname[32];
} ExplodeModifierData;
typedef struct MultiresModifierData {
ModifierData modifier;
char lvl, sculptlvl, renderlvl, totlvl;
char simple, flags, pad[2];
} MultiresModifierData;
typedef enum {
eMultiresModifierFlag_ControlEdges = (1<<0),
} MultiresModifierFlag;
typedef struct FluidsimModifierData {
ModifierData modifier;
2010-04-25 17:24:18 +02:00
struct FluidsimSettings *fss; /* definition is in DNA_object_fluidsim.h */
struct PointCache *point_cache; /* definition is in DNA_object_force.h */
} FluidsimModifierData;
typedef struct ShrinkwrapModifierData {
ModifierData modifier;
struct Object *target; /* shrink target */
struct Object *auxTarget; /* additional shrink target */
char vgroup_name[32]; /* optional vertexgroup name */
float keepDist; /* distance offset to keep from mesh/projection point */
short shrinkType; /* shrink type projection */
short shrinkOpts; /* shrink options */
char projAxis; /* axis to project over */
/*
* if using projection over vertex normal this controls the
* the level of subsurface that must be done before getting the
* vertex coordinates and normal
*/
char subsurfLevels;
char pad[6];
} ShrinkwrapModifierData;
/* Shrinkwrap->shrinkType */
#define MOD_SHRINKWRAP_NEAREST_SURFACE 0
#define MOD_SHRINKWRAP_PROJECT 1
#define MOD_SHRINKWRAP_NEAREST_VERTEX 2
/* Shrinkwrap->shrinkOpts */
#define MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR (1<<0) /* allow shrinkwrap to move the vertex in the positive direction of axis */
#define MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR (1<<1) /* allow shrinkwrap to move the vertex in the negative direction of axis */
#define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) /* ignore vertex moves if a vertex ends projected on a front face of the target */
#define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) /* ignore vertex moves if a vertex ends projected on a back face of the target */
#define MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */
#define MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS (1<<0)
#define MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS (1<<1)
#define MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS (1<<2)
#define MOD_SHRINKWRAP_PROJECT_OVER_NORMAL 0 /* projection over normal is used if no axis is selected */
typedef struct SimpleDeformModifierData {
ModifierData modifier;
struct Object *origin; /* object to control the origin of modifier space coordinates */
char vgroup_name[32]; /* optional vertexgroup name */
float factor; /* factors to control simple deforms */
float limit[2]; /* lower and upper limit */
char mode; /* deform function */
char axis; /* lock axis (for taper and strech) */
char originOpts; /* originOptions */
char pad;
} SimpleDeformModifierData;
#define MOD_SIMPLEDEFORM_MODE_TWIST 1
#define MOD_SIMPLEDEFORM_MODE_BEND 2
#define MOD_SIMPLEDEFORM_MODE_TAPER 3
#define MOD_SIMPLEDEFORM_MODE_STRETCH 4
#define MOD_SIMPLEDEFORM_LOCK_AXIS_X (1<<0)
#define MOD_SIMPLEDEFORM_LOCK_AXIS_Y (1<<1)
/* indicates whether simple deform should use the local
coordinates or global coordinates of origin */
#define MOD_SIMPLEDEFORM_ORIGIN_LOCAL (1<<0)
#define MOD_UVPROJECT_MAX 10
typedef struct ShapeKeyModifierData {
ModifierData modifier;
} ShapeKeyModifierData;
typedef struct SolidifyModifierData {
ModifierData modifier;
char defgrp_name[32]; /* name of vertex group to use */
float offset; /* new surface offset level*/
float offset_fac; /* midpoint of the offset */
float crease_inner;
float crease_outer;
float crease_rim;
int flag;
short mat_ofs;
short mat_ofs_rim;
int pad;
} SolidifyModifierData;
#define MOD_SOLIDIFY_RIM (1<<0)
#define MOD_SOLIDIFY_EVEN (1<<1)
#define MOD_SOLIDIFY_NORMAL_CALC (1<<2)
#define MOD_SOLIDIFY_VGROUP_INV (1<<3)
#define MOD_SOLIDIFY_RIM_MATERIAL (1<<4) /* deprecated, used in do_versions */
typedef struct ScrewModifierData {
ModifierData modifier;
struct Object *ob_axis;
int steps;
int render_steps;
int iter;
float screw_ofs;
float angle;
short axis;
short flag;
} ScrewModifierData;
#define MOD_SCREW_NORMAL_FLIP (1<<0)
#define MOD_SCREW_NORMAL_CALC (1<<1)
#define MOD_SCREW_OBJECT_OFFSET (1<<2)
// #define MOD_SCREW_OBJECT_ANGLE (1<<4)
typedef struct NgonInterpModifierData {
ModifierData modifier;
int resolution, pad0;
} NgonInterpModifierData;
2011-05-09 01:43:18 +02:00
typedef struct WarpModifierData {
ModifierData modifier;
/* keep in sync with MappingInfoModifierData */
struct Tex *texture;
struct Object *map_object;
char uvlayer_name[32];
int uvlayer_tmp;
int texmapping;
int pad10;
/* end MappingInfoModifierData */
float strength;
struct Object *object_from;
struct Object *object_to;
struct CurveMapping *curfalloff;
char defgrp_name[32]; /* optional vertexgroup name */
float falloff_radius;
char flag; /* not used yet */
char falloff_type;
char pad[2];
} WarpModifierData;
#define MOD_WARP_VOLUME_PRESERVE 1
typedef enum {
eWarp_Falloff_None = 0,
eWarp_Falloff_Curve = 1,
eWarp_Falloff_Sharp = 2, /* PROP_SHARP */
eWarp_Falloff_Smooth = 3, /* PROP_SMOOTH */
eWarp_Falloff_Root = 4, /* PROP_ROOT */
eWarp_Falloff_Linear = 5, /* PROP_LIN */
eWarp_Falloff_Const = 6, /* PROP_CONST */
eWarp_Falloff_Sphere = 7, /* PROP_SPHERE */
/* PROP_RANDOM not used */
} WarpModifierFalloff;
#endif