2 years agoRemoved loading thumbs from file, drawing with template_icon_view temp-sybren-poselib
Sybren A. Stüvel [Thu, 15 Dec 2016 15:00:57 +0000 (16:00 +0100)]
Removed loading thumbs from file, drawing with template_icon_view

2 years agoRevert "Removed now-unused code of old poselib-previews addon."
Sybren A. Stüvel [Thu, 15 Dec 2016 14:21:00 +0000 (15:21 +0100)]
Revert "Removed now-unused code of old poselib-previews addon."

This reverts commit 94527ed77c65bda18915216121c7c27cd5b9d2a1.

2 years agoMerge branch 'multi_previews_id' into temp-sybren-poselib
Sybren A. Stüvel [Thu, 15 Dec 2016 11:14:44 +0000 (12:14 +0100)]
Merge branch 'multi_previews_id' into temp-sybren-poselib

2 years agoAdded rendering of previews of single poses
Sybren A. Stüvel [Thu, 15 Dec 2016 11:14:16 +0000 (12:14 +0100)]
Added rendering of previews of single poses

2 years agoFIx merge issues, move preview resolution setting from RNA to BKE, do not clear previ... multi_previews_id
Bastien Montagne [Thu, 15 Dec 2016 11:09:34 +0000 (12:09 +0100)]
FIx merge issues, move preview resolution setting from RNA to BKE, do not clear preview when setting same resolution as current one.

2 years agoMerge branch 'master' into multi_previews_id
Bastien Montagne [Thu, 15 Dec 2016 10:56:59 +0000 (11:56 +0100)]
Merge branch 'master' into multi_previews_id


2 years agoProper fix for strict compiler warning
Sergey Sharybin [Thu, 15 Dec 2016 10:51:53 +0000 (11:51 +0100)]
Proper fix for strict compiler warning

2 years agoRevert "Cleanup: Remove unused variable"
Sergey Sharybin [Thu, 15 Dec 2016 10:50:25 +0000 (11:50 +0100)]
Revert "Cleanup: Remove unused variable"

This reverts commit 743165eb48870f1d68c8df48cc5907dea857b017.

Didn't see it is used in debug mode, sorry

2 years agoCleanup: Remove unused variable
Sergey Sharybin [Thu, 15 Dec 2016 10:49:44 +0000 (11:49 +0100)]
Cleanup: Remove unused variable

2 years agoDocumented an assumption of the code in a comment.
Sybren A. Stüvel [Thu, 15 Dec 2016 10:07:28 +0000 (11:07 +0100)]
Documented an assumption of the code in a comment.

2 years agoDon't reset preview index to 0.
Sybren A. Stüvel [Thu, 15 Dec 2016 10:07:06 +0000 (11:07 +0100)]
Don't reset preview index to 0.

2 years agoUse window manager progress reporting while rendering previews.
Sybren A. Stüvel [Thu, 15 Dec 2016 10:06:50 +0000 (11:06 +0100)]
Use window manager progress reporting while rendering previews.

2 years agoRegister UNDO step after preview rendering.
Sybren A. Stüvel [Thu, 15 Dec 2016 10:06:27 +0000 (11:06 +0100)]
Register UNDO step after preview rendering.

2 years agoRemoved now-unused code of old poselib-previews addon.
Sybren A. Stüvel [Thu, 15 Dec 2016 09:12:47 +0000 (10:12 +0100)]
Removed now-unused code of old poselib-previews addon.

2 years agoFix STR_String Capitalize on non Win32
Karsten Weiss [Thu, 15 Dec 2016 01:56:48 +0000 (12:56 +1100)]
Fix STR_String Capitalize on non Win32

Harmless since its not used, but good to fix.

2 years agoBGE: Fix T50098: Crash when useding ImageMirror
Thomas Szepe [Wed, 14 Dec 2016 19:07:51 +0000 (20:07 +0100)]
BGE: Fix T50098: Crash when useding ImageMirror

The crash was caused by a missing m_sync initialisation in the second
ImageRender constructor.

2 years agoFix World Space Shading option influence on Fresnel node for BI + cleanup
Alexander Romanov [Wed, 14 Dec 2016 16:48:01 +0000 (19:48 +0300)]
Fix World Space Shading option influence on Fresnel node for BI + cleanup

