6 months agoDRW: only show hidden geometry when selection is used
Campbell Barton [Tue, 22 Jan 2019 21:46:26 +0000 (08:46 +1100)]
DRW: only show hidden geometry when selection is used

Matches 2.7x behavior.

6 months agoRevert "Fix T60126: Gradient affects hidden vertices when weight painting"
Campbell Barton [Tue, 22 Jan 2019 21:24:54 +0000 (08:24 +1100)]
Revert "Fix T60126: Gradient affects hidden vertices when weight painting"

This reverts commit 06a6b5dba459d4153d85c5894e3c3e72abeb34e3.

The error is that geometry was hidden in the first place,
this should only apply when selecting verts/faces.

6 months agoFix T58492: smoke flow jitters around flow source when using adaptive domain.
Bastien Montagne [Tue, 22 Jan 2019 20:49:38 +0000 (21:49 +0100)]
Fix T58492: smoke flow jitters around flow source when using adaptive domain.

This is more like a band-aid than a real fix actually, real fix would be
to understand why rendering smoke requires auto texspace to be ON
(afaict, this was not the case in 2.7x)...

But I've already spent way too much time on this issue, at least now we
get better situation than before (i.e. smoke with adaptive domain works
well even when orig domain mesh has autospace flag disabled).

6 months agoMesh eval: Do not condition clearing of auto texspace to dirty bbox.
Bastien Montagne [Tue, 22 Jan 2019 20:47:50 +0000 (21:47 +0100)]
Mesh eval: Do not condition clearing of auto texspace to dirty bbox.

Not sure why that was that way (can't remember any good reason at least,
so assuming this is a dummy mistake from own rB33cbcd73448f), this
should be done in any case.

6 months agoUI: disable scene and view layer delete buttons when not available.
Harley Acheson [Tue, 22 Jan 2019 19:34:06 +0000 (20:34 +0100)]
UI: disable scene and view layer delete buttons when not available.

Differential Revision:

6 months agoFix T60602: outliner pose bone selection does not update in viewport.
Sebastian Parborg [Tue, 22 Jan 2019 19:24:33 +0000 (20:24 +0100)]
Fix T60602: outliner pose bone selection does not update in viewport.

Differential Revision:

6 months agoGP: Fix UV error for second point
Antonioya [Tue, 22 Jan 2019 19:13:56 +0000 (20:13 +0100)]
GP: Fix UV error for second point

The UV was not calculated for second point (1), only first and > 1

6 months agoDefaults: don't use Filmic view transform in Video Editing template.
Brecht Van Lommel [Tue, 22 Jan 2019 18:59:27 +0000 (19:59 +0100)]
Defaults: don't use Filmic view transform in Video Editing template.

It's too slow for now, could be considered if it's optimized more.

6 months agoFix T60722: decimate modifier not working in some cases.
Philipp Oeser [Tue, 22 Jan 2019 18:49:44 +0000 (19:49 +0100)]
Fix T60722: decimate modifier not working in some cases.

7 months agoGP: Recalc UV data for primitive strokes
Antonioya [Tue, 22 Jan 2019 16:54:19 +0000 (17:54 +0100)]
GP: Recalc UV data for primitive strokes

The data was not caculated when complete a primitive and it was only updated when use Edit mode.

7 months agoUI: use same light icon for all light types in properties editor tabs.
Joep Peters [Tue, 22 Jan 2019 14:35:51 +0000 (15:35 +0100)]
UI: use same light icon for all light types in properties editor tabs.

Differential Revision:

7 months agoUV Editor: support snapping to center of pixels, in addition to corners.
Joep Peters [Tue, 22 Jan 2019 14:38:56 +0000 (15:38 +0100)]
UV Editor: support snapping to center of pixels, in addition to corners.

Differential Revision:

7 months agoFix light probe panels not being visible for Cycles.
Brecht Van Lommel [Tue, 22 Jan 2019 14:31:14 +0000 (15:31 +0100)]
Fix light probe panels not being visible for Cycles.

7 months agoFix T60748: Move GP stroke extremes with noise modifier
Antonioya [Tue, 22 Jan 2019 15:48:45 +0000 (16:48 +0100)]
Fix T60748: Move GP stroke extremes with noise modifier

