From b8d78a5c121066651935a97ebbda039474c571c8 Mon Sep 17 00:00:00 2001
From: bernardkwok <bernard.kwok@autodesk.com>
Date: Mon, 19 Jul 2021 12:30:28 -0400
Subject: [PATCH] Expose hardcoded UDIM transform names. Currently for atlas
 lookup but can be used for array lookup as well.

---
 source/MaterialXGenShader/Nodes/HwImageNode.cpp | 4 ++--
 source/MaterialXGenShader/Nodes/HwImageNode.h   | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/source/MaterialXGenShader/Nodes/HwImageNode.cpp b/source/MaterialXGenShader/Nodes/HwImageNode.cpp
index ed6444d4df..1b1807536b 100644
--- a/source/MaterialXGenShader/Nodes/HwImageNode.cpp
+++ b/source/MaterialXGenShader/Nodes/HwImageNode.cpp
@@ -13,8 +13,8 @@
 namespace MaterialX
 {
 // Additional implementaton arguments for image nodes
-const string UV_SCALE = "uv_scale";
-const string UV_OFFSET = "uv_offset";
+string HwImageNode::UV_SCALE = "uv_scale";
+string HwImageNode::UV_OFFSET = "uv_offset";
 
 ShaderNodeImplPtr HwImageNode::create()
 {
diff --git a/source/MaterialXGenShader/Nodes/HwImageNode.h b/source/MaterialXGenShader/Nodes/HwImageNode.h
index 826bf49259..4e16fbf48d 100644
--- a/source/MaterialXGenShader/Nodes/HwImageNode.h
+++ b/source/MaterialXGenShader/Nodes/HwImageNode.h
@@ -19,6 +19,12 @@ class MX_GENSHADER_API HwImageNode : public HwSourceCodeNode
 
     void addInputs(ShaderNode& node, GenContext& context) const override;
     void setValues(const Node& node, ShaderNode& shaderNode, GenContext& context) const override;
+
+    // Aguments which may be added as part of the signature for image nodes
+    // to allow for additional texture coordinate transformations.
+    // Currently these are added to support UDIM texture atlas lookup.
+    static string UV_SCALE;
+    static string UV_OFFSET;
 };
 
 } // namespace MaterialX