Ejemplo n.º 1
0
def register():
    bpy.utils.register_class(NMSShader)
    newcatlist = [
        ShaderNewNodeCategory("SH_NEW_CUSTOM",
                              "NMS Shader",
                              items=[NodeItem("NMSShader")])
    ]
    register_node_categories("NMS_SHADER", newcatlist)
Ejemplo n.º 2
0
def register():
    bpy.utils.register_class(DynamicMathsExpressionNode)
    newcatlist = [
        ShaderNewNodeCategory("SH_NEW_CUSTOM",
                              "Custom Nodes",
                              items=[
                                  NodeItem("DynamicMathsExpressionNode"),
                              ]),
    ]
    register_node_categories("CUSTOM_NODES", newcatlist)
Ejemplo n.º 3
0
def node_menu_exclude(catid, catname, node):
    index, ident, cat, mt, pt = getCategory(catid, catname)
    if cat:
        itemslist = list(cat.items(context=None))
        for i in itemslist:
            if i.nodetype == node.bl_name:
                itemslist.remove(i)
        delCat(catid, catname)
    if itemslist:
        category = ShaderNewNodeCategory(catid, catname, items=itemslist)
        addCat(category, index=index)
Ejemplo n.º 4
0
def node_menu_include(catid, catname, node):
    index, ident, cat, mt, pt = getCategory(catid, catname)
    if cat:
        itemslist = list(cat.items(context=None))
        for item in itemslist:
            if item.nodetype == node.bl_name:
                return
        itemslist.append(NodeItem(node.bl_name))
        delCat(catid, catname)
    else:
        itemslist = [NodeItem(node.bl_name)]
    category = ShaderNewNodeCategory(catid, catname, items=itemslist)
    addCat(category, index=index)
Ejemplo n.º 5
0
        znode.outputs["Total"].default_value = total
        znode.userTotalProperty = total


myNewMenuCategory = {
    "SH_NEW_INPUT":
    ShaderNewNodeCategory("SH_NEW_INPUT", "Input", items=[
        NodeItem("ShaderNodeTexCoord"),
        NodeItem("ShaderNodeAttribute"),
        NodeItem("ShaderNodeLightPath"),
        NodeItem("ShaderNodeFresnel"),
        NodeItem("ShaderNodeLayerWeight"),
        NodeItem("ShaderNodeRGB"),
        NodeItem("ShaderNodeValue"),
        NodeItem("ShaderNodeTangent"),
        NodeItem("ShaderNodeNewGeometry"),
        NodeItem("ShaderNodeWireframe"),
        NodeItem("ShaderNodeObjectInfo"),
        NodeItem("ShaderNodeHairInfo"),
        NodeItem("ShaderNodeParticleInfo"),
        NodeItem("ShaderNodeCameraData"),
        NodeItem("ShaderNodeUVMap"),
        NodeItem("ShaderNodeUVAlongStroke", poll=nodeitems_builtins.line_style_shader_nodes_poll),
        NodeItem("NodeGroupInput", poll=nodeitems_builtins.group_input_output_item_poll),
        NodeItem("ShaderNodeObjectIndexer"),
    ]), }


def registerMenu():
    # remove, replace, add back the menu
    nodeitems_builtins.unregister()
Ejemplo n.º 6
0
                               NodeItem("GenericNoteNode"),
                               NodeItem("CompositorNodeSwitch"),
                           ]),
    "TEX_LAYOUT":
    TextureNodeCategory("TEX_LAYOUT",
                        "Layout",
                        items=[
                            NodeItem("NodeFrame"),
                            NodeItem("NodeReroute"),
                            NodeItem("GenericNoteNode"),
                        ]),
    "SH_NEW_LAYOUT":
    ShaderNewNodeCategory("SH_NEW_LAYOUT",
                          "Layout",
                          items=[
                              NodeItem("NodeFrame"),
                              NodeItem("NodeReroute"),
                              NodeItem("GenericNoteNode"),
                          ]),
    "SH_LAYOUT":
    ShaderOldNodeCategory("SH_LAYOUT",
                          "Layout",
                          items=[
                              NodeItem("NodeFrame"),
                              NodeItem("NodeReroute"),
                              NodeItem("GenericNoteNode"),
                          ])
}
"""
Really prefer there would be an interface for this instead of
patching this in as done here. Also happy for suggestions for