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 * Contributor(s): Blender Foundation (2008), Juho Veps‰l‰inen
22 * ***** END GPL LICENSE BLOCK *****
25 /** \file blender/makesrna/intern/rna_modifier.c
34 #include "RNA_define.h"
35 #include "RNA_enum_types.h"
37 #include "rna_internal.h"
39 #include "DNA_armature_types.h"
40 #include "DNA_modifier_types.h"
41 #include "DNA_object_types.h"
42 #include "DNA_object_force.h"
43 #include "DNA_scene_types.h"
45 #include "MEM_guardedalloc.h"
49 #include "BKE_animsys.h"
50 #include "BKE_bmesh.h" /* For BevelModifierData */
51 #include "BKE_multires.h"
52 #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
57 EnumPropertyItem modifier_type_items[] ={
58 {0, "", 0, "Generate", ""},
59 {eModifierType_Array, "ARRAY", ICON_MOD_ARRAY, "Array", ""},
60 {eModifierType_Bevel, "BEVEL", ICON_MOD_BEVEL, "Bevel", ""},
61 {eModifierType_Boolean, "BOOLEAN", ICON_MOD_BOOLEAN, "Boolean", ""},
62 {eModifierType_Build, "BUILD", ICON_MOD_BUILD, "Build", ""},
63 {eModifierType_Decimate, "DECIMATE", ICON_MOD_DECIM, "Decimate", ""},
64 {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
65 {eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
66 {eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
67 {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
68 {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
69 {eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
70 {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
71 {0, "", 0, "Modify", ""},
72 {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
73 {eModifierType_WeightVGEdit, "VERTEX_WEIGHT_EDIT", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Edit", ""},
74 {eModifierType_WeightVGMix, "VERTEX_WEIGHT_MIX", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Mix", ""},
75 {eModifierType_WeightVGProximity, "VERTEX_WEIGHT_PROXIMITY", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Proximity", ""},
76 {0, "", 0, "Deform", ""},
77 {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
78 {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
79 {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""},
80 {eModifierType_Displace, "DISPLACE", ICON_MOD_DISPLACE, "Displace", ""},
81 {eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", ""},
82 {eModifierType_Lattice, "LATTICE", ICON_MOD_LATTICE, "Lattice", ""},
83 {eModifierType_MeshDeform, "MESH_DEFORM", ICON_MOD_MESHDEFORM, "Mesh Deform", ""},
84 {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""},
85 {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""},
86 {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""},
87 {eModifierType_Warp, "WARP", ICON_MOD_SUBSURF, "Warp", ""},
88 {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""},
89 {0, "", 0, "Simulate", ""},
90 {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
91 {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
92 {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""},
93 {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""},
94 {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
95 {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
96 {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""},
97 {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
98 {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""},
99 {eModifierType_NgonInterp, "NGONINTERP", ICON_MOD_LATTICE, "Precision UV Interpolation", ""},
100 {0, NULL, 0, NULL, NULL}};
104 #include "DNA_particle_types.h"
105 #include "DNA_smoke_types.h"
107 #include "BKE_context.h"
108 #include "BKE_depsgraph.h"
109 #include "BKE_library.h"
110 #include "BKE_modifier.h"
111 #include "BKE_particle.h"
113 static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
115 UVProjectModifierData *uvp= (UVProjectModifierData*)ptr->data;
116 rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), uvp->num_projectors, 0, NULL);
119 static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
121 ModifierData *md= (ModifierData*)ptr->data;
124 case eModifierType_Subsurf:
125 return &RNA_SubsurfModifier;
126 case eModifierType_Lattice:
127 return &RNA_LatticeModifier;
128 case eModifierType_Curve:
129 return &RNA_CurveModifier;
130 case eModifierType_Build:
131 return &RNA_BuildModifier;
132 case eModifierType_Mirror:
133 return &RNA_MirrorModifier;
134 case eModifierType_Decimate:
135 return &RNA_DecimateModifier;
136 case eModifierType_Wave:
137 return &RNA_WaveModifier;
138 case eModifierType_Armature:
139 return &RNA_ArmatureModifier;
140 case eModifierType_Hook:
141 return &RNA_HookModifier;
142 case eModifierType_Softbody:
143 return &RNA_SoftBodyModifier;
144 case eModifierType_Boolean:
145 return &RNA_BooleanModifier;
146 case eModifierType_Array:
147 return &RNA_ArrayModifier;
148 case eModifierType_EdgeSplit:
149 return &RNA_EdgeSplitModifier;
150 case eModifierType_Displace:
151 return &RNA_DisplaceModifier;
152 case eModifierType_UVProject:
153 return &RNA_UVProjectModifier;
154 case eModifierType_Smooth:
155 return &RNA_SmoothModifier;
156 case eModifierType_Cast:
157 return &RNA_CastModifier;
158 case eModifierType_MeshDeform:
159 return &RNA_MeshDeformModifier;
160 case eModifierType_ParticleSystem:
161 return &RNA_ParticleSystemModifier;
162 case eModifierType_ParticleInstance:
163 return &RNA_ParticleInstanceModifier;
164 case eModifierType_Explode:
165 return &RNA_ExplodeModifier;
166 case eModifierType_Cloth:
167 return &RNA_ClothModifier;
168 case eModifierType_Collision:
169 return &RNA_CollisionModifier;
170 case eModifierType_Bevel:
171 return &RNA_BevelModifier;
172 case eModifierType_Shrinkwrap:
173 return &RNA_ShrinkwrapModifier;
174 case eModifierType_Fluidsim:
175 return &RNA_FluidSimulationModifier;
176 case eModifierType_Mask:
177 return &RNA_MaskModifier;
178 case eModifierType_SimpleDeform:
179 return &RNA_SimpleDeformModifier;
180 case eModifierType_Multires:
181 return &RNA_MultiresModifier;
182 case eModifierType_Surface:
183 return &RNA_SurfaceModifier;
184 case eModifierType_NgonInterp:
185 return &RNA_NgonInterpModifier;
186 case eModifierType_Smoke:
187 return &RNA_SmokeModifier;
188 case eModifierType_Solidify:
189 return &RNA_SolidifyModifier;
190 case eModifierType_Screw:
191 return &RNA_ScrewModifier;
192 case eModifierType_Warp:
193 return &RNA_WarpModifier;
194 case eModifierType_WeightVGEdit:
195 return &RNA_VertexWeightEditModifier;
196 case eModifierType_WeightVGMix:
197 return &RNA_VertexWeightMixModifier;
198 case eModifierType_WeightVGProximity:
199 return &RNA_VertexWeightProximityModifier;
201 return &RNA_Modifier;
205 void rna_Modifier_name_set(PointerRNA *ptr, const char *value)
207 ModifierData *md= ptr->data;
208 char oldname[sizeof(md->name)];
210 /* make a copy of the old name first */
211 BLI_strncpy(oldname, md->name, sizeof(md->name));
213 /* copy the new name into the name slot */
214 BLI_strncpy(md->name, value, sizeof(md->name));
216 /* make sure the name is truly unique */
218 Object *ob= ptr->id.data;
219 modifier_unique_name(&ob->modifiers, md);
222 /* fix all the animation data which may link to this */
223 BKE_all_animdata_fix_paths_rename("modifiers", oldname, md->name);
226 static char *rna_Modifier_path(PointerRNA *ptr)
228 return BLI_sprintfN("modifiers[\"%s\"]", ((ModifierData*)ptr->data)->name);
231 static void rna_Modifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
233 DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
234 WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ptr->id.data);
237 static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
239 rna_Modifier_update(bmain, scene, ptr);
240 DAG_scene_sort(bmain, scene);
243 static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
245 SmokeModifierData *smd= (SmokeModifierData *)ptr->data;
246 Object *ob= (Object*)ptr->id.data;
247 ParticleSystemModifierData *psmd = NULL;
248 ParticleSystem *psys = NULL;
249 ParticleSettings *part = NULL;
252 if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
255 smokeModifier_free(smd); // XXX TODO: completely free all 3 pointers
256 smokeModifier_createType(smd); // create regarding of selected type
259 case MOD_SMOKE_TYPE_DOMAIN:
262 case MOD_SMOKE_TYPE_FLOW:
263 for(psys=ob->particlesystem.first; psys; psys=psys->next)
264 if(psys->part->type == PART_EMITTER)
266 if(ob->type == OB_MESH && !psys) {
267 /* add particle system */
268 psmd = (ParticleSystemModifierData *)object_add_particle_system(scene, ob, NULL);
273 part->lifetime = 1.0f;
276 part->ren_as = PART_DRAW_NOT;
277 part->draw_as = PART_DRAW_DOT;
278 sprintf(psys->name, "SmokeParticles");
279 psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
280 DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
284 smd->flow->psys = psys;
285 case MOD_SMOKE_TYPE_COLL:
292 // update dependancy since a domain - other type switch could have happened
293 rna_Modifier_dependency_update(bmain, scene, ptr);
296 static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
298 ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
299 rna_object_vgroup_name_index_get(ptr, value, emd->vgroup);
302 static int rna_ExplodeModifier_vgroup_length(PointerRNA *ptr)
304 ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
305 return rna_object_vgroup_name_index_length(ptr, emd->vgroup);
308 static void rna_ExplodeModifier_vgroup_set(PointerRNA *ptr, const char *value)
310 ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
311 rna_object_vgroup_name_index_set(ptr, value, &emd->vgroup);
314 static void rna_SimpleDeformModifier_vgroup_set(PointerRNA *ptr, const char *value)
316 SimpleDeformModifierData *smd= (SimpleDeformModifierData*)ptr->data;
317 rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name));
320 static void rna_ShrinkwrapModifier_vgroup_set(PointerRNA *ptr, const char *value)
322 ShrinkwrapModifierData *smd= (ShrinkwrapModifierData*)ptr->data;
323 rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name));
326 static void rna_LatticeModifier_vgroup_set(PointerRNA *ptr, const char *value)
328 LatticeModifierData *lmd= (LatticeModifierData*)ptr->data;
329 rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
332 static void rna_ArmatureModifier_vgroup_set(PointerRNA *ptr, const char *value)
334 ArmatureModifierData *lmd= (ArmatureModifierData*)ptr->data;
335 rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
338 static void rna_CurveModifier_vgroup_set(PointerRNA *ptr, const char *value)
340 CurveModifierData *lmd= (CurveModifierData*)ptr->data;
341 rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
344 static void rna_DisplaceModifier_vgroup_set(PointerRNA *ptr, const char *value)
346 DisplaceModifierData *lmd= (DisplaceModifierData*)ptr->data;
347 rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
350 static void rna_HookModifier_vgroup_set(PointerRNA *ptr, const char *value)
352 HookModifierData *lmd= (HookModifierData*)ptr->data;
353 rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
356 static void rna_MaskModifier_vgroup_set(PointerRNA *ptr, const char *value)
358 MaskModifierData *lmd= (MaskModifierData*)ptr->data;
359 rna_object_vgroup_name_set(ptr, value, lmd->vgroup, sizeof(lmd->vgroup));
362 static void rna_MeshDeformModifier_vgroup_set(PointerRNA *ptr, const char *value)
364 MeshDeformModifierData *lmd= (MeshDeformModifierData*)ptr->data;
365 rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
368 static void rna_SmoothModifier_vgroup_set(PointerRNA *ptr, const char *value)
370 SmoothModifierData *lmd= (SmoothModifierData*)ptr->data;
371 rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
374 static void rna_WaveModifier_vgroup_set(PointerRNA *ptr, const char *value)
376 WaveModifierData *lmd= (WaveModifierData*)ptr->data;
377 rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
380 static void rna_CastModifier_vgroup_set(PointerRNA *ptr, const char *value)
382 CastModifierData *lmd= (CastModifierData*)ptr->data;
383 rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
386 static void rna_SolidifyModifier_vgroup_set(PointerRNA *ptr, const char *value)
388 SolidifyModifierData *smd= (SolidifyModifierData*)ptr->data;
389 rna_object_vgroup_name_set(ptr, value, smd->defgrp_name, sizeof(smd->defgrp_name));
392 static void rna_WeightVGModifier_vgroup_set(PointerRNA *ptr, const char *value)
394 ModifierData *md = (ModifierData*)ptr->data;
395 if (md->type == eModifierType_WeightVGEdit) {
396 WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md;
397 rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name));
399 else if (md->type == eModifierType_WeightVGMix) {
400 WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md;
401 rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_a, sizeof(wmd->defgrp_name_a));
403 else if (md->type == eModifierType_WeightVGProximity) {
404 WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md;
405 rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name));
409 static void rna_WeightVGModifier_mask_vgroup_set(PointerRNA *ptr, const char *value)
411 ModifierData *md = (ModifierData*)ptr->data;
412 if (md->type == eModifierType_WeightVGEdit) {
413 WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md;
414 rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
416 else if (md->type == eModifierType_WeightVGMix) {
417 WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md;
418 rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
420 else if (md->type == eModifierType_WeightVGProximity) {
421 WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md;
422 rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
426 static void rna_WeightVGMixModifier_vgroup2_set(PointerRNA *ptr, const char *value)
428 WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)ptr->data;
429 rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_b, sizeof(wmd->defgrp_name_b));
432 static void rna_MappingInfo_uvlayer_set(PointerRNA *ptr, const char *value)
434 MappingInfoModifierData *mmd= (MappingInfoModifierData *)ptr->data;
435 rna_object_uvlayer_name_set(ptr, value, mmd->uvlayer_name, sizeof(mmd->uvlayer_name));
438 static void rna_UVProjectModifier_uvlayer_set(PointerRNA *ptr, const char *value)
440 UVProjectModifierData *umd= (UVProjectModifierData*)ptr->data;
441 rna_object_uvlayer_name_set(ptr, value, umd->uvlayer_name, sizeof(umd->uvlayer_name));
444 static void RNA_WarpModifier_vgroup_set(PointerRNA *ptr, const char *value)
446 WarpModifierData *tmd= (WarpModifierData*)ptr->data;
447 rna_object_vgroup_name_set(ptr, value, tmd->defgrp_name, sizeof(tmd->defgrp_name));
450 static void rna_WaveModifier_uvlayer_set(PointerRNA *ptr, const char *value)
452 WaveModifierData *wmd= (WaveModifierData*)ptr->data;
453 rna_object_uvlayer_name_set(ptr, value, wmd->uvlayer_name, sizeof(wmd->uvlayer_name));
456 static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *value)
458 ModifierData *md = (ModifierData*)ptr->data;
459 if (md->type == eModifierType_WeightVGEdit) {
460 WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md;
461 rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name));
463 else if (md->type == eModifierType_WeightVGMix) {
464 WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md;
465 rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name));
467 else if (md->type == eModifierType_WeightVGProximity) {
468 WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md;
469 rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name));
473 static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max)
475 MultiresModifierData *mmd = (MultiresModifierData*)ptr->data;
478 *max = mmd->totlvl; /* intentionally _not_ -1 */
482 static int rna_MultiresModifier_external_get(PointerRNA *ptr)
484 Object *ob= (Object*)ptr->id.data;
487 return CustomData_external_test(&me->ldata, CD_MDISPS);
490 static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value)
492 Object *ob= (Object*)ptr->id.data;
493 CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
495 BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename));
498 static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value)
500 Object *ob= (Object*)ptr->id.data;
501 CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
503 if(external && strcmp(external->filename, value)) {
504 BLI_strncpy(external->filename, value, sizeof(external->filename));
505 multires_force_external_reload(ob);
509 static int rna_MultiresModifier_filepath_length(PointerRNA *ptr)
511 Object *ob= (Object*)ptr->id.data;
512 CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
514 return strlen((external)? external->filename: "");
517 static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value)
519 Object *ob= value.data;
521 if(!self || ob != self) {
522 if(!ob || type == OB_EMPTY || ob->type == type) {
523 id_lib_extern((ID *)ob);
529 static void rna_LatticeModifier_object_set(PointerRNA *ptr, PointerRNA value)
531 modifier_object_set(ptr->id.data, &((LatticeModifierData*)ptr->data)->object, OB_LATTICE, value);
534 static void rna_BooleanModifier_object_set(PointerRNA *ptr, PointerRNA value)
536 modifier_object_set(ptr->id.data, &((BooleanModifierData*)ptr->data)->object, OB_MESH, value);
539 static void rna_CurveModifier_object_set(PointerRNA *ptr, PointerRNA value)
541 modifier_object_set(ptr->id.data, &((CurveModifierData*)ptr->data)->object, OB_CURVE, value);
544 static void rna_CastModifier_object_set(PointerRNA *ptr, PointerRNA value)
546 modifier_object_set(ptr->id.data, &((CastModifierData*)ptr->data)->object, OB_EMPTY, value);
549 static void rna_ArmatureModifier_object_set(PointerRNA *ptr, PointerRNA value)
551 modifier_object_set(ptr->id.data, &((ArmatureModifierData*)ptr->data)->object, OB_ARMATURE, value);
554 static void rna_MaskModifier_armature_set(PointerRNA *ptr, PointerRNA value)
556 modifier_object_set(ptr->id.data, &((MaskModifierData*)ptr->data)->ob_arm, OB_ARMATURE, value);
559 static void rna_ShrinkwrapModifier_auxiliary_target_set(PointerRNA *ptr, PointerRNA value)
561 modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData*)ptr->data)->auxTarget, OB_MESH, value);
564 static void rna_ShrinkwrapModifier_target_set(PointerRNA *ptr, PointerRNA value)
566 modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData*)ptr->data)->target, OB_MESH, value);
569 static int rna_ShrinkwrapModifier_face_cull_get(PointerRNA *ptr)
571 ShrinkwrapModifierData *swm= (ShrinkwrapModifierData*)ptr->data;
572 return swm->shrinkOpts & (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE);
575 static void rna_ShrinkwrapModifier_face_cull_set(struct PointerRNA *ptr, int value)
577 ShrinkwrapModifierData *swm= (ShrinkwrapModifierData*)ptr->data;
579 swm->shrinkOpts= (swm->shrinkOpts & ~(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) | value;
582 static void rna_MeshDeformModifier_object_set(PointerRNA *ptr, PointerRNA value)
584 modifier_object_set(ptr->id.data, &((MeshDeformModifierData*)ptr->data)->object, OB_MESH, value);
587 static void rna_ArrayModifier_end_cap_set(PointerRNA *ptr, PointerRNA value)
589 modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->end_cap, OB_MESH, value);
592 static void rna_ArrayModifier_start_cap_set(PointerRNA *ptr, PointerRNA value)
594 modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->start_cap, OB_MESH, value);
597 static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value)
599 modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value);
602 static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr)
604 return (((MeshDeformModifierData*)ptr->data)->bindcagecos != NULL);
607 static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)
609 Object *ob= (Object*)ptr->id.data;
610 return rna_pointer_inherit_refine(ptr, &RNA_SoftBodySettings, ob->soft);
613 static PointerRNA rna_SoftBodyModifier_point_cache_get(PointerRNA *ptr)
615 Object *ob= (Object*)ptr->id.data;
616 return rna_pointer_inherit_refine(ptr, &RNA_PointCache, ob->soft->pointcache);
619 static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr)
621 Object *ob= (Object*)ptr->id.data;
622 return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
625 static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr)
627 Object **ob= (Object**)ptr->data;
628 return rna_pointer_inherit_refine(ptr, &RNA_Object, *ob);
631 static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value)
633 Object **ob= (Object**)ptr->data;
638 id_us_plus((ID*)value.data);
643 static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
645 UVProjectModifierData *md= (UVProjectModifierData*)ptr->data;
648 md->num_projectors= CLAMPIS(value, 1, MOD_UVPROJECT_MAX);
649 for(a=md->num_projectors; a<MOD_UVPROJECT_MAX; a++)
650 md->projectors[a]= NULL;
653 static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr)
655 EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data;
656 return DEG2RADF(md->split_angle);
659 static void rna_EdgeSplitModifier_split_angle_set(PointerRNA *ptr, float value)
661 EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data;
662 value= RAD2DEGF(value);
663 CLAMP(value, 0.0f, 180.0f);
664 md->split_angle= (int)value;
667 static float rna_BevelModifier_angle_limit_get(PointerRNA *ptr)
669 BevelModifierData *md= (BevelModifierData*)ptr->data;
670 return DEG2RADF(md->bevel_angle);
673 static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value)
675 BevelModifierData *md= (BevelModifierData*)ptr->data;
676 value= RAD2DEGF(value);
677 CLAMP(value, 0.0f, 180.0f);
678 md->bevel_angle= (int)value;
683 static void rna_def_property_subdivision_common(StructRNA *srna, const char type[])
685 static EnumPropertyItem prop_subdivision_type_items[] = {
686 {0, "CATMULL_CLARK", 0, "Catmull-Clark", ""},
687 {1, "SIMPLE", 0, "Simple", ""},
688 {0, NULL, 0, NULL, NULL}};
690 PropertyRNA *prop= RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
691 RNA_def_property_enum_sdna(prop, NULL, type);
692 RNA_def_property_enum_items(prop, prop_subdivision_type_items);
693 RNA_def_property_ui_text(prop, "Subdivision Type", "Selects type of subdivision algorithm");
694 RNA_def_property_update(prop, 0, "rna_Modifier_update");
697 static void rna_def_modifier_subsurf(BlenderRNA *brna)
702 srna= RNA_def_struct(brna, "SubsurfModifier", "Modifier");
703 RNA_def_struct_ui_text(srna, "Subsurf Modifier", "Subdivision surface modifier");
704 RNA_def_struct_sdna(srna, "SubsurfModifierData");
705 RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
707 rna_def_property_subdivision_common(srna, "subdivType");
709 prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
710 RNA_def_property_int_sdna(prop, NULL, "levels");
711 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
712 RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform");
713 RNA_def_property_update(prop, 0, "rna_Modifier_update");
715 prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
716 RNA_def_property_int_sdna(prop, NULL, "renderLevels");
717 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
718 RNA_def_property_ui_text(prop, "Render Levels", "Number of subdivisions to perform when rendering");
720 prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
721 RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges);
722 RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
723 RNA_def_property_update(prop, 0, "rna_Modifier_update");
725 prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
726 RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv);
727 RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
728 RNA_def_property_update(prop, 0, "rna_Modifier_update");
731 static void rna_def_modifier_generic_map_info(StructRNA *srna)
733 static EnumPropertyItem prop_texture_coordinates_items[] = {
734 {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", "Uses the local coordinate system for the texture coordinates"},
735 {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Uses the global coordinate system for the texture coordinates"},
736 {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Uses the linked object's local coordinate system for the texture coordinates"},
737 {MOD_DISP_MAP_UV, "UV", 0, "UV", "Uses UV coordinates for the texture coordinates"},
738 {0, NULL, 0, NULL, NULL}};
742 prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
743 RNA_def_property_ui_text(prop, "Texture", "");
744 RNA_def_property_flag(prop, PROP_EDITABLE);
745 RNA_def_property_update(prop, 0, "rna_Modifier_update");
747 prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
748 RNA_def_property_enum_sdna(prop, NULL, "texmapping");
749 RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
750 RNA_def_property_ui_text(prop, "Texture Coordinates", "");
751 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
753 prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
754 RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
755 RNA_def_property_ui_text(prop, "UV Layer", "UV layer name");
756 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MappingInfo_uvlayer_set");
757 RNA_def_property_update(prop, 0, "rna_Modifier_update");
759 prop= RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE);
760 RNA_def_property_pointer_sdna(prop, NULL, "map_object");
761 RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Object to set the texture coordinates");
762 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
763 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
766 static void rna_def_modifier_warp(BlenderRNA *brna)
771 static EnumPropertyItem prop_falloff_items[] = {
772 {eWarp_Falloff_None, "NONE", 0, "No Falloff", ""},
773 {eWarp_Falloff_Curve, "CURVE", 0, "Curve", ""},
774 {eWarp_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
775 {eWarp_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
776 {eWarp_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""},
777 {eWarp_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
778 {eWarp_Falloff_Linear, "LINEAR", ICON_LINCURVE, "Linear", ""},
779 {eWarp_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""},
780 {0, NULL, 0, NULL, NULL}};
782 srna= RNA_def_struct(brna, "WarpModifier", "Modifier");
783 RNA_def_struct_ui_text(srna, "Warp Modifier", "Warp modifier");
784 RNA_def_struct_sdna(srna, "WarpModifierData");
785 //RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
787 prop= RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE);
788 RNA_def_property_ui_text(prop, "From", "Object to transform from");
789 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
790 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
792 prop= RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE);
793 RNA_def_property_ui_text(prop, "To", "Object to transform to");
794 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
795 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
797 prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
798 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
799 RNA_def_property_ui_range(prop, -100, 100, 10, 2);
800 RNA_def_property_ui_text(prop, "Strength", "");
801 RNA_def_property_update(prop, 0, "rna_Modifier_update");
803 prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
804 RNA_def_property_enum_items(prop, prop_falloff_items);
805 RNA_def_property_ui_text(prop, "Falloff Type", "");
806 RNA_def_property_update(prop, 0, "rna_Modifier_update");
808 prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED);
809 RNA_def_property_ui_text(prop, "Radius", "Radius to apply");
810 RNA_def_property_update(prop, 0, "rna_Modifier_update");
812 prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
813 RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
814 RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
815 RNA_def_property_update(prop, 0, "rna_Modifier_update");
817 prop= RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE);
818 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WARP_VOLUME_PRESERVE);
819 RNA_def_property_ui_text(prop, "Preserve Volume", "Preserve volume when rotations are used");
820 RNA_def_property_update(prop, 0, "rna_Modifier_update");
822 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
823 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
824 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
825 RNA_def_property_string_funcs(prop, NULL, NULL, "RNA_WarpModifier_vgroup_set");
826 RNA_def_property_update(prop, 0, "rna_Modifier_update");
828 rna_def_modifier_generic_map_info(srna);
831 static void rna_def_modifier_multires(BlenderRNA *brna)
836 srna= RNA_def_struct(brna, "MultiresModifier", "Modifier");
837 RNA_def_struct_ui_text(srna, "Multires Modifier", "Multiresolution mesh modifier");
838 RNA_def_struct_sdna(srna, "MultiresModifierData");
839 RNA_def_struct_ui_icon(srna, ICON_MOD_MULTIRES);
841 rna_def_property_subdivision_common(srna, "simple");
843 prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
844 RNA_def_property_int_sdna(prop, NULL, "lvl");
845 RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to use in the viewport");
846 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
847 RNA_def_property_update(prop, 0, "rna_Modifier_update");
849 prop= RNA_def_property(srna, "sculpt_levels", PROP_INT, PROP_UNSIGNED);
850 RNA_def_property_int_sdna(prop, NULL, "sculptlvl");
851 RNA_def_property_ui_text(prop, "Sculpt Levels", "Number of subdivisions to use in sculpt mode");
852 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
853 RNA_def_property_update(prop, 0, "rna_Modifier_update");
855 prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
856 RNA_def_property_int_sdna(prop, NULL, "renderlvl");
857 RNA_def_property_ui_text(prop, "Render Levels", "The subdivision level visible at render time");
858 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
860 prop= RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED);
861 RNA_def_property_int_sdna(prop, NULL, "totlvl");
862 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
863 RNA_def_property_ui_text(prop, "Total Levels", "Number of subdivisions for which displacements are stored");
865 prop= RNA_def_property(srna, "is_external", PROP_BOOLEAN, PROP_NONE);
866 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
867 RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", NULL);
868 RNA_def_property_ui_text(prop, "External", "Store multires displacements outside the .blend file, to save memory");
870 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
871 RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filepath_get", "rna_MultiresModifier_filepath_length", "rna_MultiresModifier_filepath_set");
872 RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
873 RNA_def_property_update(prop, 0, "rna_Modifier_update");
875 prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
876 RNA_def_property_boolean_sdna(prop, NULL, "flags", eMultiresModifierFlag_ControlEdges);
877 RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
878 RNA_def_property_update(prop, 0, "rna_Modifier_update");
880 prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
881 RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", eMultiresModifierFlag_PlainUv);
882 RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
883 RNA_def_property_update(prop, 0, "rna_Modifier_update");
886 static void rna_def_modifier_lattice(BlenderRNA *brna)
891 srna= RNA_def_struct(brna, "LatticeModifier", "Modifier");
892 RNA_def_struct_ui_text(srna, "Lattice Modifier", "Lattice deformation modifier");
893 RNA_def_struct_sdna(srna, "LatticeModifierData");
894 RNA_def_struct_ui_icon(srna, ICON_MOD_LATTICE);
896 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
897 RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with");
898 RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL, "rna_Lattice_object_poll");
899 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
900 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
902 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
903 RNA_def_property_string_sdna(prop, NULL, "name");
904 RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
905 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_LatticeModifier_vgroup_set");
906 RNA_def_property_update(prop, 0, "rna_Modifier_update");
909 static void rna_def_modifier_curve(BlenderRNA *brna)
914 static EnumPropertyItem prop_deform_axis_items[] = {
915 {MOD_CURVE_POSX, "POS_X", 0, "X", ""},
916 {MOD_CURVE_POSY, "POS_Y", 0, "Y", ""},
917 {MOD_CURVE_POSZ, "POS_Z", 0, "Z", ""},
918 {MOD_CURVE_NEGX, "NEG_X", 0, "-X", ""},
919 {MOD_CURVE_NEGY, "NEG_Y", 0, "-Y", ""},
920 {MOD_CURVE_NEGZ, "NEG_Z", 0, "-Z", ""},
921 {0, NULL, 0, NULL, NULL}};
923 srna= RNA_def_struct(brna, "CurveModifier", "Modifier");
924 RNA_def_struct_ui_text(srna, "Curve Modifier", "Curve deformation modifier");
925 RNA_def_struct_sdna(srna, "CurveModifierData");
926 RNA_def_struct_ui_icon(srna, ICON_MOD_CURVE);
928 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
929 RNA_def_property_ui_text(prop, "Object", "Curve object to deform with");
930 RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL, "rna_Curve_object_poll");
931 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
932 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
934 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
935 RNA_def_property_string_sdna(prop, NULL, "name");
936 RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
937 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CurveModifier_vgroup_set");
938 RNA_def_property_update(prop, 0, "rna_Modifier_update");
940 prop= RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE);
941 RNA_def_property_enum_sdna(prop, NULL, "defaxis");
942 RNA_def_property_enum_items(prop, prop_deform_axis_items);
943 RNA_def_property_ui_text(prop, "Deform Axis", "The axis that the curve deforms along");
944 RNA_def_property_update(prop, 0, "rna_Modifier_update");
947 static void rna_def_modifier_build(BlenderRNA *brna)
952 srna= RNA_def_struct(brna, "BuildModifier", "Modifier");
953 RNA_def_struct_ui_text(srna, "Build Modifier", "Build effect modifier");
954 RNA_def_struct_sdna(srna, "BuildModifierData");
955 RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD);
957 prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
958 RNA_def_property_float_sdna(prop, NULL, "start");
959 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
960 RNA_def_property_ui_text(prop, "Start", "Specify the start frame of the effect");
961 RNA_def_property_update(prop, 0, "rna_Modifier_update");
963 prop= RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME);
964 RNA_def_property_float_sdna(prop, NULL, "length");
965 RNA_def_property_range(prop, 1, MAXFRAMEF);
966 RNA_def_property_ui_text(prop, "Length", "Specify the total time the build effect requires");
967 RNA_def_property_update(prop, 0, "rna_Modifier_update");
969 prop= RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE);
970 RNA_def_property_boolean_sdna(prop, NULL, "randomize", 1);
971 RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build");
972 RNA_def_property_update(prop, 0, "rna_Modifier_update");
974 prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
975 RNA_def_property_range(prop, 1, MAXFRAMEF);
976 RNA_def_property_ui_text(prop, "Seed", "Specify the seed for random if used");
977 RNA_def_property_update(prop, 0, "rna_Modifier_update");
980 static void rna_def_modifier_mirror(BlenderRNA *brna)
985 srna= RNA_def_struct(brna, "MirrorModifier", "Modifier");
986 RNA_def_struct_ui_text(srna, "Mirror Modifier", "Mirroring modifier");
987 RNA_def_struct_sdna(srna, "MirrorModifierData");
988 RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR);
990 prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
991 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X);
992 RNA_def_property_ui_text(prop, "X", "Enable X axis mirror");
993 RNA_def_property_update(prop, 0, "rna_Modifier_update");
995 prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
996 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Y);
997 RNA_def_property_ui_text(prop, "Y", "Enable Y axis mirror");
998 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1000 prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1001 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Z);
1002 RNA_def_property_ui_text(prop, "Z", "Enable Z axis mirror");
1003 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1005 prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
1006 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_CLIPPING);
1007 RNA_def_property_ui_text(prop, "Clip", "Prevents vertices from going through the mirror during transform");
1008 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1010 prop= RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE);
1011 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP);
1012 RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)");
1013 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1015 prop= RNA_def_property(srna, "use_mirror_merge", PROP_BOOLEAN, PROP_NONE);
1016 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MOD_MIR_NO_MERGE);
1017 RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices within the merge threshold");
1018 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1020 prop= RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
1021 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U);
1022 RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the 0.5 point");
1023 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1025 prop= RNA_def_property(srna, "use_mirror_v", PROP_BOOLEAN, PROP_NONE);
1026 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_V);
1027 RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point");
1028 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1030 prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
1031 RNA_def_property_float_sdna(prop, NULL, "tolerance");
1032 RNA_def_property_range(prop, 0, FLT_MAX);
1033 RNA_def_property_ui_range(prop, 0, 1, 0.01, 6);
1034 RNA_def_property_ui_text(prop, "Merge Limit", "Distance from axis within which mirrored vertices are merged");
1035 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1037 prop= RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE);
1038 RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob");
1039 RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror");
1040 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1041 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1044 static void rna_def_modifier_decimate(BlenderRNA *brna)
1049 srna= RNA_def_struct(brna, "DecimateModifier", "Modifier");
1050 RNA_def_struct_ui_text(srna, "Decimate Modifier", "Decimation modifier");
1051 RNA_def_struct_sdna(srna, "DecimateModifierData");
1052 RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM);
1054 prop= RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE);
1055 RNA_def_property_float_sdna(prop, NULL, "percent");
1056 RNA_def_property_range(prop, 0, 1);
1057 RNA_def_property_ui_range(prop, 0, 1, 1, 2);
1058 RNA_def_property_ui_text(prop, "Ratio", "Defines the ratio of triangles to reduce to");
1059 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1061 prop= RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE);
1062 RNA_def_property_int_sdna(prop, NULL, "faceCount");
1063 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1064 RNA_def_property_ui_text(prop, "Face Count", "The current number of faces in the decimated mesh");
1067 static void rna_def_modifier_wave(BlenderRNA *brna)
1072 static EnumPropertyItem prop_texture_coordinates_items[] = {
1073 {MOD_WAV_MAP_LOCAL, "LOCAL", 0, "Local", ""},
1074 {MOD_WAV_MAP_GLOBAL, "GLOBAL", 0, "Global", ""},
1075 {MOD_WAV_MAP_OBJECT, "OBJECT", 0, "Object", ""},
1076 {MOD_WAV_MAP_UV, "MAP_UV", 0, "UV", ""},
1077 {0, NULL, 0, NULL, NULL}};
1079 srna= RNA_def_struct(brna, "WaveModifier", "Modifier");
1080 RNA_def_struct_ui_text(srna, "Wave Modifier", "Wave effect modifier");
1081 RNA_def_struct_sdna(srna, "WaveModifierData");
1082 RNA_def_struct_ui_icon(srna, ICON_MOD_WAVE);
1084 prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1085 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_X);
1086 RNA_def_property_ui_text(prop, "X", "X axis motion");
1087 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1089 prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1090 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_Y);
1091 RNA_def_property_ui_text(prop, "Y", "Y axis motion");
1092 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1094 prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
1095 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_CYCL);
1096 RNA_def_property_ui_text(prop, "Cyclic", "Cyclic wave effect");
1097 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1099 prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
1100 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM);
1101 RNA_def_property_ui_text(prop, "Normals", "Displace along normals");
1102 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1104 prop= RNA_def_property(srna, "use_normal_x", PROP_BOOLEAN, PROP_NONE);
1105 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_X);
1106 RNA_def_property_ui_text(prop, "X Normal", "Enable displacement along the X normal");
1107 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1109 prop= RNA_def_property(srna, "use_normal_y", PROP_BOOLEAN, PROP_NONE);
1110 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Y);
1111 RNA_def_property_ui_text(prop, "Y Normal", "Enable displacement along the Y normal");
1112 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1114 prop= RNA_def_property(srna, "use_normal_z", PROP_BOOLEAN, PROP_NONE);
1115 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Z);
1116 RNA_def_property_ui_text(prop, "Z Normal", "Enable displacement along the Z normal");
1117 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1119 prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE);
1120 RNA_def_property_float_sdna(prop, NULL, "timeoffs");
1121 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
1122 RNA_def_property_ui_text(prop, "Time Offset", "Either the starting frame (for positive speed) or ending frame (for negative speed.)");
1123 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1125 prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
1126 RNA_def_property_float_sdna(prop, NULL, "lifetime");
1127 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
1128 RNA_def_property_ui_text(prop, "Lifetime", "Lifetime of the wave in frames, zero means infinite");
1129 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1131 prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME);
1132 RNA_def_property_float_sdna(prop, NULL, "damp");
1133 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
1134 RNA_def_property_ui_text(prop, "Damping Time", "Number of frames in which the waves damps out after it dies");
1135 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1137 prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
1138 RNA_def_property_float_sdna(prop, NULL, "falloff");
1139 RNA_def_property_range(prop, 0, FLT_MAX);
1140 RNA_def_property_ui_range(prop, 0, 100, 100, 2);
1141 RNA_def_property_ui_text(prop, "Falloff Radius", "Distance after which it fades out");
1142 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1144 prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE);
1145 RNA_def_property_float_sdna(prop, NULL, "startx");
1146 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1147 RNA_def_property_ui_range(prop, -100, 100, 100, 2);
1148 RNA_def_property_ui_text(prop, "Start Position X", "X coordinate of the start position");
1149 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1151 prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE);
1152 RNA_def_property_float_sdna(prop, NULL, "starty");
1153 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1154 RNA_def_property_ui_range(prop, -100, 100, 100, 2);
1155 RNA_def_property_ui_text(prop, "Start Position Y", "Z coordinate of the start position");
1156 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1158 prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE);
1159 RNA_def_property_pointer_sdna(prop, NULL, "objectcenter");
1160 RNA_def_property_ui_text(prop, "Start Position Object", "Object which defines the wave center");
1161 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1162 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1164 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1165 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
1166 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the wave");
1167 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_vgroup_set");
1168 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1170 prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
1171 RNA_def_property_ui_text(prop, "Texture", "Texture for modulating the wave");
1172 RNA_def_property_flag(prop, PROP_EDITABLE);
1173 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1175 prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
1176 RNA_def_property_enum_sdna(prop, NULL, "texmapping");
1177 RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
1178 RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used for modulating input");
1179 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1181 prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
1182 RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
1183 RNA_def_property_ui_text(prop, "UV Layer", "UV layer name");
1184 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_uvlayer_set");
1185 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1187 prop= RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE);
1188 RNA_def_property_pointer_sdna(prop, NULL, "map_object");
1189 RNA_def_property_ui_text(prop, "Texture Coordinates Object", "");
1190 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1191 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1193 prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
1194 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1195 RNA_def_property_ui_range(prop, -1, 1, 10, 2);
1196 RNA_def_property_ui_text(prop, "Speed", "Speed of the wave, towards the starting point when negative");
1197 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1199 prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
1200 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1201 RNA_def_property_ui_range(prop, -2, 2, 10, 2);
1202 RNA_def_property_ui_text(prop, "Height", "Height of the wave");
1203 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1205 prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
1206 RNA_def_property_range(prop, 0, FLT_MAX);
1207 RNA_def_property_ui_range(prop, 0, 5, 10, 2);
1208 RNA_def_property_ui_text(prop, "Width", "Distance between the waves");
1209 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1211 prop= RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_DISTANCE);
1212 RNA_def_property_float_sdna(prop, NULL, "narrow");
1213 RNA_def_property_range(prop, 0, FLT_MAX);
1214 RNA_def_property_ui_range(prop, 0, 10, 10, 2);
1215 RNA_def_property_ui_text(prop, "Narrowness", "Distance between the top and the base of a wave, the higher the value, the more narrow the wave");
1216 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1219 static void rna_def_modifier_armature(BlenderRNA *brna)
1224 srna= RNA_def_struct(brna, "ArmatureModifier", "Modifier");
1225 RNA_def_struct_ui_text(srna, "Armature Modifier", "Armature deformation modifier");
1226 RNA_def_struct_sdna(srna, "ArmatureModifierData");
1227 RNA_def_struct_ui_icon(srna, ICON_MOD_ARMATURE);
1229 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1230 RNA_def_property_ui_text(prop, "Object", "Armature object to deform with");
1231 RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL, "rna_Armature_object_poll");
1232 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1233 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1235 prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
1236 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE);
1237 RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Binds Bone envelope to armature modifier");
1238 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1240 prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE);
1241 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP);
1242 RNA_def_property_ui_text(prop, "Use Vertex Groups", "Binds vertex group to armature modifier");
1243 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1245 prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
1246 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
1247 RNA_def_property_ui_text(prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
1248 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1250 prop= RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
1251 RNA_def_property_boolean_sdna(prop, NULL, "multi", 0);
1252 RNA_def_property_ui_text(prop, "Multi Modifier", "Use same input as previous modifier, and mix results using overall vgroup");
1253 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1255 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1256 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
1257 RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
1258 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureModifier_vgroup_set");
1259 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1261 prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
1262 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
1263 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
1264 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1267 static void rna_def_modifier_hook(BlenderRNA *brna)
1272 srna= RNA_def_struct(brna, "HookModifier", "Modifier");
1273 RNA_def_struct_ui_text(srna, "Hook Modifier", "Hook modifier to modify the location of vertices");
1274 RNA_def_struct_sdna(srna, "HookModifierData");
1275 RNA_def_struct_ui_icon(srna, ICON_HOOK);
1277 prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_DISTANCE);
1278 RNA_def_property_range(prop, 0, FLT_MAX);
1279 RNA_def_property_ui_range(prop, 0, 100, 100, 2);
1280 RNA_def_property_ui_text(prop, "Falloff", "If not zero, the distance from the hook where influence ends");
1281 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1283 prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
1284 RNA_def_property_range(prop, 0, 1);
1285 RNA_def_property_ui_text(prop, "Force", "Relative force of the hook");
1286 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1288 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1289 RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset");
1290 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1291 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1293 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
1294 RNA_def_property_string_sdna(prop, NULL, "subtarget");
1295 RNA_def_property_ui_text(prop, "Sub-Target", "Name of Parent Bone for hook (if applicable), also recalculates and clears offset");
1296 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1298 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1299 RNA_def_property_string_sdna(prop, NULL, "name");
1300 RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
1301 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_HookModifier_vgroup_set");
1302 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1305 static void rna_def_modifier_softbody(BlenderRNA *brna)
1310 srna= RNA_def_struct(brna, "SoftBodyModifier", "Modifier");
1311 RNA_def_struct_ui_text(srna, "Soft Body Modifier", "Soft body simulation modifier");
1312 RNA_def_struct_sdna(srna, "SoftbodyModifierData");
1313 RNA_def_struct_ui_icon(srna, ICON_MOD_SOFT);
1315 prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
1316 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1317 RNA_def_property_struct_type(prop, "SoftBodySettings");
1318 RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL, NULL);
1319 RNA_def_property_ui_text(prop, "Soft Body Settings", "");
1321 prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
1322 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1323 RNA_def_property_struct_type(prop, "PointCache");
1324 RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL, NULL);
1325 RNA_def_property_ui_text(prop, "Soft Body Point Cache", "");
1328 static void rna_def_modifier_boolean(BlenderRNA *brna)
1333 static EnumPropertyItem prop_operation_items[] = {
1334 {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", "Keeps the part of the mesh that intersects with the other selected object"},
1335 {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combines two meshes in an additive way"},
1336 {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combines two meshes in a subtractive way"},
1337 {0, NULL, 0, NULL, NULL}};
1339 srna= RNA_def_struct(brna, "BooleanModifier", "Modifier");
1340 RNA_def_struct_ui_text(srna, "Boolean Modifier", "Boolean operations modifier");
1341 RNA_def_struct_sdna(srna, "BooleanModifierData");
1342 RNA_def_struct_ui_icon(srna, ICON_MOD_BOOLEAN);
1344 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1345 RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation");
1346 RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL, "rna_Mesh_object_poll");
1347 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1348 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1350 prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
1351 RNA_def_property_enum_items(prop, prop_operation_items);
1352 RNA_def_property_ui_text(prop, "Operation", "");
1353 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1356 static void rna_def_modifier_array(BlenderRNA *brna)
1361 static EnumPropertyItem prop_fit_type_items[] = {
1362 {MOD_ARR_FIXEDCOUNT, "FIXED_COUNT", 0, "Fixed Count", "Duplicate the object a certain number of times"},
1363 {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", "Duplicate the object as many times as fits in a certain length"},
1364 {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", "Fit the duplicated objects to a curve"},
1365 {0, NULL, 0, NULL, NULL}};
1367 srna= RNA_def_struct(brna, "ArrayModifier", "Modifier");
1368 RNA_def_struct_ui_text(srna, "Array Modifier", "Array duplication modifier");
1369 RNA_def_struct_sdna(srna, "ArrayModifierData");
1370 RNA_def_struct_ui_icon(srna, ICON_MOD_ARRAY);
1372 /* Length parameters */
1373 prop= RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE);
1374 RNA_def_property_enum_items(prop, prop_fit_type_items);
1375 RNA_def_property_ui_text(prop, "Fit Type", "Array length calculation method");
1376 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1378 prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
1379 RNA_def_property_range(prop, 1, INT_MAX);
1380 RNA_def_property_ui_range(prop, 1, 1000, 1, 0);
1381 RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make");
1382 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1384 prop= RNA_def_property(srna, "fit_length", PROP_FLOAT, PROP_DISTANCE);
1385 RNA_def_property_float_sdna(prop, NULL, "length");
1386 RNA_def_property_range(prop, 0, INT_MAX);
1387 RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
1388 RNA_def_property_ui_text(prop, "Length", "Length to fit array within");
1389 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1391 prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1392 RNA_def_property_pointer_sdna(prop, NULL, "curve_ob");
1393 RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to");
1394 RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL, "rna_Curve_object_poll");
1395 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1396 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1398 /* Offset parameters */
1399 prop= RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_TRANSLATION);
1400 RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST);
1401 RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset");
1402 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1404 prop= RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
1405 RNA_def_property_float_sdna(prop, NULL, "offset");
1406 RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for the distance between arrayed items");
1407 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1409 prop= RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE);
1410 RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_RELATIVE);
1411 RNA_def_property_ui_text(prop, "Relative Offset", "Add an offset relative to the object's bounding box");
1412 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1414 prop= RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE); /* PROP_TRANSLATION causes units to be used which we dont want */
1415 RNA_def_property_float_sdna(prop, NULL, "scale");
1416 RNA_def_property_ui_text(prop, "Relative Offset Displacement", "The size of the geometry will determine the distance between arrayed items");
1417 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1419 /* Vertex merging parameters */
1420 prop= RNA_def_property(srna, "use_merge_vertices", PROP_BOOLEAN, PROP_NONE);
1421 RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGE);
1422 RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in adjacent duplicates");
1423 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1425 prop= RNA_def_property(srna, "use_merge_vertices_cap", PROP_BOOLEAN, PROP_NONE);
1426 RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGEFINAL);
1427 RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in first and last duplicates");
1428 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1430 prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
1431 RNA_def_property_float_sdna(prop, NULL, "merge_dist");
1432 RNA_def_property_range(prop, 0, FLT_MAX);
1433 RNA_def_property_ui_range(prop, 0, 1, 1, 4);
1434 RNA_def_property_ui_text(prop, "Merge Distance", "Limit below which to merge vertices");
1435 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1438 prop= RNA_def_property(srna, "use_object_offset", PROP_BOOLEAN, PROP_NONE);
1439 RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_OBJ);
1440 RNA_def_property_ui_text(prop, "Object Offset", "Add another object's transformation to the total offset");
1441 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1443 prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
1444 RNA_def_property_pointer_sdna(prop, NULL, "offset_ob");
1445 RNA_def_property_ui_text(prop, "Object Offset", "Uses the location and rotation of another object to determine the distance and rotational change between arrayed items");
1446 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1447 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1450 prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE);
1451 RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap");
1452 RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL, "rna_Mesh_object_poll");
1453 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1454 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1456 prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE);
1457 RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap");
1458 RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll");
1459 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1460 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1463 static void rna_def_modifier_edgesplit(BlenderRNA *brna)
1468 srna= RNA_def_struct(brna, "EdgeSplitModifier", "Modifier");
1469 RNA_def_struct_ui_text(srna, "EdgeSplit Modifier", "Edge splitting modifier to create sharp edges");
1470 RNA_def_struct_sdna(srna, "EdgeSplitModifierData");
1471 RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT);
1473 #if 1 /* expose as radians */
1474 prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE);
1475 RNA_def_property_float_funcs(prop, "rna_EdgeSplitModifier_split_angle_get", "rna_EdgeSplitModifier_split_angle_set", NULL);
1476 RNA_def_property_range(prop, 0, DEG2RAD(180));
1477 RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2);
1479 prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_NONE);
1480 RNA_def_property_range(prop, 0, 180);
1481 RNA_def_property_ui_range(prop, 0, 180, 100, 2);
1483 RNA_def_property_ui_text(prop, "Split Angle", "Angle above which to split edges");
1484 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1486 prop= RNA_def_property(srna, "use_edge_angle", PROP_BOOLEAN, PROP_NONE);
1487 RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMANGLE);
1488 RNA_def_property_ui_text(prop, "Use Edge Angle", "Split edges with high angle between faces");
1489 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1491 prop= RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
1492 RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMFLAG);
1493 RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp");
1494 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1497 static void rna_def_modifier_displace(BlenderRNA *brna)
1502 static EnumPropertyItem prop_direction_items[] = {
1503 {MOD_DISP_DIR_X, "X", 0, "X", "Uses the texture's intensity value to displace in the X direction"},
1504 {MOD_DISP_DIR_Y, "Y", 0, "Y", "Uses the texture's intensity value to displace in the Y direction"},
1505 {MOD_DISP_DIR_Z, "Z", 0, "Z", "Uses the texture's intensity value to displace in the Z direction"},
1506 {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", "Uses the texture's intensity value to displace in the normal direction"},
1507 {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Uses the texture's RGB values to displace the mesh in the XYZ direction"},
1508 {0, NULL, 0, NULL, NULL}};
1510 srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier");
1511 RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier");
1512 RNA_def_struct_sdna(srna, "DisplaceModifierData");
1513 RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE);
1515 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1516 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
1517 RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
1518 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_vgroup_set");
1519 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1521 prop= RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE);
1522 RNA_def_property_float_sdna(prop, NULL, "midlevel");
1523 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1524 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1525 RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement");
1526 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1528 prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
1529 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1530 RNA_def_property_ui_range(prop, -100, 100, 10, 3);
1531 RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry");
1532 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1534 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
1535 RNA_def_property_enum_items(prop, prop_direction_items);
1536 RNA_def_property_ui_text(prop, "Direction", "");
1537 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1539 rna_def_modifier_generic_map_info(srna);
1542 static void rna_def_modifier_uvproject(BlenderRNA *brna)
1547 srna= RNA_def_struct(brna, "UVProjectModifier", "Modifier");
1548 RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to sets UVs from a projector");
1549 RNA_def_struct_sdna(srna, "UVProjectModifierData");
1550 RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT);
1552 prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
1553 RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
1554 RNA_def_property_ui_text(prop, "UV Layer", "UV layer name");
1555 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set");
1556 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1558 prop= RNA_def_property(srna, "projector_count", PROP_INT, PROP_NONE);
1559 RNA_def_property_int_sdna(prop, NULL, "num_projectors");
1560 RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use");
1561 RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL);
1562 RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX);
1563 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1565 prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE);
1566 RNA_def_property_struct_type(prop, "UVProjector");
1567 RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
1568 RNA_def_property_ui_text(prop, "Projectors", "");
1570 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
1571 RNA_def_property_ui_text(prop, "Image", "");
1572 RNA_def_property_flag(prop, PROP_EDITABLE);
1573 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1575 prop= RNA_def_property(srna, "aspect_x", PROP_FLOAT, PROP_NONE);
1576 RNA_def_property_float_sdna(prop, NULL, "aspectx");
1577 RNA_def_property_range(prop, 1, FLT_MAX);
1578 RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
1579 RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", "");
1580 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1582 prop= RNA_def_property(srna, "aspect_y", PROP_FLOAT, PROP_NONE);
1583 RNA_def_property_float_sdna(prop, NULL, "aspecty");
1584 RNA_def_property_range(prop, 1, FLT_MAX);
1585 RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
1586 RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", "");
1587 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1589 prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
1590 RNA_def_property_float_sdna(prop, NULL, "scalex");
1591 RNA_def_property_range(prop, 0, FLT_MAX);
1592 RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
1593 RNA_def_property_ui_text(prop, "Horizontal Scale", "");
1594 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1596 prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
1597 RNA_def_property_float_sdna(prop, NULL, "scaley");
1598 RNA_def_property_range(prop, 0, FLT_MAX);
1599 RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
1600 RNA_def_property_ui_text(prop, "Vertical Scale", "");
1601 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1603 prop= RNA_def_property(srna, "use_image_override", PROP_BOOLEAN, PROP_NONE);
1604 RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE);
1605 RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image");
1606 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1608 srna= RNA_def_struct(brna, "UVProjector", NULL);
1609 RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier");
1611 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1612 RNA_def_property_struct_type(prop, "Object");
1613 RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL, NULL);
1614 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1615 RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform");
1616 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1619 static void rna_def_modifier_smooth(BlenderRNA *brna)
1624 srna= RNA_def_struct(brna, "SmoothModifier", "Modifier");
1625 RNA_def_struct_ui_text(srna, "Smooth Modifier", "Smoothing effect modifier");
1626 RNA_def_struct_sdna(srna, "SmoothModifierData");
1627 RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
1629 prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1630 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X);
1631 RNA_def_property_ui_text(prop, "X", "Smooth object along X axis");
1632 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1634 prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1635 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y);
1636 RNA_def_property_ui_text(prop, "Y", "Smooth object along Y axis");
1637 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1639 prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1640 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z);
1641 RNA_def_property_ui_text(prop, "Z", "Smooth object along Z axis");
1642 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1644 prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
1645 RNA_def_property_float_sdna(prop, NULL, "fac");
1646 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1647 RNA_def_property_ui_range(prop, -10, 10, 1, 3);
1648 RNA_def_property_ui_text(prop, "Factor", "Strength of modifier effect");
1649 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1651 prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
1652 RNA_def_property_int_sdna(prop, NULL, "repeat");
1653 RNA_def_property_ui_range(prop, 0, 30, 1, 0);
1654 RNA_def_property_ui_text(prop, "Repeat", "");
1655 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1657 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1658 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
1659 RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
1660 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SmoothModifier_vgroup_set");
1661 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1664 static void rna_def_modifier_cast(BlenderRNA *brna)
1669 static EnumPropertyItem prop_cast_type_items[] = {
1670 {MOD_CAST_TYPE_SPHERE, "SPHERE", 0, "Sphere", ""},
1671 {MOD_CAST_TYPE_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
1672 {MOD_CAST_TYPE_CUBOID, "CUBOID", 0, "Cuboid", ""},
1673 {0, NULL, 0, NULL, NULL}};
1675 srna= RNA_def_struct(brna, "CastModifier", "Modifier");
1676 RNA_def_struct_ui_text(srna, "Cast Modifier", "Cast modifier to cast to other shapes");
1677 RNA_def_struct_sdna(srna, "CastModifierData");
1678 RNA_def_struct_ui_icon(srna, ICON_MOD_CAST);
1680 prop= RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE);
1681 RNA_def_property_enum_sdna(prop, NULL, "type");
1682 RNA_def_property_enum_items(prop, prop_cast_type_items);
1683 RNA_def_property_ui_text(prop, "Cast Type", "Target object shape");
1684 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1686 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1687 RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect");
1688 RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL, NULL);
1689 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1690 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1692 prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1693 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_X);
1694 RNA_def_property_ui_text(prop, "X", "");
1695 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1697 prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1698 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Y);
1699 RNA_def_property_ui_text(prop, "Y", "");
1700 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1702 prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1703 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Z);
1704 RNA_def_property_ui_text(prop, "Z", "");
1705 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1707 prop= RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE);
1708 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS);
1709 RNA_def_property_ui_text(prop, "From Radius", "Use radius as size of projection shape (0 = auto)");
1710 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1712 prop= RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE);
1713 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_USE_OB_TRANSFORM);
1714 RNA_def_property_ui_text(prop, "Use transform", "Use object transform to control projection shape");
1715 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1717 prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
1718 RNA_def_property_float_sdna(prop, NULL, "fac");
1719 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1720 RNA_def_property_ui_range(prop, -10, 10, 5, 2);
1721 RNA_def_property_ui_text(prop, "Factor", "");
1722 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1724 prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
1725 RNA_def_property_range(prop, 0, FLT_MAX);
1726 RNA_def_property_ui_range(prop, 0, 100, 5, 2);
1727 RNA_def_property_ui_text(prop, "Radius", "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite.)");
1728 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1730 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
1731 RNA_def_property_range(prop, 0, FLT_MAX);
1732 RNA_def_property_ui_range(prop, 0, 100, 5, 2);
1733 RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto.)");
1734 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1736 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1737 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
1738 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
1739 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CastModifier_vgroup_set");
1740 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1743 static void rna_def_modifier_meshdeform(BlenderRNA *brna)
1748 static EnumPropertyItem prop_mode_items[] = {
1749 {0, "VOLUME", 0, "Volume", "Bind to volume inside cage mesh"},
1750 {1, "SURFACE", 0, "Surface", "Bind to surface of cage mesh"},
1751 {0, NULL, 0, NULL, NULL}};
1754 srna= RNA_def_struct(brna, "MeshDeformModifier", "Modifier");
1755 RNA_def_struct_ui_text(srna, "MeshDeform Modifier", "Mesh deformation modifier to deform with other meshes");
1756 RNA_def_struct_sdna(srna, "MeshDeformModifierData");
1757 RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);
1759 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1760 RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with");
1761 RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL, NULL);
1762 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1763 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1765 prop= RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE);
1766 RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", NULL);
1767 RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage");
1768 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1770 prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
1771 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP);
1772 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
1773 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1775 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1776 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
1777 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
1778 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshDeformModifier_vgroup_set");
1779 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1781 prop= RNA_def_property(srna, "precision", PROP_INT, PROP_NONE);
1782 RNA_def_property_int_sdna(prop, NULL, "gridsize");
1783 RNA_def_property_range(prop, 2, 10);
1784 RNA_def_property_ui_text(prop, "Precision", "The grid size for binding");
1785 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1787 prop= RNA_def_property(srna, "use_dynamic_bind", PROP_BOOLEAN, PROP_NONE);
1788 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_DYNAMIC_BIND);
1789 RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming.)");
1790 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1793 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1794 RNA_def_property_enum_items(prop, prop_mode_items);
1795 RNA_def_property_ui_text(prop, "Mode", "Method of binding vertices are bound to cage mesh");
1796 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1800 static void rna_def_modifier_particlesystem(BlenderRNA *brna)
1805 srna= RNA_def_struct(brna, "ParticleSystemModifier", "Modifier");
1806 RNA_def_struct_ui_text(srna, "ParticleSystem Modifier", "Particle system simulation modifier");
1807 RNA_def_struct_sdna(srna, "ParticleSystemModifierData");
1808 RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
1810 prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
1811 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1812 RNA_def_property_pointer_sdna(prop, NULL, "psys");
1813 RNA_def_property_ui_text(prop, "Particle System", "Particle System that this modifier controls");
1816 static void rna_def_modifier_particleinstance(BlenderRNA *brna)
1821 static EnumPropertyItem particleinstance_axis[] = {
1822 {0, "X", 0, "X", ""},
1823 {1, "Y", 0, "Y", ""},
1824 {2, "Z", 0, "Z", ""},
1825 {0, NULL, 0, NULL, NULL}
1828 srna= RNA_def_struct(brna, "ParticleInstanceModifier", "Modifier");
1829 RNA_def_struct_ui_text(srna, "ParticleInstance Modifier", "Particle system instancing modifier");
1830 RNA_def_struct_sdna(srna, "ParticleInstanceModifierData");
1831 RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
1833 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1834 RNA_def_property_pointer_sdna(prop, NULL, "ob");
1835 RNA_def_property_ui_text(prop, "Object", "Object that has the particle system");
1836 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
1837 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
1839 prop= RNA_def_property(srna, "particle_system_index", PROP_INT, PROP_NONE);
1840 RNA_def_property_int_sdna(prop, NULL, "psys");
1841 RNA_def_property_range(prop, 1, 10);
1842 RNA_def_property_ui_text(prop, "Particle System Number", "");
1843 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1845 prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
1846 RNA_def_property_enum_sdna(prop, NULL, "axis");
1847 RNA_def_property_enum_items(prop, particleinstance_axis);
1848 RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation");
1849 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1851 prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
1852 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents);
1853 RNA_def_property_ui_text(prop, "Normal", "Create instances from normal particles");
1854 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1856 prop= RNA_def_property(srna, "use_children", PROP_BOOLEAN, PROP_NONE);
1857 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Children);
1858 RNA_def_property_ui_text(prop, "Children", "Create instances from child particles");
1859 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1861 prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
1862 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path);
1863 RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths");
1864 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1866 prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
1867 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Unborn);
1868 RNA_def_property_ui_text(prop, "Unborn", "Show instances when particles are unborn");
1869 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1871 prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
1872 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Alive);
1873 RNA_def_property_ui_text(prop, "Alive", "Show instances when particles are alive");
1874 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1876 prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
1877 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead);
1878 RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead");
1879 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1881 prop= RNA_def_property(srna, "use_preserve_shape", PROP_BOOLEAN, PROP_NONE);
1882 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape);
1883 RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object");
1884 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1886 prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
1887 RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize);
1888 RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances");
1889 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1891 prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
1892 RNA_def_property_float_sdna(prop, NULL, "position");
1893 RNA_def_property_range(prop, 0.0, 1.0);
1894 RNA_def_property_ui_text(prop, "Position", "Position along path");
1895 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1897 prop= RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE);
1898 RNA_def_property_float_sdna(prop, NULL, "random_position");
1899 RNA_def_property_range(prop, 0.0, 1.0);
1900 RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path");
1901 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1904 static void rna_def_modifier_explode(BlenderRNA *brna)
1909 srna= RNA_def_struct(brna, "ExplodeModifier", "Modifier");
1910 RNA_def_struct_ui_text(srna, "Explode Modifier", "Explosion effect modifier based on a particle system");
1911 RNA_def_struct_sdna(srna, "ExplodeModifierData");
1912 RNA_def_struct_ui_icon(srna, ICON_MOD_EXPLODE);
1914 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
1915 RNA_def_property_string_funcs(prop, "rna_ExplodeModifier_vgroup_get", "rna_ExplodeModifier_vgroup_length", "rna_ExplodeModifier_vgroup_set");
1916 RNA_def_property_ui_text(prop, "Vertex Group", "");
1918 prop= RNA_def_property(srna, "protect", PROP_FLOAT, PROP_NONE);
1919 RNA_def_property_range(prop, 0, 1);
1920 RNA_def_property_ui_text(prop, "Protect", "Clean vertex group edges");
1921 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1923 prop= RNA_def_property(srna, "use_edge_cut", PROP_BOOLEAN, PROP_NONE);
1924 RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_EdgeCut);
1925 RNA_def_property_ui_text(prop, "Cut Edges", "Cut face edges for nicer shrapnel");
1926 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1928 prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
1929 RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Unborn);
1930 RNA_def_property_ui_text(prop, "Unborn", "Show mesh when particles are unborn");
1931 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1933 prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
1934 RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Alive);
1935 RNA_def_property_ui_text(prop, "Alive", "Show mesh when particles are alive");
1936 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1938 prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
1939 RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Dead);
1940 RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead");
1941 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1943 prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
1944 RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_PaSize);
1945 RNA_def_property_ui_text(prop, "Size", "Use particle size for the shrapnel");
1946 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1948 prop= RNA_def_property(srna, "particle_uv", PROP_STRING, PROP_NONE);
1949 RNA_def_property_string_sdna(prop, NULL, "uvname");
1950 RNA_def_property_string_maxlength(prop, 32);
1951 RNA_def_property_ui_text(prop, "Particle UV", "UV Layer to change with particle age");
1952 RNA_def_property_update(prop, 0, "rna_Modifier_update");
1955 static void rna_def_modifier_cloth(BlenderRNA *brna)
1960 srna= RNA_def_struct(brna, "ClothModifier", "Modifier");
1961 RNA_def_struct_ui_text(srna, "Cloth Modifier", "Cloth simulation modifier");
1962 RNA_def_struct_sdna(srna, "ClothModifierData");
1963 RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH);
1965 prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
1966 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1967 RNA_def_property_pointer_sdna(prop, NULL, "sim_parms");
1968 RNA_def_property_ui_text(prop, "Cloth Settings", "");
1970 prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE);
1971 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1972 RNA_def_property_pointer_sdna(prop, NULL, "coll_parms");
1973 RNA_def_property_ui_text(prop, "Cloth Collision Settings", "");
1975 prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
1976 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1977 RNA_def_property_ui_text(prop, "Point Cache", "");
1980 static void rna_def_modifier_smoke(BlenderRNA *brna)
1985 static EnumPropertyItem prop_smoke_type_items[] = {
1986 {0, "NONE", 0, "None", ""},
1987 {MOD_SMOKE_TYPE_DOMAIN, "DOMAIN", 0, "Domain", ""},
1988 {MOD_SMOKE_TYPE_FLOW, "FLOW", 0, "Flow", "Inflow/Outflow"},
1989 {MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""},
1990 {0, NULL, 0, NULL, NULL}};
1992 srna= RNA_def_struct(brna, "SmokeModifier", "Modifier");
1993 RNA_def_struct_ui_text(srna, "Smoke Modifier", "Smoke simulation modifier");
1994 RNA_def_struct_sdna(srna, "SmokeModifierData");
1995 RNA_def_struct_ui_icon(srna, ICON_MOD_SMOKE);
1997 prop= RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE);
1998 RNA_def_property_pointer_sdna(prop, NULL, "domain");
1999 RNA_def_property_ui_text(prop, "Domain Settings", "");
2001 prop= RNA_def_property(srna, "flow_settings", PROP_POINTER, PROP_NONE);
2002 RNA_def_property_pointer_sdna(prop, NULL, "flow");
2003 RNA_def_property_ui_text(prop, "Flow Settings", "");
2005 prop= RNA_def_property(srna, "coll_settings", PROP_POINTER, PROP_NONE);
2006 RNA_def_property_pointer_sdna(prop, NULL, "coll");
2007 RNA_def_property_ui_text(prop, "Collision Settings", "");
2009 prop= RNA_def_property(srna, "smoke_type", PROP_ENUM, PROP_NONE);
2010 RNA_def_property_enum_sdna(prop, NULL, "type");
2011 RNA_def_property_enum_items(prop, prop_smoke_type_items);
2012 RNA_def_property_ui_text(prop, "Type", "");
2013 RNA_def_property_update(prop, 0, "rna_Smoke_set_type");
2016 static void rna_def_modifier_collision(BlenderRNA *brna)
2021 srna= RNA_def_struct(brna, "CollisionModifier", "Modifier");
2022 RNA_def_struct_ui_text(srna, "Collision Modifier", "Collision modifier defining modifier stack position used for collision");
2023 RNA_def_struct_sdna(srna, "CollisionModifierData");
2024 RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
2026 prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
2027 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2028 RNA_def_property_struct_type(prop, "CollisionSettings");
2029 RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL, NULL);
2030 RNA_def_property_ui_text(prop, "Settings", "");
2033 static void rna_def_modifier_bevel(BlenderRNA *brna)
2038 static EnumPropertyItem prop_limit_method_items[] = {
2039 {0, "NONE", 0, "None", "Bevel the entire mesh by a constant amount"},
2040 {BME_BEVEL_ANGLE, "ANGLE", 0, "Angle", "Only bevel edges with sharp enough angles between faces"},
2041 {BME_BEVEL_WEIGHT, "WEIGHT", 0, "Weight", "Use bevel weights to determine how much bevel is applied; apply them separately in vert/edge select mode"},
2042 {0, NULL, 0, NULL, NULL}};
2044 static EnumPropertyItem prop_edge_weight_method_items[] = {
2045 {0, "AVERAGE", 0, "Average", ""},
2046 {BME_BEVEL_EMIN, "SHARPEST", 0, "Sharpest", ""},
2047 {BME_BEVEL_EMAX, "LARGEST", 0, "Largest", ""},
2048 {0, NULL, 0, NULL, NULL}};
2050 srna= RNA_def_struct(brna, "BevelModifier", "Modifier");
2051 RNA_def_struct_ui_text(srna, "Bevel Modifier", "Bevel modifier to make edges and vertices more rounded");
2052 RNA_def_struct_sdna(srna, "BevelModifierData");
2053 RNA_def_struct_ui_icon(srna, ICON_MOD_BEVEL);
2055 prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
2056 RNA_def_property_float_sdna(prop, NULL, "value");
2057 RNA_def_property_range(prop, 0, FLT_MAX);
2058 RNA_def_property_ui_range(prop, 0, 10, 0.1, 4);
2059 RNA_def_property_ui_text(prop, "Width", "Bevel value/amount");
2060 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2062 prop= RNA_def_property(srna, "use_only_vertices", PROP_BOOLEAN, PROP_NONE);
2063 RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_VERT);
2064 RNA_def_property_ui_text(prop, "Only Vertices", "Bevel verts/corners, not edges");
2065 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2067 prop= RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE);
2068 RNA_def_property_enum_sdna(prop, NULL, "lim_flags");
2069 RNA_def_property_enum_items(prop, prop_limit_method_items);
2070 RNA_def_property_ui_text(prop, "Limit Method", "");
2071 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2073 prop= RNA_def_property(srna, "edge_weight_method", PROP_ENUM, PROP_NONE);
2074 RNA_def_property_enum_sdna(prop, NULL, "e_flags");
2075 RNA_def_property_enum_items(prop, prop_edge_weight_method_items);
2076 RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex");
2077 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2079 #if 1 /* expose as radians */
2080 prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE);
2081 RNA_def_property_float_funcs(prop, "rna_BevelModifier_angle_limit_get", "rna_BevelModifier_angle_limit_set", NULL);
2082 RNA_def_property_range(prop, 0, DEG2RAD(180));
2083 RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2);
2085 prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_NONE);
2086 RNA_def_property_float_sdna(prop, NULL, "bevel_angle");
2087 RNA_def_property_range(prop, 0, 180);
2088 RNA_def_property_ui_range(prop, 0, 180, 100, 2);
2090 RNA_def_property_ui_text(prop, "Angle", "Angle above which to bevel edges");
2091 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2094 static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
2099 static EnumPropertyItem shrink_type_items[] = {
2100 {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", "Shrinks the mesh to the nearest target surface"},
2101 {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrinks the mesh to the nearest target surface along a given axis"},
2102 {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrinks the mesh to the nearest target vertex"},
2103 {0, NULL, 0, NULL, NULL}};
2105 static EnumPropertyItem shrink_face_cull_items[] = {
2106 {0, "OFF", 0, "Off", ""},
2107 {MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, "FRONT", 0, "Front", ""},
2108 {MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, "BACK", 0, "Back", ""},
2109 {0, NULL, 0, NULL, NULL}};
2111 srna= RNA_def_struct(brna, "ShrinkwrapModifier", "Modifier");
2112 RNA_def_struct_ui_text(srna, "Shrinkwrap Modifier", "Shrink wrapping modifier to shrink wrap and object to a target");
2113 RNA_def_struct_sdna(srna, "ShrinkwrapModifierData");
2114 RNA_def_struct_ui_icon(srna, ICON_MOD_SHRINKWRAP);
2116 prop= RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE);
2117 RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
2118 RNA_def_property_enum_items(prop, shrink_type_items);
2119 RNA_def_property_ui_text(prop, "Mode", "");
2120 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2122 prop= RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
2123 RNA_def_property_enum_sdna(prop, NULL, "shrinkOpts");
2124 RNA_def_property_enum_items(prop, shrink_face_cull_items);
2125 RNA_def_property_enum_funcs(prop, "rna_ShrinkwrapModifier_face_cull_get", "rna_ShrinkwrapModifier_face_cull_set", NULL);
2126 RNA_def_property_ui_text(prop, "Face Cull", "Stop vertices from projecting to a the face on the target when facing towards/away");
2127 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2129 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2130 RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to");
2131 RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL, "rna_Mesh_object_poll");
2132 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2133 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2135 prop= RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
2136 RNA_def_property_pointer_sdna(prop, NULL, "auxTarget");
2137 RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to");
2138 RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL, "rna_Mesh_object_poll");
2139 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2140 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2142 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2143 RNA_def_property_string_sdna(prop, NULL, "vgroup_name");
2144 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
2145 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShrinkwrapModifier_vgroup_set");
2146 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2148 prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
2149 RNA_def_property_float_sdna(prop, NULL, "keepDist");
2150 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2151 RNA_def_property_ui_range(prop, -100, 100, 1, 2);
2152 RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target");
2153 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2155 prop= RNA_def_property(srna, "use_project_x", PROP_BOOLEAN, PROP_NONE);
2156 RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS);
2157 RNA_def_property_ui_text(prop, "X", "");
2158 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2160 prop= RNA_def_property(srna, "use_project_y", PROP_BOOLEAN, PROP_NONE);
2161 RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS);
2162 RNA_def_property_ui_text(prop, "Y", "");
2163 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2165 prop= RNA_def_property(srna, "use_project_z", PROP_BOOLEAN, PROP_NONE);
2166 RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS);
2167 RNA_def_property_ui_text(prop, "Z", "");
2168 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2170 prop= RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE);
2171 RNA_def_property_int_sdna(prop, NULL, "subsurfLevels");
2172 RNA_def_property_range(prop, 0, 6);
2173 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
2174 RNA_def_property_ui_text(prop, "Subsurf Levels", "Number of subdivisions that must be performed before extracting vertices' positions and normals");
2175 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2177 prop= RNA_def_property(srna, "use_negative_direction", PROP_BOOLEAN, PROP_NONE);
2178 RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR);
2179 RNA_def_property_ui_text(prop, "Negative", "Allow vertices to move in the negative direction of axis");
2180 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2182 prop= RNA_def_property(srna, "use_positive_direction", PROP_BOOLEAN, PROP_NONE);
2183 RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR);
2184 RNA_def_property_ui_text(prop, "Positive", "Allow vertices to move in the positive direction of axis");
2185 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2187 prop= RNA_def_property(srna, "use_keep_above_surface", PROP_BOOLEAN, PROP_NONE);
2188 RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE);
2189 RNA_def_property_ui_text(prop, "Keep Above Surface", "");
2190 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2193 static void rna_def_modifier_fluidsim(BlenderRNA *brna)
2198 srna= RNA_def_struct(brna, "FluidSimulationModifier", "Modifier");
2199 RNA_def_struct_ui_text(srna, "Fluid Simulation Modifier", "Fluid simulation modifier");
2200 RNA_def_struct_sdna(srna, "FluidsimModifierData");
2201 RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM);
2203 prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
2204 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2205 RNA_def_property_pointer_sdna(prop, NULL, "fss");
2206 RNA_def_property_ui_text(prop, "Settings", "Settings for how this object is used in the fluid simulation");
2209 static void rna_def_modifier_mask(BlenderRNA *brna)
2214 static EnumPropertyItem modifier_mask_mode_items[] = {
2215 {MOD_MASK_MODE_VGROUP, "VERTEX_GROUP", 0, "Vertex Group", ""},
2216 {MOD_MASK_MODE_ARM, "ARMATURE", 0, "Armature", ""},
2217 {0, NULL, 0, NULL, NULL}};
2219 srna= RNA_def_struct(brna, "MaskModifier", "Modifier");
2220 RNA_def_struct_ui_text(srna, "Mask Modifier", "Mask modifier to hide parts of the mesh");
2221 RNA_def_struct_sdna(srna, "MaskModifierData");
2222 RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);
2224 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
2225 RNA_def_property_enum_items(prop, modifier_mask_mode_items);
2226 RNA_def_property_ui_text(prop, "Mode", "");
2227 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2229 prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE);
2230 RNA_def_property_pointer_sdna(prop, NULL, "ob_arm");
2231 RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask");
2232 RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL, "rna_Armature_object_poll");
2233 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2234 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2236 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2237 RNA_def_property_string_sdna(prop, NULL, "vgroup");
2238 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
2239 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MaskModifier_vgroup_set");
2240 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2242 prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
2243 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MASK_INV);
2244 RNA_def_property_ui_text(prop, "Invert", "Use vertices that are not part of region defined");
2245 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2248 static void rna_def_modifier_simpledeform(BlenderRNA *brna)
2253 static EnumPropertyItem simple_deform_mode_items[] = {
2254 {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", "Rotates around the Z axis of the modifier space"},
2255 {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", "Bends the mesh over the Z axis of the modifier space"},
2256 {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scales along Z axis of the modifier space"},
2257 {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretches the object along the Z axis of the modifier space"},
2258 {0, NULL, 0, NULL, NULL}};
2260 srna= RNA_def_struct(brna, "SimpleDeformModifier", "Modifier");
2261 RNA_def_struct_ui_text(srna, "SimpleDeform Modifier", "Simple deformation modifier to apply effects such as twisting and bending");
2262 RNA_def_struct_sdna(srna, "SimpleDeformModifierData");
2263 RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLEDEFORM);
2265 prop= RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
2266 RNA_def_property_enum_sdna(prop, NULL, "mode");
2267 RNA_def_property_enum_items(prop, simple_deform_mode_items);
2268 RNA_def_property_ui_text(prop, "Mode", "");
2269 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2271 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2272 RNA_def_property_string_sdna(prop, NULL, "vgroup_name");
2273 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
2274 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SimpleDeformModifier_vgroup_set");
2275 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2277 prop= RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE);
2278 RNA_def_property_ui_text(prop, "Origin", "Origin of modifier space coordinates");
2279 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2280 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2282 prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
2283 RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL);
2284 RNA_def_property_ui_text(prop, "Relative", "Sets the origin of deform space to be relative to the object");
2285 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2287 prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
2288 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2289 RNA_def_property_ui_range(prop, -10, 10, 1, 3);
2290 RNA_def_property_ui_text(prop, "Factor", "Amount to deform object");
2291 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2293 prop= RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE);
2294 RNA_def_property_float_sdna(prop, NULL, "limit");
2295 RNA_def_property_array(prop, 2);
2296 RNA_def_property_range(prop, 0, 1);
2297 RNA_def_property_ui_range(prop, 0, 1, 5, 2);
2298 RNA_def_property_ui_text(prop, "Limits", "Lower/Upper limits for deform");
2299 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2301 prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
2302 RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X);
2303 RNA_def_property_ui_text(prop, "Lock X Axis", "Do not allow tapering along the X axis");
2304 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2306 prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
2307 RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y);
2308 RNA_def_property_ui_text(prop, "Lock Y Axis", "Do not allow tapering along the Y axis");
2309 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2312 static void rna_def_modifier_surface(BlenderRNA *brna)
2316 srna= RNA_def_struct(brna, "SurfaceModifier", "Modifier");
2317 RNA_def_struct_ui_text(srna, "Surface Modifier", "Surface modifier defining modifier stack position used for surface fields");
2318 RNA_def_struct_sdna(srna, "SurfaceModifierData");
2319 RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
2322 static void rna_def_modifier_solidify(BlenderRNA *brna)
2327 srna= RNA_def_struct(brna, "SolidifyModifier", "Modifier");
2328 RNA_def_struct_ui_text(srna, "Solidify Modifier", "Create a solid skin by extruding, compensating for sharp angles");
2329 RNA_def_struct_sdna(srna, "SolidifyModifierData");
2330 RNA_def_struct_ui_icon(srna, ICON_MOD_SOLIDIFY);
2332 prop= RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_DISTANCE);
2333 RNA_def_property_float_sdna(prop, NULL, "offset");
2334 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2335 RNA_def_property_ui_range(prop, -10, 10, 0.1, 4);
2336 RNA_def_property_ui_text(prop, "Thickness", "Thickness of the shell");
2337 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2339 prop= RNA_def_property(srna, "thickness_vertex_group", PROP_FLOAT, PROP_FACTOR);
2340 RNA_def_property_float_sdna(prop, NULL, "offset_fac_vg");
2341 RNA_def_property_range(prop, 0.0, 1.0);
2342 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
2343 RNA_def_property_ui_text(prop, "Vertex Group Factor", "Thickness factor to use for zero vertex group influence");
2344 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2346 prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
2347 RNA_def_property_float_sdna(prop, NULL, "offset_fac");
2348 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2349 RNA_def_property_ui_range(prop, -1, 1, 0.1, 4);
2350 RNA_def_property_ui_text(prop, "Offset", "Offset the thickness from the center");
2351 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2353 prop= RNA_def_property(srna, "edge_crease_inner", PROP_FLOAT, PROP_FACTOR);
2354 RNA_def_property_float_sdna(prop, NULL, "crease_inner");
2355 RNA_def_property_range(prop, 0, 1);
2356 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
2357 RNA_def_property_ui_text(prop, "Inner Crease", "Assign a crease to inner edges");
2358 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2360 prop= RNA_def_property(srna, "edge_crease_outer", PROP_FLOAT, PROP_FACTOR);
2361 RNA_def_property_float_sdna(prop, NULL, "crease_outer");
2362 RNA_def_property_range(prop, 0, 1);
2363 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
2364 RNA_def_property_ui_text(prop, "Outer Crease", "Assign a crease to outer edges");
2365 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2367 prop= RNA_def_property(srna, "edge_crease_rim", PROP_FLOAT, PROP_FACTOR);
2368 RNA_def_property_float_sdna(prop, NULL, "crease_rim");
2369 RNA_def_property_range(prop, 0, 1);
2370 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
2371 RNA_def_property_ui_text(prop, "Rim Crease", "Assign a crease to the edges making up the rim");
2372 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2374 prop= RNA_def_property(srna, "material_offset", PROP_INT, PROP_NONE);
2375 RNA_def_property_int_sdna(prop, NULL, "mat_ofs");
2376 RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
2377 RNA_def_property_ui_text(prop, "Material Offset", "Offset material index of generated faces");
2378 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2380 prop= RNA_def_property(srna, "material_offset_rim", PROP_INT, PROP_NONE);
2381 RNA_def_property_int_sdna(prop, NULL, "mat_ofs_rim");
2382 RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
2383 RNA_def_property_ui_text(prop, "Rim Material Offset", "Offset material index of generated rim faces");
2384 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2386 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2387 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
2388 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
2389 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SolidifyModifier_vgroup_set");
2390 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2392 prop= RNA_def_property(srna, "use_rim", PROP_BOOLEAN, PROP_NONE);
2393 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_RIM);
2394 RNA_def_property_ui_text(prop, "Fill Rim", "Create edge loops between the inner and outer surfaces on face edges (slow, disable when not needed)");
2395 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2397 prop= RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
2398 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_EVEN);
2399 RNA_def_property_ui_text(prop, "Even Thickness", "Maintain thickness by adjusting for sharp corners (slow, disable when not needed)");
2400 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2402 prop= RNA_def_property(srna, "use_quality_normals", PROP_BOOLEAN, PROP_NONE);
2403 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_NORMAL_CALC);
2404 RNA_def_property_ui_text(prop, "High Quality Normals", "Calculate normals which result in more even thickness (slow, disable when not needed)");
2405 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2407 prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
2408 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_VGROUP_INV);
2409 RNA_def_property_ui_text(prop, "Vertex Group Invert", "Invert the vertex group influence");
2410 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2415 static void rna_def_modifier_screw(BlenderRNA *brna)
2417 static EnumPropertyItem axis_items[]= {
2418 {0, "X", 0, "X Axis", ""},
2419 {1, "Y", 0, "Y Axis", ""},
2420 {2, "Z", 0, "Z Axis", ""},
2421 {0, NULL, 0, NULL, NULL}};
2426 srna= RNA_def_struct(brna, "ScrewModifier", "Modifier");
2427 RNA_def_struct_ui_text(srna, "Screw Modifier", "Revolve edges");
2428 RNA_def_struct_sdna(srna, "ScrewModifierData");
2429 RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW);
2431 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
2432 RNA_def_property_pointer_sdna(prop, NULL, "ob_axis");
2433 RNA_def_property_ui_text(prop, "Object", "Object to define the screw axis");
2434 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2435 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2437 prop= RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED);
2438 RNA_def_property_range(prop, 2, 10000);
2439 RNA_def_property_ui_range(prop, 3, 512, 1, 0);
2440 RNA_def_property_ui_text(prop, "Steps", "Number of steps in the revolution");
2441 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2443 prop= RNA_def_property(srna, "render_steps", PROP_INT, PROP_UNSIGNED);
2444 RNA_def_property_range(prop, 2, 10000);
2445 RNA_def_property_ui_range(prop, 2, 512, 1, 0);
2446 RNA_def_property_ui_text(prop, "Render Steps", "Number of steps in the revolution");
2447 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2449 prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
2450 RNA_def_property_int_sdna(prop, NULL, "iter");
2451 RNA_def_property_range(prop, 1, 10000);
2452 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
2453 RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply the screw operation");
2454 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2456 prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
2457 RNA_def_property_enum_items(prop, axis_items);
2458 RNA_def_property_ui_text(prop, "Axis", "Screw axis");
2459 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2461 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
2462 RNA_def_property_ui_range(prop, 0, -M_PI*2, M_PI*2, 2);
2463 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2464 RNA_def_property_ui_text(prop, "Angle", "Angle of revolution");
2465 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2467 prop= RNA_def_property(srna, "screw_offset", PROP_FLOAT, PROP_DISTANCE);
2468 RNA_def_property_float_sdna(prop, NULL, "screw_ofs");
2469 RNA_def_property_ui_text(prop, "Screw", "Offset the revolution along its axis");
2470 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2472 prop= RNA_def_property(srna, "use_normal_flip", PROP_BOOLEAN, PROP_NONE);
2473 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_FLIP);
2474 RNA_def_property_ui_text(prop, "Flip", "Flip normals of lathed faces");
2475 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2477 prop= RNA_def_property(srna, "use_normal_calculate", PROP_BOOLEAN, PROP_NONE);
2478 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_CALC);
2479 RNA_def_property_ui_text(prop, "Calc Order", "Calculate the order of edges (needed for meshes, but not curves)");
2480 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2482 prop= RNA_def_property(srna, "use_object_screw_offset", PROP_BOOLEAN, PROP_NONE);
2483 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_OFFSET);
2484 RNA_def_property_ui_text(prop, "Object Screw", "Use the distance between the objects to make a screw");
2485 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2487 /*prop= RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE);
2488 RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_ANGLE);
2489 RNA_def_property_ui_text(prop, "Object Angle", "Use the angle between the objects rather than the fixed angle");
2490 RNA_def_property_update(prop, 0, "rna_Modifier_update");*/
2493 static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna)
2495 static EnumPropertyItem weightvg_mask_tex_map_items[] = {
2496 {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", ""},
2497 {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", ""},
2498 {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", ""},
2499 {MOD_DISP_MAP_UV, "UV", 0, "UV", ""},
2500 {0, NULL, 0, NULL, NULL}};
2502 static EnumPropertyItem weightvg_mask_tex_used_items[] = {
2503 {MOD_WVG_MASK_TEX_USE_INT, "INT", 0, "Intensity", ""},
2504 {MOD_WVG_MASK_TEX_USE_RED, "RED", 0, "Red", ""},
2505 {MOD_WVG_MASK_TEX_USE_GREEN, "GREEN", 0, "Green", ""},
2506 {MOD_WVG_MASK_TEX_USE_BLUE, "BLUE", 0, "Blue", ""},
2507 {MOD_WVG_MASK_TEX_USE_HUE, "HUE", 0, "Hue", ""},
2508 {MOD_WVG_MASK_TEX_USE_SAT, "SAT", 0, "Saturation", ""},
2509 {MOD_WVG_MASK_TEX_USE_VAL, "VAL", 0, "Value", ""},
2510 {MOD_WVG_MASK_TEX_USE_ALPHA, "ALPHA", 0, "Alpha", ""},
2511 {0, NULL, 0, NULL, NULL}};
2515 prop= RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_NONE);
2516 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2517 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
2518 RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup.");
2519 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2521 prop= RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE);
2522 RNA_def_property_string_sdna(prop, NULL, "mask_defgrp_name");
2523 RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name.");
2524 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_vgroup_set");
2525 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2527 prop= RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
2528 RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture.");
2529 RNA_def_property_flag(prop, PROP_EDITABLE);
2530 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2532 prop= RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE);
2533 RNA_def_property_enum_items(prop, weightvg_mask_tex_used_items);
2534 RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking.");
2535 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2537 prop= RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE);
2538 RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items);
2539 RNA_def_property_ui_text(prop, "Texture Coordinates", "Which texture coordinates "
2540 "to use for mapping.");
2541 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2543 prop= RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE);
2544 RNA_def_property_string_sdna(prop, NULL, "mask_tex_uvlayer_name");
2545 RNA_def_property_ui_text(prop, "UV Layer", "UV layer name");
2546 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_uvlayer_set");
2547 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2549 prop= RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE);
2550 RNA_def_property_pointer_sdna(prop, NULL, "mask_tex_map_obj");
2551 RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Which object to take texture "
2552 "coordinates from.");
2553 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2554 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2557 static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
2559 static EnumPropertyItem weightvg_edit_falloff_type_items[] = {
2560 {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", ""},
2561 {MOD_WVG_MAPPING_CURVE, "CURVE", ICON_RNDCURVE, "Custom Curve", ""},
2562 {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
2563 {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
2564 {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
2565 {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""},
2566 {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
2567 {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE, "Median Step", ""}, /* Would need a better icon... */
2568 {0, NULL, 0, NULL, NULL}};
2573 srna= RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier");
2574 RNA_def_struct_ui_text(srna, "WeightVG Edit Modifier",
2575 "Edit the weights of vertices in a group.");
2576 RNA_def_struct_sdna(srna, "WeightVGEditModifierData");
2577 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
2579 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2580 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
2581 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name.");
2582 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
2583 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2585 prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
2586 RNA_def_property_enum_items(prop, weightvg_edit_falloff_type_items);
2587 RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values.");
2588 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2590 prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
2591 RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG);
2592 RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold "
2594 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2596 prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
2597 RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG);
2598 RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold "
2600 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2602 prop= RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE);
2603 RNA_def_property_range(prop, 0.0, 1.0f);
2604 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
2605 RNA_def_property_ui_text(prop, "Default Weight", "Default weight a vertex will have if "
2606 "it is not in the vgroup.");
2607 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2609 prop= RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
2610 RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve");
2611 RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve.");
2612 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2614 prop= RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE);
2615 RNA_def_property_float_sdna(prop, NULL, "add_threshold");
2616 RNA_def_property_range(prop, 0.0, 1.0);
2617 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
2618 RNA_def_property_ui_text(prop, "Add Threshold", "Lower bound for a vertex's weight "
2619 "to be added to the vgroup.");
2620 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2622 prop= RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE);
2623 RNA_def_property_float_sdna(prop, NULL, "rem_threshold");
2624 RNA_def_property_range(prop, 0.0, 1.0);
2625 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
2626 RNA_def_property_ui_text(prop, "Rem Threshold", "Upper bound for a vertex's weight "
2627 "to be removed from the vgroup.");
2628 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2630 /* Common masking properties. */
2631 rna_def_modifier_weightvg_mask(brna, srna);
2634 static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
2636 static EnumPropertyItem weightvg_mix_modes_items[] = {
2637 {MOD_WVG_MIX_SET, "SET", 0, "Replace weights", ""},
2638 {MOD_WVG_MIX_ADD, "ADD", 0, "Add to weights", ""},
2639 {MOD_WVG_MIX_SUB, "SUB", 0, "Subtract from weights", ""},
2640 {MOD_WVG_MIX_MUL, "MUL", 0, "Multiply weights", ""},
2641 {MOD_WVG_MIX_DIV, "DIV", 0, "Divide weights", ""},
2642 {MOD_WVG_MIX_DIF, "DIF", 0, "Difference", ""},
2643 {MOD_WVG_MIX_AVG, "AVG", 0, "Average", ""},
2644 {0, NULL, 0, NULL, NULL}};
2646 static EnumPropertyItem weightvg_mix_set_items[] = {
2647 {MOD_WVG_SET_ALL, "ALL", 0, "All vertices", ""},
2648 {MOD_WVG_SET_A, "A", 0, "Vertices from group A", ""},
2649 {MOD_WVG_SET_B, "B", 0, "Vertices from group B", ""},
2650 {MOD_WVG_SET_OR, "OR", 0, "Vertices from one group", ""},
2651 {MOD_WVG_SET_AND, "AND", 0, "Vertices from both groups", ""},
2652 {0, NULL, 0, NULL, NULL}};
2657 srna= RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier");
2658 RNA_def_struct_ui_text(srna, "WeightVG Mix Modifier",
2659 "Mix the weights of two vertex groups.");
2660 RNA_def_struct_sdna(srna, "WeightVGMixModifierData");
2661 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
2663 prop= RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE);
2664 RNA_def_property_string_sdna(prop, NULL, "defgrp_name_a");
2665 RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name.");
2666 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
2667 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2669 prop= RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE);
2670 RNA_def_property_string_sdna(prop, NULL, "defgrp_name_b");
2671 RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name.");
2672 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGMixModifier_vgroup2_set");
2673 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2675 prop= RNA_def_property(srna, "default_weight_a", PROP_FLOAT, PROP_NONE);
2676 RNA_def_property_range(prop, 0.0, 1.0f);
2677 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
2678 RNA_def_property_ui_text(prop, "Default Weight A", "Default weight a vertex will have if "
2679 "it is not in the first vgroup.");
2680 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2682 prop= RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE);
2683 RNA_def_property_range(prop, 0.0, 1.0f);
2684 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
2685 RNA_def_property_ui_text(prop, "Default Weight B", "Default weight a vertex will have if "
2686 "it is not in the second vgroup.");
2687 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2689 prop= RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
2690 RNA_def_property_enum_items(prop, weightvg_mix_modes_items);
2691 RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup 2 affect weights "
2693 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2695 prop= RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE);
2696 RNA_def_property_enum_items(prop, weightvg_mix_set_items);
2697 RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected.");
2698 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2700 /* Common masking properties. */
2701 rna_def_modifier_weightvg_mask(brna, srna);
2704 static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
2706 static EnumPropertyItem weightvg_proximity_modes_items[] = {
2707 {MOD_WVG_PROXIMITY_OBJECT, "OBJECT", 0, "Object Distance",
2708 "Use distance between affected and target objects."},
2709 {MOD_WVG_PROXIMITY_GEOMETRY, "GEOMETRY", 0, "Geometry Distance",
2710 "Use distance between affected object's vertices and target object, or target object's geometry."},
2711 {0, NULL, 0, NULL, NULL}};
2713 static EnumPropertyItem proximity_geometry_items[] = {
2714 {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex."},
2715 {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge."},
2716 {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face."},
2717 {0, NULL, 0, NULL, NULL}};
2719 static EnumPropertyItem weightvg_proximity_falloff_type_items[] = {
2720 {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", ""},
2721 /* No curve mapping here! */
2722 {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
2723 {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
2724 {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
2725 {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""},
2726 {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
2727 {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE, "Median Step", ""}, /* Would need a better icon... */
2728 {0, NULL, 0, NULL, NULL}};
2733 srna= RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier");
2734 RNA_def_struct_ui_text(srna, "WeightVG Proximity Modifier",
2735 "Set the weights of vertices in a group from a target object's "
2737 RNA_def_struct_sdna(srna, "WeightVGProximityModifierData");
2738 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
2740 prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2741 RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
2742 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name.");
2743 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
2744 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2746 prop= RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE);
2747 RNA_def_property_enum_items(prop, weightvg_proximity_modes_items);
2748 RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use.");
2749 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2751 prop= RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE);
2752 RNA_def_property_enum_sdna(prop, NULL, "proximity_flags");
2753 RNA_def_property_enum_items(prop, proximity_geometry_items);
2754 RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */
2755 RNA_def_property_ui_text(prop, "Proximity Geometry",
2756 "Use the shortest computed distance to target object's geometry "
2758 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2760 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2761 RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target");
2762 RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from.");
2763 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2764 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2766 prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_NONE);
2767 RNA_def_property_range(prop, 0.0, FLT_MAX);
2768 RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
2769 RNA_def_property_ui_text(prop, "Lowest Dist", "Distance mapping to weight 0.0 (or weight 1.0 if above Highest Dist).");
2770 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2772 prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_NONE);
2773 RNA_def_property_range(prop, 0.0, FLT_MAX);
2774 RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
2775 RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0 (or weight 0.0 if below Lowest Dist).");
2776 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2778 prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
2779 RNA_def_property_enum_items(prop, weightvg_proximity_falloff_type_items);
2780 RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values.");
2781 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2783 /* Common masking properties. */
2784 rna_def_modifier_weightvg_mask(brna, srna);
2789 static void rna_def_modifier_ngoninterp(BlenderRNA *brna)
2794 srna= RNA_def_struct(brna, "NgonInterpModifier", "Modifier");
2795 RNA_def_struct_ui_text(srna, "Precision UV Modifier", "Precision UV interpolation");
2796 RNA_def_struct_sdna(srna, "NgonInterpModifierData");
2797 RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW);
2799 prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
2800 RNA_def_property_range(prop, 1, 10000);
2801 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
2802 RNA_def_property_ui_text(prop, "Resolution", "Size of interpolation grids");
2803 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2806 void RNA_def_modifier(BlenderRNA *brna)
2812 srna= RNA_def_struct(brna, "Modifier", NULL);
2813 RNA_def_struct_ui_text(srna , "Modifier", "Modifier affecting the geometry data of an object");
2814 RNA_def_struct_refine_func(srna, "rna_Modifier_refine");
2815 RNA_def_struct_path_func(srna, "rna_Modifier_path");
2816 RNA_def_struct_sdna(srna, "ModifierData");
2819 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2820 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Modifier_name_set");
2821 RNA_def_property_ui_text(prop, "Name", "Modifier name");
2822 RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
2823 RNA_def_struct_name_property(srna, prop);
2826 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
2827 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2828 RNA_def_property_enum_sdna(prop, NULL, "type");
2829 RNA_def_property_enum_items(prop, modifier_type_items);
2830 RNA_def_property_ui_text(prop, "Type", "");
2833 prop= RNA_def_property(srna, "show_viewport", PROP_BOOLEAN, PROP_NONE);
2834 RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime);
2835 RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier");
2836 RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
2837 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2838 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
2840 prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
2841 RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
2842 RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering");
2843 RNA_def_property_ui_icon(prop, ICON_SCENE, 0);
2844 RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
2846 prop= RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
2847 RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode);
2848 RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode");
2849 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2850 RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
2852 prop= RNA_def_property(srna, "show_on_cage", PROP_BOOLEAN, PROP_NONE);
2853 RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage);
2854 RNA_def_property_ui_text(prop, "On Cage", "Enable direct editing of modifier control cage");
2855 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2857 prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
2858 RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
2859 RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
2860 RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
2862 prop= RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE);
2863 RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_ApplyOnSpline);
2864 RNA_def_property_ui_text(prop, "Apply on spline", "Apply this and all preceding deformation modifiers on splines' points rather than on filled curve/surface");
2865 RNA_def_property_ui_icon(prop, ICON_SURFACE_DATA, 0);
2866 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2869 rna_def_modifier_subsurf(brna);
2870 rna_def_modifier_lattice(brna);
2871 rna_def_modifier_curve(brna);
2872 rna_def_modifier_build(brna);
2873 rna_def_modifier_mirror(brna);
2874 rna_def_modifier_decimate(brna);
2875 rna_def_modifier_wave(brna);
2876 rna_def_modifier_armature(brna);
2877 rna_def_modifier_hook(brna);
2878 rna_def_modifier_softbody(brna);
2879 rna_def_modifier_boolean(brna);
2880 rna_def_modifier_array(brna);
2881 rna_def_modifier_edgesplit(brna);
2882 rna_def_modifier_displace(brna);
2883 rna_def_modifier_uvproject(brna);
2884 rna_def_modifier_smooth(brna);
2885 rna_def_modifier_cast(brna);
2886 rna_def_modifier_meshdeform(brna);
2887 rna_def_modifier_particlesystem(brna);
2888 rna_def_modifier_particleinstance(brna);
2889 rna_def_modifier_explode(brna);
2890 rna_def_modifier_cloth(brna);
2891 rna_def_modifier_collision(brna);
2892 rna_def_modifier_bevel(brna);
2893 rna_def_modifier_shrinkwrap(brna);
2894 rna_def_modifier_fluidsim(brna);
2895 rna_def_modifier_mask(brna);
2896 rna_def_modifier_simpledeform(brna);
2897 rna_def_modifier_warp(brna);
2898 rna_def_modifier_multires(brna);
2899 rna_def_modifier_surface(brna);
2900 rna_def_modifier_smoke(brna);
2901 rna_def_modifier_solidify(brna);
2902 rna_def_modifier_screw(brna);
2903 rna_def_modifier_weightvgedit(brna);
2904 rna_def_modifier_weightvgmix(brna);
2905 rna_def_modifier_weightvgproximity(brna);
2906 rna_def_modifier_ngoninterp(brna);