Commit Graph

266 Commits

Author SHA1 Message Date
97e9659c53 style cleanup 2012-08-04 12:54:27 +00:00
84df85164d fullscreen mask editing now works in the image space over a viewer node. 2012-08-03 20:56:04 +00:00
Lukas Toenne
771a7241b9 Fix for node placement when copying to/pasting from clipboard. Child node location is always relative to parent nodes (if the parent is also copied) and must not be offset. Also takes the offset of the edited node group in the editor into account now. 2012-08-03 10:51:29 +00:00
Lukas Toenne
c12d0fd76c Fix for node clipboard copy operator for Frame nodes. Was redirecting the parent pointer of the original instead of the copied nodes. 2012-08-03 10:18:52 +00:00
db8c9c24f6 code cleanup: remove unused includes 2012-08-02 23:03:16 +00:00
8f07833ed5 code cleanup: move node background image operators into node_view.c 2012-08-02 21:52:09 +00:00
Lukas Toenne
9d2173518c Clipboard feature for nodes. With the Copy operator a copy of all selected nodes and links between them is stored in an offscreen list (not in the library). The Paste operator then in turn copies these into the active node tree in the editor.
Currently does not support copying of animation data. This would require copying of individual fcurves etc. between data block, which is not implemented yet.

Also it is currently possible to circumvent some constraints of the nodes, in particular for node groups (e.g. no groups inside groups, render layer not inside groups).
2012-08-02 09:52:37 +00:00
829c48a991 code cleanup: headers 2012-08-01 20:39:14 +00:00
689c6133ea split node_edit.c into separate files (add, group, relationshops), was almost 5000 loc. 2012-08-01 19:11:17 +00:00
179d00fb9c make node select_all consistent with other select operators, also add Ctrl+I, select inverse to node space. 2012-08-01 13:28:19 +00:00
75046eadbf Mango request: option to create nodes with hidden preview by default 2012-07-30 17:11:59 +00:00
7b4733f422 fix usercount error with dropping images in the node view. 2012-07-27 13:57:03 +00:00
c67e910df6 fix/workaround for glitch with node editing active texture bug - where a node texture in a group could get stuck and the buttons UI wouldnt update to other active nodes.
Files saved with this error will still give problems, toggling group edit will fix.
2012-07-24 12:35:41 +00:00
2b286585af fix for node editor re-rendering when the background image was moved in the view. 2012-07-22 13:13:36 +00:00
Lukas Toenne
f883337ba3 Fix #32118, Reroute nodes inside groups get created in wonky places.
Previous attempt was not taking into account parent nodes of the group nodes (i.e. frames). The nodeFromView function should be used to convert between relative node location to absolute view space. Also added this in the node_add_node helper function, which is used in a number of operators for adding nodes in a specific location.
2012-07-20 15:07:06 +00:00
Lukas Toenne
2721a17a31 Fix #32118, Reroute nodes inside groups get created in wonky places. The operator needs to take into account the potential offset from the group node (most operators use the node_add_node helper function which does this). 2012-07-19 08:23:56 +00:00
54bfdb9296 toggling node hide/sockets/options was triggering a re-render. 2012-07-16 16:16:05 +00:00
474b922472 fix: node background image move operator didn't take zoom into account when clamping pan bounds. 2012-07-15 11:33:13 +00:00
7cc5af4ef3 minor refactor for rect functions. more consistent naming. 2012-07-15 00:29:56 +00:00
Lukas Toenne
18d7a23166 Fix #32051, Ungroup operator crashes. The link iterator can be invalidated when unconnected input links are removed. 2012-07-12 15:14:50 +00:00
Lukas Toenne
80867d76e5 Fix #32052, Conflicts in unique node names.
All node group operators which move nodes directly between bNodeTree->nodes lists now make sure the node names are indeed unique in their new environment (the node group tree or the parent tree).
2012-07-10 09:31:08 +00:00
558721ab59 More spell checking. 2012-07-04 15:04:38 +00:00
5def0b6c55 display a sample line in the hue correct, handy to sample the image to know what to change 2012-06-21 14:37:56 +00:00
c896a99213 sampling the node backdrop now draws a line in the curve (as it did in 2.4x). 2012-06-21 14:12:14 +00:00
0592657485 style cleanup 2012-06-21 13:19:19 +00:00
Lukas Toenne
6c4510f681 Modification of node groups by adding/removing nodes is not possible yet. This patch extends the 'Make Group' operator and adds a new 'Separate' operator to add such functionality.
1) For inserting into existing groups:
  The 'Make Group from selected' (CTRL+g) operator shows a selection popup (like the object parenting operator), with options depending on the type of the active node (last selected):
  * "New" -> regular operator, creates new group type with all selected nodes inside.
  * "Insert" (only if active node is a group) -> adds all other selected nodes into the group.

  Currently still prohibits groups inside groups in general, though would be technically possible as long as no actual recursion occurs (group containing itself).

