[Bf-blender-cvs] [6cdb3845a3] clay-engine: Added collection settings getter/setter
Clément Foucault
noreply at git.blender.org
Fri Feb 3 13:36:52 CET 2017
Commit: 6cdb3845a351ee9437030bd50ca7a7124953e097
Author: Clément Foucault
Date: Fri Feb 3 12:51:22 2017 +0100
Branches: clay-engine
https://developer.blender.org/rB6cdb3845a351ee9437030bd50ca7a7124953e097
Added collection settings getter/setter
===================================================================
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 e796ef93fd..184f7b9afc 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -105,6 +105,10 @@ void BKE_layer_collection_engine_settings_free(struct ListBase *lb);
void BKE_collection_engine_property_add_float(struct CollectionEngineSettings *ces, const char *name, float value);
void BKE_collection_engine_property_add_int(struct CollectionEngineSettings *ces, const char *name, int value);
struct CollectionEngineProperty *BKE_collection_engine_property_get(struct CollectionEngineSettings *ces, const char *name);
+int BKE_collection_engine_property_value_get_int(struct CollectionEngineSettings *ces, const char *name);
+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);
/* iterators */
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 4b28eb99f0..7e4d78a454 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -739,6 +739,34 @@ CollectionEngineProperty *BKE_collection_engine_property_get(CollectionEngineSet
return BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name));
}
+int BKE_collection_engine_property_value_get_int(CollectionEngineSettings *ces, const char *name)
+{
+ CollectionEnginePropertyInt *prop;
+ prop = (CollectionEnginePropertyInt *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name));
+ return prop->value;
+}
+
+int BKE_collection_engine_property_value_get_float(CollectionEngineSettings *ces, const char *name)
+{
+ CollectionEnginePropertyFloat *prop;
+ prop = (CollectionEnginePropertyFloat *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name));
+ return prop->value;
+}
+
+void BKE_collection_engine_property_value_set_int(CollectionEngineSettings *ces, const char *name, int value)
+{
+ CollectionEnginePropertyInt *prop;
+ prop = (CollectionEnginePropertyInt *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name));
+ prop->value = value;
+}
+
+void BKE_collection_engine_property_value_set_float(CollectionEngineSettings *ces, const char *name, float value)
+{
+ CollectionEnginePropertyFloat *prop;
+ prop = (CollectionEnginePropertyFloat *)BLI_findstring(&ces->properties, name, offsetof(CollectionEngineProperty, name));
+ prop->value = value;
+}
+
/* ---------------------------------------------------------------------- */
/* Iterators */
More information about the Bf-blender-cvs
mailing list