3 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Mon, 3 Oct 2016 20:54:22 +0000 (20:54 +0000)]
Merge remote-tracking branch 'origin/master' into blender2.8

3 years agoCycles CUDA: make CUDA 8.0 the officially supported version for all platforms.
Brecht Van Lommel [Mon, 3 Oct 2016 20:14:43 +0000 (22:14 +0200)]
Cycles CUDA: make CUDA 8.0 the officially supported version for all platforms.

3 years agoFix Cycles CUDA performance on CUDA 8.0.
Brecht Van Lommel [Sun, 2 Oct 2016 12:48:39 +0000 (14:48 +0200)]
Fix Cycles CUDA performance on CUDA 8.0.

Mostly this is making inlining match CUDA 7.5 in a few performance critical
places. The end result is that performance is now better than before, possibly
due to less register spilling or other CUDA 8.0 compiler improvements.

On benchmarks scenes, there are 3% to 35% render time reductions. Stack memory
usage is reduced a little too.

Reviewed By: sergey

Differential Revision:

3 years agoFix fluid sim build error with MSVC.
Brecht Van Lommel [Mon, 3 Oct 2016 20:07:13 +0000 (22:07 +0200)]
Fix fluid sim build error with MSVC.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Mon, 3 Oct 2016 18:48:00 +0000 (20:48 +0200)]
Merge branch 'master' into blender2.8

3 years agoFix memory leak caused by unknown opeartor of keymap item
Julian Eisel [Mon, 3 Oct 2016 15:52:46 +0000 (17:52 +0200)]
Fix memory leak caused by unknown opeartor of keymap item

3 years agoFix T49548: Entering Cycles Rendered Viewport Unlinks Material from Objects.
Bastien Montagne [Mon, 3 Oct 2016 15:38:14 +0000 (17:38 +0200)]
Fix T49548: Entering Cycles Rendered Viewport Unlinks Material from Objects.

We *always* want to increase mat user count when from Object (and not
Data), because in that case we are moving mat from object to temp
generated mesh, material can never be 'borrowed' in that case.

To be backported to 2.78a

3 years agoFix missing operator-type registration
Julian Eisel [Mon, 3 Oct 2016 14:34:51 +0000 (16:34 +0200)]
Fix missing operator-type registration

Removed in a7dbc0704f217a, but only should've removed default keymap entry.

3 years agoFix T49506: Remove unused File Browser theme settings
Julian Eisel [Mon, 3 Oct 2016 11:26:52 +0000 (13:26 +0200)]
Fix T49506: Remove unused File Browser theme settings

If I didn't miss anything these are indeed not used. Old themes should still work (will only print info on redundant theme defines into console), but updated non-contrib themes already.

3 years agoFix missing new eyedropper keymap entry in
Bastien Montagne [Mon, 3 Oct 2016 10:29:18 +0000 (12:29 +0200)]
Fix missing new eyedropper keymap entry in

Missing from rBe9bcdcdbbd91d9.

3 years ago[Windows/Cycles/Clang] Fix compilation error with clang-cl on windows
lazydodo [Sun, 2 Oct 2016 20:01:23 +0000 (14:01 -0600)]
[Windows/Cycles/Clang] Fix compilation error with clang-cl on windows

3 years agoFix compile errors with Alembic.
Kévin Dietrich [Sun, 2 Oct 2016 18:52:25 +0000 (20:52 +0200)]
Fix compile errors with Alembic.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Sun, 2 Oct 2016 16:53:01 +0000 (18:53 +0200)]
Merge branch 'master' into blender2.8

3 years agoFluids: improve multithreaded CPU usage.
Brecht Van Lommel [Sun, 2 Oct 2016 13:43:02 +0000 (15:43 +0200)]
Fluids: improve multithreaded CPU usage.

Fixes for clamp-omp, fewer shared variables, fix some cases of threads writing
to the same memory location. Issue found by Jens Verwiebe, who reports 30%
speedup with 16 core CPU, when using this with a recent clang-omp version.

3 years agoOpenGL: draw volumetric gpencil with point sprites
Mike Erwin [Sat, 1 Oct 2016 22:11:58 +0000 (18:11 -0400)]
OpenGL: draw volumetric gpencil with point sprites

Transition away from GLU and legacy matrix stack. Using point sprites eliminated the need for most of the matrix math!

Depends on decent support of large aliased points. NVIDIA is good at this, must test limits on AMD & Intel systems.

Still needs proper scaling based on view zoom.

Part of T49042, touches on T49043 and T49450.