2 years agoCycles: Fix uninitialized variable issue after recent changes
Sergey Sharybin [Wed, 14 Dec 2016 16:30:50 +0000 (17:30 +0100)]
Cycles: Fix uninitialized variable issue after recent changes

2 years agoFresnel node support for Blender Internal Render
Alexander Romanov [Wed, 14 Dec 2016 15:02:38 +0000 (18:02 +0300)]
Fresnel node support for Blender Internal Render

2 years agoCycles: Move object culling helper to own files
Sergey Sharybin [Wed, 14 Dec 2016 12:01:33 +0000 (13:01 +0100)]
Cycles: Move object culling helper to own files

This is a stand-alone logic, which becomes quite comprehensive now.

2 years agoCycles: Fix indendation
Sergey Sharybin [Wed, 14 Dec 2016 11:47:28 +0000 (12:47 +0100)]
Cycles: Fix indendation

2 years agoCycles: Consider GGX/Beckmann/Ashikhmin of 0 roughness a singular ray
Sergey Sharybin [Tue, 6 Dec 2016 14:57:16 +0000 (15:57 +0100)]
Cycles: Consider GGX/Beckmann/Ashikhmin of 0 roughness a singular ray

This matches behavior of Multiscatter GGX and could become handy later on
when/if we decide it would be beneficial to replace on closure with another.

Reviewers: lukasstockner97, brecht

Reviewed By: brecht

Differential Revision:

2 years agoCycles: Tweak curve segment (un)pack to handle more curve segments
Sergey Sharybin [Wed, 7 Dec 2016 09:53:07 +0000 (10:53 +0100)]
Cycles: Tweak curve segment (un)pack to handle more curve segments

There was 16 bits reserved for primitive type, while we only need 4.

Reviewers: brecht

Reviewed By: brecht

Differential Revision:

2 years agoUsual UI messages/i18n fixes/tweaks.
Bastien Montagne [Wed, 14 Dec 2016 09:36:43 +0000 (10:36 +0100)]
Usual UI messages/i18n fixes/tweaks.

2 years agoFix T50243: libmv_panography_test is broken
Sergey Sharybin [Wed, 14 Dec 2016 09:44:57 +0000 (10:44 +0100)]
Fix T50243: libmv_panography_test is broken

There was fully wrong logic in comparison: was actually accessing memory
past the array boundary. Run test manually and the figure seems correct
to me now.

Spotted by @LazyDodo, thanks!

2 years agoSmall cleanup: Remove unused code
Aaron Carlisle [Tue, 13 Dec 2016 19:15:53 +0000 (20:15 +0100)]
Small cleanup: Remove unused code

This code has not been used for a long time if not ever.
Most of the code was removed in rB1d3609262704f88c9e30b2cebdb236110b25cdc9
however, this was forgoten.

2 years agoUI: Externally open file and path from context menu
Julian Eisel [Tue, 13 Dec 2016 15:45:07 +0000 (16:45 +0100)]
UI: Externally open file and path from context menu

Adds two buttons to context (RMB) menu of path buttons:
* "Open File Externally" to open a file in an external app (only visible if path contains a filename)
* "Open Location Externally" to open a path in an external file browser

The functionallity for this was already there, just hidden behind Shift/Alt click of file_browse button (folder icon next to path button).

2 years agoFix strict warnings on Windows
Sergey Sharybin [Tue, 13 Dec 2016 15:46:04 +0000 (16:46 +0100)]
Fix strict warnings on Windows

2 years agoFix strict compiler error when building without bullet
Sergey Sharybin [Tue, 13 Dec 2016 09:18:02 +0000 (10:18 +0100)]
Fix strict compiler error when building without bullet

2 years agoLibmv: Fix typo in assert message
Karsten Weiss [Tue, 13 Dec 2016 09:16:20 +0000 (10:16 +0100)]
Libmv: Fix typo in assert message

2 years agoLibmv: Fix copy-paste mistake in camera intrinsic parameters
Karsten Weiss [Tue, 13 Dec 2016 09:15:40 +0000 (10:15 +0100)]
Libmv: Fix copy-paste mistake in camera intrinsic parameters

2 years agoCleanup: bad (harmless) usage of PARM_PYFUNC_OPTIONAL in new ID.make_local RNA defini...
Bastien Montagne [Mon, 12 Dec 2016 14:56:00 +0000 (15:56 +0100)]
Cleanup: bad (harmless) usage of PARM_PYFUNC_OPTIONAL in new ID.make_local RNA definition.

