blender.git
5 years agoFix bmesh test after recent refactor.
Bastien Montagne [Sat, 2 Jul 2016 17:11:13 +0000 (19:11 +0200)]
Fix bmesh test after recent refactor.

5 years agoBI Viewport(GLSL): support for envmap in Texture node
Alexander Romanov [Mon, 4 Jul 2016 08:19:13 +0000 (11:19 +0300)]
BI Viewport(GLSL): support for envmap in Texture node

This patch is another step to achieve BI and it's Viewport consistency for cubemap textures.
{F318879}

To test world_space_shading flag D2072 is required.

Alexander (Blend4Web Team)

Reviewers: campbellbarton, brecht

Subscribers: homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

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

5 years agoFix input for Texture node (envmap+world_space_shading)
Alexander Romanov [Mon, 4 Jul 2016 08:08:48 +0000 (11:08 +0300)]
Fix input for Texture node (envmap+world_space_shading)

This patch fixes shortcoming of D2046.
The original behavior without world_space_shading flag is that Texture node expects the reflected vector in view space. But with world_space_shading it should be in world space.

In attached file you will see a simple material setup and a node material analogue.

Simple material must have the same behavior regardless world_space_shading flag.

{F318866}

Alexander (Blend4Web Team)

Reviewers: brecht

Reviewed By: brecht

Subscribers: campbellbarton, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

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

5 years agoEnvironment lighting for the GLSL mode
Alexander Romanov [Mon, 4 Jul 2016 08:01:32 +0000 (11:01 +0300)]
Environment lighting for the GLSL mode

Environment lighting (aka ambient) is a key component of any renderer.
It's implemented like the Environment lighting of BI render for Approximate Gather mode. It support "Sky Color" and "White" Environment lighting modes.

It would be great if the user could see actual lighting conditions right in the Blender viewport instead of waiting for the renderer to complete the final image, exporting for external renderer or for a game engine.

Before:
{F113921}

After:
{F113922}

Example file: {F319013}

Original author: valentin_b4w

Alexander (Blend4Web Team)

Reviewers: valentin_b4w, campbellbarton, merwin, brecht

Reviewed By: brecht

Subscribers: panzergame, youle, duarteframos, AlexKowel, yurikovelenov, dingto, Evgeny_Rodygin

Projects: #rendering, #opengl_gfx

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

5 years agoQuiet warnings w/ USE_VERIFY define
Campbell Barton [Mon, 4 Jul 2016 04:55:29 +0000 (14:55 +1000)]
Quiet warnings w/ USE_VERIFY define

5 years agoCurve: utility to evaluate entire curve
Campbell Barton [Sun, 3 Jul 2016 13:20:53 +0000 (23:20 +1000)]
Curve: utility to evaluate entire curve

5 years agoUpdate pacman pkgbuild
Campbell Barton [Sun, 3 Jul 2016 11:13:43 +0000 (21:13 +1000)]
Update pacman pkgbuild

5 years agoFix T48783: OSL render errors after recent refactoring.
Brecht Van Lommel [Sun, 3 Jul 2016 11:08:21 +0000 (13:08 +0200)]
Fix T48783: OSL render errors after recent refactoring.

5 years agoFix use of uninitialized variable in Cycles OpenCL image textures.
Brecht Van Lommel [Sat, 2 Jul 2016 12:11:11 +0000 (14:11 +0200)]
Fix use of uninitialized variable in Cycles OpenCL image textures.

5 years agoFix typo in bgl.Buffer report function
Thomas Szepe [Sat, 2 Jul 2016 16:38:05 +0000 (18:38 +0200)]
Fix typo in bgl.Buffer report function

A GL_INT buffer was reported as GL_BYTE.

5 years agoInstall Deps: Use OSL 1.7.3, latest bugfix release.
Thomas Dinges [Sat, 2 Jul 2016 16:07:20 +0000 (18:07 +0200)]
Install Deps: Use OSL 1.7.3, latest bugfix release.

5 years agoCorrection for MSVC
Campbell Barton [Sat, 2 Jul 2016 10:21:39 +0000 (20:21 +1000)]
Correction for MSVC

5 years agoBMesh: utility function to resize bmesh elements
Campbell Barton [Sat, 2 Jul 2016 08:07:58 +0000 (18:07 +1000)]
BMesh: utility function to resize bmesh elements

