Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-06-27 07:05:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-27 07:05:19 +0400
commit2085a42e52f5b0d18a4516af15132d112b11a8c1 (patch)
tree1cc22295204861157183fe73a6220734e25c6f42 /release/scripts/startup/nodeitems_builtins.py
parentbb42703ea34e539e441dd90f5cbba16599e91506 (diff)
pep8 cleanup
Diffstat (limited to 'release/scripts/startup/nodeitems_builtins.py')
-rw-r--r--release/scripts/startup/nodeitems_builtins.py74
1 files changed, 41 insertions, 33 deletions
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index fe9e06301f3..af966fa106e 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -27,19 +27,22 @@ from nodeitems_utils import NodeCategory, NodeItem, NodeItemCustom
class CompositorNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
- return context.space_data.tree_type == 'CompositorNodeTree'
+ return (context.space_data.tree_type == 'CompositorNodeTree')
+
class ShaderNewNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
- return context.space_data.tree_type == 'ShaderNodeTree' and \
- context.scene.render.use_shading_nodes
+ return (context.space_data.tree_type == 'ShaderNodeTree' and
+ context.scene.render.use_shading_nodes)
+
class ShaderOldNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
- return context.space_data.tree_type == 'ShaderNodeTree' and \
- not context.scene.render.use_shading_nodes
+ return (context.space_data.tree_type == 'ShaderNodeTree' and
+ not context.scene.render.use_shading_nodes)
+
class TextureNodeCategory(NodeCategory):
@classmethod
@@ -54,10 +57,12 @@ def group_make_draw(self, layout, context):
# maps node tree type to group node type
node_tree_group_type = {
- 'CompositorNodeTree' : 'CompositorNodeGroup',
- 'ShaderNodeTree' : 'ShaderNodeGroup',
- 'TextureNodeTree' : 'TextureNodeGroup',
+ 'CompositorNodeTree': 'CompositorNodeGroup',
+ 'ShaderNodeTree': 'ShaderNodeGroup',
+ 'TextureNodeTree': 'TextureNodeGroup',
}
+
+
# generic node group items generator for shader, compositor and texture node groups
def node_group_items(context):
space = context.space_data
@@ -86,7 +91,10 @@ def node_group_items(context):
if contains_group(group, ntree):
continue
- yield NodeItem(node_tree_group_type[group.bl_idname], group.name, { "node_tree" : "bpy.data.node_groups[%r]" % group.name })
+ yield NodeItem(node_tree_group_type[group.bl_idname],
+ group.name,
+ {"node_tree": "bpy.data.node_groups[%r]" % group.name})
+
# only show input/output nodes inside node groups
def group_input_output_item_poll(context):
@@ -231,8 +239,8 @@ shader_node_categories = [
]
compositor_node_categories = [
- # Compositor Nodes
- CompositorNodeCategory("CMP_INPUT", "Input", items = [
+ # Compositor Nodes
+ CompositorNodeCategory("CMP_INPUT", "Input", items=[
NodeItem("CompositorNodeRLayers"),
NodeItem("CompositorNodeImage"),
NodeItem("CompositorNodeMovieClip"),
@@ -245,7 +253,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeTrackPos"),
NodeItem("NodeGroupInput", poll=group_input_output_item_poll),
]),
- CompositorNodeCategory("CMP_OUTPUT", "Output", items = [
+ CompositorNodeCategory("CMP_OUTPUT", "Output", items=[
NodeItem("CompositorNodeComposite"),
NodeItem("CompositorNodeViewer"),
NodeItem("CompositorNodeSplitViewer"),
@@ -253,7 +261,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeLevels"),
NodeItem("NodeGroupOutput", poll=group_input_output_item_poll),
]),
- CompositorNodeCategory("CMP_OP_COLOR", "Color", items = [
+ CompositorNodeCategory("CMP_OP_COLOR", "Color", items=[
NodeItem("CompositorNodeMixRGB"),
NodeItem("CompositorNodeAlphaOver"),
NodeItem("CompositorNodeInvert"),
@@ -267,7 +275,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeTonemap"),
NodeItem("CompositorNodeZcombine"),
]),
- CompositorNodeCategory("CMP_CONVERTOR", "Converter", items = [
+ CompositorNodeCategory("CMP_CONVERTOR", "Converter", items=[
NodeItem("CompositorNodeMath"),
NodeItem("CompositorNodeValToRGB"),
NodeItem("CompositorNodeSetAlpha"),
@@ -283,7 +291,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeSepYCCA"),
NodeItem("CompositorNodeCombYCCA"),
]),
- CompositorNodeCategory("CMP_OP_FILTER", "Filter", items = [
+ CompositorNodeCategory("CMP_OP_FILTER", "Filter", items=[
NodeItem("CompositorNodeBlur"),
NodeItem("CompositorNodeBilateralblur"),
NodeItem("CompositorNodeDilateErode"),
@@ -297,14 +305,14 @@ compositor_node_categories = [
NodeItem("CompositorNodeDBlur"),
NodeItem("CompositorNodePixelate"),
]),
- CompositorNodeCategory("CMP_OP_VECTOR", "Vector", items = [
+ CompositorNodeCategory("CMP_OP_VECTOR", "Vector", items=[
NodeItem("CompositorNodeNormal"),
NodeItem("CompositorNodeMapValue"),
NodeItem("CompositorNodeMapRange"),
NodeItem("CompositorNodeNormalize"),
NodeItem("CompositorNodeCurveVec"),
]),
- CompositorNodeCategory("CMP_MATTE", "Matte", items = [
+ CompositorNodeCategory("CMP_MATTE", "Matte", items=[
NodeItem("CompositorNodeKeying"),
NodeItem("CompositorNodeKeyingScreen"),
NodeItem("CompositorNodeChannelMatte"),
@@ -318,7 +326,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeColorMatte"),
NodeItem("CompositorNodeDoubleEdgeMask"),
]),
- CompositorNodeCategory("CMP_DISTORT", "Distort", items = [
+ CompositorNodeCategory("CMP_DISTORT", "Distort", items=[
NodeItem("CompositorNodeScale"),
NodeItem("CompositorNodeLensdist"),
NodeItem("CompositorNodeMovieDistortion"),
@@ -332,7 +340,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeStabilize"),
]),
CompositorNodeCategory("CMP_GROUP", "Group", items=node_group_items),
- CompositorNodeCategory("CMP_LAYOUT", "Layout", items = [
+ CompositorNodeCategory("CMP_LAYOUT", "Layout", items=[
NodeItem("NodeFrame"),
NodeItem("NodeReroute"),
NodeItem("CompositorNodeSwitch"),
@@ -341,19 +349,19 @@ compositor_node_categories = [
texture_node_categories = [
# Texture Nodes
- TextureNodeCategory("TEX_INPUT", "Input", items = [
+ TextureNodeCategory("TEX_INPUT", "Input", items=[
NodeItem("TextureNodeCurveTime"),
NodeItem("TextureNodeCoordinates"),
NodeItem("TextureNodeTexture"),
NodeItem("TextureNodeImage"),
NodeItem("NodeGroupInput", poll=group_input_output_item_poll),
]),
- TextureNodeCategory("TEX_OUTPUT", "Output", items = [
+ TextureNodeCategory("TEX_OUTPUT", "Output", items=[
NodeItem("TextureNodeOutput"),
NodeItem("TextureNodeViewer"),
NodeItem("NodeGroupOutput", poll=group_input_output_item_poll),
]),
- TextureNodeCategory("TEX_OP_COLOR", "Color", items = [
+ TextureNodeCategory("TEX_OP_COLOR", "Color", items=[
NodeItem("TextureNodeMixRGB"),
NodeItem("TextureNodeCurveRGB"),
NodeItem("TextureNodeInvert"),
@@ -361,11 +369,11 @@ texture_node_categories = [
NodeItem("TextureNodeCompose"),
NodeItem("TextureNodeDecompose"),
]),
- TextureNodeCategory("TEX_PATTERN", "Pattern", items = [
+ TextureNodeCategory("TEX_PATTERN", "Pattern", items=[
NodeItem("TextureNodeChecker"),
NodeItem("TextureNodeBricks"),
]),
- TextureNodeCategory("TEX_TEXTURE", "Textures", items = [
+ TextureNodeCategory("TEX_TEXTURE", "Textures", items=[
NodeItem("TextureNodeTexNoise"),
NodeItem("TextureNodeTexDistNoise"),
NodeItem("TextureNodeTexClouds"),
@@ -377,20 +385,20 @@ texture_node_categories = [
NodeItem("TextureNodeTexMusgrave"),
NodeItem("TextureNodeTexStucci"),
]),
- TextureNodeCategory("TEX_CONVERTOR", "Converter", items = [
+ TextureNodeCategory("TEX_CONVERTOR", "Converter", items=[
NodeItem("TextureNodeMath"),
NodeItem("TextureNodeValToRGB"),
NodeItem("TextureNodeRGBToBW"),
NodeItem("TextureNodeValToNor"),
NodeItem("TextureNodeDistance"),
]),
- TextureNodeCategory("TEX_DISTORT", "Distort", items = [
+ TextureNodeCategory("TEX_DISTORT", "Distort", items=[
NodeItem("TextureNodeScale"),
NodeItem("TextureNodeTranslate"),
NodeItem("TextureNodeRotate"),
]),
TextureNodeCategory("TEX_GROUP", "Group", items=node_group_items),
- TextureNodeCategory("TEX_LAYOUT", "Layout", items = [
+ TextureNodeCategory("TEX_LAYOUT", "Layout", items=[
NodeItem("NodeFrame"),
NodeItem("NodeReroute"),
]),
@@ -398,15 +406,15 @@ texture_node_categories = [
def register():
- nodeitems_utils.register_node_categories("SHADER", shader_node_categories)
- nodeitems_utils.register_node_categories("COMPOSITING", compositor_node_categories)
- nodeitems_utils.register_node_categories("TEXTURE", texture_node_categories)
+ nodeitems_utils.register_node_categories('SHADER', shader_node_categories)
+ nodeitems_utils.register_node_categories('COMPOSITING', compositor_node_categories)
+ nodeitems_utils.register_node_categories('TEXTURE', texture_node_categories)
def unregister():
- nodeitems_utils.unregister_node_categories("SHADER")
- nodeitems_utils.unregister_node_categories("COMPOSITING")
- nodeitems_utils.unregister_node_categories("TEXTURE")
+ nodeitems_utils.unregister_node_categories('SHADER')
+ nodeitems_utils.unregister_node_categories('COMPOSITING')
+ nodeitems_utils.unregister_node_categories('TEXTURE')
if __name__ == "__main__":