Commit Graph

40 Commits

Author SHA1 Message Date
Campbell Barton 9149e89421 Merge branch 'master' into blende2.8 2018-12-17 10:25:40 +11:00
Campbell Barton 98f43ba3e4 Cleanup: use bit-shifted flag definitions in DNA 2018-12-17 09:55:47 +11:00
Antonioya 351f537fa8 GP: New Curve primitive and other primitive improvements
This commit adds support for new curve tool and adds more functionalities to the existing primitives, including new handles, editing, stroke thickness curve, noise, preview of the real stroke, etc.

Thanks to @charlie for his great contribution to this improvement.
2018-12-15 17:21:47 +01:00
Brecht Van Lommel 5d3c815c2f Revert "Compositor: Added Weighted Standard Curve evaluation"
This reverts commit b8c9df6f21. The code is not
correct with regards to color management, and its purpose was not documented.
2018-09-26 14:24:13 +02:00
Jeroen Bakker b8c9df6f21 Compositor: Added Weighted Standard Curve evaluation
Available in RGB Curve node in the compositor and as modifier in the
sequencer. I reshuffled the values of the enum. But a the first commit
is just 1 day old I think that the order is more important than the file
compatibility.
2018-08-24 10:04:33 +02:00
Jeroen Bakker 4de7c0c310 Compositor: Film-like curve
Film-like curves for the RGB Curve node (Compositor) and Curve Modifier
(Sequencer)

Film-like curves originated from Adobe.
"It’s an RGB curve where the tone curve is applied on the largest and smallest value, and then the middle value is adapted to keep a constant hue as defined by RGB-HSL/HSV. In terms of look and saturation increase it’s very similar to a pure RGB curve, more so than a HSL-L curve or HSV-V curve, but some color shift problems are avoided."

Other tools like Natron, Krita and RawTherapee have implemented this curve tone.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

Tags: #compositing, #video_sequencer

Differential Revision: https://developer.blender.org/D3638
2018-08-23 11:39:11 +02:00
Antonioya 66da2f537a New Grease Pencil object for 2D animation
This commit merge the full development done in greasepencil-object branch and include mainly the following features.

- New grease pencil object.
- New drawing engine.
- New grease pencil modes Draw/Sculpt/Edit and Weight Paint.
- New brushes for grease pencil.
- New modifiers for grease pencil.
- New shaders FX.
- New material system (replace old palettes and colors).
- Split of annotations (old grease pencil) and new grease pencil object.
- UI adapted to blender 2.8.

You can get more info here:

https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/
https://code.blender.org/2018/07/grease-pencil-status-update/

This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible.

Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
2018-07-31 10:50:43 +02:00
Campbell Barton 78fbd146f3 Cleanup: trailing space for DNA headers 2018-06-17 17:04:09 +02:00
Campbell Barton 99520e3f92 Cleanup: use 'e' prefix for enum typedefs
Convention was only followed loosely,
apply to DNA where changes aren't likely to conflict.

(Skipped ModifierType for eg).
2017-10-17 13:49:20 +11:00
Campbell Barton 8c74ebb64f Support Auto-Clamped Handle for Curve-Mapping
This patch supports auto-clamped handles for curves,
useful since without this it can be difficult to have 'flat' sections of a curve.
2016-08-01 09:06:40 +10:00
Sergey Sharybin a76e69f5f7 Additional Waveform Drawing Mode
This diff adds a 6th drawing mode to the Waveform Scope.

The new mode shows the RGB colour channels overlaid as a "Full colour" waveform.

The old "Red Green Blue" mode is renamed "Parade" which is the standard industry
term for RGB channels shown side-by-side.

This full colour style of waveform is very much more useful for colour grading than the
Parade mode and is the default waveform for many artists.

Files from older Blender versions which show scopes open as expected.

Patch by John Cox (johnedwardcox), thanks!

Reviewers: sergey

Reviewed By: sergey

Subscribers: campbellbarton, tmw, Blendify

