Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes/NOD_socket_declarations.hh')
-rw-r--r--source/blender/nodes/NOD_socket_declarations.hh26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/nodes/NOD_socket_declarations.hh b/source/blender/nodes/NOD_socket_declarations.hh
index e22b96cd1ff..d4958f433d6 100644
--- a/source/blender/nodes/NOD_socket_declarations.hh
+++ b/source/blender/nodes/NOD_socket_declarations.hh
@@ -145,14 +145,26 @@ class ColorBuilder : public SocketDeclarationBuilder<Color> {
ColorBuilder &default_value(const ColorGeometry4f value);
};
+class StringBuilder;
+
class String : public SocketDeclaration {
+ private:
+ std::string default_value_;
+
+ friend StringBuilder;
+
public:
- using Builder = SocketDeclarationBuilder<String>;
+ using Builder = StringBuilder;
bNodeSocket &build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const override;
bool matches(const bNodeSocket &socket) const override;
};
+class StringBuilder : public SocketDeclarationBuilder<String> {
+ public:
+ StringBuilder &default_value(const std::string value);
+};
+
class IDSocketDeclaration : public SocketDeclaration {
private:
const char *idname_;
@@ -323,6 +335,18 @@ inline ColorBuilder &ColorBuilder::default_value(const ColorGeometry4f value)
/** \} */
/* -------------------------------------------------------------------- */
+/** \name #StringBuilder Inline Methods
+ * \{ */
+
+inline StringBuilder &StringBuilder::default_value(std::string value)
+{
+ decl_->default_value_ = std::move(value);
+ return *this;
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name #IDSocketDeclaration and Children Inline Methods
* \{ */