From a6a5c113ca40855b8bfac75d2a0527e379fcf0c6 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 12 Jun 2020 03:27:52 +1000 Subject: [PATCH] nodeinput: added convenience function for determining if a value is expected to change over time --- app/node/input.cpp | 5 +++++ app/node/input.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/app/node/input.cpp b/app/node/input.cpp index 287d471ac..3ec99b36f 100644 --- a/app/node/input.cpp +++ b/app/node/input.cpp @@ -970,6 +970,11 @@ bool NodeInput::is_keyframable() const return keyframable_; } +bool NodeInput::is_static() const +{ + return !(this->is_connected() || this->is_keyframing()); +} + QVariant NodeInput::get_standard_value() const { return combine_track_values_into_normal_value(standard_value_); diff --git a/app/node/input.h b/app/node/input.h index c9e1b1d8d..4a6da4822 100644 --- a/app/node/input.h +++ b/app/node/input.h @@ -200,6 +200,13 @@ public: */ bool is_keyframable() const; + /** + * @brief Returns whether the value that this input returns is always the same or is expected to change + * + * Equivalent to `!(is_connected() || is_keyframing())` + */ + bool is_static() const; + /** * @brief Get non-keyframed value */