Differential Revision: https://developer.blender.org/D1936
2016-07-18 15:42:21 +02:00
Campbell Barton b1d758ae6b Cleanup: redundant struct declarations 2015-03-29 03:56:39 +11:00
Brecht Van Lommel 42946c37c7 Fix T38606: C curve in the curve mapping compositing node not extrapolating correct.
The "premultiply" optimization here did not take the extrapolation into account.
2014-02-14 16:03:45 +01:00
Sergey Sharybin cf8cddf07a Film response curves implemented as a looks
This commit implement's OCIO's Looks idea which
is about applying some color correction on the
buffer before it get's affected by a display
transform.

This is mainly used to modify images in an
artistics way.

Currently we've got looks generated from film
response curves for all sorts of cameras.

Patch by both of me and Brecht.
2013-09-09 09:48:26 +00:00
Sergey Sharybin 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
Campbell Barton 3204731209 code cleanup: don't use magic numbers for curve flag & use bool args for curvemapping_changed() 2012-08-21 08:47:36 +00:00
Sergey Sharybin fb278a501e Ensure enums in DNA files has got explicit values
See http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Macros.2C_Enums.2C_Inline_functions
2012-06-15 14:11:05 +00:00
Campbell Barton 219eca0f51 mango request - add alpha to histogram & sample line. 2012-06-10 12:33:27 +00:00
Campbell Barton 5e29381825 mango request
- optionally display the histogram as lines (not filled areas).
- expand the enum for faster access.
- keep the sample line displayed after doing the line sample (running again clears).
2012-06-10 12:09:25 +00:00
Campbell Barton 2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Campbell Barton ca629d5ccc minor dna header cleanup 2011-12-30 07:25:49 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Nathan Letwory 22dbae84e5 DNA header files are now grouped under the same module. No further documentation done. 2011-02-17 20:48:12 +00:00
Jason Wilkins 5505697ac5 Merge GSOC Sculpt Branch: 28499-30319
https://svn.blender.org/svnroot/bf-blender/branches/soc-2010-jwilkins
See log of that branch for details.
2010-07-14 14:11:03 +00:00
Xavier Thomas bd4fe1b71d Fix for histogram Luma mode not working when waveform is in RGB mode.
Also unified the scope vocabulary.
2010-05-10 03:42:22 +00:00
Matt Ebb 77833847ee Patch from Xavier Thomas: Use vertex arrays for drawing image editor vector scope
too, making it a lot more efficient.

