本文整理汇总了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