[Bf-blender-cvs] [aaabac0] master: Cycles Volume Render: these changes should have included in the last commit.
Brecht Van Lommel
noreply at git.blender.org
Tue Dec 31 18:03:48 CET 2013
Commit: aaabac069fbf1454e7c7b00a1e96783ecf1563cd
Author: Brecht Van Lommel
Date: Tue Dec 31 17:33:55 2013 +0100
https://developer.blender.org/rBaaabac069fbf1454e7c7b00a1e96783ecf1563cd
Cycles Volume Render: these changes should have included in the last commit.
===================================================================
M intern/cycles/render/graph.cpp
M source/blender/editors/space_node/drawnode.c
===================================================================
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 4256c5e..3fae524 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -17,6 +17,7 @@
#include "attribute.h"
#include "graph.h"
#include "nodes.h"
+#include "shader.h"
#include "util_algorithm.h"
#include "util_debug.h"
@@ -121,11 +122,15 @@ void ShaderNode::attributes(Shader *shader, AttributeRequestSet *attributes)
foreach(ShaderInput *input, inputs) {
if(!input->link) {
if(input->default_value == ShaderInput::TEXTURE_GENERATED) {
- attributes->add(ATTR_STD_GENERATED);
- attributes->add(ATTR_STD_GENERATED_TRANSFORM); // XXX only for volumes!
+ if(shader->has_surface)
+ attributes->add(ATTR_STD_GENERATED);
+ if(shader->has_volume)
+ attributes->add(ATTR_STD_GENERATED_TRANSFORM);
+ }
+ else if(input->default_value == ShaderInput::TEXTURE_UV) {
+ if(shader->has_surface)
+ attributes->add(ATTR_STD_UV);
}
- else if(input->default_value == ShaderInput::TEXTURE_UV)
- attributes->add(ATTR_STD_UV);
}
}
}
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index f762837..72caa46 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -931,8 +931,6 @@ static void node_shader_buts_volume(uiLayout *layout, bContext *C, PointerRNA *U
if (cscene.data && RNA_enum_get(&cscene, "device") == 1)
uiItemL(layout, IFACE_("Volumes not supported on GPU"), ICON_ERROR);
- else
- uiItemL(layout, IFACE_("Volumes are work in progress"), ICON_ERROR);
}
}
More information about the Bf-blender-cvs
mailing list