Commit Graph

205 Commits

Author SHA1 Message Date
Richard Antalik ab3a9dc1ed VSE: prefetching
When enabled prefetching(preview panel>view settings), a pernament running job
is created, that will render frames in the background until the cache is full.
If the cache is not filled fast enough, prefetch job suspends itself
at the last moment and will wait until it has chance to "catch up".
Effectively this will decouple rendering to separate thread, so rendering
itself is a bit faster.
Cache recycling behavior will be changed to "free furthest frame to the left
of playhead if possible, otherwise rightmost frame".

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5386
2019-09-13 17:24:42 -07:00
Campbell Barton 6eadd40597 Cleanup: redundant struct declarations 2019-08-25 16:45:47 +10:00
Sergey Sharybin 0767f95a63 Sound: Fix queries of sound info
A lot of areas were querying sound information directly using audio handle
which does not exist on an original sound IDs.

This change basically makes it so it's possible to query information about
given sound ID, without worrying about whether it's loaded or not: if it is
needed to load it first it happens automatically (no automatically-opened
handles are left behind though).

While this seems a bit extreme to open files on such queries it is still
better than the old situation when all sound handles were opened on file
load, no matter if it's needed or not. Besides, none of the changed code
paths are performance critical, just handful of tools.

Fixes T65696: Sequencer fails to create a new sound sequence strip via Python
Fixes T65656: Audio strip - SHIFT K crashes Blender

Reviewers: brecht

Reviewed By: brecht

Subscribers: ISS

Maniphest Tasks: T65696, T65656

Differential Revision: https://developer.blender.org/D5061
2019-06-11 15:11:07 +02:00
Richard Antalik 9c00605729 VSE: Cache invalidation
Add invalidation to strip add functions
Add invalidation for scene and movieclip strips
Skip invalidation for sound strips

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4989
2019-06-06 16:23:39 -07:00
Richard Antalik 7ccc7ef61f VSE: don't add crop and transform data for sound strips
This also fixes commit rB1fd7b380f4cf8a0489b405de2819f228a4da5ea2 which
didn't do allocation for effect strips properly.

Reviewed By: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D4970
2019-05-30 15:47:25 -07:00
Richard Antalik fd51d2f97c VSE: minimal cache invalidation 2019-05-23 11:52:28 -07:00
Jeroen Bakker b52a0c78af Workbench,EEVEE: Viewport Render Samples
- Add `render_aa` and `viewport_aa` sampling setting for workbench. 0
   samples means no AA, 1 sample uses FXAA and more samples will use
   TAA.
   The viewport `gpu_viewport_quality` can still limit viewport anti-aliasing
   method.
 - Use TAA when rendering images. (this used to be CPU based FSAA)
 - Removed `R_OSA` related settings.

Reviewers: fclem, brecht

Maniphest Tasks: T60847

Differential Revision: https://developer.blender.org/D4773
2019-05-02 16:19:12 +02:00
Richard Antalik bc597eb487 Fix T49589: 2.78 VSE no longer caching Node Editor scene strips
Sequencer cache was cleared when rendering compositor output.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4758
2019-05-01 05:16:01 -07:00
Jeroen Bakker d1f6ea2793 Sequencer: Scene Strip Performance
- Merged SEQ_OFSDRAW with V3D_OFSDRAW and define in the
       DNA_view3d_types: Due to this FSAA always kicked in making the
       rendering slow.
     - Removed `Texture Solid` and `DOF`.
     - Now when chosing Solid rendering the settings
       of the original scene is used.
     - Added a global override to use scene specific shading. In the
       Future we will need to enhanced this so user can change the
       settings.
     - Added support for LookDev. LookDev crashed as it needed the
       `evil_C` what was not set
     - LookDev mode will always show the scene + world lights.

Reviewed By: brecht, fclem

Maniphest Tasks: T62517

