Blender V2.61 - r43446

rna_modifier.c

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * Contributor(s): Blender Foundation (2008), Juho Veps‰l‰inen
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00028 #include <float.h>
00029 #include <limits.h>
00030 #include <stdlib.h>
00031 
00032 #include "RNA_define.h"
00033 #include "RNA_enum_types.h"
00034 
00035 #include "rna_internal.h"
00036 
00037 #include "DNA_armature_types.h"
00038 #include "DNA_modifier_types.h"
00039 #include "DNA_object_types.h"
00040 #include "DNA_object_force.h"
00041 #include "DNA_scene_types.h"
00042 
00043 #include "MEM_guardedalloc.h"
00044 
00045 #include "BLI_math.h"
00046 
00047 #include "BKE_animsys.h"
00048 #include "BKE_bmesh.h" /* For BevelModifierData */
00049 #include "BKE_dynamicpaint.h"
00050 #include "BKE_multires.h"
00051 #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
00052 
00053 #include "WM_api.h"
00054 #include "WM_types.h"
00055 
00056 EnumPropertyItem modifier_type_items[] ={
00057     {0, "", 0, "Modify", ""},
00058     {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
00059     {eModifierType_WeightVGEdit, "VERTEX_WEIGHT_EDIT", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Edit", ""},
00060     {eModifierType_WeightVGMix, "VERTEX_WEIGHT_MIX", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Mix", ""},
00061     {eModifierType_WeightVGProximity, "VERTEX_WEIGHT_PROXIMITY", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Proximity", ""},
00062     {0, "", 0, "Generate", ""},
00063     {eModifierType_Array, "ARRAY", ICON_MOD_ARRAY, "Array", ""},
00064     {eModifierType_Bevel, "BEVEL", ICON_MOD_BEVEL, "Bevel", ""},
00065     {eModifierType_Boolean, "BOOLEAN", ICON_MOD_BOOLEAN, "Boolean", ""},
00066     {eModifierType_Build, "BUILD", ICON_MOD_BUILD, "Build", ""},
00067     {eModifierType_Decimate, "DECIMATE", ICON_MOD_DECIM, "Decimate", ""},
00068     {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
00069     {eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
00070     {eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
00071     {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
00072     {eModifierType_Remesh, "REMESH", ICON_MOD_REMESH, "Remesh", ""},
00073     {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
00074     {eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
00075     {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
00076     {0, "", 0, "Deform", ""},
00077     {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
00078     {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
00079     {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""},
00080     {eModifierType_Displace, "DISPLACE", ICON_MOD_DISPLACE, "Displace", ""},
00081     {eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", ""},
00082     {eModifierType_Lattice, "LATTICE", ICON_MOD_LATTICE, "Lattice", ""},
00083     {eModifierType_MeshDeform, "MESH_DEFORM", ICON_MOD_MESHDEFORM, "Mesh Deform", ""},
00084     {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""},
00085     {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""},
00086     {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""},
00087     {eModifierType_Warp, "WARP", ICON_MOD_SUBSURF, "Warp", ""},
00088     {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""},
00089     {0, "", 0, "Simulate", ""},
00090     {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
00091     {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
00092     {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, "Dynamic Paint", ""},
00093     {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""},
00094     {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""},
00095     {eModifierType_Ocean, "OCEAN", ICON_MOD_WAVE, "Ocean", ""},
00096     {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
00097     {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
00098     {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""},
00099     {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
00100     {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""},
00101     {0, NULL, 0, NULL, NULL}};
00102 
00103 #ifdef RNA_RUNTIME
00104 
00105 #include "DNA_particle_types.h"
00106 #include "DNA_smoke_types.h"
00107 
00108 #include "BKE_context.h"
00109 #include "BKE_depsgraph.h"
00110 #include "BKE_library.h"
00111 #include "BKE_modifier.h"
00112 #include "BKE_particle.h"
00113 
00114 static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
00115 {
00116     UVProjectModifierData *uvp= (UVProjectModifierData*)ptr->data;
00117     rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), uvp->num_projectors, 0, NULL);
00118 }
00119 
00120 static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
00121 {
00122     ModifierData *md= (ModifierData*)ptr->data;
00123 
00124     switch(md->type) {
00125         case eModifierType_Subsurf:
00126             return &RNA_SubsurfModifier;
00127         case eModifierType_Lattice:
00128             return &RNA_LatticeModifier;
00129         case eModifierType_Curve:
00130             return &RNA_CurveModifier;
00131         case eModifierType_Build:
00132             return &RNA_BuildModifier;
00133         case eModifierType_Mirror:
00134             return &RNA_MirrorModifier;
00135         case eModifierType_Decimate:
00136             return &RNA_DecimateModifier;
00137         case eModifierType_Wave:
00138             return &RNA_WaveModifier;
00139         case eModifierType_Armature:
00140             return &RNA_ArmatureModifier;
00141         case eModifierType_Hook:
00142             return &RNA_HookModifier;
00143         case eModifierType_Softbody:
00144             return &RNA_SoftBodyModifier;
00145         case eModifierType_Boolean:
00146             return &RNA_BooleanModifier;
00147         case eModifierType_Array:
00148             return &RNA_ArrayModifier;
00149         case eModifierType_EdgeSplit:
00150             return &RNA_EdgeSplitModifier;
00151         case eModifierType_Displace:
00152             return &RNA_DisplaceModifier;
00153         case eModifierType_UVProject:
00154             return &RNA_UVProjectModifier;
00155         case eModifierType_Smooth:
00156             return &RNA_SmoothModifier;
00157         case eModifierType_Cast:
00158             return &RNA_CastModifier;
00159         case eModifierType_MeshDeform:
00160             return &RNA_MeshDeformModifier;
00161         case eModifierType_ParticleSystem:
00162             return &RNA_ParticleSystemModifier;
00163         case eModifierType_ParticleInstance:
00164             return &RNA_ParticleInstanceModifier;
00165         case eModifierType_Explode:
00166             return &RNA_ExplodeModifier;
00167         case eModifierType_Cloth:
00168             return &RNA_ClothModifier;
00169         case eModifierType_Collision:
00170             return &RNA_CollisionModifier;
00171         case eModifierType_Bevel:
00172             return &RNA_BevelModifier;
00173         case eModifierType_Shrinkwrap:
00174             return &RNA_ShrinkwrapModifier;
00175         case eModifierType_Fluidsim:
00176             return &RNA_FluidSimulationModifier;
00177         case eModifierType_Mask:
00178             return &RNA_MaskModifier;
00179         case eModifierType_SimpleDeform:
00180             return &RNA_SimpleDeformModifier;
00181         case eModifierType_Multires:
00182             return &RNA_MultiresModifier;
00183         case eModifierType_Surface:
00184             return &RNA_SurfaceModifier;
00185         case eModifierType_Smoke:
00186             return &RNA_SmokeModifier;
00187         case eModifierType_Solidify:
00188             return &RNA_SolidifyModifier;
00189         case eModifierType_Screw:
00190             return &RNA_ScrewModifier;
00191         case eModifierType_Ocean:
00192             return &RNA_OceanModifier;
00193         case eModifierType_Warp:
00194             return &RNA_WarpModifier;
00195         case eModifierType_WeightVGEdit:
00196             return &RNA_VertexWeightEditModifier;
00197         case eModifierType_WeightVGMix:
00198             return &RNA_VertexWeightMixModifier;
00199         case eModifierType_WeightVGProximity:
00200             return &RNA_VertexWeightProximityModifier;
00201         case eModifierType_DynamicPaint:
00202             return &RNA_DynamicPaintModifier;
00203         case eModifierType_Remesh:
00204             return &RNA_RemeshModifier;
00205         default:
00206             return &RNA_Modifier;
00207     }
00208 }
00209 
00210 void rna_Modifier_name_set(PointerRNA *ptr, const char *value)
00211 {
00212     ModifierData *md= ptr->data;
00213     char oldname[sizeof(md->name)];
00214     
00215     /* make a copy of the old name first */
00216     BLI_strncpy(oldname, md->name, sizeof(md->name));
00217     
00218     /* copy the new name into the name slot */
00219     BLI_strncpy_utf8(md->name, value, sizeof(md->name));
00220     
00221     /* make sure the name is truly unique */
00222     if (ptr->id.data) {
00223         Object *ob= ptr->id.data;
00224         modifier_unique_name(&ob->modifiers, md);
00225     }
00226     
00227     /* fix all the animation data which may link to this */
00228     BKE_all_animdata_fix_paths_rename("modifiers", oldname, md->name);
00229 }
00230 
00231 static char *rna_Modifier_path(PointerRNA *ptr)
00232 {
00233     return BLI_sprintfN("modifiers[\"%s\"]", ((ModifierData*)ptr->data)->name);
00234 }
00235 
00236 static void rna_Modifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00237 {
00238     DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
00239     WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ptr->id.data);
00240 }
00241 
00242 static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00243 {
00244     rna_Modifier_update(bmain, scene, ptr);
00245     DAG_scene_sort(bmain, scene);
00246 }
00247 
00248 static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
00249 {
00250     SmokeModifierData *smd= (SmokeModifierData *)ptr->data;
00251     Object *ob= (Object*)ptr->id.data;
00252     ParticleSystemModifierData *psmd = NULL;
00253     ParticleSystem *psys = NULL;
00254     ParticleSettings *part = NULL;
00255 
00256     // nothing changed
00257     if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
00258         return;
00259         
00260     smokeModifier_free(smd); // XXX TODO: completely free all 3 pointers
00261     smokeModifier_createType(smd); // create regarding of selected type
00262 
00263     switch (smd->type) {
00264         case MOD_SMOKE_TYPE_DOMAIN:
00265             ob->dt = OB_WIRE;
00266             break;
00267         case MOD_SMOKE_TYPE_FLOW:
00268             for(psys=ob->particlesystem.first; psys; psys=psys->next)
00269                 if(psys->part->type == PART_EMITTER)
00270                     break;
00271             if(ob->type == OB_MESH && !psys) {
00272                 /* add particle system */
00273                 psmd = (ParticleSystemModifierData *)object_add_particle_system(scene, ob, NULL);
00274                 if(psmd)
00275                 {
00276                     psys = psmd->psys;
00277                     part = psys->part;
00278                     part->lifetime = 1.0f;
00279                     part->sta = 1.0f;
00280                     part->end = 250.0f;
00281                     part->ren_as = PART_DRAW_NOT;
00282                     part->draw_as = PART_DRAW_DOT;
00283                     BLI_strncpy(psys->name, "SmokeParticles", sizeof(psys->name));
00284                     psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
00285                     DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
00286                 }
00287             }
00288             if(smd->flow)
00289                 smd->flow->psys = psys;
00290         case MOD_SMOKE_TYPE_COLL:
00291         case 0:
00292         default:
00293             ob->dt = OB_TEXTURE;
00294             break;
00295     }
00296     
00297     // update dependancy since a domain - other type switch could have happened
00298     rna_Modifier_dependency_update(bmain, scene, ptr);
00299 }
00300 
00301 static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
00302 {
00303     ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
00304     rna_object_vgroup_name_index_get(ptr, value, emd->vgroup);
00305 }
00306 
00307 static int rna_ExplodeModifier_vgroup_length(PointerRNA *ptr)
00308 {
00309     ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
00310     return rna_object_vgroup_name_index_length(ptr, emd->vgroup);
00311 }
00312 
00313 static void rna_ExplodeModifier_vgroup_set(PointerRNA *ptr, const char *value)
00314 {
00315     ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
00316     rna_object_vgroup_name_index_set(ptr, value, &emd->vgroup);
00317 }
00318 
00319 static void rna_SimpleDeformModifier_vgroup_set(PointerRNA *ptr, const char *value)
00320 {
00321     SimpleDeformModifierData *smd= (SimpleDeformModifierData*)ptr->data;
00322     rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name));
00323 }
00324 
00325 static void rna_ShrinkwrapModifier_vgroup_set(PointerRNA *ptr, const char *value)
00326 {
00327     ShrinkwrapModifierData *smd= (ShrinkwrapModifierData*)ptr->data;
00328     rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name));
00329 }
00330 
00331 static void rna_LatticeModifier_vgroup_set(PointerRNA *ptr, const char *value)
00332 {
00333     LatticeModifierData *lmd= (LatticeModifierData*)ptr->data;
00334     rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
00335 }
00336 
00337 static void rna_ArmatureModifier_vgroup_set(PointerRNA *ptr, const char *value)
00338 {
00339     ArmatureModifierData *lmd= (ArmatureModifierData*)ptr->data;
00340     rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
00341 }
00342 
00343 static void rna_CurveModifier_vgroup_set(PointerRNA *ptr, const char *value)
00344 {
00345     CurveModifierData *lmd= (CurveModifierData*)ptr->data;
00346     rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
00347 }
00348 
00349 static void rna_DisplaceModifier_vgroup_set(PointerRNA *ptr, const char *value)
00350 {
00351     DisplaceModifierData *lmd= (DisplaceModifierData*)ptr->data;
00352     rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
00353 }
00354 
00355 static void rna_HookModifier_vgroup_set(PointerRNA *ptr, const char *value)
00356 {
00357     HookModifierData *lmd= (HookModifierData*)ptr->data;
00358     rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
00359 }
00360 
00361 static void rna_MaskModifier_vgroup_set(PointerRNA *ptr, const char *value)
00362 {
00363     MaskModifierData *lmd= (MaskModifierData*)ptr->data;
00364     rna_object_vgroup_name_set(ptr, value, lmd->vgroup, sizeof(lmd->vgroup));
00365 }
00366 
00367 static void rna_MeshDeformModifier_vgroup_set(PointerRNA *ptr, const char *value)
00368 {
00369     MeshDeformModifierData *lmd= (MeshDeformModifierData*)ptr->data;
00370     rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
00371 }
00372 
00373 static void rna_SmoothModifier_vgroup_set(PointerRNA *ptr, const char *value)
00374 {
00375     SmoothModifierData *lmd= (SmoothModifierData*)ptr->data;
00376     rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
00377 }
00378 
00379 static void rna_WaveModifier_vgroup_set(PointerRNA *ptr, const char *value)
00380 {
00381     WaveModifierData *lmd= (WaveModifierData*)ptr->data;
00382     rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
00383 }
00384 
00385 static void rna_CastModifier_vgroup_set(PointerRNA *ptr, const char *value)
00386 {
00387     CastModifierData *lmd= (CastModifierData*)ptr->data;
00388     rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
00389 }
00390 
00391 static void rna_SolidifyModifier_vgroup_set(PointerRNA *ptr, const char *value)
00392 {
00393     SolidifyModifierData *smd= (SolidifyModifierData*)ptr->data;
00394     rna_object_vgroup_name_set(ptr, value, smd->defgrp_name, sizeof(smd->defgrp_name));
00395 }
00396 
00397 static void rna_WeightVGModifier_vgroup_set(PointerRNA *ptr, const char *value)
00398 {
00399     ModifierData *md = (ModifierData*)ptr->data;
00400     if (md->type == eModifierType_WeightVGEdit) {
00401         WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md;
00402         rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name));
00403     }
00404     else if (md->type == eModifierType_WeightVGMix) {
00405         WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md;
00406         rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_a, sizeof(wmd->defgrp_name_a));
00407     }
00408     else if (md->type == eModifierType_WeightVGProximity) {
00409         WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md;
00410         rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name));
00411     }
00412 }
00413 
00414 static void rna_WeightVGModifier_mask_vgroup_set(PointerRNA *ptr, const char *value)
00415 {
00416     ModifierData *md = (ModifierData*)ptr->data;
00417     if (md->type == eModifierType_WeightVGEdit) {
00418         WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md;
00419         rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
00420     }
00421     else if (md->type == eModifierType_WeightVGMix) {
00422         WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md;
00423         rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
00424     }
00425     else if (md->type == eModifierType_WeightVGProximity) {
00426         WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md;
00427         rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
00428     }
00429 }
00430 
00431 static void rna_WeightVGMixModifier_vgroup2_set(PointerRNA *ptr, const char *value)
00432 {
00433     WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)ptr->data;
00434     rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_b, sizeof(wmd->defgrp_name_b));
00435 }
00436 
00437 static void rna_MappingInfo_uvlayer_set(PointerRNA *ptr, const char *value)
00438 {
00439     MappingInfoModifierData *mmd= (MappingInfoModifierData *)ptr->data;
00440     rna_object_uvlayer_name_set(ptr, value, mmd->uvlayer_name, sizeof(mmd->uvlayer_name));
00441 }
00442 
00443 static void rna_UVProjectModifier_uvlayer_set(PointerRNA *ptr, const char *value)
00444 {
00445     UVProjectModifierData *umd= (UVProjectModifierData*)ptr->data;
00446     rna_object_uvlayer_name_set(ptr, value, umd->uvlayer_name, sizeof(umd->uvlayer_name));
00447 }
00448 
00449 static void RNA_WarpModifier_vgroup_set(PointerRNA *ptr, const char *value)
00450 {
00451     WarpModifierData *tmd= (WarpModifierData*)ptr->data;
00452     rna_object_vgroup_name_set(ptr, value, tmd->defgrp_name, sizeof(tmd->defgrp_name));
00453 }
00454 
00455 static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *value)
00456 {
00457     ModifierData *md = (ModifierData*)ptr->data;
00458     if (md->type == eModifierType_WeightVGEdit) {
00459         WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md;
00460         rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name));
00461     }
00462     else if (md->type == eModifierType_WeightVGMix) {
00463         WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md;
00464         rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name));
00465     }
00466     else if (md->type == eModifierType_WeightVGProximity) {
00467         WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md;
00468         rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name));
00469     }
00470 }
00471 
00472 static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max)
00473 {
00474     MultiresModifierData *mmd = (MultiresModifierData*)ptr->data;
00475 
00476     *min = 0;
00477     *max = mmd->totlvl; /* intentionally _not_ -1 */
00478     *max= MAX2(0, *max);
00479 }
00480 
00481 static int rna_MultiresModifier_external_get(PointerRNA *ptr)
00482 {
00483     Object *ob= (Object*)ptr->id.data;
00484     Mesh *me= ob->data;
00485 
00486     return CustomData_external_test(&me->fdata, CD_MDISPS);
00487 }
00488 
00489 static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value)
00490 {
00491     Object *ob= (Object*)ptr->id.data;
00492     CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
00493 
00494     BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename));
00495 }
00496 
00497 static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value)
00498 {
00499     Object *ob= (Object*)ptr->id.data;
00500     CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
00501 
00502     if(external && strcmp(external->filename, value)) {
00503         BLI_strncpy(external->filename, value, sizeof(external->filename));
00504         multires_force_external_reload(ob);
00505     }
00506 }
00507 
00508 static int rna_MultiresModifier_filepath_length(PointerRNA *ptr)
00509 {
00510     Object *ob= (Object*)ptr->id.data;
00511     CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
00512 
00513     return strlen((external)? external->filename: "");
00514 }
00515 
00516 static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value)
00517 {
00518     Object *ob= value.data;
00519 
00520     if(!self || ob != self) {
00521         if(!ob || type == OB_EMPTY || ob->type == type) {
00522             id_lib_extern((ID *)ob);
00523             *ob_p= ob;
00524         }
00525     }
00526 }
00527 
00528 static void rna_LatticeModifier_object_set(PointerRNA *ptr, PointerRNA value)
00529 {
00530     modifier_object_set(ptr->id.data, &((LatticeModifierData*)ptr->data)->object, OB_LATTICE, value);
00531 }
00532 
00533 static void rna_BooleanModifier_object_set(PointerRNA *ptr, PointerRNA value)
00534 {
00535     modifier_object_set(ptr->id.data, &((BooleanModifierData*)ptr->data)->object, OB_MESH, value);
00536 }
00537 
00538 static void rna_CurveModifier_object_set(PointerRNA *ptr, PointerRNA value)
00539 {
00540     modifier_object_set(ptr->id.data, &((CurveModifierData*)ptr->data)->object, OB_CURVE, value);
00541 }
00542 
00543 static void rna_CastModifier_object_set(PointerRNA *ptr, PointerRNA value)
00544 {
00545     modifier_object_set(ptr->id.data, &((CastModifierData*)ptr->data)->object, OB_EMPTY, value);
00546 }
00547 
00548 static void rna_ArmatureModifier_object_set(PointerRNA *ptr, PointerRNA value)
00549 {
00550     modifier_object_set(ptr->id.data, &((ArmatureModifierData*)ptr->data)->object, OB_ARMATURE, value);
00551 }
00552 
00553 static void rna_MaskModifier_armature_set(PointerRNA *ptr, PointerRNA value)
00554 {
00555     modifier_object_set(ptr->id.data, &((MaskModifierData*)ptr->data)->ob_arm, OB_ARMATURE, value);
00556 }
00557 
00558 static void rna_ShrinkwrapModifier_auxiliary_target_set(PointerRNA *ptr, PointerRNA value)
00559 {
00560     modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData*)ptr->data)->auxTarget, OB_MESH, value);
00561 }
00562 
00563 static void rna_ShrinkwrapModifier_target_set(PointerRNA *ptr, PointerRNA value)
00564 {
00565     modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData*)ptr->data)->target, OB_MESH, value);
00566 }
00567 
00568 static int rna_ShrinkwrapModifier_face_cull_get(PointerRNA *ptr)
00569 {
00570     ShrinkwrapModifierData *swm= (ShrinkwrapModifierData*)ptr->data;
00571     return swm->shrinkOpts & (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE);
00572 }
00573 
00574 static void rna_ShrinkwrapModifier_face_cull_set(struct PointerRNA *ptr, int value)
00575 {
00576     ShrinkwrapModifierData *swm= (ShrinkwrapModifierData*)ptr->data;
00577     
00578     swm->shrinkOpts= (swm->shrinkOpts & ~(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) | value;
00579 }
00580 
00581 static void rna_MeshDeformModifier_object_set(PointerRNA *ptr, PointerRNA value)
00582 {
00583     modifier_object_set(ptr->id.data, &((MeshDeformModifierData*)ptr->data)->object, OB_MESH, value);
00584 }
00585 
00586 static void rna_ArrayModifier_end_cap_set(PointerRNA *ptr, PointerRNA value)
00587 {
00588     modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->end_cap, OB_MESH, value);
00589 }
00590 
00591 static void rna_ArrayModifier_start_cap_set(PointerRNA *ptr, PointerRNA value)
00592 {
00593     modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->start_cap, OB_MESH, value);
00594 }
00595 
00596 static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value)
00597 {
00598     modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value);
00599 }
00600 
00601 static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr)
00602 {
00603     return (((MeshDeformModifierData*)ptr->data)->bindcagecos != NULL);
00604 }
00605 
00606 static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)
00607 {
00608     Object *ob= (Object*)ptr->id.data;
00609     return rna_pointer_inherit_refine(ptr, &RNA_SoftBodySettings, ob->soft);
00610 }
00611 
00612 static PointerRNA rna_SoftBodyModifier_point_cache_get(PointerRNA *ptr)
00613 {
00614     Object *ob= (Object*)ptr->id.data;
00615     return rna_pointer_inherit_refine(ptr, &RNA_PointCache, ob->soft->pointcache);
00616 }
00617 
00618 static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr)
00619 {
00620     Object *ob= (Object*)ptr->id.data;
00621     return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
00622 }
00623 
00624 static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr)
00625 {
00626     Object **ob= (Object**)ptr->data;
00627     return rna_pointer_inherit_refine(ptr, &RNA_Object, *ob);
00628 }
00629 
00630 static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value)
00631 {
00632     Object **ob= (Object**)ptr->data;
00633 
00634     if(*ob)
00635         id_us_min((ID*)*ob);
00636     if(value.data)
00637         id_us_plus((ID*)value.data);
00638 
00639     *ob= value.data;
00640 }
00641 
00642 static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
00643 {
00644     UVProjectModifierData *md= (UVProjectModifierData*)ptr->data;
00645     int a;
00646 
00647     md->num_projectors= CLAMPIS(value, 1, MOD_UVPROJECT_MAX);
00648     for(a=md->num_projectors; a<MOD_UVPROJECT_MAX; a++)
00649         md->projectors[a]= NULL;
00650 }
00651 
00652 static int rna_OceanModifier_is_build_enabled_get(PointerRNA *UNUSED(ptr))
00653 {
00654 #ifdef WITH_OCEANSIM
00655     return 1;
00656 #else // WITH_OCEANSIM
00657     return 0;
00658 #endif // WITH_OCEANSIM
00659 }
00660 
00661 static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00662 {
00663     OceanModifierData *omd= (OceanModifierData*)ptr->data;
00664     
00665     omd->refresh |= (MOD_OCEAN_REFRESH_RESET|MOD_OCEAN_REFRESH_SIM|MOD_OCEAN_REFRESH_CLEAR_CACHE);
00666     
00667     rna_Modifier_update(bmain, scene, ptr);
00668 }
00669 
00670 static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00671 {
00672     OceanModifierData *omd= (OceanModifierData*)ptr->data;
00673     
00674     omd->refresh |= MOD_OCEAN_REFRESH_SIM;
00675     
00676     rna_Modifier_update(bmain, scene, ptr);
00677 }
00678 
00679 static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00680 {
00681     OceanModifierData *omd= (OceanModifierData*)ptr->data;
00682     
00683     omd->refresh |= MOD_OCEAN_REFRESH_TOPOLOGY;
00684     
00685     rna_Modifier_update(bmain, scene, ptr);
00686 }
00687 
00688 static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value)
00689 {
00690     OceanModifierData *omd= (OceanModifierData*)ptr->data;
00691     float old_value = omd->chop_amount;
00692     
00693     omd->chop_amount = value;
00694     
00695     if ((old_value == 0.0f && value > 0.0f) ||
00696         (old_value > 0.0f && value == 0.0f))
00697     {
00698         omd->refresh |= MOD_OCEAN_REFRESH_RESET;
00699         omd->refresh |= MOD_OCEAN_REFRESH_CLEAR_CACHE;
00700     }
00701 }
00702 
00703 static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr)
00704 {
00705     EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data;
00706     return DEG2RADF(md->split_angle);
00707 }
00708 
00709 static void rna_EdgeSplitModifier_split_angle_set(PointerRNA *ptr, float value)
00710 {
00711     EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data;
00712     value= RAD2DEGF(value);
00713     CLAMP(value, 0.0f, 180.0f);
00714     md->split_angle= (int)value;
00715 }
00716 
00717 static float rna_BevelModifier_angle_limit_get(PointerRNA *ptr)
00718 {
00719     BevelModifierData *md= (BevelModifierData*)ptr->data;
00720     return DEG2RADF(md->bevel_angle);
00721 }
00722 
00723 static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value)
00724 {
00725     BevelModifierData *md= (BevelModifierData*)ptr->data;
00726     value= RAD2DEGF(value);
00727     CLAMP(value, 0.0f, 180.0f);
00728     md->bevel_angle= (int)value;
00729 }
00730 
00731 #else
00732 
00733 static void rna_def_property_subdivision_common(StructRNA *srna, const char type[])
00734 {
00735     static EnumPropertyItem prop_subdivision_type_items[] = {
00736         {0, "CATMULL_CLARK", 0, "Catmull-Clark", ""},
00737         {1, "SIMPLE", 0, "Simple", ""},
00738         {0, NULL, 0, NULL, NULL}};
00739 
00740     PropertyRNA *prop= RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
00741     RNA_def_property_enum_sdna(prop, NULL, type);
00742     RNA_def_property_enum_items(prop, prop_subdivision_type_items);
00743     RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm");
00744     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00745 }
00746 
00747 static void rna_def_modifier_subsurf(BlenderRNA *brna)
00748 {
00749     StructRNA *srna;
00750     PropertyRNA *prop;
00751 
00752     srna= RNA_def_struct(brna, "SubsurfModifier", "Modifier");
00753     RNA_def_struct_ui_text(srna, "Subsurf Modifier", "Subdivision surface modifier");
00754     RNA_def_struct_sdna(srna, "SubsurfModifierData");
00755     RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
00756 
00757     rna_def_property_subdivision_common(srna, "subdivType");
00758 
00759     prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
00760     RNA_def_property_int_sdna(prop, NULL, "levels");
00761     RNA_def_property_ui_range(prop, 0, 6, 1, 0);
00762     RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform");
00763     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00764 
00765     prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
00766     RNA_def_property_int_sdna(prop, NULL, "renderLevels");
00767     RNA_def_property_ui_range(prop, 0, 6, 1, 0);
00768     RNA_def_property_ui_text(prop, "Render Levels", "Number of subdivisions to perform when rendering");
00769 
00770     prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
00771     RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges);
00772     RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
00773     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00774     
00775     prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
00776     RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv);
00777     RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
00778     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00779 }
00780 
00781 static void rna_def_modifier_generic_map_info(StructRNA *srna)
00782 {
00783     static EnumPropertyItem prop_texture_coordinates_items[] = {
00784         {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", "Use the local coordinate system for the texture coordinates"},
00785         {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use the global coordinate system for the texture coordinates"},
00786         {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Use the linked object's local coordinate system for the texture coordinates"},
00787         {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use UV coordinates for the texture coordinates"},
00788         {0, NULL, 0, NULL, NULL}};
00789 
00790     PropertyRNA *prop;
00791 
00792     prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
00793     RNA_def_property_ui_text(prop, "Texture", "");
00794     RNA_def_property_flag(prop, PROP_EDITABLE);
00795     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00796 
00797     prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
00798     RNA_def_property_enum_sdna(prop, NULL, "texmapping");
00799     RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
00800     RNA_def_property_ui_text(prop, "Texture Coordinates", "");
00801     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
00802 
00803     prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
00804     RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
00805     RNA_def_property_ui_text(prop, "UV Map", "UV map name");
00806     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MappingInfo_uvlayer_set");
00807     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00808 
00809     prop= RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE);
00810     RNA_def_property_pointer_sdna(prop, NULL, "map_object");
00811     RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Object to set the texture coordinates");
00812     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
00813     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
00814 }
00815 
00816 static void rna_def_modifier_warp(BlenderRNA *brna)
00817 {
00818     StructRNA *srna;
00819     PropertyRNA *prop;
00820 
00821     static EnumPropertyItem prop_falloff_items[] = {
00822         {eWarp_Falloff_None,    "NONE", 0, "No Falloff", ""},
00823         {eWarp_Falloff_Curve,   "CURVE", 0, "Curve", ""},
00824         {eWarp_Falloff_Smooth,  "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
00825         {eWarp_Falloff_Sphere,  "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
00826         {eWarp_Falloff_Root,    "ROOT", ICON_ROOTCURVE, "Root", ""},
00827         {eWarp_Falloff_Sharp,   "SHARP", ICON_SHARPCURVE, "Sharp", ""},
00828         {eWarp_Falloff_Linear,  "LINEAR", ICON_LINCURVE, "Linear", ""},
00829         {eWarp_Falloff_Const,   "CONSTANT", ICON_NOCURVE, "Constant", ""},
00830         {0, NULL, 0, NULL, NULL}};
00831 
00832     srna= RNA_def_struct(brna, "WarpModifier", "Modifier");
00833     RNA_def_struct_ui_text(srna, "Warp Modifier", "Warp modifier");
00834     RNA_def_struct_sdna(srna, "WarpModifierData");
00835     //RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
00836 
00837     prop= RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE);
00838     RNA_def_property_ui_text(prop, "From", "Object to transform from");
00839     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
00840     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
00841 
00842     prop= RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE);
00843     RNA_def_property_ui_text(prop, "To", "Object to transform to");
00844     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
00845     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
00846 
00847     prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
00848     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
00849     RNA_def_property_ui_range(prop, -100, 100, 10, 2);
00850     RNA_def_property_ui_text(prop, "Strength", "");
00851     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00852 
00853     prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
00854     RNA_def_property_enum_items(prop, prop_falloff_items);
00855     RNA_def_property_ui_text(prop, "Falloff Type", "");
00856     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00857 
00858     prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED | PROP_DISTANCE);
00859     RNA_def_property_ui_text(prop, "Radius", "Radius to apply");
00860     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00861 
00862     prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
00863     RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
00864     RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
00865     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00866 
00867     prop= RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE);
00868     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WARP_VOLUME_PRESERVE);
00869     RNA_def_property_ui_text(prop, "Preserve Volume", "Preserve volume when rotations are used");
00870     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00871 
00872     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
00873     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
00874     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
00875     RNA_def_property_string_funcs(prop, NULL, NULL, "RNA_WarpModifier_vgroup_set");
00876     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00877 
00878     rna_def_modifier_generic_map_info(srna);
00879 }
00880 
00881 static void rna_def_modifier_multires(BlenderRNA *brna)
00882 {
00883     StructRNA *srna;
00884     PropertyRNA *prop;
00885 
00886     srna= RNA_def_struct(brna, "MultiresModifier", "Modifier");
00887     RNA_def_struct_ui_text(srna, "Multires Modifier", "Multiresolution mesh modifier");
00888     RNA_def_struct_sdna(srna, "MultiresModifierData");
00889     RNA_def_struct_ui_icon(srna, ICON_MOD_MULTIRES);
00890 
00891     rna_def_property_subdivision_common(srna, "simple");
00892 
00893     prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
00894     RNA_def_property_int_sdna(prop, NULL, "lvl");
00895     RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to use in the viewport");
00896     RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
00897     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00898 
00899     prop= RNA_def_property(srna, "sculpt_levels", PROP_INT, PROP_UNSIGNED);
00900     RNA_def_property_int_sdna(prop, NULL, "sculptlvl");
00901     RNA_def_property_ui_text(prop, "Sculpt Levels", "Number of subdivisions to use in sculpt mode");
00902     RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
00903     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00904 
00905     prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
00906     RNA_def_property_int_sdna(prop, NULL, "renderlvl");
00907     RNA_def_property_ui_text(prop, "Render Levels", "The subdivision level visible at render time");
00908     RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
00909 
00910     prop= RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED);
00911     RNA_def_property_int_sdna(prop, NULL, "totlvl");
00912     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
00913     RNA_def_property_ui_text(prop, "Total Levels", "Number of subdivisions for which displacements are stored");
00914 
00915     prop= RNA_def_property(srna, "is_external", PROP_BOOLEAN, PROP_NONE);
00916     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
00917     RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", NULL);
00918     RNA_def_property_ui_text(prop, "External", "Store multires displacements outside the .blend file, to save memory");
00919 
00920     prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
00921     RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filepath_get", "rna_MultiresModifier_filepath_length", "rna_MultiresModifier_filepath_set");
00922     RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
00923     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00924 
00925     prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
00926     RNA_def_property_boolean_sdna(prop, NULL, "flags", eMultiresModifierFlag_ControlEdges);
00927     RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
00928     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00929 
00930     prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
00931     RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", eMultiresModifierFlag_PlainUv);
00932     RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
00933     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00934 }
00935 
00936 static void rna_def_modifier_lattice(BlenderRNA *brna)
00937 {
00938     StructRNA *srna;
00939     PropertyRNA *prop;
00940 
00941     srna= RNA_def_struct(brna, "LatticeModifier", "Modifier");
00942     RNA_def_struct_ui_text(srna, "Lattice Modifier", "Lattice deformation modifier");
00943     RNA_def_struct_sdna(srna, "LatticeModifierData");
00944     RNA_def_struct_ui_icon(srna, ICON_MOD_LATTICE);
00945 
00946     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
00947     RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with");
00948     RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL, "rna_Lattice_object_poll");
00949     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
00950     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
00951 
00952     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
00953     RNA_def_property_string_sdna(prop, NULL, "name");
00954     RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
00955     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_LatticeModifier_vgroup_set");
00956     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00957 }
00958 
00959 static void rna_def_modifier_curve(BlenderRNA *brna)
00960 {
00961     StructRNA *srna;
00962     PropertyRNA *prop;
00963 
00964     static EnumPropertyItem prop_deform_axis_items[] = {
00965         {MOD_CURVE_POSX, "POS_X", 0, "X", ""},
00966         {MOD_CURVE_POSY, "POS_Y", 0, "Y", ""},
00967         {MOD_CURVE_POSZ, "POS_Z", 0, "Z", ""},
00968         {MOD_CURVE_NEGX, "NEG_X", 0, "-X", ""},
00969         {MOD_CURVE_NEGY, "NEG_Y", 0, "-Y", ""},
00970         {MOD_CURVE_NEGZ, "NEG_Z", 0, "-Z", ""},
00971         {0, NULL, 0, NULL, NULL}};
00972 
00973     srna= RNA_def_struct(brna, "CurveModifier", "Modifier");
00974     RNA_def_struct_ui_text(srna, "Curve Modifier", "Curve deformation modifier");
00975     RNA_def_struct_sdna(srna, "CurveModifierData");
00976     RNA_def_struct_ui_icon(srna, ICON_MOD_CURVE);
00977 
00978     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
00979     RNA_def_property_ui_text(prop, "Object", "Curve object to deform with");
00980     RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL, "rna_Curve_object_poll");
00981     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
00982     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
00983 
00984     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
00985     RNA_def_property_string_sdna(prop, NULL, "name");
00986     RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
00987     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CurveModifier_vgroup_set");
00988     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00989 
00990     prop= RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE);
00991     RNA_def_property_enum_sdna(prop, NULL, "defaxis");
00992     RNA_def_property_enum_items(prop, prop_deform_axis_items);
00993     RNA_def_property_ui_text(prop, "Deform Axis", "The axis that the curve deforms along");
00994     RNA_def_property_update(prop, 0, "rna_Modifier_update");
00995 }
00996 
00997 static void rna_def_modifier_build(BlenderRNA *brna)
00998 {
00999     StructRNA *srna;
01000     PropertyRNA *prop;
01001 
01002     srna= RNA_def_struct(brna, "BuildModifier", "Modifier");
01003     RNA_def_struct_ui_text(srna, "Build Modifier", "Build effect modifier");
01004     RNA_def_struct_sdna(srna, "BuildModifierData");
01005     RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD);
01006 
01007     prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
01008     RNA_def_property_float_sdna(prop, NULL, "start");
01009     RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
01010     RNA_def_property_ui_text(prop, "Start", "Start frame of the effect");
01011     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01012 
01013     prop= RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME);
01014     RNA_def_property_float_sdna(prop, NULL, "length");
01015     RNA_def_property_range(prop, 1, MAXFRAMEF);
01016     RNA_def_property_ui_text(prop, "Length", "Total time the build effect requires");
01017     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01018 
01019     prop= RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE);
01020     RNA_def_property_boolean_sdna(prop, NULL, "randomize", 1);
01021     RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build");
01022     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01023 
01024     prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
01025     RNA_def_property_range(prop, 1, MAXFRAMEF);
01026     RNA_def_property_ui_text(prop, "Seed", "Seed for random if used");
01027     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01028 }
01029 
01030 static void rna_def_modifier_mirror(BlenderRNA *brna)
01031 {
01032     StructRNA *srna;
01033     PropertyRNA *prop;
01034 
01035     srna= RNA_def_struct(brna, "MirrorModifier", "Modifier");
01036     RNA_def_struct_ui_text(srna, "Mirror Modifier", "Mirroring modifier");
01037     RNA_def_struct_sdna(srna, "MirrorModifierData");
01038     RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR);
01039 
01040     prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
01041     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X);
01042     RNA_def_property_ui_text(prop, "X", "Enable X axis mirror");
01043     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01044 
01045     prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
01046     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Y);
01047     RNA_def_property_ui_text(prop, "Y", "Enable Y axis mirror");
01048     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01049 
01050     prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
01051     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Z);
01052     RNA_def_property_ui_text(prop, "Z", "Enable Z axis mirror");
01053     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01054 
01055     prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
01056     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_CLIPPING);
01057     RNA_def_property_ui_text(prop, "Clip", "Prevent vertices from going through the mirror during transform");
01058     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01059 
01060     prop= RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE);
01061     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP);
01062     RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)");
01063     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01064     
01065     prop= RNA_def_property(srna, "use_mirror_merge", PROP_BOOLEAN, PROP_NONE);
01066     RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MOD_MIR_NO_MERGE);
01067     RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices within the merge threshold");
01068     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01069 
01070     prop= RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
01071     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U);
01072     RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the 0.5 point");
01073     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01074 
01075     prop= RNA_def_property(srna, "use_mirror_v", PROP_BOOLEAN, PROP_NONE);
01076     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_V);
01077     RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point");
01078     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01079 
01080     prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
01081     RNA_def_property_float_sdna(prop, NULL, "tolerance");
01082     RNA_def_property_range(prop, 0, FLT_MAX);
01083     RNA_def_property_ui_range(prop, 0, 1, 0.01, 6);
01084     RNA_def_property_ui_text(prop, "Merge Limit", "Distance from axis within which mirrored vertices are merged");
01085     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01086 
01087     prop= RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE);
01088     RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob");
01089     RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror");
01090     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01091     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01092 }
01093 
01094 static void rna_def_modifier_decimate(BlenderRNA *brna)
01095 {
01096     StructRNA *srna;
01097     PropertyRNA *prop;
01098 
01099     srna= RNA_def_struct(brna, "DecimateModifier", "Modifier");
01100     RNA_def_struct_ui_text(srna, "Decimate Modifier", "Decimation modifier");
01101     RNA_def_struct_sdna(srna, "DecimateModifierData");
01102     RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM);
01103 
01104     prop= RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE);
01105     RNA_def_property_float_sdna(prop, NULL, "percent");
01106     RNA_def_property_range(prop, 0, 1);
01107     RNA_def_property_ui_range(prop, 0, 1, 1, 2);
01108     RNA_def_property_ui_text(prop, "Ratio", "Ratio of triangles to reduce to");
01109     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01110 
01111     prop= RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE);
01112     RNA_def_property_int_sdna(prop, NULL, "faceCount");
01113     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01114     RNA_def_property_ui_text(prop, "Face Count", "The current number of faces in the decimated mesh");
01115 }
01116 
01117 static void rna_def_modifier_wave(BlenderRNA *brna)
01118 {
01119     StructRNA *srna;
01120     PropertyRNA *prop;
01121 
01122     srna= RNA_def_struct(brna, "WaveModifier", "Modifier");
01123     RNA_def_struct_ui_text(srna, "Wave Modifier", "Wave effect modifier");
01124     RNA_def_struct_sdna(srna, "WaveModifierData");
01125     RNA_def_struct_ui_icon(srna, ICON_MOD_WAVE);
01126 
01127     prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
01128     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_X);
01129     RNA_def_property_ui_text(prop, "X", "X axis motion");
01130     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01131 
01132     prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
01133     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_Y);
01134     RNA_def_property_ui_text(prop, "Y", "Y axis motion");
01135     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01136 
01137     prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
01138     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_CYCL);
01139     RNA_def_property_ui_text(prop, "Cyclic", "Cyclic wave effect");
01140     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01141 
01142     prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
01143     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM);
01144     RNA_def_property_ui_text(prop, "Normals", "Displace along normals");
01145     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01146 
01147     prop= RNA_def_property(srna, "use_normal_x", PROP_BOOLEAN, PROP_NONE);
01148     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_X);
01149     RNA_def_property_ui_text(prop, "X Normal", "Enable displacement along the X normal");
01150     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01151 
01152     prop= RNA_def_property(srna, "use_normal_y", PROP_BOOLEAN, PROP_NONE);
01153     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Y);
01154     RNA_def_property_ui_text(prop, "Y Normal", "Enable displacement along the Y normal");
01155     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01156 
01157     prop= RNA_def_property(srna, "use_normal_z", PROP_BOOLEAN, PROP_NONE);
01158     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Z);
01159     RNA_def_property_ui_text(prop, "Z Normal", "Enable displacement along the Z normal");
01160     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01161 
01162     prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE);
01163     RNA_def_property_float_sdna(prop, NULL, "timeoffs");
01164     RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
01165     RNA_def_property_ui_text(prop, "Time Offset", "Either the starting frame (for positive speed) or ending frame (for negative speed.)");
01166     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01167 
01168     prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
01169     RNA_def_property_float_sdna(prop, NULL, "lifetime");
01170     RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
01171     RNA_def_property_ui_text(prop, "Lifetime",  "Lifetime of the wave in frames, zero means infinite");
01172     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01173 
01174     prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME);
01175     RNA_def_property_float_sdna(prop, NULL, "damp");
01176     RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
01177     RNA_def_property_ui_text(prop, "Damping Time",  "Number of frames in which the wave damps out after it dies");
01178     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01179 
01180     prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
01181     RNA_def_property_float_sdna(prop, NULL, "falloff");
01182     RNA_def_property_range(prop, 0, FLT_MAX);
01183     RNA_def_property_ui_range(prop, 0, 100, 100, 2);
01184     RNA_def_property_ui_text(prop, "Falloff Radius",  "Distance after which it fades out");
01185     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01186 
01187     prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE);
01188     RNA_def_property_float_sdna(prop, NULL, "startx");
01189     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01190     RNA_def_property_ui_range(prop, -100, 100, 100, 2);
01191     RNA_def_property_ui_text(prop, "Start Position X",  "X coordinate of the start position");
01192     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01193 
01194     prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE);
01195     RNA_def_property_float_sdna(prop, NULL, "starty");
01196     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01197     RNA_def_property_ui_range(prop, -100, 100, 100, 2);
01198     RNA_def_property_ui_text(prop, "Start Position Y",  "Y coordinate of the start position");
01199     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01200 
01201     prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE);
01202     RNA_def_property_pointer_sdna(prop, NULL, "objectcenter");
01203     RNA_def_property_ui_text(prop, "Start Position Object", "Object which defines the wave center");
01204     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01205     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01206 
01207     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01208     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
01209     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the wave");
01210     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_vgroup_set");
01211     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01212 
01213     prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
01214     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01215     RNA_def_property_ui_range(prop, -1, 1, 10, 2);
01216     RNA_def_property_ui_text(prop, "Speed", "Speed of the wave, towards the starting point when negative");
01217     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01218 
01219     prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
01220     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01221     RNA_def_property_ui_range(prop, -2, 2, 10, 2);
01222     RNA_def_property_ui_text(prop, "Height", "Height of the wave");
01223     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01224 
01225     prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
01226     RNA_def_property_range(prop, 0, FLT_MAX);
01227     RNA_def_property_ui_range(prop, 0, 5, 10, 2);
01228     RNA_def_property_ui_text(prop, "Width", "Distance between the waves");
01229     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01230 
01231     prop= RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_DISTANCE);
01232     RNA_def_property_float_sdna(prop, NULL, "narrow");
01233     RNA_def_property_range(prop, 0, FLT_MAX);
01234     RNA_def_property_ui_range(prop, 0, 10, 10, 2);
01235     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");
01236     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01237 
01238     rna_def_modifier_generic_map_info(srna);
01239 }
01240 
01241 static void rna_def_modifier_armature(BlenderRNA *brna)
01242 {
01243     StructRNA *srna;
01244     PropertyRNA *prop;
01245 
01246     srna= RNA_def_struct(brna, "ArmatureModifier", "Modifier");
01247     RNA_def_struct_ui_text(srna, "Armature Modifier", "Armature deformation modifier");
01248     RNA_def_struct_sdna(srna, "ArmatureModifierData");
01249     RNA_def_struct_ui_icon(srna, ICON_MOD_ARMATURE);
01250 
01251     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01252     RNA_def_property_ui_text(prop, "Object", "Armature object to deform with");
01253     RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL, "rna_Armature_object_poll");
01254     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01255     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01256 
01257     prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
01258     RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE);
01259     RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Bind Bone envelopes to armature modifier");
01260     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01261 
01262     prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE);
01263     RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP);
01264     RNA_def_property_ui_text(prop, "Use Vertex Groups", "Bind vertex groups to armature modifier");
01265     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01266     
01267     prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
01268     RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
01269     RNA_def_property_ui_text(prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
01270     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01271 
01272     prop= RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
01273     RNA_def_property_boolean_sdna(prop, NULL, "multi", 0);
01274     RNA_def_property_ui_text(prop, "Multi Modifier",  "Use same input as previous modifier, and mix results using overall vgroup");
01275     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01276     
01277     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01278     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
01279     RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
01280     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureModifier_vgroup_set");
01281     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01282 
01283     prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
01284     RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
01285     RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
01286     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01287 }
01288 
01289 static void rna_def_modifier_hook(BlenderRNA *brna)
01290 {
01291     StructRNA *srna;
01292     PropertyRNA *prop;
01293 
01294     srna= RNA_def_struct(brna, "HookModifier", "Modifier");
01295     RNA_def_struct_ui_text(srna, "Hook Modifier", "Hook modifier to modify the location of vertices");
01296     RNA_def_struct_sdna(srna, "HookModifierData");
01297     RNA_def_struct_ui_icon(srna, ICON_HOOK);
01298 
01299     prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_DISTANCE);
01300     RNA_def_property_range(prop, 0, FLT_MAX);
01301     RNA_def_property_ui_range(prop, 0, 100, 100, 2);
01302     RNA_def_property_ui_text(prop, "Falloff",  "If not zero, the distance from the hook where influence ends");
01303     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01304 
01305     prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
01306     RNA_def_property_range(prop, 0, 1);
01307     RNA_def_property_ui_text(prop, "Force",  "Relative force of the hook");
01308     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01309 
01310     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01311     RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset");
01312     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01313     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01314     
01315     prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
01316     RNA_def_property_string_sdna(prop, NULL, "subtarget");
01317     RNA_def_property_ui_text(prop, "Sub-Target", "Name of Parent Bone for hook (if applicable), also recalculates and clears offset");
01318     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01319 
01320     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01321     RNA_def_property_string_sdna(prop, NULL, "name");
01322     RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
01323     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_HookModifier_vgroup_set");
01324     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01325 }
01326 
01327 static void rna_def_modifier_softbody(BlenderRNA *brna)
01328 {
01329     StructRNA *srna;
01330     PropertyRNA *prop;
01331 
01332     srna= RNA_def_struct(brna, "SoftBodyModifier", "Modifier");
01333     RNA_def_struct_ui_text(srna, "Soft Body Modifier", "Soft body simulation modifier");
01334     RNA_def_struct_sdna(srna, "SoftbodyModifierData");
01335     RNA_def_struct_ui_icon(srna, ICON_MOD_SOFT);
01336 
01337     prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
01338     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01339     RNA_def_property_struct_type(prop, "SoftBodySettings");
01340     RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL, NULL);
01341     RNA_def_property_ui_text(prop, "Soft Body Settings", "");
01342 
01343     prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
01344     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01345     RNA_def_property_struct_type(prop, "PointCache");
01346     RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL, NULL);
01347     RNA_def_property_ui_text(prop, "Soft Body Point Cache", "");
01348 }
01349 
01350 static void rna_def_modifier_boolean(BlenderRNA *brna)
01351 {
01352     StructRNA *srna;
01353     PropertyRNA *prop;
01354 
01355     static EnumPropertyItem prop_operation_items[] = {
01356         {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", "Keep the part of the mesh that intersects with the other selected object"},
01357         {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combine two meshes in an additive way"},
01358         {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combine two meshes in a subtractive way"},
01359         {0, NULL, 0, NULL, NULL}};
01360 
01361     srna= RNA_def_struct(brna, "BooleanModifier", "Modifier");
01362     RNA_def_struct_ui_text(srna, "Boolean Modifier", "Boolean operations modifier");
01363     RNA_def_struct_sdna(srna, "BooleanModifierData");
01364     RNA_def_struct_ui_icon(srna, ICON_MOD_BOOLEAN);
01365 
01366     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01367     RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation");
01368     RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL, "rna_Mesh_object_poll");
01369     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01370     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01371 
01372     prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
01373     RNA_def_property_enum_items(prop, prop_operation_items);
01374     RNA_def_property_ui_text(prop, "Operation", "");
01375     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01376 }
01377 
01378 static void rna_def_modifier_array(BlenderRNA *brna)
01379 {
01380     StructRNA *srna;
01381     PropertyRNA *prop;
01382 
01383     static EnumPropertyItem prop_fit_type_items[] = {
01384         {MOD_ARR_FIXEDCOUNT, "FIXED_COUNT", 0, "Fixed Count", "Duplicate the object a certain number of times"},
01385         {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", "Duplicate the object as many times as fits in a certain length"},
01386         {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", "Fit the duplicated objects to a curve"},
01387         {0, NULL, 0, NULL, NULL}};
01388 
01389     srna= RNA_def_struct(brna, "ArrayModifier", "Modifier");
01390     RNA_def_struct_ui_text(srna, "Array Modifier", "Array duplication modifier");
01391     RNA_def_struct_sdna(srna, "ArrayModifierData");
01392     RNA_def_struct_ui_icon(srna, ICON_MOD_ARRAY);
01393 
01394     /* Length parameters */
01395     prop= RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE);
01396     RNA_def_property_enum_items(prop, prop_fit_type_items);
01397     RNA_def_property_ui_text(prop, "Fit Type", "Array length calculation method");
01398     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01399 
01400     prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
01401     RNA_def_property_range(prop, 1, INT_MAX);
01402     RNA_def_property_ui_range(prop, 1, 1000, 1, 0);
01403     RNA_def_property_ui_text(prop, "Count",  "Number of duplicates to make");
01404     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01405 
01406     prop= RNA_def_property(srna, "fit_length", PROP_FLOAT, PROP_DISTANCE);
01407     RNA_def_property_float_sdna(prop, NULL, "length");
01408     RNA_def_property_range(prop, 0, INT_MAX);
01409     RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
01410     RNA_def_property_ui_text(prop, "Length", "Length to fit array within");
01411     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01412 
01413     prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
01414     RNA_def_property_pointer_sdna(prop, NULL, "curve_ob");
01415     RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to");
01416     RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL, "rna_Curve_object_poll");
01417     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01418     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01419 
01420     /* Offset parameters */
01421     prop= RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_TRANSLATION);
01422     RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST);
01423     RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset");
01424     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01425     
01426     prop= RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
01427     RNA_def_property_float_sdna(prop, NULL, "offset");
01428     RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for the distance between arrayed items");
01429     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01430 
01431     prop= RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE);
01432     RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_RELATIVE);
01433     RNA_def_property_ui_text(prop, "Relative Offset", "Add an offset relative to the object's bounding box");
01434     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01435 
01436     prop= RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE); /* PROP_TRANSLATION causes units to be used which we dont want */
01437     RNA_def_property_float_sdna(prop, NULL, "scale");
01438     RNA_def_property_ui_text(prop, "Relative Offset Displacement", "The size of the geometry will determine the distance between arrayed items");
01439     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01440 
01441     /* Vertex merging parameters */
01442     prop= RNA_def_property(srna, "use_merge_vertices", PROP_BOOLEAN, PROP_NONE);
01443     RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGE);
01444     RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in adjacent duplicates");
01445     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01446 
01447     prop= RNA_def_property(srna, "use_merge_vertices_cap", PROP_BOOLEAN, PROP_NONE);
01448     RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGEFINAL);
01449     RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in first and last duplicates");
01450     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01451 
01452     prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
01453     RNA_def_property_float_sdna(prop, NULL, "merge_dist");
01454     RNA_def_property_range(prop, 0, FLT_MAX);
01455     RNA_def_property_ui_range(prop, 0, 1, 1, 4);
01456     RNA_def_property_ui_text(prop, "Merge Distance", "Limit below which to merge vertices");
01457     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01458 
01459     /* Offset object */
01460     prop= RNA_def_property(srna, "use_object_offset", PROP_BOOLEAN, PROP_NONE);
01461     RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_OBJ);
01462     RNA_def_property_ui_text(prop, "Object Offset", "Add another object's transformation to the total offset");
01463     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01464 
01465     prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
01466     RNA_def_property_pointer_sdna(prop, NULL, "offset_ob");
01467     RNA_def_property_ui_text(prop, "Object Offset", "Use the location and rotation of another object to determine the distance and rotational change between arrayed items");
01468     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01469     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01470     
01471     /* Caps */
01472     prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE);
01473     RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap");
01474     RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL, "rna_Mesh_object_poll");
01475     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01476     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01477 
01478     prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE);
01479     RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap");
01480     RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll");
01481     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01482     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01483 }
01484 
01485 static void rna_def_modifier_edgesplit(BlenderRNA *brna)
01486 {
01487     StructRNA *srna;
01488     PropertyRNA *prop;
01489 
01490     srna= RNA_def_struct(brna, "EdgeSplitModifier", "Modifier");
01491     RNA_def_struct_ui_text(srna, "EdgeSplit Modifier", "Edge splitting modifier to create sharp edges");
01492     RNA_def_struct_sdna(srna, "EdgeSplitModifierData");
01493     RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT);
01494 
01495 #if 1 /* expose as radians */
01496     prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE);
01497     RNA_def_property_float_funcs(prop, "rna_EdgeSplitModifier_split_angle_get", "rna_EdgeSplitModifier_split_angle_set", NULL);
01498     RNA_def_property_range(prop, 0, DEG2RAD(180));
01499     RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2);
01500 #else
01501     prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_NONE);
01502     RNA_def_property_range(prop, 0, 180);
01503     RNA_def_property_ui_range(prop, 0, 180, 100, 2);
01504 #endif
01505     RNA_def_property_ui_text(prop, "Split Angle", "Angle above which to split edges");
01506     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01507 
01508     prop= RNA_def_property(srna, "use_edge_angle", PROP_BOOLEAN, PROP_NONE);
01509     RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMANGLE);
01510     RNA_def_property_ui_text(prop, "Use Edge Angle", "Split edges with high angle between faces");
01511     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01512 
01513     prop= RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
01514     RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMFLAG);
01515     RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp");
01516     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01517 }
01518 
01519 static void rna_def_modifier_displace(BlenderRNA *brna)
01520 {
01521     StructRNA *srna;
01522     PropertyRNA *prop;
01523 
01524     static EnumPropertyItem prop_direction_items[] = {
01525         {MOD_DISP_DIR_X, "X", 0, "X", "Use the texture's intensity value to displace in the X direction"},
01526         {MOD_DISP_DIR_Y, "Y", 0, "Y", "Use the texture's intensity value to displace in the Y direction"},
01527         {MOD_DISP_DIR_Z, "Z", 0, "Z", "Use the texture's intensity value to displace in the Z direction"},
01528         {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", "Use the texture's intensity value to displace in the normal direction"},
01529         {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Use the texture's RGB values to displace the mesh in the XYZ direction"},
01530         {0, NULL, 0, NULL, NULL}};
01531 
01532     srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier");
01533     RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier");
01534     RNA_def_struct_sdna(srna, "DisplaceModifierData");
01535     RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE);
01536 
01537     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01538     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
01539     RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
01540     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_vgroup_set");
01541     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01542 
01543     prop= RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE);
01544     RNA_def_property_float_sdna(prop, NULL, "midlevel");
01545     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01546     RNA_def_property_ui_range(prop, 0, 1, 10, 3);
01547     RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement");
01548     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01549 
01550     prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
01551     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01552     RNA_def_property_ui_range(prop, -100, 100, 10, 3);
01553     RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry");
01554     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01555 
01556     prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
01557     RNA_def_property_enum_items(prop, prop_direction_items);
01558     RNA_def_property_ui_text(prop, "Direction", "");
01559     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01560 
01561     rna_def_modifier_generic_map_info(srna);
01562 }
01563 
01564 static void rna_def_modifier_uvproject(BlenderRNA *brna)
01565 {
01566     StructRNA *srna;
01567     PropertyRNA *prop;
01568 
01569     srna= RNA_def_struct(brna, "UVProjectModifier", "Modifier");
01570     RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to set UVs from a projector");
01571     RNA_def_struct_sdna(srna, "UVProjectModifierData");
01572     RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT);
01573 
01574     prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
01575     RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
01576     RNA_def_property_ui_text(prop, "UV Map", "UV map name");
01577     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set");
01578     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01579 
01580     prop= RNA_def_property(srna, "projector_count", PROP_INT, PROP_NONE);
01581     RNA_def_property_int_sdna(prop, NULL, "num_projectors");
01582     RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use");
01583     RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL);
01584     RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX);
01585     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01586 
01587     prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE);
01588     RNA_def_property_struct_type(prop, "UVProjector");
01589     RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
01590     RNA_def_property_ui_text(prop, "Projectors", "");
01591 
01592     prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
01593     RNA_def_property_ui_text(prop, "Image", "");
01594     RNA_def_property_flag(prop, PROP_EDITABLE);
01595     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01596 
01597     prop= RNA_def_property(srna, "aspect_x", PROP_FLOAT, PROP_NONE);
01598     RNA_def_property_float_sdna(prop, NULL, "aspectx");
01599     RNA_def_property_range(prop, 1, FLT_MAX);
01600     RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
01601     RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", "");
01602     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01603 
01604     prop= RNA_def_property(srna, "aspect_y", PROP_FLOAT, PROP_NONE);
01605     RNA_def_property_float_sdna(prop, NULL, "aspecty");
01606     RNA_def_property_range(prop, 1, FLT_MAX);
01607     RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
01608     RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", "");
01609     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01610     
01611     prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
01612     RNA_def_property_float_sdna(prop, NULL, "scalex");
01613     RNA_def_property_range(prop, 0, FLT_MAX);
01614     RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
01615     RNA_def_property_ui_text(prop, "Horizontal Scale", "");
01616     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01617 
01618     prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
01619     RNA_def_property_float_sdna(prop, NULL, "scaley");
01620     RNA_def_property_range(prop, 0, FLT_MAX);
01621     RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
01622     RNA_def_property_ui_text(prop, "Vertical Scale", "");
01623     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01624 
01625     prop= RNA_def_property(srna, "use_image_override", PROP_BOOLEAN, PROP_NONE);
01626     RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE);
01627     RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image");
01628     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01629 
01630     srna= RNA_def_struct(brna, "UVProjector", NULL);
01631     RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier");
01632 
01633     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01634     RNA_def_property_struct_type(prop, "Object");
01635     RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL, NULL);
01636     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01637     RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform");
01638     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01639 }
01640 
01641 static void rna_def_modifier_smooth(BlenderRNA *brna)
01642 {
01643     StructRNA *srna;
01644     PropertyRNA *prop;
01645 
01646     srna= RNA_def_struct(brna, "SmoothModifier", "Modifier");
01647     RNA_def_struct_ui_text(srna, "Smooth Modifier", "Smoothing effect modifier");
01648     RNA_def_struct_sdna(srna, "SmoothModifierData");
01649     RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
01650 
01651     prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
01652     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X);
01653     RNA_def_property_ui_text(prop, "X", "Smooth object along X axis");
01654     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01655 
01656     prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
01657     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y);
01658     RNA_def_property_ui_text(prop, "Y", "Smooth object along Y axis");
01659     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01660 
01661     prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
01662     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z);
01663     RNA_def_property_ui_text(prop, "Z", "Smooth object along Z axis");
01664     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01665 
01666     prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
01667     RNA_def_property_float_sdna(prop, NULL, "fac");
01668     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01669     RNA_def_property_ui_range(prop, -10, 10, 1, 3);
01670     RNA_def_property_ui_text(prop, "Factor", "Strength of modifier effect");
01671     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01672 
01673     prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
01674     RNA_def_property_int_sdna(prop, NULL, "repeat");
01675     RNA_def_property_ui_range(prop, 0, 30, 1, 0);
01676     RNA_def_property_ui_text(prop, "Repeat", "");
01677     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01678     
01679     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01680     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
01681     RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
01682     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SmoothModifier_vgroup_set");
01683     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01684 }
01685 
01686 static void rna_def_modifier_cast(BlenderRNA *brna)
01687 {
01688     StructRNA *srna;
01689     PropertyRNA *prop;
01690 
01691     static EnumPropertyItem prop_cast_type_items[] = {
01692         {MOD_CAST_TYPE_SPHERE, "SPHERE", 0, "Sphere", ""},
01693         {MOD_CAST_TYPE_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
01694         {MOD_CAST_TYPE_CUBOID, "CUBOID", 0, "Cuboid", ""},
01695         {0, NULL, 0, NULL, NULL}};
01696 
01697     srna= RNA_def_struct(brna, "CastModifier", "Modifier");
01698     RNA_def_struct_ui_text(srna, "Cast Modifier", "Modifier to cast to other shapes");
01699     RNA_def_struct_sdna(srna, "CastModifierData");
01700     RNA_def_struct_ui_icon(srna, ICON_MOD_CAST);
01701 
01702     prop= RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE);
01703     RNA_def_property_enum_sdna(prop, NULL, "type");
01704     RNA_def_property_enum_items(prop, prop_cast_type_items);
01705     RNA_def_property_ui_text(prop, "Cast Type", "Target object shape");
01706     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01707     
01708     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01709     RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect");
01710     RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL, NULL);
01711     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01712     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01713 
01714     prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
01715     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_X);
01716     RNA_def_property_ui_text(prop, "X", "");
01717     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01718 
01719     prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
01720     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Y);
01721     RNA_def_property_ui_text(prop, "Y", "");
01722     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01723 
01724     prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
01725     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Z);
01726     RNA_def_property_ui_text(prop, "Z", "");
01727     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01728     
01729     prop= RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE);
01730     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS);
01731     RNA_def_property_ui_text(prop, "From Radius", "Use radius as size of projection shape (0 = auto)");
01732     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01733     
01734     prop= RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE);
01735     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_USE_OB_TRANSFORM);
01736     RNA_def_property_ui_text(prop, "Use transform", "Use object transform to control projection shape");
01737     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01738     
01739     prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
01740     RNA_def_property_float_sdna(prop, NULL, "fac");
01741     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
01742     RNA_def_property_ui_range(prop, -10, 10, 5, 2);
01743     RNA_def_property_ui_text(prop, "Factor", "");
01744     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01745 
01746     prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
01747     RNA_def_property_range(prop, 0, FLT_MAX);
01748     RNA_def_property_ui_range(prop, 0, 100, 5, 2);
01749     RNA_def_property_ui_text(prop, "Radius", "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite.)");
01750     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01751 
01752     prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
01753     RNA_def_property_range(prop, 0, FLT_MAX);
01754     RNA_def_property_ui_range(prop, 0, 100, 5, 2);
01755     RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto)");
01756     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01757 
01758     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01759     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
01760     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
01761     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CastModifier_vgroup_set");
01762     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01763 }
01764 
01765 static void rna_def_modifier_meshdeform(BlenderRNA *brna)
01766 {
01767     StructRNA *srna;
01768     PropertyRNA *prop;
01769 #if 0
01770     static EnumPropertyItem prop_mode_items[] = {
01771         {0, "VOLUME", 0, "Volume", "Bind to volume inside cage mesh"},
01772         {1, "SURFACE", 0, "Surface", "Bind to surface of cage mesh"},
01773         {0, NULL, 0, NULL, NULL}};
01774 #endif
01775 
01776     srna= RNA_def_struct(brna, "MeshDeformModifier", "Modifier");
01777     RNA_def_struct_ui_text(srna, "MeshDeform Modifier", "Mesh deformation modifier to deform with other meshes");
01778     RNA_def_struct_sdna(srna, "MeshDeformModifierData");
01779     RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);
01780 
01781     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01782     RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with");
01783     RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL, NULL);
01784     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01785     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01786     
01787     prop= RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE);
01788     RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", NULL);
01789     RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage");
01790     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01791     
01792     prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
01793     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP);
01794     RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
01795     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01796 
01797     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01798     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
01799     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
01800     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshDeformModifier_vgroup_set");
01801     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01802 
01803     prop= RNA_def_property(srna, "precision", PROP_INT, PROP_NONE);
01804     RNA_def_property_int_sdna(prop, NULL, "gridsize");
01805     RNA_def_property_range(prop, 2, 10);
01806     RNA_def_property_ui_text(prop, "Precision", "The grid size for binding");
01807     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01808 
01809     prop= RNA_def_property(srna, "use_dynamic_bind", PROP_BOOLEAN, PROP_NONE);
01810     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_DYNAMIC_BIND);
01811     RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming)");
01812     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01813 
01814 #if 0
01815     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01816     RNA_def_property_enum_items(prop, prop_mode_items);
01817     RNA_def_property_ui_text(prop, "Mode", "Method of binding vertices are bound to cage mesh");
01818     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01819 #endif
01820 }
01821 
01822 static void rna_def_modifier_particlesystem(BlenderRNA *brna)
01823 {
01824     StructRNA *srna;
01825     PropertyRNA *prop;
01826 
01827     srna= RNA_def_struct(brna, "ParticleSystemModifier", "Modifier");
01828     RNA_def_struct_ui_text(srna, "ParticleSystem Modifier", "Particle system simulation modifier");
01829     RNA_def_struct_sdna(srna, "ParticleSystemModifierData");
01830     RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
01831     
01832     prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
01833     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01834     RNA_def_property_pointer_sdna(prop, NULL, "psys");
01835     RNA_def_property_ui_text(prop, "Particle System", "Particle System that this modifier controls");
01836 }
01837 
01838 static void rna_def_modifier_particleinstance(BlenderRNA *brna)
01839 {
01840     StructRNA *srna;
01841     PropertyRNA *prop;
01842 
01843     static EnumPropertyItem particleinstance_axis[] = {
01844         {0, "X", 0, "X", ""},
01845         {1, "Y", 0, "Y", ""},
01846         {2, "Z", 0, "Z", ""},
01847         {0, NULL, 0, NULL, NULL}
01848     };
01849 
01850     srna= RNA_def_struct(brna, "ParticleInstanceModifier", "Modifier");
01851     RNA_def_struct_ui_text(srna, "ParticleInstance Modifier", "Particle system instancing modifier");
01852     RNA_def_struct_sdna(srna, "ParticleInstanceModifierData");
01853     RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
01854 
01855     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
01856     RNA_def_property_pointer_sdna(prop, NULL, "ob");
01857     RNA_def_property_ui_text(prop, "Object", "Object that has the particle system");
01858     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
01859     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
01860 
01861     prop= RNA_def_property(srna, "particle_system_index", PROP_INT, PROP_NONE);
01862     RNA_def_property_int_sdna(prop, NULL, "psys");
01863     RNA_def_property_range(prop, 1, 10);
01864     RNA_def_property_ui_text(prop, "Particle System Number", "");
01865     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01866 
01867     prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
01868     RNA_def_property_enum_sdna(prop, NULL, "axis");
01869     RNA_def_property_enum_items(prop, particleinstance_axis);
01870     RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation");
01871     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01872     
01873     prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
01874     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents);
01875     RNA_def_property_ui_text(prop, "Normal", "Create instances from normal particles");
01876     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01877 
01878     prop= RNA_def_property(srna, "use_children", PROP_BOOLEAN, PROP_NONE);
01879     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Children);
01880     RNA_def_property_ui_text(prop, "Children", "Create instances from child particles");
01881     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01882 
01883     prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
01884     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path);
01885     RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths");
01886     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01887 
01888     prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
01889     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Unborn);
01890     RNA_def_property_ui_text(prop, "Unborn", "Show instances when particles are unborn");
01891     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01892 
01893     prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
01894     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Alive);
01895     RNA_def_property_ui_text(prop, "Alive", "Show instances when particles are alive");
01896     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01897 
01898     prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
01899     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead);
01900     RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead");
01901     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01902 
01903     prop= RNA_def_property(srna, "use_preserve_shape", PROP_BOOLEAN, PROP_NONE);
01904     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape);
01905     RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object");
01906     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01907 
01908     prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
01909     RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize);
01910     RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances");
01911     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01912 
01913     prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
01914     RNA_def_property_float_sdna(prop, NULL, "position");
01915     RNA_def_property_range(prop, 0.0, 1.0);
01916     RNA_def_property_ui_text(prop, "Position", "Position along path");
01917     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01918 
01919     prop= RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE);
01920     RNA_def_property_float_sdna(prop, NULL, "random_position");
01921     RNA_def_property_range(prop, 0.0, 1.0);
01922     RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path");
01923     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01924 }
01925 
01926 static void rna_def_modifier_explode(BlenderRNA *brna)
01927 {
01928     StructRNA *srna;
01929     PropertyRNA *prop;
01930 
01931     srna= RNA_def_struct(brna, "ExplodeModifier", "Modifier");
01932     RNA_def_struct_ui_text(srna, "Explode Modifier", "Explosion effect modifier based on a particle system");
01933     RNA_def_struct_sdna(srna, "ExplodeModifierData");
01934     RNA_def_struct_ui_icon(srna, ICON_MOD_EXPLODE);
01935 
01936     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
01937     RNA_def_property_string_funcs(prop, "rna_ExplodeModifier_vgroup_get", "rna_ExplodeModifier_vgroup_length", "rna_ExplodeModifier_vgroup_set");
01938     RNA_def_property_ui_text(prop, "Vertex Group", "");
01939 
01940     prop= RNA_def_property(srna, "protect", PROP_FLOAT, PROP_NONE);
01941     RNA_def_property_range(prop, 0, 1);
01942     RNA_def_property_ui_text(prop, "Protect", "Clean vertex group edges");
01943     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01944 
01945     prop= RNA_def_property(srna, "use_edge_cut", PROP_BOOLEAN, PROP_NONE);
01946     RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_EdgeCut);
01947     RNA_def_property_ui_text(prop, "Cut Edges", "Cut face edges for nicer shrapnel");
01948     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01949 
01950     prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
01951     RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Unborn);
01952     RNA_def_property_ui_text(prop, "Unborn", "Show mesh when particles are unborn");
01953     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01954 
01955     prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
01956     RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Alive);
01957     RNA_def_property_ui_text(prop, "Alive", "Show mesh when particles are alive");
01958     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01959 
01960     prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
01961     RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Dead);
01962     RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead");
01963     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01964 
01965     prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
01966     RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_PaSize);
01967     RNA_def_property_ui_text(prop, "Size", "Use particle size for the shrapnel");
01968     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01969 
01970     prop= RNA_def_property(srna, "particle_uv", PROP_STRING, PROP_NONE);
01971     RNA_def_property_string_sdna(prop, NULL, "uvname");
01972     RNA_def_property_string_maxlength(prop, MAX_CUSTOMDATA_LAYER_NAME);
01973     RNA_def_property_ui_text(prop, "Particle UV", "UV map to change with particle age");
01974     RNA_def_property_update(prop, 0, "rna_Modifier_update");
01975 }
01976 
01977 static void rna_def_modifier_cloth(BlenderRNA *brna)
01978 {
01979     StructRNA *srna;
01980     PropertyRNA *prop;
01981 
01982     srna= RNA_def_struct(brna, "ClothModifier", "Modifier");
01983     RNA_def_struct_ui_text(srna, "Cloth Modifier", "Cloth simulation modifier");
01984     RNA_def_struct_sdna(srna, "ClothModifierData");
01985     RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH);
01986     
01987     prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
01988     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01989     RNA_def_property_pointer_sdna(prop, NULL, "sim_parms");
01990     RNA_def_property_ui_text(prop, "Cloth Settings", "");
01991     
01992     prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE);
01993     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01994     RNA_def_property_pointer_sdna(prop, NULL, "coll_parms");
01995     RNA_def_property_ui_text(prop, "Cloth Collision Settings", "");
01996     
01997     prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
01998     RNA_def_property_flag(prop, PROP_NEVER_NULL);
01999     RNA_def_property_ui_text(prop, "Point Cache", "");
02000 }
02001 
02002 static void rna_def_modifier_smoke(BlenderRNA *brna)
02003 {
02004     StructRNA *srna;
02005     PropertyRNA *prop;
02006     
02007     static EnumPropertyItem prop_smoke_type_items[] = {
02008             {0, "NONE", 0, "None", ""},
02009             {MOD_SMOKE_TYPE_DOMAIN, "DOMAIN", 0, "Domain", ""},
02010             {MOD_SMOKE_TYPE_FLOW, "FLOW", 0, "Flow", "Inflow/Outflow"},
02011             {MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""},
02012             {0, NULL, 0, NULL, NULL}};
02013     
02014     srna= RNA_def_struct(brna, "SmokeModifier", "Modifier");
02015     RNA_def_struct_ui_text(srna, "Smoke Modifier", "Smoke simulation modifier");
02016     RNA_def_struct_sdna(srna, "SmokeModifierData");
02017     RNA_def_struct_ui_icon(srna, ICON_MOD_SMOKE);
02018     
02019     prop= RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE);
02020     RNA_def_property_pointer_sdna(prop, NULL, "domain");
02021     RNA_def_property_ui_text(prop, "Domain Settings", "");
02022     
02023     prop= RNA_def_property(srna, "flow_settings", PROP_POINTER, PROP_NONE);
02024     RNA_def_property_pointer_sdna(prop, NULL, "flow");
02025     RNA_def_property_ui_text(prop, "Flow Settings", "");
02026     
02027     prop= RNA_def_property(srna, "coll_settings", PROP_POINTER, PROP_NONE);
02028     RNA_def_property_pointer_sdna(prop, NULL, "coll");
02029     RNA_def_property_ui_text(prop, "Collision Settings", "");
02030     
02031     prop= RNA_def_property(srna, "smoke_type", PROP_ENUM, PROP_NONE);
02032     RNA_def_property_enum_sdna(prop, NULL, "type");
02033     RNA_def_property_enum_items(prop, prop_smoke_type_items);
02034     RNA_def_property_ui_text(prop, "Type", "");
02035     RNA_def_property_update(prop, 0, "rna_Smoke_set_type");
02036 }
02037 
02038 static void rna_def_modifier_dynamic_paint(BlenderRNA *brna)
02039 {
02040     StructRNA *srna;
02041     PropertyRNA *prop;
02042     
02043     srna= RNA_def_struct(brna, "DynamicPaintModifier", "Modifier");
02044     RNA_def_struct_ui_text(srna, "Dynamic Paint Modifier", "Dynamic Paint modifier");
02045     RNA_def_struct_sdna(srna, "DynamicPaintModifierData");
02046     RNA_def_struct_ui_icon(srna, ICON_MOD_DYNAMICPAINT);
02047     
02048     prop= RNA_def_property(srna, "canvas_settings", PROP_POINTER, PROP_NONE);
02049     RNA_def_property_pointer_sdna(prop, NULL, "canvas");
02050     RNA_def_property_ui_text(prop, "Canvas Settings", "");
02051     
02052     prop= RNA_def_property(srna, "brush_settings", PROP_POINTER, PROP_NONE);
02053     RNA_def_property_pointer_sdna(prop, NULL, "brush");
02054     RNA_def_property_ui_text(prop, "Brush Settings", "");
02055 
02056     prop= RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE);
02057     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02058     RNA_def_property_enum_sdna(prop, NULL, "type");
02059     RNA_def_property_enum_items(prop, prop_dynamicpaint_type_items);
02060     RNA_def_property_ui_text(prop, "Type", "");
02061 }
02062 
02063 static void rna_def_modifier_collision(BlenderRNA *brna)
02064 {
02065     StructRNA *srna;
02066     PropertyRNA *prop;
02067 
02068     srna= RNA_def_struct(brna, "CollisionModifier", "Modifier");
02069     RNA_def_struct_ui_text(srna, "Collision Modifier", "Collision modifier defining modifier stack position used for collision");
02070     RNA_def_struct_sdna(srna, "CollisionModifierData");
02071     RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
02072 
02073     prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
02074     RNA_def_property_flag(prop, PROP_NEVER_NULL);
02075     RNA_def_property_struct_type(prop, "CollisionSettings");
02076     RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL, NULL);
02077     RNA_def_property_ui_text(prop, "Settings", "");
02078 }
02079 
02080 static void rna_def_modifier_bevel(BlenderRNA *brna)
02081 {
02082     StructRNA *srna;
02083     PropertyRNA *prop;
02084 
02085     static EnumPropertyItem prop_limit_method_items[] = {
02086         {0, "NONE", 0, "None", "Bevel the entire mesh by a constant amount"},
02087         {BME_BEVEL_ANGLE, "ANGLE", 0, "Angle", "Only bevel edges with sharp enough angles between faces"},
02088         {BME_BEVEL_WEIGHT, "WEIGHT", 0, "Weight", "Use bevel weights to determine how much bevel is applied; apply them separately in vert/edge select mode"},
02089         {0, NULL, 0, NULL, NULL}};
02090 
02091     static EnumPropertyItem prop_edge_weight_method_items[] = {
02092         {0, "AVERAGE", 0, "Average", ""},
02093         {BME_BEVEL_EMIN, "SHARPEST", 0, "Sharpest", ""},
02094         {BME_BEVEL_EMAX, "LARGEST", 0, "Largest", ""},
02095         {0, NULL, 0, NULL, NULL}};
02096 
02097     srna= RNA_def_struct(brna, "BevelModifier", "Modifier");
02098     RNA_def_struct_ui_text(srna, "Bevel Modifier", "Bevel modifier to make edges and vertices more rounded");
02099     RNA_def_struct_sdna(srna, "BevelModifierData");
02100     RNA_def_struct_ui_icon(srna, ICON_MOD_BEVEL);
02101 
02102     prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
02103     RNA_def_property_float_sdna(prop, NULL, "value");
02104     RNA_def_property_range(prop, 0, FLT_MAX);
02105     RNA_def_property_ui_range(prop, 0, 10, 0.1, 4);
02106     RNA_def_property_ui_text(prop, "Width", "Bevel value/amount");
02107     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02108 
02109     prop= RNA_def_property(srna, "use_only_vertices", PROP_BOOLEAN, PROP_NONE);
02110     RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_VERT);
02111     RNA_def_property_ui_text(prop, "Only Vertices", "Bevel verts/corners, not edges");
02112     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02113 
02114     prop= RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE);
02115     RNA_def_property_enum_sdna(prop, NULL, "lim_flags");
02116     RNA_def_property_enum_items(prop, prop_limit_method_items);
02117     RNA_def_property_ui_text(prop, "Limit Method", "");
02118     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02119 
02120     prop= RNA_def_property(srna, "edge_weight_method", PROP_ENUM, PROP_NONE);
02121     RNA_def_property_enum_sdna(prop, NULL, "e_flags");
02122     RNA_def_property_enum_items(prop, prop_edge_weight_method_items);
02123     RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex");
02124     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02125 
02126 #if 1 /* expose as radians */
02127     prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE);
02128     RNA_def_property_float_funcs(prop, "rna_BevelModifier_angle_limit_get", "rna_BevelModifier_angle_limit_set", NULL);
02129     RNA_def_property_range(prop, 0, DEG2RAD(180));
02130     RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2);
02131 #else
02132     prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_NONE);
02133     RNA_def_property_float_sdna(prop, NULL, "bevel_angle");
02134     RNA_def_property_range(prop, 0, 180);
02135     RNA_def_property_ui_range(prop, 0, 180, 100, 2);
02136 #endif
02137     RNA_def_property_ui_text(prop, "Angle", "Angle above which to bevel edges");
02138     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02139 }
02140 
02141 static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
02142 {
02143     StructRNA *srna;
02144     PropertyRNA *prop;
02145 
02146     static EnumPropertyItem shrink_type_items[] = {
02147         {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", "Shrink the mesh to the nearest target surface"},
02148         {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrink the mesh to the nearest target surface along a given axis"},
02149         {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the mesh to the nearest target vertex"},
02150         {0, NULL, 0, NULL, NULL}};
02151     
02152     static EnumPropertyItem shrink_face_cull_items[] = {
02153         {0, "OFF", 0, "Off", "No culling"},
02154         {MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, "FRONT", 0, "Front", "No projection when in front of the face"},
02155         {MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, "BACK", 0, "Back", "No projection when behind the face"},
02156         {0, NULL, 0, NULL, NULL}};
02157 
02158     srna= RNA_def_struct(brna, "ShrinkwrapModifier", "Modifier");
02159     RNA_def_struct_ui_text(srna, "Shrinkwrap Modifier", "Shrink wrapping modifier to shrink wrap and object to a target");
02160     RNA_def_struct_sdna(srna, "ShrinkwrapModifierData");
02161     RNA_def_struct_ui_icon(srna, ICON_MOD_SHRINKWRAP);
02162 
02163     prop= RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE);
02164     RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
02165     RNA_def_property_enum_items(prop, shrink_type_items);
02166     RNA_def_property_ui_text(prop, "Mode", "");
02167     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02168 
02169     prop= RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
02170     RNA_def_property_enum_sdna(prop, NULL, "shrinkOpts");
02171     RNA_def_property_enum_items(prop, shrink_face_cull_items);
02172     RNA_def_property_enum_funcs(prop, "rna_ShrinkwrapModifier_face_cull_get", "rna_ShrinkwrapModifier_face_cull_set", NULL);
02173     RNA_def_property_ui_text(prop, "Face Cull", "Stop vertices from projecting to a face on the target when facing towards/away");
02174     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02175 
02176     prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
02177     RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to");
02178     RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL, "rna_Mesh_object_poll");
02179     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
02180     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02181 
02182     prop= RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
02183     RNA_def_property_pointer_sdna(prop, NULL, "auxTarget");
02184     RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to");
02185     RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL, "rna_Mesh_object_poll");
02186     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
02187     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02188 
02189     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
02190     RNA_def_property_string_sdna(prop, NULL, "vgroup_name");
02191     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
02192     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShrinkwrapModifier_vgroup_set");
02193     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02194 
02195     prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
02196     RNA_def_property_float_sdna(prop, NULL, "keepDist");
02197     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
02198     RNA_def_property_ui_range(prop, -100, 100, 1, 2);
02199     RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target");
02200     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02201 
02202     prop= RNA_def_property(srna, "use_project_x", PROP_BOOLEAN, PROP_NONE);
02203     RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS);
02204     RNA_def_property_ui_text(prop, "X", "");
02205     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02206 
02207     prop= RNA_def_property(srna, "use_project_y", PROP_BOOLEAN, PROP_NONE);
02208     RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS);
02209     RNA_def_property_ui_text(prop, "Y", "");
02210     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02211 
02212     prop= RNA_def_property(srna, "use_project_z", PROP_BOOLEAN, PROP_NONE);
02213     RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS);
02214     RNA_def_property_ui_text(prop, "Z", "");
02215     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02216     
02217     prop= RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE);
02218     RNA_def_property_int_sdna(prop, NULL, "subsurfLevels");
02219     RNA_def_property_range(prop, 0, 6);
02220     RNA_def_property_ui_range(prop, 0, 6, 1, 0);
02221     RNA_def_property_ui_text(prop, "Subsurf Levels", "Number of subdivisions that must be performed before extracting vertices' positions and normals");
02222     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02223 
02224     prop= RNA_def_property(srna, "use_negative_direction", PROP_BOOLEAN, PROP_NONE);
02225     RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR);
02226     RNA_def_property_ui_text(prop, "Negative", "Allow vertices to move in the negative direction of axis");
02227     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02228 
02229     prop= RNA_def_property(srna, "use_positive_direction", PROP_BOOLEAN, PROP_NONE);
02230     RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR);
02231     RNA_def_property_ui_text(prop, "Positive", "Allow vertices to move in the positive direction of axis");
02232     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02233 
02234     prop= RNA_def_property(srna, "use_keep_above_surface", PROP_BOOLEAN, PROP_NONE);
02235     RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE);
02236     RNA_def_property_ui_text(prop, "Keep Above Surface", "");
02237     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02238 }
02239 
02240 static void rna_def_modifier_fluidsim(BlenderRNA *brna)
02241 {
02242     StructRNA *srna;
02243     PropertyRNA *prop;
02244 
02245     srna= RNA_def_struct(brna, "FluidSimulationModifier", "Modifier");
02246     RNA_def_struct_ui_text(srna, "Fluid Simulation Modifier", "Fluid simulation modifier");
02247     RNA_def_struct_sdna(srna, "FluidsimModifierData");
02248     RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM);
02249 
02250     prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
02251     RNA_def_property_flag(prop, PROP_NEVER_NULL);
02252     RNA_def_property_pointer_sdna(prop, NULL, "fss");
02253     RNA_def_property_ui_text(prop, "Settings", "Settings for how this object is used in the fluid simulation");
02254 }
02255 
02256 static void rna_def_modifier_mask(BlenderRNA *brna)
02257 {
02258     StructRNA *srna;
02259     PropertyRNA *prop;
02260 
02261     static EnumPropertyItem modifier_mask_mode_items[] = {
02262         {MOD_MASK_MODE_VGROUP, "VERTEX_GROUP", 0, "Vertex Group", ""},
02263         {MOD_MASK_MODE_ARM, "ARMATURE", 0, "Armature", ""},
02264         {0, NULL, 0, NULL, NULL}};
02265 
02266     srna= RNA_def_struct(brna, "MaskModifier", "Modifier");
02267     RNA_def_struct_ui_text(srna, "Mask Modifier", "Mask modifier to hide parts of the mesh");
02268     RNA_def_struct_sdna(srna, "MaskModifierData");
02269     RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);
02270 
02271     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
02272     RNA_def_property_enum_items(prop, modifier_mask_mode_items);
02273     RNA_def_property_ui_text(prop, "Mode", "");
02274     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02275 
02276     prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE);
02277     RNA_def_property_pointer_sdna(prop, NULL, "ob_arm");
02278     RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask");
02279     RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL, "rna_Armature_object_poll");
02280     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
02281     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02282 
02283     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
02284     RNA_def_property_string_sdna(prop, NULL, "vgroup");
02285     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
02286     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MaskModifier_vgroup_set");
02287     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02288 
02289     prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
02290     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MASK_INV);
02291     RNA_def_property_ui_text(prop, "Invert", "Use vertices that are not part of region defined");
02292     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02293 }
02294 
02295 static void rna_def_modifier_simpledeform(BlenderRNA *brna)
02296 {
02297     StructRNA *srna;
02298     PropertyRNA *prop;
02299 
02300     static EnumPropertyItem simple_deform_mode_items[] = {
02301         {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", "Rotate around the Z axis of the modifier space"},
02302         {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", "Bend the mesh over the Z axis of the modifier space"},
02303         {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scale along Z axis of the modifier space"},
02304         {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretch the object along the Z axis of the modifier space"},
02305         {0, NULL, 0, NULL, NULL}};
02306 
02307     srna= RNA_def_struct(brna, "SimpleDeformModifier", "Modifier");
02308     RNA_def_struct_ui_text(srna, "SimpleDeform Modifier", "Simple deformation modifier to apply effects such as twisting and bending");
02309     RNA_def_struct_sdna(srna, "SimpleDeformModifierData");
02310     RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLEDEFORM);
02311 
02312     prop= RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
02313     RNA_def_property_enum_sdna(prop, NULL, "mode");
02314     RNA_def_property_enum_items(prop, simple_deform_mode_items);
02315     RNA_def_property_ui_text(prop, "Mode", "");
02316     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02317 
02318     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
02319     RNA_def_property_string_sdna(prop, NULL, "vgroup_name");
02320     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
02321     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SimpleDeformModifier_vgroup_set");
02322     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02323 
02324     prop= RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE);
02325     RNA_def_property_ui_text(prop, "Origin", "Origin of modifier space coordinates");
02326     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
02327     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02328 
02329     prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
02330     RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL);
02331     RNA_def_property_ui_text(prop, "Relative", "Set the origin of deform space to be relative to the object");
02332     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02333 
02334     prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
02335     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
02336     RNA_def_property_ui_range(prop, -10, 10, 1, 3);
02337     RNA_def_property_ui_text(prop, "Factor", "Amount to deform object");
02338     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02339 
02340     prop= RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE);
02341     RNA_def_property_float_sdna(prop, NULL, "limit");
02342     RNA_def_property_array(prop, 2);
02343     RNA_def_property_range(prop, 0, 1);
02344     RNA_def_property_ui_range(prop, 0, 1, 5, 2);
02345     RNA_def_property_ui_text(prop, "Limits", "Lower/Upper limits for deform");
02346     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02347 
02348     prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
02349     RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X);
02350     RNA_def_property_ui_text(prop, "Lock X Axis", "Do not allow tapering along the X axis");
02351     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02352 
02353     prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
02354     RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y);
02355     RNA_def_property_ui_text(prop, "Lock Y Axis", "Do not allow tapering along the Y axis");
02356     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02357 }
02358 
02359 static void rna_def_modifier_surface(BlenderRNA *brna)
02360 {
02361     StructRNA *srna;
02362 
02363     srna= RNA_def_struct(brna, "SurfaceModifier", "Modifier");
02364     RNA_def_struct_ui_text(srna, "Surface Modifier", "Surface modifier defining modifier stack position used for surface fields");
02365     RNA_def_struct_sdna(srna, "SurfaceModifierData");
02366     RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
02367 }
02368 
02369 static void rna_def_modifier_solidify(BlenderRNA *brna)
02370 {
02371     StructRNA *srna;
02372     PropertyRNA *prop;
02373 
02374     srna= RNA_def_struct(brna, "SolidifyModifier", "Modifier");
02375     RNA_def_struct_ui_text(srna, "Solidify Modifier", "Create a solid skin by extruding, compensating for sharp angles");
02376     RNA_def_struct_sdna(srna, "SolidifyModifierData");
02377     RNA_def_struct_ui_icon(srna, ICON_MOD_SOLIDIFY);
02378 
02379     prop= RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_DISTANCE);
02380     RNA_def_property_float_sdna(prop, NULL, "offset");
02381     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
02382     RNA_def_property_ui_range(prop, -10, 10, 0.1, 4);
02383     RNA_def_property_ui_text(prop, "Thickness", "Thickness of the shell");
02384     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02385 
02386     prop= RNA_def_property(srna, "thickness_vertex_group", PROP_FLOAT, PROP_FACTOR);
02387     RNA_def_property_float_sdna(prop, NULL, "offset_fac_vg");
02388     RNA_def_property_range(prop, 0.0, 1.0);
02389     RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
02390     RNA_def_property_ui_text(prop, "Vertex Group Factor", "Thickness factor to use for zero vertex group influence");
02391     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02392 
02393     prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
02394     RNA_def_property_float_sdna(prop, NULL, "offset_fac");
02395     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
02396     RNA_def_property_ui_range(prop, -1, 1, 0.1, 4);
02397     RNA_def_property_ui_text(prop, "Offset", "Offset the thickness from the center");
02398     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02399 
02400     prop= RNA_def_property(srna, "edge_crease_inner", PROP_FLOAT, PROP_FACTOR);
02401     RNA_def_property_float_sdna(prop, NULL, "crease_inner");
02402     RNA_def_property_range(prop, 0, 1);
02403     RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
02404     RNA_def_property_ui_text(prop, "Inner Crease", "Assign a crease to inner edges");
02405     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02406 
02407     prop= RNA_def_property(srna, "edge_crease_outer", PROP_FLOAT, PROP_FACTOR);
02408     RNA_def_property_float_sdna(prop, NULL, "crease_outer");
02409     RNA_def_property_range(prop, 0, 1);
02410     RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
02411     RNA_def_property_ui_text(prop, "Outer Crease", "Assign a crease to outer edges");
02412     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02413 
02414     prop= RNA_def_property(srna, "edge_crease_rim", PROP_FLOAT, PROP_FACTOR);
02415     RNA_def_property_float_sdna(prop, NULL, "crease_rim");
02416     RNA_def_property_range(prop, 0, 1);
02417     RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
02418     RNA_def_property_ui_text(prop, "Rim Crease", "Assign a crease to the edges making up the rim");
02419     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02420 
02421     prop= RNA_def_property(srna, "material_offset", PROP_INT, PROP_NONE);
02422     RNA_def_property_int_sdna(prop, NULL, "mat_ofs");
02423     RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
02424     RNA_def_property_ui_text(prop, "Material Offset", "Offset material index of generated faces");
02425     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02426 
02427     prop= RNA_def_property(srna, "material_offset_rim", PROP_INT, PROP_NONE);
02428     RNA_def_property_int_sdna(prop, NULL, "mat_ofs_rim");
02429     RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
02430     RNA_def_property_ui_text(prop, "Rim Material Offset", "Offset material index of generated rim faces");
02431     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02432 
02433     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
02434     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
02435     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
02436     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SolidifyModifier_vgroup_set");
02437     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02438 
02439     prop= RNA_def_property(srna, "use_rim", PROP_BOOLEAN, PROP_NONE);
02440     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_RIM);
02441     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)");
02442     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02443 
02444     prop= RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
02445     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_EVEN);
02446     RNA_def_property_ui_text(prop, "Even Thickness", "Maintain thickness by adjusting for sharp corners (slow, disable when not needed)");
02447     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02448 
02449     prop= RNA_def_property(srna, "use_quality_normals", PROP_BOOLEAN, PROP_NONE);
02450     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_NORMAL_CALC);
02451     RNA_def_property_ui_text(prop, "High Quality Normals", "Calculate normals which result in more even thickness (slow, disable when not needed)");
02452     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02453 
02454     prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
02455     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_VGROUP_INV);
02456     RNA_def_property_ui_text(prop, "Vertex Group Invert", "Invert the vertex group influence");
02457     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02458     
02459     
02460 }
02461 
02462 static void rna_def_modifier_screw(BlenderRNA *brna)
02463 {
02464     static EnumPropertyItem axis_items[]= {
02465         {0, "X", 0, "X Axis", ""},
02466         {1, "Y", 0, "Y Axis", ""},
02467         {2, "Z", 0, "Z Axis", ""},
02468         {0, NULL, 0, NULL, NULL}};
02469 
02470     StructRNA *srna;
02471     PropertyRNA *prop;
02472 
02473     srna= RNA_def_struct(brna, "ScrewModifier", "Modifier");
02474     RNA_def_struct_ui_text(srna, "Screw Modifier", "Revolve edges");
02475     RNA_def_struct_sdna(srna, "ScrewModifierData");
02476     RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW);
02477 
02478     prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
02479     RNA_def_property_pointer_sdna(prop, NULL, "ob_axis");
02480     RNA_def_property_ui_text(prop, "Object", "Object to define the screw axis");
02481     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
02482     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02483 
02484     prop= RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED);
02485     RNA_def_property_range(prop, 2, 10000);
02486     RNA_def_property_ui_range(prop, 3, 512, 1, 0);
02487     RNA_def_property_ui_text(prop, "Steps", "Number of steps in the revolution");
02488     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02489 
02490     prop= RNA_def_property(srna, "render_steps", PROP_INT, PROP_UNSIGNED);
02491     RNA_def_property_range(prop, 2, 10000);
02492     RNA_def_property_ui_range(prop, 2, 512, 1, 0);
02493     RNA_def_property_ui_text(prop, "Render Steps", "Number of steps in the revolution");
02494     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02495 
02496     prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
02497     RNA_def_property_int_sdna(prop, NULL, "iter");
02498     RNA_def_property_range(prop, 1, 10000);
02499     RNA_def_property_ui_range(prop, 1, 100, 1, 0);
02500     RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply the screw operation");
02501     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02502 
02503     prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
02504     RNA_def_property_enum_items(prop, axis_items);
02505     RNA_def_property_ui_text(prop, "Axis", "Screw axis");
02506     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02507 
02508     prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
02509     RNA_def_property_ui_range(prop, 0, -M_PI*2, M_PI*2, 2);
02510     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
02511     RNA_def_property_ui_text(prop, "Angle", "Angle of revolution");
02512     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02513 
02514     prop= RNA_def_property(srna, "screw_offset", PROP_FLOAT, PROP_DISTANCE);
02515     RNA_def_property_float_sdna(prop, NULL, "screw_ofs");
02516     RNA_def_property_ui_text(prop, "Screw", "Offset the revolution along its axis");
02517     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02518 
02519     prop= RNA_def_property(srna, "use_normal_flip", PROP_BOOLEAN, PROP_NONE);
02520     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_FLIP);
02521     RNA_def_property_ui_text(prop, "Flip", "Flip normals of lathed faces");
02522     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02523 
02524     prop= RNA_def_property(srna, "use_normal_calculate", PROP_BOOLEAN, PROP_NONE);
02525     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_CALC);
02526     RNA_def_property_ui_text(prop, "Calc Order", "Calculate the order of edges (needed for meshes, but not curves)");
02527     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02528 
02529     prop= RNA_def_property(srna, "use_object_screw_offset", PROP_BOOLEAN, PROP_NONE);
02530     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_OFFSET);
02531     RNA_def_property_ui_text(prop, "Object Screw", "Use the distance between the objects to make a screw");
02532     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02533 
02534     /*prop= RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE);
02535     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_ANGLE);
02536     RNA_def_property_ui_text(prop, "Object Angle", "Use the angle between the objects rather than the fixed angle");
02537     RNA_def_property_update(prop, 0, "rna_Modifier_update");*/
02538 }
02539 
02540 static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna)
02541 {
02542     static EnumPropertyItem weightvg_mask_tex_map_items[] = {
02543         {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", "Use local generated coordinates"},
02544         {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use global coordinates"},
02545         {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Use local generated coordinates of another object"},
02546         {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use coordinates from an UV layer"},
02547         {0, NULL, 0, NULL, NULL}};
02548 
02549     static EnumPropertyItem weightvg_mask_tex_used_items[] = {
02550         {MOD_WVG_MASK_TEX_USE_INT, "INT", 0, "Intensity", ""},
02551         {MOD_WVG_MASK_TEX_USE_RED, "RED", 0, "Red", ""},
02552         {MOD_WVG_MASK_TEX_USE_GREEN, "GREEN", 0, "Green", ""},
02553         {MOD_WVG_MASK_TEX_USE_BLUE, "BLUE", 0, "Blue", ""},
02554         {MOD_WVG_MASK_TEX_USE_HUE, "HUE", 0, "Hue", ""},
02555         {MOD_WVG_MASK_TEX_USE_SAT, "SAT", 0, "Saturation", ""},
02556         {MOD_WVG_MASK_TEX_USE_VAL, "VAL", 0, "Value", ""},
02557         {MOD_WVG_MASK_TEX_USE_ALPHA, "ALPHA", 0, "Alpha", ""},
02558         {0, NULL, 0, NULL, NULL}};
02559 
02560     PropertyRNA *prop;
02561 
02562     prop= RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_NONE);
02563     RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
02564     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
02565     RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup");
02566     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02567 
02568     prop= RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE);
02569     RNA_def_property_string_sdna(prop, NULL, "mask_defgrp_name");
02570     RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name");
02571     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_vgroup_set");
02572     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02573 
02574     prop= RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
02575     RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture");
02576     RNA_def_property_flag(prop, PROP_EDITABLE);
02577     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02578 
02579     prop= RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE);
02580     RNA_def_property_enum_items(prop, weightvg_mask_tex_used_items);
02581     RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking");
02582     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02583 
02584     prop= RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE);
02585     RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items);
02586     RNA_def_property_ui_text(prop, "Texture Coordinates", "Which texture coordinates "
02587                                                           "to use for mapping");
02588     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02589 
02590     prop= RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE);
02591     RNA_def_property_string_sdna(prop, NULL, "mask_tex_uvlayer_name");
02592     RNA_def_property_ui_text(prop, "UV Map", "UV map name");
02593     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_uvlayer_set");
02594     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02595 
02596     prop= RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE);
02597     RNA_def_property_pointer_sdna(prop, NULL, "mask_tex_map_obj");
02598     RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Which object to take texture "
02599                                                                 "coordinates from");
02600     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
02601     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02602 }
02603 
02604 static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
02605 {
02606     static EnumPropertyItem weightvg_edit_falloff_type_items[] = {
02607         {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", "Null action"},
02608         {MOD_WVG_MAPPING_CURVE, "CURVE", ICON_RNDCURVE, "Custom Curve", ""},
02609         {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
02610         {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
02611         {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
02612         {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""},
02613         {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
02614         {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE /* Would need a better icon... */, "Median Step",
02615                                "Map all values below 0.5 to 0.0, and all others to 1.0"},
02616         {0, NULL, 0, NULL, NULL}};
02617 
02618     StructRNA *srna;
02619     PropertyRNA *prop;
02620 
02621     srna= RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier");
02622     RNA_def_struct_ui_text(srna, "WeightVG Edit Modifier",
02623                            "Edit the weights of vertices in a group");
02624     RNA_def_struct_sdna(srna, "WeightVGEditModifierData");
02625     RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
02626 
02627     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
02628     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
02629     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
02630     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
02631     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02632 
02633     prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
02634     RNA_def_property_enum_items(prop, weightvg_edit_falloff_type_items);
02635     RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values");
02636     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02637 
02638     prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
02639     RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG);
02640     RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold "
02641                                                 "to vgroup");
02642     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02643 
02644     prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
02645     RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG);
02646     RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold "
02647                                                    "from vgroup");
02648     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02649 
02650     prop= RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE);
02651     RNA_def_property_range(prop, 0.0, 1.0f);
02652     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
02653     RNA_def_property_ui_text(prop, "Default Weight", "Default weight a vertex will have if "
02654                                                      "it is not in the vgroup");
02655     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02656 
02657     prop= RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
02658     RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve");
02659     RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve");
02660     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02661 
02662     prop= RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE);
02663     RNA_def_property_float_sdna(prop, NULL, "add_threshold");
02664     RNA_def_property_range(prop, 0.0, 1.0);
02665     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
02666     RNA_def_property_ui_text(prop, "Add Threshold", "Lower bound for a vertex's weight "
02667                                                     "to be added to the vgroup");
02668     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02669 
02670     prop= RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE);
02671     RNA_def_property_float_sdna(prop, NULL, "rem_threshold");
02672     RNA_def_property_range(prop, 0.0, 1.0);
02673     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
02674     RNA_def_property_ui_text(prop, "Rem Threshold", "Upper bound for a vertex's weight "
02675                                                     "to be removed from the vgroup");
02676     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02677 
02678     /* Common masking properties. */
02679     rna_def_modifier_weightvg_mask(brna, srna);
02680 }
02681 
02682 static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
02683 {
02684     static EnumPropertyItem weightvg_mix_modes_items[] = {
02685         {MOD_WVG_MIX_SET, "SET", 0, "Replace", "Replace VGroup A's weights by VGroup B's ones"},
02686         {MOD_WVG_MIX_ADD, "ADD", 0, "Add", "Add VGroup B's weights to VGroup A's ones"},
02687         {MOD_WVG_MIX_SUB, "SUB", 0, "Subtract", "Subtract VGroup B's weights from VGroup A's ones"},
02688         {MOD_WVG_MIX_MUL, "MUL", 0, "Multiply", "Multiply VGroup A's weights by VGroup B's ones"},
02689         {MOD_WVG_MIX_DIV, "DIV", 0, "Divide", "Divide VGroup A's weights by VGroup B's ones"},
02690         {MOD_WVG_MIX_DIF, "DIF", 0, "Difference", "Difference between VGroup A's and VGroup B's weigths"},
02691         {MOD_WVG_MIX_AVG, "AVG", 0, "Average", "Average value of VGroup A's and VGroup B's weigths"},
02692         {0, NULL, 0, NULL, NULL}};
02693 
02694     static EnumPropertyItem weightvg_mix_set_items[] = {
02695         {MOD_WVG_SET_ALL,   "ALL",   0, "All", "Affect all vertices (might add some to VGroup A)"},
02696         {MOD_WVG_SET_A,     "A",   0, "VGroup A", "Affect vertices in VGroup A"},
02697         {MOD_WVG_SET_B,     "B",   0, "VGroup B", "Affect vertices in VGroup B (might add some to VGroup A)"},
02698         {MOD_WVG_SET_OR,    "OR", 0, "VGroup A or B", "Affect vertices in at least one of both VGroups (might add some to VGroup A)"},
02699         {MOD_WVG_SET_AND,   "AND", 0, "VGroup A and B", "Affect vertices in both groups"},
02700         {0, NULL, 0, NULL, NULL}};
02701 
02702     StructRNA *srna;
02703     PropertyRNA *prop;
02704 
02705     srna= RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier");
02706     RNA_def_struct_ui_text(srna, "WeightVG Mix Modifier",
02707                            "Mix the weights of two vertex groups");
02708     RNA_def_struct_sdna(srna, "WeightVGMixModifierData");
02709     RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
02710 
02711     prop= RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE);
02712     RNA_def_property_string_sdna(prop, NULL, "defgrp_name_a");
02713     RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name");
02714     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
02715     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02716 
02717     prop= RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE);
02718     RNA_def_property_string_sdna(prop, NULL, "defgrp_name_b");
02719     RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name");
02720     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGMixModifier_vgroup2_set");
02721     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02722 
02723     prop= RNA_def_property(srna, "default_weight_a", PROP_FLOAT, PROP_NONE);
02724     RNA_def_property_range(prop, 0.0, 1.0f);
02725     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
02726     RNA_def_property_ui_text(prop, "Default Weight A", "Default weight a vertex will have if "
02727                                                        "it is not in the first A vgroup");
02728     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02729 
02730     prop= RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE);
02731     RNA_def_property_range(prop, 0.0, 1.0f);
02732     RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
02733     RNA_def_property_ui_text(prop, "Default Weight B", "Default weight a vertex will have if "
02734                                                        "it is not in the second B vgroup");
02735     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02736 
02737     prop= RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
02738     RNA_def_property_enum_items(prop, weightvg_mix_modes_items);
02739     RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup B affect weights "
02740                                                "of vgroup A");
02741     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02742 
02743     prop= RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE);
02744     RNA_def_property_enum_items(prop, weightvg_mix_set_items);
02745     RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected");
02746     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02747 
02748     /* Common masking properties. */
02749     rna_def_modifier_weightvg_mask(brna, srna);
02750 }
02751 
02752 static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
02753 {
02754     static EnumPropertyItem weightvg_proximity_modes_items[] = {
02755         {MOD_WVG_PROXIMITY_OBJECT, "OBJECT", 0, "Object Distance",
02756                                    "Use distance between affected and target objects"},
02757         {MOD_WVG_PROXIMITY_GEOMETRY, "GEOMETRY", 0, "Geometry Distance",
02758                                      "Use distance between affected object's vertices and target "
02759                                      "object, or target object's geometry"},
02760         {0, NULL, 0, NULL, NULL}};
02761 
02762     static EnumPropertyItem proximity_geometry_items[] = {
02763         {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex"},
02764         {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge"},
02765         {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face"},
02766         {0, NULL, 0, NULL, NULL}};
02767 
02768     static EnumPropertyItem weightvg_proximity_falloff_type_items[] = {
02769         {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", "Null action"},
02770         /* No curve mapping here! */
02771         {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
02772         {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
02773         {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
02774         {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""},
02775         {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
02776         {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE /* Would need a better icon... */, "Median Step",
02777                                "Map all values below 0.5 to 0.0, and all others to 1.0"},
02778         {0, NULL, 0, NULL, NULL}};
02779 
02780     StructRNA *srna;
02781     PropertyRNA *prop;
02782 
02783     srna= RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier");
02784     RNA_def_struct_ui_text(srna, "WeightVG Proximity Modifier",
02785                            "Set the weights of vertices in a group from a target object's "
02786                            "distance");
02787     RNA_def_struct_sdna(srna, "WeightVGProximityModifierData");
02788     RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
02789 
02790     prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
02791     RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
02792     RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
02793     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
02794     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02795 
02796     prop= RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE);
02797     RNA_def_property_enum_items(prop, weightvg_proximity_modes_items);
02798     RNA_def_property_enum_default(prop, MOD_WVG_PROXIMITY_GEOMETRY);
02799     RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use");
02800     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02801 
02802     prop= RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE);
02803     RNA_def_property_enum_sdna(prop, NULL, "proximity_flags");
02804     RNA_def_property_enum_items(prop, proximity_geometry_items);
02805     RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */
02806     RNA_def_property_enum_default(prop, MOD_WVG_PROXIMITY_GEOM_FACES);
02807     RNA_def_property_ui_text(prop, "Proximity Geometry",
02808                              "Use the shortest computed distance to target object's geometry "
02809                              "as weight");
02810     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02811 
02812     prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
02813     RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target");
02814     RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from");
02815     RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
02816     RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
02817 
02818     prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_DISTANCE);
02819     RNA_def_property_range(prop, 0.0, FLT_MAX);
02820     RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
02821     RNA_def_property_ui_text(prop, "Lowest Dist", "Distance mapping to weight 0.0");
02822     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02823 
02824     prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_DISTANCE);
02825     RNA_def_property_range(prop, 0.0, FLT_MAX);
02826     RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
02827     RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0");
02828     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02829 
02830     prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
02831     RNA_def_property_enum_items(prop, weightvg_proximity_falloff_type_items);
02832     RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values");
02833     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02834 
02835     /* Common masking properties. */
02836     rna_def_modifier_weightvg_mask(brna, srna);
02837 }
02838 
02839 static void rna_def_modifier_remesh(BlenderRNA *brna)
02840 {
02841     static EnumPropertyItem mode_items[]= {
02842         {MOD_REMESH_CENTROID, "BLOCKS", 0, "Blocks", "Output a blocky surface with no smoothing"},
02843         {MOD_REMESH_MASS_POINT, "SMOOTH", 0, "Smooth", "Output a smooth surface with no sharp-features detection"},
02844         {MOD_REMESH_SHARP_FEATURES, "SHARP", 0, "Sharp", "Output a surface that reproduces sharp edges and corners from the input mesh"},
02845         {0, NULL, 0, NULL, NULL}};
02846 
02847     StructRNA *srna;
02848     PropertyRNA *prop;
02849 
02850     srna= RNA_def_struct(brna, "RemeshModifier", "Modifier");
02851     RNA_def_struct_ui_text(srna, "Remesh Modifier", "Generate a new surface with regular topology that follows the shape of the input mesh");
02852     RNA_def_struct_sdna(srna, "RemeshModifierData");
02853     RNA_def_struct_ui_icon(srna, ICON_MOD_REMESH);
02854 
02855     prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
02856     RNA_def_property_enum_items(prop, mode_items);
02857     RNA_def_property_ui_text(prop, "Mode", "");
02858     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02859 
02860     prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
02861     RNA_def_property_ui_range(prop, 0, 0.99, 0.01, 3);
02862     RNA_def_property_range(prop, 0, 0.99);
02863     RNA_def_property_ui_text(prop, "Scale", "The ratio of the largest dimension of the model over the size of the grid");
02864     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02865 
02866     prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
02867     RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
02868     RNA_def_property_range(prop, 0, 1);
02869     RNA_def_property_ui_text(prop, "Threshold", "If removing disconnected pieces, minimum size of components to preserve as a ratio of the number of polygons in the largest component");
02870     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02871 
02872     prop= RNA_def_property(srna, "octree_depth", PROP_INT, PROP_NONE);
02873     RNA_def_property_int_sdna(prop, NULL, "depth");
02874     RNA_def_property_range(prop, 1, 10);
02875     RNA_def_property_ui_text(prop, "Octree Depth", "Resolution of the octree; higher values give finer details");
02876     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02877 
02878     prop= RNA_def_property(srna, "sharpness", PROP_FLOAT, PROP_NONE);
02879     RNA_def_property_float_sdna(prop, NULL, "hermite_num");
02880     RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
02881     RNA_def_property_ui_text(prop, "Sharpness", "Tolerance for outliers; lower values filter noise while higher values will reproduce edges closer to the input");
02882     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02883 
02884     prop= RNA_def_property(srna, "remove_disconnected_pieces", PROP_BOOLEAN, PROP_NONE);
02885     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_REMESH_FLOOD_FILL);
02886     RNA_def_property_ui_text(prop, "Remove Disconnected Pieces", "");
02887     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02888 }
02889 
02890 static void rna_def_modifier_ocean(BlenderRNA *brna)
02891 {
02892     StructRNA *srna;
02893     PropertyRNA *prop;
02894     
02895     static EnumPropertyItem geometry_items[]= {
02896         {MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generate ocean surface geometry at the specified resolution"},
02897         {MOD_OCEAN_GEOM_DISPLACE, "DISPLACE", 0, "Displace", "Displace existing geometry according to simulation"},
02898         //{MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only", "Leaves geometry unchanged, but still runs simulation (to be used from texture)"},
02899         {0, NULL, 0, NULL, NULL}};
02900     
02901     srna= RNA_def_struct(brna, "OceanModifier", "Modifier");
02902     RNA_def_struct_ui_text(srna, "Ocean Modifier", "Simulate an ocean surface");
02903     RNA_def_struct_sdna(srna, "OceanModifierData");
02904     RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM);
02905     
02906     /* General check if blender was built with OceanSim modifier support */
02907     prop= RNA_def_property(srna, "is_build_enabled", PROP_BOOLEAN, PROP_NONE);
02908     RNA_def_property_boolean_funcs(prop, "rna_OceanModifier_is_build_enabled_get", NULL);
02909     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02910     RNA_def_property_ui_text(prop, "Build Enabled", "True if the OceanSim modifier is enabled in this build");
02911     
02912     prop= RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE);
02913     RNA_def_property_enum_sdna(prop, NULL, "geometry_mode");
02914     RNA_def_property_enum_items(prop, geometry_items);
02915     RNA_def_property_ui_text(prop, "Geometry", "Method of modifying geometry");
02916     RNA_def_property_update(prop, 0, "rna_Modifier_update");
02917     
02918     prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_UNSIGNED);
02919     RNA_def_property_float_sdna(prop, NULL, "size");
02920     RNA_def_property_ui_text(prop, "Size", "");
02921     RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
02922     RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update");
02923     
02924     prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_UNSIGNED);
02925     RNA_def_property_int_sdna(prop, NULL, "repeat_x");
02926     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02927     RNA_def_property_range(prop, 1, 1024);
02928     RNA_def_property_ui_range(prop, 1, 100, 1, 0);
02929     RNA_def_property_ui_text(prop, "Repeat X", "Repetitions of the generated surface in X");
02930     RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update");
02931     
02932     prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_UNSIGNED);
02933     RNA_def_property_int_sdna(prop, NULL, "repeat_y");
02934     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02935     RNA_def_property_range(prop, 1, 1024);
02936     RNA_def_property_ui_range(prop, 1, 100, 1, 0);
02937     RNA_def_property_ui_text(prop, "Repeat Y", "Repetitions of the generated surface in Y");
02938     RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update");
02939 
02940     prop= RNA_def_property(srna, "use_normals", PROP_BOOLEAN, PROP_NONE);
02941     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_NORMALS);
02942     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02943     RNA_def_property_ui_text(prop, "Generate Normals", "Output normals for bump mapping - disabling can speed up performance if its not needed");
02944     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02945     
02946     prop= RNA_def_property(srna, "use_foam", PROP_BOOLEAN, PROP_NONE);
02947     RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_FOAM);
02948     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02949     RNA_def_property_ui_text(prop, "Generate Foam", "Generate foam mask as a vertex color channel");
02950     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02951     
02952     prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
02953     RNA_def_property_int_sdna(prop, NULL, "resolution");
02954     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02955     RNA_def_property_range(prop, 1, 1024);
02956     RNA_def_property_ui_range(prop, 1, 32, 1, 0);
02957     RNA_def_property_ui_text(prop, "Resolution", "Resolution of the generated surface");
02958     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02959     
02960     prop= RNA_def_property(srna, "spatial_size", PROP_INT, PROP_DISTANCE);
02961     RNA_def_property_int_sdna(prop, NULL, "spatial_size");
02962     RNA_def_property_ui_range(prop, 1, 512, 2, 0);
02963     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02964     RNA_def_property_ui_text(prop, "Spatial Size", "Physical size of the simulation domain (m)");
02965     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02966     
02967     prop= RNA_def_property(srna, "wind_velocity", PROP_FLOAT, PROP_VELOCITY);
02968     RNA_def_property_float_sdna(prop, NULL, "wind_velocity");
02969     RNA_def_property_ui_text(prop, "Wind Velocity", "Wind speed (m/s)");
02970     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02971     
02972     prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_FACTOR);
02973     RNA_def_property_float_sdna(prop, NULL, "damp");
02974     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02975     RNA_def_property_ui_text(prop, "Damping", "Damp reflected waves going in opposite direction to the wind");
02976     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02977     
02978     prop= RNA_def_property(srna, "wave_scale_min", PROP_FLOAT, PROP_DISTANCE);
02979     RNA_def_property_float_sdna(prop, NULL, "smallest_wave");
02980     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02981     RNA_def_property_range(prop, 0.0, FLT_MAX);
02982     RNA_def_property_ui_text(prop, "Smallest Wave", "Shortest allowed wavelength (m)");
02983     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02984     
02985     prop= RNA_def_property(srna, "wave_alignment", PROP_FLOAT, PROP_UNSIGNED);
02986     RNA_def_property_float_sdna(prop, NULL, "wave_alignment");
02987     RNA_def_property_range(prop, 0.0, 10.0);
02988     RNA_def_property_ui_text(prop, "Wave Alignment", "");
02989     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02990     
02991     prop= RNA_def_property(srna, "wave_direction", PROP_FLOAT, PROP_ANGLE);
02992     RNA_def_property_float_sdna(prop, NULL, "wave_direction");
02993     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
02994     RNA_def_property_ui_text(prop, "Wave Direction", "");
02995     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
02996     
02997     prop= RNA_def_property(srna, "wave_scale", PROP_FLOAT, PROP_UNSIGNED);
02998     RNA_def_property_float_sdna(prop, NULL, "wave_scale");
02999     RNA_def_property_ui_text(prop, "Wave Scale", "");
03000     RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update");
03001     
03002     prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_UNSIGNED);
03003     RNA_def_property_float_sdna(prop, NULL, "depth");
03004     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03005     RNA_def_property_ui_text(prop, "Depth", "");
03006     RNA_def_property_ui_range(prop, 0, 250, 1, 0);
03007     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
03008     
03009     prop= RNA_def_property(srna, "foam_coverage", PROP_FLOAT, PROP_NONE);
03010     RNA_def_property_float_sdna(prop, NULL, "foam_coverage");
03011     RNA_def_property_ui_text(prop, "Foam Coverage", "");
03012     RNA_def_property_update(prop, 0, "rna_Modifier_update");
03013     
03014     prop= RNA_def_property(srna, "bake_foam_fade", PROP_FLOAT, PROP_UNSIGNED);
03015     RNA_def_property_float_sdna(prop, NULL, "foam_fade");
03016     RNA_def_property_ui_text(prop, "Foam Fade", "");
03017     RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
03018     RNA_def_property_update(prop, 0, NULL);
03019     
03020     prop= RNA_def_property(srna, "foam_layer_name", PROP_STRING, PROP_NONE);
03021     RNA_def_property_string_sdna(prop, NULL, "foamlayername");
03022     RNA_def_property_ui_text(prop, "Foam Layer Name", "Name of the vertex color layer used for foam");
03023     RNA_def_property_update(prop, 0, "rna_Modifier_update");
03024     
03025     prop= RNA_def_property(srna, "choppiness", PROP_FLOAT, PROP_UNSIGNED);
03026     RNA_def_property_float_sdna(prop, NULL, "chop_amount");
03027     RNA_def_property_ui_text(prop, "Choppiness", "");
03028     RNA_def_property_ui_range(prop, 0.0, 4.0, 3, 0);
03029     RNA_def_property_float_funcs(prop, NULL, "rna_OceanModifier_ocean_chop_set", NULL);
03030     RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update");
03031     
03032     prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
03033     RNA_def_property_float_sdna(prop, NULL, "time");
03034     RNA_def_property_ui_text(prop, "Time", "");
03035     RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
03036     RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update");
03037     
03038     prop= RNA_def_property(srna, "random_seed", PROP_INT, PROP_UNSIGNED);
03039     RNA_def_property_int_sdna(prop, NULL, "seed");
03040     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03041     RNA_def_property_ui_text(prop, "Random Seed", "");
03042     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
03043     
03044     prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_UNSIGNED);
03045     RNA_def_property_int_sdna(prop, NULL, "bakestart");
03046     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03047     RNA_def_property_ui_text(prop, "Bake Start", "");
03048     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
03049     
03050     prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_UNSIGNED);
03051     RNA_def_property_int_sdna(prop, NULL, "bakeend");
03052     RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
03053     RNA_def_property_ui_text(prop, "Bake End", "");
03054     RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
03055     
03056     prop= RNA_def_property(srna, "is_cached", PROP_BOOLEAN, PROP_NONE);
03057     RNA_def_property_boolean_sdna(prop, NULL, "cached", 1);
03058     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
03059     RNA_def_property_ui_text(prop, "Ocean is Cached", "Whether the ocean is using cached data or simulating");
03060 
03061     prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
03062     RNA_def_property_string_sdna(prop, NULL, "cachepath");
03063     RNA_def_property_ui_text(prop, "Cache Path", "Path to a folder to store external baked images");
03064     //RNA_def_property_update(prop, 0, "rna_Modifier_update");
03065     // XXX how to update?
03066 }
03067 
03068 
03069 void RNA_def_modifier(BlenderRNA *brna)
03070 {
03071     StructRNA *srna;
03072     PropertyRNA *prop;
03073     
03074     /* data */
03075     srna= RNA_def_struct(brna, "Modifier", NULL);
03076     RNA_def_struct_ui_text(srna , "Modifier", "Modifier affecting the geometry data of an object");
03077     RNA_def_struct_refine_func(srna, "rna_Modifier_refine");
03078     RNA_def_struct_path_func(srna, "rna_Modifier_path");
03079     RNA_def_struct_sdna(srna, "ModifierData");
03080     
03081     /* strings */
03082     prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
03083     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Modifier_name_set");
03084     RNA_def_property_ui_text(prop, "Name", "Modifier name");
03085     RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
03086     RNA_def_struct_name_property(srna, prop);
03087     
03088     /* enums */
03089     prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
03090     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
03091     RNA_def_property_enum_sdna(prop, NULL, "type");
03092     RNA_def_property_enum_items(prop, modifier_type_items);
03093     RNA_def_property_ui_text(prop, "Type", "");
03094     
03095     /* flags */
03096     prop= RNA_def_property(srna, "show_viewport", PROP_BOOLEAN, PROP_NONE);
03097     RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime);
03098     RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier");
03099     RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
03100     RNA_def_property_update(prop, 0, "rna_Modifier_update");
03101     RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
03102     
03103     prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
03104     RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
03105     RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering");
03106     RNA_def_property_ui_icon(prop, ICON_SCENE, 0);
03107     RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
03108     
03109     prop= RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
03110     RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode);
03111     RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode");
03112     RNA_def_property_update(prop, 0, "rna_Modifier_update");
03113     RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
03114     
03115     prop= RNA_def_property(srna, "show_on_cage", PROP_BOOLEAN, PROP_NONE);
03116     RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage);
03117     RNA_def_property_ui_text(prop, "On Cage", "Enable direct editing of modifier control cage");
03118     RNA_def_property_update(prop, 0, "rna_Modifier_update");
03119     
03120     prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
03121     RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
03122     RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
03123     RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
03124 
03125     prop= RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE);
03126     RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_ApplyOnSpline);
03127     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");
03128     RNA_def_property_ui_icon(prop, ICON_SURFACE_DATA, 0);
03129     RNA_def_property_update(prop, 0, "rna_Modifier_update");
03130 
03131     /* types */
03132     rna_def_modifier_subsurf(brna);
03133     rna_def_modifier_lattice(brna);
03134     rna_def_modifier_curve(brna);
03135     rna_def_modifier_build(brna);
03136     rna_def_modifier_mirror(brna);
03137     rna_def_modifier_decimate(brna);
03138     rna_def_modifier_wave(brna);
03139     rna_def_modifier_armature(brna);
03140     rna_def_modifier_hook(brna);
03141     rna_def_modifier_softbody(brna);
03142     rna_def_modifier_boolean(brna);
03143     rna_def_modifier_array(brna);
03144     rna_def_modifier_edgesplit(brna);
03145     rna_def_modifier_displace(brna);
03146     rna_def_modifier_uvproject(brna);
03147     rna_def_modifier_smooth(brna);
03148     rna_def_modifier_cast(brna);
03149     rna_def_modifier_meshdeform(brna);
03150     rna_def_modifier_particlesystem(brna);
03151     rna_def_modifier_particleinstance(brna);
03152     rna_def_modifier_explode(brna);
03153     rna_def_modifier_cloth(brna);
03154     rna_def_modifier_collision(brna);
03155     rna_def_modifier_bevel(brna);
03156     rna_def_modifier_shrinkwrap(brna);
03157     rna_def_modifier_fluidsim(brna);
03158     rna_def_modifier_mask(brna);
03159     rna_def_modifier_simpledeform(brna);
03160     rna_def_modifier_warp(brna);
03161     rna_def_modifier_multires(brna);
03162     rna_def_modifier_surface(brna);
03163     rna_def_modifier_smoke(brna);
03164     rna_def_modifier_solidify(brna);
03165     rna_def_modifier_screw(brna);
03166     rna_def_modifier_weightvgedit(brna);
03167     rna_def_modifier_weightvgmix(brna);
03168     rna_def_modifier_weightvgproximity(brna);
03169     rna_def_modifier_dynamic_paint(brna);
03170     rna_def_modifier_ocean(brna);
03171     rna_def_modifier_remesh(brna);
03172 }
03173 
03174 #endif