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:
authorOmarSquircleArt <omar.squircleart@gmail.com>2019-08-22 15:26:09 +0300
committerOmarSquircleArt <omar.squircleart@gmail.com>2019-08-22 15:26:09 +0300
commit08ab3cbcce1eb9c2de4953a83b50cabc44479d3c (patch)
treeef169595562509b0e3338cecb36a3b3210bd64ce /intern/cycles/kernel/osl
parenta2443848646cdb5d13980157a8c62eb4cd578388 (diff)
Shading: Add object color to Object Info node.
The object color property is added as an additional output in the Object Info node. Reviewers: brecht Differential Revision: https://developer.blender.org/D5554
Diffstat (limited to 'intern/cycles/kernel/osl')
-rw-r--r--intern/cycles/kernel/osl/osl_services.cpp5
-rw-r--r--intern/cycles/kernel/osl/osl_services.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
index 3850d0fe94b..222475b3778 100644
--- a/intern/cycles/kernel/osl/osl_services.cpp
+++ b/intern/cycles/kernel/osl/osl_services.cpp
@@ -81,6 +81,7 @@ ustring OSLRenderServices::u_screen("screen");
ustring OSLRenderServices::u_raster("raster");
ustring OSLRenderServices::u_ndc("NDC");
ustring OSLRenderServices::u_object_location("object:location");
+ustring OSLRenderServices::u_object_color("object:color");
ustring OSLRenderServices::u_object_index("object:index");
ustring OSLRenderServices::u_geom_dupli_generated("geom:dupli_generated");
ustring OSLRenderServices::u_geom_dupli_uv("geom:dupli_uv");
@@ -668,6 +669,10 @@ bool OSLRenderServices::get_object_standard_attribute(
float3 f = object_location(kg, sd);
return set_attribute_float3(f, type, derivatives, val);
}
+ else if (name == u_object_color) {
+ float3 f = object_color(kg, sd->object);
+ return set_attribute_float3(f, type, derivatives, val);
+ }
else if (name == u_object_index) {
float f = object_pass_id(kg, sd->object);
return set_attribute_float(f, type, derivatives, val);
diff --git a/intern/cycles/kernel/osl/osl_services.h b/intern/cycles/kernel/osl/osl_services.h
index 024ef656be1..469c5188730 100644
--- a/intern/cycles/kernel/osl/osl_services.h
+++ b/intern/cycles/kernel/osl/osl_services.h
@@ -245,6 +245,7 @@ class OSLRenderServices : public OSL::RendererServices {
static ustring u_raster;
static ustring u_ndc;
static ustring u_object_location;
+ static ustring u_object_color;
static ustring u_object_index;
static ustring u_geom_dupli_generated;
static ustring u_geom_dupli_uv;