diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 04:58:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 05:03:52 +0300 |
commit | 79e51d9e5fba95fc9569e75412b27b08bef7a7d5 (patch) | |
tree | 096ca14d1b3c4173ce8f927117ffbd5f4eae57f5 /source/blender/makesrna | |
parent | a977cb04455c4987711052f9abea04065c618427 (diff) |
Cleanup: replace verbose checks with read-only attributes
These attributes checked for any baked / baking
since this is a common test that was performed in layout code.
Also follow our naming convention - using an 'is_/has_' prefix
in this case since "cache_baked_data" reads as if it's used to access
the baked data.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_fluid.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index d879d5cc315..f3a691a5b86 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -2019,46 +2019,55 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Cache directory", "Directory that contains fluid cache files"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baking_data", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "is_cache_baking_data", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKING_DATA); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baked_data", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "has_cache_baked_data", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKED_DATA); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baking_noise", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "is_cache_baking_noise", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKING_NOISE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baked_noise", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "has_cache_baked_noise", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKED_NOISE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baking_mesh", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "is_cache_baking_mesh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKING_MESH); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baked_mesh", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "has_cache_baked_mesh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKED_MESH); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baking_particles", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "is_cache_baking_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKING_PARTICLES); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baked_particles", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "has_cache_baked_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKED_PARTICLES); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baking_guiding", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "is_cache_baking_guiding", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKING_GUIDING); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - prop = RNA_def_property(srna, "cache_baked_guiding", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "has_cache_baked_guiding", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKED_GUIDING); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); + /* Read only checks, avoids individually accessing flags above. */ + prop = RNA_def_property(srna, "is_cache_baking_any", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKING_ALL); + RNA_def_property_flag(prop, PROP_EDITABLE); + + prop = RNA_def_property(srna, "has_cache_baked_any", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", FLUID_DOMAIN_BAKED_ALL); + RNA_def_property_flag(prop, PROP_EDITABLE); + prop = RNA_def_property(srna, "export_manta_script", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", FLUID_DOMAIN_EXPORT_MANTA_SCRIPT); RNA_def_property_ui_text( |