PARM_PYFUNC_OPTIONAL is only useful in definition of callbacks for
registrable types...

2 years agoFix (unreported) some RNA func definitions setting flags of other func parameters!
Bastien Montagne [Mon, 12 Dec 2016 14:54:16 +0000 (15:54 +0100)]
Fix (unreported) some RNA func definitions setting flags of other func parameters!

Both found cases where luckily harmless, though...

2 years agoRefactor RNA property: split flags in property flags, parameter flags, and internal...
Bastien Montagne [Mon, 12 Dec 2016 14:23:55 +0000 (15:23 +0100)]
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.

This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.

To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.

This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).

And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).

Reviewers: sergey, Severin

Subscribers: dfelinto, brecht

Differential Revision:

2 years agoCleanup: Get rid of unused BKE_rigidbody_relink_constraint().
Bastien Montagne [Mon, 12 Dec 2016 14:05:19 +0000 (15:05 +0100)]
Cleanup: Get rid of unused BKE_rigidbody_relink_constraint().

Also use proper ID_NEW_REMAP macro in BKE_rigidbody_world_groups_relink()!

2 years agoCleanup: Rename BKE_libblock_relink, and move it to BKE_library_remap.h
Bastien Montagne [Mon, 12 Dec 2016 13:58:10 +0000 (14:58 +0100)]
Cleanup: Rename BKE_libblock_relink, and move it to BKE_library_remap.h

Was a waaaaayyyyy to much generic name for such a specific func, renamed
to much more descriptive BKE_libblock_relink_to_newid().

In near future (few weeks, to limit as much as possible silent mismatch
in branches), will rename BKE_libblock_relink_ex to BKE_libblock_relink,
this is the real generic data-block relinking func!

2 years agoCleanup: Get rid of ntreeSwitchID(_ex) functions, use generic BKE_libblock_relink_ex...
Bastien Montagne [Mon, 12 Dec 2016 13:31:50 +0000 (14:31 +0100)]
Cleanup: Get rid of ntreeSwitchID(_ex) functions, use generic BKE_libblock_relink_ex instead.

2 years agoCycles: Cleanup, variable names
Sergey Sharybin [Mon, 12 Dec 2016 11:10:37 +0000 (12:10 +0100)]
Cycles: Cleanup, variable names

Use underscore again and also solve confusing part then in BVH smae
thing is called prim_addr but in intersection funcitons it was called

2 years agoCycles: Cleanup, variables names
Sergey Sharybin [Mon, 12 Dec 2016 09:19:49 +0000 (10:19 +0100)]
Cycles: Cleanup, variables names

Use underscore instead of camel case.

2 years agoAdded --debug-io flag to command line
Gaia Clary [Fri, 9 Dec 2016 16:19:59 +0000 (17:19 +0100)]
Added --debug-io flag to command line

2 years agoLand D2339 by bliblu bli
lazydodo [Fri, 9 Dec 2016 15:28:04 +0000 (08:28 -0700)]
Land D2339 by bliblu bli

2 years agoDepsgraph: Add missing relation for cast modifier
Sergey Sharybin [Fri, 9 Dec 2016 12:40:12 +0000 (13:40 +0100)]
Depsgraph: Add missing relation for cast modifier

When control object is used we need to known our own transformation as well.

2 years agoDepsgraph: Bone parent should also include armature transform relation
Sergey Sharybin [Fri, 9 Dec 2016 12:05:39 +0000 (13:05 +0100)]
Depsgraph: Bone parent should also include armature transform relation

It is required to have world-space bone position, which consists of armature
object transform and local bone transform.

2 years agoFix emissive volumes generates unexpected fireflies around intersections
Sergey Sharybin [Thu, 8 Sep 2016 15:07:58 +0000 (17:07 +0200)]
Fix emissive volumes generates unexpected fireflies around intersections

Discard the whole volume stack on the last bounce (but keep
world volume if present).

Volumes are expected to be closed manifol meshes, meaning if
ray entered the volume there should be an intersection event
of ray exisintg the volume. Case when ray hit nothing and
there are still non-world volumes in the stack can happen in
either of cases.

1. Mesh is not closed manifold.

Such configurations are not really supported anyway and should
not be used.

Previous code would have consider the infinite length of the
ray to sample across, so render result wasn't really correct