This can be used to re-allocate bmesh data with/without tool flags.
Needed for Symmetrize since it uses bmesh operators from dyntopo.

5 years agoCleanup: comment blocks
Campbell Barton [Sat, 2 Jul 2016 00:02:04 +0000 (10:02 +1000)]
Cleanup: comment blocks

5 years agoCleanup: style
Campbell Barton [Sat, 2 Jul 2016 00:00:30 +0000 (10:00 +1000)]
Cleanup: style

5 years agoFix Cycles OpenCL not taking Extend and Clip extension types into account.
Thomas Dinges [Fri, 1 Jul 2016 21:48:31 +0000 (23:48 +0200)]
Fix Cycles OpenCL not taking Extend and Clip extension types into account.

(See T48720).

5 years ago"Fix" crash when deleting linked object which has indirect usages.
Bastien Montagne [Fri, 1 Jul 2016 15:51:08 +0000 (17:51 +0200)]
"Fix" crash when deleting linked object which has indirect usages.

This is in fact very hairy situation here... Objects are only refcounted by scenes,
any other usage is 'free', which means once all object instanciations are gone Blender
considers it can delete it.

There is a trap here though: indirect usages. Typically, we should never modify linked data
(because it is essencially useless, changes would be ignored and ost on next reload or
even undo/redo). This means indirect usages are not affected by default 'safe' remapping/unlinking.

For unlinking preceeding deletion however, this is not acceptable - we are likely to end with
a zero-user ID (aka deletable one) which is still actually used by other linked data.

Solution choosen here is double:
I) From 'user-space' (i.e. outliner, operators...), we check for cases where deleting datablocks
should not be allowed (indirect data or indirectly used data), and abort (with report) if needed.
II) From 'lower' level (BKE_library_remap and RNA), we also unlink from linked data,
which makes actual deletion possible and safe.

Note that with previous behavior (2.77 one), linked object would be deleted, including from linked data -
but then, once file is saved and reloaded, indirect usage would link back the deleted object,
without any instanciation in scene, which made it somehow virtual and unreachable...

With new behavior, this is no more possible, but on the other hand it means that in situations of dependency cycles
(two linked objects using each other), linked objects become impossible to delete (from user space).

Not sure what's best here, behavior with those corner cases of library linking is very poorly defined... :(

5 years agoOutliner: pass operator's reports to all operation callbacks.
Bastien Montagne [Fri, 1 Jul 2016 15:16:39 +0000 (17:16 +0200)]
Outliner: pass operator's reports to all operation callbacks.

Also define single callback func typedef, cleaner this way!

Note: maybe we want to do that for the other callbacks too (data, etc.), but will be enough for now.

5 years agoFix T48666: Segfault on boolean operation when exiting edit mode of instanced operand
Sergey Sharybin [Fri, 1 Jul 2016 12:19:47 +0000 (14:19 +0200)]
Fix T48666: Segfault on boolean operation when exiting edit mode of instanced operand

This is quite tricky situation which combined:

- Boolean modifier which accesses other object's derived mesh
  (in fact, it's nothing to do with boolean modifier, any other
  modifier which uses other's DM will have same bug).

- Dependency cycles in the scene which is rather russian-roulette
  from the cycle solver point of view.

- Multiple instanced objects used as boolean operand.

With all this things combined boolean modifier was accessing operand's derived
mesh which was referencing data from Mesh datablock. The issue is that those
references are becoming invalid after EDBM_mesh_load().

This function already had code to make sure object itself does not end up with
dangling pointers from derived mesh. Make it now so no possible instanced objects
are left with dangling pointers.

And who said it's a good idea to reference something from derived mesh..

5 years agoUI: take zoom into account w/ curves widget
Alexander Gavrilov [Fri, 1 Jul 2016 12:11:43 +0000 (22:11 +1000)]
UI: take zoom into account w/ curves widget

The Curves widget has buttons to zoom in on the curve. However the
click detection code doesn't take it into account, and at full zoom
in click on curve is detected very far from the actual visible curve.

Change it to compare the position to the actual line segments
in the UI coordinate space, i.e. with curve zoom applied.

5 years agoAdd wait cursor toggling dyntopo
Campbell Barton [Fri, 1 Jul 2016 11:50:53 +0000 (21:50 +1000)]
Add wait cursor toggling dyntopo

5 years agoUI: move dyntopo button to header
Campbell Barton [Fri, 1 Jul 2016 11:40:59 +0000 (21:40 +1000)]
UI: move dyntopo button to header

This looks a bit odd, but being able to see if dyntopo is enabled
when the panel is collapsed is handy.

5 years agoSculpt: skip normal calculation entering dyntopo
Campbell Barton [Fri, 1 Jul 2016 11:13:12 +0000 (21:13 +1000)]
Sculpt: skip normal calculation entering dyntopo

When no triangulation runs we can skip re-calculating normals.

5 years agoBGE: Display Hardware infos only in standalone.
Ulysse Martin [Fri, 1 Jul 2016 11:53:09 +0000 (11:53 +0000)]
BGE: Display Hardware infos only in standalone.

This patch moves the PrintHardwareInfo() function in standalone only, not in embedded. Why? Because you can need this infos for debugging
purpose in "compiled" blender files but it was boring to have it displayed each time you launched embedded. So you can have this infos when you
click standalone or when you run your executable app from a console.

Reviewers: moguri, kupoman, panzergame.

5 years agoEnable dyntopo re-entering sculpt mode
Campbell Barton [Fri, 1 Jul 2016 09:47:00 +0000 (19:47 +1000)]
Enable dyntopo re-entering sculpt mode

5 years agoBMesh: make toolflags optional
Campbell Barton [Fri, 1 Jul 2016 09:07:11 +0000 (19:07 +1000)]
BMesh: make toolflags optional

Saves 8 bytes per vert/edge/face.
Gives overall ~20-25% memory saving for dyntopo sculpting
and modifiers that use BMesh.

5 years agoFix T48757: Broken in D1120 normal baking
Alexander Romanov [Thu, 30 Jun 2016 09:40:10 +0000 (12:40 +0300)]
Fix T48757: Broken in D1120 normal baking

5 years agoFix T48728, part 2: Vertex colors not shown in texture mode
Sergey Sharybin [Thu, 30 Jun 2016 09:20:20 +0000 (14:20 +0500)]
Fix T48728, part 2: Vertex colors not shown in texture mode

5 years agoTransform Snap: Optimize edge-snap using BVH tree
Germano Cavalcante [Thu, 30 Jun 2016 05:43:47 +0000 (15:43 +1000)]
Transform Snap: Optimize edge-snap using BVH tree

changes in BLI_kdopbvh:

- `BLI_bvhtree_find_nearest_to_ray` now takes is_ray_normalized and scale argument.
- `BLI_bvhtree_find_nearest_to_ray_angle` has been added (use for perspective view).

changes in BLI_bvhutils:

- `bvhtree_from_editmesh_edges_ex` was added.

changes in math_geom:

- `dist_squared_ray_to_seg_v3` was added.

other changes:

- `do_ray_start_correction` is no longer necessary to snap to verts.
- the way in which the test of depth was done before is being simulated in callbacks.

5 years agoCMake: list buildinfo.h as buildinfo.cmake's output
Campbell Barton [Wed, 29 Jun 2016 22:49:50 +0000 (08:49 +1000)]
CMake: list buildinfo.h as buildinfo.cmake's output

Keep the fake header to ensure we always run.

5 years agoCorrect fix for MSVC
Campbell Barton [Wed, 29 Jun 2016 22:10:49 +0000 (08:10 +1000)]
Correct fix for MSVC

5 years agoFix bplayer (c)
Bastien Montagne [Wed, 29 Jun 2016 15:57:41 +0000 (17:57 +0200)]
Fix bplayer (c)

5 years agoCleanup: use const
Campbell Barton [Wed, 29 Jun 2016 13:22:54 +0000 (23:22 +1000)]
Cleanup: use const

5 years agoCleanup: spelling, indentation
Campbell Barton [Wed, 29 Jun 2016 10:37:54 +0000 (20:37 +1000)]
Cleanup: spelling, indentation

5 years agoFix T48695: Slowdown w/ edit-mesh & shrinkwrap
Germano Cavalcante [Wed, 29 Jun 2016 09:31:57 +0000 (19:31 +1000)]
Fix T48695: Slowdown w/ edit-mesh & shrinkwrap

0b5a0d84 caused regression since edit-mesh BVH wasn't cached,
each shrink-wrap modifier created its own BVH.

5 years agoCorrection to previous commit: Only skip colors for texture paint
Sergey Sharybin [Wed, 29 Jun 2016 08:30:58 +0000 (13:30 +0500)]
Correction to previous commit: Only skip colors for texture paint

This way we avoid regression of sculpt mode shading.

Hopefully now it's all fine.

5 years agoCleanup: endian tests
Campbell Barton [Wed, 29 Jun 2016 08:12:59 +0000 (18:12 +1000)]
Cleanup: endian tests

5 years agoFix T48728: Vertex colors not shown in texture mode
Sergey Sharybin [Wed, 29 Jun 2016 08:08:12 +0000 (13:08 +0500)]
Fix T48728: Vertex colors not shown in texture mode

Regression caused by own changes to make texture paint more efficient
from workflow point of view.

Now the idea is to use vertex color outside of paint mode, so we don't
break any compatibility here.

5 years agoCleanup: warning
Campbell Barton [Wed, 29 Jun 2016 07:12:22 +0000 (17:12 +1000)]
Cleanup: warning

5 years agoBMesh Intersect: use flags to keep track of verts
Campbell Barton [Wed, 29 Jun 2016 06:09:58 +0000 (16:09 +1000)]
BMesh Intersect: use flags to keep track of verts

For simple cases bitmasks were OK, but didnt work for vert/edge, vert/edge tests.

Tag verts instead, makes logic easier to follow and gives minor speedup.

5 years agoUI: prevent softrange from becoming nan
Campbell Barton [Wed, 29 Jun 2016 02:00:17 +0000 (12:00 +1000)]
UI: prevent softrange from becoming nan

Quiets assert

5 years agoFix T48755: Crash UV unwrapping
Campbell Barton [Wed, 29 Jun 2016 01:48:50 +0000 (11:48 +1000)]
Fix T48755: Crash UV unwrapping

5 years agoUsual i18n/UI messages cleanup & fixes.
Bastien Montagne [Tue, 28 Jun 2016 19:34:18 +0000 (21:34 +0200)]
Usual i18n/UI messages cleanup & fixes.

5 years ago[msvc2015/OpenEXR] Linker hackery is no longer required in vc2015
Martijn Berger [Tue, 28 Jun 2016 14:02:12 +0000 (16:02 +0200)]
[msvc2015/OpenEXR] Linker hackery is no longer required in vc2015

Reviewers: juicyfruit

Reviewed By: juicyfruit

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

5 years agoFix T48732: New GGX breaks OpenCL kernel
Sergey Sharybin [Tue, 28 Jun 2016 12:11:17 +0000 (17:11 +0500)]
Fix T48732: New GGX breaks OpenCL kernel

Make sure we don't perform any implicit address space conversion.

A bit annoying, but less intrusive approaches (like using temp private
variable in .cl kernel) do not work correct here.

Using generic address space will help from code side here, but will
be somewhat slower due to extra things happening as far as i know.

5 years agoCleanup: use bool for writefile
Campbell Barton [Tue, 28 Jun 2016 11:00:00 +0000 (21:00 +1000)]
Cleanup: use bool for writefile

5 years agowritefile: replace most struct lookups /w constants
Campbell Barton [Tue, 28 Jun 2016 10:05:42 +0000 (20:05 +1000)]
writefile: replace most struct lookups /w constants

Removes many hash lookups per file-save and undo-step.

5 years agoCleanup: code-style
Campbell Barton [Tue, 28 Jun 2016 07:35:35 +0000 (17:35 +1000)]
Cleanup: code-style

Other changes here planned which touch many lines, so run cleanup first.

5 years agoFix T48753: VSE must restart for international fonts
Campbell Barton [Tue, 28 Jun 2016 06:18:17 +0000 (16:18 +1000)]
Fix T48753: VSE must restart for international fonts

5 years agoGHOST/X11: Hotplug support for xinput
Campbell Barton [Tue, 28 Jun 2016 03:34:53 +0000 (13:34 +1000)]
GHOST/X11: Hotplug support for xinput

Allows to plug/unplug different tablets while Blender is running.

Also fixes crash unplugging tablet while Blender runs (T48750).

5 years agoRNA: resolve assert w/ no languages available
Campbell Barton [Tue, 28 Jun 2016 02:36:21 +0000 (12:36 +1000)]
RNA: resolve assert w/ no languages available

5 years agoRNA: perform reverse search on operators
Campbell Barton [Tue, 28 Jun 2016 02:11:34 +0000 (12:11 +1000)]
RNA: perform reverse search on operators

In most the last added operator is being handles.

5 years agoCleanup: Python imports
Campbell Barton [Tue, 28 Jun 2016 01:58:38 +0000 (11:58 +1000)]
Cleanup: Python imports

5 years agoFix MSVC error, co_return now a reserved word
Campbell Barton [Mon, 27 Jun 2016 22:31:52 +0000 (08:31 +1000)]
Fix MSVC error, co_return now a reserved word

D2073 by @LazyDodo

5 years agoFix (unreported) wrong ID type check in Text editor's ID remap callback.
Bastien Montagne [Mon, 27 Jun 2016 15:40:08 +0000 (17:40 +0200)]
Fix (unreported) wrong ID type check in Text editor's ID remap callback.

5 years agoBendy Bones Instability Fix - Second Attempt
Joshua Leung [Mon, 27 Jun 2016 14:52:20 +0000 (02:52 +1200)]
Bendy Bones Instability Fix - Second Attempt

So the error seems to be in cubic_tangent_factor_circle_v3(),
which was introduced with D2001.

I've tweaked the most obvious culprit here - the epsilon factor.
It used to be 10^-7, but I've reduced it down to 10^-5 now,
and it's looking a lot more stable now :)

---------

BTW, about the derivation of the magic 0.390464 factor I briefly subbed back
as a workaround for this bug, see:
    http://www.whizkidtech.redprince.net/bezier/circle/

5 years agoBendy Bones: Temporary workaround for instability caused by D2001 when using custom...
Joshua Leung [Mon, 27 Jun 2016 14:20:25 +0000 (02:20 +1200)]
Bendy Bones: Temporary workaround for instability caused by D2001 when using custom handle bones

It's probably some numeric precision issue, but until we figure out exactly what's
going wrong here, let's just revert back to the hardcoded value that was used here
successfully for years without issues.

5 years agoFix T48740: User could remap indirect libdata usages from outliner.
Bastien Montagne [Mon, 27 Jun 2016 13:43:04 +0000 (15:43 +0200)]
Fix T48740: User could remap indirect libdata usages from outliner.

Remapping indirect usage of IDs is forbidden from user space, this is calling for
nice nightmare with libraries handling (and undo crash, among other things).

Not sure why I was 'laxist' about indirect usage cases detection like that,
for now just consider any ID used by another linked datablock as indirect usage case!

Also, added some error/warning reports to Outliner's remap code.

5 years agoFCurve Auto Colours: "XYZ to RGB" works for Quaternions too now
Joshua Leung [Mon, 27 Jun 2016 12:25:48 +0000 (00:25 +1200)]
FCurve Auto Colours: "XYZ to RGB" works for Quaternions too now

The "W" channel will get a yellowish colour (i.e. a blend between the X/R and
Y/G axis colours), while the XYZ will behave as they do for other transforms.

5 years agoPartial fix for T48734
Joshua Leung [Mon, 27 Jun 2016 07:01:25 +0000 (19:01 +1200)]
Partial fix for T48734

The create drivers operator should not use the "Transform Channel" variable type
when driving one transform with another on the same object/bone. Otherwise, you
end up with a situation which technically results in a bit of a pseudo-dependency
cycle.

5 years agoCode Cleanup: Use bools not shorts
Joshua Leung [Mon, 27 Jun 2016 03:47:44 +0000 (15:47 +1200)]
Code Cleanup: Use bools not shorts

5 years agoCtrl-Shift-C: Made it easier to add constraints between bones in different armatures
Joshua Leung [Mon, 27 Jun 2016 03:42:06 +0000 (15:42 +1200)]
Ctrl-Shift-C: Made it easier to add constraints between bones in different armatures

The Ctrl-Shift-C operator to add constraints between a pair of selected items,
for example, between two objects, or between two bones (in the same armature).

This commit makes it possible to use this operator to add a constraint where the
target is a bone from another object - e.g. to make a deform bone follow the control
bone in another armature, or to make an object use a bone as a tracking target.

Usage:
1) Ensure you are in Pose Mode, then select the bone to use as the target
2) Shift-Select the other object and/or the bone that's going to get the constraint
3) Ctrl-Shift-C