7 months agoFix T58640: Round corner in edge crease of subdivided surfaces
Sergey Sharybin [Tue, 22 Jan 2019 14:33:28 +0000 (15:33 +0100)]
Fix T58640: Round corner in edge crease of subdivided surfaces
Fix T60502: Creasing behavior on 2.8 seams wrong

Was a mistake in a boundary vertices sharpness calculation.

7 months agoFix T60126: Gradient affects hidden vertices when weight painting
Jacques Lucke [Tue, 22 Jan 2019 14:30:37 +0000 (15:30 +0100)]
Fix T60126: Gradient affects hidden vertices when weight painting

Also includes some minor refactoring: use guard clauses instead of nested conditionals.

Reviewers: brecht

Differential Revision:

7 months agoFix T60742, T55974: crash using mesh/curve surface force fields.
Brecht Van Lommel [Tue, 22 Jan 2019 14:17:34 +0000 (15:17 +0100)]
Fix T60742, T55974: crash using mesh/curve surface force fields.

Missing dependency graph relations caused race conditions.

7 months agoFix potential invalid memory access in surface force field BVH tree.
Andrew Williams [Tue, 22 Jan 2019 11:51:14 +0000 (12:51 +0100)]
Fix potential invalid memory access in surface force field BVH tree.

Free the BVH tree immediately along with the mesh, otherwise we might access
invalid mesh data.

Differential Revision:

7 months agoFix T60686: Renaming an animated bone breaks its animation
Sergey Sharybin [Tue, 22 Jan 2019 13:50:58 +0000 (14:50 +0100)]
Fix T60686: Renaming an animated bone breaks its animation

After rename is done we need to make sure all copies of
corresponding datablocks are updated in all dependency
graphs: otherwise bone will have a new name, but animation
will still be using an old one.

7 months agoCleanup: space after template bracket
Sergey Sharybin [Tue, 22 Jan 2019 12:47:08 +0000 (13:47 +0100)]
Cleanup: space after template bracket

7 months agoFix T60737: Crash workbench rendering
Campbell Barton [Tue, 22 Jan 2019 11:27:23 +0000 (22:27 +1100)]
Fix T60737: Crash workbench rendering

Addition of clipping from 7467049055a7
didn't account for non viewport display.

7 months ago3D View: Support vert & weight paint mask clipping
Campbell Barton [Tue, 22 Jan 2019 11:20:19 +0000 (22:20 +1100)]
3D View: Support vert & weight paint mask clipping

7 months agoCleanup: Silence pedantic compiler warning
Sergey Sharybin [Tue, 22 Jan 2019 11:05:48 +0000 (12:05 +0100)]
Cleanup: Silence pedantic compiler warning

Was happening in release builds.

7 months agoCleanup: Remove unused variable
Sergey Sharybin [Tue, 22 Jan 2019 11:02:35 +0000 (12:02 +0100)]
Cleanup: Remove unused variable

7 months agoFix T60575: Multiresolution Crashes when appliing more subdivisions
Sergey Sharybin [Tue, 22 Jan 2019 10:48:28 +0000 (11:48 +0100)]
Fix T60575: Multiresolution Crashes when appliing more subdivisions

The issue was caused by intermediate DerivedMesh being created with
scene's Simplify settings taken into account. This is what happens
when one area makes implicit decisions based on whether passed Scene
pointer is not NULL.

Made it so ignoring simplification serttings is an explicit flag,
which makes it easier to follow what's going on.

7 months agoFix T59395: Subdivision modifier with quality 1 crashes blender
Sergey Sharybin [Mon, 21 Jan 2019 15:43:30 +0000 (16:43 +0100)]
Fix T59395: Subdivision modifier with quality 1 crashes blender

This is actually a workaround for the crash in OpenSubdiv.
Topology refiner will have a crash when special conditions
are met:

- Refiner is configured to use infinitely sharp patches.
- Refinement happens for the level 1 (which we call Quality 1 on
  Blender side).
- Mesh has non-quad faces.

