diff options
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_cloth.py | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 24 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_cloth_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_cloth.c | 17 |
4 files changed, 5 insertions, 43 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index f141c0b1b29..a5cbffb2e2c 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -92,9 +92,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): sub.prop_search(cloth, "vertex_group_mass", ob, "vertex_groups", text="") sub.prop(cloth, "pin_stiffness", text="Stiffness") - col.label(text="Pre roll:") - col.prop(cloth, "pre_roll", text="Frames") - # Disabled for now """ if cloth.vertex_group_mass: diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 14f94735957..317348903ff 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -88,7 +88,6 @@ void cloth_init(ClothModifierData *clmd ) clmd->sim_parms->stepsPerFrame = 5; clmd->sim_parms->flags = 0; clmd->sim_parms->solver_type = 0; - clmd->sim_parms->preroll = 0; clmd->sim_parms->maxspringlen = 10; clmd->sim_parms->vgroup_mass = 0; clmd->sim_parms->vgroup_shrink = 0; @@ -463,10 +462,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, ×cale); clmd->sim_parms->timescale= timescale; - if (clmd->sim_parms->reset || - (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0) || - (clmd->clothObject && dm->getNumVerts(dm) != clmd->clothObject->numverts)) - { + if (clmd->sim_parms->reset || (clmd->clothObject && dm->getNumVerts(dm) != clmd->clothObject->numverts)) { clmd->sim_parms->reset = 0; cache->flag |= PTCACHE_OUTDATED; BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); @@ -478,22 +474,6 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived // unused in the moment, calculated separately in implicit.c clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame; - /* handle continuous simulation with the play button */ - if ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe)) { - BKE_ptcache_invalidate(cache); - - /* do simulation */ - if (!do_init_cloth(ob, clmd, dm, framenr)) - return; - - do_step_cloth(ob, clmd, dm, framenr); - cloth_to_object(ob, clmd, vertexCos); - - clmd->clothObject->last_frame= framenr; - - return; - } - /* simulation is only active during a specific period */ if (framenr < startframe) { BKE_ptcache_invalidate(cache); @@ -507,7 +487,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived if (!do_init_cloth(ob, clmd, dm, framenr)) return; - if ((framenr == startframe) && (clmd->sim_parms->preroll == 0)) { + if (framenr == startframe) { BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); do_init_cloth(ob, clmd, dm, framenr); BKE_ptcache_validate(cache, framenr); diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h index 3144dadb680..07bc2478837 100644 --- a/source/blender/makesdna/DNA_cloth_types.h +++ b/source/blender/makesdna/DNA_cloth_types.h @@ -32,6 +32,8 @@ #ifndef __DNA_CLOTH_TYPES_H__ #define __DNA_CLOTH_TYPES_H__ +#include "DNA_defs.h" + /** * This struct contains all the global data required to run a simulation. * At the time of this writing, this structure contains data appropriate @@ -85,7 +87,7 @@ typedef struct ClothSimSettings { int stepsPerFrame; /* Number of time steps per frame. */ int flags; /* flags, see CSIMSETT_FLAGS enum above. */ - int preroll; /* How many frames of simulation to do before we start. */ + int preroll DNA_DEPRECATED; /* How many frames of simulation to do before we start. */ int maxspringlen; /* in percent!; if tearing enabled, a spring will get cut */ short solver_type; /* which solver should be used? txold */ short vgroup_bend; /* vertex group for scaling bending stiffness */ diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 991020a1574..bcb3544049c 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -68,17 +68,6 @@ static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene), WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } -static void rna_cloth_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) -{ - Object *ob = (Object *)ptr->id.data; - ClothSimSettings *settings = (ClothSimSettings *)ptr->data; - - settings->reset = 1; - - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); -} - static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value) { @@ -559,12 +548,6 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Weights", ""); - prop = RNA_def_property(srna, "pre_roll", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "preroll"); - RNA_def_property_range(prop, 0, MAXFRAME); - RNA_def_property_ui_text(prop, "Pre Roll", "Start simulation a number of frames earlier to let the cloth settle in"); - RNA_def_property_update(prop, 0, "rna_cloth_reset"); - prop = RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "ShapeKey"); |