[Bf-extensions-cvs] [689bb9c] master: Merge Nodes Efficiency Tools with Greg Zaal's Node Wrangler
Bartek Skorupa
noreply at git.blender.org
Mon Dec 9 13:59:48 CET 2013
Commit: 689bb9c2146ae75ccce0dae6914681104e3c5f7a
Author: Bartek Skorupa
Date: Mon Dec 9 13:59:05 2013 +0100
http://developer.blender.org/rBA689bb9c2146ae75ccce0dae6914681104e3c5f7a
Merge Nodes Efficiency Tools with Greg Zaal's Node Wrangler
New Features:
- Lazy Connect
- Lazy Mix
- Delete Unused Nodes
- Swap Outputs
- Reset Backdrop
- Add UV Layout attribute node
- Add Vertex Color attribute node
- Shader Viewer
- Frame Selected Nodes (wrap nodes in frame)
- Reload all images
- Modify Labels
Modified features:
- Switch Node Type - now every node's type can be changed to any other.
Links will be preserved whenever possible.
All old and new features documented on wiki page:
http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Nodes_
Efficiency_Tools
===================================================================
M node_efficiency_tools.py
===================================================================
diff --git a/node_efficiency_tools.py b/node_efficiency_tools.py
index 64461aa..9526087 100644
--- a/node_efficiency_tools.py
+++ b/node_efficiency_tools.py
@@ -17,22 +17,23 @@
# ##### END GPL LICENSE BLOCK #####
bl_info = {
- 'name': "Nodes Efficiency Tools",
- 'author': "Bartek Skorupa",
- 'version': (2, 33),
+ 'name': "Node Wrangler (aka Nodes Efficiency Tools)",
+ 'author': "Bartek Skorupa, Greg Zaal",
+ 'version': (3, 00),
'blender': (2, 69, 0),
- 'location': "Node Editor Properties Panel (Ctrl+Space)",
- 'description': "Nodes Efficiency Tools",
+ 'location': "Node Editor Properties Panel or Ctrl-SPACE",
+ 'description': "Various tools to enhance and speed up node-based workflow",
'warning': "",
'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Nodes_Efficiency_Tools",
'tracker_url': "http://projects.blender.org/tracker/index.php?func=detail&aid=33543&group_id=153&atid=469",
'category': "Node",
- }
+}
-import bpy
+import bpy, blf, bgl
from bpy.types import Operator, Panel, Menu
-from bpy.props import FloatProperty, EnumProperty, BoolProperty
+from bpy.props import FloatProperty, EnumProperty, BoolProperty, StringProperty, FloatVectorProperty
from mathutils import Vector
+from math import cos, sin, pi, sqrt
#################
# rl_outputs:
@@ -72,8 +73,236 @@ rl_outputs = (
('use_pass_uv', 'UV', 'UV', True, True),
('use_pass_vector', 'Speed', 'Vector', True, True),
('use_pass_z', 'Z', 'Depth', True, True),
- )
+)
+
+# shader nodes
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_input_nodes_props = (
+ ('ShaderNodeTexCoord', 'TEX_COORD', 'Texture Coordinate'),
+ ('ShaderNodeAttribute', 'ATTRIBUTE', 'Attribute'),
+ ('ShaderNodeLightPath', 'LIGHT_PATH', 'Light Path'),
+ ('ShaderNodeFresnel', 'FRESNEL', 'Fresnel'),
+ ('ShaderNodeLayerWeight', 'LAYER_WEIGHT', 'Layer Weight'),
+ ('ShaderNodeRGB', 'RGB', 'RGB'),
+ ('ShaderNodeValue', 'VALUE', 'Value'),
+ ('ShaderNodeTangent', 'TANGENT', 'Tangent'),
+ ('ShaderNodeNewGeometry', 'NEW_GEOMETRY', 'Geometry'),
+ ('ShaderNodeWireframe', 'WIREFRAME', 'Wireframe'),
+ ('ShaderNodeObjectInfo', 'OBJECT_INFO', 'Object Info'),
+ ('ShaderNodeHairInfo', 'HAIR_INFO', 'Hair Info'),
+ ('ShaderNodeParticleInfo', 'PARTICLE_INFO', 'Particle Info'),
+ ('ShaderNodeCameraData', 'CAMERA', 'Camera Data'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_output_nodes_props = (
+ ('ShaderNodeOutputMaterial', 'OUTPUT_MATERIAL', 'Material Output'),
+ ('ShaderNodeOutputLamp', 'OUTPUT_LAMP', 'Lamp Output'),
+ ('ShaderNodeOutputWorld', 'OUTPUT_WORLD', 'World Output'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_shader_nodes_props = (
+ ('ShaderNodeMixShader', 'MIX_SHADER', 'Mix Shader'),
+ ('ShaderNodeAddShader', 'ADD_SHADER', 'Add Shader'),
+ ('ShaderNodeBsdfDiffuse', 'BSDF_DIFFUSE', 'Diffuse BSDF'),
+ ('ShaderNodeBsdfGlossy', 'BSDF_GLOSSY', 'Glossy BSDF'),
+ ('ShaderNodeBsdfTransparent', 'BSDF_TRANSPARENT', 'Transparent BSDF'),
+ ('ShaderNodeBsdfRefraction', 'BSDF_REFRACTION', 'Refraction BSDF'),
+ ('ShaderNodeBsdfGlass', 'BSDF_GLASS', 'Glass BSDF'),
+ ('ShaderNodeBsdfTranslucent', 'BSDF_TRANSLUCENT', 'Translucent BSDF'),
+ ('ShaderNodeBsdfAnisotropic', 'BSDF_ANISOTROPIC', 'Anisotropic BSDF'),
+ ('ShaderNodeBsdfVelvet', 'BSDF_VELVET', 'Velvet BSDF'),
+ ('ShaderNodeBsdfToon', 'BSDF_TOON', 'Toon BSDF'),
+ ('ShaderNodeSubsurfaceScattering', 'SUBSURFACE_SCATTERING', 'Subsurface Scattering'),
+ ('ShaderNodeEmission', 'EMISSION', 'Emission'),
+ ('ShaderNodeBackground', 'BACKGROUND', 'Background'),
+ ('ShaderNodeAmbientOcclusion', 'AMBIENT_OCCLUSION', 'Ambient Occlusion'),
+ ('ShaderNodeHoldout', 'HOLDOUT', 'Holdout'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_texture_nodes_props = (
+ ('ShaderNodeTexImage', 'TEX_IMAGE', 'Image'),
+ ('ShaderNodeTexEnvironment', 'TEX_ENVIRONMENT', 'Environment'),
+ ('ShaderNodeTexSky', 'TEX_SKY', 'Sky'),
+ ('ShaderNodeTexNoise', 'TEX_NOISE', 'Noise'),
+ ('ShaderNodeTexWave', 'TEX_WAVE', 'Wave'),
+ ('ShaderNodeTexVoronoi', 'TEX_VORONOI', 'Voronoi'),
+ ('ShaderNodeTexMusgrave', 'TEX_MUSGRAVE', 'Musgrave'),
+ ('ShaderNodeTexGradient', 'TEX_GRADIENT', 'Gradient'),
+ ('ShaderNodeTexMagic', 'TEX_MAGIC', 'Magic'),
+ ('ShaderNodeTexChecker', 'TEX_CHECKER', 'Checker'),
+ ('ShaderNodeTexBrick', 'TEX_BRICK', 'Brick')
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_color_nodes_props = (
+ ('ShaderNodeMixRGB', 'MIX_RGB', 'MixRGB'),
+ ('ShaderNodeRGBCurve', 'CURVE_RGB', 'RGB Curves'),
+ ('ShaderNodeInvert', 'INVERT', 'Invert'),
+ ('ShaderNodeLightFalloff', 'LIGHT_FALLOFF', 'Light Falloff'),
+ ('ShaderNodeHueSaturation', 'HUE_SAT', 'Hue/Saturation'),
+ ('ShaderNodeGamma', 'GAMMA', 'Gamma'),
+ ('ShaderNodeBrightContrast', 'BRIGHTCONTRAST', 'Bright Contrast'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_vector_nodes_props = (
+ ('ShaderNodeMapping', 'MAPPING', 'Mapping'),
+ ('ShaderNodeBump', 'BUMP', 'Bump'),
+ ('ShaderNodeNormalMap', 'NORMAL_MAP', 'Normal Map'),
+ ('ShaderNodeNormal', 'NORMAL', 'Normal'),
+ ('ShaderNodeVectorCurve', 'CURVE_VEC', 'Vector Curves'),
+ ('ShaderNodeVectorTransform', 'VECT_TRANSFORM', 'Vector Transform'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_converter_nodes_props = (
+ ('ShaderNodeMath', 'MATH', 'Math'),
+ ('ShaderNodeValToRGB', 'VALTORGB', 'ColorRamp'),
+ ('ShaderNodeRGBToBW', 'RGBTOBW', 'RGB to BW'),
+ ('ShaderNodeVectorMath', 'VECT_MATH', 'Vector Math'),
+ ('ShaderNodeSeparateRGB', 'SEPRGB', 'Separate RGB'),
+ ('ShaderNodeCombineRGB', 'COMBRGB', 'Combine RGB'),
+ ('ShaderNodeSeparateHSV', 'SEPHSV', 'Separate HSV'),
+ ('ShaderNodeCombineHSV', 'COMBHSV', 'Combine HSV'),
+ ('ShaderNodeWavelength', 'WAVELENGTH', 'Wavelength'),
+ ('ShaderNodeBlackbody', 'BLACKBODY', 'Blackbody'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+shaders_layout_nodes_props = (
+ ('NodeFrame', 'FRAME', 'Frame'),
+ ('NodeReroute', 'REROUTE', 'Reroute'),
+)
+
+# compositing nodes
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+compo_input_nodes_props = (
+ ('CompositorNodeRLayers', 'R_LAYERS', 'Render Layers'),
+ ('CompositorNodeImage', 'IMAGE', 'Image'),
+ ('CompositorNodeMovieClip', 'MOVIECLIP', 'Movie Clip'),
+ ('CompositorNodeMask', 'MASK', 'Mask'),
+ ('CompositorNodeRGB', 'RGB', 'RGB'),
+ ('CompositorNodeValue', 'VALUE', 'Value'),
+ ('CompositorNodeTexture', 'TEXTURE', 'Texture'),
+ ('CompositorNodeBokehImage', 'BOKEHIMAGE', 'Bokeh Image'),
+ ('CompositorNodeTime', 'TIME', 'Time'),
+ ('CompositorNodeTrackPos', 'TRACKPOS', 'Track Position'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+compo_output_nodes_props = (
+ ('CompositorNodeComposite', 'COMPOSITE', 'Composite'),
+ ('CompositorNodeViewer', 'VIEWER', 'Viewer'),
+ ('CompositorNodeSplitViewer', 'SPLITVIEWER', 'Split Viewer'),
+ ('CompositorNodeOutputFile', 'OUTPUT_FILE', 'File Output'),
+ ('CompositorNodeLevels', 'LEVELS', 'Levels'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+compo_color_nodes_props = (
+ ('CompositorNodeMixRGB', 'MIX_RGB', 'Mix'),
+ ('CompositorNodeAlphaOver', 'ALPHAOVER', 'Alpha Over'),
+ ('CompositorNodeInvert', 'INVERT', 'Invert'),
+ ('CompositorNodeCurveRGB', 'CURVE_RGB', 'RGB Curves'),
+ ('CompositorNodeHueSat', 'HUE_SAT', 'Hue Saturation Value'),
+ ('CompositorNodeColorBalance', 'COLORBALANCE', 'Color Balance'),
+ ('CompositorNodeHueCorrect', 'HUECORRECT', 'Hue Correct'),
+ ('CompositorNodeBrightContrast', 'BRIGHTCONTRAST', 'Bright/Contrast'),
+ ('CompositorNodeGamma', 'GAMMA', 'Gamma'),
+ ('CompositorNodeColorCorrection', 'COLORCORRECTION', 'Color Correction'),
+ ('CompositorNodeTonemap', 'TONEMAP', 'Tonemap'),
+ ('CompositorNodeZcombine', 'ZCOMBINE', 'Z Combine'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+compo_converter_nodes_props = (
+ ('CompositorNodeMath', 'MATH', 'Math'),
+ ('CompositorNodeValToRGB', 'VALTORGB', 'ColorRamp'),
+ ('CompositorNodeSetAlpha', 'SETALPHA', 'Set Alpha'),
+ ('CompositorNodePremulKey', 'PREMULKEY', 'Alpha Convert'),
+ ('CompositorNodeIDMask', 'ID_MASK', 'ID Mask'),
+ ('CompositorNodeRGBToBW', 'RGBTOBW', 'RGB to BW'),
+ ('CompositorNodeSepRGBA', 'SEPRGBA', 'Separate RGBA'),
+ ('CompositorNodeCombRGBA', 'COMBRGBA', 'Combine RGBA'),
+ ('CompositorNodeSepHSVA', 'SEPHSVA', 'Separate HSVA'),
+ ('CompositorNodeCombHSVA', 'COMBHSVA', 'Combine HSVA'),
+ ('CompositorNodeSepYUVA', 'SEPYUVA', 'Separate YUVA'),
+ ('CompositorNodeCombYUVA', 'COMBYUVA', 'Combine YUVA'),
+ ('CompositorNodeSepYCCA', 'SEPYCCA', 'Separate YCbCrA'),
+ ('CompositorNodeCombYCCA', 'COMBYCCA', 'Combine YCbCrA'),
+)
+# (rna_type.identifier, type, rna_type.name)
+# Keeping mixed case to avoid having to translate entries when adding new nodes in operators.
+compo_filter_nodes_pro
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list