blender.git
2 years agoCycles Denoising: Fix reading of the new properties temp-cycles-denoising
Lukas Stockner [Thu, 4 May 2017 12:53:40 +0000 (14:53 +0200)]
Cycles Denoising: Fix reading of the new properties

2 years agoMerge remote-tracking branch 'origin/master' into temp-cycles-denoising
Lukas Stockner [Thu, 4 May 2017 12:20:27 +0000 (14:20 +0200)]
Merge remote-tracking branch 'origin/master' into temp-cycles-denoising

2 years agoCycles Denoising: Add option to store feature passes in the render result
Lukas Stockner [Thu, 4 May 2017 00:20:22 +0000 (02:20 +0200)]
Cycles Denoising: Add option to store feature passes in the render result

Useful for debugging and possibly in the future in combination with a standalone animation denoising mode

2 years agoCycles Denoising: Move denoising properties to the Cycles addon and improve the UI
Lukas Stockner [Wed, 3 May 2017 21:30:58 +0000 (23:30 +0200)]
Cycles Denoising: Move denoising properties to the Cycles addon and improve the UI

2 years agoFix use after free of new render layer ID properites after copying scene
Sergey Sharybin [Thu, 4 May 2017 10:27:28 +0000 (12:27 +0200)]
Fix use after free of new render layer ID properites after copying scene

2 years agoFix memory leak of ID properties after recent render passes commit
Sergey Sharybin [Thu, 4 May 2017 10:18:39 +0000 (12:18 +0200)]
Fix memory leak of ID properties after recent render passes commit

2 years agoCycles: Fix unused argument warning when building without debug passes
Sergey Sharybin [Thu, 4 May 2017 07:33:51 +0000 (09:33 +0200)]
Cycles: Fix unused argument warning when building without debug passes

2 years ago[msvc/make.bat] Limit the amount of simultaneously compiled projects.
lazydodo [Wed, 3 May 2017 21:15:35 +0000 (15:15 -0600)]
[msvc/make.bat] Limit the amount of simultaneously compiled projects.

This was set to maxcpu which in an 8 core box would be 8, each project would then spawn
8 instances of cl.exe, making a possible of 64 simultaneously running compiler instances
slowing the compile down instead of speeding it up.

2 years agoCycles Denoising: Fix crash in CPUDevice
Lukas Stockner [Wed, 3 May 2017 19:41:14 +0000 (21:41 +0200)]
Cycles Denoising: Fix crash in CPUDevice

The code initialized allocated memory by assigning the KernelGlobals to it. However, that calls the assignment operator, which frees previous elements which were never allocated.

2 years agoMerge remote-tracking branch 'origin/master' into temp-cycles-denoising
Lukas Stockner [Wed, 3 May 2017 19:35:58 +0000 (21:35 +0200)]
Merge remote-tracking branch 'origin/master' into temp-cycles-denoising

2 years agoFix Cycles build on Windows
Dalai Felinto [Wed, 3 May 2017 19:16:45 +0000 (21:16 +0200)]
Fix Cycles build on Windows

2 years agoFix error in node flag check
Campbell Barton [Wed, 3 May 2017 16:57:39 +0000 (02:57 +1000)]
Fix error in node flag check

2 years ago"Fix" root cause of T51260 Forward compatibility crash fter adding new IDProp type.
Bastien Montagne [Wed, 3 May 2017 15:01:00 +0000 (17:01 +0200)]
"Fix" root cause of T51260 Forward compatibility crash fter adding new IDProp type.

We unfortunately cannot fix this for previous versions of Blender, but
at least the issue (Blender crashing on unknown IDProp types) should now
be addressed for future.

Simply reset unknown IDProp types to integer one, and reset its value to zero.

2 years agoRender API/Cycles: Identify Render Passes by their name instead of a type flag
Lukas Stockner [Tue, 2 May 2017 22:21:18 +0000 (00:21 +0200)]
Render API/Cycles: Identify Render Passes by their name instead of a type flag

Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.