The workaround is to force refinement to happen to level 2 (or
quality 2 on Blender side) when those conditions are met.

Later on with the next OpenSubdiv update we can remove this
workaround, since there was work done on OpenSubdiv side to
deal better with such configurations.

The modifier will now be somewhat slower, but this will be
compensated with upcoming topology cache enabled by default.

The workaround is done when initializing settings, so the
comparison of topology refiner settings is happening without
any extra workarounds there.

7 months agoMerge branch 'blender2.7'
Sergey Sharybin [Tue, 22 Jan 2019 10:57:03 +0000 (11:57 +0100)]
Merge branch 'blender2.7'

7 months agoFix full compilation after recent passes changes
Sergey Sharybin [Tue, 22 Jan 2019 10:56:03 +0000 (11:56 +0100)]
Fix full compilation after recent passes changes

Was caused by c9eef249.

7 months ago3D View: Support edit-mesh clipping (only verts)
Campbell Barton [Tue, 22 Jan 2019 06:23:24 +0000 (17:23 +1100)]
3D View: Support edit-mesh clipping (only verts)

We'll need to replace built-in shaders to add support for clipping.

7 months agoFix T60112: Smooth crashes w/ multiple views
Campbell Barton [Tue, 22 Jan 2019 05:51:31 +0000 (16:51 +1100)]
Fix T60112: Smooth crashes w/ multiple views

7 months agoFix T60643: BMesh operator enum args fail when unset from Python
Campbell Barton [Tue, 22 Jan 2019 03:26:15 +0000 (14:26 +1100)]
Fix T60643: BMesh operator enum args fail when unset from Python

Error introduced with bmesh operator enum support: 1e6a5eb087911

7 months agoCleanup: minor changes to reduce code duplication
Campbell Barton [Tue, 22 Jan 2019 02:51:21 +0000 (13:51 +1100)]
Cleanup: minor changes to reduce code duplication

D4236 by @sobakasu w/ edits.

7 months agoCleanup: de-duplicate font loading code
Campbell Barton [Tue, 22 Jan 2019 02:09:17 +0000 (13:09 +1100)]
Cleanup: de-duplicate font loading code

Part of D4236 by @sobakasu

7 months agoCleanp: use single global for draw manager
Campbell Barton [Tue, 22 Jan 2019 01:09:27 +0000 (12:09 +1100)]
Cleanp: use single global for draw manager

Add 'G_draw' for all draw manager globals,
avoids adding extern to each file.

Connection between `ts` and `globals_ubo` wasn't obvious,
now called `G_draw.block` & `G_draw.block_ubo`.

7 months agoCleanup: use const args
Campbell Barton [Tue, 22 Jan 2019 01:08:33 +0000 (12:08 +1100)]
Cleanup: use const args

7 months agoFix error in last commit
Campbell Barton [Tue, 22 Jan 2019 00:24:27 +0000 (11:24 +1100)]
Fix error in last commit

7 months agoCleanup: use DRW_shader_create_from_arrays
Campbell Barton [Mon, 21 Jan 2019 23:39:35 +0000 (10:39 +1100)]
Cleanup: use DRW_shader_create_from_arrays

Avoids messy conditional defines and inline lib allocation.

7 months agoDRW: Add DRW_shader_create_from_arrays utility
Campbell Barton [Mon, 21 Jan 2019 23:29:46 +0000 (10:29 +1100)]
DRW: Add DRW_shader_create_from_arrays utility

While verbose, this is a more flexible way to construct shaders.

Libs & defines can be optionally included for each shader type
which was previously done with inline string creation.

7 months agoCleanup: remove redundant '_sh' suffix, add '_shgrp'
Campbell Barton [Mon, 21 Jan 2019 21:31:07 +0000 (08:31 +1100)]
Cleanup: remove redundant '_sh' suffix, add '_shgrp'

7 months agoCleanup: rename shader containers
Campbell Barton [Mon, 21 Jan 2019 21:26:43 +0000 (08:26 +1100)]
Cleanup: rename shader containers

These only contain shaders, so name Shaders instead of ShaderData.