2. Exit intersection is more far away than the camera far
   clip distance.

This case also will behave differently now, but previously it
wasn't really correct either, so it's not like we're breaking
something which was working as expected.

3. We missed exit event due to intersection precision issues.

This is exact the case which this patch fixes and avoid

4. Volume has Camera only visibility (all the rest visibility
is set to off)

This is what could be considered a regression but could be
solved quite easily by checking volume stack's objects flags
and keep entries which doesn't have Volume Scatter visibility
(or even better: ensure Volume Scatter visibility for objects
with volume closure),

Fixes T46108: Cycles - Overlapping emissive volumes generates unexpected bright hotspots around the intersection
Also fixes fireflies appearing on the edges of cube with
emissive volue.

Reviewers: juicyfruit, brecht

Reviewed By: brecht

Maniphest Tasks: T46108

Differential Revision:

2 years agoFix T49872: 3D cursor places with camera shift in ortographic mode
Julian Eisel [Thu, 8 Dec 2016 11:41:27 +0000 (12:41 +0100)]
Fix T49872: 3D cursor places with camera shift in ortographic mode

2 years agoFix expanding enum property in sub-layout of pie menus
Julian Eisel [Thu, 8 Dec 2016 10:53:48 +0000 (11:53 +0100)]
Fix expanding enum property in sub-layout of pie menus

//ui_item_enum_expand// function replaces all pie menu's sub-layouts with radial layout. It should replace only root layout.

To reproduce the issue paste the code in Blender's text editor and press Run Script button.
import bpy

class VIEW3D_PIE_template(bpy.types.Menu):
    bl_label = "Select Mode"

    def draw(self, context):
        layout = self.layout.menu_pie()
            context.scene.render.image_settings, "color_mode", expand=True)

def register():

def unregister():

if __name__ == "__main__":

Differential Revision: by @raa

2 years agoFix crash when opening a Blender file containing Alembic data.
Kévin Dietrich [Wed, 7 Dec 2016 22:01:51 +0000 (23:01 +0100)]
Fix crash when opening a Blender file containing Alembic data.

Was also affecting object linking.

2 years agoFix failing to build ffmpeg 3.
Bastien Montagne [Wed, 7 Dec 2016 16:17:31 +0000 (17:17 +0100)]
Fix failing to build ffmpeg 3.

--disable-libfaac is no more ffmpeg build option.

2 years agoFix (unreported) Sequencer Drop effect: wrong initial offset in second input buffer.
Bastien Montagne [Wed, 7 Dec 2016 13:53:57 +0000 (14:53 +0100)]
Fix (unreported) Sequencer Drop effect: wrong initial offset in second input buffer.

Reading rest of the code, it's obvious we want to start à YOFF lines
from start of rect2i, so we have to also multiply by number of

Also did some minor cleanup.

2 years agoFix T49893: Crash in Video Sequence Editor with 'drop' effect.
Bastien Montagne [Wed, 7 Dec 2016 13:16:07 +0000 (14:16 +0100)]
Fix T49893: Crash in Video Sequence Editor with 'drop' effect.

Code was not accounting for possibilities that width or height of given
buffers may be smaller than XOFF/YOFF...

Note that I seriously doubt that drop code actually works (as in, gives
expected results) when applied to tiles like it seems to be done
currently, but this is much more complex (and involved) topic.

2 years agoRemove unused include statement
Sergey Sharybin [Wed, 7 Dec 2016 10:39:12 +0000 (11:39 +0100)]
Remove unused include statement

2 years agoUse proper defaults for Hue/Saturation node
Sergey Sharybin [Wed, 7 Dec 2016 10:27:27 +0000 (11:27 +0100)]
Use proper defaults for Hue/Saturation node

2 years agoCycles :Cleanup, indentation
Sergey Sharybin [Tue, 6 Dec 2016 14:36:35 +0000 (15:36 +0100)]
Cycles :Cleanup, indentation

2 years agoDepsgraph: Only re-schedule objects which are on visible layers
Sergey Sharybin [Tue, 6 Dec 2016 13:48:48 +0000 (14:48 +0100)]
Depsgraph: Only re-schedule objects which are on visible layers

Otherwise it's possible to cause infinite update loop in Cycles viewport.

Gets a bit messy logic, need to revisit this..