To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.

To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.

From a user perspective, nothing should change with this commit.

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

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

2 years agoCycles: Split kernel - sort shaders
Hristo Gueorguiev [Wed, 3 May 2017 13:30:45 +0000 (15:30 +0200)]
Cycles: Split kernel - sort shaders

Reduce thread divergence in kernel_shader_eval.

Rays are sorted in blocks of 2048 according to shader->id.

On R9 290 Classroom is ~30% faster, and Pabellon Barcelone is ~8% faster.

No sorting for CUDA split kernel.

Reviewers: sergey, maiself

Reviewed By: maiself

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

2 years agoCycles: Fix OpenCL compilation failure after recent color changes
Sergey Sharybin [Wed, 3 May 2017 12:11:19 +0000 (14:11 +0200)]
Cycles: Fix OpenCL compilation failure after recent color changes

It is really confusing to have some functions available in some devices
and not on another devices.

2 years agoCycles: Use render visibility for duplis when Render Layer option in viewport is...
Sergey Sharybin [Wed, 3 May 2017 10:05:52 +0000 (12:05 +0200)]
Cycles: Use render visibility for duplis when Render Layer option in viewport is used

Previously the logic was different for duplis and regular objects: regular objects
were using render visibility when Render Layer option is enabled which duplis were
always using viewport visibility when rendering from the viewport.

This was quite confusing because caused different results in viewport and render
when artists were expecting them to match 1:1.

2 years agoCycles: Simplify code in SVM image by using new utility function
Sergey Sharybin [Wed, 3 May 2017 09:22:27 +0000 (11:22 +0200)]
Cycles: Simplify code in SVM image by using new utility function

Can not measure any performance difference, so seems the code is identical
and just shorter.

2 years agoCycles: Add utility function to convert float4 color from srgb to linear
Sergey Sharybin [Wed, 3 May 2017 09:19:40 +0000 (11:19 +0200)]
Cycles: Add utility function to convert float4 color from srgb to linear

It will use SSE2 optimized version when is possible.

2 years agoCycles: Remove extra clFinish from driver workaround
Mai Lavelle [Tue, 2 May 2017 17:56:05 +0000 (13:56 -0400)]
Cycles: Remove extra clFinish from driver workaround

These were causing problems with Nvidia OpenCL.

2 years agoCycles: Output split state element size
Mai Lavelle [Sat, 8 Apr 2017 05:35:32 +0000 (01:35 -0400)]
Cycles: Output split state element size

2 years agoCycles: Branched path tracing for the split kernel
Mai Lavelle [Tue, 21 Mar 2017 02:31:54 +0000 (22:31 -0400)]
Cycles: Branched path tracing for the split kernel

This implements branched path tracing for the split kernel.

General approach is to store the ray state at a branch point, trace the
branched ray as normal, then restore the state as necessary before iterating
to the next part of the path. A state machine is used to advance the indirect
loop state, which avoids the need to add any new kernels. Each iteration the
state machine recreates as much state as possible from the stored ray to keep
overall storage down.

Its kind of hard to keep all the different integration loops in sync, so this
needs lots of testing to make sure everything is working correctly. We should
probably start trying to deduplicate the integration loops more now.

Nonbranched BMW is ~2% slower, while classroom is ~2% faster, other scenes
could use more testing still.

Reviewers: sergey, nirved

Reviewed By: nirved

Subscribers: Blendify, bliblubli

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

2 years agoBGE: Fix silly typo that invalidates negative scaling camera feature.
Benoit Bolsee [Tue, 2 May 2017 18:11:02 +0000 (20:11 +0200)]
BGE: Fix silly typo that invalidates negative scaling camera feature.

Negative scale on camera is a nice trick to invert render image on one
axis at no extra CPU cost. It was implemented in the Decklink branch but
I introduced a typo when porting it to master. It is now fixed.

