本文整理匯總了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.
示例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
示例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
示例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
示例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
示例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
示例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.
示例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')
示例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')
示例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')
示例11: draw_label
# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import Node [as 別名]
def draw_label(self):
return "Data Node"
示例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")
示例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