4 years agoCysles: Avoid having ShaderData on the stack
Sergey Sharybin [Sun, 22 Nov 2015 10:00:29 +0000 (15:00 +0500)]
Cysles: Avoid having ShaderData on the stack

This commit introduces a SSS-oriented intersection structure which is replacing
old logic of having separate arrays for just intersections and shader data and
encapsulates all the data needed for SSS evaluation.

This giver a huge stack memory saving on GPU. In own experiments it gave 25%
memory usage reduction on GTX560Ti (722MB vs. 946MB).

Unfortunately, this gave some performance loss of 20% which only happens on GPU.
This is perhaps due to different memory access pattern. Will be solved in the
future, hopefully.

Famous saying: won in memory - lost in time (which is also valid in other way

4 years agoOpenGL: set geometry shader input length implicitly
Mike Erwin [Wed, 25 Nov 2015 06:49:07 +0000 (01:49 -0500)]
OpenGL: set geometry shader input length implicitly

Input array length is implicitly set at link time, based on the geometry
shader's layout. Specifying the wrong value here is an error; specifying
no value is the same as getting it right. (inspired by a recent codegen

4 years agoBMesh: raise exception face-split w/ adjacent loops
Campbell Barton [Wed, 25 Nov 2015 01:04:36 +0000 (12:04 +1100)]
BMesh: raise exception face-split w/ adjacent loops

Was raising "internal error".

4 years agoBMesh: remove double faces when triangulating
Campbell Barton [Wed, 25 Nov 2015 00:55:46 +0000 (11:55 +1100)]
BMesh: remove double faces when triangulating

4 years agoFix error in recent check for duplicate tris
Campbell Barton [Wed, 25 Nov 2015 00:28:25 +0000 (11:28 +1100)]
Fix error in recent check for duplicate tris

4 years agoOSX bump python to 3.5
Martijn Berger [Tue, 24 Nov 2015 22:18:25 +0000 (23:18 +0100)]
OSX bump python to 3.5

4 years agoSculpting optimization: Avoid iterating the PBVH for intersection during
Antony Riakiotakis [Tue, 24 Nov 2015 20:40:18 +0000 (21:40 +0100)]
Sculpting optimization: Avoid iterating the PBVH for intersection during
the paint cursor drawing when a stroke is underway; this information is
already available from the stroke itself.

Should improve performance when "show brush" is enabled (which is
always, for sane people). Finding an intersection is not always cheap,
especially on heavy meshes.

Cudos to the dyntopo test thread for the report and the sculpt love :)

4 years agoFix T46855: Limit Location Max value limited to 1000 units.
Bastien Montagne [Tue, 24 Nov 2015 19:29:33 +0000 (20:29 +0100)]
Fix T46855: Limit Location Max value limited to 1000 units.

Those should be UI limits, not hard absolute limits...

4 years agoFix previous own fix - second message was actually OK, first one had bad comma placem...
Bastien Montagne [Tue, 24 Nov 2015 14:36:49 +0000 (15:36 +0100)]
Fix previous own fix - second message was actually OK, first one had bad comma placement...

Thanks to psy-fi for the head-up.

4 years agoFix broken windows 'MessageBox' calls (UI messages).
Bastien Montagne [Tue, 24 Nov 2015 14:11:28 +0000 (15:11 +0100)]
Fix broken windows 'MessageBox' calls (UI messages).

Reported by Bzzt_Ploink on IRC.

4 years agoFix T46851: Crash on multires more than million
Sergey Sharybin [Tue, 24 Nov 2015 10:23:33 +0000 (15:23 +0500)]
Fix T46851: Crash on multires more than million

yet another bug introduced by recent shadowing changes -- q and r CCG arrays
were overwritten by the temporary evaluation because the code was changed to
use global pointers instead of the local ones.

Naming of the variables could be changed to be a bit more accurate.

4 years agoBuildbot: Switch Linux builds to Python 3.5
Sergey Sharybin [Tue, 24 Nov 2015 09:45:55 +0000 (14:45 +0500)]
Buildbot: Switch Linux builds to Python 3.5

4 years agoFix T46839: New dependency graph missed time update on motrack constraints
Sergey Sharybin [Tue, 24 Nov 2015 09:44:38 +0000 (14:44 +0500)]
Fix T46839: New dependency graph missed time update on motrack constraints

4 years agoFix outliner crash after recent no-functional-changes cleanup commits
Sergey Sharybin [Tue, 24 Nov 2015 09:24:26 +0000 (14:24 +0500)]
Fix outliner crash after recent no-functional-changes cleanup commits

4 years update official numpy version.
Bastien Montagne [Tue, 24 Nov 2015 09:13:16 +0000 (10:13 +0100)] update official numpy version.

4 years agoCycles: Support per-render layer world AO settings
Sergey Sharybin [Tue, 24 Nov 2015 08:21:40 +0000 (13:21 +0500)]
Cycles: Support per-render layer world AO settings

This is sort of extension of existing Use Environment option which now allows to
disable AO on the render layer basis.

Useful in cases like disabling AO for the background because it might make it
too flat and so.

Reviewers: juicyfruit, dingto, brecht

Reviewed By: brecht

Subscribers: eyecandy, venomgfx

Differential Revision:

4 years agoBGE: Save screenshots in a different thread
Sybren A. Stüvel [Tue, 24 Nov 2015 08:15:15 +0000 (09:15 +0100)]
BGE: Save screenshots in a different thread

This patch allows the game engine to keep running while performing things like PNG compression and disk I/O.

As an example, my crowd simulation rasterizer saves a screenshot for every frame. This now takes up 13 msec per frame, which was 31 msec before this patch. Effectively, it allows the simulation to save every frame and still run at 60 FPS.

Reviewers: lordloki, moguri, panzergame

Reviewed By: moguri, panzergame

Projects: #game_engine

Differential Revision:

4 years agoCleanup: Unsued variables
Julian Eisel [Tue, 24 Nov 2015 08:01:52 +0000 (09:01 +0100)]
Cleanup: Unsued variables

Unused since rB291afea8ccdea5.

4 years agoOpenGL: when checking GL version, assume >= 2.1
Mike Erwin [Tue, 24 Nov 2015 07:34:54 +0000 (02:34 -0500)]
OpenGL: when checking GL version, assume >= 2.1

Mostly glBlendFunc related.

4 years agoOpenGL: clean up use of old extensions
Mike Erwin [Tue, 24 Nov 2015 07:20:38 +0000 (02:20 -0500)]
OpenGL: clean up use of old extensions

4 years agofix error in last commit
Campbell Barton [Tue, 24 Nov 2015 06:57:47 +0000 (17:57 +1100)]
fix error in last commit

4 years agoFix T46805: Scale along axis fails w/ Python
Campbell Barton [Tue, 24 Nov 2015 05:50:21 +0000 (16:50 +1100)]
Fix T46805: Scale along axis fails w/ Python

't->value' no longer has constraint matrix applied for translate,
fix for T46003 is no longer needed.

4 years agoFix T46816: Vert/Edge snap fails at edge of bounds
Campbell Barton [Tue, 24 Nov 2015 01:13:49 +0000 (12:13 +1100)]
Fix T46816: Vert/Edge snap fails at edge of bounds

4 years agoView3D: move snapping functions out of ruler
Campbell Barton [Tue, 24 Nov 2015 00:09:03 +0000 (11:09 +1100)]
View3D: move snapping functions out of ruler

4 years agoUV Smart Project: restore 'Stretch to UV Bounds'
Campbell Barton [Mon, 23 Nov 2015 20:28:42 +0000 (07:28 +1100)]
UV Smart Project: restore 'Stretch to UV Bounds'

This option wasn't exposed since 2.4x.

D1622 by @candreacchio

4 years Fix dependencies between (built) libs.
Bastien Montagne [Mon, 23 Nov 2015 20:03:22 +0000 (21:03 +0100)] Fix dependencies between (built) libs.

Who in hell did make OSD dependant on llvm???

4 years Cleanup: Use correct boolean checks.
Bastien Montagne [Mon, 23 Nov 2015 19:28:34 +0000 (20:28 +0100)] Cleanup: Use correct boolean checks.

Yeah... that is correct bash boolean check syntax. Pretty sure even BASIC or Perl do better.


4 years add option to force building libs instead of using packages, and...
Bastien Montagne [Mon, 23 Nov 2015 18:54:25 +0000 (19:54 +0100)] add option to force building libs instead of using packages, and limited fallback for unsuported distro.

This commit adds '--build-foo' options to force the script to build relevant libraries
instead of trying to use packages from the distribution.

In addition, it also now offers (with those '--build-foo' options) the possibility
to build libraries on distributions that are not fully supported.

This is limited, but should still help people once they have installed themselves
the basics of dependencies - boost, llvm, osl/osd etc. are not libraries that are
really easy to build.

DISCLAIMER: I did not take the 20 (or more) hours needed to test all combinations
over all distributions, and given the size of the changes, bad sneaky typos are quite
probable, so please report if you get some errors!

4 years refactor message about needed dependencies, and add option to show...
Bastien Montagne [Mon, 23 Nov 2015 14:42:46 +0000 (15:42 +0100)] refactor message about needed dependencies, and add option to show it and exit (--show-deps).

More info about 'official' source and versions of main libraries handled by the script have also been added to that info option.

4 years agoGit ignore BUILD_NOTES.txt from
Brecht Van Lommel [Sun, 22 Nov 2015 23:01:09 +0000 (00:01 +0100)]
Git ignore BUILD_NOTES.txt from

4 years agoCMake: enable -std=gnu99 for clang and icc.
Brecht Van Lommel [Mon, 23 Nov 2015 17:22:53 +0000 (18:22 +0100)]
CMake: enable -std=gnu99 for clang and icc.

4 years agoFix T46848: OpenNL crash on Windows due to uninintialized variables.
Brecht Van Lommel [Mon, 23 Nov 2015 17:20:32 +0000 (18:20 +0100)]
Fix T46848: OpenNL crash on Windows due to uninintialized variables.

4 years agoFix T46842: Removing World is missing AO update in viewport render
Sergey Sharybin [Mon, 23 Nov 2015 12:24:49 +0000 (17:24 +0500)]
Fix T46842: Removing World is missing AO update in viewport render

4 years agoCleanup: shadowing (unwrap)
Campbell Barton [Mon, 23 Nov 2015 11:12:29 +0000 (22:12 +1100)]
Cleanup: shadowing (unwrap)

4 years agoFix T46841: Thick lines w/ graph visible
Campbell Barton [Mon, 23 Nov 2015 10:55:35 +0000 (21:55 +1100)]
Fix T46841: Thick lines w/ graph visible

4 years agoOpenSubdiv: support OpenGL 3.x
Mike Erwin [Mon, 23 Nov 2015 08:33:49 +0000 (03:33 -0500)]
OpenSubdiv: support OpenGL 3.x

GLSL 130, 140, 150 with extensions as needed.

Similar logic to my recent gpu_extensions changes.

Partially fixes T46706. Matcaps now work with OpenSubdiv, as do basic
materials. Anything with UV coordinates is still broken.

4 years agoOpenGL: Replace some more ARB suffix from glBindBufferARB.
Thomas Dinges [Mon, 23 Nov 2015 08:09:26 +0000 (09:09 +0100)]
OpenGL: Replace some more ARB suffix from glBindBufferARB.

4 years agoCMake: use -Wshadow warning for C source
Campbell Barton [Mon, 23 Nov 2015 04:45:52 +0000 (15:45 +1100)]
CMake: use -Wshadow warning for C source

C source now builds without shadowing, enable with GCC by default.

4 years agoCleanup: shadowing (interface)
Campbell Barton [Sun, 22 Nov 2015 23:01:54 +0000 (10:01 +1100)]
Cleanup: shadowing (interface)

4 years agoCleanup: shadowing (editors)
Campbell Barton [Mon, 23 Nov 2015 04:44:15 +0000 (15:44 +1100)]
Cleanup: shadowing (editors)

4 years agoCleanup: shadowing (rna, modifiers, *misc*)
Campbell Barton [Mon, 23 Nov 2015 04:45:10 +0000 (15:45 +1100)]
Cleanup: shadowing (rna, modifiers, *misc*)

4 years agoCleanup: shadowing (bmesh)
Campbell Barton [Mon, 23 Nov 2015 01:34:50 +0000 (12:34 +1100)]
Cleanup: shadowing (bmesh)

4 years agoCleanup: shadowing (render)
Campbell Barton [Mon, 23 Nov 2015 01:28:01 +0000 (12:28 +1100)]
Cleanup: shadowing (render)

4 years agoCleanup: shadowing (blenkernel)
Campbell Barton [Mon, 23 Nov 2015 00:27:02 +0000 (11:27 +1100)]
Cleanup: shadowing (blenkernel)

4 years agoCleanup: shadowing (blenlib, gpu, imbuf)
Campbell Barton [Mon, 23 Nov 2015 00:45:54 +0000 (11:45 +1100)]
Cleanup: shadowing (blenlib, gpu, imbuf)

4 years agoCleanup: use `rna_enum_` prefix for RNA enums
Campbell Barton [Mon, 23 Nov 2015 02:49:52 +0000 (13:49 +1100)]
Cleanup: use `rna_enum_` prefix for RNA enums

Definitions could shadow local vars.

4 years agoCleanup: use single struct for freestyle globals
Campbell Barton [Mon, 23 Nov 2015 04:31:11 +0000 (15:31 +1100)]
Cleanup: use single struct for freestyle globals

Was shadowing local vars.

4 years agoCleanup: redundant string escape
Campbell Barton [Mon, 23 Nov 2015 03:36:48 +0000 (14:36 +1100)]
Cleanup: redundant string escape

4 years agoCleanup: warning
Campbell Barton [Mon, 23 Nov 2015 06:39:18 +0000 (17:39 +1100)]
Cleanup: warning

4 years agoOpenGL: fix hq viewport dof on Mac / GL 2.1
Mike Erwin [Mon, 23 Nov 2015 05:32:35 +0000 (00:32 -0500)]
OpenGL: fix hq viewport dof on Mac / GL 2.1

My earlier fix for GL >= 3 on Windows broke it. Should work for both
platforms now.

4 years agoOpenGL: codegen formatting
Mike Erwin [Mon, 23 Nov 2015 05:13:57 +0000 (00:13 -0500)]
OpenGL: codegen formatting

Formatting of generated GLSL code:
- attribute/varying for version 120
- in/out for version 130+
- minor cosmetic stuff

Tested working on Windows 10, GL 4.3.

4 years agoOpenGL: update geometry shaders, fixes T46838
Mike Erwin [Mon, 23 Nov 2015 05:08:09 +0000 (00:08 -0500)]
OpenGL: update geometry shaders, fixes T46838

4 years agoOpenGL: choose compatible GLSL version
Mike Erwin [Mon, 23 Nov 2015 01:40:54 +0000 (20:40 -0500)]
OpenGL: choose compatible GLSL version

Fix GLSL version & geometry shader support query to consider core vs

All shaders need to be compatible with each other, and for now that
means GLSL 120. For drivers that support compatibility profiles, choose
the highest available (up to 150). If only core profile is supported,
max out at GLSL 130.

4 years agorevert file mode to 644
Mike Erwin [Mon, 23 Nov 2015 00:19:47 +0000 (19:19 -0500)]
revert file mode to 644

4 years agoOpenGL: bump gpu_extensions to GL 2.1, prepare for 3.x
Mike Erwin [Sun, 22 Nov 2015 18:22:47 +0000 (13:22 -0500)]
OpenGL: bump gpu_extensions to GL 2.1, prepare for 3.x

Several changes. Tested working on Windows 10 GL 4.3 and MacOS 10.11 GL

- document extensions used in this file
- some simple ARB/EXT suffix deletion
- stop checking for pre-2.1 features — they’re available!
- convert old ARB shader API to the one adopted in GL 2.0
- remove checks for old (pre-R600) ATI cards
- choose GLSL version at runtime, between 1.2 and 1.5
- prefer GLSL 1.5 for geometry shaders, fall back to
EXT_geometry_shader4 if needed

Differential Revision:

4 years agoOpenNL: make the API thread safe by always passing context.
Brecht Van Lommel [Sun, 22 Nov 2015 04:15:56 +0000 (05:15 +0100)]
OpenNL: make the API thread safe by always passing context.

Previously two laplacian smooth or deform modifiers executing
simultaneously could crash.

4 years agoOpenNL: significantly simplify code using Eigen / STL.
Brecht Van Lommel [Sun, 22 Nov 2015 04:25:32 +0000 (05:25 +0100)]
OpenNL: significantly simplify code using Eigen / STL.

4 years agoOpenNL: replace SuperLU by Eigen SparseLU solver.
Brecht Van Lommel [Sun, 22 Nov 2015 01:29:31 +0000 (02:29 +0100)]
OpenNL: replace SuperLU by Eigen SparseLU solver.

Performance is roughly the same because it's using the same COLAMD ordering
and supernodal LU factorization algorithms. Solve results also appear to be

4 years agoOpenNL: convert source file to C++, remove some unused functions.
Brecht Van Lommel [Sat, 21 Nov 2015 23:51:47 +0000 (00:51 +0100)]
OpenNL: convert source file to C++, remove some unused functions.

4 years agoOpenNL: removed unused softbody code.
Brecht Van Lommel [Sun, 22 Nov 2015 20:12:20 +0000 (21:12 +0100)]
OpenNL: removed unused softbody code.

4 years agoCMake: check GNU compiler before using extension
Campbell Barton [Sun, 22 Nov 2015 21:31:29 +0000 (08:31 +1100)]
CMake: check GNU compiler before using extension

Minor edit, don't assume non-msvc compilers are gcc/gnu compatible.

4 years agoC99 is now the C standard for all our C code.
Brecht Van Lommel [Sun, 22 Nov 2015 16:12:54 +0000 (17:12 +0100)]
C99 is now the C standard for all our C code.

The main new feature is mixed variable declarations and code, which can help
reduce uninitialized variables or accidental variable reuse.

Due to incomplete C99 support in VS 2013, variable length arrays are not
supported, BLI_array_alloca must still be used. The header <tgmath.h> is also
not supported.

Differential Revision:

4 years agoError out on Windows if driver does not support OpenGL 2.1 with an error
Antony Riakiotakis [Sun, 22 Nov 2015 19:53:57 +0000 (20:53 +0100)]
Error out on Windows if driver does not support OpenGL 2.1 with an error

4 years agoRemove vertex array support from GPUBuffers. Remove USER_DISABLE_VBO. All
Antony Riakiotakis [Sun, 22 Nov 2015 18:46:31 +0000 (19:46 +0100)]
Remove vertex array support from GPUBuffers. Remove USER_DISABLE_VBO. All
GPUBuffer rendering is now done using vertex buffers.

Vertex arrays are completely removed from GL 3.2 core profile, so we'll
have to do this change at some point anyway.

This commit, though big, is not modifying blender in any way. Use should
be exactly as if the vetex buffer option is constantly on.

4 years agoSmoke drawing code cleanups (and little refactor)
Kévin Dietrich [Sun, 22 Nov 2015 17:17:09 +0000 (18:17 +0100)]
Smoke drawing code cleanups (and little refactor)

This patch contains the following changes:

- the vertices and edges arrays would be assigned default values, and
then reassigned new ones right away. It appears that those arrays were
once global and then made local
(rB06a2ee4afed4237398b69ddf253e29a730b2f9f0), so it makes sense now to
initialize them with the right values.
- the flame spectrum texture was created whether it was needed or not,
so now it's only created if there's flame to be drawn, also split the
code in a separate function.
 - reduce the number of parameters to the main draw function, as most of
them are member of SmokeDomainSettings.
- some other minor cleanups: fold multiple operations into one to get
rid of one local variable, mark variables as `const` when necessary,
unecessary gl draw calls, reorder the code a bit...

Reviewers: campbellbarton, psy-fi

Differential Revision:

4 years agoAdd check for OpenGL version 2.1 on linux.
Antony Riakiotakis [Sun, 22 Nov 2015 17:14:16 +0000 (18:14 +0100)]
Add check for OpenGL version 2.1 on linux.

Unfortunately there's no easy way to show a messagebox here, so just
print a warning on fstderr and exit. If we don't call exit() here we get
crashes on other blender systems (python, opensubdiv) and it can get
tricky to track the initialization state here, so just using exit()
should do the trick for now.

4 years agoOpenGL: bump gpu_buffers to GL 2.1
Mike Erwin [Sun, 22 Nov 2015 16:35:21 +0000 (11:35 -0500)]
OpenGL: bump gpu_buffers to GL 2.1

simple stuff!
- remove ARB suffix from core functions & enums
- remove checks for core features (VBOs, generic attribs)
- keep checks for non-core features (draw elements base vertex)

4 years agoFix T46678: Extending left handle of a VSE multicam effect strip with snap creates...
Bastien Montagne [Fri, 20 Nov 2015 16:33:53 +0000 (17:33 +0100)]
Fix T46678: Extending left handle of a VSE multicam effect strip with snap creates frame stills.

Also fixes cache handling for those strips, they need more radical flushing...

4 years agoCycles: Make branched path tracer covered with requested features
Sergey Sharybin [Sun, 22 Nov 2015 08:54:51 +0000 (13:54 +0500)]
Cycles: Make branched path tracer covered with requested features

This gives few percent extra memory saving for the CUDA kernel when
using regular path tracing.

Still more like an experiment, but will be handy in the future.

4 years agoCycles: Save one transform inversion in the camera sync
Lukas Stockner [Sat, 21 Nov 2015 21:14:13 +0000 (22:14 +0100)]
Cycles: Save one transform inversion in the camera sync

Summary: By calculating the Camera-to-Screen-Matrix first, one inversion can be saved in the Camera sync.
It won't really improve speed and/or precision, it's mainly a small cleanup.

Reviewers: sergey, dingto


4 years agoCycles: Make requested features struct aware of subsurface BSDF
Sergey Sharybin [Sat, 21 Nov 2015 17:31:58 +0000 (22:31 +0500)]
Cycles: Make requested features struct aware of subsurface BSDF

This way we'll be able to disable SSS for the scene-adaptive kernel.

4 years agoCycles: Quick experiment with using feature-adaptive kernels for CUDA
Sergey Sharybin [Sat, 21 Nov 2015 17:16:01 +0000 (22:16 +0500)]
Cycles: Quick experiment with using feature-adaptive kernels for CUDA

Gives few percent of memory improvement for regular feature set kernel
and could give significant memory improvement for Experimental kernel.
It could also give some degree of performance improvement, but this I
didn't really measure reliably yet.

Code is ifdef-ed for now, since it's only working on Linux and requires
CUDA toolkit to be installed (other platform only use precompiled

This is just an experiment for now and a base for the proper feature
support in the future (with runtime compilation using CUDA 7?).

4 years agoCycles: add utility function to calculate MD5 hash of a given string
Sergey Sharybin [Sat, 21 Nov 2015 17:07:59 +0000 (22:07 +0500)]
Cycles: add utility function to calculate MD5 hash of a given string

4 years agoCycles: Make CUDA device internally operate with requested features
Sergey Sharybin [Sat, 21 Nov 2015 16:49:00 +0000 (21:49 +0500)]
Cycles: Make CUDA device internally operate with requested features

This just replaces internal argument `experimental` with `requested_features`
making it possible to access particular requested settings when building

4 years agoCycles: Move build options constructions to DeviceRequestedFeatures
Sergey Sharybin [Sat, 21 Nov 2015 16:42:31 +0000 (21:42 +0500)]
Cycles: Move build options constructions to DeviceRequestedFeatures

This way it's easier to re-use requested features logic across multiple
device implementations.

4 years agoCycles: Avoid multiple spaces in OpenCL build options
Sergey Sharybin [Sat, 21 Nov 2015 16:33:08 +0000 (21:33 +0500)]
Cycles: Avoid multiple spaces in OpenCL build options

This should solve some compilation errors with compilation on OSX.

4 years agoFix/Request T46798: Alt+I removes keyframes from all bones, not only selected in...
Joshua Leung [Sat, 21 Nov 2015 03:38:11 +0000 (16:38 +1300)]
Fix/Request T46798: Alt+I removes keyframes from all bones, not only selected in Pose Mode

Technically this was more of a feature request, but now the Alt-I operator will
only remove keyframes related to selected bones in Pose Mode. In Object Mode,
it will continue to operate on all keyframes of the object.

This change makes this operator more meaningful when animating in the 3D view.

4 years agoBMesh: improve face-path-picking w/ tri-fans
Campbell Barton [Fri, 20 Nov 2015 23:07:18 +0000 (10:07 +1100)]
BMesh: improve face-path-picking w/ tri-fans

Face paths including triangle-fans would often be avoided because
the face center and edge would 'zig-zag'.

Resolve using wighted face center and picking an edge-point between face centers.

4 years agoFix T46826: EXR Compression method set in UI does not always get passed correctly...
Bastien Montagne [Fri, 20 Nov 2015 18:22:20 +0000 (19:22 +0100)]
Fix T46826: EXR Compression method set in UI does not always get passed correctly to the actual OpenEXR writing code.

4 years agoCycles: Fix filter glossy being broken after recent changes
Sergey Sharybin [Fri, 20 Nov 2015 13:18:27 +0000 (18:18 +0500)]
Cycles: Fix filter glossy being broken after recent changes

Basically we can not use sharp closure as a substitude when filter glossy is
used. This is because we can not blur sharp reflection/refraction.

This is quite quick and not really clean implementation. Not really happy
with manual handling of original settings, but this is as good as we can do
in the quick patch. It's a good acknowledgment and we now can re-consider
some aspects of graph simplification to make such cases more natively

P.S. This failure would have been shown by our regression tests, so please,
bother a bit to run Cycles's test sweep before doing such optimizations.

4 years agoCorrect error in background job template
Campbell Barton [Fri, 20 Nov 2015 05:09:02 +0000 (16:09 +1100)]
Correct error in background job template

Remove check for the path being writable,
the operator raises error in this case.

4 years agoFix switching scenes w/ background render
Campbell Barton [Thu, 19 Nov 2015 22:35:37 +0000 (09:35 +1100)]
Fix switching scenes w/ background render

Caused by own de-duplication, b3492978

Scene switching relies on the window context being cleared.

4 years agoCleanup: variable names, ascii diagram
Campbell Barton [Thu, 19 Nov 2015 21:21:15 +0000 (08:21 +1100)]
Cleanup: variable names, ascii diagram

4 years agoRecent change to bmesh_jekv caused assert
Campbell Barton [Thu, 19 Nov 2015 21:14:49 +0000 (08:14 +1100)]
Recent change to bmesh_jekv caused assert

Note that the mesh was valid, this just stops the radial check from failing.

4 years agoFix T46804: Crash using triangulate modifier on a specific mesh.
Bastien Montagne [Thu, 19 Nov 2015 21:00:07 +0000 (22:00 +0100)]
Fix T46804: Crash using triangulate modifier on a specific mesh.

Issues was again the ugly hack of swapping last generated tri with original face
we use in BMesh triangulate code - here it could lead in some rare case to have
invalid face pointer in doubles list.

4 years agoRecent edits to grid-fill removed edgeloop flip
Campbell Barton [Thu, 19 Nov 2015 19:58:37 +0000 (06:58 +1100)]
Recent edits to grid-fill removed edgeloop flip

4 years agoFix related to T46804 - BMesh validate code would use invalid pointers after checking...
Bastien Montagne [Thu, 19 Nov 2015 19:42:46 +0000 (20:42 +0100)]
Fix related to T46804 - BMesh validate code would use invalid pointers after checking them!

Note that this does not fix the issue reported in T46804, juts makes it crash later down in code...

4 years agoFix T48806: mesh.materials.clear() does not decrement users counts.
Bastien Montagne [Thu, 19 Nov 2015 17:03:38 +0000 (18:03 +0100)]
Fix T48806: mesh.materials.clear() does not decrement users counts.

4 years agoFix new UI align code behavior with very small buttons.
Bastien Montagne [Thu, 19 Nov 2015 14:07:51 +0000 (15:07 +0100)]
Fix new UI align code behavior with very small buttons.

In case two neighbor buttons are very small, their total width (or height) can remain below
max authorized delta, and hence wrong side could be detected as 'common side' for the pair.

This is now fixed by checking both opposite sides at once.

Also, we expect buttons to have some width and height to be considered alignable now!

Took me two days to sort that out, grrrr!

4 years agoBMesh: support for grid-fill non uniform grids
Campbell Barton [Thu, 19 Nov 2015 11:13:12 +0000 (22:13 +1100)]
BMesh: support for grid-fill non uniform grids

4 years agoBMesh: support splitting edge-loops when expanding
Campbell Barton [Thu, 19 Nov 2015 11:12:41 +0000 (22:12 +1100)]
BMesh: support splitting edge-loops when expanding

4 years agoBMesh: new API call to collapse an edge
Campbell Barton [Thu, 19 Nov 2015 07:12:20 +0000 (18:12 +1100)]
BMesh: new API call to collapse an edge

Existing collapse functions were strict regarding the number of verts sharing an edge.
BM_edge_collapse allows any edge to be passed in without first having to manipulate geometry.

4 years agoBMesh: bmesh_jekv check for degenerate faces
Campbell Barton [Thu, 19 Nov 2015 04:28:18 +0000 (15:28 +1100)]
BMesh: bmesh_jekv check for degenerate faces

Move check for degenerate faces from BM_vert_collapse_faces into bmesh_jekv.

4 years agoCleanup: redundant 'break', minor edits
Campbell Barton [Thu, 19 Nov 2015 05:16:06 +0000 (16:16 +1100)]
Cleanup: redundant 'break', minor edits

4 years agoCleanup: remove unused bmesh iterator
Campbell Barton [Thu, 19 Nov 2015 05:08:40 +0000 (16:08 +1100)]
Cleanup: remove unused bmesh iterator

4 years agoFix T46818, crash with Glossy node on Windows.
Thomas Dinges [Thu, 19 Nov 2015 07:43:43 +0000 (08:43 +0100)]
Fix T46818, crash with Glossy node on Windows.

4 years agoCycles: Add Blackman-Harris filter, fix Gaussian filter
Lukas Stockner [Thu, 6 Aug 2015 19:04:43 +0000 (21:04 +0200)]
Cycles: Add Blackman-Harris filter, fix Gaussian filter

This commit adds the Blackman-Harris windows function as a pixel filter to Cycles. On some cases, such as wireframes or high-frequency textures,
Blackman-Harris can give subtle but noticable improvements over the Gaussian window.
Also, the gaussian window was truncated too early, which degraded quality a bit, therefore the evaluation region is now three times as wide.
To avoid artifacts caused by the wider curve, the filter table size is increased to 1024.

Reviewers: #cycles

Differential Revision:

4 years agoFix T46807: image/clip/sound load has one user
Campbell Barton [Wed, 18 Nov 2015 19:20:02 +0000 (06:20 +1100)]
Fix T46807: image/clip/sound load has one user

Loading data from Python gave it one user (unlike 'new' which has zero).

4 years agoCycles / Shader graph: Fallback to Sharp closures for very small roughness.
Thomas Dinges [Wed, 18 Nov 2015 17:47:56 +0000 (18:47 +0100)]
Cycles / Shader graph: Fallback to Sharp closures for very small roughness.

We fallback to Sharp closures for Glossy, Glass and Refraction nodes now, in case the Roughness input is disconnected and 0 (< 1e-4f to be exact).
This way we gain a few percentages of performance, in case the user did not manually set the closure type to "Sharp" in the UI.

Sharp will probably be removed from the UI as a followup, not needed anymore with this internal optimization.

Original idea by Lukas Stockner(Differential Revision:, code implementation by myself.

4 years agoCleanup: Add some notes in code for upcoming graph simplification process.
Thomas Dinges [Wed, 18 Nov 2015 16:20:39 +0000 (17:20 +0100)]
Cleanup: Add some notes in code for upcoming graph simplification process.