From f658e3faac0f650f198c2a3dfef17fbd58f85e0c Mon Sep 17 00:00:00 2001 From: wikoreman Date: Mon, 10 Sep 2018 16:19:29 +0200 Subject: [PATCH] Added get_project_data, update get_project_fps function --- colorbleed/lib.py | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/colorbleed/lib.py b/colorbleed/lib.py index 1297aba606..45bb569af4 100644 --- a/colorbleed/lib.py +++ b/colorbleed/lib.py @@ -257,16 +257,33 @@ def get_project_fps(): Returns: int, float + + """ + + data = get_project_data() + fps = data.get("fps", 25.0) + + return fps + + +def get_project_data(): + """Get the data of the current project + + The data of the project can contain things like: + resolution + fps + renderer + + Returns: + dict: + """ project_name = io.active_project() project = io.find_one({"name": project_name, "type": "project"}, - projection={"config": True}) + projection={"data": True}) - config = project.get("config", None) - assert config, "This is a bug" + data = project.get("data", {}) - fps = config.get("fps", 25.0) - - return fps + return data