Commit Graph

105 Commits

Author SHA1 Message Date
e2429d6492 Woo Hoo. First git commit.
Changes for VC2013

Now, I can build Blender with VC2013 with Cycles, Collada, OpenExr,OpenImageIO disabled. Also, you need VC2008 sp1 installed to make old libs compatible.
2013-11-29 15:13:12 -05:00
a2492e0603 style cleanup: braces/indentation 2013-07-19 16:44:17 +00:00
2df82a2a2b Code cleanup: fix some vs2012 compiler warnings 2013-06-21 12:33:19 +00:00
1f7096bb58 Fix #35658: OpenEXR (from Maya) - missing passes
Added some special case for two-component channels name.

Maybe magic could be simplified to just use last char of
channel name as an id, but extra paranoid check never hurts.
2013-06-10 13:54:09 +00:00
9fe63e82c3 Fix double free error in OpenEXR when file cannot be saved 2013-05-01 19:07:32 +00:00
fe4305ef82 skip calling BKE_editmesh_tessface_calc() from BKE_bmbvh_new(), also quiet float/double warnings. 2013-04-16 13:01:46 +00:00
afe46eeb40 Fix #34689: Multilayer EXRs don't load correctly if one layer is named and the other is not
OpenEXR's ChannelList.layers() will not include empty layer names,
which caused the issue. Made it so if there's one non-empty layer
name, check for empty names happens.

