Geometry Nodes: new Material input node
[blender.git] / release / scripts / startup / nodeitems_builtins.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21 import nodeitems_utils
22 from nodeitems_utils import (
23     NodeCategory,
24     NodeItem,
25     NodeItemCustom,
26 )
27
28
29 # Subclasses for standard node types
30
31 class SortedNodeCategory(NodeCategory):
32     def __init__(self, identifier, name, description="", items=None):
33         # for builtin nodes the convention is to sort by name
34         if isinstance(items, list):
35             items = sorted(items, key=lambda item: item.label.lower())
36
37         super().__init__(identifier, name, description, items)
38
39
40 class CompositorNodeCategory(SortedNodeCategory):
41     @classmethod
42     def poll(cls, context):
43         return (context.space_data.type == 'NODE_EDITOR' and
44                 context.space_data.tree_type == 'CompositorNodeTree')
45
46
47 class ShaderNodeCategory(SortedNodeCategory):
48     @classmethod
49     def poll(cls, context):
50         return (context.space_data.type == 'NODE_EDITOR' and
51                 context.space_data.tree_type == 'ShaderNodeTree')
52
53
54 class TextureNodeCategory(SortedNodeCategory):
55     @classmethod
56     def poll(cls, context):
57         return (context.space_data.type == 'NODE_EDITOR' and
58                 context.space_data.tree_type == 'TextureNodeTree')
59
60
61 class GeometryNodeCategory(SortedNodeCategory):
62     @classmethod
63     def poll(cls, context):
64         return (context.space_data.type == 'NODE_EDITOR' and
65                 context.space_data.tree_type == 'GeometryNodeTree')
66
67
68 # menu entry for node group tools
69 def group_tools_draw(self, layout, context):
70     layout.operator("node.group_make")
71     layout.operator("node.group_ungroup")
72     layout.separator()
73
74
75 # maps node tree type to group node type
76 node_tree_group_type = {
77     'CompositorNodeTree': 'CompositorNodeGroup',
78     'ShaderNodeTree': 'ShaderNodeGroup',
79     'TextureNodeTree': 'TextureNodeGroup',
80     'GeometryNodeTree': 'GeometryNodeGroup',
81 }
82
83
84 # generic node group items generator for shader, compositor, geometry and texture node groups
85 def node_group_items(context):
86     if context is None:
87         return
88     space = context.space_data
89     if not space:
90         return
91     ntree = space.edit_tree
92     if not ntree:
93         return
94
95     yield NodeItemCustom(draw=group_tools_draw)
96
97     yield NodeItem("NodeGroupInput", poll=group_input_output_item_poll)
98     yield NodeItem("NodeGroupOutput", poll=group_input_output_item_poll)
99
100     yield NodeItemCustom(draw=lambda self, layout, context: layout.separator())
101
102     def contains_group(nodetree, group):
103         if nodetree == group:
104             return True
105         else:
106             for node in nodetree.nodes:
107                 if node.bl_idname in node_tree_group_type.values() and node.node_tree is not None:
108                     if contains_group(node.node_tree, group):
109                         return True
110         return False
111
112     for group in context.blend_data.node_groups:
113         if group.bl_idname != ntree.bl_idname:
114             continue
115         # filter out recursive groups
116         if contains_group(group, ntree):
117             continue
118         # filter out hidden nodetrees
119         if group.name.startswith('.'):
120             continue
121         yield NodeItem(node_tree_group_type[group.bl_idname],
122                        group.name,
123                        {"node_tree": "bpy.data.node_groups[%r]" % group.name})
124
125
126 # only show input/output nodes inside node groups
127 def group_input_output_item_poll(context):
128     space = context.space_data
129     if space.edit_tree in bpy.data.node_groups.values():
130         return True
131     return False
132
133
134 # only show input/output nodes when editing line style node trees
135 def line_style_shader_nodes_poll(context):
136     snode = context.space_data
137     return (snode.tree_type == 'ShaderNodeTree' and
138             snode.shader_type == 'LINESTYLE')
139
140
141 # only show nodes working in world node trees
142 def world_shader_nodes_poll(context):
143     snode = context.space_data
144     return (snode.tree_type == 'ShaderNodeTree' and
145             snode.shader_type == 'WORLD')
146
147
148 # only show nodes working in object node trees
149 def object_shader_nodes_poll(context):
150     snode = context.space_data
151     return (snode.tree_type == 'ShaderNodeTree' and
152             snode.shader_type == 'OBJECT')
153
154
155 def cycles_shader_nodes_poll(context):
156     return context.engine == 'CYCLES'
157
158
159 def eevee_shader_nodes_poll(context):
160     return context.engine == 'BLENDER_EEVEE'
161
162
163 def eevee_cycles_shader_nodes_poll(context):
164     return (cycles_shader_nodes_poll(context) or
165             eevee_shader_nodes_poll(context))
166
167
168 def object_cycles_shader_nodes_poll(context):
169     return (object_shader_nodes_poll(context) and
170             cycles_shader_nodes_poll(context))
171
172
173 def object_eevee_shader_nodes_poll(context):
174     return (object_shader_nodes_poll(context) and
175             eevee_shader_nodes_poll(context))
176
177
178 def object_eevee_cycles_shader_nodes_poll(context):
179     return (object_shader_nodes_poll(context) and
180             eevee_cycles_shader_nodes_poll(context))
181
182
183 # All standard node categories currently used in nodes.
184
185 shader_node_categories = [
186     # Shader Nodes (Cycles and Eevee)
187     ShaderNodeCategory("SH_NEW_INPUT", "Input", items=[
188         NodeItem("ShaderNodeTexCoord"),
189         NodeItem("ShaderNodeAttribute"),
190         NodeItem("ShaderNodeLightPath"),
191         NodeItem("ShaderNodeFresnel"),
192         NodeItem("ShaderNodeLayerWeight"),
193         NodeItem("ShaderNodeRGB"),
194         NodeItem("ShaderNodeValue"),
195         NodeItem("ShaderNodeTangent"),
196         NodeItem("ShaderNodeNewGeometry"),
197         NodeItem("ShaderNodeWireframe"),
198         NodeItem("ShaderNodeBevel"),
199         NodeItem("ShaderNodeAmbientOcclusion"),
200         NodeItem("ShaderNodeObjectInfo"),
201         NodeItem("ShaderNodeHairInfo"),
202         NodeItem("ShaderNodeVolumeInfo"),
203         NodeItem("ShaderNodeParticleInfo"),
204         NodeItem("ShaderNodeCameraData"),
205         NodeItem("ShaderNodeUVMap"),
206         NodeItem("ShaderNodeVertexColor"),
207         NodeItem("ShaderNodeUVAlongStroke", poll=line_style_shader_nodes_poll),
208     ]),
209     ShaderNodeCategory("SH_NEW_OUTPUT", "Output", items=[
210         NodeItem("ShaderNodeOutputMaterial", poll=object_eevee_cycles_shader_nodes_poll),
211         NodeItem("ShaderNodeOutputLight", poll=object_cycles_shader_nodes_poll),
212         NodeItem("ShaderNodeOutputAOV"),
213         NodeItem("ShaderNodeOutputWorld", poll=world_shader_nodes_poll),
214         NodeItem("ShaderNodeOutputLineStyle", poll=line_style_shader_nodes_poll),
215     ]),
216     ShaderNodeCategory("SH_NEW_SHADER", "Shader", items=[
217         NodeItem("ShaderNodeMixShader", poll=eevee_cycles_shader_nodes_poll),
218         NodeItem("ShaderNodeAddShader", poll=eevee_cycles_shader_nodes_poll),
219         NodeItem("ShaderNodeBsdfDiffuse", poll=object_eevee_cycles_shader_nodes_poll),
220         NodeItem("ShaderNodeBsdfPrincipled", poll=object_eevee_cycles_shader_nodes_poll),
221         NodeItem("ShaderNodeBsdfGlossy", poll=object_eevee_cycles_shader_nodes_poll),
222         NodeItem("ShaderNodeBsdfTransparent", poll=object_eevee_cycles_shader_nodes_poll),
223         NodeItem("ShaderNodeBsdfRefraction", poll=object_eevee_cycles_shader_nodes_poll),
224         NodeItem("ShaderNodeBsdfGlass", poll=object_eevee_cycles_shader_nodes_poll),
225         NodeItem("ShaderNodeBsdfTranslucent", poll=object_eevee_cycles_shader_nodes_poll),
226         NodeItem("ShaderNodeBsdfAnisotropic", poll=object_cycles_shader_nodes_poll),
227         NodeItem("ShaderNodeBsdfVelvet", poll=object_cycles_shader_nodes_poll),
228         NodeItem("ShaderNodeBsdfToon", poll=object_cycles_shader_nodes_poll),
229         NodeItem("ShaderNodeSubsurfaceScattering", poll=object_eevee_cycles_shader_nodes_poll),
230         NodeItem("ShaderNodeEmission", poll=eevee_cycles_shader_nodes_poll),
231         NodeItem("ShaderNodeBsdfHair", poll=object_cycles_shader_nodes_poll),
232         NodeItem("ShaderNodeBackground", poll=world_shader_nodes_poll),
233         NodeItem("ShaderNodeHoldout", poll=object_eevee_cycles_shader_nodes_poll),
234         NodeItem("ShaderNodeVolumeAbsorption", poll=eevee_cycles_shader_nodes_poll),
235         NodeItem("ShaderNodeVolumeScatter", poll=eevee_cycles_shader_nodes_poll),
236         NodeItem("ShaderNodeVolumePrincipled"),
237         NodeItem("ShaderNodeEeveeSpecular", poll=object_eevee_shader_nodes_poll),
238         NodeItem("ShaderNodeBsdfHairPrincipled", poll=object_cycles_shader_nodes_poll)
239     ]),
240     ShaderNodeCategory("SH_NEW_TEXTURE", "Texture", items=[
241         NodeItem("ShaderNodeTexImage"),
242         NodeItem("ShaderNodeTexEnvironment"),
243         NodeItem("ShaderNodeTexSky"),
244         NodeItem("ShaderNodeTexNoise"),
245         NodeItem("ShaderNodeTexWave"),
246         NodeItem("ShaderNodeTexVoronoi"),
247         NodeItem("ShaderNodeTexMusgrave"),
248         NodeItem("ShaderNodeTexGradient"),
249         NodeItem("ShaderNodeTexMagic"),
250         NodeItem("ShaderNodeTexChecker"),
251         NodeItem("ShaderNodeTexBrick"),
252         NodeItem("ShaderNodeTexPointDensity"),
253         NodeItem("ShaderNodeTexIES"),
254         NodeItem("ShaderNodeTexWhiteNoise"),
255     ]),
256     ShaderNodeCategory("SH_NEW_OP_COLOR", "Color", items=[
257         NodeItem("ShaderNodeMixRGB"),
258         NodeItem("ShaderNodeRGBCurve"),
259         NodeItem("ShaderNodeInvert"),
260         NodeItem("ShaderNodeLightFalloff"),
261         NodeItem("ShaderNodeHueSaturation"),
262         NodeItem("ShaderNodeGamma"),
263         NodeItem("ShaderNodeBrightContrast"),
264     ]),
265     ShaderNodeCategory("SH_NEW_OP_VECTOR", "Vector", items=[
266         NodeItem("ShaderNodeMapping"),
267         NodeItem("ShaderNodeBump"),
268         NodeItem("ShaderNodeDisplacement"),
269         NodeItem("ShaderNodeVectorDisplacement"),
270         NodeItem("ShaderNodeNormalMap"),
271         NodeItem("ShaderNodeNormal"),
272         NodeItem("ShaderNodeVectorCurve"),
273         NodeItem("ShaderNodeVectorRotate"),
274         NodeItem("ShaderNodeVectorTransform"),
275     ]),
276     ShaderNodeCategory("SH_NEW_CONVERTOR", "Converter", items=[
277         NodeItem("ShaderNodeMapRange"),
278         NodeItem("ShaderNodeClamp"),
279         NodeItem("ShaderNodeMath"),
280         NodeItem("ShaderNodeValToRGB"),
281         NodeItem("ShaderNodeRGBToBW"),
282         NodeItem("ShaderNodeShaderToRGB", poll=object_eevee_shader_nodes_poll),
283         NodeItem("ShaderNodeVectorMath"),
284         NodeItem("ShaderNodeSeparateRGB"),
285         NodeItem("ShaderNodeCombineRGB"),
286         NodeItem("ShaderNodeSeparateXYZ"),
287         NodeItem("ShaderNodeCombineXYZ"),
288         NodeItem("ShaderNodeSeparateHSV"),
289         NodeItem("ShaderNodeCombineHSV"),
290         NodeItem("ShaderNodeWavelength"),
291         NodeItem("ShaderNodeBlackbody"),
292     ]),
293     ShaderNodeCategory("SH_NEW_SCRIPT", "Script", items=[
294         NodeItem("ShaderNodeScript"),
295     ]),
296     ShaderNodeCategory("SH_NEW_GROUP", "Group", items=node_group_items),
297     ShaderNodeCategory("SH_NEW_LAYOUT", "Layout", items=[
298         NodeItem("NodeFrame"),
299         NodeItem("NodeReroute"),
300     ]),
301 ]
302
303 compositor_node_categories = [
304     # Compositor Nodes
305     CompositorNodeCategory("CMP_INPUT", "Input", items=[
306         NodeItem("CompositorNodeRLayers"),
307         NodeItem("CompositorNodeImage"),
308         NodeItem("CompositorNodeMovieClip"),
309         NodeItem("CompositorNodeMask"),
310         NodeItem("CompositorNodeRGB"),
311         NodeItem("CompositorNodeValue"),
312         NodeItem("CompositorNodeTexture"),
313         NodeItem("CompositorNodeBokehImage"),
314         NodeItem("CompositorNodeTime"),
315         NodeItem("CompositorNodeTrackPos"),
316     ]),
317     CompositorNodeCategory("CMP_OUTPUT", "Output", items=[
318         NodeItem("CompositorNodeComposite"),
319         NodeItem("CompositorNodeViewer"),
320         NodeItem("CompositorNodeSplitViewer"),
321         NodeItem("CompositorNodeOutputFile"),
322         NodeItem("CompositorNodeLevels"),
323     ]),
324     CompositorNodeCategory("CMP_OP_COLOR", "Color", items=[
325         NodeItem("CompositorNodeMixRGB"),
326         NodeItem("CompositorNodeAlphaOver"),
327         NodeItem("CompositorNodeInvert"),
328         NodeItem("CompositorNodeCurveRGB"),
329         NodeItem("CompositorNodeHueSat"),
330         NodeItem("CompositorNodeColorBalance"),
331         NodeItem("CompositorNodeHueCorrect"),
332         NodeItem("CompositorNodeBrightContrast"),
333         NodeItem("CompositorNodeGamma"),
334         NodeItem("CompositorNodeExposure"),
335         NodeItem("CompositorNodeColorCorrection"),
336         NodeItem("CompositorNodeTonemap"),
337         NodeItem("CompositorNodeZcombine"),
338     ]),
339     CompositorNodeCategory("CMP_CONVERTOR", "Converter", items=[
340         NodeItem("CompositorNodeMath"),
341         NodeItem("CompositorNodeValToRGB"),
342         NodeItem("CompositorNodeSetAlpha"),
343         NodeItem("CompositorNodePremulKey"),
344         NodeItem("CompositorNodeIDMask"),
345         NodeItem("CompositorNodeRGBToBW"),
346         NodeItem("CompositorNodeSepRGBA"),
347         NodeItem("CompositorNodeCombRGBA"),
348         NodeItem("CompositorNodeSepHSVA"),
349         NodeItem("CompositorNodeCombHSVA"),
350         NodeItem("CompositorNodeSepYUVA"),
351         NodeItem("CompositorNodeCombYUVA"),
352         NodeItem("CompositorNodeSepYCCA"),
353         NodeItem("CompositorNodeCombYCCA"),
354         NodeItem("CompositorNodeSwitchView"),
355     ]),
356     CompositorNodeCategory("CMP_OP_FILTER", "Filter", items=[
357         NodeItem("CompositorNodeBlur"),
358         NodeItem("CompositorNodeBilateralblur"),
359         NodeItem("CompositorNodeDilateErode"),
360         NodeItem("CompositorNodeDespeckle"),
361         NodeItem("CompositorNodeFilter"),
362         NodeItem("CompositorNodeBokehBlur"),
363         NodeItem("CompositorNodeVecBlur"),
364         NodeItem("CompositorNodeDefocus"),
365         NodeItem("CompositorNodeGlare"),
366         NodeItem("CompositorNodeInpaint"),
367         NodeItem("CompositorNodeDBlur"),
368         NodeItem("CompositorNodePixelate"),
369         NodeItem("CompositorNodeSunBeams"),
370         NodeItem("CompositorNodeDenoise"),
371         NodeItem("CompositorNodeAntiAliasing"),
372     ]),
373     CompositorNodeCategory("CMP_OP_VECTOR", "Vector", items=[
374         NodeItem("CompositorNodeNormal"),
375         NodeItem("CompositorNodeMapValue"),
376         NodeItem("CompositorNodeMapRange"),
377         NodeItem("CompositorNodeNormalize"),
378         NodeItem("CompositorNodeCurveVec"),
379     ]),
380     CompositorNodeCategory("CMP_MATTE", "Matte", items=[
381         NodeItem("CompositorNodeKeying"),
382         NodeItem("CompositorNodeKeyingScreen"),
383         NodeItem("CompositorNodeChannelMatte"),
384         NodeItem("CompositorNodeColorSpill"),
385         NodeItem("CompositorNodeBoxMask"),
386         NodeItem("CompositorNodeEllipseMask"),
387         NodeItem("CompositorNodeLumaMatte"),
388         NodeItem("CompositorNodeDiffMatte"),
389         NodeItem("CompositorNodeDistanceMatte"),
390         NodeItem("CompositorNodeChromaMatte"),
391         NodeItem("CompositorNodeColorMatte"),
392         NodeItem("CompositorNodeDoubleEdgeMask"),
393         NodeItem("CompositorNodeCryptomatte"),
394         NodeItem("CompositorNodeCryptomatteV2"),
395     ]),
396     CompositorNodeCategory("CMP_DISTORT", "Distort", items=[
397         NodeItem("CompositorNodeScale"),
398         NodeItem("CompositorNodeLensdist"),
399         NodeItem("CompositorNodeMovieDistortion"),
400         NodeItem("CompositorNodeTranslate"),
401         NodeItem("CompositorNodeRotate"),
402         NodeItem("CompositorNodeFlip"),
403         NodeItem("CompositorNodeCrop"),
404         NodeItem("CompositorNodeDisplace"),
405         NodeItem("CompositorNodeMapUV"),
406         NodeItem("CompositorNodeTransform"),
407         NodeItem("CompositorNodeStabilize"),
408         NodeItem("CompositorNodePlaneTrackDeform"),
409         NodeItem("CompositorNodeCornerPin"),
410     ]),
411     CompositorNodeCategory("CMP_GROUP", "Group", items=node_group_items),
412     CompositorNodeCategory("CMP_LAYOUT", "Layout", items=[
413         NodeItem("NodeFrame"),
414         NodeItem("NodeReroute"),
415         NodeItem("CompositorNodeSwitch"),
416     ]),
417 ]
418
419 texture_node_categories = [
420     # Texture Nodes
421     TextureNodeCategory("TEX_INPUT", "Input", items=[
422         NodeItem("TextureNodeCurveTime"),
423         NodeItem("TextureNodeCoordinates"),
424         NodeItem("TextureNodeTexture"),
425         NodeItem("TextureNodeImage"),
426     ]),
427     TextureNodeCategory("TEX_OUTPUT", "Output", items=[
428         NodeItem("TextureNodeOutput"),
429         NodeItem("TextureNodeViewer"),
430     ]),
431     TextureNodeCategory("TEX_OP_COLOR", "Color", items=[
432         NodeItem("TextureNodeMixRGB"),
433         NodeItem("TextureNodeCurveRGB"),
434         NodeItem("TextureNodeInvert"),
435         NodeItem("TextureNodeHueSaturation"),
436         NodeItem("TextureNodeCompose"),
437         NodeItem("TextureNodeDecompose"),
438     ]),
439     TextureNodeCategory("TEX_PATTERN", "Pattern", items=[
440         NodeItem("TextureNodeChecker"),
441         NodeItem("TextureNodeBricks"),
442     ]),
443     TextureNodeCategory("TEX_TEXTURE", "Textures", items=[
444         NodeItem("TextureNodeTexNoise"),
445         NodeItem("TextureNodeTexDistNoise"),
446         NodeItem("TextureNodeTexClouds"),
447         NodeItem("TextureNodeTexBlend"),
448         NodeItem("TextureNodeTexVoronoi"),
449         NodeItem("TextureNodeTexMagic"),
450         NodeItem("TextureNodeTexMarble"),
451         NodeItem("TextureNodeTexWood"),
452         NodeItem("TextureNodeTexMusgrave"),
453         NodeItem("TextureNodeTexStucci"),
454     ]),
455     TextureNodeCategory("TEX_CONVERTOR", "Converter", items=[
456         NodeItem("TextureNodeMath"),
457         NodeItem("TextureNodeValToRGB"),
458         NodeItem("TextureNodeRGBToBW"),
459         NodeItem("TextureNodeValToNor"),
460         NodeItem("TextureNodeDistance"),
461     ]),
462     TextureNodeCategory("TEX_DISTORT", "Distort", items=[
463         NodeItem("TextureNodeScale"),
464         NodeItem("TextureNodeTranslate"),
465         NodeItem("TextureNodeRotate"),
466         NodeItem("TextureNodeAt"),
467     ]),
468     TextureNodeCategory("TEX_GROUP", "Group", items=node_group_items),
469     TextureNodeCategory("TEX_LAYOUT", "Layout", items=[
470         NodeItem("NodeFrame"),
471         NodeItem("NodeReroute"),
472     ]),
473 ]
474
475
476 def not_implemented_node(idname):
477     NodeType = getattr(bpy.types, idname)
478     name = NodeType.bl_rna.name
479     label = "%s (mockup)" % name
480     return NodeItem(idname, label=label)
481
482
483 geometry_node_categories = [
484     # Geometry Nodes
485     GeometryNodeCategory("GEO_ATTRIBUTE", "Attribute", items=[
486         NodeItem("GeometryNodeAttributeRandomize"),
487         NodeItem("GeometryNodeAttributeMath"),
488         NodeItem("GeometryNodeAttributeClamp"),
489         NodeItem("GeometryNodeAttributeCompare"),
490         NodeItem("GeometryNodeAttributeConvert"),
491         NodeItem("GeometryNodeAttributeCurveMap"),
492         NodeItem("GeometryNodeAttributeFill"),
493         NodeItem("GeometryNodeAttributeMix"),
494         NodeItem("GeometryNodeAttributeProximity"),
495         NodeItem("GeometryNodeAttributeColorRamp"),
496         NodeItem("GeometryNodeAttributeVectorMath"),
497         NodeItem("GeometryNodeAttributeVectorRotate"),
498         NodeItem("GeometryNodeAttributeSampleTexture"),
499         NodeItem("GeometryNodeAttributeCombineXYZ"),
500         NodeItem("GeometryNodeAttributeSeparateXYZ"),
501         NodeItem("GeometryNodeAttributeRemove"),
502         NodeItem("GeometryNodeAttributeMapRange"),
503         NodeItem("GeometryNodeAttributeTransfer"),
504     ]),
505     GeometryNodeCategory("GEO_COLOR", "Color", items=[
506         NodeItem("ShaderNodeValToRGB"),
507         NodeItem("ShaderNodeSeparateRGB"),
508         NodeItem("ShaderNodeCombineRGB"),
509     ]),
510     GeometryNodeCategory("GEO_CURVE", "Curve", items=[
511         NodeItem("GeometryNodeCurveToMesh"),
512         NodeItem("GeometryNodeCurveResample"),
513     ]),
514     GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=[
515         NodeItem("GeometryNodeBoundBox"),
516         NodeItem("GeometryNodeTransform"),
517         NodeItem("GeometryNodeJoinGeometry"),
518     ]),
519     GeometryNodeCategory("GEO_INPUT", "Input", items=[
520         NodeItem("GeometryNodeObjectInfo"),
521         NodeItem("GeometryNodeCollectionInfo"),
522         NodeItem("FunctionNodeRandomFloat"),
523         NodeItem("ShaderNodeValue"),
524         NodeItem("FunctionNodeInputString"),
525         NodeItem("FunctionNodeInputVector"),
526         NodeItem("GeometryNodeInputMaterial"),
527         NodeItem("GeometryNodeIsViewport"),
528     ]),
529     GeometryNodeCategory("GEO_MATERIAL", "Material", items=[
530         NodeItem("GeometryNodeMaterialAssign"),
531     ]),
532     GeometryNodeCategory("GEO_MESH", "Mesh", items=[
533         NodeItem("GeometryNodeBoolean"),
534         NodeItem("GeometryNodeTriangulate"),
535         NodeItem("GeometryNodeEdgeSplit"),
536         NodeItem("GeometryNodeSubdivisionSurface"),
537         NodeItem("GeometryNodeSubdivide"),
538     ]),
539     GeometryNodeCategory("GEO_PRIMITIVES", "Mesh Primitives", items=[
540         NodeItem("GeometryNodeMeshCircle"),
541         NodeItem("GeometryNodeMeshCone"),
542         NodeItem("GeometryNodeMeshCube"),
543         NodeItem("GeometryNodeMeshCylinder"),
544         NodeItem("GeometryNodeMeshGrid"),
545         NodeItem("GeometryNodeMeshIcoSphere"),
546         NodeItem("GeometryNodeMeshLine"),
547         NodeItem("GeometryNodeMeshUVSphere"),
548     ]),
549     GeometryNodeCategory("GEO_POINT", "Point", items=[
550         NodeItem("GeometryNodePointDistribute"),
551         NodeItem("GeometryNodePointInstance"),
552         NodeItem("GeometryNodePointSeparate"),
553         NodeItem("GeometryNodePointScale"),
554         NodeItem("GeometryNodePointTranslate"),
555         NodeItem("GeometryNodeRotatePoints"),
556         NodeItem("GeometryNodeAlignRotationToVector"),
557     ]),
558     GeometryNodeCategory("GEO_UTILITIES", "Utilities", items=[
559         NodeItem("ShaderNodeMapRange"),
560         NodeItem("ShaderNodeClamp"),
561         NodeItem("ShaderNodeMath"),
562         NodeItem("FunctionNodeBooleanMath"),
563         NodeItem("FunctionNodeFloatCompare"),
564         NodeItem("GeometryNodeSwitch"),
565     ]),
566     GeometryNodeCategory("GEO_VECTOR", "Vector", items=[
567         NodeItem("ShaderNodeSeparateXYZ"),
568         NodeItem("ShaderNodeCombineXYZ"),
569         NodeItem("ShaderNodeVectorMath"),
570         NodeItem("ShaderNodeVectorRotate"),
571     ]),
572     GeometryNodeCategory("GEO_VOLUME", "Volume", items=[
573         NodeItem("GeometryNodePointsToVolume"),
574         NodeItem("GeometryNodeVolumeToMesh"),
575     ]),
576     GeometryNodeCategory("GEO_GROUP", "Group", items=node_group_items),
577     GeometryNodeCategory("GEO_LAYOUT", "Layout", items=[
578         NodeItem("NodeFrame"),
579         NodeItem("NodeReroute"),
580     ]),
581 ]
582
583
584 def register():
585     nodeitems_utils.register_node_categories('SHADER', shader_node_categories)
586     nodeitems_utils.register_node_categories('COMPOSITING', compositor_node_categories)
587     nodeitems_utils.register_node_categories('TEXTURE', texture_node_categories)
588     nodeitems_utils.register_node_categories('GEOMETRY', geometry_node_categories)
589
590
591 def unregister():
592     nodeitems_utils.unregister_node_categories('SHADER')
593     nodeitems_utils.unregister_node_categories('COMPOSITING')
594     nodeitems_utils.unregister_node_categories('TEXTURE')
595     nodeitems_utils.unregister_node_categories('GEOMETRY')
596
597
598 if __name__ == "__main__":
599     register()