2 years agoFix T50122: SEGFAULT: OCIO configuration typo leads to segfault
Sergey Sharybin [Tue, 6 Dec 2016 13:19:17 +0000 (14:19 +0100)]
Fix T50122: SEGFAULT: OCIO configuration typo leads to segfault

2 years agoFix T50003, Bevel makes non-manifold mesh.
Howard Trickey [Tue, 6 Dec 2016 12:43:47 +0000 (07:43 -0500)]
Fix T50003, Bevel makes non-manifold mesh.

Problem was setting prev/next faces for edges around
a vertex on valence-2 vertices.

2 years agoFix T50020: adding a background image does not set image user data.
Kévin Dietrich [Mon, 5 Dec 2016 23:04:15 +0000 (00:04 +0100)]
Fix T50020: adding a background image does not set image user data.

2 years agoUI: add a message to indicate when using a modifier that wasn't
Kévin Dietrich [Mon, 5 Dec 2016 22:33:21 +0000 (23:33 +0100)]
UI: add a message to indicate when using a modifier that wasn't

This adds a short message to the smoke, remesh and boolean modifiers' UI
when trying to use them when their compilation was turned off. This was
already implemented for the fluid and ocean simulation modifiers.

This also makes the 'quick fluid' and 'quick smoke' operator abort and
report when trying to use them when unavailable.

2 years agoDepsgraph: Use HIGH priority for scheduled tasks
Sergey Sharybin [Mon, 5 Dec 2016 15:31:34 +0000 (16:31 +0100)]
Depsgraph: Use HIGH priority for scheduled tasks

This kind of keeps threads "warmer" and should in theory give better
cache coherency bringing some %% of speedup. It was already tested
few months ago and it gave few % speedup in barber shop, but was
reverted due to some bone popping. The popping is now fixed so it
should be fine to use new scheduling policy.

2 years agoDepsgraph: avoid more transitive relations for rigid body simulation
Sergey Sharybin [Mon, 5 Dec 2016 15:30:30 +0000 (16:30 +0100)]
Depsgraph: avoid more transitive relations for rigid body simulation

2 years agoDepsgraph: Rigid body simulation doesn't need explicit time relation
Sergey Sharybin [Mon, 5 Dec 2016 15:03:10 +0000 (16:03 +0100)]
Depsgraph: Rigid body simulation doesn't need explicit time relation

It'll be dependent on time via Time Source -> Rebuild RB World chain.

2 years agoDepsgraph: Avoid transitive relation from local transform to final
Sergey Sharybin [Mon, 5 Dec 2016 14:59:31 +0000 (15:59 +0100)]
Depsgraph: Avoid transitive relation from local transform to final

There is always an uber eval node on the way. so we can avoid creating
some relations here in order to speed up both construction time and

2 years agoFix depsgraph: hair collision is actually enabled, so add the relations.
Alexander Gavrilov [Mon, 5 Dec 2016 10:35:24 +0000 (13:35 +0300)]
Fix depsgraph: hair collision is actually enabled, so add the relations.

2 years agoFix compilation error on recent Debian desktop
Sergey Sharybin [Mon, 5 Dec 2016 10:34:49 +0000 (11:34 +0100)]
Fix compilation error on recent Debian desktop

Something funny happened here, there were missing symbols from png
library to math functions.

2 years agoFix T50141: Nabla zero division on texture force field
Luca Rood [Sat, 3 Dec 2016 16:05:56 +0000 (14:05 -0200)]
Fix T50141: Nabla zero division on texture force field

This sets forces to zero, when Nabla is zero and a grayscale texture is
used or texture mode is Gradient or Curl.

Nabla equal to zero was causing a zero division, and forces ended up
being set to `nan`.

Reviewed By: mont29

Differential Revision:

2 years agoCMake: disable QuickTime with macOS SDK 10.12+, no longer supported by Apple.
Brecht Van Lommel [Sun, 4 Dec 2016 19:23:55 +0000 (20:23 +0100)]
CMake: disable QuickTime with macOS SDK 10.12+, no longer supported by Apple.

2 years agoFix macOS 10.9 build when using OIIO without FFmpeg.
Brecht Van Lommel [Sun, 4 Dec 2016 12:49:34 +0000 (13:49 +0100)]
Fix macOS 10.9 build when using OIIO without FFmpeg.

2 years agoDocs: Show 'Other Options' last in --help
Campbell Barton [Sun, 4 Dec 2016 10:55:17 +0000 (21:55 +1100)]
Docs: Show 'Other Options' last in --help