Differential Revision: https://developer.blender.org/D4738
2019-04-30 14:01:22 +02:00
Richard Antalik 337cac760b VSE: Cache rewrite
This patch implements new cache system.
Aim is to give user more control over cache, so it can be maximally
utilized. This is done through sequencer timeline side panel
in category proxy & cache.
Cached images are also visualized in timeline, controled by
sequencer timeline view->cache menu

Functional changes:
 - NOT use IMB_moviecache API
 - refactor names of cached image types
 - each scene owns 1 sequencer cache
 - merge preprocess cache into per-sequencer cache
 - cache links images rendered per frame in order as they are created
 - add cache content visualization tool
 - add RNA properties to control the cache

More info can be found in design notes in blenkernel/intern/seqcache.c
and in https://developer.blender.org/D4443

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4443
2019-04-28 14:50:48 -07:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton dbc058301b Cleanup: trailing commas 2019-04-16 16:40:47 +02:00
Richard Antalik 82b3b1a3c6 Revert "Glyph cache is cleared by UI_view2d_zoom_cache_reset, when zooming V2D, but is required to calculate text height in UI_view2d_text_cache_draw"
Accidentaly committed unwanted changes.

This reverts commit 6bcdcc96c2.
2019-02-23 11:33:48 -08:00
Richard Antalik 6bcdcc96c2 Glyph cache is cleared by UI_view2d_zoom_cache_reset, when zooming V2D, but is required to calculate text height in UI_view2d_text_cache_draw
This caused text in strips to "jump around"

There was a comment in UI_view2d_zoom_cache_reset:
While scaling we can accumulate fonts at many sizes (~20 or so).
Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244].

Reviewed by: Brecht

Differential revision: https://developer.blender.org/D4389
2019-02-23 06:14:44 -08:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Richard Antalik b3dbe17658 Add font selection to VSE text strips
Allows users to select a font for text strips in the video sequence editor.

Related: 3610f1fc43 Sequencer: refactor clipboard copy to no longer increase user count.

Reviewed by: Brecht

Differential Revision: https://developer.blender.org/D3621
2019-01-13 21:57:09 -08:00
Bastien Montagne ee34275e7d Merge branch 'blender2.7' 2019-01-11 20:03:42 +01:00
Bastien Montagne 1ded3d2f7c Fix T55668: Volume Keyframe on Cut-ted Metastrip (re-doing the fix in better way).
Fix T60194: Sequencer cut loses animation data for the right strip.

