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
AgeCommit message (Collapse)Author
2017-03-25Cleanup: imports, indentation, long linesCampbell Barton
2017-03-18PyAPI: remove bpy.utils.register_module()Campbell Barton
In preparation for it being removed, see: T47811
2016-03-22Cleanup: style (80-width)Campbell Barton
2015-08-02Use auto-offset after adding node from search menu as wellJulian Eisel
2015-08-01Note Editor: Auto-offset nodes on insertionJulian Eisel
Implements "Auto-offset" (called "insert offset" in code) feature for Node Editor, developed during and after LSOC :) Idea and sponsoring by Sebastian König, blendFX, Mathias Eimann, Mikavaa, Knick Design When you drop a node with at least one input and one output socket onto a an existing connection between two nodes, Auto-offset will, depending on the direction setting, automatically and animated move the left or right and all of its following nodes away to make room for the new node. The direction for offsetting can be toggled while you are moving the node by pressing „T“. The auto-offset is enabled by default but can be disabled in the header of the node-editor. The offset margin can be changed in the editing section of the User Preferences. Thanks a lot to the sponsors, and especially to Sebastian who helped *a lot* with this. That's how users can help developing Blender!
2015-02-27cleanup: typosCampbell Barton
2015-01-29cleanup: pep8Campbell Barton
also remove empty class parenthesis
2015-01-28cleanup: py importsCampbell Barton
2014-04-24Code cleanup: unused python vars & importsCampbell Barton
Use frosted rather then pyflakes
2013-12-10Missed one usage of use_hidden_preview.Jeroen Bakker
2013-11-07Fix #37348, Different behaviour in Node editor. Adding nodes from the search ↵Lukas Toenne
operator now also removes them again if the subsequent transform is cancelled, like with the regular node shift+A menu operators.
2013-10-06Check the node Add operator's type property before attempting to create a ↵Lukas Toenne
new node. This prevents python exceptions when calling it from the search menu, where the node type is unspecified. Reported by Sebastian Koenig in unrelated bug report #36968.
2013-09-18style cleanupCampbell Barton
2013-09-17Fix for #36739: Delete new nodes added via the Add menu or toolbar if the ↵Lukas Toenne
subsequent transform operator is cancelled. This prevents ugly situations where nodes stick "under" the toolbar after clicking a wrong button. Works by adding a flag to transform operators "remove_on_cancel". This is currently only used for node transforms, the idea is that if set, the operator will remove the transformed elements when it is cancelled. It's not possible to do that in the original NODE_OT_add_node operator, because transform is modal and there is no way of reacting to a cancel outside of the transform itself (previous attempt used a macro operator, but that also doesn't work because subsequent operators don't get executed if the previous transform cancels).
2013-09-05Bugfix #35920Ton Roosendaal
Adding a new node in Node Editor failed for "High DPI" (Only Mac retina now). - Py script for adding nodes was doing dpi magic, which it shouldn't. It has been replaced with a (temporary) API call to set the correct cursor location. (Thanks to Lukas T for helping here) - The SpaceNode->cursor[2] property now is *only* storing the coordinate in "adding new node space". Use of this has been removed from the code where possible, with as only exception the code to draw noodles while adding them. Special coder note: Nodes should respect the DPI value, and draw larger with larger buttons if you increase this size. The hack here is that this can only work nice if also the node positions are scaled accordingly. A better fix could be to check on scaling the node view itself for it. That then would also remove this Python API call that was added in this commit. However, that again might fight with how buttons layout code works now... needs some careful checking.
2013-07-17re-commit temp workaround [#35920], this still fails for OSX retina display,Campbell Barton
but at least it resolves for DPI values other then 72.
2013-06-30revert own fix for adding nodes with (DPI != 72), the fix doesn't work for ↵Campbell Barton
OSX retina displays.
2013-06-27fix for adding nodes with a DPI besides 72 causing offset.Campbell Barton
2013-06-27pep8 cleanupCampbell Barton
2013-06-08Fix for node search operator, this was not taking into account possible ↵Lukas Toenne
NodeItemCustom in the categories yet. Such custom items as just ignored for now.
2013-06-05Fix #35640, part 2. Check id.lib in poll functions for operators which do ↵Lukas Toenne
critical modification of node trees (create nodes, link, etc.). Transform operators and hide/show type operators are still allowed, this does not modify actual behavior of the nodes and can be useful for inspecting linked nodes.
2013-05-29workaround for search menu enum using freed python scripts (py api limitation).Campbell Barton
2013-05-10Small fix for node add operators: use the UNDO option so they get registered ↵Lukas Toenne
in undo stack properly.
2013-05-09Upgrade for the add_search node operator. This now uses the same basic ↵Lukas Toenne
system as the regular add_node operator, with enum items generated from the common node categories system (nodeitems_utils module). This means that any node listed in the regular node Add menu can now also be added via searching, including node groups and the like. The search operator also uses the subsequent transform to make insertion a bit more streamlined.
2013-05-09Fix for add_node operator: needs to have SKIP_SAVE set for the settings ↵Lukas Toenne
collection to prevent it from re-using settings from a previous call. This would otherwise lead to python exceptions when those properties don't exist for the other node type (point in case: node_tree only is defined for group nodes).
2013-05-08Moved a couple of common properties into the NodeAddOperator base class to ↵Lukas Toenne
avoid repetitive code. A new operator node_add_and_link is another variant that first creates a node and them connects a specific socket to an existing one (defined by context pointer).
2013-05-08Removed the add_group_node operator, this is now integrated into the generic ↵Lukas Toenne
node_add operator. The group node tree pointer is then part of the settings dictionary.
2013-04-21Fix for add nodes search box showing nasty "UUUUUUUU"-like entries with some ↵Bastien Montagne
python builds... Workaround for an issue with python: strings generated by py scripts should also exist in python as long as they are used in C. Else C code may access freed memory. Simply store the generated list of items in the class, for now. :/
2013-04-13Replacing the node Add menu and making the toolbar usefulLukas Toenne
As some people have already noticed, the "Add" menu for nodes is a bit messy since pynodes merge. The reason for this is that the order of nodes in submenus (categories) was previously defined by the order in which all nodes are registered (at the bottom of blenkernel/intern/node.c). For the dynamic registration of node types now possible this system of defining node order along with registration is no longer viable: while it would still sort of work for C nodes, it is completely meaningless for dynamic (python) nodes, which are basically registered automatically in whatever order modules and addons are loaded, with the added complexity of unloading and reloading. To fix this problem and add a bunch of desirable features this commit replaces the C menu with a python implementation. The new menu does not rely on any particular order of types in the node registry, but instead uses a simple explicit list of all the available nodes, grouped by categories (in scripts/nodeitems_builtins.py). There are a number of additional features that become possible with this implementation: 1) Node Toolbar can be populated! The list of nodes is used to create 2 UI items for each node: 1 entry in a submenu of "Add" menu and 1 item in a node toolbar panel with basically the same functionality. Clicking a button in the toolbar will add a new node of this type, just like selecting an item in the menu. The toolbar has the advantage of having collapsible panels for each category, so users can decide if they don't need certain nodes categories and have the rest more easily accessible. 2) Each node item is a true operator call. The old Add menu is a pretty old piece of C code which doesn't even use proper operator buttons. Now there is a generic node_add operator which can be used very flexibly for adding any of the available nodes. 3) Node Items support additional settings. Each "NodeItem" consists of the basic node type plus an optional list of initial settings that shall be applied to a new instance. This gives additional flexibility for creating variants of the same node or for defining preferred initial settings. E.g. it has been requested to disable previews for all nodes except inputs, this would be simple change in the py code and much less intrusive than in C. 4) Node items can be generated with a function. A callback can be used in any category instead of the fixed list, which generates a set of items based on the context (much like dynamic enum items in bpy.props). Originally this was implemented for group nodes, because these nodes only make sense when linked to a node tree from the library data. This principle could come in handy for a number of other nodes, e.g. Image nodes could provide a similar list of node variants based on images in the library - no need to first add node, then select an image. WARNING: pynodes scripters will have to rework their "draw_add_menu" callback in node tree types, this has been removed now! It was already pretty redundant, since one can add draw functions to the Add menu just like for any other menu. In the future i'd like to improve the categories system further so scripters can use it for custom node systems too, for now just make a draw callback and attach it to the Add menu.
2013-04-04Two small fixes:Ton Roosendaal
- "Add node" was showing on wrong location when used via pulldown menus. Now this option will put the nodes in center of the view. - The Curves widget was making itself smaller/bigger based on width of region. That messes up the layout engine now - especially the code that checks if there's a scroller needed or not (it went into an eternal feedback loop). Now this widget has fixed height (like the other larger widgets). Better would be to allow such large widgets to be scaled vertically individually. That's for the todo!
2013-03-28code cleanup: python/pep8 and double-promotion warnings.Campbell Barton
2013-03-22Fix for the use_hidden_preview setting in SpaceNode. The application of this ↵Lukas Toenne
flag to new nodes got lost during merges at some point. Also is now in the python node.add_node operator as well as the C function.
2013-03-18Merge of the PyNodes branch (aka "custom nodes") into trunk.Lukas Toenne
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-01-16style cleanupCampbell Barton
2012-12-29Fix for the NODE_OT_add_node operator. The way python classes were ↵Lukas Toenne
subclassed does not work with the registration mechanism. Combined both node_add and node_add_move operators into a single general operator with a flag. When use_transform is set, the operator will start transform on the new nodes after inserting.
2012-12-12style cleanup: also change node selection method not to compare nodes a lot.Campbell Barton
2012-12-12A few basic Python operators for adding nodes in the node editor tree. These ↵Lukas Toenne
operators basically have the same functionality as the 'Add' menu (which currently does not even use operators itself). They can be used in customized tools. The node_add_move operator is an extended variant which starts the (modal) transform operator right after adding a node, as a quicker way of inserting nodes in a tree.
2012-09-27pep8 cleanupCampbell Barton
2012-08-17style cleanupCampbell Barton
2012-08-17fix for crash showing tooltip for NODE_OT_add_search()Campbell Barton
2012-08-14style cleanup: pep8 & unfinished comment from own commit.Campbell Barton
2012-08-14Python node operator for combined node collapsing and hiding unused sockets. ↵Lukas Toenne
Socket hide flag is added to RNA as well, but can only be set when the socket is not connected, to avoid dangling links in editor drawing. Currently this operator has no default hotkey, but can be called from the Node menu.
2012-08-10Extended the search operator for nodes to also support node groups. The ↵Lukas Toenne
basic node group type is not included in the node items list, instead all existing node groups are added to the items list in the callback. A prefix is used to distinguish base node types from node groups.
2012-08-08code cleanup: lazy init enum for node searchCampbell Barton
2012-08-08Search option for adding nodes.Lukas Toenne
The 'Add' menu in the node editor now has an option 'Search' at the top, which opens a separate popup for searching node types by name. The operator for this is implemented completely in Python (this could also be done for the regular menu-based Add options in the future). There are a few necessary extensions to the RNA as well: * The View2D struct in regions is now exposed. Currently only contains converter functions for coordinates from the region to the view (i.e. scrolled and zoomed view space). Used for converting mouse location to node space. * The SpaceNode exposes the existing 'cursor_location' for operators to store mouse position beyond invoke calls. Not used for anything else (transforms) so far. * The edit_tree in SpaceNode is also exposed, this is needed for operators to work correctly inside node groups.