5 years agoFix (unreported) potential buffer overflow with BLO_library_path_explode() usage.
Bastien Montagne [Mon, 27 Jun 2016 10:38:12 +0000 (12:38 +0200)]
Fix (unreported) potential buffer overflow with BLO_library_path_explode() usage.

Also added warning to func doc, let's try to avoid this in future (for until we
pass string length systematically...).

5 years agoFix T48741: File browser back button doesn't work from inside Blend (library) file.
Bastien Montagne [Mon, 27 Jun 2016 08:54:17 +0000 (10:54 +0200)]
Fix T48741: File browser back button doesn't work from inside Blend (library) file.

Problem was in fact slightly wider, File space was nearly not taking into account
library navigation case and its 'virtual' directoris, except in a few places.

Add a wrapper around BLI_is_dir that also check for lib paths, and used it in
ED_file_change_dir(), such that we now always check path is a
valid directory - in the filebrowser context, not filesytem context. ;)

5 years agoCycles: Fix corner case of human readable number returning empty string
Sergey Sharybin [Mon, 27 Jun 2016 08:49:25 +0000 (13:49 +0500)]
Cycles: Fix corner case of human readable number returning empty string

5 years agoFix T48717: Modal operators called from Py omit reports from the UI
Campbell Barton [Mon, 27 Jun 2016 07:09:52 +0000 (17:09 +1000)]
Fix T48717: Modal operators called from Py omit reports from the UI

