Commit Graph

12 Commits

Author SHA1 Message Date
Lukas Tönne
a6c2d02366 Fix T42389: Removed outdated comment from custom_nodes.py example script.
There was some confusion about the bl_icon attribute being optional. In
fact the functionality for hiding a tree type in the editor header is
now controlled by writing a poll function for the tree type instead,
which is more flexible and clean.

http://www.blender.org/documentation/blender_python_api_2_71_6/bpy.types.NodeTree.html#bpy.types.NodeTree.poll
2014-10-29 13:05:21 +01:00
Campbell Barton
ea610e655c Style cleanup: C & pep8 2014-04-15 13:11:48 +10:00
Lukas Toenne
8db4f87546 Small example for dynamic node labels in the custom_nodes.py template script. 2013-11-12 18:18:06 +00:00
Lukas Toenne
3b7d5a8a40 Change to node output socket drawing: Instead of always drawing only the socket label for outputs, leave this check up to the socket type draw function. This gives custom node scripts more flexibility in
how to draw socket values by allowing buttons on output sockets as well.

http://wiki.blender.org/index.php/Extensions:2.6/Py/API_Changes#Python_Node_Output_Drawing
2013-10-10 12:58:35 +00:00
Lukas Toenne
7e02d82036 Minor change to the custom_nodes.py template that has some consequences for addons: use bpy.types.* base classes instead of bpy_types.*
The bpy_types classes cause issues when used in addons when loading on Blender startup (subclasses cannot be properly registered).
2013-07-30 08:30:15 +00:00
Lukas Toenne
3fe01ecfd9 Removed the unused draw_add_menu function from pynodes template. This was previously used to extend the node Add menu, now the node categories system is used instead. 2013-06-09 09:49:44 +00:00
Lukas Toenne
6e55460a8d Removed deprecated XXX comment from custom_nodes.py, importing node base types works now (this comment was causing some confusion in the past). 2013-06-09 09:42:34 +00:00
Lukas Toenne
90cbf5d591 Added an example for using the new node categories system to the custom_nodes.py template script. 2013-06-09 08:46:48 +00:00
Lukas Toenne
fd2e3999bb Removed the 'custom node group' example from the pynodes template script. This does not work properly due to the fact that node groups don't have a single registerable base class any more. The reason for
that is that RNA does not support multiple inheritance so the actual node group subtypes (ShaderNodeGroup, CompositorNodeGroup, TextureNodeGroup) can not be derived from both the
ShaderNode/CompositorNode/TextureNode base types as well as a common NodeGroup type ... It is possible however to define node group types entirely in python which avoids the limitations of the RNA system
and is much more flexible, example for this will follow later.
2013-06-09 08:46:47 +00:00
Lukas Toenne
a3c82d4cde Updated the custom_nodes.py template script to reflect socket draw API changes in r56584 and r56585. 2013-05-08 16:17:04 +00:00
Lukas Toenne
a00eda0835 Fix for the custom_nodes.py template. Socket classes now return their drawing color in a callback instead of a simple property, this makes it possible to change a socket color e.g. based on data type. 2013-03-22 13:17:16 +00:00
Lukas Toenne
4638e5f99a Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2013-03-18 16:34:57 +00:00