4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * ***** END GPL LICENSE BLOCK *****
23 #ifndef DNA_MODIFIER_TYPES_H
24 #define DNA_MODIFIER_TYPES_H
26 /** \file DNA_modifier_types.h
30 #include "DNA_listBase.h"
33 #define MODSTACK_DEBUG 1
35 /* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE! */
37 typedef enum ModifierType {
38 eModifierType_None = 0,
39 eModifierType_Subsurf,
40 eModifierType_Lattice,
44 eModifierType_Decimate,
46 eModifierType_Armature,
48 eModifierType_Softbody,
49 eModifierType_Boolean,
51 eModifierType_EdgeSplit,
52 eModifierType_Displace,
53 eModifierType_UVProject,
56 eModifierType_MeshDeform,
57 eModifierType_ParticleSystem,
58 eModifierType_ParticleInstance,
59 eModifierType_Explode,
61 eModifierType_Collision,
63 eModifierType_Shrinkwrap,
64 eModifierType_Fluidsim,
66 eModifierType_SimpleDeform,
67 eModifierType_Multires,
68 eModifierType_Surface,
70 eModifierType_ShapeKey,
71 eModifierType_Solidify,
74 eModifierType_WeightVGEdit,
75 eModifierType_WeightVGMix,
76 eModifierType_WeightVGProximity,
80 typedef enum ModifierMode {
81 eModifierMode_Realtime = (1<<0),
82 eModifierMode_Render = (1<<1),
83 eModifierMode_Editmode = (1<<2),
84 eModifierMode_OnCage = (1<<3),
85 eModifierMode_Expanded = (1<<4),
86 eModifierMode_Virtual = (1<<5),
87 eModifierMode_ApplyOnSpline = (1<<6),
88 eModifierMode_DisableTemporary = (1 << 31)
91 typedef struct ModifierData {
92 struct ModifierData *next, *prev;
98 /* XXX for timing info set by caller... solve later? (ton) */
105 eSubsurfModifierFlag_Incremental = (1<<0),
106 eSubsurfModifierFlag_DebugIncr = (1<<1),
107 eSubsurfModifierFlag_ControlEdges = (1<<2),
108 eSubsurfModifierFlag_SubsurfUv = (1<<3)
109 } SubsurfModifierFlag;
111 /* not a real modifier */
112 typedef struct MappingInfoModifierData {
113 ModifierData modifier;
116 struct Object *map_object;
117 char uvlayer_name[32];
120 } MappingInfoModifierData;
122 typedef struct SubsurfModifierData {
123 ModifierData modifier;
125 short subdivType, levels, renderLevels, flags;
127 void *emCache, *mCache;
128 } SubsurfModifierData;
130 typedef struct LatticeModifierData {
131 ModifierData modifier;
133 struct Object *object;
134 char name[32]; /* optional vertexgroup name */
135 } LatticeModifierData;
137 typedef struct CurveModifierData {
138 ModifierData modifier;
140 struct Object *object;
141 char name[32]; /* optional vertexgroup name */
142 short defaxis; /* axis along which curve deforms */
146 /* CurveModifierData->defaxis */
147 #define MOD_CURVE_POSX 1
148 #define MOD_CURVE_POSY 2
149 #define MOD_CURVE_POSZ 3
150 #define MOD_CURVE_NEGX 4
151 #define MOD_CURVE_NEGY 5
152 #define MOD_CURVE_NEGZ 6
154 typedef struct BuildModifierData {
155 ModifierData modifier;
162 typedef struct MaskModifierData {
163 ModifierData modifier;
165 struct Object *ob_arm; /* armature to use to in place of hardcoded vgroup */
166 char vgroup[32]; /* name of vertex group to use to mask */
168 int mode; /* using armature or hardcoded vgroup */
169 int flag; /* flags for various things */
172 /* Mask Modifier -> mode */
173 #define MOD_MASK_MODE_VGROUP 0
174 #define MOD_MASK_MODE_ARM 1
176 /* Mask Modifier -> flag */
177 #define MOD_MASK_INV (1<<0)
179 typedef struct ArrayModifierData {
180 ModifierData modifier;
182 /* the object with which to cap the start of the array */
183 struct Object *start_cap;
184 /* the object with which to cap the end of the array */
185 struct Object *end_cap;
186 /* the curve object to use for MOD_ARR_FITCURVE */
187 struct Object *curve_ob;
188 /* the object to use for object offset */
189 struct Object *offset_ob;
190 /* a constant duplicate offset;
191 1 means the duplicates are 1 unit apart
194 /* a scaled factor for duplicate offsets;
195 1 means the duplicates are 1 object-width apart
198 /* the length over which to distribute the duplicates */
200 /* the limit below which to merge vertices in adjacent duplicates */
202 /* determines how duplicate count is calculated; one of:
203 MOD_ARR_FIXEDCOUNT -> fixed
204 MOD_ARR_FITLENGTH -> calculated to fit a set length
205 MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
208 /* flags specifying how total offset is calculated; binary OR of:
209 MOD_ARR_OFF_CONST -> total offset += offset
210 MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
211 MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
212 total offset is the sum of the individual enabled offsets
216 MOD_ARR_MERGE -> merge vertices in adjacent duplicates
219 /* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
223 /* ArrayModifierData->fit_type */
224 #define MOD_ARR_FIXEDCOUNT 0
225 #define MOD_ARR_FITLENGTH 1
226 #define MOD_ARR_FITCURVE 2
228 /* ArrayModifierData->offset_type */
229 #define MOD_ARR_OFF_CONST (1<<0)
230 #define MOD_ARR_OFF_RELATIVE (1<<1)
231 #define MOD_ARR_OFF_OBJ (1<<2)
233 /* ArrayModifierData->flags */
234 #define MOD_ARR_MERGE (1<<0)
235 #define MOD_ARR_MERGEFINAL (1<<1)
237 typedef struct MirrorModifierData {
238 ModifierData modifier;
240 short axis; /* deprecated, use flag instead */
243 struct Object *mirror_ob;
244 } MirrorModifierData;
246 /* MirrorModifierData->flag */
247 #define MOD_MIR_CLIPPING (1<<0)
248 #define MOD_MIR_MIRROR_U (1<<1)
249 #define MOD_MIR_MIRROR_V (1<<2)
250 #define MOD_MIR_AXIS_X (1<<3)
251 #define MOD_MIR_AXIS_Y (1<<4)
252 #define MOD_MIR_AXIS_Z (1<<5)
253 #define MOD_MIR_VGROUP (1<<6)
254 #define MOD_MIR_NO_MERGE (1<<7)
256 typedef struct EdgeSplitModifierData {
257 ModifierData modifier;
259 float split_angle; /* angle above which edges should be split */
261 } EdgeSplitModifierData;
263 /* EdgeSplitModifierData->flags */
264 #define MOD_EDGESPLIT_FROMANGLE (1<<1)
265 #define MOD_EDGESPLIT_FROMFLAG (1<<2)
267 typedef struct BevelModifierData {
268 ModifierData modifier;
270 float value; /* the "raw" bevel value (distance/amount to bevel) */
271 int res; /* the resolution (as originally coded, it is the number of recursive bevels) */
273 short flags; /* general option flags */
274 short val_flags; /* flags used to interpret the bevel value */
275 short lim_flags; /* flags to tell the tool how to limit the bevel */
276 short e_flags; /* flags to direct how edge weights are applied to verts */
277 float bevel_angle; /* if the BME_BEVEL_ANGLE is set, this will be how "sharp" an edge must be before it gets beveled */
278 char defgrp_name[32]; /* if the BME_BEVEL_VWEIGHT option is set, this will be the name of the vert group */
281 typedef struct BMeshModifierData {
282 ModifierData modifier;
289 /* Smoke modifier flags */
290 #define MOD_SMOKE_TYPE_DOMAIN (1 << 0)
291 #define MOD_SMOKE_TYPE_FLOW (1 << 1)
292 #define MOD_SMOKE_TYPE_COLL (1 << 2)
294 typedef struct SmokeModifierData {
295 ModifierData modifier;
297 struct SmokeDomainSettings *domain;
298 struct SmokeFlowSettings *flow; /* inflow, outflow, smoke objects */
299 struct SmokeCollSettings *coll; /* collision objects */
301 int type; /* domain, inflow, outflow, ... */
304 typedef struct DisplaceModifierData {
305 ModifierData modifier;
307 /* keep in sync with MappingInfoModifierData */
309 struct Object *map_object;
310 char uvlayer_name[32];
314 /* end MappingInfoModifierData */
318 char defgrp_name[32];
320 } DisplaceModifierData;
322 /* DisplaceModifierData->direction */
328 MOD_DISP_DIR_RGB_XYZ,
331 /* DisplaceModifierData->texmapping */
339 typedef struct UVProjectModifierData {
340 ModifierData modifier;
342 /* the objects which do the projecting */
343 struct Object *projectors[10]; /* MOD_UVPROJECT_MAX */
344 struct Image *image; /* the image to project */
347 float aspectx, aspecty;
348 float scalex, scaley;
349 char uvlayer_name[32];
350 int uvlayer_tmp, pad;
351 } UVProjectModifierData;
353 #define MOD_UVPROJECT_MAXPROJECTORS 10
355 /* UVProjectModifierData->flags */
356 #define MOD_UVPROJECT_OVERRIDEIMAGE (1<<0)
358 typedef struct DecimateModifierData {
359 ModifierData modifier;
363 } DecimateModifierData;
365 /* Smooth modifier flags */
366 #define MOD_SMOOTH_X (1<<1)
367 #define MOD_SMOOTH_Y (1<<2)
368 #define MOD_SMOOTH_Z (1<<3)
370 typedef struct SmoothModifierData {
371 ModifierData modifier;
373 char defgrp_name[32];
376 } SmoothModifierData;
378 /* Cast modifier flags */
379 #define MOD_CAST_X (1<<1)
380 #define MOD_CAST_Y (1<<2)
381 #define MOD_CAST_Z (1<<3)
382 #define MOD_CAST_USE_OB_TRANSFORM (1<<4)
383 #define MOD_CAST_SIZE_FROM_RADIUS (1<<5)
385 /* Cast modifier projection types */
386 #define MOD_CAST_TYPE_SPHERE 0
387 #define MOD_CAST_TYPE_CYLINDER 1
388 #define MOD_CAST_TYPE_CUBOID 2
390 typedef struct CastModifierData {
391 ModifierData modifier;
393 struct Object *object;
397 char defgrp_name[32];
408 /* WaveModifierData.flag */
409 #define MOD_WAVE_X (1<<1)
410 #define MOD_WAVE_Y (1<<2)
411 #define MOD_WAVE_CYCL (1<<3)
412 #define MOD_WAVE_NORM (1<<4)
413 #define MOD_WAVE_NORM_X (1<<5)
414 #define MOD_WAVE_NORM_Y (1<<6)
415 #define MOD_WAVE_NORM_Z (1<<7)
417 typedef struct WaveModifierData {
418 ModifierData modifier;
420 struct Object *objectcenter;
421 char defgrp_name[32];
423 struct Object *map_object;
427 float startx, starty, height, width;
428 float narrow, speed, damp, falloff;
430 int texmapping, uvlayer_tmp;
432 char uvlayer_name[32];
434 float timeoffs, lifetime;
438 typedef struct ArmatureModifierData {
439 ModifierData modifier;
441 short deformflag, multi; /* deformflag replaces armature->deformflag */
443 struct Object *object;
444 float *prevCos; /* stored input of previous modifier, for vertexgroup blending */
445 char defgrp_name[32];
446 } ArmatureModifierData;
448 typedef struct HookModifierData {
449 ModifierData modifier;
451 struct Object *object;
452 char subtarget[32]; /* optional name of bone target */
454 float parentinv[4][4]; /* matrix making current transform unmodified */
455 float cent[3]; /* visualization of hook */
456 float falloff; /* if not zero, falloff is distance where influence zero */
458 int *indexar; /* if NULL, it's using vertexgroup */
461 char name[32]; /* optional vertexgroup name */
464 typedef struct SoftbodyModifierData {
465 ModifierData modifier;
466 } SoftbodyModifierData;
468 typedef struct ClothModifierData {
469 ModifierData modifier;
471 struct Scene *scene; /* the context, time etc is here */
472 struct Cloth *clothObject; /* The internal data structure for cloth. */
473 struct ClothSimSettings *sim_parms; /* definition is in DNA_cloth_types.h */
474 struct ClothCollSettings *coll_parms; /* definition is in DNA_cloth_types.h */
475 struct PointCache *point_cache; /* definition is in DNA_object_force.h */
476 struct ListBase ptcaches;
479 typedef struct CollisionModifierData {
480 ModifierData modifier;
482 struct MVert *x; /* position at the beginning of the frame */
483 struct MVert *xnew; /* position at the end of the frame */
484 struct MVert *xold; /* unsued atm, but was discussed during sprint */
485 struct MVert *current_xnew; /* new position at the actual inter-frame step */
486 struct MVert *current_x; /* position at the actual inter-frame step */
487 struct MVert *current_v; /* (xnew - x) at the actual inter-frame step */
489 struct MFace *mfaces; /* object face data */
491 unsigned int numverts;
492 unsigned int numfaces;
493 float time_x, time_xnew; /* cfra time of modifier */
494 struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */
495 } CollisionModifierData;
497 typedef struct SurfaceModifierData {
498 ModifierData modifier;
500 struct MVert *x; /* old position */
501 struct MVert *v; /* velocity */
503 struct DerivedMesh *dm;
505 struct BVHTreeFromMesh *bvhtree; /* bounding volume hierarchy of the mesh faces */
508 } SurfaceModifierData;
511 eBooleanModifierOp_Intersect,
512 eBooleanModifierOp_Union,
513 eBooleanModifierOp_Difference,
515 typedef struct BooleanModifierData {
516 ModifierData modifier;
518 struct Object *object;
520 } BooleanModifierData;
522 #define MOD_MDEF_INVERT_VGROUP (1<<0)
523 #define MOD_MDEF_DYNAMIC_BIND (1<<1)
525 #define MOD_MDEF_VOLUME 0
526 #define MOD_MDEF_SURFACE 1
528 typedef struct MDefInfluence {
533 typedef struct MDefCell {
538 typedef struct MeshDeformModifierData {
539 ModifierData modifier;
541 struct Object *object; /* mesh object */
542 char defgrp_name[32]; /* optional vertexgroup name */
544 short gridsize, flag, mode, pad;
546 /* result of static binding */
547 MDefInfluence *bindinfluences; /* influences */
548 int *bindoffsets; /* offsets into influences array */
549 float *bindcagecos; /* coordinates that cage was bound with */
550 int totvert, totcagevert; /* total vertices in mesh and cage */
552 /* result of dynamic binding */
553 MDefCell *dyngrid; /* grid with dynamic binding cell points */
554 MDefInfluence *dyninfluences; /* dynamic binding vertex influences */
555 int *dynverts, *pad2; /* is this vertex bound or not? */
556 int dyngridsize; /* size of the dynamic bind grid */
557 int totinfluence; /* total number of vertex influences */
558 float dyncellmin[3]; /* offset of the dynamic bind grid */
559 float dyncellwidth; /* width of dynamic bind cell */
560 float bindmat[4][4]; /* matrix of cage at binding time */
562 /* deprecated storage */
563 float *bindweights; /* deprecated inefficient storage */
564 float *bindcos; /* deprecated storage of cage coords */
567 void (*bindfunc)(struct Scene *scene,
568 struct MeshDeformModifierData *mmd,
569 float *vertexcos, int totvert, float cagemat[][4]);
570 } MeshDeformModifierData;
573 eParticleSystemFlag_Pars = (1<<0),
574 eParticleSystemFlag_psys_updated = (1<<1),
575 eParticleSystemFlag_file_loaded = (1<<2),
576 } ParticleSystemModifierFlag;
578 typedef struct ParticleSystemModifierData {
579 ModifierData modifier;
580 struct ParticleSystem *psys;
581 struct DerivedMesh *dm;
582 int totdmvert, totdmedge, totdmface;
584 } ParticleSystemModifierData;
587 eParticleInstanceFlag_Parents = (1<<0),
588 eParticleInstanceFlag_Children = (1<<1),
589 eParticleInstanceFlag_Path = (1<<2),
590 eParticleInstanceFlag_Unborn = (1<<3),
591 eParticleInstanceFlag_Alive = (1<<4),
592 eParticleInstanceFlag_Dead = (1<<5),
593 eParticleInstanceFlag_KeepShape = (1<<6),
594 eParticleInstanceFlag_UseSize = (1<<7),
595 } ParticleInstanceModifierFlag;
597 typedef struct ParticleInstanceModifierData {
598 ModifierData modifier;
600 short psys, flag, axis, rt;
601 float position, random_position;
602 } ParticleInstanceModifierData;
605 eExplodeFlag_CalcFaces = (1<<0),
606 eExplodeFlag_PaSize = (1<<1),
607 eExplodeFlag_EdgeCut = (1<<2),
608 eExplodeFlag_Unborn = (1<<3),
609 eExplodeFlag_Alive = (1<<4),
610 eExplodeFlag_Dead = (1<<5),
611 } ExplodeModifierFlag;
613 typedef struct ExplodeModifierData {
614 ModifierData modifier;
619 } ExplodeModifierData;
621 typedef struct MultiresModifierData {
622 ModifierData modifier;
624 char lvl, sculptlvl, renderlvl, totlvl;
625 char simple, flags, pad[2];
626 } MultiresModifierData;
629 eMultiresModifierFlag_ControlEdges = (1<<0),
630 eMultiresModifierFlag_PlainUv = (1<<1),
631 } MultiresModifierFlag;
633 typedef struct FluidsimModifierData {
634 ModifierData modifier;
636 struct FluidsimSettings *fss; /* definition is in DNA_object_fluidsim.h */
637 struct PointCache *point_cache; /* definition is in DNA_object_force.h */
638 } FluidsimModifierData;
640 typedef struct ShrinkwrapModifierData {
641 ModifierData modifier;
643 struct Object *target; /* shrink target */
644 struct Object *auxTarget; /* additional shrink target */
645 char vgroup_name[32]; /* optional vertexgroup name */
646 float keepDist; /* distance offset to keep from mesh/projection point */
647 short shrinkType; /* shrink type projection */
648 short shrinkOpts; /* shrink options */
649 char projAxis; /* axis to project over */
652 * if using projection over vertex normal this controls the
653 * the level of subsurface that must be done before getting the
654 * vertex coordinates and normal
660 } ShrinkwrapModifierData;
662 /* Shrinkwrap->shrinkType */
663 #define MOD_SHRINKWRAP_NEAREST_SURFACE 0
664 #define MOD_SHRINKWRAP_PROJECT 1
665 #define MOD_SHRINKWRAP_NEAREST_VERTEX 2
667 /* Shrinkwrap->shrinkOpts */
668 #define MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR (1<<0) /* allow shrinkwrap to move the vertex in the positive direction of axis */
669 #define MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR (1<<1) /* allow shrinkwrap to move the vertex in the negative direction of axis */
671 #define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) /* ignore vertex moves if a vertex ends projected on a front face of the target */
672 #define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) /* ignore vertex moves if a vertex ends projected on a back face of the target */
674 #define MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */
676 #define MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS (1<<0)
677 #define MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS (1<<1)
678 #define MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS (1<<2)
679 #define MOD_SHRINKWRAP_PROJECT_OVER_NORMAL 0 /* projection over normal is used if no axis is selected */
681 typedef struct SimpleDeformModifierData {
682 ModifierData modifier;
684 struct Object *origin; /* object to control the origin of modifier space coordinates */
685 char vgroup_name[32]; /* optional vertexgroup name */
686 float factor; /* factors to control simple deforms */
687 float limit[2]; /* lower and upper limit */
689 char mode; /* deform function */
690 char axis; /* lock axis (for taper and strech) */
691 char originOpts; /* originOptions */
694 } SimpleDeformModifierData;
696 #define MOD_SIMPLEDEFORM_MODE_TWIST 1
697 #define MOD_SIMPLEDEFORM_MODE_BEND 2
698 #define MOD_SIMPLEDEFORM_MODE_TAPER 3
699 #define MOD_SIMPLEDEFORM_MODE_STRETCH 4
701 #define MOD_SIMPLEDEFORM_LOCK_AXIS_X (1<<0)
702 #define MOD_SIMPLEDEFORM_LOCK_AXIS_Y (1<<1)
704 /* indicates whether simple deform should use the local
705 coordinates or global coordinates of origin */
706 #define MOD_SIMPLEDEFORM_ORIGIN_LOCAL (1<<0)
708 #define MOD_UVPROJECT_MAX 10
710 typedef struct ShapeKeyModifierData {
711 ModifierData modifier;
712 } ShapeKeyModifierData;
714 typedef struct SolidifyModifierData {
715 ModifierData modifier;
717 char defgrp_name[32]; /* name of vertex group to use */
718 float offset; /* new surface offset level*/
719 float offset_fac; /* midpoint of the offset */
720 float offset_fac_vg; /* factor for the minimum weight to use when vgroups are used, avoids 0.0 weights giving duplicate geometry */
727 } SolidifyModifierData;
729 #define MOD_SOLIDIFY_RIM (1<<0)
730 #define MOD_SOLIDIFY_EVEN (1<<1)
731 #define MOD_SOLIDIFY_NORMAL_CALC (1<<2)
732 #define MOD_SOLIDIFY_VGROUP_INV (1<<3)
733 #define MOD_SOLIDIFY_RIM_MATERIAL (1<<4) /* deprecated, used in do_versions */
735 typedef struct ScrewModifierData {
736 ModifierData modifier;
737 struct Object *ob_axis;
747 #define MOD_SCREW_NORMAL_FLIP (1<<0)
748 #define MOD_SCREW_NORMAL_CALC (1<<1)
749 #define MOD_SCREW_OBJECT_OFFSET (1<<2)
750 // #define MOD_SCREW_OBJECT_ANGLE (1<<4)
752 typedef struct WarpModifierData {
753 ModifierData modifier;
755 /* keep in sync with MappingInfoModifierData */
757 struct Object *map_object;
758 char uvlayer_name[32];
762 /* end MappingInfoModifierData */
766 struct Object *object_from;
767 struct Object *object_to;
768 struct CurveMapping *curfalloff;
769 char defgrp_name[32]; /* optional vertexgroup name */
770 float falloff_radius;
771 char flag; /* not used yet */
776 #define MOD_WARP_VOLUME_PRESERVE 1
779 eWarp_Falloff_None = 0,
780 eWarp_Falloff_Curve = 1,
781 eWarp_Falloff_Sharp = 2, /* PROP_SHARP */
782 eWarp_Falloff_Smooth = 3, /* PROP_SMOOTH */
783 eWarp_Falloff_Root = 4, /* PROP_ROOT */
784 eWarp_Falloff_Linear = 5, /* PROP_LIN */
785 eWarp_Falloff_Const = 6, /* PROP_CONST */
786 eWarp_Falloff_Sphere = 7, /* PROP_SPHERE */
787 /* PROP_RANDOM not used */
788 } WarpModifierFalloff;
790 typedef struct WeightVGEditModifierData {
791 ModifierData modifier;
793 /* XXX Note: I tried to keep everything logically ordered – provided the
794 * alignment constraints…
797 char defgrp_name[32]; /* Name of vertex group to edit. */
799 /* Flags (MOD_WVG_EDIT_MAP, MOD_WVG_EDIT_CMAP, MOD_WVG_EDIT_REVERSE_WEIGHTS,
800 * MOD_WVG_EDIT_ADD2VG, MOD_WVG_EDIT_REMFVG, MOD_WVG_EDIT_CLAMP).
803 float default_weight; /* Weight for vertices not in vgroup. */
806 struct CurveMapping *cmap_curve; /* The custom mapping curve! */
808 /* The add/remove vertices weight thresholds. */
809 float add_threshold, rem_threshold;
811 /* Masking options. */
812 float mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
813 /* Name of mask vertex group from which to get weight factors. */
814 char mask_defgrp_name[32];
816 /* Texture masking. */
817 int mask_tex_use_channel; /* Which channel to use as weightf. */
818 struct Tex *mask_texture; /* The texture. */
819 struct Object *mask_tex_map_obj; /* Name of the map object. */
820 /* How to map the texture (using MOD_DISP_MAP_xxx constants). */
821 int mask_tex_mapping;
822 char mask_tex_uvlayer_name[32]; /* Name of the UV layer. */
826 } WeightVGEditModifierData;
828 /* WeightVGEdit flags. */
829 /* Use parametric mapping. */
830 //#define MOD_WVG_EDIT_MAP (1 << 0)
831 /* Use curve mapping. */
832 #define MOD_WVG_EDIT_CMAP (1 << 1)
833 /* Reverse weights (in the [0.0, 1.0] standard range). */
834 //#define MOD_WVG_EDIT_REVERSE_WEIGHTS (1 << 2)
835 /* Add vertices with higher weight than threshold to vgroup. */
836 #define MOD_WVG_EDIT_ADD2VG (1 << 3)
837 /* Remove vertices with lower weight than threshold from vgroup. */
838 #define MOD_WVG_EDIT_REMFVG (1 << 4)
840 //#define MOD_WVG_EDIT_CLAMP (1 << 5)
842 typedef struct WeightVGMixModifierData {
843 ModifierData modifier;
845 /* XXX Note: I tried to keep everything logically ordered – provided the
846 * alignment constraints…
849 char defgrp_name[32]; /* Name of vertex group to modify/weight. */
850 char defgrp_name2[32]; /* Name of other vertex group to mix in. */
851 float default_weight; /* Default weight value for first vgroup. */
852 float default_weight2; /* Default weight value to mix in. */
853 char mix_mode; /* How second vgroup’s weights affect first ones */
854 char mix_set; /* What vertices to affect. */
859 /* Masking options. */
860 float mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
861 /* Name of mask vertex group from which to get weight factors. */
862 char mask_defgrp_name[32];
864 /* Texture masking. */
865 int mask_tex_use_channel; /* Which channel to use as weightf. */
866 struct Tex *mask_texture; /* The texture. */
867 struct Object *mask_tex_map_obj; /* Name of the map object. */
868 int mask_tex_mapping; /* How to map the texture! */
869 char mask_tex_uvlayer_name[32]; /* Name of the UV layer. */
873 } WeightVGMixModifierData;
875 /* How second vgroup’s weights affect first ones. */
876 #define MOD_WVG_MIX_SET 1 /* Second weights replace weights. */
877 #define MOD_WVG_MIX_ADD 2 /* Second weights are added to weights. */
878 #define MOD_WVG_MIX_SUB 3 /* Second weights are subtracted from weights. */
879 #define MOD_WVG_MIX_MUL 4 /* Second weights are multiplied with weights. */
880 #define MOD_WVG_MIX_DIV 5 /* Second weights divide weights. */
881 #define MOD_WVG_MIX_DIF 6 /* Difference between second weights and weights. */
882 #define MOD_WVG_MIX_AVG 7 /* Average of both weights. */
884 /* What vertices to affect. */
885 #define MOD_WVG_SET_ALL 1 /* Affect all vertices. */
886 #define MOD_WVG_SET_ORG 2 /* Affect only vertices in first vgroup. */
887 #define MOD_WVG_SET_NEW 3 /* Affect only vertices in second vgroup. */
888 #define MOD_WVG_SET_UNION 4 /* Affect only vertices in one vgroup or the other. */
889 #define MOD_WVG_SET_INTER 5 /* Affect only vertices in both vgroups. */
891 typedef struct WeightVGProximityModifierData {
892 ModifierData modifier;
894 /* XXX Note: I tried to keep everything logically ordered – provided the
895 * alignment constraints…
898 char defgrp_name[32]; /* Name of vertex group to modify/weight. */
900 /* Proximity modes. */
904 /* Target object from which to calculate vertices’ distances. */
905 struct Object *proximity_ob_target;
907 /* Masking options. */
908 float mask_constant; /* The global “influence”, if no vgroup nor tex is used as mask. */
909 /* Name of mask vertex group from which to get weight factors. */
910 char mask_defgrp_name[32];
912 /* Texture masking. */
913 int mask_tex_use_channel; /* Which channel to use as weightf. */
914 struct Tex *mask_texture; /* The texture. */
915 struct Object *mask_tex_map_obj; /* Name of the map object. */
916 int mask_tex_mapping; /* How to map the texture! */
917 char mask_tex_uvlayer_name[32]; /* Name of the UV layer. */
919 float min_dist, max_dist; /* Distances mapping to 0.0/1.0 weights. */
923 } WeightVGProximityModifierData;
925 /* Modes of proximity weighting. */
926 /* Dist from target object to affected object. */
927 #define MOD_WVG_PROXIMITY_OBJECT 1 /* source vertex to other location */
928 /* Dist from target object to vertex. */
929 #define MOD_WVG_PROXIMITY_GEOMETRY 2 /* source vertex to other geometry */
931 /* Flags options for proximity weighting. */
932 /* Use nearest vertices of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
933 #define MOD_WVG_PROXIMITY_GEOM_VERTS (1 << 0)
934 /* Use nearest edges of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
935 #define MOD_WVG_PROXIMITY_GEOM_EDGES (1 << 1)
936 /* Use nearest faces of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
937 #define MOD_WVG_PROXIMITY_GEOM_FACES (1 << 2)
939 /* Defines common to all WeightVG modifiers. */
940 /* Tex channel to be used as mask. */
941 #define MOD_WVG_MASK_TEX_USE_INT 1
942 #define MOD_WVG_MASK_TEX_USE_RED 2
943 #define MOD_WVG_MASK_TEX_USE_GREEN 3
944 #define MOD_WVG_MASK_TEX_USE_BLUE 4
945 #define MOD_WVG_MASK_TEX_USE_HUE 5
946 #define MOD_WVG_MASK_TEX_USE_SAT 6
947 #define MOD_WVG_MASK_TEX_USE_VAL 7
948 #define MOD_WVG_MASK_TEX_USE_ALPHA 8