Commit Graph

332 Commits

Author SHA1 Message Date
0807c976f4 code cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,
also correct odd indentation.
2013-03-15 10:48:48 +00:00
f9f7070336 add STREQ macro (commonly used macro like CLAMP, MAX2, STRINGIFY). Use for some areas of the python api, bmesh. 2013-03-10 06:18:03 +00:00
221a383366 use 'bool' for BLI_/BKE_ functions. 2013-03-09 05:35:49 +00:00
c36f20a7d2 style cleanup 2013-03-08 04:00:06 +00:00
5cb22bbedf Fix sequencer crash when pasteing strips after creating new file
Issue happened for scene. movie clip and mask strips, which contains
pointers to datablocks which are freeing on loading new file.

Also, scene strip would crash when pasted from clipboard after scene
was unlinked from file.
2013-02-28 14:25:09 +00:00
fefc684036 Fix #34439: Strip modifier - Mask multiply failure 2013-02-27 09:58:40 +00:00
e5a135e0b2 Fixes for alpha mode do_versions code
Before this change only old flag "Premultiply" was used to
detect alpha mode, which is not enough actually.

Now the logic here is:

- If "Premultiply" was enabled it is likely float image with
  straight alpha, which shall be premultiplied before usage.

  In this case image/sequence Alpha Mode is set to Straight.

- Otherwise use default alpha mode for image format based on
  an extension. This could fail in some cases like TIFF, but
  this wasn't handled fully correct in older blender anyway.

Initial discovered issue was that EXR images saved in older
Blender versions were set to Straight alpha mode, which is
obviously a straight way to lots of headache.
2013-02-19 08:37:08 +00:00
1ba194aedd [#34013] [video sequence editor] Offset and crop of strips are wrong
Applied patch by jehan after confirming the issue.

Thanks for the patch!
2013-02-10 21:01:30 +00:00
95bca1c6bc Small UI annoyance: proxy build progress could is incorrect in some cases 2013-02-07 14:15:30 +00:00
69993c5d40 style cleanup: spaces -> tabs 2013-02-04 00:18:09 +00:00
fa0805e287 Changes for opengl render to reflect new alpha premul pipeline
without hurting quick texture painting

- ED_view3d_draw_offscreen will now output buffer with
  transparent alpha, if sky needed it should be alpha-undered
  later.

- ED_view3d_draw_offscreen_imbuf now accepts alpha mode as an
  argument which could be either R_ADDSKY or R_PREMULALPHA

- OpenGL render and sequencer's opengl preview will now reflect
  scene's Alpha Mode

- Quick Edit will use OpenGL with transparent alpha mode
2013-01-05 15:33:18 +00:00
821d481f53 Correction for rev53555 which was obviously wrong -- always setting alpha to premul
Also optimized it a bit by skipping byte/float buffer allocation.
2013-01-04 13:19:57 +00:00
1022151d6e fix for missing NULL check in BKE_sequence_init_colorspace(). 2013-01-04 11:02:35 +00:00
ea2224e28d changes needed for EDL import to work again.
- add sequence.update(data=False) function.
- made some sequence vars editable.
- correct some comments.

also rename rna function sequence.getStripElem() --> strip_elem_from_frame()
2013-01-02 16:15:45 +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
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
b2c66e268f replace MIN/MAX 3,4 with inline functions 2012-12-21 05:07:26 +00:00
8a4ba61786 Fix part #33534: Building proxies will remove strip animation 2012-12-17 08:45:44 +00:00
dd0e554d9e Sequencer: add textured solid option for opengl preview 2012-12-12 12:42:12 +00:00
743ecc7bd0 Revert recent workaround for sequencer, it'll only work in cases
scene strip is added at frame 1, which is very limited usecase.

Proper solution is not possible yet..
2012-12-12 12:23:30 +00:00
0ec099f282 Sequencer old todo: inserting keyframes with preview opened didn't work
Solved in more like a workaround way by not calling BKE_scene_update_for_newframe
if scene's frame didn't change.
2012-12-12 11:12:37 +00:00
ede703ab85 some minor edits
- script stub printed resource warning with py3.3 (not closing a file).
- bmesh customdata layer access had bad docstring.
- float/double conversion warnings in sequencer code (use doubles since result is double)
- remove unused var
2012-11-29 03:55:07 +00:00
2eb21ef30c Fix #33295: Shifted movie strip when rendering <100% resolution for strip with complex transform
That was kind of a regression since fix for #32091: Crop and offset coordinates changes proxy
render settings on image strips, which is now fixed in other way.

Namely Offset/Crop values are filling in 100% scene resolution values, but getting scaled to
proxy / scene percentage values.
2012-11-28 09:01:00 +00:00
be61d4eeac Fix for animation possible offset in sequencer.
BKE_scene_update_for_newframe should be called before RE_BlenderFrame in
seq_render_scene_strip. It's not entirely nice, but bot sure about better
solution for now.
2012-11-22 11:45:52 +00:00
13e528240c Fix #33263: Sequencer Command Line Bugs
Was own regressions since recursive sequencer commit.
2012-11-22 11:45:39 +00:00
e1d1cc0680 Fix #33253: VSE preview doesn't display compositor
There were two issues in scene strip rendering:

- It will skip rendering if scene doesn't have camera but uses compositor
- G.is_break will cancel preview rendering

Also removed Use Sequencer from scene's strip settings, it's not supported.
2012-11-21 09:36:36 +00:00
66b488acc3 style cleanup 2012-11-11 11:00:55 +00:00
cf503f5c77 Sequencer: disabled sequencer recursion and corrected rendered preview mode
Sequencer recursion was never actually supported and only gives lots of
issues. Disabled it now, so users are not getting confused by semi-working
stuff.

Also made a correction to rendered sequencer preview, so now using scene
strip in it's own sequencer will work properly (it produced black frames
before).