2) For extracting from an existing group:
  New 'Separate from group' operator (p), works similar to separating vertices/edges/faces from mesh. Two modes:
  * "Copy" makes a copy of the nodes in the parent tree, but keeps the original group intact.
  * "Move" removes selected nodes from the node group and adds them to the parent tree
2012-06-12 08:44:46 +00:00
5189356d58 style cleanup 2012-06-04 20:11:09 +00:00
Lukas Toenne
17935168c0 Reroute nodes, by Jeroen Bakker (patch #28443).
By holding shift and "cutting" a node link a new reroute helper node can be inserted. This consists of a single socket that can be used to insert additional connection points into a link. This can be used to keep a connection point in the tree when  deleting a node, or to control the path of long connections for layout cleanup.
2012-06-01 12:38:03 +00:00
Lukas Toenne
f462743dae Viewer linking operator has to flag the node tree for update, to ensure the dependency sorting is correct (avoid red links). 2012-05-30 14:42:40 +00:00
Lukas Toenne
3091c9d440 Fix for node linking operator, which could insert node link into the list twice and cause deadlock due to incomplete test. 2012-05-28 14:39:55 +00:00
fd2f05be44 A few minor UI message fixes... 2012-05-28 14:01:42 +00:00
dab1d8e487 style cleanup 2012-05-22 22:03:41 +00:00
Lukas Toenne
53b01d9002 A number of new features for the node editor in general and the Frame node in particular.
For an detailed user-level description of new features see the following blogpost:

http://code.blender.org/index.php/2012/05/node-editing-tweaks/

TL;DR:
* Frame node gets more usable bounding-box behavior
* Node resizing has helpful mouse cursor indicators and works on all borders
* Node selection/active colors are themeable independently
* Customizable background colors for nodes (useful for frames visual
distinction).
2012-05-22 14:13:33 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
044e818cf8 ____
`````|````` | |        |                        ..'''' 
     |      | |        |______               .''       
     |      | |        |                  ..'          
     |      | |_______ |___________ ....''             
               merge to TRUNK!

 * The old compositor is still available (Debug Menu: 200)

This commit was brought to you by:

Developers:
 * Monique Dewanchand
 * Jeroen Bakker
 * Dalai Felinto
 * Lukas Tönne

Review:
 * Brecht van Lommel

Testers:
 * Nate Wiebe
 * Wolfgang Faehnle
 * Carlo Andreacchio
 * Daniel Salazar
 * Artur Mag
 * Christian Krupa
 * Francesco Siddi
 * Dan McGrath
 * Bassam Kurdali

But mostly by the community:
Gold:

    Joshua Faulkner
    Michael Tiemann
    Francesco Paglia
    Blender Guru
    Blender Developers Fund

Silver:

    Pablo Vazquez
    Joel Heethaar
    Amrein Olivier
    Ilias Karasavvidis
    Thomas Kumlehn
    Sebastian Koenig
    Hannu Hoffrén
    Benjamin Dansie
    Fred M'ule
    Michel Vilain
    Bradley Cathey
    Gianmichele Mariani
    Gottfried Hofmann
    Bjørnar Frøyse
    Valentijn Bruning
    Paul Holmes
    Clemens Rudolph
    Juris Graphix
    David Strebel
    Ronan Zeegers
    François Tarlier
    Felipe Andres Esquivel Reed
    Olaf Beckman
    Jesus Alberto Olmos Linares
    Kajimba
    Maria Figueiredo
    Alexandr Galperin
    Francesco Siddi
    Julio Iglesias Lopez
    Kjartan Tysdal
    Thomas Torfs
    Film Works
    Teruyuki Nakamura
    Roger Luethi
    Benoit Bolsee
    Stefan Abrahamsen
    Andreas Mattijat
    Xavier Bouchoux
    Blender 3D Graphics and Animation
    Henk Vostermans
    Daniel Blanco Delgado
    BlenderDay/2011
    Bradley Cathey
    Matthieu Dupont de Dinechin
    Gianmichele Mariani
    Jérôme Scaillet

Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó, 
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli, 
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein, 
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio, 
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel, 
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey, 
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter, 
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini, 
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch, 
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson, 
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song, 
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
Lukas Toenne
324b22f701 A generalization of the modal node linking operator (for dragging from socket to socket).
This operator still had some built-in assumptions about the connectivity of input/output sockets (1-to-n in all current node systems). For future node systems (e.g. flow-based particles) and for general customizable nodes the operator is now fully symmetric and supports all kinds of connectivity limits (1:1, 1:n, m:1, m:n).

The operator data can also store a list of node links as opposed to a single link now, so that multiple links can be redirected at once. Holding the CTRL key when clicking a socket, all links from/to that socket are detached and can be moved to a different socket. This is useful for quickly appending a node without moving every individual link.
2012-05-15 12:40:43 +00:00
ff26474a46 was casting to short for int args. 2012-05-14 13:54:00 +00:00
c53fe94bb4 Fix #31318: cycles preview missing update for other materials using same node
group with certain operations.
2012-05-05 19:44:28 +00:00
f3230c7897 Second part of fix for [#31157]: Some (actually, 172) operators have no tooltip.
About 30 undocumented ops remaining...
2012-05-05 17:10:51 +00:00
6292fb4cbd code cleanup: BKE_libblock_find_name() now takes an ID constant rather then a string. 2012-05-05 17:00:11 +00:00
1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
34b18fcbc1 code cleanup: BKE_ naming, also make bpy.data.images.load() always load a new image. (not use existing one) 2012-05-05 14:52:04 +00:00
299ff91ea1 code cleanup: BKE_scene api naming.
also stop numpy from being found in /usr/include with cmake.
2012-05-05 14:33:36 +00:00
Lukas Toenne
d6ae78322e Removed the automatic socket selection in the modal node linking operator.
This was originally reimplemented as part of the socket selection feature, but since selecting a socket necessarily also selected the owning node, it messes with the manual user selection of nodes too much (and doesn't add any additional usability).
2012-05-04 13:12:09 +00:00
Lukas Toenne
d3a5fd5508 Enum property items were missing a terminator item. 2012-05-03 06:57:30 +00:00
b2a9d012b4 Fix #31236: linking a socket of a different type to an existing node group output
would crash, did not convert default value storage correctly.
2012-05-02 15:47:15 +00:00
Lukas Toenne
01b3deb680 A number of changes to node RNA and the file output node, to simplify socket types and make node code more robust for future nodes with extra socket data.
* Removed the struct_type identifier from sockets completely. Any specialization of socket types can be done by using separate collections in RNA and customized socket draw callbacks in node type. Sockets themselves are pure data inputs/outputs now. Possibly the sock->storage data could also be removed, but this will change anyway with id properties in custom nodes.

* Replaced the direct socket button draw calls by extra callbacks in node types. This allows nodes to draw sockets in specialized ways without referring to the additional struct_type identifier. Default is simply drawing the socket default_value button, only file output node overrides this atm.

* File output node slots now use a separate file sub-path in their storage data, instead of using the socket name. That way the path is an actual PROP_FILEPATH property and it works better with the UI list template (name property is local to the data struct).

* Node draw contexts for options on the node itself and detail buttons in the sidebar now have an extra context pointer "node" (uiLayoutSetContextPointer). This can be used to bind operator buttons to a specific node, instead of having to rely on the active/selected node(s) or making weak links via node name. Compare to modifiers and logic bricks, they use the same feature.

* Added another operator for reordering custom input slots in the file output node.
2012-05-02 07:18:51 +00:00
a5af5e8f50 style cleanup: re - http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Braces_with_Macros 2012-04-30 16:22:40 +00:00
ef054e165c style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros. 2012-04-28 15:14:16 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00