Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-02-03 18:14:23 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-02-03 18:16:39 +0300
commit83fea5307be3eca872c5a8d056cb6fe8d1fbc1f5 (patch)
treecf36247b776265572f19a21a8aff33bd7272d7fa
parent6644ff25f299288aa274b26665a4e2588f3d0222 (diff)
layer: getter/setter for USE flag
-rw-r--r--source/blender/blenkernel/BKE_layer.h2
-rw-r--r--source/blender/blenkernel/intern/layer.c20
2 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h
index 993a91eb9b6..c16d00de3e3 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -113,6 +113,8 @@ int BKE_collection_engine_property_value_get_int(struct CollectionEngineSettings
int BKE_collection_engine_property_value_get_float(struct CollectionEngineSettings *ces, const char *name);
void BKE_collection_engine_property_value_set_int(struct CollectionEngineSettings *ces, const char *name, int value);
void BKE_collection_engine_property_value_set_float(struct CollectionEngineSettings *ces, const char *name, float value);
+bool BKE_collection_engine_property_use_get(struct CollectionEngineSettings *ces, const char *name);
+void BKE_collection_engine_property_use_set(struct CollectionEngineSettings *ces, const char *name, bool value);
/* iterators */
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 177f9011438..6ebc3719603 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -798,6 +798,26 @@ void BKE_collection_engine_property_value_set_float(CollectionEngineSettings *ce
prop->data.flag |= COLLECTION_PROP_USE;
}
+bool BKE_collection_engine_property_use_get(CollectionEngineSettings *ces, const char *name)
+{
+ CollectionEngineProperty *prop;
+ prop = (CollectionEngineProperty *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name));
+ return ((prop->flag & COLLECTION_PROP_USE) != 0);
+}
+
+void BKE_collection_engine_property_use_set(CollectionEngineSettings *ces, const char *name, bool value)
+{
+ CollectionEngineProperty *prop;
+ prop = (CollectionEngineProperty *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name));
+
+ if (value) {
+ prop->flag |= COLLECTION_PROP_USE;
+ }
+ else {
+ prop->flag &= ~COLLECTION_PROP_USE;
+ }
+}
+
/* ---------------------------------------------------------------------- */
/* Iterators */