diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-03-19 12:47:03 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-03-26 16:13:39 +0300 |
commit | f65b7c8377de664198195754abf31782cc00398f (patch) | |
tree | d839e0c1fed21c8144168da4544dbca667dfefe2 /source | |
parent | 84411eb190e7e6d2c821ebbe135ebe1149431c62 (diff) |
UI cleanup and a bit nicer workflow by treating read/write mode like
an enum toggle.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 2 | ||||
-rw-r--r-- | source/blender/editors/io/io_cache_library.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 12 |
5 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index b35d070ea8c..378663fee83 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -625,7 +625,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Main *bmain, Sc * when the duplicator is visible (even if group objects are not visible themselves). * It is not a true dependency, the duplicator does not in any way depend on group objects or data! */ - if (ob->transflag & OB_DUPLI && !(ob->transflag & OB_DUPLI_USE_CACHE)) { + if (ob->transflag & OB_DUPLI && !(ob->transflag & OB_DUPLI_READ_CACHE)) { if ((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) { GroupObject *go; for (go = ob->dup_group->gobject.first; go; go = go->next) { diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index bc409ffae01..d1dbf288609 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -1397,7 +1397,7 @@ void BKE_object_dupli_cache_update(Scene *scene, Object *ob, EvaluationContext * const eCacheLibrary_EvalMode eval_mode = eval_ctx->mode == DAG_EVAL_RENDER ? CACHE_LIBRARY_EVAL_RENDER : CACHE_LIBRARY_EVAL_VIEWPORT; bool is_dupligroup = (ob->transflag & OB_DUPLIGROUP) && ob->dup_group; - bool is_cached = (ob->transflag & OB_DUPLI_USE_CACHE) && ob->cache_library; + bool is_cached = (ob->transflag & OB_DUPLI_READ_CACHE) && ob->cache_library; /* cache is a group duplicator feature only */ if (is_dupligroup && is_cached) { diff --git a/source/blender/editors/io/io_cache_library.c b/source/blender/editors/io/io_cache_library.c index b946a4dec0b..1cf7fda270f 100644 --- a/source/blender/editors/io/io_cache_library.c +++ b/source/blender/editors/io/io_cache_library.c @@ -231,7 +231,7 @@ static int cache_library_bake_poll(bContext *C) /* re-baking cached results doesn't make much sense, * clarify workflow by enabling either reading or writing, but not both */ - if (ob->transflag & OB_DUPLI_USE_CACHE) + if (ob->transflag & OB_DUPLI_READ_CACHE) return false; return true; diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index cf94c5f0bab..90e6a1532ec 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -433,7 +433,7 @@ enum { OB_RENDER_DUPLI = 1 << 12, OB_NO_CONSTRAINTS = 1 << 13, /* runtime constraints disable */ OB_NO_PSYS_UPDATE = 1 << 14, /* hack to work around particle issue */ - OB_DUPLI_USE_CACHE = 1 << 15, /* use cache instead of object data */ + OB_DUPLI_READ_CACHE = 1 << 15, /* use cache instead of object data */ OB_DUPLI = OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLIGROUP | OB_DUPLIFACES | OB_DUPLIPARTS, }; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 48b4e1c57cc..9631a5e6d5a 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2647,9 +2647,15 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Dupli Faces Scale", "Scale the DupliFace objects"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); - prop = RNA_def_property(srna, "use_dupli_cache", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI_USE_CACHE); - RNA_def_property_ui_text(prop, "Use Dupli Cache", "Use caching instead of object data"); + prop = RNA_def_property(srna, "use_dupli_cache_read", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI_READ_CACHE); + RNA_def_property_ui_text(prop, "Read Dupli Cache", "Use cached data instead of object data"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); + + /* note: inversion of use_dupli_cache_read, for enum-like mode switch */ + prop = RNA_def_property(srna, "use_dupli_cache_write", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "transflag", OB_DUPLI_READ_CACHE); + RNA_def_property_ui_text(prop, "Write Dupli Cache", "Enabling writing of dupli cache data"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); prop = RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE); |