Cleanup: RNA naming

- Use abbreviations min/max
  this is used throughout the existing API.
- Rename use_adaptive_stepping to use_adaptive_timesteps
  since this is used with timesteps_min/max it's clearer
  to use matching terms.
This commit is contained in:
Campbell Barton 2019-12-17 14:45:14 +11:00
parent 8676491090
commit 2564e2a2ad
Notes: blender-bot 2023-02-14 04:20:36 +01:00
Referenced by commit 4b62d98984, Fluid: Fix python script after refactor
2 changed files with 15 additions and 11 deletions

View File

@ -161,11 +161,11 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel):
col.prop(domain, "cfl_condition", text="CFL Number")
col = flow.column()
col.prop(domain, "use_adaptive_stepping", text="Use Adaptive Stepping")
col.prop(domain, "use_adaptive_timesteps")
col1 = col.column(align=True)
col1.enabled = domain.use_adaptive_stepping
col1.prop(domain, "timesteps_maximum", text="Timesteps Maximum")
col1.prop(domain, "timesteps_minimum", text="Minimum")
col1.prop(domain, "timesteps_max", text="Timesteps Maximum")
col1.prop(domain, "timesteps_min", text="Minimum")
col.separator()
@ -438,8 +438,8 @@ class PHYSICS_PT_liquid(PhysicButtonsPanel, Panel):
col1 = flow.column(align=True)
col1.enabled = not is_baking_any and not has_baked_data
col1.prop(domain, "particle_maximum", text="Particles Maximum")
col1.prop(domain, "particle_minimum", text="Minimum")
col1.prop(domain, "particle_max", text="Particles Maximum")
col1.prop(domain, "particle_min", text="Minimum")
col1 = flow.column()
col1.enabled = not is_baking_any and not has_baked_data

View File

@ -1554,7 +1554,8 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop, "Number", "Particle number factor (higher value results in more particles)");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_resetCache");
prop = RNA_def_property(srna, "particle_minimum", PROP_INT, PROP_NONE);
prop = RNA_def_property(srna, "particle_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "particle_minimum");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop,
"Minimum",
@ -1562,7 +1563,8 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
"least this amount of particles)");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_resetCache");
prop = RNA_def_property(srna, "particle_maximum", PROP_INT, PROP_NONE);
prop = RNA_def_property(srna, "particle_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "particle_maximum");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop,
"Maximum",
@ -2094,19 +2096,21 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
prop, "CFL", "Maximal velocity per cell (higher value results in larger timesteps)");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_resetCache");
prop = RNA_def_property(srna, "use_adaptive_stepping", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_adaptive_timesteps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", FLUID_DOMAIN_USE_ADAPTIVE_TIME);
RNA_def_property_ui_text(prop, "Adaptive stepping", "Enable adaptive time-stepping");
RNA_def_property_ui_text(prop, "Use Adaptive Time Steps", "");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_resetCache");
prop = RNA_def_property(srna, "timesteps_minimum", PROP_INT, PROP_NONE);
prop = RNA_def_property(srna, "timesteps_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "timesteps_minimum");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_range(prop, 0, 100, 1, -1);
RNA_def_property_ui_text(
prop, "Minimum", "Minimum number of simulation steps to perform for one frame");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_reset");
prop = RNA_def_property(srna, "timesteps_maximum", PROP_INT, PROP_NONE);
prop = RNA_def_property(srna, "timesteps_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "timesteps_maximum");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_range(prop, 0, 100, 1, -1);
RNA_def_property_ui_text(