Commit Graph

288 Commits

Author SHA1 Message Date
Lukas Toenne
09ed97afc5 Internal node links are now cached in a per-node list, instead of being generated as a transient list that is returned from the callback and had to be freed by the caller. These internal links are used for muted nodes, disconnect operators and reroute nodes, to effectively replace the node with direct input-to-output links.
Storing this list in the node has the advantage of requiring far fewer calls to the potentially expensive internal_connect callback. This was called on every node redraw ...

Also it will allow Cycles to properly use the internal links for muted nodes, which ensures consistent behavior. The previous method was not applicable in Cycles because transient list return values are not supported well in the RNA and particularly the C++ API implementation.
2012-10-25 16:49:06 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
67e2768570 quiet some -Wshadow warnings 2012-10-12 14:35:10 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
a73dd3476e Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.

This introduces two configurable color spaces:

- Input color space for images and movie clips. This space is used to convert
  images/movies from color space in which file is saved to Blender's linear
  space (for float images, byte images are not internally converted, only input
  space is stored for such images and used later).

  This setting could be found in image/clip data block settings.

- Display color space which defines space in which particular display is working.

  This settings could be found in scene's Color Management panel.

When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.

This conversions are:

- View, which defines tone curve applying before display transformation.
  These are different ways to view the image on the same display device.
  For example it could be used to emulate film view on sRGB display.

- Exposure affects on image exposure before tone map is applied.

- Gamma is post-display gamma correction, could be used to match particular
  display gamma.

- RGB curves are user-defined curves which are applying before display
  transformation, could be used for different purposes.

All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.

This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).

Some technical notes:

- Image buffer's float buffer is now always in linear space, even if it was
  created from 16bit byte images.

- Space of byte buffer is stored in image buffer's rect_colorspace property.

- Profile of image buffer was removed since it's not longer meaningful.

- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
  to support other spaces, but it's quite large project which isn't so
  much important.

- Legacy Color Management option disabled is emulated by using None display.
  It could have some regressions, but there's no clear way to avoid them.

- If OpenColorIO is disabled on build time, it should make blender behaving
  in the same way as previous release with color management enabled.

More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management

--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
aa2d84da37 style cleanup:
also remove some redundant conversions int -> short -> int
2012-09-09 00:00:21 +00:00
1a7eb3454e style cleanup 2012-09-08 08:59:47 +00:00
56b28635e7 code cleanup: rename BLI_in_rctf() --> BLI_rctf_isect_pt(), to conform with our naming convention. 2012-08-23 18:25:45 +00:00
1939baa47d style cleanup 2012-08-22 16:44:32 +00:00
26f073b327 macros for rectangle center and size 2012-08-20 15:29:02 +00:00
6c74d1147e minor cleanup to node pasting. 2012-08-20 13:59:19 +00:00
0f6a6c7499 fix for crash pasting nodes into a node tree when the ID pointer is lost.
also fix for ID user count on paste which wasn't increasing.
2012-08-20 13:51:25 +00:00
60915c9099 escape key now quits composite. 2012-08-15 11:31:04 +00:00
15bd03f958 fix for missing change to fluidsim from last commit and name jobs a more useful name - 'wm_job'. 2012-08-15 10:03:29 +00:00
97859e8709 add wm job types they are not used yet, so this just defines them for new jobs add add argument to search by job type. 2012-08-15 09:42:06 +00:00
c567cf3fab code cleanup: WM naming conventions 2012-08-11 21:35:24 +00:00
f0951f58ca code cleanup: rename G.afbreek --> is_break, G.rendering --> is_rendering 2012-08-08 18:37:06 +00:00
Lukas Toenne
543cee14ca Renamed the mx/my coordinates in SpaceNode to more descriptive 'cursor'. This follows the naming in the View3D space, since this vector is used for essentially the same purpose (adding nodes at a specific location), although not used for any transform origin and not displayed in the editor.
Note: While renaming DNA properties is usually dangerous and can break files, in this case it is possible because the mx/my values are only used at runtime.
2012-08-08 17:37:02 +00:00
2988c81d6b fix [#32272] crash while rendering and modifying the node setup. 2012-08-06 10:13:49 +00:00
df81b50bf2 prevent copy/paste from incompatible types (compo -> material for eg) - would crash instantly. 2012-08-06 08:41:45 +00:00
5bb97305a4 fix for node clipboard leak on exit, also use blenders convention for function naming with BKE clipboard funcs. 2012-08-06 08:25:24 +00:00
e592f757e8 fix for crash when moving frames about in the node space, was possible to move a node into its own child frame (causing recursive parent loop).
also some minor code cleanup.
2012-08-05 20:40:26 +00:00
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