diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-02-03 14:51:22 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-02-03 15:33:59 +0300 |
commit | 6cdb3845a351ee9437030bd50ca7a7124953e097 (patch) | |
tree | 11a8857c62cb1386708a0666b5352fd7859f842e | |
parent | 8a22429db20bc1e0317f9fcda6643a2e2e501663 (diff) |
Added collection settings getter/setter
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 28 |
2 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index e796ef93fda..184f7b9afc5 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 4b28eb99f07..7e4d78a4542 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 */ |