7 months agoGP: Cleanup previous commit
Antonioya [Mon, 21 Jan 2019 17:30:15 +0000 (18:30 +0100)]
GP: Cleanup previous commit

7 months agoFix T60714: Avoid creation of nested objects
Antonioya [Mon, 21 Jan 2019 17:29:02 +0000 (18:29 +0100)]
Fix T60714: Avoid creation of nested objects

In grease pencil is not logic add an object inside other object in edit mode. The object must be created only in Object mode.

7 months agoGP: Fix memory leaks when use cutter with weights
Antonioya [Mon, 21 Jan 2019 16:38:47 +0000 (17:38 +0100)]
GP: Fix memory leaks when use cutter with weights

There were some issues when copy the weights and  other memory leaks.

Also some code cleanup.

7 months agoFix keymap preferences UI layout issues for modifier keys.
William Reynish [Mon, 21 Jan 2019 16:20:43 +0000 (17:20 +0100)]
Fix keymap preferences UI layout issues for modifier keys.

7 months agoFix T60683, T60662: Cycles render crash in edit mode for certain meshes.
Brecht Van Lommel [Mon, 21 Jan 2019 14:34:34 +0000 (15:34 +0100)]
Fix T60683, T60662: Cycles render crash in edit mode for certain meshes.

7 months agoDRW: Fix corner indices order in clipping plane setup
Clément Foucault [Mon, 21 Jan 2019 14:21:17 +0000 (15:21 +0100)]
DRW: Fix corner indices order in clipping plane setup

Fix T60667: Eevee: reflection plane bug in rendered view.

7 months agoFix clipping shaders with some AMD/Intel drivers
Campbell Barton [Mon, 21 Jan 2019 12:51:34 +0000 (23:51 +1100)]
Fix clipping shaders with some AMD/Intel drivers

    error: unsized array index must be constant

Use hard coded number of clipping planes, copying the 4th to 5 & 6
when only 4 are used.

7 months agoFix T60709: Apply Object Transform does nothing by default
Jacques Lucke [Mon, 21 Jan 2019 12:43:16 +0000 (13:43 +0100)]
Fix T60709: Apply Object Transform does nothing by default

Clément Foucault [Mon, 21 Jan 2019 11:50:57 +0000 (12:50 +0100)]

This makes it possible to have some code specific to each shader inside a
shader library.

7 months agoT60701: GP using cutter tool on stroke with vertex group crashes blender
Antonioya [Mon, 21 Jan 2019 10:02:24 +0000 (11:02 +0100)]
T60701: GP using cutter tool on stroke with vertex group crashes blender

7 months agoCleanup: add clarifying comments for recent NUMA fixes.
Brecht Van Lommel [Mon, 21 Jan 2019 09:51:19 +0000 (10:51 +0100)]
Cleanup: add clarifying comments for recent NUMA fixes.

7 months agoFix T55461: [Vertex Group] "Delete all unlocked groups" not working.
Bastien Montagne [Mon, 21 Jan 2019 09:35:55 +0000 (10:35 +0100)]
Fix T55461: [Vertex Group] "Delete all unlocked groups" not working.

7 months agoDRW: Support wire overlay clipping
Campbell Barton [Mon, 21 Jan 2019 08:08:42 +0000 (19:08 +1100)]
DRW: Support wire overlay clipping

7 months agoCorrect freeing builtin shader from recent commit
Campbell Barton [Mon, 21 Jan 2019 08:05:29 +0000 (19:05 +1100)]
Correct freeing builtin shader from recent commit

7 months agoFix T60704: Transparency threshold only half visible
Antonioya [Mon, 21 Jan 2019 07:59:42 +0000 (08:59 +0100)]
Fix T60704: Transparency threshold only half visible

7 months agoDRW: pass clipping to geom shader via 'gl_in'
Campbell Barton [Mon, 21 Jan 2019 06:48:16 +0000 (17:48 +1100)]
DRW: pass clipping to geom shader via 'gl_in'

Removes need to pass the worldspace location.

7 months agoCleanup: remove '_sh' suffix
Campbell Barton [Mon, 21 Jan 2019 06:00:18 +0000 (17:00 +1100)]
Cleanup: remove '_sh' suffix