If there's empty layer name in case one non-empty layer name, file
will be considered multilayer now.
2013-03-22 09:18:35 +00:00
2c8d3a969d patch [#34604] Add DPI read write for BMP and OpenEXR format 2013-03-13 07:16:53 +00:00
ae09d2f9d8 Fixe related on #34608: MultiLayer OpenEXR (from Maya) - passes lost in Compositor Image Node
imb_exr_split_channel_name didn't set any value to layer and pass names,
leaving them uninitialized.

This is likely solves initial report, but will know for sure after testing
windows build only.
2013-03-12 10:34:14 +00:00
d1136ba2ef Bug fix #34174
Multilayer files saved from Maya (and I bet others) store the 'primary' layer without
layer or pass name, just as R G B A. Allows viewers to show stuff too, I guess.

Blender now reads this as well, just allowing an empty string for the layer and pass.
2013-02-09 16:54:10 +00:00
08cea96ab0 Alpha premul pipeline cleanup
This assumptions are now made:
- Internally float buffers are always linear alpha-premul colors
- Readers should worry about delivering float buffers with that
  assumptions.
- There's an input image setting to say whether it's stored with
  straight/premul alpha on the disk.
- Byte buffers are now assumed have straight alpha, readers should
  deliver straight alpha.

Some implementation details:

- Removed scene's color unpremultiply setting, which was very
  much confusing and was wrong for default settings.
  Now all renderers assumes to deliver premultiplied alpha.

- IMB_buffer_byte_from_float will now linearize alpha when
  converting from buffer.

- Sequencer's effects were changed to assume bytes have got
  straight alpha. Most of effects will work with bytes still,
  however for glow it was more tricky to avoid data loss, so
  there's a commented out glow implementation which converts
  byte buffer to floats first, operates on floats and returns
  bytes back. It's slower and not sure if it should actually
  be used -- who're using glow on alpha anyway?

- Sequencer modifiers should also be working nice with straight
  bytes now.

- GLSL preview will predivide float textures to make nice shading,
  shading with byte textures worked nice (GLSL was assuming straight
  alpha).

- Blender Internal will set alpha=1 to the whole sky. The same
  happens in Cycles and there's no way to avoid this -- sky is
  neither straight nor premul and doesn't fit color pipeline well.

- Straight alpha mode for render result was also eliminated.

- Conversion to correct alpha need to be done before linearizing
  float buffer.

- TIFF will now load and save files with proper alpha mode setting
  in file meta data header.

- Remove Use Alpha from texture mapping and replaced with image
  datablock setting.

  Behaves much more predictable and clear from code point of view
  and solves possible regressions when non-premultiplied images were
  used as textures with ignoring alpha channel.
2012-12-31 13:52:13 +00:00
1e98e96f7c Windows Libs: move OpenEXR headers to same directory structure as other platforms. 2012-11-19 16:02:29 +00:00
f579aea076 code cleanup: use ptrdiff_t when comparing pointers and tag event as an unused arg to move_to_layer_invoke() 2012-11-13 15:46:55 +00:00
f9428065b8 Bugfix #33161
The new node that outputs multilayer was using longer names than default.
Caused old code that truncated pass names to 11 chars to fail on loading exr.

This was an old limit in openexr - but that got fixed long ago.

On todo: check current openexr name lenghts, and all code in Blender that
defines pass/layer names.
2012-11-13 15:36:46 +00:00
cf6994b910 code cleanup: spelling,
also initialize bmesh-bevel settings struct to zero to avoid possible uninitialized memory later.
2012-11-12 07:33:01 +00:00
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
4572a82de7 Fix #32712: non-multilayer openexr file save for a single channel image would
write wrong colors for float and crash for half-float.
2012-10-01 20:21:50 +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
a5e77e3753 Compiling fix for Windows+Mingw: "Ambiguous" use of IStream 2012-08-26 07:27:51 +00:00
1a2d0d84da Fix for build error on some platforms, seems ImfStdIO.h is not included with
the other headers everywhere.
2012-08-24 14:04:21 +00:00
61a39c7b17 Fix second part #32377: saving/loading exr files to file paths with non-ascii
characters should now work on Windows.
2012-08-24 12:10:35 +00:00
1939baa47d style cleanup 2012-08-22 16:44:32 +00:00
6324c5fed1 code cleanup: includes for imbuf, also remove double promotion. 2012-08-12 23:28:33 +00:00
2c8db87897 fix [#32020] Image will not render in second (any scene other than first) if scene name is longer than 28 characters 2012-07-08 00:04:41 +00:00
e2cda811ac fix for years old bug - OpenEXR always adding alpha channel on load (how did nobody notice this?). 2012-06-14 12:05:38 +00:00
d3c8cdc1c3 code cleanup: zbuf/alpha exr writing 2012-06-14 11:44:05 +00:00
9e6869ea8a style cleanup 2012-06-13 17:27:49 +00:00
d5032657ed style cleanup 2012-06-06 22:38:39 +00:00
Lukas Toenne
9d91bc38d3 A couple more changes to the file and image nodes to improve access to layers that don't follow Blender's rlayer.rpass naming scheme.
--- Changes to File Output node ---
* Flat layer names in EXR multilayer files.

 For a socket with name "AAA" the previous resulting EXR layer name would be "AAA.AAA", i.e. the render layer as well as render pass would use the socket name.

 Now the "render_layer.render_pass" scheme is ignored in multilayer files, socket names are directly written to EXR layers (EXR layer name is "AAA" in this example). If sockets should have a notion of "render layer" this can still be achieved by explicitly adding a separator, e.g. "AAA.BBB". When loading such layers into a Blender Image struct, the name is interpreted as a "render_layer.render_pass" again (although the image node does not care about it, see below).

* Socket sub-paths (for singlelayer) or layer names (for multilayer) are stored in dedicated string variables in the socket storage data. This way the RNA can define precise string subtypes (PROP_FILEPATH) and length. The file/layer slots are defined as separate structs with own name properties in the RNA as well, so they can be used nicely with the list template.

* Ensure unique socket paths/layer names to prevent overwriting of files and layers respectively.

--- Changes to Image node ---
* Loading multilayer OpenEXR files has improved layer name splitting into render layer + render pass names now. This properly supports arbitrary EXR layer names now.
  Example:

 OpenEXR layer name:   AAA.BBB.CCC

 is split into

 Render layer name:    AAA.BBB
 Render pass name:     CCC

 If the layer name has no '.' separators the render layer name is empty.

* Image node ignores the selected render layer in the image user data. Instead all existing layers are displayed at the same time by combining the render layer names with render pass names again, to reconstruct the original EXR layer name. This avoids the problem that render layers with empty name are not selectetable in the dropdown and allows using all image layers at the same time without duplicating the node.
2012-05-11 08:06:01 +00:00
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
Lukas Toenne
c509f687ca Avoid invalid delete call when loading multilayer EXR files with that don't fit the Blender pass naming scheme. If the imb_exr_begin_read_mem function fails reading the EXR (e.g. because of too many channels per pass) it deletes the file internally, leading to segfault on second delete. 2012-04-16 11:57:22 +00:00
Nathan Letwory
0d69b18a05 Make sure Multilayer EXR from other apps are read in as multilayer. 2012-04-03 11:53:38 +00:00
ff951270d5 Solve namespace conflicts for ole grumpy MinGW. It seems FLOAT is also defined in a windef.h header. 2012-04-02 13:48:20 +00:00
86c68c0569 Multithreaded EXR files loading
Use multithreaded loading of EXR files which is enabling by call of
setGlobalThreadCount function from OpenEXR library to set up number
of used threads to number of system threads which speeds up loading
high-resolution files on multi-core / multi-cpu systems and allows
to work with high-resolution sequences in clip editor and sequencer.
2012-04-02 11:04:24 +00:00
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
1ae27144f6 Fix for OpenEXR half float save function resulting in dark images saved
Float buffers of ImBuf are always supposed to be linear space a,d ImBuf's
profile means how byte array was constructed from float buffer.
2012-03-05 18:54:57 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
30fd1ab523 replace ImBuf.depth with ImBuf.planes to match ImageFormatData.planes & to avoid confusion with ImageFormatData.depth 2011-11-21 20:47:19 +00:00
e417e011d5 Code cleanup: file operations merged into single header, some function names
made less cryptic and changed to indicate if they work on files or directories.
2011-10-22 15:35:49 +00:00
a828845f27 reverting 41124, maybe better solution is to enforce linear space in generated float images 2011-10-20 12:15:39 +00:00
364fcde86d #fix: Saving OpenEXR images as floats ignores color profile. This was not noticable in renderer because it works in linear color space. Painting on the image editor, saving and reloading was problematic though. 2011-10-19 23:04:48 +00:00
c27926896f spaces -> tabs (whitespace only changes) 2011-10-06 22:04:01 +00:00
c58a0c5eb8 catch exception and report an error when failing to write exr files - was crashing with debug builds. 2011-08-30 23:08:38 +00:00
2164847928 fix for openexr include path, for both cmake and scons a custom openexr install wouldn't work since it expected BF_OPENEXR/include and BF_OPENEXR/include/OpenEXR to be in the search path. 2011-06-15 11:50:45 +00:00
Nathan Letwory
192ab99b5c doxygen: blender/imbuf tagged. 2011-02-27 20:23:21 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
6a2e5ad599 [#25815] Patch gcc 4.6
with minor edits, made sure it works in CMake too.
2011-01-27 00:02:25 +00:00