2023-08-24 13:46:11 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
|
|
|
|
|
#
|
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
from bpy.types import Menu
|
|
|
|
|
from bl_ui import node_add_menu
|
2023-08-31 16:32:49 +02:00
|
|
|
from bpy.app.translations import (
|
2023-12-30 15:35:10 +01:00
|
|
|
contexts as i18n_contexts,
|
2023-08-31 16:32:49 +02:00
|
|
|
)
|
2023-08-24 13:46:11 +02:00
|
|
|
|
2023-09-01 11:19:44 +10:00
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_input(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_input"
|
2023-08-24 13:46:11 +02:00
|
|
|
bl_label = "Input"
|
|
|
|
|
|
2023-08-31 16:32:49 +02:00
|
|
|
def draw(self, context):
|
2025-07-27 20:36:07 +10:00
|
|
|
del context
|
2023-08-24 13:46:11 +02:00
|
|
|
layout = self.layout
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_input_constant")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
Compositor: Replace Composite node with Group Output node
This patch replaces the Composite node with the Group Output node as the
primary compositor output. The old node was removed and versioned. This
was done for consistency with Geometry Nodes and in preparation for more
generic use of the compositor in VSE modifiers, layered compositing, NPR
multi-stage compositing, and more.
The Group Output node relies on the node tree interface, so we now have
a default interface of a single input and a single output. For now, only
the first input is considered while the rest are ignored, just like the
Geometry Nodes design. Furthermore, the input is required to be of type
color. Warnings and errors are issues if any of those are not met, also
similar to Geometry Nodes.
This introduces a new limitation: Composite outputs can no longer exist
in node groups, since they obviously then act as their respective group
outputs.
A refactor for the compositor scheduler is needed to simplify the logic
after this change, but this will be done in a separate patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/142232
2025-07-24 13:41:56 +02:00
|
|
|
node_add_menu.add_node_type(layout, "NodeGroupInput")
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeBokehImage")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeImage")
|
2025-06-10 15:49:31 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeImageInfo")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeImageCoordinates")
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeMask")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeMovieClip")
|
2023-08-31 16:32:49 +02:00
|
|
|
|
|
|
|
|
layout.separator()
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_input_scene")
|
2023-08-31 16:32:49 +02:00
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_input_constant(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_input_constant"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Constant"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeRGB")
|
2025-03-19 10:54:36 +01:00
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeValue")
|
2025-06-19 16:12:45 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeNormal")
|
2023-08-31 16:32:49 +02:00
|
|
|
|
2023-10-15 19:52:38 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, "Input/Constant")
|
2023-08-31 16:32:49 +02:00
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_input_scene(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_input_scene"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Scene"
|
|
|
|
|
|
2025-05-15 20:56:33 +02:00
|
|
|
def draw(self, context):
|
2023-08-31 16:32:49 +02:00
|
|
|
layout = self.layout
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeRLayers")
|
Nodes: support searching for outputs of various input nodes directly
Previously, one had to search for the name of an input node (Geometry, Light
Path, etc.) instead of for the actual desired values.
This patch makes it possible to search for the output names of various input
nodes directly. All other outputs of the input node are hidden automatically.
This was partially support for the Scene Time before.
Supported nodes:
* Compositor: Scene Time
* Geometry Nodes: Camera Info, Mouse Position, Scene Time, Viewport Transform
* Shader Nodes: Camera Data, Curves Info, Geometry, Volume Info, Light Path,
Object Info, Particle Info
Right now, the output names are hardcoded in the menu. We don't have a great way
to access those without an actual node instance currently. For that we'll need
to make the node declarations available in Python, which is a good project but
out of scope for this this feature. It also does not seem too bad to have more
explicit control over what's shown in the search.
Pull Request: https://projects.blender.org/blender/blender/pulls/139477
2025-05-28 05:41:37 +02:00
|
|
|
node_add_menu.add_node_type_with_outputs(context, layout, "CompositorNodeSceneTime", ["Frame", "Seconds"])
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeTime")
|
|
|
|
|
|
2023-10-15 19:52:38 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, "Input/Scene")
|
2023-08-24 13:46:11 +02:00
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_output(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_output"
|
2023-08-24 13:46:11 +02:00
|
|
|
bl_label = "Output"
|
|
|
|
|
|
2023-08-31 16:32:49 +02:00
|
|
|
def draw(self, context):
|
2025-07-27 20:36:07 +10:00
|
|
|
del context
|
2023-08-31 16:32:49 +02:00
|
|
|
layout = self.layout
|
Compositor: Replace Composite node with Group Output node
This patch replaces the Composite node with the Group Output node as the
primary compositor output. The old node was removed and versioned. This
was done for consistency with Geometry Nodes and in preparation for more
generic use of the compositor in VSE modifiers, layered compositing, NPR
multi-stage compositing, and more.
The Group Output node relies on the node tree interface, so we now have
a default interface of a single input and a single output. For now, only
the first input is considered while the rest are ignored, just like the
Geometry Nodes design. Furthermore, the input is required to be of type
color. Warnings and errors are issues if any of those are not met, also
similar to Geometry Nodes.
This introduces a new limitation: Composite outputs can no longer exist
in node groups, since they obviously then act as their respective group
outputs.
A refactor for the compositor scheduler is needed to simplify the logic
after this change, but this will be done in a separate patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/142232
2025-07-24 13:41:56 +02:00
|
|
|
node_add_menu.add_node_type(layout, "NodeGroupOutput")
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeViewer")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeOutputFile")
|
|
|
|
|
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_color(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_color"
|
2023-08-24 13:46:11 +02:00
|
|
|
bl_label = "Color"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_color_adjust")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_color_mix")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodePremulKey")
|
2025-06-10 15:49:31 +02:00
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeBlackbody")
|
2025-03-19 10:54:36 +01:00
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeValToRGB")
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeConvertColorSpace")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeSetAlpha")
|
|
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeInvert")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeRGBToBW")
|
|
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_color_adjust(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_color_adjust"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Adjust"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeBrightContrast")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeColorBalance")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeColorCorrection")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeExposure")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeGamma")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeHueCorrect")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeHueSat")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeCurveRGB")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeTonemap")
|
|
|
|
|
|
2023-10-15 19:52:38 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, "Color/Adjust")
|
2023-08-24 13:46:11 +02:00
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_color_mix(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_color_mix"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Mix"
|
2023-08-24 13:46:11 +02:00
|
|
|
|
2025-05-09 04:02:50 +02:00
|
|
|
def draw(self, context):
|
2023-08-24 13:46:11 +02:00
|
|
|
layout = self.layout
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeAlphaOver")
|
|
|
|
|
layout.separator()
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeCombineColor")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeSeparateColor")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeZcombine")
|
2025-07-25 22:25:19 -04:00
|
|
|
node_add_menu.add_color_mix_node(context, layout)
|
2023-10-15 19:52:38 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, "Color/Mix")
|
2023-08-24 13:46:11 +02:00
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_filter(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_filter"
|
2023-08-24 13:46:11 +02:00
|
|
|
bl_label = "Filter"
|
|
|
|
|
|
2025-05-14 13:42:48 +02:00
|
|
|
def draw(self, context):
|
2023-08-24 13:46:11 +02:00
|
|
|
layout = self.layout
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_filter_blur")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeAntiAliasing")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDenoise")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDespeckle")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDilateErode")
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeInpaint")
|
|
|
|
|
layout.separator()
|
2025-05-19 11:55:57 +02:00
|
|
|
node_add_menu.add_node_type_with_searchable_enum(context, layout, "CompositorNodeFilter", "filter_type")
|
2025-05-14 13:42:48 +02:00
|
|
|
node_add_menu.add_node_type_with_searchable_enum(context, layout, "CompositorNodeGlare", "glare_type")
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeKuwahara")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodePixelate")
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodePosterize")
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeSunBeams")
|
|
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_filter_blur(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_filter_blur"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Blur"
|
2023-08-24 13:46:11 +02:00
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeBilateralblur")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeBlur")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeBokehBlur")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDefocus")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDBlur")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeVecBlur")
|
2023-08-24 13:46:11 +02:00
|
|
|
|
2023-10-15 19:52:38 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, "Filter/Blur")
|
2023-08-31 16:32:49 +02:00
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_group(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_group"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Group"
|
2023-08-24 13:46:11 +02:00
|
|
|
|
2023-08-31 16:32:49 +02:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
node_add_menu.draw_node_group_add_menu(context, layout)
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_keying(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_keying"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Keying"
|
2023-08-24 13:46:11 +02:00
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeChannelMatte")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeChromaMatte")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeColorMatte")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeColorSpill")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDiffMatte")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDistanceMatte")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeKeying")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeKeyingScreen")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeLumaMatte")
|
|
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_mask(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_mask"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Mask"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeCryptomatteV2")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeCryptomatte")
|
|
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeBoxMask")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeEllipseMask")
|
|
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDoubleEdgeMask")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeIDMask")
|
|
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_tracking(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_tracking"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Tracking"
|
2023-12-30 15:35:10 +01:00
|
|
|
bl_translation_context = i18n_contexts.id_movieclip
|
2023-08-24 13:46:11 +02:00
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodePlaneTrackDeform")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeStabilize")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeTrackPos")
|
|
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
2023-08-24 13:46:11 +02:00
|
|
|
|
2023-08-31 16:32:49 +02:00
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_transform(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_transform"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Transform"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeRotate")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeScale")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeTransform")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeTranslate")
|
|
|
|
|
layout.separator()
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeCornerPin")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeCrop")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeDisplace")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeFlip")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeMapUV")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeLensdist")
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeMovieDistortion")
|
|
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2025-03-26 16:43:31 +02:00
|
|
|
class NODE_MT_category_compositor_texture(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_texture"
|
|
|
|
|
bl_label = "Texture"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexBrick")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexChecker")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexGabor")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexGradient")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexMagic")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexNoise")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexVoronoi")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexWave")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeTexWhiteNoise")
|
|
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_utilities(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_utilities"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Utilities"
|
2023-08-24 13:46:11 +02:00
|
|
|
|
2025-05-08 04:28:22 +02:00
|
|
|
def draw(self, context):
|
2023-08-24 13:46:11 +02:00
|
|
|
layout = self.layout
|
2025-03-19 10:54:36 +01:00
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeMapRange")
|
2025-05-08 04:28:22 +02:00
|
|
|
node_add_menu.add_node_type_with_searchable_enum(context, layout, "ShaderNodeMath", "operation")
|
2025-03-19 10:54:36 +01:00
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeMix")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeClamp")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeFloatCurve")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeLevels")
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeNormalize")
|
|
|
|
|
layout.separator()
|
2023-12-03 23:20:44 +01:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeSplit")
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeSwitch")
|
2025-07-18 11:08:30 +02:00
|
|
|
node_add_menu.add_node_type(layout, "GeometryNodeMenuSwitch")
|
2023-08-31 16:32:49 +02:00
|
|
|
node_add_menu.add_node_type(
|
|
|
|
|
layout, "CompositorNodeSwitchView",
|
I18n: Translate GN Add > Input > Import menu items
Geometry Nodes' Add > Input > Import menu includes file format items
such as "Standford PLY (.ply)", "STL (.stl)", "Text (.txt)". The
latter needs to be translated because "Text" is a generic format.
These items are declared using a custom function
`node_add_menu.add_node_type`, with a `label` argument. This commit
adds the `label` argument to the function arguments that can be
extracted from specific node declaration functions, and specifies the
argument position for each:
"add_node_type", "add_node_type_with_outputs", "add_simulation_zone",
"add_repeat_zone", "add_foreach_geometry_element_zone",
"add_closure_zone".
There is currently no facility to specify a translation context but it
could be easily added if the need arises.
Most of these functions do not actually declare new, unique messages,
but it could happen in the future. In addition, two messages were
extracted using manual `iface_()` calls, which are no longer needed
after this change.
Reported by Ye Gui in #43295.
2025-06-30 11:31:45 +02:00
|
|
|
label="Switch Stereo View")
|
2025-05-20 08:32:46 +02:00
|
|
|
layout.separator()
|
|
|
|
|
node_add_menu.add_node_type(layout, "CompositorNodeRelativeToPixel")
|
2023-08-31 16:32:49 +02:00
|
|
|
|
|
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_category_compositor_vector(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_category_compositor_vector"
|
2023-08-31 16:32:49 +02:00
|
|
|
bl_label = "Vector"
|
|
|
|
|
|
2025-05-08 04:28:22 +02:00
|
|
|
def draw(self, context):
|
2023-08-31 16:32:49 +02:00
|
|
|
layout = self.layout
|
2025-03-19 10:54:36 +01:00
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeCombineXYZ")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeSeparateXYZ")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
I18n: Translate GN Add > Input > Import menu items
Geometry Nodes' Add > Input > Import menu includes file format items
such as "Standford PLY (.ply)", "STL (.stl)", "Text (.txt)". The
latter needs to be translated because "Text" is a generic format.
These items are declared using a custom function
`node_add_menu.add_node_type`, with a `label` argument. This commit
adds the `label` argument to the function arguments that can be
extracted from specific node declaration functions, and specifies the
argument position for each:
"add_node_type", "add_node_type_with_outputs", "add_simulation_zone",
"add_repeat_zone", "add_foreach_geometry_element_zone",
"add_closure_zone".
There is currently no facility to specify a translation context but it
could be easily added if the need arises.
Most of these functions do not actually declare new, unique messages,
but it could happen in the future. In addition, two messages were
extracted using manual `iface_()` calls, which are no longer needed
after this change.
Reported by Ye Gui in #43295.
2025-06-30 11:31:45 +02:00
|
|
|
props = node_add_menu.add_node_type(layout, "ShaderNodeMix", label="Mix Vector")
|
2025-03-19 10:54:36 +01:00
|
|
|
ops = props.settings.add()
|
|
|
|
|
ops.name = "data_type"
|
|
|
|
|
ops.value = "'VECTOR'"
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeVectorCurve")
|
2025-06-10 15:49:31 +02:00
|
|
|
node_add_menu.add_node_type_with_searchable_enum(context, layout, "ShaderNodeVectorMath", "operation")
|
|
|
|
|
node_add_menu.add_node_type(layout, "ShaderNodeVectorRotate")
|
2023-08-31 16:32:49 +02:00
|
|
|
|
2023-08-24 13:46:11 +02:00
|
|
|
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
|
|
|
|
|
|
|
|
|
|
2023-09-01 23:43:13 +02:00
|
|
|
class NODE_MT_compositor_node_add_all(Menu):
|
|
|
|
|
bl_idname = "NODE_MT_compositor_node_add_all"
|
2023-08-24 13:46:11 +02:00
|
|
|
bl_label = ""
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_input")
|
|
|
|
|
layout.menu("NODE_MT_category_compositor_output")
|
2023-08-24 13:46:11 +02:00
|
|
|
layout.separator()
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_color")
|
|
|
|
|
layout.menu("NODE_MT_category_compositor_filter")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_keying")
|
|
|
|
|
layout.menu("NODE_MT_category_compositor_mask")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_tracking")
|
2023-08-31 16:32:49 +02:00
|
|
|
layout.separator()
|
2025-03-26 16:43:31 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_texture")
|
2025-06-10 15:49:31 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_transform")
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_utilities")
|
|
|
|
|
layout.menu("NODE_MT_category_compositor_vector")
|
2023-08-24 13:46:11 +02:00
|
|
|
layout.separator()
|
2023-09-01 23:43:13 +02:00
|
|
|
layout.menu("NODE_MT_category_compositor_group")
|
2023-09-01 20:46:12 +02:00
|
|
|
layout.menu("NODE_MT_category_layout")
|
2023-08-24 13:46:11 +02:00
|
|
|
|
|
|
|
|
node_add_menu.draw_root_assets(layout)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes = (
|
2023-09-01 23:43:13 +02:00
|
|
|
NODE_MT_compositor_node_add_all,
|
|
|
|
|
NODE_MT_category_compositor_input,
|
|
|
|
|
NODE_MT_category_compositor_input_constant,
|
|
|
|
|
NODE_MT_category_compositor_input_scene,
|
|
|
|
|
NODE_MT_category_compositor_output,
|
|
|
|
|
NODE_MT_category_compositor_color,
|
|
|
|
|
NODE_MT_category_compositor_color_adjust,
|
|
|
|
|
NODE_MT_category_compositor_color_mix,
|
|
|
|
|
NODE_MT_category_compositor_filter,
|
|
|
|
|
NODE_MT_category_compositor_filter_blur,
|
2025-03-26 16:43:31 +02:00
|
|
|
NODE_MT_category_compositor_texture,
|
2023-09-01 23:43:13 +02:00
|
|
|
NODE_MT_category_compositor_keying,
|
|
|
|
|
NODE_MT_category_compositor_mask,
|
|
|
|
|
NODE_MT_category_compositor_tracking,
|
|
|
|
|
NODE_MT_category_compositor_transform,
|
|
|
|
|
NODE_MT_category_compositor_utilities,
|
|
|
|
|
NODE_MT_category_compositor_vector,
|
|
|
|
|
NODE_MT_category_compositor_group,
|
2023-08-24 13:46:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
|
from bpy.utils import register_class
|
|
|
|
|
for cls in classes:
|
|
|
|
|
register_class(cls)
|