Shaders are now stored in their own struct, no need for special names.

Also free as an array.

7 months agoDRW: Support edit-mesh clipping
Campbell Barton [Mon, 21 Jan 2019 04:57:10 +0000 (15:57 +1100)]
DRW: Support edit-mesh clipping

7 months agoCleanup: rename GPU function to set buffer length
Campbell Barton [Mon, 21 Jan 2019 00:28:41 +0000 (11:28 +1100)]
Cleanup: rename GPU function to set buffer length

7 months agoCleanup: rename terms count/num to len
Campbell Barton [Mon, 21 Jan 2019 00:24:19 +0000 (11:24 +1100)]
Cleanup: rename terms count/num to len

7 months agoCleanup: replace 'ct' w/ 'len'
Campbell Barton [Mon, 21 Jan 2019 00:20:53 +0000 (11:20 +1100)]
Cleanup: replace 'ct' w/ 'len'

7 months agoDRW: set 4 clipping planes for box-clip
Campbell Barton [Mon, 21 Jan 2019 00:12:26 +0000 (11:12 +1100)]
DRW: set 4 clipping planes for box-clip

7 months ago3D View: add back clipping border operator
Campbell Barton [Mon, 21 Jan 2019 00:05:15 +0000 (11:05 +1100)]
3D View: add back clipping border operator

7 months ago3D View: add back initial clipping support
Campbell Barton [Sun, 20 Jan 2019 23:43:01 +0000 (10:43 +1100)]
3D View: add back initial clipping support

Use clipping for workbench solid mode drawing.

Other modes & shading support still needs to be added.

7 months agoCleanup: trailing space
Campbell Barton [Sun, 20 Jan 2019 23:41:39 +0000 (10:41 +1100)]
Cleanup: trailing space

7 months agoCleanup: shadow warning, style
Campbell Barton [Sun, 20 Jan 2019 23:04:09 +0000 (10:04 +1100)]
Cleanup: shadow warning, style

7 months agoFix T60678: GP, smoothing a stroke's weights multiple times will lead to unweightable...
Antonioya [Sun, 20 Jan 2019 19:38:00 +0000 (20:38 +0100)]
Fix T60678: GP, smoothing a stroke's weights multiple times will lead to unweightable points

7 months agoFix T60677: GP vertex groups get messed up, when deleting a group
Antonioya [Sun, 20 Jan 2019 19:31:11 +0000 (20:31 +0100)]
Fix T60677: GP vertex groups get messed up, when deleting a group

7 months agoFix T60671: GP weight paint crash when smoothing weights
Antonioya [Sun, 20 Jan 2019 18:37:13 +0000 (19:37 +0100)]
Fix T60671: GP weight paint crash when smoothing weights

7 months agoGP: Fix mirror modifier with parent object
Antonioya [Sun, 20 Jan 2019 16:57:13 +0000 (17:57 +0100)]
GP: Fix mirror modifier with parent object

Still problems when local rotation.

Some cleanup done.

7 months agoCleanup: remove all BLI_utiledefines' ugly vectorial macros.
Bastien Montagne [Sun, 20 Jan 2019 15:22:55 +0000 (16:22 +0100)]
Cleanup: remove all BLI_utiledefines' ugly vectorial macros.

Not only were those often making doublons with already existing
BLI_math's stuff, but they were also used to hide implicit type

As usual this adds some more exotic inlined vector functions (one of
the rare cases where I really miss C++ and its templates... ;) ).

7 months agoFix bevel modifier spread value bug.
Howard Trickey [Sat, 19 Jan 2019 20:56:11 +0000 (15:56 -0500)]
Fix bevel modifier spread value bug.

Was using same field as value, by mistake.

7 months agoCleanup: add trailing commas
Campbell Barton [Sat, 19 Jan 2019 02:21:18 +0000 (13:21 +1100)]
Cleanup: add trailing commas

Prevents clang-format merging into a single line.

7 months agoMerge branch 'blender2.7'
Brecht Van Lommel [Fri, 18 Jan 2019 20:00:24 +0000 (21:00 +0100)]
Merge branch 'blender2.7'