5 years agoRename script stub
Campbell Barton [Mon, 27 Jun 2016 06:04:59 +0000 (16:04 +1000)]
Rename script stub

Was clear from name this is to run external scripts.

5 years agoFix T48733: World background fails in 3d-view
Campbell Barton [Mon, 27 Jun 2016 05:32:52 +0000 (15:32 +1000)]
Fix T48733: World background fails in 3d-view

Missing from fix for T48555.
Unfortunately duplicates code.

5 years agoFix T48743: Broken menu key accelerators
Campbell Barton [Mon, 27 Jun 2016 04:08:36 +0000 (14:08 +1000)]
Fix T48743: Broken menu key accelerators

Regression caused by fc96110b

5 years agoCleanup: unnecessary NULL check
Campbell Barton [Mon, 27 Jun 2016 02:54:56 +0000 (12:54 +1000)]
Cleanup: unnecessary NULL check

5 years agoDocs: arg names
Campbell Barton [Mon, 27 Jun 2016 03:20:56 +0000 (13:20 +1000)]
Docs: arg names

5 years agoDocs: minor edits to writefile comments
Campbell Barton [Mon, 27 Jun 2016 01:21:03 +0000 (11:21 +1000)]
Docs: minor edits to writefile comments

5 years agoFix T48732 v2: New GGX breaks OpenCL kernel
Lukas Stockner [Sat, 25 Jun 2016 22:46:27 +0000 (00:46 +0200)]
Fix T48732 v2: New GGX breaks OpenCL kernel

