Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * ***** END GPL LICENSE BLOCK ***** 00019 */ 00020 00025 #ifndef DNA_MODIFIER_TYPES_H 00026 #define DNA_MODIFIER_TYPES_H 00027 00028 #include "DNA_defs.h" 00029 #include "DNA_listBase.h" 00030 00031 00032 #define MODSTACK_DEBUG 1 00033 00034 /* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE! 00035 * (ONLY ADD NEW ITEMS AT THE END) */ 00036 00037 typedef enum ModifierType { 00038 eModifierType_None = 0, 00039 eModifierType_Subsurf, 00040 eModifierType_Lattice, 00041 eModifierType_Curve, 00042 eModifierType_Build, 00043 eModifierType_Mirror, 00044 eModifierType_Decimate, 00045 eModifierType_Wave, 00046 eModifierType_Armature, 00047 eModifierType_Hook, 00048 eModifierType_Softbody, 00049 eModifierType_Boolean, 00050 eModifierType_Array, 00051 eModifierType_EdgeSplit, 00052 eModifierType_Displace, 00053 eModifierType_UVProject, 00054 eModifierType_Smooth, 00055 eModifierType_Cast, 00056 eModifierType_MeshDeform, 00057 eModifierType_ParticleSystem, 00058 eModifierType_ParticleInstance, 00059 eModifierType_Explode, 00060 eModifierType_Cloth, 00061 eModifierType_Collision, 00062 eModifierType_Bevel, 00063 eModifierType_Shrinkwrap, 00064 eModifierType_Fluidsim, 00065 eModifierType_Mask, 00066 eModifierType_SimpleDeform, 00067 eModifierType_Multires, 00068 eModifierType_Surface, 00069 eModifierType_Smoke, 00070 eModifierType_ShapeKey, 00071 eModifierType_Solidify, 00072 eModifierType_Screw, 00073 eModifierType_Warp, 00074 eModifierType_WeightVGEdit, 00075 eModifierType_WeightVGMix, 00076 eModifierType_WeightVGProximity, 00077 eModifierType_Ocean, 00078 eModifierType_DynamicPaint, 00079 eModifierType_Remesh, 00080 NUM_MODIFIER_TYPES 00081 } ModifierType; 00082 00083 typedef enum ModifierMode { 00084 eModifierMode_Realtime = (1<<0), 00085 eModifierMode_Render = (1<<1), 00086 eModifierMode_Editmode = (1<<2), 00087 eModifierMode_OnCage = (1<<3), 00088 eModifierMode_Expanded = (1<<4), 00089 eModifierMode_Virtual = (1<<5), 00090 eModifierMode_ApplyOnSpline = (1<<6), 00091 eModifierMode_DisableTemporary = (1 << 31) 00092 } ModifierMode; 00093 00094 typedef struct ModifierData { 00095 struct ModifierData *next, *prev; 00096 00097 int type, mode; 00098 int stackindex, pad; 00099 char name[64]; /* MAX_NAME */ 00100 00101 /* XXX for timing info set by caller... solve later? (ton) */ 00102 struct Scene *scene; 00103 00104 char *error; 00105 } ModifierData; 00106 00107 typedef enum { 00108 eSubsurfModifierFlag_Incremental = (1<<0), 00109 eSubsurfModifierFlag_DebugIncr = (1<<1), 00110 eSubsurfModifierFlag_ControlEdges = (1<<2), 00111 eSubsurfModifierFlag_SubsurfUv = (1<<3) 00112 } SubsurfModifierFlag; 00113 00114 /* not a real modifier */ 00115 typedef struct MappingInfoModifierData { 00116 ModifierData modifier; 00117 00118 struct Tex *texture; 00119 struct Object *map_object; 00120 char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00121 int uvlayer_tmp; 00122 int texmapping; 00123 } MappingInfoModifierData; 00124 00125 typedef struct SubsurfModifierData { 00126 ModifierData modifier; 00127 00128 short subdivType, levels, renderLevels, flags; 00129 00130 void *emCache, *mCache; 00131 } SubsurfModifierData; 00132 00133 typedef struct LatticeModifierData { 00134 ModifierData modifier; 00135 00136 struct Object *object; 00137 char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ 00138 } LatticeModifierData; 00139 00140 typedef struct CurveModifierData { 00141 ModifierData modifier; 00142 00143 struct Object *object; 00144 char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ 00145 short defaxis; /* axis along which curve deforms */ 00146 char pad[6]; 00147 } CurveModifierData; 00148 00149 /* CurveModifierData->defaxis */ 00150 #define MOD_CURVE_POSX 1 00151 #define MOD_CURVE_POSY 2 00152 #define MOD_CURVE_POSZ 3 00153 #define MOD_CURVE_NEGX 4 00154 #define MOD_CURVE_NEGY 5 00155 #define MOD_CURVE_NEGZ 6 00156 00157 typedef struct BuildModifierData { 00158 ModifierData modifier; 00159 00160 float start, length; 00161 int randomize, seed; 00162 } BuildModifierData; 00163 00164 /* Mask Modifier */ 00165 typedef struct MaskModifierData { 00166 ModifierData modifier; 00167 00168 struct Object *ob_arm; /* armature to use to in place of hardcoded vgroup */ 00169 char vgroup[64]; /* name of vertex group to use to mask, MAX_VGROUP_NAME */ 00170 00171 int mode; /* using armature or hardcoded vgroup */ 00172 int flag; /* flags for various things */ 00173 } MaskModifierData; 00174 00175 /* Mask Modifier -> mode */ 00176 #define MOD_MASK_MODE_VGROUP 0 00177 #define MOD_MASK_MODE_ARM 1 00178 00179 /* Mask Modifier -> flag */ 00180 #define MOD_MASK_INV (1<<0) 00181 00182 typedef struct ArrayModifierData { 00183 ModifierData modifier; 00184 00185 /* the object with which to cap the start of the array */ 00186 struct Object *start_cap; 00187 /* the object with which to cap the end of the array */ 00188 struct Object *end_cap; 00189 /* the curve object to use for MOD_ARR_FITCURVE */ 00190 struct Object *curve_ob; 00191 /* the object to use for object offset */ 00192 struct Object *offset_ob; 00193 /* a constant duplicate offset; 00194 1 means the duplicates are 1 unit apart 00195 */ 00196 float offset[3]; 00197 /* a scaled factor for duplicate offsets; 00198 1 means the duplicates are 1 object-width apart 00199 */ 00200 float scale[3]; 00201 /* the length over which to distribute the duplicates */ 00202 float length; 00203 /* the limit below which to merge vertices in adjacent duplicates */ 00204 float merge_dist; 00205 /* determines how duplicate count is calculated; one of: 00206 MOD_ARR_FIXEDCOUNT -> fixed 00207 MOD_ARR_FITLENGTH -> calculated to fit a set length 00208 MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object 00209 */ 00210 int fit_type; 00211 /* flags specifying how total offset is calculated; binary OR of: 00212 MOD_ARR_OFF_CONST -> total offset += offset 00213 MOD_ARR_OFF_RELATIVE -> total offset += relative * object width 00214 MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix 00215 total offset is the sum of the individual enabled offsets 00216 */ 00217 int offset_type; 00218 /* general flags: 00219 MOD_ARR_MERGE -> merge vertices in adjacent duplicates 00220 */ 00221 int flags; 00222 /* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */ 00223 int count; 00224 } ArrayModifierData; 00225 00226 /* ArrayModifierData->fit_type */ 00227 #define MOD_ARR_FIXEDCOUNT 0 00228 #define MOD_ARR_FITLENGTH 1 00229 #define MOD_ARR_FITCURVE 2 00230 00231 /* ArrayModifierData->offset_type */ 00232 #define MOD_ARR_OFF_CONST (1<<0) 00233 #define MOD_ARR_OFF_RELATIVE (1<<1) 00234 #define MOD_ARR_OFF_OBJ (1<<2) 00235 00236 /* ArrayModifierData->flags */ 00237 #define MOD_ARR_MERGE (1<<0) 00238 #define MOD_ARR_MERGEFINAL (1<<1) 00239 00240 typedef struct MirrorModifierData { 00241 ModifierData modifier; 00242 00243 short axis DNA_DEPRECATED; /* deprecated, use flag instead */ 00244 short flag; 00245 float tolerance; 00246 struct Object *mirror_ob; 00247 } MirrorModifierData; 00248 00249 /* MirrorModifierData->flag */ 00250 #define MOD_MIR_CLIPPING (1<<0) 00251 #define MOD_MIR_MIRROR_U (1<<1) 00252 #define MOD_MIR_MIRROR_V (1<<2) 00253 #define MOD_MIR_AXIS_X (1<<3) 00254 #define MOD_MIR_AXIS_Y (1<<4) 00255 #define MOD_MIR_AXIS_Z (1<<5) 00256 #define MOD_MIR_VGROUP (1<<6) 00257 #define MOD_MIR_NO_MERGE (1<<7) 00258 00259 typedef struct EdgeSplitModifierData { 00260 ModifierData modifier; 00261 00262 float split_angle; /* angle above which edges should be split */ 00263 int flags; 00264 } EdgeSplitModifierData; 00265 00266 /* EdgeSplitModifierData->flags */ 00267 #define MOD_EDGESPLIT_FROMANGLE (1<<1) 00268 #define MOD_EDGESPLIT_FROMFLAG (1<<2) 00269 00270 typedef struct BevelModifierData { 00271 ModifierData modifier; 00272 00273 float value; /* the "raw" bevel value (distance/amount to bevel) */ 00274 int res; /* the resolution (as originally coded, it is the number of recursive bevels) */ 00275 int pad; 00276 short flags; /* general option flags */ 00277 short val_flags; /* flags used to interpret the bevel value */ 00278 short lim_flags; /* flags to tell the tool how to limit the bevel */ 00279 short e_flags; /* flags to direct how edge weights are applied to verts */ 00280 float bevel_angle; /* if the BME_BEVEL_ANGLE is set, this will be how "sharp" an edge must be before it gets beveled */ 00281 char defgrp_name[64]; /* if the BME_BEVEL_VWEIGHT option is set, this will be the name of the vert group, MAX_VGROUP_NAME */ 00282 } BevelModifierData; 00283 00284 typedef struct BMeshModifierData { 00285 ModifierData modifier; 00286 00287 float pad; 00288 int type; 00289 } BMeshModifierData; 00290 00291 00292 /* Smoke modifier flags */ 00293 #define MOD_SMOKE_TYPE_DOMAIN (1 << 0) 00294 #define MOD_SMOKE_TYPE_FLOW (1 << 1) 00295 #define MOD_SMOKE_TYPE_COLL (1 << 2) 00296 00297 typedef struct SmokeModifierData { 00298 ModifierData modifier; 00299 00300 struct SmokeDomainSettings *domain; 00301 struct SmokeFlowSettings *flow; /* inflow, outflow, smoke objects */ 00302 struct SmokeCollSettings *coll; /* collision objects */ 00303 float time; 00304 int type; /* domain, inflow, outflow, ... */ 00305 } SmokeModifierData; 00306 00307 typedef struct DisplaceModifierData { 00308 ModifierData modifier; 00309 00310 /* keep in sync with MappingInfoModifierData */ 00311 struct Tex *texture; 00312 struct Object *map_object; 00313 char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00314 int uvlayer_tmp; 00315 int texmapping; 00316 /* end MappingInfoModifierData */ 00317 00318 float strength; 00319 int direction; 00320 char defgrp_name[64]; /* MAX_VGROUP_NAME */ 00321 float midlevel; 00322 int pad; 00323 } DisplaceModifierData; 00324 00325 /* DisplaceModifierData->direction */ 00326 enum { 00327 MOD_DISP_DIR_X, 00328 MOD_DISP_DIR_Y, 00329 MOD_DISP_DIR_Z, 00330 MOD_DISP_DIR_NOR, 00331 MOD_DISP_DIR_RGB_XYZ, 00332 }; 00333 00334 /* DisplaceModifierData->texmapping */ 00335 enum { 00336 MOD_DISP_MAP_LOCAL, 00337 MOD_DISP_MAP_GLOBAL, 00338 MOD_DISP_MAP_OBJECT, 00339 MOD_DISP_MAP_UV 00340 }; 00341 00342 typedef struct UVProjectModifierData { 00343 ModifierData modifier; 00344 00345 /* the objects which do the projecting */ 00346 struct Object *projectors[10]; /* MOD_UVPROJECT_MAX */ 00347 struct Image *image; /* the image to project */ 00348 int flags; 00349 int num_projectors; 00350 float aspectx, aspecty; 00351 float scalex, scaley; 00352 char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00353 int uvlayer_tmp, pad; 00354 } UVProjectModifierData; 00355 00356 #define MOD_UVPROJECT_MAXPROJECTORS 10 00357 00358 /* UVProjectModifierData->flags */ 00359 #define MOD_UVPROJECT_OVERRIDEIMAGE (1<<0) 00360 00361 typedef struct DecimateModifierData { 00362 ModifierData modifier; 00363 00364 float percent; 00365 int faceCount; 00366 } DecimateModifierData; 00367 00368 /* Smooth modifier flags */ 00369 #define MOD_SMOOTH_X (1<<1) 00370 #define MOD_SMOOTH_Y (1<<2) 00371 #define MOD_SMOOTH_Z (1<<3) 00372 00373 typedef struct SmoothModifierData { 00374 ModifierData modifier; 00375 float fac; 00376 char defgrp_name[64]; /* MAX_VGROUP_NAME */ 00377 short flag, repeat; 00378 00379 } SmoothModifierData; 00380 00381 /* Cast modifier flags */ 00382 #define MOD_CAST_X (1<<1) 00383 #define MOD_CAST_Y (1<<2) 00384 #define MOD_CAST_Z (1<<3) 00385 #define MOD_CAST_USE_OB_TRANSFORM (1<<4) 00386 #define MOD_CAST_SIZE_FROM_RADIUS (1<<5) 00387 00388 /* Cast modifier projection types */ 00389 #define MOD_CAST_TYPE_SPHERE 0 00390 #define MOD_CAST_TYPE_CYLINDER 1 00391 #define MOD_CAST_TYPE_CUBOID 2 00392 00393 typedef struct CastModifierData { 00394 ModifierData modifier; 00395 00396 struct Object *object; 00397 float fac; 00398 float radius; 00399 float size; 00400 char defgrp_name[64]; /* MAX_VGROUP_NAME */ 00401 short flag, type; 00402 } CastModifierData; 00403 00404 /* WaveModifierData.flag */ 00405 #define MOD_WAVE_X (1<<1) 00406 #define MOD_WAVE_Y (1<<2) 00407 #define MOD_WAVE_CYCL (1<<3) 00408 #define MOD_WAVE_NORM (1<<4) 00409 #define MOD_WAVE_NORM_X (1<<5) 00410 #define MOD_WAVE_NORM_Y (1<<6) 00411 #define MOD_WAVE_NORM_Z (1<<7) 00412 00413 typedef struct WaveModifierData { 00414 ModifierData modifier; 00415 00416 /* keep in sync with MappingInfoModifierData */ 00417 struct Tex *texture; 00418 struct Object *map_object; 00419 char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00420 int uvlayer_tmp; 00421 int texmapping; 00422 /* end MappingInfoModifierData */ 00423 00424 struct Object *objectcenter; 00425 char defgrp_name[64]; /* MAX_VGROUP_NAME */ 00426 00427 short flag, pad; 00428 00429 float startx, starty, height, width; 00430 float narrow, speed, damp, falloff; 00431 00432 float timeoffs, lifetime; 00433 float pad1; 00434 } WaveModifierData; 00435 00436 typedef struct ArmatureModifierData { 00437 ModifierData modifier; 00438 00439 short deformflag, multi; /* deformflag replaces armature->deformflag */ 00440 int pad2; 00441 struct Object *object; 00442 float *prevCos; /* stored input of previous modifier, for vertexgroup blending */ 00443 char defgrp_name[64]; /* MAX_VGROUP_NAME */ 00444 } ArmatureModifierData; 00445 00446 typedef struct HookModifierData { 00447 ModifierData modifier; 00448 00449 struct Object *object; 00450 char subtarget[64]; /* optional name of bone target, MAX_ID_NAME-2 */ 00451 00452 float parentinv[4][4]; /* matrix making current transform unmodified */ 00453 float cent[3]; /* visualization of hook */ 00454 float falloff; /* if not zero, falloff is distance where influence zero */ 00455 00456 int *indexar; /* if NULL, it's using vertexgroup */ 00457 int totindex; 00458 float force; 00459 char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ 00460 } HookModifierData; 00461 00462 typedef struct SoftbodyModifierData { 00463 ModifierData modifier; 00464 } SoftbodyModifierData; 00465 00466 typedef struct ClothModifierData { 00467 ModifierData modifier; 00468 00469 struct Scene *scene; /* the context, time etc is here */ 00470 struct Cloth *clothObject; /* The internal data structure for cloth. */ 00471 struct ClothSimSettings *sim_parms; /* definition is in DNA_cloth_types.h */ 00472 struct ClothCollSettings *coll_parms; /* definition is in DNA_cloth_types.h */ 00473 struct PointCache *point_cache; /* definition is in DNA_object_force.h */ 00474 struct ListBase ptcaches; 00475 } ClothModifierData; 00476 00477 typedef struct CollisionModifierData { 00478 ModifierData modifier; 00479 00480 struct MVert *x; /* position at the beginning of the frame */ 00481 struct MVert *xnew; /* position at the end of the frame */ 00482 struct MVert *xold; /* unsued atm, but was discussed during sprint */ 00483 struct MVert *current_xnew; /* new position at the actual inter-frame step */ 00484 struct MVert *current_x; /* position at the actual inter-frame step */ 00485 struct MVert *current_v; /* (xnew - x) at the actual inter-frame step */ 00486 00487 struct MFace *mfaces; /* object face data */ 00488 00489 unsigned int numverts; 00490 unsigned int numfaces; 00491 float time_x, time_xnew; /* cfra time of modifier */ 00492 struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */ 00493 } CollisionModifierData; 00494 00495 typedef struct SurfaceModifierData { 00496 ModifierData modifier; 00497 00498 struct MVert *x; /* old position */ 00499 struct MVert *v; /* velocity */ 00500 00501 struct DerivedMesh *dm; 00502 00503 struct BVHTreeFromMesh *bvhtree; /* bounding volume hierarchy of the mesh faces */ 00504 00505 int cfra, numverts; 00506 } SurfaceModifierData; 00507 00508 typedef enum { 00509 eBooleanModifierOp_Intersect, 00510 eBooleanModifierOp_Union, 00511 eBooleanModifierOp_Difference, 00512 } BooleanModifierOp; 00513 typedef struct BooleanModifierData { 00514 ModifierData modifier; 00515 00516 struct Object *object; 00517 int operation, pad; 00518 } BooleanModifierData; 00519 00520 #define MOD_MDEF_INVERT_VGROUP (1<<0) 00521 #define MOD_MDEF_DYNAMIC_BIND (1<<1) 00522 00523 #define MOD_MDEF_VOLUME 0 00524 #define MOD_MDEF_SURFACE 1 00525 00526 typedef struct MDefInfluence { 00527 int vertex; 00528 float weight; 00529 } MDefInfluence; 00530 00531 typedef struct MDefCell { 00532 int offset; 00533 int totinfluence; 00534 } MDefCell; 00535 00536 typedef struct MeshDeformModifierData { 00537 ModifierData modifier; 00538 00539 struct Object *object; /* mesh object */ 00540 char defgrp_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ 00541 00542 short gridsize, flag, mode, pad; 00543 00544 /* result of static binding */ 00545 MDefInfluence *bindinfluences; /* influences */ 00546 int *bindoffsets; /* offsets into influences array */ 00547 float *bindcagecos; /* coordinates that cage was bound with */ 00548 int totvert, totcagevert; /* total vertices in mesh and cage */ 00549 00550 /* result of dynamic binding */ 00551 MDefCell *dyngrid; /* grid with dynamic binding cell points */ 00552 MDefInfluence *dyninfluences; /* dynamic binding vertex influences */ 00553 int *dynverts, *pad2; /* is this vertex bound or not? */ 00554 int dyngridsize; /* size of the dynamic bind grid */ 00555 int totinfluence; /* total number of vertex influences */ 00556 float dyncellmin[3]; /* offset of the dynamic bind grid */ 00557 float dyncellwidth; /* width of dynamic bind cell */ 00558 float bindmat[4][4]; /* matrix of cage at binding time */ 00559 00560 /* deprecated storage */ 00561 float *bindweights; /* deprecated inefficient storage */ 00562 float *bindcos; /* deprecated storage of cage coords */ 00563 00564 /* runtime */ 00565 void (*bindfunc)(struct Scene *scene, 00566 struct MeshDeformModifierData *mmd, 00567 float *vertexcos, int totvert, float cagemat[][4]); 00568 } MeshDeformModifierData; 00569 00570 typedef enum { 00571 eParticleSystemFlag_Pars = (1<<0), 00572 eParticleSystemFlag_psys_updated = (1<<1), 00573 eParticleSystemFlag_file_loaded = (1<<2), 00574 } ParticleSystemModifierFlag; 00575 00576 typedef struct ParticleSystemModifierData { 00577 ModifierData modifier; 00578 struct ParticleSystem *psys; 00579 struct DerivedMesh *dm; 00580 int totdmvert, totdmedge, totdmface; 00581 short flag, rt; 00582 } ParticleSystemModifierData; 00583 00584 typedef enum { 00585 eParticleInstanceFlag_Parents = (1<<0), 00586 eParticleInstanceFlag_Children = (1<<1), 00587 eParticleInstanceFlag_Path = (1<<2), 00588 eParticleInstanceFlag_Unborn = (1<<3), 00589 eParticleInstanceFlag_Alive = (1<<4), 00590 eParticleInstanceFlag_Dead = (1<<5), 00591 eParticleInstanceFlag_KeepShape = (1<<6), 00592 eParticleInstanceFlag_UseSize = (1<<7), 00593 } ParticleInstanceModifierFlag; 00594 00595 typedef struct ParticleInstanceModifierData { 00596 ModifierData modifier; 00597 struct Object *ob; 00598 short psys, flag, axis, rt; 00599 float position, random_position; 00600 } ParticleInstanceModifierData; 00601 00602 typedef enum { 00603 eExplodeFlag_CalcFaces = (1<<0), 00604 eExplodeFlag_PaSize = (1<<1), 00605 eExplodeFlag_EdgeCut = (1<<2), 00606 eExplodeFlag_Unborn = (1<<3), 00607 eExplodeFlag_Alive = (1<<4), 00608 eExplodeFlag_Dead = (1<<5), 00609 } ExplodeModifierFlag; 00610 00611 typedef struct ExplodeModifierData { 00612 ModifierData modifier; 00613 int *facepa; 00614 short flag, vgroup; 00615 float protect; 00616 char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00617 } ExplodeModifierData; 00618 00619 typedef struct MultiresModifierData { 00620 ModifierData modifier; 00621 00622 char lvl, sculptlvl, renderlvl, totlvl; 00623 char simple, flags, pad[2]; 00624 } MultiresModifierData; 00625 00626 typedef enum { 00627 eMultiresModifierFlag_ControlEdges = (1<<0), 00628 eMultiresModifierFlag_PlainUv = (1<<1), 00629 } MultiresModifierFlag; 00630 00631 typedef struct FluidsimModifierData { 00632 ModifierData modifier; 00633 00634 struct FluidsimSettings *fss; /* definition is in DNA_object_fluidsim.h */ 00635 struct PointCache *point_cache; /* definition is in DNA_object_force.h */ 00636 } FluidsimModifierData; 00637 00638 typedef struct ShrinkwrapModifierData { 00639 ModifierData modifier; 00640 00641 struct Object *target; /* shrink target */ 00642 struct Object *auxTarget; /* additional shrink target */ 00643 char vgroup_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ 00644 float keepDist; /* distance offset to keep from mesh/projection point */ 00645 short shrinkType; /* shrink type projection */ 00646 short shrinkOpts; /* shrink options */ 00647 char projAxis; /* axis to project over */ 00648 00649 /* 00650 * if using projection over vertex normal this controls the 00651 * the level of subsurface that must be done before getting the 00652 * vertex coordinates and normal 00653 */ 00654 char subsurfLevels; 00655 00656 char pad[6]; 00657 00658 } ShrinkwrapModifierData; 00659 00660 /* Shrinkwrap->shrinkType */ 00661 #define MOD_SHRINKWRAP_NEAREST_SURFACE 0 00662 #define MOD_SHRINKWRAP_PROJECT 1 00663 #define MOD_SHRINKWRAP_NEAREST_VERTEX 2 00664 00665 /* Shrinkwrap->shrinkOpts */ 00666 #define MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR (1<<0) /* allow shrinkwrap to move the vertex in the positive direction of axis */ 00667 #define MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR (1<<1) /* allow shrinkwrap to move the vertex in the negative direction of axis */ 00668 00669 #define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) /* ignore vertex moves if a vertex ends projected on a front face of the target */ 00670 #define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) /* ignore vertex moves if a vertex ends projected on a back face of the target */ 00671 00672 #define MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */ 00673 00674 #define MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS (1<<0) 00675 #define MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS (1<<1) 00676 #define MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS (1<<2) 00677 #define MOD_SHRINKWRAP_PROJECT_OVER_NORMAL 0 /* projection over normal is used if no axis is selected */ 00678 00679 typedef struct SimpleDeformModifierData { 00680 ModifierData modifier; 00681 00682 struct Object *origin; /* object to control the origin of modifier space coordinates */ 00683 char vgroup_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ 00684 float factor; /* factors to control simple deforms */ 00685 float limit[2]; /* lower and upper limit */ 00686 00687 char mode; /* deform function */ 00688 char axis; /* lock axis (for taper and strech) */ 00689 char originOpts; /* originOptions */ 00690 char pad; 00691 00692 } SimpleDeformModifierData; 00693 00694 #define MOD_SIMPLEDEFORM_MODE_TWIST 1 00695 #define MOD_SIMPLEDEFORM_MODE_BEND 2 00696 #define MOD_SIMPLEDEFORM_MODE_TAPER 3 00697 #define MOD_SIMPLEDEFORM_MODE_STRETCH 4 00698 00699 #define MOD_SIMPLEDEFORM_LOCK_AXIS_X (1<<0) 00700 #define MOD_SIMPLEDEFORM_LOCK_AXIS_Y (1<<1) 00701 00702 /* indicates whether simple deform should use the local 00703 * coordinates or global coordinates of origin */ 00704 #define MOD_SIMPLEDEFORM_ORIGIN_LOCAL (1<<0) 00705 00706 #define MOD_UVPROJECT_MAX 10 00707 00708 typedef struct ShapeKeyModifierData { 00709 ModifierData modifier; 00710 } ShapeKeyModifierData; 00711 00712 typedef struct SolidifyModifierData { 00713 ModifierData modifier; 00714 00715 char defgrp_name[64]; /* name of vertex group to use, MAX_VGROUP_NAME */ 00716 float offset; /* new surface offset level*/ 00717 float offset_fac; /* midpoint of the offset */ 00718 float offset_fac_vg; /* factor for the minimum weight to use when vgroups are used, avoids 0.0 weights giving duplicate geometry */ 00719 float crease_inner; 00720 float crease_outer; 00721 float crease_rim; 00722 int flag; 00723 short mat_ofs; 00724 short mat_ofs_rim; 00725 } SolidifyModifierData; 00726 00727 #define MOD_SOLIDIFY_RIM (1<<0) 00728 #define MOD_SOLIDIFY_EVEN (1<<1) 00729 #define MOD_SOLIDIFY_NORMAL_CALC (1<<2) 00730 #define MOD_SOLIDIFY_VGROUP_INV (1<<3) 00731 #define MOD_SOLIDIFY_RIM_MATERIAL (1<<4) /* deprecated, used in do_versions */ 00732 00733 typedef struct ScrewModifierData { 00734 ModifierData modifier; 00735 struct Object *ob_axis; 00736 int steps; 00737 int render_steps; 00738 int iter; 00739 float screw_ofs; 00740 float angle; 00741 short axis; 00742 short flag; 00743 } ScrewModifierData; 00744 00745 #define MOD_SCREW_NORMAL_FLIP (1<<0) 00746 #define MOD_SCREW_NORMAL_CALC (1<<1) 00747 #define MOD_SCREW_OBJECT_OFFSET (1<<2) 00748 // #define MOD_SCREW_OBJECT_ANGLE (1<<4) 00749 00750 typedef struct OceanModifierData { 00751 ModifierData modifier; 00752 00753 struct Ocean *ocean; 00754 struct OceanCache *oceancache; 00755 00756 int resolution; 00757 int spatial_size; 00758 00759 float wind_velocity; 00760 00761 float damp; 00762 float smallest_wave; 00763 float depth; 00764 00765 float wave_alignment; 00766 float wave_direction; 00767 float wave_scale; 00768 00769 float chop_amount; 00770 float foam_coverage; 00771 float time; 00772 00773 int bakestart; 00774 int bakeend; 00775 00776 char cachepath[240]; // FILE_MAX 00777 char foamlayername[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00778 char cached; 00779 char geometry_mode; 00780 00781 char flag; 00782 char refresh; 00783 00784 short repeat_x; 00785 short repeat_y; 00786 00787 int seed; 00788 00789 float size; 00790 00791 float foam_fade; 00792 00793 int pad; 00794 00795 } OceanModifierData; 00796 00797 #define MOD_OCEAN_GEOM_GENERATE 0 00798 #define MOD_OCEAN_GEOM_DISPLACE 1 00799 #define MOD_OCEAN_GEOM_SIM_ONLY 2 00800 00801 #define MOD_OCEAN_REFRESH_RESET 1 00802 #define MOD_OCEAN_REFRESH_SIM 2 00803 #define MOD_OCEAN_REFRESH_ADD 4 00804 #define MOD_OCEAN_REFRESH_CLEAR_CACHE 8 00805 #define MOD_OCEAN_REFRESH_TOPOLOGY 16 00806 00807 #define MOD_OCEAN_GENERATE_FOAM 1 00808 #define MOD_OCEAN_GENERATE_NORMALS 2 00809 00810 00811 typedef struct WarpModifierData { 00812 ModifierData modifier; 00813 00814 /* keep in sync with MappingInfoModifierData */ 00815 struct Tex *texture; 00816 struct Object *map_object; 00817 char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00818 int uvlayer_tmp; 00819 int texmapping; 00820 /* end MappingInfoModifierData */ 00821 00822 struct Object *object_from; 00823 struct Object *object_to; 00824 struct CurveMapping *curfalloff; 00825 char defgrp_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ 00826 float strength; 00827 float falloff_radius; 00828 char flag; /* not used yet */ 00829 char falloff_type; 00830 char pad[6]; 00831 } WarpModifierData; 00832 00833 #define MOD_WARP_VOLUME_PRESERVE 1 00834 00835 typedef enum { 00836 eWarp_Falloff_None = 0, 00837 eWarp_Falloff_Curve = 1, 00838 eWarp_Falloff_Sharp = 2, /* PROP_SHARP */ 00839 eWarp_Falloff_Smooth = 3, /* PROP_SMOOTH */ 00840 eWarp_Falloff_Root = 4, /* PROP_ROOT */ 00841 eWarp_Falloff_Linear = 5, /* PROP_LIN */ 00842 eWarp_Falloff_Const = 6, /* PROP_CONST */ 00843 eWarp_Falloff_Sphere = 7, /* PROP_SPHERE */ 00844 /* PROP_RANDOM not used */ 00845 } WarpModifierFalloff; 00846 00847 typedef struct WeightVGEditModifierData { 00848 ModifierData modifier; 00849 00850 /* Note: I tried to keep everything logically ordered - provided the 00851 * alignment constraints... */ 00852 00853 char defgrp_name[64]; /* Name of vertex group to edit. MAX_VGROUP_NAME. */ 00854 00855 short edit_flags; /* Using MOD_WVG_EDIT_* flags. */ 00856 short falloff_type; /* Using MOD_WVG_MAPPING_* defines. */ 00857 float default_weight; /* Weight for vertices not in vgroup. */ 00858 00859 /* Mapping stuff. */ 00860 struct CurveMapping *cmap_curve; /* The custom mapping curve! */ 00861 00862 /* The add/remove vertices weight thresholds. */ 00863 float add_threshold, rem_threshold; 00864 00865 /* Masking options. */ 00866 float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */ 00867 /* Name of mask vertex group from which to get weight factors. */ 00868 char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */ 00869 00870 /* Texture masking. */ 00871 int mask_tex_use_channel; /* Which channel to use as weightf. */ 00872 struct Tex *mask_texture; /* The texture. */ 00873 struct Object *mask_tex_map_obj; /* Name of the map object. */ 00874 /* How to map the texture (using MOD_DISP_MAP_* constants). */ 00875 int mask_tex_mapping; 00876 char mask_tex_uvlayer_name[64]; /* Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME */ 00877 00878 /* Padding... */ 00879 int pad_i1; 00880 } WeightVGEditModifierData; 00881 00882 /* WeightVGEdit flags. */ 00883 /* Use parametric mapping. */ 00884 //#define MOD_WVG_EDIT_MAP (1 << 0) 00885 /* Use curve mapping. */ 00886 //#define MOD_WVG_EDIT_CMAP (1 << 1) 00887 /* Reverse weights (in the [0.0, 1.0] standard range). */ 00888 //#define MOD_WVG_EDIT_REVERSE_WEIGHTS (1 << 2) 00889 /* Add vertices with higher weight than threshold to vgroup. */ 00890 #define MOD_WVG_EDIT_ADD2VG (1 << 3) 00891 /* Remove vertices with lower weight than threshold from vgroup. */ 00892 #define MOD_WVG_EDIT_REMFVG (1 << 4) 00893 /* Clamp weights. */ 00894 //#define MOD_WVG_EDIT_CLAMP (1 << 5) 00895 00896 typedef struct WeightVGMixModifierData { 00897 ModifierData modifier; 00898 00899 /* XXX Note: I tried to keep everything logically ordered – provided the 00900 * alignment constraints... */ 00901 00902 char defgrp_name_a[64]; /* Name of vertex group to modify/weight. MAX_VGROUP_NAME. */ 00903 char defgrp_name_b[64]; /* Name of other vertex group to mix in. MAX_VGROUP_NAME. */ 00904 float default_weight_a; /* Default weight value for first vgroup. */ 00905 float default_weight_b; /* Default weight value to mix in. */ 00906 char mix_mode; /* How second vgroups weights affect first ones */ 00907 char mix_set; /* What vertices to affect. */ 00908 00909 char pad_c1[6]; 00910 00911 /* Masking options. */ 00912 float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */ 00913 /* Name of mask vertex group from which to get weight factors. */ 00914 char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */ 00915 00916 /* Texture masking. */ 00917 int mask_tex_use_channel; /* Which channel to use as weightf. */ 00918 struct Tex *mask_texture; /* The texture. */ 00919 struct Object *mask_tex_map_obj; /* Name of the map object. */ 00920 int mask_tex_mapping; /* How to map the texture! */ 00921 char mask_tex_uvlayer_name[64]; /* Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME. */ 00922 00923 /* Padding... */ 00924 int pad_i1; 00925 } WeightVGMixModifierData; 00926 00927 /* How second vgroup's weights affect first ones. */ 00928 #define MOD_WVG_MIX_SET 1 /* Second weights replace weights. */ 00929 #define MOD_WVG_MIX_ADD 2 /* Second weights are added to weights. */ 00930 #define MOD_WVG_MIX_SUB 3 /* Second weights are subtracted from weights. */ 00931 #define MOD_WVG_MIX_MUL 4 /* Second weights are multiplied with weights. */ 00932 #define MOD_WVG_MIX_DIV 5 /* Second weights divide weights. */ 00933 #define MOD_WVG_MIX_DIF 6 /* Difference between second weights and weights. */ 00934 #define MOD_WVG_MIX_AVG 7 /* Average of both weights. */ 00935 00936 /* What vertices to affect. */ 00937 #define MOD_WVG_SET_ALL 1 /* Affect all vertices. */ 00938 #define MOD_WVG_SET_A 2 /* Affect only vertices in first vgroup. */ 00939 #define MOD_WVG_SET_B 3 /* Affect only vertices in second vgroup. */ 00940 #define MOD_WVG_SET_OR 4 /* Affect only vertices in one vgroup or the other. */ 00941 #define MOD_WVG_SET_AND 5 /* Affect only vertices in both vgroups. */ 00942 00943 typedef struct WeightVGProximityModifierData { 00944 ModifierData modifier; 00945 00946 /* Note: I tried to keep everything logically ordered - provided the 00947 * alignment constraints... */ 00948 00949 char defgrp_name[64]; /* Name of vertex group to modify/weight. MAX_VGROUP_NAME. */ 00950 00951 /* Proximity modes. */ 00952 int proximity_mode; 00953 int proximity_flags; 00954 00955 /* Target object from which to calculate vertices distances. */ 00956 struct Object *proximity_ob_target; 00957 00958 /* Masking options. */ 00959 float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */ 00960 /* Name of mask vertex group from which to get weight factors. */ 00961 char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */ 00962 00963 /* Texture masking. */ 00964 int mask_tex_use_channel; /* Which channel to use as weightf. */ 00965 struct Tex *mask_texture; /* The texture. */ 00966 struct Object *mask_tex_map_obj; /* Name of the map object. */ 00967 int mask_tex_mapping; /* How to map the texture! */ 00968 char mask_tex_uvlayer_name[64]; /* Name of the UV Map. MAX_CUSTOMDATA_LAYER_NAME. */ 00969 00970 float min_dist, max_dist; /* Distances mapping to 0.0/1.0 weights. */ 00971 00972 /* Put here to avoid breaking existing struct... */ 00973 short falloff_type; /* Using MOD_WVG_MAPPING_* defines. */ 00974 00975 /* Padding... */ 00976 short pad_s1; 00977 } WeightVGProximityModifierData; 00978 00979 /* Modes of proximity weighting. */ 00980 /* Dist from target object to affected object. */ 00981 #define MOD_WVG_PROXIMITY_OBJECT 1 /* source vertex to other location */ 00982 /* Dist from target object to vertex. */ 00983 #define MOD_WVG_PROXIMITY_GEOMETRY 2 /* source vertex to other geometry */ 00984 00985 /* Flags options for proximity weighting. */ 00986 /* Use nearest vertices of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */ 00987 #define MOD_WVG_PROXIMITY_GEOM_VERTS (1 << 0) 00988 /* Use nearest edges of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */ 00989 #define MOD_WVG_PROXIMITY_GEOM_EDGES (1 << 1) 00990 /* Use nearest faces of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */ 00991 #define MOD_WVG_PROXIMITY_GEOM_FACES (1 << 2) 00992 00993 /* Defines common to all WeightVG modifiers. */ 00994 /* Mapping modes. */ 00995 #define MOD_WVG_MAPPING_NONE 0 00996 #define MOD_WVG_MAPPING_CURVE 1 00997 #define MOD_WVG_MAPPING_SHARP 2 /* PROP_SHARP */ 00998 #define MOD_WVG_MAPPING_SMOOTH 3 /* PROP_SMOOTH */ 00999 #define MOD_WVG_MAPPING_ROOT 4 /* PROP_ROOT */ 01000 /* PROP_LIN not used (same as NONE, here...). */ 01001 /* PROP_CONST not used. */ 01002 #define MOD_WVG_MAPPING_SPHERE 7 /* PROP_SPHERE */ 01003 #define MOD_WVG_MAPPING_RANDOM 8 /* PROP_RANDOM */ 01004 #define MOD_WVG_MAPPING_STEP 9 /* Median Step. */ 01005 01006 /* Tex channel to be used as mask. */ 01007 #define MOD_WVG_MASK_TEX_USE_INT 1 01008 #define MOD_WVG_MASK_TEX_USE_RED 2 01009 #define MOD_WVG_MASK_TEX_USE_GREEN 3 01010 #define MOD_WVG_MASK_TEX_USE_BLUE 4 01011 #define MOD_WVG_MASK_TEX_USE_HUE 5 01012 #define MOD_WVG_MASK_TEX_USE_SAT 6 01013 #define MOD_WVG_MASK_TEX_USE_VAL 7 01014 #define MOD_WVG_MASK_TEX_USE_ALPHA 8 01015 01016 /* Dynamic paint modifier flags */ 01017 #define MOD_DYNAMICPAINT_TYPE_CANVAS (1 << 0) 01018 #define MOD_DYNAMICPAINT_TYPE_BRUSH (1 << 1) 01019 01020 typedef struct DynamicPaintModifierData { 01021 ModifierData modifier; 01022 01023 struct DynamicPaintCanvasSettings *canvas; 01024 struct DynamicPaintBrushSettings *brush; 01025 int type; /* ui display: canvas / brush */ 01026 int pad; 01027 } DynamicPaintModifierData; 01028 01029 /* Remesh modifier */ 01030 01031 typedef enum RemeshModifierFlags { 01032 MOD_REMESH_FLOOD_FILL = 1, 01033 } RemeshModifierFlags; 01034 01035 typedef enum RemeshModifierMode { 01036 /* blocky */ 01037 MOD_REMESH_CENTROID = 0, 01038 /* smooth */ 01039 MOD_REMESH_MASS_POINT = 1, 01040 /* keeps sharp edges */ 01041 MOD_REMESH_SHARP_FEATURES = 2, 01042 } RemeshModifierMode; 01043 01044 typedef struct RemeshModifierData { 01045 ModifierData modifier; 01046 01047 /* floodfill option, controls how small components can be 01048 before they are removed */ 01049 float threshold; 01050 01051 /* ratio between size of model and grid */ 01052 float scale; 01053 01054 float hermite_num; 01055 01056 /* octree depth */ 01057 char depth; 01058 01059 char flag; 01060 char mode; 01061 char pad; 01062 } RemeshModifierData; 01063 01064 #endif