7 months agoFix T60627: Cycles render hanging on Windows with threadripper CPU.
Sergey Sharybin [Fri, 18 Jan 2019 18:45:39 +0000 (19:45 +0100)]
Fix T60627: Cycles render hanging on Windows with threadripper CPU.

7 months agoFix T60585: Cycles not using all cores on threadripper, after recent changes.
Brecht Van Lommel [Fri, 18 Jan 2019 18:15:38 +0000 (19:15 +0100)]
Fix T60585: Cycles not using all cores on threadripper, after recent changes.

7 months agoFix T60585: Cycles not using all cores on threadripper, after recent changes.
Brecht Van Lommel [Fri, 18 Jan 2019 18:15:38 +0000 (19:15 +0100)]
Fix T60585: Cycles not using all cores on threadripper, after recent changes.

7 months agoAdd miter pattern options.
Howard Trickey [Fri, 18 Jan 2019 17:54:10 +0000 (12:54 -0500)]
Add miter pattern options.

Will document the new options in release notes, then in manual.
Still a bit of work to do on the bulging shape that appears
on cube corners if using arc inner miters, but will do that later.
Also need to do something smarter in clamp overlap.

7 months agoFix T60615: Cycles baking not working with some modifiers.
Brecht Van Lommel [Tue, 15 Jan 2019 12:03:09 +0000 (13:03 +0100)]
Fix T60615: Cycles baking not working with some modifiers.

Refactors Cycles mesh export a bit to avoid unnecessary copies and to be in
sync with the Blender baker.

7 months agoGP: Guides: Fix bug with Mkey and Circular guides
Charlie Jolly [Fri, 18 Jan 2019 15:50:16 +0000 (15:50 +0000)]
GP: Guides: Fix bug with Mkey and Circular guides

Reported by @pepeland.

Adding missing events on the first point was breaking the guide behaviour.
Also, updated Ckey so it always defaults to Circular mode when guides are off.

7 months agoView 3D Grid: Improve precision and reduce code complexity
Clément Foucault [Fri, 18 Jan 2019 15:29:52 +0000 (16:29 +0100)]
View 3D Grid: Improve precision and reduce code complexity

Instead of doing manual ray-plane intersection we use normalized positions
of the grid mesh and apply scaling after interpolation so that we keep
good precision even at really far distances.

Precision is now two order of magnitude better and does not produce the
same kind of artifact at lower clip start values.

This commit also cleanup the implementation.

Fixes T58918 Grid not appearing correctly at low clip start in 2.8

7 months agoPreferences: assortment of minor layout tweaks.
Brecht Van Lommel [Fri, 18 Jan 2019 10:31:26 +0000 (11:31 +0100)]
Preferences: assortment of minor layout tweaks.

7 months agoCycles: Fixed uninitialized memory
Stefan Werner [Fri, 18 Jan 2019 14:16:11 +0000 (15:16 +0100)]
Cycles: Fixed uninitialized memory

Cryptomatte on CPU with accurate mode was hitting uninitialized variables.
This is now explicitly initializing them to NULL.

7 months agoFix/workaround: Undo erase all dyntopo changes
Campbell Barton [Fri, 18 Jan 2019 13:48:00 +0000 (00:48 +1100)]
Fix/workaround: Undo erase all dyntopo changes

Memfile undo isn't compatible with sculpt or edit-mode.

This didn't work in 2.7x, so best disable memfile undo for now in
situations where it's going to loose data or crash.

7 months agoFix loading a file saved w/ dyntopo
Campbell Barton [Fri, 18 Jan 2019 12:15:22 +0000 (23:15 +1100)]
Fix loading a file saved w/ dyntopo

Ensure ED_editors_init doesn't create any undo steps
before the initial memfile undo is written.

7 months agoFix undo push entering sculpt mode
Campbell Barton [Fri, 18 Jan 2019 12:15:00 +0000 (23:15 +1100)]
Fix undo push entering sculpt mode

