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:
authorCampbell Barton <ideasman42@gmail.com>2018-02-13 17:06:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-13 17:06:41 +0300
commitb330804ff3eca68cdd65e26d551d1829fae5ff36 (patch)
tree7501de6265ae963e064a580e6339539740a9008b /intern/cycles/render
parent9e2ec6c86a9ea2e387fe5e523df06c0a462819b7 (diff)
parent9fb1f9c5cdccc14f65ba2047e5656b360142aa43 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern/cycles/render')
-rw-r--r--intern/cycles/render/attribute.cpp5
-rw-r--r--intern/cycles/render/nodes.cpp9
2 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp
index 95e69df6885..2d1100c9d88 100644
--- a/intern/cycles/render/attribute.cpp
+++ b/intern/cycles/render/attribute.cpp
@@ -267,6 +267,8 @@ const char *Attribute::standard_name(AttributeStandard std)
return "particle";
case ATTR_STD_CURVE_INTERCEPT:
return "curve_intercept";
+ case ATTR_STD_CURVE_INDEX:
+ return "curve_index";
case ATTR_STD_PTEX_FACE_ID:
return "ptex_face_id";
case ATTR_STD_PTEX_UV:
@@ -451,6 +453,9 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name)
case ATTR_STD_CURVE_INTERCEPT:
attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY);
break;
+ case ATTR_STD_CURVE_INDEX:
+ attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE);
+ break;
case ATTR_STD_GENERATED_TRANSFORM:
attr = add(name, TypeDesc::TypeMatrix, ATTR_ELEMENT_MESH);
break;
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index cb884ba9231..d2a03ceb76a 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -3572,6 +3572,7 @@ NODE_DEFINE(HairInfoNode)
#if 0 /*output for minimum hair width transparency - deactivated */
SOCKET_OUT_FLOAT(fade, "Fade");
#endif
+ SOCKET_OUT_FLOAT(index, "Index");
return type;
}
@@ -3588,6 +3589,9 @@ void HairInfoNode::attributes(Shader *shader, AttributeRequestSet *attributes)
if(!intercept_out->links.empty())
attributes->add(ATTR_STD_CURVE_INTERCEPT);
+
+ if(!output("Index")->links.empty())
+ attributes->add(ATTR_STD_CURVE_INDEX);
}
ShaderNode::attributes(shader, attributes);
@@ -3623,6 +3627,11 @@ void HairInfoNode::compile(SVMCompiler& compiler)
compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_FADE, compiler.stack_assign(out));
}*/
+ out = output("Index");
+ if(!out->links.empty()) {
+ int attr = compiler.attribute(ATTR_STD_CURVE_INDEX);
+ compiler.add_node(NODE_ATTR, attr, compiler.stack_assign(out), NODE_ATTR_FLOAT);
+ }
}
void HairInfoNode::compile(OSLCompiler& compiler)