diff options
author | Thomas Dinges <blender@dingto.org> | 2009-06-04 02:19:04 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2009-06-04 02:19:04 +0400 |
commit | 34014df367d61bca0223eee25a9aa7b2c5a0e232 (patch) | |
tree | a6ea7e91c7e4811d36b166cda91819a40320f89b /source/blender/makesrna/intern/rna_object_force.c | |
parent | 7c3c9df2c07f739448e804d2ed9fc3d596f5022a (diff) |
2.5 RNA:
* Started wrapping object force.
* Added "absorption" property in Collision Modifier RNA.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 146 |
1 files changed, 144 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 22521528d68..3c68f8630ef 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Contributor(s): Blender Foundation (2008). + * Contributor(s): Blender Foundation (2008), Thomas Dinges * * ***** END GPL LICENSE BLOCK ***** */ @@ -39,27 +39,170 @@ static void rna_def_pointcache(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; srna= RNA_def_struct(brna, "PointCache", NULL); RNA_def_struct_ui_text(srna, "Point Cache", "Point cache for physics simulations."); + + prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "startframe"); + RNA_def_property_range(prop, 1, 300000); + RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts."); + + prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "endframe"); + RNA_def_property_range(prop, 1, 300000); + RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops."); } static void rna_def_collision(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; srna= RNA_def_struct(brna, "CollisionSettings", NULL); RNA_def_struct_sdna(srna, "PartDeflect"); RNA_def_struct_ui_text(srna, "Collision Settings", "Collision settings for object in physics simulation."); + + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "deflect", 1); + RNA_def_property_ui_text(prop, "Enabled", "Enable this objects as a collider for physics systems"); + + /* Particle Interaction */ + + prop= RNA_def_property(srna, "damping_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_damp"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Damping Factor", "Amount of damping during particle collision"); + + prop= RNA_def_property(srna, "random_damping", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_rdamp"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Random Damping", "Random variation of damping"); + + prop= RNA_def_property(srna, "friction_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_frict"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Friction Factor", "Amount of friction during particle collision"); + + prop= RNA_def_property(srna, "random_friction", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_rfrict"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Random Friction", "Random variation of friction"); + + prop= RNA_def_property(srna, "permeability", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_perm"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Permeability", "Chance that the particle will pass through the mesh"); + + prop= RNA_def_property(srna, "kill_particles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PDEFLE_KILL_PART); + RNA_def_property_ui_text(prop, "Kill Particles", "Kill collided particles"); + + /* Soft Body and Cloth Interaction */ + + prop= RNA_def_property(srna, "inner_thickness", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_sbift"); + RNA_def_property_range(prop, 0.001f, 1.0f); + RNA_def_property_ui_text(prop, "Inner Thickness", "Inner face thickness"); + + prop= RNA_def_property(srna, "outer_thickness", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_sboft"); + RNA_def_property_range(prop, 0.001f, 1.0f); + RNA_def_property_ui_text(prop, "Outer Thickness", "Outer face thickness"); + + prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pdef_sbdamp"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Damping", "Amount of damping during collision"); + + /* Does this belong here? + prop= RNA_def_property(srna, "collision_stack", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_COLLFINAL); + RNA_def_property_ui_text(prop, "Collision from Stack", "Pick collision object from modifier stack (softbody only)"); + */ } static void rna_def_field(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem field_type_items[] = { + {PFIELD_FORCE, "FORCE", "None", ""}, + {PFIELD_VORTEX, "VORTEX", "Vortex", ""}, + {PFIELD_MAGNET, "MAGNET", "Magnetic", ""}, + {PFIELD_WIND, "WIND", "Wind", ""}, + {PFIELD_GUIDE, "GUIDE", "Spherical", ""}, + {PFIELD_TEXTURE, "TEXTURE", "Texture", ""}, + {PFIELD_HARMONIC, "HARMONIC", "Harmonic", ""}, + {PFIELD_CHARGE, "CHARGE", "Charge", ""}, + {PFIELD_LENNARDJ, "LENNARDJ", "Lennard-Jones", ""}, + {0, NULL, NULL, NULL}}; + + static EnumPropertyItem falloff_items[] = { + {PFIELD_FALL_SPHERE, "SPHERE", "Sphere", ""}, + {PFIELD_FALL_TUBE, "TUBE", "Tube", ""}, + {PFIELD_FALL_CONE, "CONE", "Cone", ""}, + {0, NULL, NULL, NULL}}; srna= RNA_def_struct(brna, "FieldSettings", NULL); RNA_def_struct_sdna(srna, "PartDeflect"); RNA_def_struct_ui_text(srna, "Field Settings", "Field settings for an object in physics simulation."); + + /* Enums */ + + prop= RNA_def_property(srna, "field_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "forcefield"); + RNA_def_property_enum_items(prop, field_type_items); + RNA_def_property_ui_text(prop, "Field Type", "Choose Field Type"); + + prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "falloff"); + RNA_def_property_enum_items(prop, falloff_items); + RNA_def_property_ui_text(prop, "Fall-Off", "Fall-Off Shape"); + + /* Float */ + + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "f_strength"); + RNA_def_property_range(prop, -1000.0f, 1000.0f); + RNA_def_property_ui_text(prop, "Strength", "Strength of force field"); + + prop= RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "f_power"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)"); + + prop= RNA_def_property(srna, "harmonic_damping", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "f_damp"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Harmonic Damping", "Damping of the harmonic force"); + + prop= RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "mindist"); + RNA_def_property_range(prop, 0.0f, 1000.0f); + RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance for the field's fall-off"); + + prop= RNA_def_property(srna, "maximum_distance", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "maxdist"); + RNA_def_property_range(prop, 0.0f, 1000.0f); + RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for the field to work"); + + prop= RNA_def_property(srna, "radial_minimum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "minrad"); + RNA_def_property_range(prop, 0.0f, 1000.0f); + RNA_def_property_ui_text(prop, "Minimum Radial Distance", "Minimum radial distance for the field's fall-off"); + + prop= RNA_def_property(srna, "radial_maximum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "maxrad"); + RNA_def_property_range(prop, 0.0f, 1000.0f); + RNA_def_property_ui_text(prop, "Maximum Radial Distance", "Maximum radial distance for the field to work"); + + prop= RNA_def_property(srna, "radial_falloff", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "f_power_r"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Radial Falloff Power", "Radial falloff power (real gravitational falloff = 2)"); } static void rna_def_game_softbody(BlenderRNA *brna) @@ -90,4 +233,3 @@ void RNA_def_object_force(BlenderRNA *brna) } #endif - |