2 years agoCycles: Fix missing type declaration in OpenCL image
Sergey Sharybin [Tue, 2 May 2017 13:39:18 +0000 (15:39 +0200)]
Cycles: Fix missing type declaration in OpenCL image

Spotted by Mai in IRC, thanks!

2 years agoRevert "Depsgraph: Link from material to object shading"
Sergey Sharybin [Tue, 2 May 2017 13:31:49 +0000 (15:31 +0200)]
Revert "Depsgraph: Link from material to object shading"

The change was initially needed for Blender 2.8 branch but the actual
function was reverted in there. So no reason to keep dead unused
placeholder in the dependency graph.

This reverts commit fd69ba225540cde5e4c1fa651fb02df21ea0a143.

2 years agoCycles: Fix CUDA split kernel
Sergey Sharybin [Tue, 2 May 2017 13:03:51 +0000 (15:03 +0200)]
Cycles: Fix CUDA split kernel

Global size y needs to be a multiple of 16.

2 years agoCycles: Cache split kernels in CUDA device
Sergey Sharybin [Tue, 2 May 2017 13:02:49 +0000 (15:02 +0200)]
Cycles: Cache split kernels in CUDA device

This way we don't re-load kernels for every sample in the viewport.
Additionally, we don't risk global size changed inbetween of samples.

2 years agoMerge remote-tracking branch 'origin/master' into temp-cycles-denoising
Lukas Stockner [Tue, 2 May 2017 11:19:09 +0000 (13:19 +0200)]
Merge remote-tracking branch 'origin/master' into temp-cycles-denoising

2 years agoCycles Denoising: Fix shadowing pass calculation
Lukas Stockner [Mon, 1 May 2017 13:12:58 +0000 (15:12 +0200)]
Cycles Denoising: Fix shadowing pass calculation

2 years agoCycles Denoising: Cleanup offset calulation
Lukas Stockner [Tue, 2 May 2017 11:16:42 +0000 (13:16 +0200)]
Cycles Denoising: Cleanup offset calulation

2 years agoCycles Denoising: Only store lower-triangular parts of XtWX matrix
Lukas Stockner [Tue, 2 May 2017 11:16:21 +0000 (13:16 +0200)]
Cycles Denoising: Only store lower-triangular parts of XtWX matrix

This saves 55 floats per pixel, which is quite significant with GPU tile sizes.

2 years agofix typo in WITH_SYSTEM_GFLOG in CMakeLists.txt
lazydodo [Sun, 30 Apr 2017 16:52:38 +0000 (10:52 -0600)]
fix typo in WITH_SYSTEM_GFLOG in CMakeLists.txt

2 years agoCleanup: comment blocks
Campbell Barton [Sat, 29 Apr 2017 16:58:36 +0000 (02:58 +1000)]
Cleanup: comment blocks

2 years agoView3D: support both orbit select & depth
Campbell Barton [Sat, 29 Apr 2017 16:38:38 +0000 (02:38 +1000)]
View3D: support both orbit select & depth

When using both preferences, use cursor depth when nothings selected.

2 years agoCurve Fitting: minor change to re-fitting method
Campbell Barton [Sat, 29 Apr 2017 14:01:16 +0000 (00:01 +1000)]
Curve Fitting: minor change to re-fitting method

Avoid calculating a new split-index when re-fitting.

