[Bf-blender-cvs] [d67c07e] master: Fix T48671: Cycles crash with OSL nodes and bump after recent refactoring.
Brecht Van Lommel
noreply at git.blender.org
Sat Jun 18 12:34:23 CEST 2016
Commit: d67c07ea49ec06a547b8b4ec287642b83ea6d9c4
Author: Brecht Van Lommel
Date: Sat Jun 18 12:30:59 2016 +0200
Branches: master
https://developer.blender.org/rBd67c07ea49ec06a547b8b4ec287642b83ea6d9c4
Fix T48671: Cycles crash with OSL nodes and bump after recent refactoring.
===================================================================
M intern/cycles/render/nodes.cpp
M intern/cycles/render/nodes.h
===================================================================
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index a2e5171..bcaeaa9 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -4991,6 +4991,13 @@ OSLNode::~OSLNode()
delete type;
}
+ShaderNode *OSLNode::clone() const
+{
+ OSLNode *node = new OSLNode(*this);
+ node->type = new NodeType(*type);
+ return node;
+}
+
OSLNode* OSLNode::create(size_t num_inputs)
{
/* allocate space for the node itself and parameters, aligned to 16 bytes
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 41894dc..8d73a94 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -912,11 +912,13 @@ public:
static OSLNode *create(size_t num_inputs);
~OSLNode();
+ ShaderNode *clone() const;
+
char* input_default_value();
void add_input(ustring name, SocketType::Type type);
void add_output(ustring name, SocketType::Type type);
- SHADER_NODE_BASE_CLASS(OSLNode)
+ SHADER_NODE_NO_CLONE_CLASS(OSLNode)
/* ideally we could beter detect this, but we can't query this now */
bool has_spatial_varying() { return true; }
@@ -924,9 +926,6 @@ public:
string filepath;
string bytecode_hash;
-
-private:
- OSLNode();
};
class NormalMapNode : public ShaderNode {
More information about the Bf-blender-cvs
mailing list