Also fixed issue with scopes height not being stored in file properly.
2010-04-09 00:44:35 +00:00
Matt Ebb bfe248b3d6 Patch [#21750] Add luma waveform and vectorscope to image view
by Xavier Thomas

This adds the waveform monitor and vectorscope to the image editor 'scopes' 
region, bringing it inline (plus a bit more) with sequence editor functionality,
and a big step closer to the end goal of unifying the display code for image/
comp/sequence editor. It's non-intrusive, using the same code paths as 
the histogram.

There's still room for more tweaks - I modified the original patch, changing 
the openGL immediate mode drawing of the waveform display to vertex arrays for 
speed optimisation. Xavier can look at doing this for the vectorscope now too.

Thanks very much Xavier!
2010-04-06 02:05:54 +00:00
Matt Ebb 5de041c51f Histogram and line sample can now be resized vertically 2010-04-04 02:37:22 +00:00
Matt Ebb ec303cf980 Fix [#21188] HueCorrection Node, when reseting Curve, it goes to a incline instead of flat/straight 2010-03-09 07:41:27 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Matt Ebb 9d0dbd707e Fix [#20754] Histogram Not Updating, Showing Incorrect Levels, Colour Management on/off leads to Crash
Various internal fixes, also additional feature - can drag on the histogram to change scale 
(0 key to reset).

Also fix [#20844] Color balance node (lift freeze)
2010-01-28 07:26:21 +00:00
Matt Ebb aab8196a1c Finished some work from the weekend to keep local tree clean..
* Added a generic 'histogram' ui control, currently available in new image editor 
'scopes' region (shortcut P). Shows the histogram of the currently viewed image.

It's a baby step in unifying the functionality and code from the sequence editor, 
so eventually we can migrate the sequence preview to the image editor too, 
like compositor.

Still a couple of rough edges to tweak, regarding when it updates. Also would 
be very nice to have this region as a partially transparent overlapping region...
2010-01-19 01:32:06 +00:00
Ton Roosendaal 28667a314e Feature + Fix:
- while sampling color in image window, you now get the sampled color as a line
drawn in the node editor Curve nodes, allowing quicker view of what values you
actually change.

- reverted temporary the patch [#6779] by Matthew Plough
  He replaced image drawing of backdrop-node-editor with our Texture drawing
  function. That call is extremely slow, and should be by definition slower
  than glDrawPixels (unless you don't upload the image each time to gfx mem).

  Drawing large frames (2k, 4k) in node editor became unacceptable slow, even 
  with the neatest hardware around. (tested nvidia, ati) 

  Probably (Campbell thinks) this is a bypass for Linux ATI cards? 
  Anyhoo, this should be investigated further before applying. It better then
  becomes a user pref, or even much better: part of the OpenGL profiler we need.
2008-01-14 19:03:27 +00:00
Ton Roosendaal c3adb61dcc Composite Time node usablity improvement:
- now draws green 'current frame' line
- when Time Node is active, hotkey I will allow inserting a value on
  current frame.
2006-11-24 16:56:02 +00:00
Ton Roosendaal 129cab4137 New Curves Widget option: curves can get extrapolated extension.
Especially for Compositing it was annoying that colors always got clipped
in the 0.0-1.0 range. For this reason, extrapolated Curves now is the
default. Old saved files still have horizontal extrapolation.

Set the option with 'Tools' menu (wrench icon). This is a setting per
curve, so you might need to set all 4 curves for an RGBA curves widget.
2006-10-27 20:27:13 +00:00
Ton Roosendaal 3cf0bbfa17 Nasty memory conflict in Compositor... when:
- a Group has Curve node inside
- this Group was re-used more times
- with threaded render activated
- and both groups executed on same time

Then the premultipy optimize table was created twice... causing memory
to confuse.
2006-02-14 17:32:49 +00:00
Ton Roosendaal ccbc32abed Curve tool was not threadsafe... it was storing premultiplied curves in
a function (static vars) itself, causing mixups of curve data on usage.
2006-02-02 14:37:25 +00:00
Ton Roosendaal 715794859a Orange:
- cleanup of color curves code; goes at least twice faster now!
  (includes black/white point stuff)
- When using 'Curves' in image window on a byte rect, it creates a (temp)
  float rect to operate on. So curves work for regular pictures too now.
2006-01-12 15:46:29 +00:00
Ton Roosendaal 3b4907415c Orange: and now for the real exr fun: float buffer support in Image window!
Image as loaded in Blender (from openexr.com):
http://www.blender.org/bf/exrcurve1.jpg

Image with different white point:
http://www.blender.org/bf/exrcurve2.jpg

Image with white and black point and a curve:
http://www.blender.org/bf/exrcurve3.jpg

Use SHIFT+click to set the black point, and CTRL+click for white point.
The buttons in the panel work too, of course.

The curves work after the black/white range was corrected, so you can
stick to curves with a normal 0-1 range.
There's also now a general color curve, marked with 'C' button.

Note; this currently only maps the float colors to a visible 8 bits per
channel rect. You can save it, but when the blender file loads the curve
or mapping is not executed until you click in the curves... have to look
at that still.
Speed for this is also quite unoptimized... still WIP, but fun!
2006-01-09 23:52:51 +00:00
Ton Roosendaal 104ab9b103 Orange:
- New UI element: the "Curve Button".

For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.

To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:

   curvemap= curvemapping_add(3, 0, 0, 1, 1)

Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all  editing.
Evaluating a single channel:

   float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);

Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:

   curvemapping_evaluate3F(curvemap, newvec, oldvec);

Optimized versions for byte or short mapping is possible too, not done yet.

In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:

http://www.blender.org/bf/curves.jpg

- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection

In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).

- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
  (Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them

Other fixes:

- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
  the old code made ints from the raster pos coordinate, which doesn't work
  well for zoom in/out situations

- bug in Node editing: buttons could not get freed, causing in memory error
  prints at end of a Blender session. That one was a very simple, but nasty
  error causing me all evening last night to find!
  (Hint; check diff of editnode.c, where uiDoButtons is called)

Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
2006-01-08 11:41:06 +00:00