3 years agoOpenGL: fix point sprites
Mike Erwin [Sat, 1 Oct 2016 21:34:41 +0000 (17:34 -0400)]
OpenGL: fix point sprites

Apparently GL_POINT_SPRITE is important to GL 3.2+ compatibility profile, not just to GL 2.1 as thought.

We'll remove this during the core profile transition.

3 years agoOpenGL: one more point shader
Mike Erwin [Sat, 1 Oct 2016 21:32:29 +0000 (17:32 -0400)]
OpenGL: one more point shader

Added a built-in shader for points that vary both size and color.

3 years agoFix T49520: broken vertex colors in the game engine.
Brecht Van Lommel [Sat, 1 Oct 2016 20:40:35 +0000 (22:40 +0200)]
Fix T49520: broken vertex colors in the game engine.

3 years ago[Fix unreported bug] Snap align with normal was not working in derivade mesh
Germano Cavalcante [Sat, 1 Oct 2016 19:50:34 +0000 (16:50 -0300)]
[Fix unreported bug] Snap align with normal was not working in derivade mesh

The `use_snapp_align_rotation` option was using only the first vertex

3 years ago[msvc] make.bat - Fix:msbuild platform wasn't set when the architecture was auto...
lazydodo [Sat, 1 Oct 2016 17:21:42 +0000 (11:21 -0600)]
[msvc] make.bat - Fix:msbuild platform wasn't set when the architecture was auto detected.

3 years agoFix T49502: file browser on OS X not highlighting system folders and bookmarks.
Brecht Van Lommel [Sat, 1 Oct 2016 17:14:38 +0000 (19:14 +0200)]
Fix T49502: file browser on OS X not highlighting system folders and bookmarks.

3 years ago[MSVC] Make.bat updates.
lazydodo [Sat, 1 Oct 2016 16:22:28 +0000 (10:22 -0600)]
[MSVC] Make.bat updates.
- Explicitly specify the platform for msbuild, to facilitate builds with just the Visual C++ Build Tools installed.
- When vs2013 is not found, try looking for 2015 as a fallback
- Clear up any batch variables that might have been set from previous runs

3 years agoFix wrong Cycles GLSL pointiness, still not supported but should be neutral 0.5.
Brecht Van Lommel [Sat, 1 Oct 2016 12:44:11 +0000 (14:44 +0200)]
Fix wrong Cycles GLSL pointiness, still not supported but should be neutral 0.5.

3 years agoCycles: implement partial constant folding for exponentiation.
Alexander Gavrilov [Wed, 28 Sep 2016 21:35:53 +0000 (00:35 +0300)]
Cycles: implement partial constant folding for exponentiation.

This is also an important mathematical operation that can be folded
if it is known that one argument is a certain constant. For colors
the operation is provided as a Gamma node.

The SVM Gamma node needs a small fix to make it follow the 0 ^ 0 == 1
rule, same as the Power node, or the Gamma node itself in OSL mode.

Reviewers: #cycles

Differential Revision:

3 years agoOpenGL: new built-in shaders for drawing points
Mike Erwin [Sat, 1 Oct 2016 00:44:22 +0000 (20:44 -0400)]
OpenGL: new built-in shaders for drawing points

Both of these draw round points with jaggy edges, but treat color & size differently.

3 years agoAdd default UV coordinates for torus primitive.
Sebastian Witt [Fri, 30 Sep 2016 23:54:44 +0000 (01:54 +0200)]
Add default UV coordinates for torus primitive.

Fixes T47489.

Reviewed By: brecht

3 years agoFix MSVC compiler warning due to using */* to start comment.
Brecht Van Lommel [Mon, 26 Sep 2016 01:42:09 +0000 (03:42 +0200)]
Fix MSVC compiler warning due to using */* to start comment.

3 years agoOpenGL: add support for programmable point size
Mike Erwin [Fri, 30 Sep 2016 23:51:04 +0000 (19:51 -0400)]
OpenGL: add support for programmable point size

And enable point sprites always. Fragment shaders can use gl_PointCoord now.

3 years agoOpenGL: make platform requirements explicit
Mike Erwin [Fri, 30 Sep 2016 23:10:30 +0000 (19:10 -0400)]
OpenGL: make platform requirements explicit

At context startup, make sure our assumptions about the OpenGL version are true. Should match since we set up the contexts... but this is what asserts are for, to check "should"s!

Part of T49012

