|
Blender V5.3
|
#include <BKE_blender_project.hh>
Inherits blender::IDProperty.
Public Member Functions | |
| ProjectVariable (StringRef name, ProjectVariableType type) | |
| ~ProjectVariable () | |
| ProjectVariable (const ProjectVariable &other)=delete | |
| ProjectVariable & | operator= (const ProjectVariable &other)=delete |
| ProjectVariable (ProjectVariable &&other) noexcept | |
| ProjectVariable & | operator= (ProjectVariable &&other) noexcept |
| IDProperty & | prop () |
| const IDProperty & | prop () const |
| StringRefNull | name_get () const |
| ProjectVariableType | type_get () const |
| ProjectVariableStringSubtype | string_subtype_get () const |
| void | string_subtype_set (ProjectVariableStringSubtype type) |
| StringRefNull | value_string_get () const |
| int | value_int_get () const |
| float | value_float_get () const |
| void | value_set (StringRefNull value) |
| void | value_set (int value) |
| void | value_set (float value) |
| StringRefNull | description_get () const |
| void | description_set (StringRef description) |
A variable in a project.
A project variable is a named value (like a string or integer) that is shared across all blend files in a project.
Definition at line 68 of file BKE_blender_project.hh.
| blender::bke::ProjectVariable::ProjectVariable | ( | StringRef | name, |
| ProjectVariableType | type ) |
Definition at line 73 of file blender_project.cc.
References blender::BLI_assert(), blender::BLI_strdup(), blender::IDPropertyUIData::description, ELEM, blender::IDPropertyTemplate::f, blender::bke::FLOAT, blender::IDPropertyTemplate::i, blender::IDP_FLOAT, blender::IDP_INT, blender::IDP_New(), blender::IDP_NewString(), blender::IDP_ui_data_ensure(), blender::bke::INT, blender::MEM_delete_void(), blender::IDProperty::name, prop(), blender::bke::STRING, blender::IDProperty::type, and blender::IDProperty::ui_data.
Referenced by operator=(), operator=(), ProjectVariable(), and ProjectVariable().
| blender::bke::ProjectVariable::~ProjectVariable | ( | ) |
Definition at line 116 of file blender_project.cc.
References blender::IDP_ClearProperty().
|
delete |
References ProjectVariable().
|
noexcept |
Definition at line 121 of file blender_project.cc.
References ProjectVariable(), and prop().
| StringRefNull blender::bke::ProjectVariable::description_get | ( | ) | const |
Definition at line 187 of file blender_project.cc.
References blender::StringRefNull::StringRefNull(), and blender::IDProperty::ui_data.
Referenced by blender::bke::tests::TEST_F(), and blender::bke::tests::TEST_F().
| void blender::bke::ProjectVariable::description_set | ( | StringRef | description | ) |
Definition at line 195 of file blender_project.cc.
References blender::blender::StringRefBase::copy_unsafe(), blender::blender::StringRefBase::size(), and blender::IDProperty::ui_data.
Referenced by blender::bke::project_variable_add(), and blender::bke::tests::TEST_F().
| StringRefNull blender::bke::ProjectVariable::name_get | ( | ) | const |
Get the variable's name.
Note that renaming a variable requires access to project data (to ensure name uniqueness), and therefore variable renaming is done via rename_variable() on Project rather than by a method on the variable itself.
Definition at line 137 of file blender_project.cc.
References blender::IDProperty::name, and blender::StringRefNull::StringRefNull().
Referenced by blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), and blender::bke::tests::TEST_F().
|
delete |
References operator=(), and ProjectVariable().
Referenced by operator=().
|
noexcept |
Definition at line 127 of file blender_project.cc.
References blender::IDP_ClearProperty(), ProjectVariable(), and prop().
|
inline |
Get the underlying ID property of the variable.
NOTE: typically you shouldn't use this, especially outside of this source file.
We inherit privately from IDProperty because we're only using a specific subset of what it does, and we don't want people accidentally putting it in invalid states for this type. This method bypasses those protections, and should only be used in narrow specific cases.
Definition at line 89 of file BKE_blender_project.hh.
Referenced by operator=(), ProjectVariable(), and ProjectVariable().
|
inline |
Definition at line 93 of file BKE_blender_project.hh.
| ProjectVariableStringSubtype blender::bke::ProjectVariable::string_subtype_get | ( | ) | const |
Definition at line 147 of file blender_project.cc.
References blender::IDProperty::ui_data.
Referenced by blender::bke::tests::TEST_F(), and blender::bke::tests::TEST_F().
| void blender::bke::ProjectVariable::string_subtype_set | ( | ProjectVariableStringSubtype | type | ) |
Definition at line 152 of file blender_project.cc.
References blender::IDProperty::type, and blender::IDProperty::ui_data.
Referenced by blender::bke::project_variable_add(), blender::project_variable_add_exec(), and blender::bke::tests::TEST_F().
| ProjectVariableType blender::bke::ProjectVariable::type_get | ( | ) | const |
Get the variable's type.
Note that the variable's type is determined at construction time, and cannot be changed after.
Definition at line 142 of file blender_project.cc.
References blender::IDProperty::type.
Referenced by blender::bke::tests::TEST_F().
| float blender::bke::ProjectVariable::value_float_get | ( | ) | const |
Definition at line 167 of file blender_project.cc.
References IDP_float_get.
Referenced by blender::bke::tests::TEST_F(), and blender::bke::tests::TEST_F().
| int blender::bke::ProjectVariable::value_int_get | ( | ) | const |
Definition at line 162 of file blender_project.cc.
References IDP_int_get.
Referenced by blender::bke::tests::TEST_F(), and blender::bke::tests::TEST_F().
| void blender::bke::ProjectVariable::value_set | ( | float | value | ) |
Definition at line 182 of file blender_project.cc.
References IDP_float_set.
| void blender::bke::ProjectVariable::value_set | ( | int | value | ) |
Definition at line 177 of file blender_project.cc.
References IDP_int_set.
| void blender::bke::ProjectVariable::value_set | ( | StringRefNull | value | ) |
Definition at line 172 of file blender_project.cc.
References blender::StringRefNull::c_str(), and blender::IDP_AssignString().
Referenced by blender::bke::project_variable_add(), and blender::bke::tests::TEST_F().
| StringRefNull blender::bke::ProjectVariable::value_string_get | ( | ) | const |
Definition at line 157 of file blender_project.cc.
References IDP_string_get, and blender::StringRefNull::StringRefNull().
Referenced by blender::bke::tests::TEST_F(), and blender::bke::tests::TEST_F().