This required killing compositor jobs since they could be using the same
render result as renderer called from sequencer uses.

Small improvements could be:
- Add slight delay before compositor job starts handling nodes so killing
  this job would be fast
- Tag compositor to be updated after preview was fully rendered.
2012-11-09 16:49:17 +00:00
39da858001 Sequencer: input color space support for image and movie strips 2012-11-05 14:44:29 +00:00
fae6c35ca7 code cleanup: quiet -Wdouble-promotion, disabled this warnings for a few files since its done throughout the code in some places. 2012-11-04 07:18:29 +00:00
c9dade4fe0 Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()... 2012-10-26 17:32:50 +00:00
cbc734dd79 comment R_SEQ_GL_REND flag, opengl render now does gl previews. 2012-10-24 03:37:32 +00:00
17530108f4 enable rendering from the sequencer again. this was working since 2.4x and shouldn't have been disabled. 2012-10-24 03:27:11 +00:00
fec81d9b56 use min_ max_ functions in more places.
also fix minor error in MOD decimate when the modifier did nothing the reported face count would be wrong.
2012-10-23 16:21:55 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
2fd2775350 fix for crash in the sequencer if the video file fails to load (missing NULL check on imbuf),
all other uses of sequencer_imbuf_assign_spaces() check for NULL or assume IMB_allocImBuf() succeeds.
2012-10-08 02:20:47 +00:00
63840fd505 Fix #32755: Stripes in Metastrip can not be moved on other channel with mouse (grab tool)
The issue was caused by SEQ_BEGIN macro modifying sequence's depth
which ruined transformation routines. Used own DFS instead which
doesn't modify sequences.

Also corrected some typos in api and comments.
2012-10-04 18:30:28 +00:00
d8144ef0f5 style cleanup: comment blocks 2012-10-04 13:26:15 +00:00
6db84f85dc Fix #32091: Crop and offset coordinates changes proxy render settings on image strips
Made offset and crop working in final resolution space, meaning that visual result
would be the same when using different proxy resolution in sequencer preview and
different resolution percentage when rendering.

It could break some files designed to with render percentage not equal to 100%
using wrong image crop and offset values. But this would also make it easier to
setup scene and render it with different percentage (useful for preview renders
for example)
2012-09-26 10:39:36 +00:00
456a78961c code cleanup: make naming more consistent 2012-09-25 10:21:51 +00:00
bf41aa0168 - Corrected movie clip length computation
- Ignore clip's offset for movie clip sequencer strip
2012-09-24 15:27:04 +00:00
81dc928e50 Sequencer: movie clip float buffers should be converted to internal sequencer space 2012-09-24 15:26:59 +00:00
b4ccf4562c Fix crash on sequencer when movie clip fails to load frame 2012-09-24 14:48:24 +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
cd4ffe496a Sequencer: clear cache and animation buffers for strips outside of cursor when rendering
This avoids having bunch of cached images when doing animation rendering,
keeping all the memory available for rendered itself.

This keeps memory usage low when rendering huge edits with mixed
scenes and movie strips.

This should not affect on sped of video encoding, which was confirmed by
some own tests.

--
svn merge -r50051:50052 ^/branches/soc-2011-tomato
2012-09-14 14:28:24 +00:00
883117077b fix for 2 crashes freeing masks
- freeing a mask from RNA BKE_libblock_free() twice on the mask.
- loading a new blend file would only free the mask and not unlink it from nodes - it would access freed memory.
2012-09-14 01:15:08 +00:00
c3b808721b Sequencer: add missed cache invalidation
Invalidation was missed for:

- Strip (Un)Muting
- Changing speed effect
- Strip translating
2012-09-13 10:51:18 +00:00
6f0cbd787d make freeing sequencer strip without cache an option only exposed within sequencer.c 2012-09-06 09:23:38 +00:00
3bb17bd64a fix for crash in sequencer introduced with recent cache addition,
- running undo with metastrips would crash immediately.
- freeing a strip without a scene would crash (clipboard does this).
2012-09-06 04:45:25 +00:00