當前位置: 首頁>>代碼示例>>Python>>正文


Python types.Node方法代碼示例

本文整理匯總了Python中bpy.types.Node方法的典型用法代碼示例。如果您正苦於以下問題:Python types.Node方法的具體用法?Python types.Node怎麽用?Python types.Node使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bpy.types的用法示例。


在下文中一共展示了types.Node方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: poll

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def poll(cls, ntree):
        return ntree.bl_idname == 'CustomTreeType'


# Derived from the Node base type. 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:7,代碼來源:custom_nodes.py

示例2: draw_buttons

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def draw_buttons(self, context, layout):
        layout.label("Node settings")
        layout.prop(self, "myFloatProperty")

    # Detail buttons in the sidebar.
    # If this function is not defined, the draw_buttons function is used instead 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:8,代碼來源:custom_nodes.py

示例3: draw_label

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def draw_label(self):
        return "I am a custom node"


### Node Categories ###
# Node categories are a python system for automatically
# extending the Add menu, toolbar panels and search operator.
# For more examples see release/scripts/startup/nodeitems_builtins.py 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:10,代碼來源:custom_nodes.py

示例4: poll

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def poll(cls, ntree):
        b = False
        if ntree.bl_idname == 'ShaderNodeTree':
            b = True
        return b

# Derived from the Node base type 
開發者ID:blenderskool,項目名稱:kaleidoscope,代碼行數:9,代碼來源:__init__.py

示例5: draw_buttons

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def draw_buttons(self, context, layout):
        col = layout.column(align=True)
        col.label()
        col.label(text="Kaleidoscope Hybrid is just a")
        col.label(text="quick node to choose the nodes")
        col.label(text="that come with Kaleidoscope.")
        col.label()
        col.label(text="Select any one of the option to")
        col.label(text="to use the node that comes with")
        col.label(text="Kaleidoscope")
        col.label()
        row = col.row(align=True)
        row.prop(self, 'node_type', expand = True)

    #Node Label 
開發者ID:blenderskool,項目名稱:kaleidoscope,代碼行數:17,代碼來源:__init__.py

示例6: draw_buttons

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def draw_buttons(self, context, layout):
        SpectrumPaletteUI(self, context, layout)

    #Node Label 
開發者ID:blenderskool,項目名稱:kaleidoscope,代碼行數:6,代碼來源:spectrum.py

示例7: poll

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def poll(cls, ntree):
        b = False
        if ntree.bl_idname == 'ShaderNodeTree':
            b = True
        return b

# Derived from the Node base type. 
開發者ID:blenderskool,項目名稱:kaleidoscope,代碼行數:9,代碼來源:intensity.py

示例8: init

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def init(self, context):
        self.inputs.new('ArmNodeSocketAction', 'In')
        self.inputs.new('NodeSocketShader', 'Material')
        self.inputs.new('NodeSocketString', 'Node')
        self.inputs.new('NodeSocketColor', 'Color')
        self.outputs.new('ArmNodeSocketAction', 'Out') 
開發者ID:armory3d,項目名稱:armory,代碼行數:8,代碼來源:action_set_material_rgb_param.py

示例9: init

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def init(self, context):
        self.inputs.new('ArmNodeSocketAction', 'In')
        self.inputs.new('NodeSocketShader', 'Material')
        self.inputs.new('NodeSocketString', 'Node')
        self.inputs.new('NodeSocketFloat', 'Value')
        self.outputs.new('ArmNodeSocketAction', 'Out') 
開發者ID:armory3d,項目名稱:armory,代碼行數:8,代碼來源:action_set_material_value_param.py

示例10: init

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def init(self, context):
        self.inputs.new('ArmNodeSocketAction', 'In')
        self.inputs.new('NodeSocketShader', 'Material')
        self.inputs.new('NodeSocketString', 'Node')
        self.inputs.new('NodeSocketString', 'Image')
        self.outputs.new('ArmNodeSocketAction', 'Out') 
開發者ID:armory3d,項目名稱:armory,代碼行數:8,代碼來源:action_set_material_image_param.py

示例11: draw_label

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def draw_label(self):
        return "Data Node" 
開發者ID:Chasvortex,項目名稱:caffe-gui-tool,代碼行數:4,代碼來源:CGTNodes.py

示例12: draw_buttons

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def draw_buttons(self, context, layout):
        super().draw_buttons(context, layout)
        layout.prop(self, "prop_tree")
        if (not self.prop_tree == None):
            layout.prop_search(self, "prop_node", self.prop_tree, "nodes", text="Node") 
開發者ID:aachman98,項目名稱:Sorcar,代碼行數:7,代碼來源:ScSendToSverchok.py

示例13: set_color_ramp

# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def set_color_ramp(self):
    """Set the Colors from the Palette to a ColorRamp node"""
    kaleidoscope_spectrum_props=bpy.context.scene.kaleidoscope_spectrum_props
    ramp = None
    ramp_world = None
    if kaleidoscope_spectrum_props.assign_colorramp_world == True:
        try:
            try:
                ramp_world = bpy.context.scene.world.node_tree.nodes[kaleidoscope_spectrum_props.colorramp_world_name].color_ramp
            except:
                if kaleidoscope_spectrum_props.assign_colorramp_world == True:
                    try:
                        self.report({'WARNING'}, "There is Not a Valid ColorRamp Node in the World Material")
                    except AttributeError:
                        pass
            if kaleidoscope_spectrum_props.colorramp_world_name != "" and kaleidoscope_spectrum_props.assign_colorramp_world == True:
                try:
                    for i in range(0, len(ramp_world.elements)):
                            if kaleidoscope_spectrum_props.assign_colorramp_world == True:
                                exec("ramp_world.elements["+str(i)+"].color[0] = kaleidoscope_spectrum_props.color"+str(i+1)+"[0]")
                                exec("ramp_world.elements["+str(i)+"].color[1] = kaleidoscope_spectrum_props.color"+str(i+1)+"[1]")
                                exec("ramp_world.elements["+str(i)+"].color[2] = kaleidoscope_spectrum_props.color"+str(i+1)+"[2]")
                                ramp_world.elements[0].color[3] = 1.0
                except:
                    pass
        except:
            pass

    for mat in bpy.data.materials:
        spectrum_active = mat.kaleidoscope_spectrum_props
        if spectrum_active.assign_colorramp == True and spectrum_active.colorramp_name != "":
            try:
                if spectrum_active is not None:
                    ramp = mat.node_tree.nodes[spectrum_active.colorramp_name].color_ramp
            except:
                if spectrum_active.assign_colorramp == True:
                    try:
                        self.report({'WARNING'}, "There is Not a Valid ColorRamp Node in '"+mat.name+"'")
                    except AttributeError:
                        pass
            if spectrum_active.colorramp_name != "" and spectrum_active.assign_colorramp == True:
                try:
                    for i in range(0, len(ramp.elements)):
                            if spectrum_active.assign_colorramp == True:
                                exec("ramp.elements["+str(i)+"].color[0] = kaleidoscope_spectrum_props.color"+str(i+1)+"[0]")
                                exec("ramp.elements["+str(i)+"].color[1] = kaleidoscope_spectrum_props.color"+str(i+1)+"[1]")
                                exec("ramp.elements["+str(i)+"].color[2] = kaleidoscope_spectrum_props.color"+str(i+1)+"[2]")
                                ramp.elements[0].color[3] = 1.0
                except:
                    pass 
開發者ID:blenderskool,項目名稱:kaleidoscope,代碼行數:52,代碼來源:spectrum.py


注:本文中的bpy.types.Node方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。