blender.git
6 weeks agoObject Mode: add back non '_ex' versions of mode-switching functions
Campbell Barton [Fri, 2 Aug 2019 01:33:57 +0000 (11:33 +1000)]
Object Mode: add back non '_ex' versions of mode-switching functions

While these aren't currently used, its strange to have
extended versions of a function without the non-extended versions
it also avoids callers needing to add them back if they need -
or duplicating the same boiler plate when calling the '_ex' versions.

Reverts 11da3b132aff111da3b132aff1, adds depsgraph argument
so the caller is responsible for the evaluation state.

6 weeks agoCleanup: quiet maybe-unused warnings
Campbell Barton [Fri, 2 Aug 2019 01:18:07 +0000 (11:18 +1000)]
Cleanup: quiet maybe-unused warnings

While harmless, use flow control that always sets the variable.

6 weeks agoCleanup: quiet maybe-unused warning
Campbell Barton [Fri, 2 Aug 2019 01:18:07 +0000 (11:18 +1000)]
Cleanup: quiet maybe-unused warning

While harmless, use flow control that always sets the variable.

6 weeks agoCleanup: padding in windowmanager
Nathan Craddock [Fri, 2 Aug 2019 00:32:12 +0000 (18:32 -0600)]
Cleanup: padding in windowmanager

6 weeks agoKeymap: add fractional zoom shortcuts for sequencer preview
Campbell Barton [Thu, 1 Aug 2019 22:36:03 +0000 (08:36 +1000)]
Keymap: add fractional zoom shortcuts for sequencer preview

Matches shortcuts from the image editor.

D5341 by @tintwotin

6 weeks agoVSE: Use sequencer boundbox for view_all operator
Richard Antalik [Thu, 1 Aug 2019 19:43:15 +0000 (12:43 -0700)]
VSE: Use sequencer boundbox for view_all operator

Fix T67279
Fix T59954

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5368

6 weeks agoFix T66028: Move sequence, movieclip and text editor progressbars to status bar
Richard Antalik [Thu, 1 Aug 2019 19:40:57 +0000 (12:40 -0700)]
Fix T66028: Move sequence, movieclip and text editor progressbars to status bar

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5219

6 weeks agoGPU: more complete coverage of drivers for Intel shader compilation workaround
Brecht Van Lommel [Thu, 1 Aug 2019 18:43:13 +0000 (20:43 +0200)]
GPU: more complete coverage of drivers for Intel shader compilation workaround

6 weeks agoFix T67939: GPencil Noise modifier wrong random calculation
Antonioya [Thu, 1 Aug 2019 15:54:51 +0000 (17:54 +0200)]
Fix T67939: GPencil Noise modifier wrong random calculation

There were several problems in the old random calculation:

* Different result in the viewport and render.
* Noise "pop" in some frames.
* Random number was calculated every time the file was opened, so get different results.

Now, instead to calculate the random numbers when n number of frames changed, the random values are calculated using a unique seed by stroke.

Also, a new Seed parameter has been added and this adds more control in the noise generated. This value can be animated and get more variations.

Differential Revision: http://developer.blender.org/D5393

6 weeks agoCleanup: remove unnecessary include
mano-wii [Thu, 1 Aug 2019 14:31:17 +0000 (11:31 -0300)]
Cleanup: remove unnecessary include

6 weeks agoFix T66040: Make Data Transfer' Mix Factor multiply with vgroup weights when given...
Bastien Montagne [Thu, 1 Aug 2019 14:00:37 +0000 (16:00 +0200)]
Fix T66040: Make Data Transfer' Mix Factor multiply with vgroup weights when given, instead of ignoring it.

Brings behavior of those options in line with the VGroup editing
modifiers ones e.g.

6 weeks agoAlembic: fix heap-use-after-free error
Sybren A. Stüvel [Thu, 1 Aug 2019 13:14:57 +0000 (15:14 +0200)]
Alembic: fix heap-use-after-free error

The mesh can be freed by BKE_mesh_nomain_to_mesh(), so we need to get
the `ME_AUTOSMOOTH` flag before that call, and not after.

6 weeks agoFix T61935: load camera transforms from Alembic files written by Meshroom
Sybren A. Stüvel [Thu, 1 Aug 2019 12:54:22 +0000 (14:54 +0200)]
Fix T61935: load camera transforms from Alembic files written by Meshroom

Meshroom writes two hierarchies to Alembic, one rooted at
`/mvgRoot/mvgCameras` and the other at `/mvgRoot/mvgCamerasUndefined`.
These paths have no schema definition, and thus are ignored by Blender.
The cameras themselves have those schemaless paths as parent, and have
their transforms marked as "inherited", e.g. relative to their parent.
As these cameras have no valid parent, there is no Blender object to use
to convert their local matrices to world matrices, and Blender just
decided to reset them to the unit matrix.

