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:
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_ies_light.cc')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_ies_light.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_ies_light.cc b/source/blender/nodes/shader/nodes/node_shader_ies_light.cc
index 481524dadc0..82f0a3045c9 100644
--- a/source/blender/nodes/shader/nodes/node_shader_ies_light.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_ies_light.cc
@@ -19,6 +19,9 @@
#include "node_shader_util.hh"
+#include "UI_interface.h"
+#include "UI_resources.h"
+
namespace blender::nodes::node_shader_ies_light_cc {
static void node_declare(NodeDeclarationBuilder &b)
@@ -28,6 +31,23 @@ static void node_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Float>(N_("Fac"));
}
+static void node_shader_buts_ies(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+ uiLayout *row;
+
+ row = uiLayoutRow(layout, false);
+ uiItemR(row, ptr, "mode", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
+
+ row = uiLayoutRow(layout, true);
+
+ if (RNA_enum_get(ptr, "mode") == NODE_IES_INTERNAL) {
+ uiItemR(row, ptr, "ies", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
+ }
+ else {
+ uiItemR(row, ptr, "filepath", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
+ }
+}
+
static void node_shader_init_tex_ies(bNodeTree *UNUSED(ntree), bNode *node)
{
NodeShaderTexIES *tex = MEM_cnew<NodeShaderTexIES>("NodeShaderIESLight");
@@ -45,6 +65,7 @@ void register_node_type_sh_tex_ies()
sh_node_type_base(&ntype, SH_NODE_TEX_IES, "IES Texture", NODE_CLASS_TEXTURE);
ntype.declare = file_ns::node_declare;
+ ntype.draw_buttons = file_ns::node_shader_buts_ies;
node_type_init(&ntype, file_ns::node_shader_init_tex_ies);
node_type_storage(
&ntype, "NodeShaderTexIES", node_free_standard_storage, node_copy_standard_storage);