As far as I can see, the second issue there was that the functions receive a pointer to a member variable of the
ShaderData, which is stored in global memory. However, this means that the pointer points to global memory as well,
therefore OpenCL requires the ccl_addr_space "keyword" in front of the pointer.
With this commit, the OpenCL kernels build on Linux with the Intel CPU OpenCL runtime - however, they already did
without the change and I don't have an AMD card, so I can't really test whether the AMD runtime is happy as well now.

5 years agoCleanup: Get rid of remaining 'BKE_<id>_unlink()' functions, no more used anyway.
Bastien Montagne [Sat, 25 Jun 2016 16:35:54 +0000 (18:35 +0200)]
Cleanup: Get rid of remaining 'BKE_<id>_unlink()' functions, no more used anyway.

5 years agoCleanup: get rid of BKE_text_unlink(), replace by usage of generic BKE_libblock_...
Bastien Montagne [Sat, 25 Jun 2016 16:12:23 +0000 (18:12 +0200)]
Cleanup: get rid of BKE_text_unlink(), replace by usage of generic BKE_libblock_... API.

5 years agoCleanup: remove RNA's `ID.destroy()` function.
Bastien Montagne [Sat, 25 Jun 2016 15:09:26 +0000 (17:09 +0200)]
Cleanup: remove RNA's `ID.destroy()` function.

We already have Main's ID lists' `remove()` function, better not do the same thing
in two different places!

5 years agoCleanup/refactor RNA IDs' `remove` functions.
Bastien Montagne [Sat, 25 Jun 2016 15:01:36 +0000 (17:01 +0200)]
Cleanup/refactor RNA IDs' `remove` functions.

Those (one per ID type!) were uselessly duplicated, and badly inconsistent
(some types were actually unlinking before deletion, others were only working if already unlinked!).