3 years agoCleanup: Naming in EditNormals modifier
Sergey Sharybin [Fri, 30 Sep 2016 10:15:18 +0000 (12:15 +0200)]
Cleanup: Naming in EditNormals modifier

3 years agoNormal edit modifier: Fix relation builder for the new dependency graph
Sergey Sharybin [Fri, 30 Sep 2016 09:13:28 +0000 (11:13 +0200)]
Normal edit modifier: Fix relation builder for the new dependency graph

3 years agoDepsgraph: Report proper error when modifier fails to create relation link
Sergey Sharybin [Fri, 30 Sep 2016 09:05:01 +0000 (11:05 +0200)]
Depsgraph: Report proper error when modifier fails to create relation link

3 years agoCUEW: Use latest upstream version
Sergey Sharybin [Fri, 30 Sep 2016 08:36:11 +0000 (10:36 +0200)]
CUEW: Use latest upstream version

Fixes typo in README :)

Thanks to @jesterKing!

3 years agoFix T49489: Pose marker in camera action + marker bound to camera -> crash.
Bastien Montagne [Fri, 30 Sep 2016 08:11:29 +0000 (10:11 +0200)]
Fix T49489: Pose marker in camera action + marker bound to camera -> crash.

'camera' Object pointer of TimeMarkers is a 'temp' hack since Durian project...
Would need to be either made definitive now, or removed/reworked/whatever.

But since we intend to use that object pointer for other needs, and current code
could lead to crashing .blend files, for now let's fix that mess (was missing
some bits in read code, and also totally ignored in libquery code).

Should be safe for 2.78a.

3 years agoUPBGE: Fix crash when calling shade_light texture when mtex has no tex.
Ulysse Martin [Fri, 30 Sep 2016 05:40:17 +0000 (07:40 +0200)]
UPBGE: Fix crash when calling shade_light texture when mtex has no tex.

3 years agoMerge branch 'master' into blender2.8
Julian Eisel [Thu, 29 Sep 2016 23:18:41 +0000 (01:18 +0200)]
Merge branch 'master' into blender2.8


3 years agoOpenGL: draw nurbs control verts with new imm mode
Mike Erwin [Thu, 29 Sep 2016 19:20:24 +0000 (15:20 -0400)]
OpenGL: draw nurbs control verts with new imm mode

patch P397 by @lichtwert + minor const by @merwin

Notes from drawvertsN function:
this used to be called twice (once for selected/active, once for unselected -- guess: to avoid state switches[color]?)
this used to be called in a loop, too (subcurves), moved the loop here to avoid multiple init stuff

Part of T49043

3 years agoCleanup: Style
Julian Eisel [Thu, 29 Sep 2016 19:15:27 +0000 (21:15 +0200)]
Cleanup: Style

3 years agoOpenGL: draw speaker with new immediate mode
Mike Erwin [Thu, 29 Sep 2016 18:47:38 +0000 (14:47 -0400)]
OpenGL: draw speaker with new immediate mode

patch P388 by @lichtwerk, I tweaked a few things.

Since speaker theme color is opaque we leave blend mode alone.

Part of T49043

3 years agoCycles: Support earlier tile rendering termination on cancel
Sergey Sharybin [Thu, 29 Sep 2016 14:00:25 +0000 (16:00 +0200)]
Cycles: Support earlier tile rendering termination on cancel

It will discard the whole tile, but it's still kind of more friendly than
fully locked interface (sort of) for until tile is fully sampled.

Sorry if it causes PITA to merge for the opencl split work, but this issue
bothering a lot when collecting benchmarks.

3 years agoCycles: Fix typo in shader cancel routines
Sergey Sharybin [Thu, 29 Sep 2016 13:48:10 +0000 (15:48 +0200)]
Cycles: Fix typo in shader cancel routines

3 years agoAdopt referenced scene in the context when evaluating sequences within a Scene Strip
Sergey Sharybin [Thu, 29 Sep 2016 13:00:03 +0000 (15:00 +0200)]
Adopt referenced scene in the context when evaluating sequences within a Scene Strip

This change makes it so that when the sequences within a Scene strip are
evaluated, they use the Scene that they come from as the context as opposed
the Scene that the Scene strip is in. This is necessary, for example, in the
case of the MulticamSelector where it needs to reference strips in the original
Scene as opposed to the Scene where the Scene strip is located.

Patch by @Matt (HyperSphere), thanks!

3 years agoCycles: Improve OpenCL line information handling
Sergey Sharybin [Thu, 29 Sep 2016 08:20:24 +0000 (10:20 +0200)]
Cycles: Improve OpenCL line information handling

