[Bf-blender-cvs] [83fea5307b] clay-engine: layer: getter/setter for USE flag

Dalai Felinto noreply at git.blender.org
Fri Feb 3 16:18:31 CET 2017


Commit: 83fea5307be3eca872c5a8d056cb6fe8d1fbc1f5
Author: Dalai Felinto
Date:   Fri Feb 3 16:14:23 2017 +0100
Branches: clay-engine
https://developer.blender.org/rB83fea5307be3eca872c5a8d056cb6fe8d1fbc1f5

layer: getter/setter for USE flag

===================================================================

M	source/blender/blenkernel/BKE_layer.h
M	source/blender/blenkernel/intern/layer.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h
index 993a91eb9b..c16d00de3e 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 177f901143..6ebc371960 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 */




More information about the Bf-blender-cvs mailing list