Fix T75210: Frame range does not go down to 0 in the physics tab for mantaflow when clicking the left arrow
Added nore flexibility to cache frame range and ensured validity of frame range.
This commit is contained in:
@@ -75,6 +75,9 @@ void BKE_fluid_particle_system_create(struct Main *bmain,
|
|||||||
const int psys_type);
|
const int psys_type);
|
||||||
void BKE_fluid_particle_system_destroy(struct Object *ob, const int particle_type);
|
void BKE_fluid_particle_system_destroy(struct Object *ob, const int particle_type);
|
||||||
|
|
||||||
|
void BKE_fluid_cache_startframe_set(struct FluidDomainSettings *settings, int value);
|
||||||
|
void BKE_fluid_cache_endframe_set(struct FluidDomainSettings *settings, int value);
|
||||||
|
|
||||||
void BKE_fluid_cachetype_mesh_set(struct FluidDomainSettings *settings, int cache_mesh_format);
|
void BKE_fluid_cachetype_mesh_set(struct FluidDomainSettings *settings, int cache_mesh_format);
|
||||||
void BKE_fluid_cachetype_data_set(struct FluidDomainSettings *settings, int cache_data_format);
|
void BKE_fluid_cachetype_data_set(struct FluidDomainSettings *settings, int cache_data_format);
|
||||||
void BKE_fluid_cachetype_particle_set(struct FluidDomainSettings *settings,
|
void BKE_fluid_cachetype_particle_set(struct FluidDomainSettings *settings,
|
||||||
|
@@ -4471,6 +4471,16 @@ void BKE_fluid_particle_system_destroy(struct Object *ob, const int particle_typ
|
|||||||
* Use for versioning, even when fluids are disabled.
|
* Use for versioning, even when fluids are disabled.
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
|
void BKE_fluid_cache_startframe_set(FluidDomainSettings *settings, int value)
|
||||||
|
{
|
||||||
|
settings->cache_frame_start = (value > settings->cache_frame_end) ? settings->cache_frame_end : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BKE_fluid_cache_endframe_set(FluidDomainSettings *settings, int value)
|
||||||
|
{
|
||||||
|
settings->cache_frame_end = (value < settings->cache_frame_start) ? settings->cache_frame_start : value;
|
||||||
|
}
|
||||||
|
|
||||||
void BKE_fluid_cachetype_mesh_set(FluidDomainSettings *settings, int cache_mesh_format)
|
void BKE_fluid_cachetype_mesh_set(FluidDomainSettings *settings, int cache_mesh_format)
|
||||||
{
|
{
|
||||||
if (cache_mesh_format == settings->cache_mesh_format) {
|
if (cache_mesh_format == settings->cache_mesh_format) {
|
||||||
|
@@ -391,6 +391,18 @@ static void rna_Fluid_combined_export_update(Main *bmain, Scene *scene, PointerR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rna_Fluid_cache_startframe_set(struct PointerRNA *ptr, int value)
|
||||||
|
{
|
||||||
|
FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data;
|
||||||
|
BKE_fluid_cache_startframe_set(settings, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rna_Fluid_cache_endframe_set(struct PointerRNA *ptr, int value)
|
||||||
|
{
|
||||||
|
FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data;
|
||||||
|
BKE_fluid_cache_endframe_set(settings, value);
|
||||||
|
}
|
||||||
|
|
||||||
static void rna_Fluid_cachetype_mesh_set(struct PointerRNA *ptr, int value)
|
static void rna_Fluid_cachetype_mesh_set(struct PointerRNA *ptr, int value)
|
||||||
{
|
{
|
||||||
FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data;
|
FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data;
|
||||||
@@ -1925,12 +1937,13 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
|
|||||||
prop = RNA_def_property(srna, "cache_frame_start", PROP_INT, PROP_TIME);
|
prop = RNA_def_property(srna, "cache_frame_start", PROP_INT, PROP_TIME);
|
||||||
RNA_def_property_int_sdna(prop, NULL, "cache_frame_start");
|
RNA_def_property_int_sdna(prop, NULL, "cache_frame_start");
|
||||||
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
|
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
|
||||||
RNA_def_property_ui_range(prop, 1, MAXFRAME, 1, 1);
|
RNA_def_property_int_funcs(prop, NULL, "rna_Fluid_cache_startframe_set", NULL);
|
||||||
RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts");
|
RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "cache_frame_end", PROP_INT, PROP_TIME);
|
prop = RNA_def_property(srna, "cache_frame_end", PROP_INT, PROP_TIME);
|
||||||
RNA_def_property_int_sdna(prop, NULL, "cache_frame_end");
|
RNA_def_property_int_sdna(prop, NULL, "cache_frame_end");
|
||||||
RNA_def_property_range(prop, 1, MAXFRAME);
|
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
|
||||||
|
RNA_def_property_int_funcs(prop, NULL, "rna_Fluid_cache_endframe_set", NULL);
|
||||||
RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops");
|
RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "cache_frame_pause_data", PROP_INT, PROP_TIME);
|
prop = RNA_def_property(srna, "cache_frame_pause_data", PROP_INT, PROP_TIME);
|
||||||
|
Reference in New Issue
Block a user