Previously it was falling back to just a path after #include
statement was finished. Now we fall back to a proper current
file name after dealing with the preprocessor statement.

3 years agoCycles: Cleanup file headers
Sergey Sharybin [Thu, 29 Sep 2016 08:11:40 +0000 (10:11 +0200)]
Cycles: Cleanup file headers

Some of the files were wrongly attributing code to some other
organizations and in few places proper attribution was missing.

This is mainly either a copy-paste error (when new file was
created from an existing one and header wasn't updated) or due
to some refactor which split non-original-BF code with purely
BF code.

Should solve some confusion around.

3 years agoUpdate source tgz builder script
Sergey Sharybin [Thu, 29 Sep 2016 08:05:42 +0000 (10:05 +0200)]
Update source tgz builder script

Was broken since splitting BKE_blender_version from BKE_blender.

3 years ago[MSVC] make.bat updates.
lazydodo [Thu, 29 Sep 2016 01:57:25 +0000 (19:57 -0600)]
[MSVC] make.bat updates.

- The build folder name used to be depended on the order of the parameters, this is now normalized to
"build_windows_[Release/Full/Lite/Headless/Cycles/Bpy]_[x86/x64]_vc[12/14]_[Release/Debug]" regardless of the order of the parameters.

-Use CUDA8 for all kernels when building the release convenience target with visual studio 2015

3 years agoRevert "[Windows/MSVC] Blosc doesn't require debug libraries."
lazydodo [Wed, 28 Sep 2016 23:27:35 +0000 (17:27 -0600)]
Revert "[Windows/MSVC] Blosc doesn't require debug libraries."

turns out it's a C++ lib now-days and it *DOES* require debug libs.

This reverts commit bde5eb8b6303d8d92b7c41d4a3f041bbb73c162d.

3 years agoFix Windows mouse wheel scroll speed
lazydodo [Wed, 28 Sep 2016 23:19:16 +0000 (17:19 -0600)]
Fix Windows mouse wheel scroll speed

In Windows, event dispatching code is throwing out the wheel scroll count value.
Despite of how many fast you move the wheel, it only make one-notch scroll event.

This patch convert wheel event to multiple 1-notch wheel events.

This also correct the handling of smooth scroll mouse wheel (which can report smaller than 1-notch wheel movement) by accumulating the small wheel delta values.

Reviewers: djnz, shadowrom, elubie, #platform:_windows, sergey, juicyfruit, brecht

Reviewed By: shadowrom, elubie, #platform:_windows, brecht

Subscribers: dingto, elubie, brachi, brecht

Differential Revision:

3 years agoComplement fixup for 4a1feaa5558ed603 (texture shaders)
Dalai Felinto [Wed, 28 Sep 2016 19:02:53 +0000 (19:02 +0000)]
Complement fixup for 4a1feaa5558ed603 (texture shaders)

We now multiply the alpha by the image alpha (as per severin
That still doesn't solve the main question of user preference drawing

3 years agoFix animation transition in region overlay not working since 4a1feaa5
Dalai Felinto [Wed, 28 Sep 2016 18:48:51 +0000 (18:48 +0000)]
Fix animation transition in region overlay not working since 4a1feaa5

We still have stills with the User Preference window, though.

3 years agoFix T49478: triangulate of face hangs Blender.
Bastien Montagne [Wed, 28 Sep 2016 18:03:59 +0000 (20:03 +0200)]
Fix T49478: triangulate of face hangs Blender.

Another case of float imprecision leading to endless loop. INcreasing a bit 'noise threashold' seems to work OK.

Not a regression, but might be nice to have in 2.78a.

3 years agoCycles: Cleanup, indentation
Sergey Sharybin [Wed, 28 Sep 2016 15:05:33 +0000 (17:05 +0200)]
Cycles: Cleanup, indentation

3 years agoCycles: Fix compilation error with minimal feature set
Sergey Sharybin [Wed, 28 Sep 2016 15:03:42 +0000 (17:03 +0200)]
Cycles: Fix compilation error with minimal feature set

3 years agoFix T49471: Vertex Connect randomly broken.
Bastien Montagne [Wed, 28 Sep 2016 14:56:19 +0000 (16:56 +0200)]
Fix T49471: Vertex Connect randomly broken.

Not sure where this comes from, but code was converting BMEdge* to BMVert* to check oflags,
i.e. not accessing correct memory.

Regression, to be backported to 2.78a.

3 years agoFixes for pose library change 601ce6a89c4
Sybren A. Stüvel [Wed, 28 Sep 2016 13:40:05 +0000 (15:40 +0200)]
Fixes for pose library change 601ce6a89c4

Apparently the keying sets system doesn't support subclassing
KeyingSetInfo subclasses. I have added a note to the top of the file to
indicate this to future developers.

3 years agoCurve pinning: Allow pinning object data without animated object
Sergey Sharybin [Wed, 28 Sep 2016 13:18:15 +0000 (15:18 +0200)]
Curve pinning: Allow pinning object data without animated object

Special case, so now we can pin tricky cases like animated camera DOF
without requiring to have animation on the object level.

3 years agoFix T49460: Particle group instance 'Use Count' value gets reset on file-load.
Bastien Montagne [Wed, 28 Sep 2016 13:06:50 +0000 (15:06 +0200)]
Fix T49460: Particle group instance 'Use Count' value gets reset on file-load.

Regression caused rBbcc863993ad, write code was assuming dw->ob was always valid,
wich is no more the case right after reading file e.g.

Another good example of how bad it is to use 'hidden' dependencies between datablocks. :(
And another fix to be backported to 2.78a. :(((

3 years agoPOSELIB_OT_pose_add: only create keyframes for selected bones.
Sybren A. Stüvel [Wed, 28 Sep 2016 11:54:57 +0000 (13:54 +0200)]
POSELIB_OT_pose_add: only create keyframes for selected bones.

Previously the pose library used the WholeCharacter key set, which ignores
selection and add keys for almost all bones in the rig. This is a very
slow operation on complex rigs. With this patch, only selected bones are
keyed, defaulting to keying all bones when none are selected.

Note that this fixes the FIXME previously mentioned in the source.

3 years agoFix missing properties editor update when changing 3D View camera
Julian Eisel [Tue, 27 Sep 2016 22:44:31 +0000 (00:44 +0200)]
Fix missing properties editor update when changing 3D View camera

Actually two errors here:
* Properties editor wasn't refreshing on (NC_SCENE | ND_RENDER_OPTIONS) notifiers
* Was using notifier info bits wrongly, needs to send two separate notifiers

Decided to remove ND_RENDER_OPTIONS rather than adding properties editor scene context refresh for it, this is more than a render option change.

3 years agomodernize basic shader a tiny bit
Mike Erwin [Tue, 27 Sep 2016 19:25:31 +0000 (21:25 +0200)]
modernize basic shader a tiny bit

"varying" is redundant here, all GS inputs & outputs vary.

Any code that uses this will be GLSL 1.3 or newer.

3 years agosafety checks in GPU shader library
Mike Erwin [Tue, 27 Sep 2016 17:38:35 +0000 (19:38 +0200)]
safety checks in GPU shader library

If shader compilation fails, or for some other reason the shader is NULL or 0, we need to know.

3 years agofix basic shader syntax when drawing lines
Mike Erwin [Tue, 27 Sep 2016 19:05:48 +0000 (21:05 +0200)]
fix basic shader syntax when drawing lines

Fixed on GL 3.2+, Mac still lays an egg due to the geometry shader.

3 years agoDynamic Paint: Don't store duplicate adjacency links.
Alexander Gavrilov [Tue, 27 Sep 2016 09:21:44 +0000 (12:21 +0300)]
Dynamic Paint: Don't store duplicate adjacency links.

Duplicates can happen at UV seams in case of resolution mismatch
or other complications. It's better not to store them in case it
confuses some math later on.

Reviewers: mont29

Differential Revision:

3 years agoDynamic Paint: Fix adjacency computations at UV seams.
Alexander Gavrilov [Tue, 27 Sep 2016 08:13:04 +0000 (11:13 +0300)]
Dynamic Paint: Fix adjacency computations at UV seams.

1. When adding one pixel border to UV islands prefer grid directions.
   This is more logical as it means neighbor pixels will commonly
   share a border, opposed to just corners.
2. Don't subtract 0.5 when converting float UVs to int in computing
   adjacency across a UV seam. Pixels cover a square with corners
   at int positions and adding/subtracting 0.5 is only for dealing
   with the center point of a pixel.
3. Use the neighbour_pixel field from the correct pixel, and check
   it's not back to the origin point.
4. In the connected UV case, ensure that the returned index actually
   refers to a valid active pixel.

This fixes paint spread not traversing some UV seams, while at the
same time spreading to random unrelated points on other seams.
The first problem is primarily fixed by 2, while the second one
is addressed by item 4.

Differential Revision:

3 years ago[Windows/MSVC] Blosc doesn't require debug libraries.
lazydodo [Tue, 27 Sep 2016 16:24:09 +0000 (10:24 -0600)]
[Windows/MSVC] Blosc doesn't require debug libraries.

3 years agoFix T49466: Stupid typo in logicbricks new copy code from rB776a8548f03a
Bastien Montagne [Tue, 27 Sep 2016 15:55:12 +0000 (17:55 +0200)]
Fix T49466: Stupid typo in logicbricks new copy code from rB776a8548f03a

Moved that code forth and back a few times while creating rB776a8548f03a fix,
ended up forgetting to update it correctly for function where it layed down in the end.

Last-minute fixes are never a good thing... Now we already have real reason for 2.78 'a' release :(

3 years agoFix T49423: Data Preview of group containing only group instances is empty.
Bastien Montagne [Tue, 27 Sep 2016 15:03:03 +0000 (17:03 +0200)]
Fix T49423: Data Preview of group containing only group instances is empty.

Code was not getting correct boundbox in some cases (group only instancing other groups e.g.), now
compute our own bbox in those cases.

Based on patch by @lichtwerk, but extended the fix to include linked datablocks in some cases
(linked objects in local groups, linked objects in local scene, etc.), this was also broken in existing code.

Reviewers: mont29

Subscribers: duarteframos

Differential Revision:

3 years agofix Mac build for Xcode < 8
Mike Erwin [Tue, 27 Sep 2016 14:16:47 +0000 (16:16 +0200)]
fix Mac build for Xcode < 8

We need a long-term fix, but this will get 2.78 out the door.

3 years agocleanup: spacing & alignment
Mike Erwin [Tue, 27 Sep 2016 12:56:58 +0000 (14:56 +0200)]
cleanup: spacing & alignment

3 years agoFix T49461: Dynamic paint wetmap flickers.
Bastien Montagne [Tue, 27 Sep 2016 11:54:26 +0000 (13:54 +0200)]
Fix T49461: Dynamic paint wetmap flickers.

Regression from rBa4a968f, we would adjust current point's wetness without actually protecting it
in new multi-threaded context, leading to concurrent access mess.

Now delay applying wetness reduction to current point to end of function, allows us to avoid having
to lock current point twice together with neighbor one (and reducing spinlock awainting too).

To be backported to 2.78a.

3 years agoFix T49464: Data Transfer modifier slows down redraw of window.
Bastien Montagne [Tue, 27 Sep 2016 10:03:18 +0000 (12:03 +0200)]
Fix T49464: Data Transfer modifier slows down redraw of window.

Never call function that might recompute a DM in an RNA itemf callback (or any UI-related func in general)!
There was an XXX comment asking if this was OK - well, no, it was not. :P

Could be ported back to some 2.78 flavour should we need it.

3 years agoFix most toolbar panels not visible
Julian Eisel [Tue, 27 Sep 2016 01:38:24 +0000 (03:38 +0200)]
Fix most toolbar panels not visible

Was likely in here since initial blender2.8 branch commit (particle removal).

3 years agoimmediate mode: using texture shader for stereo drawing
Dalai Felinto [Mon, 26 Sep 2016 14:31:41 +0000 (14:31 +0000)]
immediate mode: using texture shader for stereo drawing

(for side-by-side and top-bottom stereo modes)

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Mon, 26 Sep 2016 15:19:03 +0000 (17:19 +0200)]
Merge branch 'master' into blender2.8

WARNING! Full build is broken, alembic has not been merged in correctly and has some references to particle stuff.
Don't have time to tackle this now (and probably would be better if someone knowing what he's doing does it anyway).


3 years agoFix export image generated by export UV layout
Sergey Sharybin [Mon, 26 Sep 2016 14:43:06 +0000 (16:43 +0200)]
Fix export image generated by export UV layout

Was only happening with new dependency graph.

The issue here is that scene's depsgraph layers will be 0 unless
it was ever visible. Worked around by checking for 0 layer in the
update_tagged of new depsgraph. This currently kind of following
logic of visible_layers, but is weak.

Committing so studio is unlocked here, will re-evaluate this layer.

3 years agoFix Scene datablocks being created with a real user while never having any real datab...
Bastien Montagne [Mon, 26 Sep 2016 14:35:52 +0000 (16:35 +0200)]
Fix Scene datablocks being created with a real user while never having any real datablock user.

Now using new system dedicated to that kind of cases, id_ensure_real_user(), instead.
That way, usercount of Scenes is handled correctly at deletion time.

Reported by @sergey over IRC, thanks.

3 years agoCleanup: stereo windowmanager code
Dalai Felinto [Mon, 26 Sep 2016 13:56:45 +0000 (13:56 +0000)]
Cleanup: stereo windowmanager code

This will make the changes in blender2.8 branch simpler

3 years agoFix crash in own recent rB776a8548f03a049.
Bastien Montagne [Mon, 26 Sep 2016 07:49:34 +0000 (09:49 +0200)]
Fix crash in own recent rB776a8548f03a049.

New ID may be null, have to check this too!

Reported by @panzergame over IRC, thanks.

To be ported to 2.78 as well.

3 years agoCycles: Use correct light sampling PDF for MIS calculation with Branched Path Tracing
Lukas Stockner [Sun, 25 Sep 2016 20:11:50 +0000 (22:11 +0200)]
Cycles: Use correct light sampling PDF for MIS calculation with Branched Path Tracing

The light sampling functions calculate light sampling PDF for the case that the light has been randomly selected out of all lights.
However, since BPT handles lamps and meshlights separately, this isn't the case. So, to avoid a wrong result, the code just included the 0.5 factor in the throughput.

In theory, however, the correction should be made to the sampling probability, which needs to be doubled. Now, for the regular calculation, that's no real difference since the throughput is divided by the pdf.
However, it does matter for the MIS calculation - it's unbiased both ways, but including the factor in the PDF instead of the throughput should give slightly better results.

Reviewers: sergey, brecht, dingto, juicyfruit

Differential Revision:

3 years agoCleanup: remove unused function.
Kévin Dietrich [Sun, 25 Sep 2016 20:11:09 +0000 (22:11 +0200)]
Cleanup: remove unused function.

3 years agoAlembic: only interpolate vertices when their number don't differ
Kévin Dietrich [Sun, 25 Sep 2016 20:09:05 +0000 (22:09 +0200)]
Alembic: only interpolate vertices when their number don't differ
between samples.

This could cause some crashes.

3 years agoCycles: Fix T49411: Multiscatter GGX with zero roughness when Filter Glossy is enabled
Lukas Stockner [Sun, 25 Sep 2016 20:08:08 +0000 (22:08 +0200)]
Cycles: Fix T49411: Multiscatter GGX with zero roughness when Filter Glossy is enabled

3 years agoVolume slice settings: tweak/fix UI enabling conditions.
Kévin Dietrich [Sun, 25 Sep 2016 19:55:29 +0000 (21:55 +0200)]
Volume slice settings: tweak/fix UI enabling conditions.

It was still possible to have some properties enabled when it does not
make sense to have them so.

3 years agoSmoke debug draw: take adaptive domain position into account.
Kévin Dietrich [Sun, 25 Sep 2016 19:45:09 +0000 (21:45 +0200)]
Smoke debug draw: take adaptive domain position into account.

Eventually the various functions that deals with adaptive domain
bounding box shall de-duplicated.

3 years agooverhaul gpuMatrix API
Mike Erwin [Sun, 25 Sep 2016 17:29:45 +0000 (19:29 +0200)]
overhaul gpuMatrix API

Complete (for our needs) 2D & 3D transformation API. Should be easy to port legacy OpenGL matrix stack-based code to this. Still needs testing.

Ported ortho, frustum, lookAt functions from Viewport FX (rB194998766c65). Kept plenty of Viewport FX code from previous commit.

Stack API and 2D routines ported from Gawain. This version uses BLI_math library so everything is licensed under GPL instead of the usual MPL.

Part of T49450

3 years agoport math function from Viewport FX
Mike Erwin [Sun, 25 Sep 2016 17:01:18 +0000 (19:01 +0200)]
port math function from Viewport FX

mul_v4_m4v3(r, M, v) means r = M * vec4(v, 1.0)
Based on rB194998766c65

3 years agospecialize mat3 multiply routines
Mike Erwin [Sun, 25 Sep 2016 16:48:11 +0000 (18:48 +0200)]
specialize mat3 multiply routines

Same as 5c6baf1ee9754e39392926cd077bb2097baf39b9 but for 3x3 matrices.

3 years agoViewport smoke: fix a couple of issues in the new display settings.
Kévin Dietrich [Sun, 25 Sep 2016 15:02:46 +0000 (17:02 +0200)]
Viewport smoke: fix a couple of issues in the new display settings.

- WITH_SMOKE macro was not defined so some code was not compiled, though
it was still accessible from the UI
- some UI elements were disappearing due to bad indentation, also rework
the UI code to not hide but rather disable/grey out button in the UI
- Display thickness was not used due to bad manual merge of the code
from the patch.

3 years agospecialize mat4 multiply routines
Mike Erwin [Sun, 25 Sep 2016 12:27:48 +0000 (14:27 +0200)]
specialize mat4 multiply routines

mul_m4_m4m4(R, A, B) gives us R = AB in general. Existing code assumed the worst, that A and B both alias the output R. For safety it makes internal copies of A and B before calculating & writing R.

This is the least common case. Usually all 3 matrices differ. Often we see M = AM or M = MB, but never M = MM.

With this revision mul_m4_m4m4 is called in exactly the same way but copies inputs only when needed. If you know the inputs are independent of the output use the "uniq" variant to skip the saftety checks.

3 years agoFix T49310: incorrect Cycles standalone normals with negative scale.
Brecht Van Lommel [Sun, 25 Sep 2016 03:07:38 +0000 (05:07 +0200)]
Fix T49310: incorrect Cycles standalone normals with negative scale.

3 years agoCurve Fitting: re-fitting heap pre-allocated too much
Campbell Barton [Sun, 25 Sep 2016 02:11:46 +0000 (12:11 +1000)]
Curve Fitting: re-fitting heap pre-allocated too much

3 years agoCurve Fitting: 'offset' method used sign when it shouldn't
Campbell Barton [Sun, 25 Sep 2016 02:03:10 +0000 (12:03 +1000)]
Curve Fitting: 'offset' method used sign when it shouldn't

3 years agoCurve Fitting: inline dot-product (avoid temp vector)
Campbell Barton [Sun, 25 Sep 2016 01:40:18 +0000 (11:40 +1000)]
Curve Fitting: inline dot-product (avoid temp vector)

3 years agoCurve Fitting: de-duplicate cubic evaluation
Campbell Barton [Sun, 25 Sep 2016 01:34:31 +0000 (11:34 +1000)]
Curve Fitting: de-duplicate cubic evaluation

3 years agoQuiet shadow warning
Campbell Barton [Sun, 25 Sep 2016 02:15:14 +0000 (12:15 +1000)]
Quiet shadow warning

No need to declare new iterator for second loop.

3 years agoFix compile error when building without smoke support.
Kévin Dietrich [Sat, 24 Sep 2016 22:26:21 +0000 (00:26 +0200)]
Fix compile error when building without smoke support.

Also fixes possible NULL pointer dereference.

Fixes T49445.

3 years agoViewport smoke: add options to draw velocity vectors.
Kévin Dietrich [Sat, 24 Sep 2016 20:36:54 +0000 (22:36 +0200)]
Viewport smoke: add options to draw velocity vectors.

This basically exposes to the UI a function that was only available
through a debug macro ; the purpose is obviously to help debugging
simulations. It adds ways to draw the vectors either as colored needles
or as arrows showing the direction of the vectors. The colors are based
on the magnitude of the underlying vectors.

Reviewers: plasmasolutions, gottfried

Differential Revision:

3 years agoViewport smoke: add support for axis aligned slicing.
Kévin Dietrich [Sat, 24 Sep 2016 19:41:16 +0000 (21:41 +0200)]
Viewport smoke: add support for axis aligned slicing.

Current approach uses view aligned slicing to generate polygons for GL
texturing such that the generated polygons are always facing the view
plane. Now it is also possible to use object aligned slicing, which
creates polygons by slicing the object perpendicular to whichever axis
is facing the most the view plane. It is also possible to create a
single slice for inspecting the volume, or for 2D rendering effects.

Settings for this, along with a density multiplier setting, are to be
found in a newly added "Smoke Display Settings" panel in the smoke
domain properties tab.

Reviewers: plasmasolutions, gottfried

Differential Revision:

3 years agoMesh: added default UVs for Monkey, improved UVs for UV Sphere and Icosphere.
Peter Lu [Sat, 24 Sep 2016 14:08:10 +0000 (16:08 +0200)]
Mesh: added default UVs for Monkey, improved UVs for UV Sphere and Icosphere.

Fixes T47488 and T47478.

Reviewed By: brecht

Differential Revision:

3 years agoconstify BLI_math_matrix inputs
Mike Erwin [Sat, 24 Sep 2016 14:21:38 +0000 (16:21 +0200)]
constify BLI_math_matrix inputs

GPU_matrix needs this very soon, and it's good practice in general.

also sprinkled in some TODOs for later