Fixing the first also fixes the second. First attempt was delaying
uniquename check at a later step of cut process, after everything had
been duplicated. While this fixed first issue, second one became even
more proeminent (it become active for all strips, and not only
video/audio movie strips in meta's).

So instead, passing along the list of (new) sequences, so that duplicated
seqs can be put there immediately, before checking for unique names,
henceforth ensuring even strips inside meta's get properly handled.
2019-01-11 20:01:01 +01:00
Bastien Montagne c97794520f Revert "Fix T55668: Volume Keyframe on Cut-ted Metastrip."
This partially reverts commit bb98e83b99.
It fixed 'strips having same name' issue, but broke handling of
animation then. Need to find a better way to handle this.
2019-01-11 19:49:06 +01:00
Brecht Van Lommel 3610f1fc43 Sequencer: refactor clipboard copy to no longer increase user count.
The clipboard is not a real user and should not be counted. Only on paste
should the user count increase.

This is part of D3621, and was implemented by Richard Antalik and me.
2018-12-28 14:08:02 +01:00
Campbell Barton a760e73dcf Merge branch 'master' into blender2.8 2018-11-30 15:49:06 +11:00
Campbell Barton 6429e6c91e Cleanup: ensure '_END' macros end with a semicolon
Missing these breaks auto-indent for editors that don't expand macros.
2018-11-30 15:35:15 +11:00
Bastien Montagne adbccae4b4 Merge branch 'master' into blender2.8
Note: Moved doversion of VSE strips uniquename to 2.8 versionning area,
and raised accordingly current file subversion, since that bug also
affected previous 2.8 .blend files...

Conflicts:
	source/blender/blenkernel/BKE_blender_version.h
2018-07-23 17:52:52 +02:00
Bastien Montagne bb98e83b99 Fix T55668: Volume Keyframe on Cut-ted Metastrip.
We actually still had cases of Meta strip duplication resulting in
non-unique strip names. Quiet surprising this went unoticed for so long. :(

Fixed that bug, and think it was last one (at least, no other case of
SEQ_DUPE_UNIQUE_NAME usage should be broken, I think...), and raised
subversion and updated doversion to run uniquename check on strips on
all previous fileversions.

Note: will have to do that again when merging in 2.8...
2018-07-23 17:42:55 +02:00
Campbell Barton 06a1a66a9b Merge branch 'master' into blender2.8 2018-06-17 17:10:19 +02:00
Campbell Barton 6fc8a74886 Cleanup: trailing space for blenkernel 2018-06-17 17:05:51 +02:00
Bastien Montagne c98b2e74df Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_relations.c
2018-06-12 12:38:54 +02:00
Bastien Montagne 75bcb70c60 Cleanup: remove some G.main from BKE area. 2018-06-12 11:21:54 +02:00
Bastien Montagne 7b6af843c2 Cleanup: getting rid of G.main.
Sometimes one needs a *lot* of changes for a single G.main... :/
2018-06-08 12:17:22 +02:00
Sergey Sharybin 48ea2131aa Sequencer: Make dependency graph part of sequencer context
Currently unused, but will be needed soon to deal with active edit
window context.
2018-05-31 18:07:55 +02:00
Bastien Montagne 20b6eabd42 Fix (unreported) broken freeing code for Sequencer.
Freeing sequencer would always do usercount, which is now forbidden when
called from main ID freeing code.

Annoying in 2.7x, much more critical issue in 2.8!

Also, moved RNA sequencer API functions to proper rna_scene_api.c file.
2018-05-11 11:36:48 +02:00
Bastien Montagne d5c1c0b10d Fix (unreported) broken freeing code for Sequencer.
Freeing sequencer would always do usercount, which is now forbidden when
called from main ID freeing code.

Annoying in 2.7x, much more critical issue in 2.8!

Also, moved RNA sequencer API functions to proper rna_scene_api.c file.
2018-05-11 11:23:11 +02:00
Ton Roosendaal 51b796ff15 Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!

* Point density, voxel data, ocean, environment map textures were removed,
  as these only worked within BI rendering. Note that the ocean modifier
  and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
  with BI. If we ever wanted to support this again probably it should go
  through the baking API.
* GPU shader export through the Python API was removed. This only worked
  for the old BI GLSL shaders, which no longer exists. Doing something
  similar for Eevee would be significantly more complicated because it
  uses a lot of multiplass rendering and logic outside the shader, it's
  probably impractical.
* Collada material import / export code is mostly gone, as it only worked
  for BI materials. We need to add Cycles / Eevee material support at some
  point.
* The mesh noise operator was removed since it only worked with BI
  material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
  for BI material texture slots. Could be added back with node support.

* Not all legacy viewport features are supported in the new viewport, but
  their code was removed. If we need to bring anything back we can look at
  older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
  that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
  used anywhere now. We may eventually use this to replace the texture
  nodes with Cycles / Eevee shader nodes.

* The Cycles Bake panel now includes settings for baking multires normal
  and displacement maps. The underlying code needs to be merged properly,
  and we plan to add back support for multires AO baking and add support
  to Cycles baking for features like vertex color, displacement, and other
  missing baking features.

* This commit removes DNA and the Python API for BI material, lamp, world
  and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
  are reusing some old BI properties but the names are not really correct
  anymore.
* Texture slots for materials, lamps and world were removed. They remain
  for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
  other renderers use this to find all panels to show, minus a few panels
  that they have their own replacement for.
2018-04-19 17:35:25 +02:00
Brecht Van Lommel f9cf2e2f6c Workspaces: remove workspace engine, use 3D viewport draw mode instead.
ViewRender was removed, which means we can't get the render engine for files
saved in 2.8. We assume that any files saved in 2.8 were intended to use Eevee
and set the engine to that.

A fix included with this is that .blend thumbails now draw with Clay mode,
and never Eevee or Cycles. These were drawn with solid mode in 2.7, and should
be very fast and not e.g. load heavy image textures.

Differential Revision: https://developer.blender.org/D3156
2018-04-18 16:35:38 +02:00
Brecht Van Lommel 34ab90f546 Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.

This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.

Differential Revision: https://developer.blender.org/D3152
2018-04-16 19:55:33 +02:00
Brecht Van Lommel eec5d3a8a8 Depsgraph: remove engine type from evaluation context.
This was only used for viewport rendering, where we can just pass the engine
type directly. There is no technical reason why we can't draw the same depsgrpah
with different render engines.

It also led to some weird things like requiring a render engine for snapping
and raycast API functions.

Differential Revision: https://developer.blender.org/D3145
2018-04-13 14:17:32 +02:00
Clément Foucault 47acd706fd GPUCompositing: Remove entire module.
This module has no use now with the new DrawManager and DrawEngines and it
is using deprecated paths.

Moving gpu_shader_fullscreen_vert.glsl
to draw/modes/shaders/common_fullscreen_vert.glsl
2018-03-22 16:11:49 +01:00
Sergey Sharybin 84a154ac68 Merge branch 'master' into blender2.8 2018-03-05 16:14:46 +01:00
Sergey Sharybin df267bd4c4 Sequencer: Expose read-only FPS property for movie-type strips
Main purpose is to make it possible to cover FPS detection with regression test.
But it might also be handy for some other scripters.

Thanks Campbell for review!
2018-03-05 15:01:23 +01:00
Sergey Sharybin 408515810e Merge branch 'master' into blender2.8 2017-11-27 14:08:35 +01:00
Sergey Sharybin 9b42b3e114 Sequencer: Add option to render OpenGL preview with DoF
The title says it all actually, controlled with DoF check box next to textured
solid check box.

Thanks Campbell for review!
2017-11-27 12:21:21 +01:00
Sergey Sharybin 37fc23dd9e Refactor view3d offscreen drawing to avoid having multiple boolean arguments
This is fully unreadable to have lots of boolean arguments scattered across the
whole argument list. What does `false, true, true` mean in terms of behavior?

Replace those with bitfield which has advantage of having more human readable
meaning.
2017-11-27 12:11:56 +01:00
Dalai Felinto b79b8478ee Cleanup: Rename ViewLayer *sl > ViewLayer *view_layer 2017-11-23 14:58:01 -02:00
Dalai Felinto 3abe8b3292 Rename any instance of scene layer or render layer in code with view layer
The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.

* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started

Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.

Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D2927
2017-11-23 07:48:23 -02:00
Dalai Felinto e4f2b2be26 Workspace: Move engines to workspace and Properties Editor cleanup
Engine is not stored in WorkSpaces. That defines the "context" engine, which
is used for the entire UI.

The engine used for the poll of nodes (add node menu, new nodes when "Use Nodes")
is obtained from context.

Introduce a ViewRender struct for viewport settings that are defined for
workspaces and scene. This struct will be populated with the hand-picked
settings that can be defined per workspace as per the 2.8 design.

* use_scene_settings
* properties editor: workshop + organize context path

Use Scene Settings
==================
For viewport drawing, Workspaces have an option to use the Scene render
settings (F12) instead of the viewport settings.

This way users can quickly preview the final render settings, engine and
View Layer. This will affect all the editors in that workspace, and it will be
clearly indicated in the top-bar.

Properties Editor: Add Workspace and organize context path
==========================================================

We now have the properties of:

Scene, Scene > Layer, Scene > World, Workspace

[Scene | Workspace] > Render Layer > Object
[Scene | Workspace] > Render Layer > Object > Data
(...)

Reviewers: Campbell Barton, Julian Eisel
Differential Revision: https://developer.blender.org/D2842
2017-10-16 17:29:04 -02:00
Campbell Barton 1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00