Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamil Roosileht <Limarest>2022-04-21 16:06:34 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-04-21 16:34:52 +0300
commitdde5915336d503e12b43af6611c6947767d3e355 (patch)
tree8b340b4996c5a377440fc58edb1b585bd8c42931
parenta254b56d417a3cd6d23a29a1d45c5ac1e16f0fbe (diff)
Fix T97105: change Vertex Colors menu to Attributes in Node Wrangler
Differential Revision: https://developer.blender.org/D14668
-rw-r--r--node_wrangler.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/node_wrangler.py b/node_wrangler.py
index 19ccf0c5..431b6ea4 100644
--- a/node_wrangler.py
+++ b/node_wrangler.py
@@ -3,7 +3,7 @@
bl_info = {
"name": "Node Wrangler",
"author": "Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer",
- "version": (3, 39),
+ "version": (3, 40),
"blender": (2, 93, 0),
"location": "Node Editor Toolbar or Shift-W",
"description": "Various tools to enhance and speed up node-based workflow",
@@ -4555,9 +4555,9 @@ class NWLinkUseOutputsNamesMenu(Menu, NWBase):
props.use_outputs_names = True
-class NWVertColMenu(bpy.types.Menu):
- bl_idname = "NODE_MT_nw_node_vertex_color_menu"
- bl_label = "Vertex Colors"
+class NWAttributeMenu(bpy.types.Menu):
+ bl_idname = "NODE_MT_nw_node_attribute_menu"
+ bl_label = "Attributes"
@classmethod
def poll(cls, context):
@@ -4577,18 +4577,18 @@ class NWVertColMenu(bpy.types.Menu):
for slot in obj.material_slots:
if slot.material == mat:
objs.append(obj)
- vcols = []
+ attrs = []
for obj in objs:
- if obj.data.vertex_colors:
- for vcol in obj.data.vertex_colors:
- vcols.append(vcol.name)
- vcols = list(set(vcols)) # get a unique list
-
- if vcols:
- for vcol in vcols:
- l.operator(NWAddAttrNode.bl_idname, text=vcol).attr_name = vcol
+ if obj.data.attributes:
+ for attr in obj.data.attributes:
+ attrs.append(attr.name)
+ attrs = list(set(attrs)) # get a unique list
+
+ if attrs:
+ for attr in attrs:
+ l.operator(NWAddAttrNode.bl_idname, text=attr).attr_name = attr
else:
- l.label(text="No Vertex Color layers on objects with this material")
+ l.label(text="No attributes on objects with this material")
class NWSwitchNodeTypeMenu(Menu, NWBase):
@@ -5011,7 +5011,7 @@ def select_parent_children_buttons(self, context):
def attr_nodes_menu_func(self, context):
col = self.layout.column(align=True)
- col.menu("NODE_MT_nw_node_vertex_color_menu")
+ col.menu("NODE_MT_nw_node_attribute_menu")
col.separator()
@@ -5297,7 +5297,7 @@ classes = (
NWLinkStandardMenu,
NWLinkUseNodeNameMenu,
NWLinkUseOutputsNamesMenu,
- NWVertColMenu,
+ NWAttributeMenu,
NWSwitchNodeTypeMenu,
NWSwitchShadersInputSubmenu,
NWSwitchShadersOutputSubmenu,