7 months agoCleanup: remove unnecessary CUDA architecture sm_72, it's for Tegra chips.
Brecht Van Lommel [Fri, 18 Jan 2019 11:38:19 +0000 (12:38 +0100)]
Cleanup: remove unnecessary CUDA architecture sm_72, it's for Tegra chips.

7 months agoSubdiv CCG: Cleanup, comments
Sergey Sharybin [Fri, 18 Jan 2019 10:28:38 +0000 (11:28 +0100)]
Subdiv CCG: Cleanup, comments

7 months agoMultires: Correct averaging
Sergey Sharybin [Thu, 17 Jan 2019 17:09:47 +0000 (18:09 +0100)]
Multires: Correct averaging

Before that only normal component was averaged, which is not
really correct.

Unfortunately, the new code is somewhat slower due to more
involved math to deal properly with non-quad faces, but the
plan is to move averaging from runtime to edit time, This
means, that mdisps will always be continuous around the edges
and no averaging on every frame change of animated character
will be needed.

7 months agoMath: Make it possible to use vector for both input and output
Sergey Sharybin [Thu, 17 Jan 2019 14:41:27 +0000 (15:41 +0100)]
Math: Make it possible to use vector for both input and output

Avoids nasty code all over where such math is required, and
compilers can easily deal with such situation.

Don't prefer questionable micro-optimization which comes with
a cost of nasty actual logic code.

7 months agoMultires: Ensure continuity when reshaping from object
Sergey Sharybin [Thu, 17 Jan 2019 14:08:41 +0000 (15:08 +0100)]
Multires: Ensure continuity when reshaping from object

7 months agoSubdiv: Fix wrong corner passed to a callback
Sergey Sharybin [Thu, 17 Jan 2019 11:55:51 +0000 (12:55 +0100)]
Subdiv: Fix wrong corner passed to a callback

7 months agoMultires: Simplify reshaping code
Sergey Sharybin [Thu, 17 Jan 2019 11:06:26 +0000 (12:06 +0100)]
Multires: Simplify reshaping code

The idea is to run reshaping for every boundary vertex
of a grid rather than trying to copy boundary grid

While this is somewhat slower, this avoids all this
tangent flipping magic, which tempts to be rather tricky
and fragile.

7 months agoMultires: Correct function name, to match behavior
Sergey Sharybin [Thu, 17 Jan 2019 10:17:15 +0000 (11:17 +0100)]
Multires: Correct function name, to match behavior

7 months agoMultires: Fix spike issues when sculpting on triangles
Sergey Sharybin [Thu, 17 Jan 2019 09:49:43 +0000 (10:49 +0100)]
Multires: Fix spike issues when sculpting on triangles

The boundary copy code was not dealing correct with flipping
tangent vectors, hence causing discontinuity in the final

Now we only copy boundaries for quads, where we know how to
deal with tangent vectors and where we know that this is

More clear solution could be to change the code in a way that
handles handles displacement grids of quads in the same way
as it's done for non-quad faces.

7 months agoMultires: Cleanup, move utility function to a more public place
Sergey Sharybin [Thu, 17 Jan 2019 09:47:14 +0000 (10:47 +0100)]
Multires: Cleanup, move utility function to a more public place

7 months agoMultires: Cleanup, more clear naming
Sergey Sharybin [Thu, 17 Jan 2019 09:41:40 +0000 (10:41 +0100)]
Multires: Cleanup, more clear naming

7 months agoGP: Create materials when separate active layer
Antonioya [Fri, 18 Jan 2019 09:52:38 +0000 (10:52 +0100)]
GP: Create materials when separate active layer

The materials were not created when used the active layer option of the separate operator.

7 months agoDRW: Increase frustum culling precision
Clément Foucault [Fri, 18 Jan 2019 09:22:11 +0000 (10:22 +0100)]
DRW: Increase frustum culling precision

Use normal_quad_v3 instead of normal_tri_v3 and compute the mean of all
corner distance during frustum plane extraction.

Fix T58243 Flickering of viewport when rotating and zooming

7 months agoDRW: Fix assert when using draw debug API
Clément Foucault [Fri, 18 Jan 2019 08:58:04 +0000 (09:58 +0100)]
DRW: Fix assert when using draw debug API