While checking if a knot can be removed, the index with the highest error
can be used as a candidate to replace the knot
(in the case it can't be removed).

2 years agoCleanup: unused includes
Campbell Barton [Sat, 29 Apr 2017 06:27:29 +0000 (16:27 +1000)]
Cleanup: unused includes

2 years agoCleanup: menu example
Campbell Barton [Sat, 29 Apr 2017 06:20:06 +0000 (16:20 +1000)]
Cleanup: menu example

remove some redundant checks, imports

2 years agoCycles: Fix crashes after recent image changes
Mai Lavelle [Fri, 28 Apr 2017 22:47:47 +0000 (18:47 -0400)]
Cycles: Fix crashes after recent image changes

Not sure if this is a proper fix, but was getting frequent crashes, so
committing this real quick just to make master sable again. Can be
reverted later if there's a better fix. The changes to images really
need a closer look...

2 years agoImplementation of custom python entries in all right click menus
Thomas Beck [Fri, 28 Apr 2017 11:01:03 +0000 (13:01 +0200)]
Implementation of custom python entries in all right click menus

Hi Guys,

as one of my clients needs the possibility to have custom menu entries in the general right click menu (all over Blender: in the node editor, properties, toolbars,..) I talked with Campbell about expanding our hard coded menu a bit. This is the outcome. As I only need those two, I support currently a button_prop and a button_pointer.

{F540397}

I tested the changes with a custom script where I added a custom entry and executed an operator on click - it seems to work exactly how it's intended to. The script: {F540435}

As I'm not too experienced in rna stuff I would really appreciate any review.
Thanks very much Campbell for his open ears & help on this issue!

Reviewers: campbellbarton, mont29

Reviewed By: campbellbarton, mont29

Subscribers: sybren, mont29

Tags: #addons

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

2 years agoFix T51324: Auto-Depth fails rotating out of camera
Campbell Barton [Fri, 28 Apr 2017 17:13:49 +0000 (03:13 +1000)]
Fix T51324: Auto-Depth fails rotating out of camera

2 years agoCycles: Use relative path for #line directives
Sergey Sharybin [Fri, 28 Apr 2017 15:46:11 +0000 (17:46 +0200)]
Cycles: Use relative path for #line directives

This way moving Blender bundle around doesn't re-trigger kernels compilation.

2 years agoLibmv: Make ERROR a default printing severity
Sergey Sharybin [Fri, 28 Apr 2017 14:47:35 +0000 (16:47 +0200)]
Libmv: Make ERROR a default printing severity

2 years agoCycles: Correct comment after previous commit
Sergey Sharybin [Fri, 28 Apr 2017 14:47:24 +0000 (16:47 +0200)]
Cycles: Correct comment after previous commit

2 years agoCycles: Lower default severity level to ERROR
Sergey Sharybin [Fri, 28 Apr 2017 14:46:11 +0000 (16:46 +0200)]
Cycles: Lower default severity level to ERROR

2 years agoAlembic: use object-oriented approach in ABC_read_mesh()
Sybren A. Stüvel [Fri, 28 Apr 2017 11:48:00 +0000 (13:48 +0200)]
Alembic: use object-oriented approach in ABC_read_mesh()

This is easier to extend than the if/else if/else chain that was in place,
and allows for somewhat more granular error messages.

2 years agoAlembic: Construct ISampleSelector once and pass along
Sybren A. Stüvel [Wed, 26 Apr 2017 14:56:50 +0000 (16:56 +0200)]
Alembic: Construct ISampleSelector once and pass along

2 years agoFix T51331: fixes for Alembic unit tests on Windows
Sybren A. Stüvel [Fri, 28 Apr 2017 13:28:41 +0000 (15:28 +0200)]
Fix T51331: fixes for Alembic unit tests on Windows

2 years agoCycles: De-duplicate bit magic for decoding image options in OpenCL kernel
Sergey Sharybin [Fri, 28 Apr 2017 13:20:34 +0000 (15:20 +0200)]
Cycles: De-duplicate bit magic for decoding image options in OpenCL kernel

2 years agoCycles: Simplify code around maximum OpenCL info size allocation
Sergey Sharybin [Fri, 28 Apr 2017 13:15:15 +0000 (15:15 +0200)]
Cycles: Simplify code around maximum OpenCL info size allocation

2 years agoCycles: Cleanup, de-duplicate image packing of various types
Sergey Sharybin [Fri, 28 Apr 2017 13:08:54 +0000 (15:08 +0200)]
Cycles: Cleanup, de-duplicate image packing of various types

2 years agoCycles: Quick (real) fix for broken textures on OpenCL
Sergey Sharybin [Fri, 28 Apr 2017 12:56:22 +0000 (14:56 +0200)]
Cycles: Quick (real) fix for broken textures on OpenCL

Previous fix did not work for mixed textures. This one will over-allocate
information array, but it's better than not being able to render at all.

Some more cleanup and improvement is coming.

2 years agoRevert "Cycles: Fix image textures were completely broken since recent unlimited...
Sergey Sharybin [Fri, 28 Apr 2017 12:48:40 +0000 (14:48 +0200)]
Revert "Cycles: Fix image textures were completely broken since recent unlimited textures commit"

This reverts commit 8f4166ee495531fa38b676b0a5ef4c482e89f9a5.

The fix was not correct for cases when we've got float textures.

2 years agoCycles: Cleanup, spelling and braces
Sergey Sharybin [Fri, 28 Apr 2017 12:10:21 +0000 (14:10 +0200)]
Cycles: Cleanup, spelling and braces

2 years agoCycles: Fix image textures were completely broken since recent unlimited textures...
Sergey Sharybin [Fri, 28 Apr 2017 12:04:27 +0000 (14:04 +0200)]
Cycles: Fix image textures were completely broken since recent unlimited textures commit

The indexing was totally wrong in both image packing code and image sampling in kernel.

Fixes T51341: Cycles OpenCL corruption in todays buildbot

2 years agoCycles: Cleanup, always use braces for blocks
Sergey Sharybin [Fri, 28 Apr 2017 11:39:14 +0000 (13:39 +0200)]
Cycles: Cleanup, always use braces for blocks

2 years agoCycles: Cleanup, indentation in preprocessor
Sergey Sharybin [Fri, 28 Apr 2017 11:24:09 +0000 (13:24 +0200)]
Cycles: Cleanup, indentation in preprocessor

2 years agoCycles: Cleanup, use ccl::vector instead of std::vector
Sergey Sharybin [Fri, 28 Apr 2017 11:22:07 +0000 (13:22 +0200)]
Cycles: Cleanup, use ccl::vector instead of std::vector

2 years agoCycles: Cleanup, indentaiton and trailing whitespace and wrapping
Sergey Sharybin [Fri, 28 Apr 2017 11:21:17 +0000 (13:21 +0200)]
Cycles: Cleanup, indentaiton and trailing whitespace and wrapping

2 years agoFix: T50271: Bilateral/Directional blur's iterations is zero by default
brunoT [Thu, 27 Apr 2017 12:54:06 +0000 (08:54 -0400)]
Fix: T50271: Bilateral/Directional blur's iterations is zero by default

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

2 years agoRevert "Fix T51328: Add note to cmdline help that threads must be first"
Campbell Barton [Thu, 27 Apr 2017 11:48:01 +0000 (21:48 +1000)]
Revert "Fix T51328: Add note to cmdline help that threads must be first"

The help message already notes that argument order matters,
and this doesn't need to be the first.

2 years agoCleanup: spelling
Campbell Barton [Thu, 27 Apr 2017 11:40:18 +0000 (21:40 +1000)]
Cleanup: spelling

2 years agoCleanup: remove unused matrix arg
Campbell Barton [Thu, 27 Apr 2017 11:35:31 +0000 (21:35 +1000)]
Cleanup: remove unused matrix arg

2 years agoCleanup: Some style and code tweaks to Image Code after changes.
Thomas Dinges [Thu, 27 Apr 2017 09:11:08 +0000 (11:11 +0200)]
Cleanup: Some style and code tweaks to Image Code after changes.

Whitespace and order of switch/case etc. Let's try to stick to float4/byte4/half4/float/byte/half order as defined in "ImageDataType".

2 years agoUnlimited number of textures for Cycles
Stefan Werner [Thu, 27 Apr 2017 07:34:51 +0000 (09:34 +0200)]
Unlimited number of textures for Cycles

This patch allows for an unlimited number of textures in Cycles where the hardware allows. It replaces a number static arrays with dynamic arrays and changes the way the flat_slot indices are calculated. Eventually, I'd like to get to a point where there are only flat slots left and textures off all kinds are stored in a single array.

Note that the arrays in DeviceScene are changed from containing device_vector<T> objects to device_vector<T>* pointers. Ideally, I'd like to store objects, but dynamic resizing of a std:vector in pre-C++11 calls the copy constructor, which for a good reason is not implemented for device_vector. Once we require C++11 for Cycles builds, we can implement a move constructor for device_vector and store objects again.

The limits for CUDA Fermi hardware still apply.

Reviewers: tod_baudais, InsigMathK, dingto, #cycles

Reviewed By: dingto, #cycles

Subscribers: dingto, smellslikedonkey

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

2 years agoFix T51328: Add note to cmdline help that threads must be first
Aaron Carlisle [Thu, 27 Apr 2017 02:44:43 +0000 (22:44 -0400)]
Fix T51328: Add note to cmdline help that threads must be first

2 years agoCycles: Allow samples to finish in split kernel to avoid artifacts when canceling
Mai Lavelle [Wed, 26 Apr 2017 14:22:48 +0000 (10:22 -0400)]
Cycles: Allow samples to finish in split kernel to avoid artifacts when canceling

Previously canceling a render done by the split kernel could cause artifacts
such as very bright or dark tiles. This was caused by unfinished samples
being included in the output buffer. To avoid this we now wait till all the
currently rendering samples have finished, up to a limit of twice the
expected time for them to finish (currently this is no more than 20 seconds,
but usually its much less). If samples still haven't finished by then we
stop anyways in case there's an endless loop occurring.

2 years agoCycles: Change OpenCL split kernel to use single program by default
Mai Lavelle [Wed, 26 Apr 2017 14:05:10 +0000 (10:05 -0400)]
Cycles: Change OpenCL split kernel to use single program by default

Single program builds twice as fast as multi programs, so its better for
users to have it as the default.

2 years agoCycles: Enable Correlated Multi Jitter for OpenCL and split kernel
Mai Lavelle [Fri, 21 Apr 2017 03:14:34 +0000 (23:14 -0400)]
Cycles: Enable Correlated Multi Jitter for OpenCL and split kernel

Testing showed no issues so there's no reason to not have this.

2 years ago[msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds.
lazydodo [Wed, 26 Apr 2017 14:46:35 +0000 (08:46 -0600)]
[msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds.

2 years agoCycles: Fix over-allocation of triangles storage for triangle primitive hair
Sergey Sharybin [Wed, 26 Apr 2017 13:58:40 +0000 (15:58 +0200)]
Cycles: Fix over-allocation of triangles storage for triangle primitive hair

Was also causing some bad memory access caused by read data from non-initialized
arrays.

Repoted by bzztploink in IRC, thanks!

2 years agoFix race condition invalidating object data's bounding box
Sergey Sharybin [Wed, 26 Apr 2017 13:40:32 +0000 (15:40 +0200)]
Fix race condition invalidating object data's bounding box

2 years agoEnsure task scheduler exists before any threading starts in Blender
Sergey Sharybin [Wed, 26 Apr 2017 13:23:46 +0000 (15:23 +0200)]
Ensure task scheduler exists before any threading starts in Blender

2 years agoAvoid race condition copying Scene for off-thread OpenGL image save
Sergey Sharybin [Wed, 26 Apr 2017 13:11:58 +0000 (15:11 +0200)]
Avoid race condition copying Scene for off-thread OpenGL image save

2 years agoUser preferences: Use checkbox for Cycles device selection
Sergey Sharybin [Wed, 26 Apr 2017 13:06:31 +0000 (15:06 +0200)]
User preferences: Use checkbox for Cycles device selection

It was totally unclear whether the device is enabled or disabled.
Lots of people got fully lost in the current interface.

While the solution is not fully ideal, it is at least solves
ambiguity in the interface.

2 years agoThreading: Remove thread lock which seems useless
Sergey Sharybin [Wed, 26 Apr 2017 12:50:21 +0000 (14:50 +0200)]
Threading: Remove thread lock which seems useless

Render data is never guarded by image drawe lock.

2 years agoMove depth select loop into its own function
Campbell Barton [Wed, 26 Apr 2017 14:01:23 +0000 (00:01 +1000)]
Move depth select loop into its own function

Useful for splitting out draw logic in 2.8x

2 years agoAlembic export: support simple child hairs (Fix T51144)
Sybren A. Stüvel [Wed, 26 Apr 2017 13:31:03 +0000 (15:31 +0200)]
Alembic export: support simple child hairs (Fix T51144)

Simple child hairs don't have a face index number assigned, so the
call to dm->getTessFaceData(dm, num, CD_MFACE) would cause a crash. To
work around this, UV and normal vectors are copied from the parent
hair.

I've also removed an unnecessary call to dm->getTessFaceArray(dm);

Reviewers: kevindietrich

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

2 years agoAlembic: fixed indentation
Sybren A. Stüvel [Wed, 26 Apr 2017 13:17:28 +0000 (15:17 +0200)]
Alembic: fixed indentation

2 years agoAlembic: fixed memory leaks
Sybren A. Stüvel [Wed, 26 Apr 2017 13:17:19 +0000 (15:17 +0200)]
Alembic: fixed memory leaks

2 years agoAlembic: fixed refcount issue when duplicating imported objects
Sybren A. Stüvel [Wed, 26 Apr 2017 13:12:51 +0000 (15:12 +0200)]
Alembic: fixed refcount issue when duplicating imported objects

Duplicating an imported object didn't increment the cache reader's refcount,
whereas removing the duplicate did decrement it. This caused problems.

2 years agoFix T51280: Alembic: Crash when removing cache modifier
Sybren A. Stüvel [Wed, 26 Apr 2017 11:01:19 +0000 (13:01 +0200)]
Fix T51280: Alembic: Crash when removing cache modifier

The calls to id_us_plus/min were unnecessary (and caused assertion
failures) as this is already taken care of by transformcache_id_looper().

2 years agoOSX buildbot: remove redundant option
Jens Verwiebe [Wed, 26 Apr 2017 12:28:36 +0000 (14:28 +0200)]
OSX buildbot: remove redundant option

2 years agoOSX buildbot: disable unsupported calls for now and use quicktime off default
Jens Verwiebe [Wed, 26 Apr 2017 12:02:53 +0000 (14:02 +0200)]
OSX buildbot: disable unsupported calls for now and use quicktime off default

2 years agoAvoid platform dependant PATH_MAX
Campbell Barton [Wed, 26 Apr 2017 11:06:00 +0000 (21:06 +1000)]
Avoid platform dependant PATH_MAX

2 years agoAlembic export: also export empties
Sybren A. Stüvel [Wed, 26 Apr 2017 10:26:21 +0000 (12:26 +0200)]
Alembic export: also export empties

Exporting an empty creates an Alembic XForm object. The empties can also
be animated.

2 years agoAlembic export: renamed func object_is_shape → object_type_is_exportable
Sybren A. Stüvel [Wed, 26 Apr 2017 10:25:45 +0000 (12:25 +0200)]
Alembic export: renamed func object_is_shape → object_type_is_exportable

The function doesn't return whether the object is a shape at all, since
it also returns true for camera objects (and soon also for empties). It
returns true when objects of this type can be exported to Alembic at all.
This is now reflected in the name.

2 years agoAlembic: shortened CacheFile.filepath to 1024 bytes again
Sybren A. Stüvel [Wed, 26 Apr 2017 08:40:54 +0000 (10:40 +0200)]
Alembic: shortened CacheFile.filepath to 1024 bytes again

As per discussion on 3128600a8ab2badd9ea39c80133f15f766794ec6

2 years agoAlembic: fixed C++98 compatibility
Sybren A. Stüvel [Wed, 26 Apr 2017 08:39:43 +0000 (10:39 +0200)]
Alembic: fixed C++98 compatibility

2 years agoAlembic import: added unit test for mesh deformation.
Sybren A. Stüvel [Tue, 25 Apr 2017 16:03:54 +0000 (18:03 +0200)]
Alembic import: added unit test for mesh deformation.

2 years agoCycles: Fix access undefined macro on non-MSVC compiler
Sergey Sharybin [Wed, 26 Apr 2017 08:00:31 +0000 (10:00 +0200)]
Cycles: Fix access undefined macro on non-MSVC compiler

Also rremove trailing whitespace.

2 years agoworkaround for T50176
lazydodo [Tue, 25 Apr 2017 20:17:41 +0000 (14:17 -0600)]
workaround for T50176

This works around a long outstanding issue T50176 with cycles on msvc2015/x86 . root cause is still unknown though,feels like a game of whack'a'mole

Reviewers: sergey, dingto

Subscribers: Blendify

Tags: #cycles

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

2 years agoCycles: use safe compiler flags for OpenCL.
Hristo Gueorguiev [Tue, 25 Apr 2017 18:10:51 +0000 (20:10 +0200)]
Cycles: use safe compiler flags for OpenCL.

Using -cl-fast-relaxed-math assumes no NaN/Inf values in any expression.
This causes problems on overflow, division by zero, square root of negative number.
Comparisons with NaN or infinite value are affected as well.

This patch causes <2% slowdown on benchmark scenes.

Fix T50985: Rendering volume scatter with GPU OpenCL comes to an halt after a few seconds

2 years agoWorkaround for AMD GPU OpenCL compiler.
Hristo Gueorguiev [Tue, 25 Apr 2017 18:08:14 +0000 (20:08 +0200)]
Workaround for AMD GPU OpenCL compiler.

2 years agoFix T51292: Alembic import, show notification when trying to load HDF5
Sybren A. Stüvel [Tue, 25 Apr 2017 12:30:01 +0000 (14:30 +0200)]
Fix T51292: Alembic import, show notification when trying to load HDF5

HDF5 Alembic files are not officially supported by Blender. With this
commit, the HDF5 format is detected even when Blender is compiled without
HDF5 support, and the user is given an explanatory error message (rather
than the generic "Could not open Alembic archive for reading".

2 years agoCycles: Fix strict compiler flags
Sergey Sharybin [Tue, 25 Apr 2017 12:11:45 +0000 (14:11 +0200)]
Cycles: Fix strict compiler flags

2 years agoFix OSX buildbot
Jens Verwiebe [Tue, 25 Apr 2017 12:05:03 +0000 (14:05 +0200)]
Fix OSX buildbot

2 years agoFix T51262: Blender CRASH with alembic file
Sybren A. Stüvel [Tue, 25 Apr 2017 10:05:55 +0000 (12:05 +0200)]
Fix T51262: Blender CRASH with alembic file

Also added a unit test for exporting & importing very long names.

2 years agoCycles: Cleanup, mainly line length in random module
Sergey Sharybin [Tue, 25 Apr 2017 09:42:36 +0000 (11:42 +0200)]
Cycles: Cleanup, mainly line length in random module

Was doing lots of investigation recently, with need to have lots of things
side by side.

2 years agoRevert "Alembic: Construct ISampleSelector once and pass along"
Sybren A. Stüvel [Tue, 25 Apr 2017 08:43:36 +0000 (10:43 +0200)]
Revert "Alembic: Construct ISampleSelector once and pass along"

This reverts commit 099816587a0e064fb6a52c82a737ae8814cf21df. It had some
unforseen side-effects that should be investigated first.

2 years agoCycles: Split vectorized math utilities to a dedicated files
Sergey Sharybin [Fri, 14 Apr 2017 12:05:23 +0000 (14:05 +0200)]
Cycles: Split vectorized math utilities to a dedicated files

This file was even a bigger mess than vectorized types header,
cleaning it up to make it easier to maintain this files and
extend further.