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:
authorKevin Dietrich <kevin.dietrich@mailoo.org>2014-04-02 13:40:29 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-02 13:53:44 +0400
commitcb7cfd3ab6be1cfba96cb2070ac60d224126f1ea (patch)
treeec8de38de655c8fe74835eabc7f9c68e20df322a /intern/cycles/kernel
parent288147334ce81cf0be533c15f3698b88ef7c63f3 (diff)
Cycles: add dedicated UV Map node, easier to find and has convenient auto complete.
Fixes T37954. Reviewed By: brecht, dingto Differential Revision: https://developer.blender.org/D230
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/shaders/CMakeLists.txt1
-rw-r--r--intern/cycles/kernel/shaders/node_uv_map.osl34
-rw-r--r--intern/cycles/kernel/svm/svm_types.h3
3 files changed, 37 insertions, 1 deletions
diff --git a/intern/cycles/kernel/shaders/CMakeLists.txt b/intern/cycles/kernel/shaders/CMakeLists.txt
index 045abdb80af..5518d652bf9 100644
--- a/intern/cycles/kernel/shaders/CMakeLists.txt
+++ b/intern/cycles/kernel/shaders/CMakeLists.txt
@@ -77,6 +77,7 @@ set(SRC_OSL
node_wave_texture.osl
node_wireframe.osl
node_hair_bsdf.osl
+ node_uv_map.osl
)
set(SRC_OSL_HEADERS
diff --git a/intern/cycles/kernel/shaders/node_uv_map.osl b/intern/cycles/kernel/shaders/node_uv_map.osl
new file mode 100644
index 00000000000..fd039beaee8
--- /dev/null
+++ b/intern/cycles/kernel/shaders/node_uv_map.osl
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2011-2013 Blender Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+#include "stdosl.h"
+
+shader node_uv_map(
+ string name = "",
+ int from_dupli = 0,
+ output point UV = point(0.0, 0.0, 0.0))
+
+{
+ if (from_dupli) {
+ getattribute("geom:dupli_uv", UV);
+ }
+ else {
+ if (name == "")
+ getattribute("geom:uv", UV);
+ else
+ getattribute(name, UV);
+ }
+}
diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h
index ad5e1ea6d2e..3285ea5cd31 100644
--- a/intern/cycles/kernel/svm/svm_types.h
+++ b/intern/cycles/kernel/svm/svm_types.h
@@ -102,7 +102,8 @@ typedef enum NodeType {
NODE_CLOSURE_AMBIENT_OCCLUSION,
NODE_TANGENT,
NODE_NORMAL_MAP,
- NODE_HAIR_INFO
+ NODE_HAIR_INFO,
+ NODE_UVMAP
} NodeType;
typedef enum NodeAttributeType {