Own error when changing order,
moving experimental features last made some sense,
but causes them to be listed twice.

Reorder and comment to avoid it happening again.

2 years agoCleanup: simplify bitmap line drawing
Campbell Barton [Sun, 4 Dec 2016 04:05:50 +0000 (15:05 +1100)]
Cleanup: simplify bitmap line drawing

- Expand overly dense & confusing delta assignments.
- Replace bit shift with multiply.

Also link to 'clipped' version of this function
which may be useful to add later.

2 years ago[msvc] Changes for new oiio/ffmpeg versions.
lazydodo [Sun, 4 Dec 2016 00:38:20 +0000 (17:38 -0700)]
[msvc] Changes for new oiio/ffmpeg versions.

2 years agoCMake: update for macOS 10.9 libs with ffmpeg 3.2.1 and webp support.
Brecht Van Lommel [Sat, 3 Dec 2016 13:56:58 +0000 (14:56 +0100)]
CMake: update for macOS 10.9 libs with ffmpeg 3.2.1 and webp support.

2 years agoFix macOS build with openimageio 1.7.8 and openexr.
Brecht Van Lommel [Sat, 3 Dec 2016 13:56:46 +0000 (14:56 +0100)]
Fix macOS build with openimageio 1.7.8 and openexr.

These macros conflict and are no longer needed with C99 or C++ anyway.

2 years agoCycles: Refactor Progress system to provide better estimates
Lukas Stockner [Sat, 26 Nov 2016 03:22:34 +0000 (04:22 +0100)]
Cycles: Refactor Progress system to provide better estimates

The Progress system in Cycles had two limitations so far:
 - It just counted tiles, but ignored their size. For example, when rendering a 600x500 image with 512x512 tiles, the right 88x500 tile would count for 50% of the progress, although it only covers 15% of the image.
 - Scene update time was incorrectly counted as rendering time - therefore, the remaining time started very long and gradually decreased.

This patch fixes both problems:
First of all, the Progress now has a function to ignore time spans, and that is used to ignore scene update time.
The larger change is the tile size: Instead of counting samples per tile, so that the final value is num_samples*num_tiles, the code now counts every sample for every pixel, so that the final value is num_samples*num_pixels.

Along with that, some unused variables were removed from the Progress and Session classes.

Reviewers: brecht, sergey, #cycles

Subscribers: brecht, candreacchio, sergey

Differential Revision:

2 years agoOCIO: Implement exposure/gamma for fallback implementation
Sergey Sharybin [Fri, 2 Dec 2016 15:57:00 +0000 (16:57 +0100)]
OCIO: Implement exposure/gamma for fallback implementation

Quite handy for debugging.

Unfortunately, this doesn't support viewport tweaks yet since those
require GLSL for colorspace conversion. Maybe this will be implemented
as well one day in the future..

2 years agoCycles: Implement AVX2 path for curve intersection functions
Sergey Sharybin [Fri, 2 Dec 2016 11:15:24 +0000 (12:15 +0100)]
Cycles: Implement AVX2 path for curve intersection functions

Gives little performance improvement on Linux and gives up to 2%
speedup on koro.blend on Windows.

Inspired by Maxym Dmytrychenko, thanks!

2 years agoCycles: Add AVX intrinsics helpers
Sergey Sharybin [Fri, 2 Dec 2016 09:42:31 +0000 (10:42 +0100)]
Cycles: Add AVX intrinsics helpers

They are defined for MSVC but seems to be missing in GCC and CLang-3.8.

Maybe some further tweaks to policy when to define those functions is
needed, but should be fine for now.

2 years agoFix T50062: Mask - Clicking in ActivePoint Parent makes Blender crash.
Bastien Montagne [Fri, 2 Dec 2016 09:45:03 +0000 (10:45 +0100)]
Fix T50062: Mask - Clicking in ActivePoint Parent makes Blender crash.

Mask primitive adding code was not initializing correctly id_type of
points' parents.

2 years agoCycles: Disable AVX2 crash workarounds
Sergey Sharybin [Fri, 2 Dec 2016 09:15:24 +0000 (10:15 +0100)]
Cycles: Disable AVX2 crash workarounds

I can no longer reproduce crash with neither of the files where
the crash was originally visible. This is something where other
changes (light threshold, sampling) had an effect and made code
to work as it is supposed to. Could have been optimizator issue
or something like that.

