Generate compatible OSL shader parameter names in cases where the node has and input and output with the same name. In that case the convention is to add suffixes "In" and "Out" respectively.

Example:

Blender node has one input "Color" and one output "Color"

-> OSL parameter names should be "ColorIn" and "ColorOut"
This commit is contained in:
Lukas Toenne
2012-09-15 16:31:07 +00:00
parent 21964e6538
commit 41081b3e8c
2 changed files with 42 additions and 14 deletions

View File

@@ -37,6 +37,7 @@ class OSLGlobals;
class Scene;
class ShaderGraph;
class ShaderNode;
class ShaderInput;
class ShaderOutput;
#ifdef WITH_OSL
@@ -96,7 +97,8 @@ private:
string id(ShaderNode *node);
void compile_type(Shader *shader, ShaderGraph *graph, ShaderType type);
bool node_skip_input(ShaderNode *node, ShaderInput *input);
string compatible_name(const char *name);
string compatible_name(ShaderNode *node, ShaderInput *input);
string compatible_name(ShaderNode *node, ShaderOutput *output);
void find_dependencies(set<ShaderNode*>& dependencies, ShaderInput *input);
void generate_nodes(const set<ShaderNode*>& nodes);