Now "inherited" transforms without a parent in Blender are interpreted
as world transforms. Reparenting those objects to a Blender object will
re-interpret the transforms as local to the parent again.

6 weeks agoFFmpeg pixel format conversion improvements
Sybren A. Stüvel [Thu, 1 Aug 2019 11:01:53 +0000 (13:01 +0200)]
FFmpeg pixel format conversion improvements

FFmpeg expects Blender to feed it pixels in the output pixel format. If
the output pixel format is different than Blender's RGBA, a conversion
is needed (via FFmpeg's `sws_scale()` function). There were a few issues
with this conversion (and surrounding code) that are fixed in this
commit:

- When conversion was necessary a temporary buffer was allocated and
  deallocated for every frame. This is now allocated once and re-used.
- Copying data to the buffer was done byte-for-byte. On little-endian
  machines it is now done line-by-line using `memcpy` for a little speedup.
- The decision whether pixel format conversion is necessary is now
  correctly done based on the pixel format Blender is actually using.
- The pixel format of the buffer sent to FFmpeg is no longer hard-coded
  incorrectly to a fixed pixel format, but uses the actual output pixel
  format. This is fixes T53058 properly, making RGB QTRLE export possible.
- I added some comments to make it clear which pixel format is referred
  to (either Blender's internal format or the FFmpeg output format).

Combined these improvements not only correct a bug (T53058) but also
results in approximately 5% speed improvement (tested with a 117-frame
shot from Spring, loaded as PNGs in the VSE, encoding to h.264 with
preset 'realtime').

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D5174

6 weeks agoFix T68055: mesh selection issues, once blend is loaded second time in a Blender...
mano-wii [Thu, 1 Aug 2019 11:30:57 +0000 (08:30 -0300)]
Fix T68055: mesh selection issues, once blend is loaded second time in a Blender session

The depth attachment of the framebuffer was missing.

6 weeks agoAdded FFmpeg preset for WebM + VP9 video + Opus audio
Sybren A. Stüvel [Thu, 1 Aug 2019 09:52:02 +0000 (11:52 +0200)]
Added FFmpeg preset for WebM + VP9 video + Opus audio

This is a standard combination (VP9 video, Opus audio, in WebM container),
so it's nice to have as a preset.

6 weeks agoI18n messages extraction: do not report multi-lines messages anymore.
Bastien Montagne [Thu, 1 Aug 2019 10:52:10 +0000 (12:52 +0200)]
I18n messages extraction: do not report multi-lines messages anymore.

Those are now supported for tooltips.

6 weeks agoCleanup a bit i18n message extraction code.
Bastien Montagne [Thu, 1 Aug 2019 10:26:21 +0000 (12:26 +0200)]
Cleanup a bit i18n message extraction code.

6 weeks agoKeymap: use Ctrl-/ to toggle comments
Campbell Barton [Thu, 1 Aug 2019 10:32:19 +0000 (20:32 +1000)]
Keymap: use Ctrl-/ to toggle comments

Consistent with many code editors, see: D5175

6 weeks agoText: toggle comment operator
Campbell Barton [Thu, 1 Aug 2019 10:31:57 +0000 (20:31 +1000)]
Text: toggle comment operator

6 weeks agoCleanup: quiet gcc warning 'alloc-size-larger-than'
Campbell Barton [Thu, 1 Aug 2019 10:28:39 +0000 (20:28 +1000)]
Cleanup: quiet gcc warning 'alloc-size-larger-than'

6 weeks agoCleanup: use doxy sections for text operators
Campbell Barton [Thu, 1 Aug 2019 09:27:25 +0000 (19:27 +1000)]
Cleanup: use doxy sections for text operators

6 weeks agoFix T68036: VSE: 'Remove Gaps' causes audio to go out of sync
Philipp Oeser [Thu, 1 Aug 2019 08:19:19 +0000 (10:19 +0200)]
Fix T68036: VSE: 'Remove Gaps' causes audio to go out of sync

Reviewers: sergey

Maniphest Tasks: T68036

Differential Revision: https://developer.blender.org/D5391

6 weeks agoLinux: resolve issue compiling on mint 18.3
Campbell Barton [Thu, 1 Aug 2019 09:14:48 +0000 (19:14 +1000)]
Linux: resolve issue compiling on mint 18.3

size_t wasn't declared. While this could be resolved differently,
convention is to include BKE after BLI.

6 weeks agoCleanup: use _ex suffix instead of _ext
Campbell Barton [Thu, 1 Aug 2019 08:34:52 +0000 (18:34 +1000)]
Cleanup: use _ex suffix instead of _ext

Convention is to use ex, not ext for extended
versions of a functions.

6 weeks agoCleanup: misc spelling fixes in variable names & defines
Campbell Barton [Thu, 1 Aug 2019 07:32:42 +0000 (17:32 +1000)]
Cleanup: misc spelling fixes in variable names & defines

T68045 by @luzpaz

6 weeks agoCleanup: remove redundant LMB select default.
Campbell Barton [Thu, 1 Aug 2019 07:23:58 +0000 (17:23 +1000)]
Cleanup: remove redundant LMB select default.

6 weeks agoFix error setting the user preferences
Campbell Barton [Thu, 1 Aug 2019 07:23:41 +0000 (17:23 +1000)]
Fix error setting the user preferences

User preferences from the startup.blend was still being used,
fixing this exposed missing theme initialization, now fixed.

6 weeks agoFix error de-duplicating BLI_file_read functions
Campbell Barton [Thu, 1 Aug 2019 06:12:39 +0000 (16:12 +1000)]
Fix error de-duplicating BLI_file_read functions

Own error in recent code de-duplication: a345f56ce3331
causing issues on Windows.

Flipped argument for reading the exact size.

6 weeks agoCleanup: misc spelling fixes
Campbell Barton [Thu, 1 Aug 2019 03:53:25 +0000 (13:53 +1000)]
Cleanup: misc spelling fixes

T68035 by @luzpaz

6 weeks agoCleanup/msvc: Remove math.h from creator_signals.c
Lazydodo [Thu, 1 Aug 2019 03:36:52 +0000 (21:36 -0600)]
Cleanup/msvc: Remove math.h from creator_signals.c

Was never needed, looks like it was copy/pasted from creator.c

spotted by @campbellbarton

6 weeks agoCleanup: Remove FMA3 Disable for msvc
Lazydodo [Thu, 1 Aug 2019 02:18:44 +0000 (20:18 -0600)]
Cleanup: Remove FMA3 Disable for msvc

We no longer build with or support msvc2013, so this hack can be removed.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5298

6 weeks agoCleanup: remove unused member
mano-wii [Thu, 1 Aug 2019 01:46:41 +0000 (22:46 -0300)]
Cleanup: remove unused member

6 weeks agoCleanup: move defaults into U_default struct
Campbell Barton [Thu, 1 Aug 2019 00:03:20 +0000 (10:03 +1000)]
Cleanup: move defaults into U_default struct

6 weeks agoCleanup: remove unused compute-id from preferences
Campbell Barton [Wed, 31 Jul 2019 23:08:43 +0000 (09:08 +1000)]
Cleanup: remove unused compute-id from preferences

6 weeks agoCleanup: use braces, unused variable, unused enum
Campbell Barton [Wed, 31 Jul 2019 23:03:50 +0000 (09:03 +1000)]
Cleanup: use braces, unused variable, unused enum

6 weeks agoFix T67951: Bone selection is broken on some Intel GPUs
mano-wii [Wed, 31 Jul 2019 19:35:06 +0000 (16:35 -0300)]
Fix T67951: Bone selection is broken on some Intel GPUs

The problem is that the `glDrawArraysInstancedBaseInstance` is ignoring the last parameter.
The solution is to indicate that `GLEW_ARB_base_instance` is not supported in these cases.

Reviewers: fclem, brecht, jbakker

Reviewed By: fclem, brecht

Differential Revision: https://developer.blender.org/D5383

6 weeks agoFix several undefined-behaviour-sanitizer warnings
Lukas Stockner [Wed, 31 Jul 2019 19:13:29 +0000 (12:13 -0700)]
Fix several undefined-behaviour-sanitizer warnings

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4222

6 weeks agoUI: Correct Spacing for Short Unit Names
Harley Acheson [Wed, 31 Jul 2019 19:14:29 +0000 (12:14 -0700)]
UI: Correct Spacing for Short Unit Names

This adds a space between a value and its short unit name except for foot, inch, degree, arcminute, arcsecond

Differential Revision: https://developer.blender.org/D5051

Reviewed by Brecht Van Lommel

6 weeks agoAdd operator for removing unused material slots
Lukas Stockner [Wed, 31 Jul 2019 19:04:52 +0000 (12:04 -0700)]
Add operator for removing unused material slots

Reviewers: campbellbarton, brecht

Reviewed By: brecht

Subscribers: brecht

Differential Revision: https://developer.blender.org/D4991

6 weeks agoMerge per-shader SVM nodes in the main update thread to avoid locking and resizing...
Lukas Stockner [Wed, 31 Jul 2019 06:29:18 +0000 (23:29 -0700)]
Merge per-shader SVM nodes in the main update thread to avoid locking and resizing overhead

In a test file containing 1300 copies of the same shader, this reduces shader update time from 3.1 sec to 0.05 sec.

Thanks to @swerner for noticing this issue.

Reviewers: brecht, sergey, swerner

Subscribers: swerner

Differential Revision: https://developer.blender.org/D5376

6 weeks agoFix T66785: Blender Menu As Text When Main Menu Collapsed
Harley Acheson [Wed, 31 Jul 2019 18:37:06 +0000 (11:37 -0700)]
Fix T66785: Blender Menu As Text When Main Menu Collapsed

This makes the blender logo menu appear as text if 'Show Menus' is off

Differential Revision: https://developer.blender.org/D5244

Reviewed by Brecht Van Lommel

6 weeks agoClarify in FloatProperty generated docs: single precision floats.
Howard Trickey [Wed, 31 Jul 2019 17:58:09 +0000 (13:58 -0400)]
Clarify in FloatProperty generated docs: single precision floats.

At least one script writer was upset that this was not specified,
as it is different from "floating point" in Python.
Also, docstring for hard and soft min and max for FloatProperty
was wrong, using sys.float_info.min and sys.float_info.max.

6 weeks agoRevert "UI: remove checks for other popovers when switching menu"
Sebastian Parborg [Wed, 31 Jul 2019 17:10:44 +0000 (19:10 +0200)]
Revert "UI: remove checks for other popovers when switching menu"

This reverts commit 77616571292ab1eeb9805797bfdd4525cc306923.

This commit broke overlapping popovers. For example in the color
management tab it would be impossible to select and of the popover
alternatives as it would switch to the menu button under the cursor.

6 weeks agoFix build error after recent cleanup
Brecht Van Lommel [Wed, 31 Jul 2019 16:57:39 +0000 (18:57 +0200)]
Fix build error after recent cleanup

6 weeks agoCleanup: typo in parameter name in function declarations.
Bastien Montagne [Wed, 31 Jul 2019 16:47:26 +0000 (18:47 +0200)]
Cleanup: typo in parameter name in function declarations.

6 weeks agoFix: test object_modifier_array is passing when it shouldn't.
Habib Gahbiche [Wed, 31 Jul 2019 16:29:58 +0000 (18:29 +0200)]
Fix: test object_modifier_array is passing when it shouldn't.

From D5253.

6 weeks agoFix negative boolean
Sergey Sharybin [Wed, 31 Jul 2019 16:20:18 +0000 (18:20 +0200)]
Fix negative boolean

Was a nice looking invention, but is obviously wrong.

Is likely no function changes, since -false is like -0
which is 0 and which false. And -true is like -<non-zero> which
is non-zero as well.

Spotted by Sybren, thanks!

6 weeks agoFix T65837: "Zoom Axis" is not working on the node editor
Sebastian Parborg [Wed, 31 Jul 2019 16:16:37 +0000 (18:16 +0200)]
Fix T65837: "Zoom Axis" is not working on the node editor

We would not take into account the user "Zoom Axis" setting in certain
2D space viewports.  In addition to this, the "Scale Zoom" didn't work
consistently in these spaces either.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5132

6 weeks agoFix T63921: Unable to use confirm on release for keyboard shortcuts
Sebastian Parborg [Wed, 31 Jul 2019 15:59:03 +0000 (17:59 +0200)]
Fix T63921: Unable to use confirm on release for keyboard shortcuts

The first issue was that we were still working around a Xorg bug that
has been solved since a very long time:

https://bugs.freedesktop.org/show_bug.cgi?id=22515

The second issue was that the global "confirm on release for mouse
clicks" was used for keyboard shortcuts as well.

6 weeks agoCleanup: remove unused boost code
Brecht Van Lommel [Wed, 31 Jul 2019 15:41:00 +0000 (17:41 +0200)]
Cleanup: remove unused boost code

6 weeks agoFix T67999: calling obj.data.materials.clear() crashes Blender
Sybren A. Stüvel [Wed, 31 Jul 2019 15:18:04 +0000 (17:18 +0200)]
Fix T67999: calling obj.data.materials.clear() crashes Blender

The `BKE_material_clear_id()` didn't call `test_all_objects_materials()`,
which caused the object and mesh material slot count to go out of sync.

6 weeks agoRefactor access to dependency graph
Sergey Sharybin [Thu, 25 Jul 2019 14:36:22 +0000 (16:36 +0200)]
Refactor access to dependency graph

This change ensures that operators which needs access to evaluated data
first makes sure there is a dependency graph.

Other accesses to the dependency graph made it more explicit about
whether they just need a valid dependency graph pointer or whether they
expect the graph to be already evaluated.

This replaces OPTYPE_USE_EVAL_DATA which is now removed.

Some general rules about usage of accessors:

- Drawing is expected to happen from a fully evaluated dependency graph.
  There is now a function to access it, which will in the future control
  that dependency graph is actually evaluated.

  This check is not yet done because there are some things to be taken
  care about first: for example, post-update hooks might leave scene in
  a state where something is still tagged for update.

- All operators which needs to access evaluated state must use
  CTX_data_ensure_evaluated_depsgraph().

  This function replaces OPTYPE_USE_EVAL_DATA.

  The call is generally to be done in the very beginning of the
  operator, prior other logic (unless this is some comprehensive
  operator which might or might not need access to an evaluated state).

  This call is never to be used from a loop.

  If some utility function requires evaluated state of dependency graph
  the graph is to be passed as an explicit argument. This way it is
  clear that no evaluation happens in a loop or something like this.

- All cases which needs to know dependency graph pointer, but which
  doesn't want to actually evaluate it can use old-style function
  CTX_data_depsgraph_pointer(), assuming that underlying code will
  ensure dependency graph is evaluated prior to accessing it.

- The new functions are replacing OPTYPE_USE_EVAL_DATA, so now it is
  explicit and local about where dependency graph is being ensured.

This commit also contains some fixes of wrong usage of evaluation
functions on original objects. Ideally should be split out, but in
reality with all the APIs being renamed is quite tricky.

Fixes T67454: Blender crash on rapid undo and select

Speculation here is that sometimes undo and selection operators are
sometimes handled in the same event loop iteration, which leaves
non-evaluated dependency graph.

Fixes T67973: Crash on Fix Deforms operator
Fixes T67902: Crash when undo a loop cut

Reviewers: brecht

Reviewed By: brecht

Subscribers: lichtwerk

Maniphest Tasks: T67454

Differential Revision: https://developer.blender.org/D5343

6 weeks agoFix: build error with MSVC
Lazydodo [Wed, 31 Jul 2019 14:44:58 +0000 (08:44 -0600)]
Fix: build error with MSVC

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D5381

6 weeks agoDepsgraph: Fix wrong check for need-to-be-evaluated
Sergey Sharybin [Wed, 31 Jul 2019 14:39:33 +0000 (16:39 +0200)]
Depsgraph: Fix wrong check for need-to-be-evaluated

Was missing since 1693a5efe91.

6 weeks agoFix T67883: Time Remapping doesn't work
Sergey Sharybin [Wed, 31 Jul 2019 14:38:04 +0000 (16:38 +0200)]
Fix T67883: Time Remapping doesn't work

Was caused by 1693a5efe91.

6 weeks agoFix T67597: Texture painting: Texture slots that correspond to nodes inside node_grou...
mano-wii [Wed, 31 Jul 2019 14:37:03 +0000 (11:37 -0300)]
Fix T67597: Texture painting: Texture slots that correspond to nodes inside node_groups don't remain active

Unlike `fill_texpaint_slots_recursive`, `rna_Material_active_paint_texture_index_update` did not search for texture nodes that are inside node groups.

Reviewers: sergey, psy-fi, zeddb, brecht

Subscribers: brecht

Differential Revision: https://developer.blender.org/D5338

6 weeks agoFix T67808: Bright/Contrast node wrong for negative contrast
Philipp Oeser [Wed, 31 Jul 2019 10:22:42 +0000 (12:22 +0200)]
Fix T67808: Bright/Contrast node wrong for negative contrast

strange nobody noticed since 2012...

thx @jenkm for spotting

Reviewers: brecht

Subscribers: jenkm

Maniphest Tasks: T67808

Differential Revision: https://developer.blender.org/D5378

6 weeks agoFix T67573: Missing offset in marker names on current frame
Alessio Monti di Sopra [Wed, 31 Jul 2019 14:15:07 +0000 (16:15 +0200)]
Fix T67573: Missing offset in marker names on current frame

Differential Revision: https://developer.blender.org/D5333

6 weeks agoHave CMake be more strict when optional x11 libraries are missing but enabled
Sebastian Parborg [Wed, 31 Jul 2019 14:15:38 +0000 (16:15 +0200)]
Have CMake be more strict when optional x11 libraries are missing but enabled

Previously cmake would silently disable features that depended on
certain x11 libraries if they were not found. Now we instead error out
and inform the user that these are missing but optional.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5380

6 weeks agoFix T68001: Rotating vertices on the UV map by a fixed number immediately crashes...
Bastien Montagne [Wed, 31 Jul 2019 14:12:33 +0000 (16:12 +0200)]
Fix T68001: Rotating vertices on the UV map by a fixed number immediately crashes Blender.

Spaghetti Transform code can use same code for different kind of data.
The 'stepped rotation' process is actually only useful/doable in a few
cases (when we do have some real place to store rotation value, and we
are using Eulers).

6 weeks agoCleanup: Remove unused function
Sergey Sharybin [Wed, 31 Jul 2019 13:41:35 +0000 (15:41 +0200)]
Cleanup: Remove unused function

6 weeks agoFix T66031: Text Material Change broken.
Bastien Montagne [Wed, 31 Jul 2019 13:36:36 +0000 (15:36 +0200)]
Fix T66031: Text Material Change broken.

font_to_curve code was not handling properly the case where it has nop
object to check for mat indices validity. Check should just not happen
then, not reset mat indices of chars to default 0 value.

6 weeks agoFix Visual Studio compatibility in writeffmpeg.c
Sybren A. Stüvel [Wed, 31 Jul 2019 13:26:25 +0000 (15:26 +0200)]
Fix Visual Studio compatibility in writeffmpeg.c

This fixes an incompatibility with Visual Studio 2019 introduced in
631d5026c7bb34320c5d9b60afa5bc44b40fc5e4. It is likely caused by using
`#  ifdef` inside the use of the `ELEM()` macro.

6 weeks agoAnimation: Remove depsgraph argument from a lot of API
Sergey Sharybin [Wed, 31 Jul 2019 12:56:17 +0000 (14:56 +0200)]
Animation: Remove depsgraph argument from a lot of API

Use explicit boolean flag to indicate whether flush to original data
is needed or not. Makes it possible to avoid confusion on whether an
evaluated or any depsgraph can be passed to the API.

Allows to remove depsgraph from bAnimContext as well.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5379

6 weeks agoAnimation: Remove depsgraph argument from direct keyframing
Sergey Sharybin [Wed, 31 Jul 2019 10:22:43 +0000 (12:22 +0200)]
Animation: Remove depsgraph argument from direct keyframing

It was used to access evaluated object and pose and was done prior
to implementation of flushing values back to original data for an
active dependency graph.

Removing the argument allows to simplify API and solve issues with
accessing missing dependency graph on redo.

6 weeks agoFix: Cycles reporting incorrect number of samples in viewport render
Jeroen Bakker [Wed, 31 Jul 2019 12:32:37 +0000 (14:32 +0200)]
Fix: Cycles reporting incorrect number of samples in viewport render

During viewport rendering where the viewport samples are set to 0 the UI
showed 16777216 as number of samples. We should not show the number of
samples when the number of viewport samples are set to 0.

Differential Revision: https://developer.blender.org/D5301

6 weeks agoSpelling fixes in comments and descriptions, patch by luzpaz
Brecht Van Lommel [Wed, 31 Jul 2019 12:25:09 +0000 (14:25 +0200)]
Spelling fixes in comments and descriptions, patch by luzpaz

Differential Revision: https://developer.blender.org/D3744

6 weeks agoFix error in user preferences commit
Campbell Barton [Wed, 31 Jul 2019 12:24:19 +0000 (22:24 +1000)]
Fix error in user preferences commit

Add include & initialize variable.

6 weeks agoFix T67652: editing UV vertex location does not work with multiple objects
Brecht Van Lommel [Wed, 31 Jul 2019 11:23:17 +0000 (13:23 +0200)]
Fix T67652: editing UV vertex location does not work with multiple objects

Patch contributed by matc.

Differential Revision: https://developer.blender.org/D5355

6 weeks agoCleanup: remove BLO_update_defaults_userpref_blend
Campbell Barton [Wed, 31 Jul 2019 11:46:13 +0000 (21:46 +1000)]
Cleanup: remove BLO_update_defaults_userpref_blend

Merge into BKE_blendfile_userdef_from_defaults

6 weeks agoPreferences: don't store preferences in the startup
Campbell Barton [Tue, 30 Jul 2019 01:04:02 +0000 (11:04 +1000)]
Preferences: don't store preferences in the startup

Simplify preferences by removing the ability to load them from
either the startup.blend or userpref.blend.

Also simplifies updating default preferences by moving
them to a struct definition.

6 weeks agoUI: tweak naming in snapping popover to be "Snap with" and "Snap to"
EitanSomething [Wed, 31 Jul 2019 10:36:19 +0000 (12:36 +0200)]
UI: tweak naming in snapping popover to be "Snap with" and "Snap to"

To replace "Target" and "Snapping", this should be more clear.

Differential Revision: https://developer.blender.org/D5242

6 weeks agoSculpt/Paint: Brush curve presets
Pablo Dobarro [Wed, 31 Jul 2019 10:58:50 +0000 (12:58 +0200)]
Sculpt/Paint: Brush curve presets

This patch introduces the same presets that are used for proportional editing in the brush falloff menu. The user can select any of these presets or use the regular custom falloff curve. The presets are hardcoded formulas, so the falloff curve is not used when they are active.

This change improves the general feeling of the brushes and it is more convenient and simpler to use. The CUSTOM curve option should now be used in the case that an unusual deformation is needed, in other cases, the hardcoded curve presets should be the default.

The smooth curve presets is a must in the grab brush, as it fixes the deformation issue with the current custom curve setting. The user may try to adjust the deformation by tweaking the curve, but it is nearly impossible to replicate this desired behavior.

{F7636217}

Other brushes that are included in the sculpt branch also rely on this as they need specific hardcoded falloffs to produce the desired effect.

Reviewers: brecht, billreynish

Reviewed By: brecht

Subscribers: JulienKaspar

Differential Revision: https://developer.blender.org/D5367

6 weeks agoFIx T66019: Text cutoffs for descriptions in keyframe insertion (keyingsets).
Bastien Montagne [Wed, 31 Jul 2019 10:29:36 +0000 (12:29 +0200)]
FIx T66019: Text cutoffs for descriptions in keyframe insertion (keyingsets).

6 weeks agoAdded BKE_mesh_clear_geometry() function
Sybren A. Stüvel [Tue, 30 Jul 2019 16:38:31 +0000 (18:38 +0200)]
Added BKE_mesh_clear_geometry() function

This function makes it possible to clear/remove/nuke all the geometry in
a mesh, allowing functions like `Mesh.from_python()` to construct a new
mesh in its place. Without this function, code like in T67627 have to
allocate a new Mesh datablock, fill that, and swap out the old Mesh for
the new one. This introduces issues when exporting, as the new mesh
could be seen by an exporter as unrelated to the old one.

Shape keys are not freed by this function. Freeing those would require
tagging the depsgraph for relations update, which is an expensive
operation. They should be removed explicitly if necessary.

Material slots are also not cleared by this function, in the same way
that they are not cleared when manually removing all geometry from a
mesh.

The `BKE_mesh_clear_geometry()` function is available in Python as
`mesh.clear_geometry()`.

Reviewed by: mont29, brecht

Differential Revision: https://developer.blender.org/D5373

6 weeks agoCleanup: Use explicit forward declaration
Sergey Sharybin [Wed, 31 Jul 2019 09:55:25 +0000 (11:55 +0200)]
Cleanup: Use explicit forward declaration

6 weeks agoUI: remove checks for other popovers when switching menu
Campbell Barton [Wed, 31 Jul 2019 08:51:32 +0000 (18:51 +1000)]
UI: remove checks for other popovers when switching menu

I'm unable to redo the original report,
Revert fix for T43247..

6 weeks agoUI: simplify check for active menu button
Campbell Barton [Wed, 31 Jul 2019 08:45:07 +0000 (18:45 +1000)]
UI: simplify check for active menu button

Dragging to select another popup now checks the menus active button.

6 weeks agoParticle: Cleanup, remove unused depsgraph argument
Sergey Sharybin [Wed, 31 Jul 2019 09:50:42 +0000 (11:50 +0200)]
Particle: Cleanup, remove unused depsgraph argument

6 weeks agoCleanup: Remove unused functions
Sergey Sharybin [Wed, 31 Jul 2019 09:46:32 +0000 (11:46 +0200)]
Cleanup: Remove unused functions

6 weeks agoFFmpeg: Added support for writing Opus audio.
Sybren A. Stüvel [Wed, 31 Jul 2019 09:21:24 +0000 (11:21 +0200)]
FFmpeg: Added support for writing Opus audio.

This audio format is often used in conjunction with VP9 video in a WebM
container. Opus was created with the intention to replace Vorbis and
Speex ([source](https://en.wikipedia.org/wiki/Opus_(audio_format))).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156

6 weeks agoFFmpeg: Added writing of WebM containers
Sybren A. Stüvel [Wed, 31 Jul 2019 09:20:21 +0000 (11:20 +0200)]
FFmpeg: Added writing of WebM containers

This commit adds support for the WebM container. Previously we only
supported the WebM/VP9 video codec, but still required that it was
stored in a Matroska, MP4, or other compatible container format.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156

6 weeks agoFFmpeg: Added support for writing alpha values in WebM/VP9 video
Sybren A. Stüvel [Wed, 31 Jul 2019 09:18:55 +0000 (11:18 +0200)]
FFmpeg: Added support for writing alpha values in WebM/VP9 video

The VP9 video codec supports writing alpha values; now this is available
in Blender too.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156

6 weeks agoCleanup: Simplification of `BKE_ffmpeg_alpha_channel_is_supported()`
Sybren A. Stüvel [Wed, 31 Jul 2019 09:15:14 +0000 (11:15 +0200)]
Cleanup: Simplification of `BKE_ffmpeg_alpha_channel_is_supported()`

Simplified `BKE_ffmpeg_alpha_channel_is_supported()` to use `ELEM()`
instead of a row consecutive `if`-statements.

No functional changes.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156

6 weeks agoDRW manager: select engine: create generic draw_select_id_mesh
mano-wii [Tue, 30 Jul 2019 21:26:35 +0000 (18:26 -0300)]
DRW manager: select engine: create generic draw_select_id_mesh

6 weeks agoCleanup: Rearrange Select Engine into multiple files
mano-wii [Tue, 30 Jul 2019 20:55:20 +0000 (17:55 -0300)]
Cleanup: Rearrange Select Engine into multiple files

6 weeks agocleanup: Fix typo in last commit
Lazydodo [Tue, 30 Jul 2019 20:50:53 +0000 (14:50 -0600)]
cleanup: Fix typo in last commit

Accidentally took the C flags as a base.

6 weeks agoCMake/Windows: Enable JMC on compilers that support it.
Lazydodo [Tue, 30 Jul 2019 20:40:05 +0000 (14:40 -0600)]
CMake/Windows: Enable JMC on compilers that support it.

JMC [1] enables more productive debugging of C++ code in visual studio
this change enables it on debug builds for builds with visual studio 15.8
or higher.

[1] https://devblogs.microsoft.com/cppblog/announcing-jmc-stepping-in-visual-studio/

6 weeks agoDRW manager: select engine: remove redundant calls
mano-wii [Tue, 30 Jul 2019 19:32:08 +0000 (16:32 -0300)]
DRW manager: select engine: remove redundant calls

6 weeks agoCmake/windows: Fix vcpkg bypassing our libs folder.
Lazydodo [Tue, 30 Jul 2019 17:13:33 +0000 (11:13 -0600)]
Cmake/windows: Fix vcpkg bypassing our libs folder.

Occasionally we get reports of people that build blender and end up
with either build errors or end up with builds that do not run on
other systems. The root cause is when you install vpckg and integrate
it into the build system it puts the search path for its includes and
libraries before anything else.

previously we told people to either uninstall vcpkg or remove the
conflicting packages, which was not great.

this change opts out of the use of vcpkg for blender only, so people
can keep using it for other work without issues.

6 weeks agoFix T67939: GPencil Noise modifier step is ignored in render
Antonio Vazquez [Tue, 30 Jul 2019 17:42:43 +0000 (19:42 +0200)]
Fix T67939: GPencil Noise modifier step is ignored in render

The value of the step was calculated using a variable that was removed when the render frame change.

Now, the step is calculated using the modulus of the current frame and recalculate noise only if the remainder that results from performing integer division is equal to 0.

To calculate current frame, the first used frame is calculated to adjust real frame range.

This approach is more stable in viewport and render.

6 weeks agoFix snap package to work with 2.80 version number
Brecht Van Lommel [Tue, 30 Jul 2019 11:56:08 +0000 (13:56 +0200)]
Fix snap package to work with 2.80 version number

Without this it rounds to 2.8.

6 weeks agoFix T65691: GPencil Drawing long strokes turn invisible
Antonioya [Sat, 20 Jul 2019 21:01:19 +0000 (23:01 +0200)]
Fix T65691: GPencil Drawing long strokes turn invisible

There was a fixed limit to the number of points available in a buffer stroke.

Now, the array is expanded as needed using a predefined number of points for each expansion, instead to add one by one. This is done to reduce the number of times the memory allocation is required.

As part of the fix, some variables have been renamed to reflect better their use.

6 weeks agoAlembic export: fix exporting of loop normals
Sybren A. Stüvel [Tue, 30 Jul 2019 15:05:37 +0000 (17:05 +0200)]
Alembic export: fix exporting of loop normals

When the mesh is using custom normals, those should always be exported,
regardless of the `ME_SMOOTH` flag on the invidivual polys.

Also replaced the loop normal writing with the same logic as we use for
reading (less pointer arithmetic, more normal counting).

6 weeks agoAlembic import: load face-varying normals
Sybren A. Stüvel [Fri, 5 Jul 2019 10:36:30 +0000 (12:36 +0200)]
Alembic import: load face-varying normals

Loop normals are called 'Face-varying normals' in Alembic. Before this
commit, the existence of such normals was used to enable smooth shading.
This is incorrect, as the normals could encode flat faces just as well.

This commit adds the loading of these normals as custom loop normals. It
then also enables Auto-Smoothing on the mesh (which is a bit of a
misnomer and indicates to Blender that the custom normals should be
used).

Fixes the glitching described in T65959.

Differential Revision: https://developer.blender.org/D5191

6 weeks agoCleanup: Alembic: renamed 'smooth_normals' to 'export_loop_normals'
Sybren A. Stüvel [Wed, 10 Jul 2019 08:35:39 +0000 (10:35 +0200)]
Cleanup: Alembic: renamed 'smooth_normals' to 'export_loop_normals'

The name now indicates what happens when the variable is set to true.

No functional changes.

6 weeks agoAlembic: changed 'void *user_data' to 'Mesh *mesh'
Sybren A. Stüvel [Thu, 4 Jul 2019 10:04:39 +0000 (12:04 +0200)]
Alembic: changed 'void *user_data' to 'Mesh *mesh'

The only thing that is stored in this pointer is a `Mesh*`, and casting
it from/to `void*` is unnecessary and confusing. Maybe the entire
CDStreamConfig class could/should be removed at some point.

No functional changes.

6 weeks agoAlembic: transformed chain-of-ifs into switch statement
Sybren A. Stüvel [Thu, 4 Jul 2019 09:53:17 +0000 (11:53 +0200)]
Alembic: transformed chain-of-ifs into switch statement

By having a switch statement that lists all the values of the enum, it is
clear which cases we're not handling, and it also allows for warnings in
the future when the enum expands.

No functional changes.

6 weeks agoAlembic: use `r_` prefix for return variables
Sybren A. Stüvel [Thu, 4 Jul 2019 09:51:13 +0000 (11:51 +0200)]
Alembic: use `r_` prefix for return variables

No functional changes.