Let's see if we hit same issue again.

2 years agoFix (unreported) memleak in ImBuf mipmap code in some cases.
Bastien Montagne [Fri, 2 Dec 2016 08:44:41 +0000 (09:44 +0100)]
Fix (unreported) memleak in ImBuf mipmap code in some cases.

`IMB_remakemipmap` may 'shrink' the mipmap list without actually freeing
anything, so we need to check all possible levels in `imb_freemipmapImBuf`
to avoid memory leaks, not only those currently used.

2 years Update official (default) lib versions of py/oiio/osl/osd/ffmpeg.
Bastien Montagne [Thu, 1 Dec 2016 15:30:17 +0000 (16:30 +0100)] Update official (default) lib versions of py/oiio/osl/osd/ffmpeg.

2 years agoFix (unreported) looptri array not being recalculated in ccgDM and emDM
Luca Rood [Wed, 23 Nov 2016 19:19:03 +0000 (17:19 -0200)]
Fix (unreported) looptri array not being recalculated in ccgDM and emDM

In ccgDM and emDM, looptri array recalculation was being handled
directly by `*DM_getLoopTriArray` (`getLoopTriArray` callback), while
`*DM_recalcLoopTri` (`recalcLoopTri` callback) was doing nothing.

This results in the array not being recalculated when other functions
that depend on the array data called the recalc function.

This moves all the recalculation code to `*DM_recalcLoopTri` and makes
`*DM_getLoopTriArray` call that.

This commit also makes a minor change to the `getNumLoopTri` function,
so that it returns the correct number without having to recalculate the
looptri array.

Reviewed By: mont29

Differential Revision:

2 years agoGPencil: Include various new operators into the 3D View menus too
Joshua Leung [Thu, 1 Dec 2016 13:19:59 +0000 (02:19 +1300)]
GPencil: Include various new operators into the 3D View menus too

Quite a few of the operators added for 2.78 were not included in the menus