Now we use same func and same API for all types, by default deletion is performed only if ID is no more used,
set `do_unlink` parameter to True to always delete ID even if still in use.
Only exception now is with Scene, since we always want to keep at least one!

Note that this will change default behavior of some types (since unlinking is never done anymore by default).

5 years agoCMake: exclude gitignore & arcconfig for addons
Campbell Barton [Sat, 25 Jun 2016 11:57:54 +0000 (21:57 +1000)]
CMake: exclude gitignore & arcconfig for addons

These files were included in releases

5 years agoCleanup: remove bad-level call
Campbell Barton [Sat, 25 Jun 2016 11:10:30 +0000 (21:10 +1000)]
Cleanup: remove bad-level call

5 years agoGPU: move select index code out of WM
Campbell Barton [Sat, 25 Jun 2016 10:16:33 +0000 (20:16 +1000)]
GPU: move select index code out of WM

This avoids bad-level calls.

5 years agoExclude obsolete static pythonlibs from install
Jens Verwiebe [Sat, 25 Jun 2016 10:39:47 +0000 (12:39 +0200)]
Exclude obsolete static pythonlibs from install

5 years agoFix T48732, OpenCL compile failure after Multiscatter GGX commit.
Thomas Dinges [Sat, 25 Jun 2016 09:14:06 +0000 (11:14 +0200)]
Fix T48732, OpenCL compile failure after Multiscatter GGX commit.

Use OpenCL "all" builtin type for conversion, according to OpenCL 1.1 spec 6.3e.

5 years agoFix T48723: Curve bevel creates invalid geometry
Campbell Barton [Sat, 25 Jun 2016 03:57:35 +0000 (13:57 +1000)]
Fix T48723: Curve bevel creates invalid geometry

5 years agoCleanup: use BLI_bitmap for bevel-split
Campbell Barton [Sat, 25 Jun 2016 01:24:25 +0000 (11:24 +1000)]
Cleanup: use BLI_bitmap for bevel-split

5 years agoFix T48725: UI message typo.
Bastien Montagne [Fri, 24 Jun 2016 09:00:19 +0000 (11:00 +0200)]
Fix T48725: UI message typo.

5 years agoBMesh: avoid redundant calculations comparing angles
Campbell Barton [Fri, 24 Jun 2016 08:59:02 +0000 (18:59 +1000)]
BMesh: avoid redundant calculations comparing angles

5 years agoFix T48716: Knife cut creates inverted normals
Campbell Barton [Fri, 24 Jun 2016 08:58:42 +0000 (18:58 +1000)]
Fix T48716: Knife cut creates inverted normals

In the case of having 3+ boundary edges, we need to find the best.

5 years agoAvoid memory leaks on exit during argument parsing
Campbell Barton [Fri, 24 Jun 2016 00:05:23 +0000 (10:05 +1000)]
Avoid memory leaks on exit during argument parsing

Exiting Blender during argument parsing would leak memory
(tests, documentation generation, utilities).

While harmless, it hides real leaks which should be resolved.

5 years agoBKE_blender: Add own atexit functions
Campbell Barton [Fri, 24 Jun 2016 00:05:18 +0000 (10:05 +1000)]
BKE_blender: Add own atexit functions

Runs before guarded-alloc leaks print.

5 years agoCleanup: use return argument prefix
Campbell Barton [Fri, 24 Jun 2016 00:05:09 +0000 (10:05 +1000)]
Cleanup: use return argument prefix

5 years agoCycles: Add multi-scattering, energy-conserving GGX as an option to the Glossy, Aniso...
Lukas Stockner [Thu, 23 Jun 2016 20:56:43 +0000 (22:56 +0200)]
Cycles: Add multi-scattering, energy-conserving GGX as an option to the Glossy, Anisotropic and Glass BSDFs

This commit adds a new distribution to the Glossy, Anisotropic and Glass BSDFs that implements the
multiple-scattering microfacet model described in the paper "Multiple-Scattering Microfacet BSDFs with the Smith Model".

Essentially, the improvement is that unlike classical GGX, which only models single scattering and assumes
the contribution of multiple bounces to be zero, this new model performs a random walk on the microsurface until
the ray leaves it again, which ensures perfect energy conservation.

In practise, this means that the "darkening problem" - GGX materials becoming darker with increasing
roughness - is solved in a physically correct and efficient way.

