利用者:Phonybone/Python Nodes/API changes

提供: wiki
< 利用者:Phonybone‎ | Python Nodes
2018年6月29日 (金) 05:53時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Changes in the bpy Python API by the pynodes branch

  • Node identifiers have been changed. A node type now uses the same identifier string as the associated RNA type, instead of the upper-case enum identifiers. These strings are used when adding trees, nodes or sockets using bpy.data.node_groups.new, nodetree.nodes.new or node.inputs.new/node.outputs.new respectively.
Examples:
Node Trees:
bpy.data.node_groups.new('SHADER') -> bpy.data.node_groups.new('ShaderNodeTree')
Nodes:
nodetree.nodes.new(type='OUTPUT_MATERIAL') -> nodetree.nodes.new(type='ShaderNodeOutputMaterial')
nodetree.nodes.new(type='BSDF_GLASS') -> nodetree.nodes.new(type='ShaderNodeBsdfGlass')
nodetree.nodes.new(type='PIXELATE') -> nodetree.nodes.new(type='CompositorNodePixelate')
WARNING!
The node.type property still returns the old enum identifiers. This is necessary for compatibility scripts, but using the 'type' property is generally discouraged. To get the actual identifier of a node type use node.bl_idname