2 years agoGPencil Sculpt: Numpad keys now work when doing sculpt sessions (i.e. when the operat...
Joshua Leung [Thu, 1 Dec 2016 06:36:30 +0000 (19:36 +1300)]
GPencil Sculpt: Numpad keys now work when doing sculpt sessions (i.e. when the operator is run using wait_for_input=True)

This just brings it in line with the drawing operator

2 years agoCompiler warning fix
Joshua Leung [Thu, 1 Dec 2016 06:34:35 +0000 (19:34 +1300)]
Compiler warning fix

2 years agoBuildbot: Disable glibc211 slaves
Sergey Sharybin [Thu, 1 Dec 2016 14:05:53 +0000 (15:05 +0100)]
Buildbot: Disable glibc211 slaves

2 years agoFix T50116: Light threshold broke branched path tracer
Sergey Sharybin [Thu, 1 Dec 2016 13:27:10 +0000 (14:27 +0100)]
Fix T50116: Light threshold broke branched path tracer

In fact, the issue was caused by light threshold being too high for
certain scenes. Lowered it down to 0.01.

2 years agoCycles: Fix correlation issues in certain cases
Sergey Sharybin [Sat, 26 Nov 2016 16:30:02 +0000 (17:30 +0100)]
Cycles: Fix correlation issues in certain cases

There were two cases where correlation issues were obvious:

- File from T38710 was giving issues in 2.78a again
- File from T50116 was having totally different shadow between
  sample 1 and sample 32.

Use some more simplified version of CMJ hash which seems to give
nice randomized value which solves the correlation.

This commit will break all unit test files, but it's a bug fix
so perhaps OK to commit this.

This also fixes T41143: Sobol gives nonuniform noise

Proper science paper about hash function is coming.

Reviewers: brecht

Reviewed By: brecht

Subscribers: lukasstockner97

Differential Revision:

2 years agoFix T50075: Assert during debug render of hair_geom_transmission.blend
Sergey Sharybin [Thu, 1 Dec 2016 11:11:11 +0000 (12:11 +0100)]
Fix T50075: Assert during debug render of hair_geom_transmission.blend

2 years agoAlembic: quiet compilation warnings on Windows.
Kévin Dietrich [Thu, 1 Dec 2016 07:32:02 +0000 (08:32 +0100)]
Alembic: quiet compilation warnings on Windows.

Most of them are harmless implicit conversions (e.g. Alembic deals with
doubles for storing time information when Blender uses both ints and
floats/doubles) or class/struct mismatch on forward declarations.

2 years agoFix T46795 : Reset GWLP_USERDATA to NULL at window destruction so any future events...
lazydodo [Thu, 1 Dec 2016 01:26:25 +0000 (18:26 -0700)]
Fix T46795 : Reset GWLP_USERDATA to NULL at window destruction so any future events will not try to reference this deleted class.

2 years agoCleanup id->newid usage, initial work.
Bastien Montagne [Wed, 30 Nov 2016 14:25:54 +0000 (15:25 +0100)]
Cleanup id->newid usage, initial work.

This aims at always ensuring that ID.newid (and relevant LIB_TAG_NEW)
stay in clean (i.e. cleared) state by default.

To achieve this, instead of clearing after all id copy call (would be
horribly noisy, and bad for performances), we try to completely remove
the setting of id->newid by default when copying a new ID.

This implies that areas actually needing that info (mainly, object editing
area (make single user...) and make local area) have to ensure they set
it themselves as needed.

This is far from simple change, many complex code paths to consider, so
will need some serious testing. :/

2 years agoOCIO: Cleanup style
Sergey Sharybin [Wed, 30 Nov 2016 11:52:48 +0000 (12:52 +0100)]
OCIO: Cleanup style

Was a ground work for some more improvements here, but got dragged
to some other studio maintenance job here.

The plan would be to enable exposure/gamma control for fallback mode
which will definitely be really handy for development and might be
handy for cases when OCIO config can not be read.

2 years agoAlembic: slight cleanup, reorder mesh code a bit.
Kévin Dietrich [Wed, 30 Nov 2016 08:33:47 +0000 (09:33 +0100)]
Alembic: slight cleanup, reorder mesh code a bit.

2 years agoFix T49813: crash after changing Alembic cache topology.
Kévin Dietrich [Wed, 30 Nov 2016 08:20:45 +0000 (09:20 +0100)]
Fix T49813: crash after changing Alembic cache topology.

Crash is due by mismatching loops and faces counts between the Alembic
data and the Blender derivedmesh which does not appear so
straightforward to fix (the crash happens deep in the derivedmesh code).

So for now, try to detect if the topology has changed and if so, both
only read vertices (vertex colors and UVs won't be read, as tied to face
loops) and add a warning message in the modifier's UI to let the user

2 years agoUI: Remove 'x' icon from paths and lists
Julian Eisel [Tue, 29 Nov 2016 22:41:20 +0000 (23:41 +0100)]
UI: Remove 'x' icon from paths and lists

2 years agoFix compilation error with latest OIIO 1.7.8
Sergey Sharybin [Tue, 29 Nov 2016 11:40:38 +0000 (12:40 +0100)]
Fix compilation error with latest OIIO 1.7.8

There are some changes in OIIO includes so now need to do some
things differently.

2 years agoFix T50094: Crash when viewport rendering point density texture
Sergey Sharybin [Tue, 29 Nov 2016 10:39:14 +0000 (11:39 +0100)]
Fix T50094: Crash when viewport rendering point density texture

The idea is simple: cache PD resolution from cache_point_density() RNA
function because that one is supposed to be called while database is
locked for original synchronization.

Ideally we would also pass array size to the sampling function, but
it turned out to be quite problematic because API only accepts int type
and passing size_t might cause some weird behavior.

2 years agoCycles: Pass extra array size argument to builtin image pixels functions
Sergey Sharybin [Tue, 29 Nov 2016 10:03:11 +0000 (11:03 +0100)]
Cycles: Pass extra array size argument to builtin image pixels functions

This is a way to avoid possible memory corruption when render threads works
in parallel with UI thread.

Not guarantees complete safe, but makes things easier to check anyway.

2 years agoMath lib: Fix use function of wrong dimension
Sergey Sharybin [Tue, 29 Nov 2016 09:31:54 +0000 (10:31 +0100)]
Math lib: Fix use function of wrong dimension

Seems to be a typo in recent commit e1e49fd.

2 years agoFix T50029: BVHTree.FromPolygons memory leak
Campbell Barton [Tue, 29 Nov 2016 08:31:46 +0000 (19:31 +1100)]
Fix T50029: BVHTree.FromPolygons memory leak