The downside of this model is that it has no (known) analytic expression for evalation. However, it can be
evaluated stochastically, and although the correct PDF isn't known either, the properties of MIS and the
balance heuristic guarantee an unbiased result at the cost of slightly higher noise.

Reviewers: dingto, #cycles, brecht

Reviewed By: dingto, #cycles, brecht

Subscribers: bliblubli, ace_dragon, gregzaal, brecht, harvester, dingto, marcog, swerner, jtheninja, Blendify, nutel

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

5 years agoGPencil: Eraser respects "Selection Mask" when in EditMode
Joshua Leung [Thu, 23 Jun 2016 15:33:31 +0000 (03:33 +1200)]
GPencil: Eraser respects "Selection Mask" when in EditMode

5 years agoFix minor typo - Was m[3][4] instead of m[4][4] for a 4x4 matrix
Joshua Leung [Thu, 23 Jun 2016 15:15:55 +0000 (03:15 +1200)]
Fix minor typo - Was m[3][4] instead of m[4][4] for a 4x4 matrix

5 years agoChildOf Constraint: Hide the Loc/Rot/Scale toggles
Joshua Leung [Thu, 23 Jun 2016 15:07:45 +0000 (03:07 +1200)]
ChildOf Constraint: Hide the Loc/Rot/Scale toggles

The RNA properties are still there (in case you really need them), except now
they will not be shown in the UI anymore, as this constraint really didn't
work well/at all when any of those was disabled. Most people shouldn't really
need to worry about this change.

If anyone wants a matrix-math challenge, they're welcome to try getting those
working for real, so that we can show these toggles again.

5 years agoDopeSheet Mask Mode: Circle/Lasso support
Joshua Leung [Thu, 23 Jun 2016 14:57:03 +0000 (02:57 +1200)]
DopeSheet Mask Mode: Circle/Lasso support

Adapted from the code for Grease Pencil (just like the whole mode was)

5 years agoDopeSheet: GPencil-Mode supports Circle and Lasso Select
Joshua Leung [Thu, 23 Jun 2016 14:52:13 +0000 (02:52 +1200)]
DopeSheet: GPencil-Mode supports Circle and Lasso Select

To get this working the least effort, I've had to expose the helper functions
used by the lasso and circle select keyframe-test callbacks (which are generic)
and expose them for use by the GP keyframe editing code too. Hopefully in time
we clean this all up and just write the code once to operate on "keyframes"

5 years agoDopesheet: Lasso and Circle Select tools work for selecting keyframes
Joshua Leung [Thu, 23 Jun 2016 11:16:14 +0000 (23:16 +1200)]
Dopesheet: Lasso and Circle Select tools work for selecting keyframes

This only works in the Action and Dopesheet modes (which operate on FCurve keyframes).
Support for Grease Pencil and Mask Keyframes though is still pending.

5 years agoCode Cleanup - Circle/Lasso select in the Graph Editor
Joshua Leung [Thu, 23 Jun 2016 07:36:24 +0000 (19:36 +1200)]
Code Cleanup - Circle/Lasso select in the Graph Editor

5 years agoGPencil UI: Streamline toolbar options a bit
Joshua Leung [Sat, 18 Jun 2016 04:52:21 +0000 (16:52 +1200)]
GPencil UI: Streamline toolbar options a bit

As suggested by mendiobox:

* Don't show "enable editing" in the 3D view. You can already do this by switching
  into stroke editing mode here, so no need for the duplication. (In other editors
  though, this can't be done yet, so we don't do it)

* Make the "Convert" button into a dropdown so that you don't need to deal with a
  a separate popup menu

* In the 3D view, don't show the selection + transform operators that can be easily
  found in the menus too (as well as having commonly used shortcuts)

5 years agoGPencil: Added a new version of the "delete active frame" operator which deletes...
Joshua Leung [Sat, 18 Jun 2016 00:58:26 +0000 (12:58 +1200)]
GPencil: Added a new version of the "delete active frame" operator which deletes on all editable layers

This new operator will delete any GP frame it finds on the current frame, regardless
of whether it's on the active layer or not. It will only remove the frames if the
layer is editable, but otherwise, it will just go for it.

The existing operator is great for use in the panel (where it only applies to the active
frame), but it was not so good for all the other places where tools can be invoked
(e.g. D-X, or Delete) as you're typically thinking about the whole scene more holisticaly
than just caring about a particular layer.