blender.git
2 years agoFix typo in new ID copying code.
Bastien Montagne [Wed, 9 Aug 2017 12:38:07 +0000 (14:38 +0200)]
Fix typo in new ID copying code.

2 years agoCycles: Remove ulong usage
Sergey Sharybin [Wed, 9 Aug 2017 11:44:21 +0000 (13:44 +0200)]
Cycles: Remove ulong usage

This is a bit confusing, especially when one mixes OpenCL code where ulong equals
to uint64_t with CPU side code where ulong is expected to be something else from
the naming.

This commit makes it so we use explicit name, common on all platforms.

2 years agoFix T52240: Alembic Not Transferring Materials Per Frame
Sybren A. Stüvel [Wed, 9 Aug 2017 11:05:22 +0000 (13:05 +0200)]
Fix T52240: Alembic Not Transferring Materials Per Frame

When a mesh changes its number of vertices during the animation,
Blender rebuilds the DerivedMesh, after which the materials weren't
applied any more (causing the default to the first material slot).

2 years agoAlembic: Renamed variable assigned_name → assigned_mat
Sybren A. Stüvel [Wed, 9 Aug 2017 09:44:22 +0000 (11:44 +0200)]
Alembic: Renamed variable assigned_name → assigned_mat

The variable is a pointer to a Material, not to a name/string.

2 years agoTypo fix
Sybren A. Stüvel [Wed, 9 Aug 2017 09:51:21 +0000 (11:51 +0200)]
Typo fix

2 years agoFixed Alembic unit test
Sybren A. Stüvel [Wed, 9 Aug 2017 11:59:27 +0000 (13:59 +0200)]
Fixed Alembic unit test

Commit b6d7cdd3cee9312156e20783248a3b12420b7a53 changed how the mesh data
is deformed, which wasn't taken into account yet in this unit test.

Instead of directly reading the mesh vertices (which aren't animated any
more), we convert the modified mesh to a new one, and inspect those
vertices instead.

2 years agoFix T52315: Crash on duplicating Scene without world.
Bastien Montagne [Wed, 9 Aug 2017 08:43:04 +0000 (10:43 +0200)]
Fix T52315: Crash on duplicating Scene without world.

Regression from rBa7b3047cefcbf, to be backported to 2.79.

Like... seriously... :|

2 years agoCycles: Proper fix for recent OpenCL image crash
Mai Lavelle [Wed, 9 Aug 2017 08:24:26 +0000 (04:24 -0400)]
Cycles: Proper fix for recent OpenCL image crash

Problem was that some code checks to see if device_pointer is null or
not and the new allocator wasn't even setting the pointer to anything
as it tracks memory location separately. Setting the pointer to non
null keeps all users of device_pointer happy.

2 years agoRevert "Cycles: Fix crash changing image after recent OpenCL changes"
Mai Lavelle [Wed, 9 Aug 2017 08:24:03 +0000 (04:24 -0400)]
Revert "Cycles: Fix crash changing image after recent OpenCL changes"

This reverts commit f2809ae0a671057caa1005e2b9cc91648c33dd1f.

2 years agoModules test: Don't print backtrace for files which are ignored
Sergey Sharybin [Wed, 9 Aug 2017 07:42:03 +0000 (09:42 +0200)]
Modules test: Don't print backtrace for files which are ignored

This could make output really polluted, where it'll be hard to see actual
issues.

It is still possible to have all backtraces printed using BLENDER_VERBOSE
environment variable.

2 years agoFix T52280: The Image node in Compositing can't read Z buffer of openEXR in 2.79
Lukas Stockner [Tue, 8 Aug 2017 21:00:02 +0000 (23:00 +0200)]
Fix T52280: The Image node in Compositing can't read Z buffer of openEXR in 2.79

As part of the fix for T51587, I removed the Depth output for non-Multilayer
images since it seemed weird that PNGs etc. that don't have a Z pass still get
a socket for it.
However, I forgot about non-multilayer EXRs, which are a special case that can
actually have a Z pass.

Therefore, this commit brings back the Depth output for non-multilayer images
just like it was in 2.78.

2 years agoCycles: More fixes for Windows 32 bit
Sergey Sharybin [Tue, 8 Aug 2017 20:32:51 +0000 (22:32 +0200)]
Cycles: More fixes for Windows 32 bit

- Apparently MSVC does not support compound literals
  in C++ (at least by the looks of it).

- Not sure how opencl_device_assert was managing to
  set protected property of the Device class.

2 years agoCycles: Fix compilation error of filter kernels on 32 bit Windows
Sergey Sharybin [Tue, 8 Aug 2017 19:56:32 +0000 (21:56 +0200)]
Cycles: Fix compilation error of filter kernels on 32 bit Windows

We don't enable global SSE optimizations in regular kernel, and we
keep those disabled on Linux 32bit.

One possible workaround would be to pass arguments by ccl_ref, but
that is quite a few of code which better be done accurately.

2 years agoFix T51701: Alembic cache screws up mesh.
Bastien Montagne [Tue, 8 Aug 2017 16:21:08 +0000 (18:21 +0200)]
Fix T51701: Alembic cache screws up mesh.

Use same trick as in DataTransfer modifier e.g. to avoid modifying
existing mesh's data.

2 years agoCycles: Fix crash changing image after recent OpenCL changes
Sergey Sharybin [Tue, 8 Aug 2017 15:17:04 +0000 (17:17 +0200)]
Cycles: Fix crash changing image after recent OpenCL changes

Steps to reproduce:
- Create shader Image texture -> Diffuse BSDF -> Output. Do NOT select image yet!
- Start viewport render.
- Select image from the ID browser of Image Texture node.

Thing is: with the memory manager we always need to inform device that memory
was freed.

2 years agoCycles: Fix compilation error without C++11
Sergey Sharybin [Tue, 8 Aug 2017 15:02:08 +0000 (17:02 +0200)]
Cycles: Fix compilation error without C++11

Common folks, nobody considered master a C++11 only branch. Such decision is to
be done officially and will involve changes in quite a few infrastructure related
areas.

2 years agoFix fixed width box layouts
Aleksandr Zinovev [Tue, 8 Aug 2017 14:37:21 +0000 (17:37 +0300)]
Fix fixed width box layouts

Regression, to be backported in 2.79.

2 years agoCleanup: mostly namings in `make_object_duplilist_real` code.
Bastien Montagne [Tue, 8 Aug 2017 14:08:24 +0000 (16:08 +0200)]
Cleanup: mostly namings in `make_object_duplilist_real` code.

2 years agoFix T52260: Blender 2.79 Objects made duplicates real still refer armature proxy.
Bastien Montagne [Tue, 8 Aug 2017 14:01:48 +0000 (16:01 +0200)]
Fix T52260: Blender 2.79 Objects made duplicates real still refer armature proxy.

New code was handling correctly ID's internal references to self, but
not references between 'made real' different objects...

Regression, to be backported in 2.79.

2 years agoFix T52255: New Depsgraph - Constraint and Drivers not working together when the...
Sergey Sharybin [Tue, 8 Aug 2017 13:27:11 +0000 (15:27 +0200)]
Fix T52255: New Depsgraph - Constraint and Drivers not working together when the driver references itself

2 years agoDepsgraph: Cleanup, make it easier to debug on laptop
Sergey Sharybin [Tue, 8 Aug 2017 13:24:35 +0000 (15:24 +0200)]
Depsgraph: Cleanup, make it easier to debug on laptop

2 years agoCycles: Cleanup, de-duplicate function parameter list
Sergey Sharybin [Tue, 8 Aug 2017 12:39:00 +0000 (14:39 +0200)]
Cycles: Cleanup, de-duplicate function parameter list

Was only needed to sue const reference on CPU. Now it is done using ccl_ref.

2 years agoCycles: Add utility macro ccl_ref
Sergey Sharybin [Tue, 8 Aug 2017 12:34:59 +0000 (14:34 +0200)]
Cycles: Add utility macro ccl_ref

It is defined to & for CPU side compilation, and defined to an empty for any GPU
platform. The idea here is to use this macro instead of #ifdef block with bunch
of duplicated lines just to make it so CPU code is efficient.

Eventually we might switch to references on CUDA as well, but that would require
some intensive testing.

2 years agoFix T46329: scene_update_{pre,post} doc needs clarification
Sybren A. Stüvel [Tue, 8 Aug 2017 13:13:54 +0000 (15:13 +0200)]
Fix T46329: scene_update_{pre,post} doc needs clarification

The documentation for the bpy.app.handlers.scene_update_{pre,post}
handlers states that they're called "on updating the scenes data".
However, they're called even when the data hasn't changed. Of course
such handlers are useful, but the documentation should reflect the
current behaviour.

Reviewers: mont29, sergey

Subscribers: Blendify

Maniphest Tasks: T46329

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

2 years agoFix width estimation for empty layouts in pie menus
Aleksandr Zinovev [Tue, 8 Aug 2017 12:52:14 +0000 (15:52 +0300)]
Fix width estimation for empty layouts in pie menus

2 years agoUpdate CUEW to latest version
Sergey Sharybin [Tue, 8 Aug 2017 12:26:46 +0000 (14:26 +0200)]
Update CUEW to latest version

Previous update pulled too much of system-wide typedefs.

2 years agoFix T52263: Crash When Splitting and Merging Areas with Header Text Set.
Bastien Montagne [Tue, 8 Aug 2017 12:06:56 +0000 (14:06 +0200)]
Fix T52263: Crash When Splitting and Merging Areas with Header Text Set.

Not a regression, but safe enough to be included in 2.79.

2 years agoUpdate CUDA wrangler to latest version
Sergey Sharybin [Tue, 8 Aug 2017 11:58:07 +0000 (13:58 +0200)]
Update CUDA wrangler to latest version

Brings new declarations from toolkit version 8.0, also fixes some
pointers used in function declarations.

2 years agoCycles: Pack kernel textures into buffers for OpenCL
Mai Lavelle [Tue, 8 Aug 2017 11:12:04 +0000 (07:12 -0400)]
Cycles: Pack kernel textures into buffers for OpenCL

Image textures were being packed into a single buffer for OpenCL, which
limited the amount of memory available for images to the size of one
buffer (usually 4gb on AMD hardware). By packing textures into multiple
buffers that limit is removed, while simultaneously reducing the number
of buffers that need to be passed to each kernel.

Benchmarks were within 2%.

Fixes T51554.

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

2 years agoFix compilation error when building without Blender
Sergey Sharybin [Tue, 8 Aug 2017 09:32:33 +0000 (11:32 +0200)]
Fix compilation error when building without Blender

Simply disabled python tests, they can't be run anyway (since blender target is
not enabled) and we don't have any player-related tests in that folder.

2 years agoCleanup: remove incorrect comment
Campbell Barton [Tue, 8 Aug 2017 01:28:47 +0000 (11:28 +1000)]
Cleanup: remove incorrect comment

enum values aren't saved in files.

2 years agoFix CMake dependencies builder issues on Linux with TBB and Python packages.
Brecht Van Lommel [Tue, 8 Aug 2017 00:32:01 +0000 (02:32 +0200)]
Fix CMake dependencies builder issues on Linux with TBB and Python packages.

2 years agoCycles: Cleanup, move curve intersection functions to own file
Sergey Sharybin [Mon, 7 Aug 2017 17:53:12 +0000 (19:53 +0200)]
Cycles: Cleanup, move curve intersection functions to own file

This way curve file becomes much shorter and it's also easier to write a
benchmark application to check performance before/after future changes.

2 years agoCycles: Cleanup, trailign whitespace
Sergey Sharybin [Mon, 7 Aug 2017 17:48:49 +0000 (19:48 +0200)]
Cycles: Cleanup, trailign whitespace

2 years agoCycles: Cleanup, remove bvh prefix from curve functions
Sergey Sharybin [Mon, 7 Aug 2017 17:47:31 +0000 (19:47 +0200)]
Cycles: Cleanup, remove bvh prefix from curve functions

Those are nothing to do with BVH, and can be used separately.

2 years agoCycles: Fix compilation error on NVidia OpenCL after recent refactor
Sergey Sharybin [Mon, 7 Aug 2017 18:52:24 +0000 (20:52 +0200)]
Cycles: Fix compilation error on NVidia OpenCL after recent refactor

Still need to verify this is proper thing to do for AMD OpenCL. At least now
i can compile OpenCL kernel on my laptop with sm21 card.

2 years agoFix compilation error when rigid body is disabled
Sergey Sharybin [Mon, 7 Aug 2017 18:11:19 +0000 (20:11 +0200)]
Fix compilation error when rigid body is disabled

2 years agoBuild: add scripts to build dependencies for Windows and macOS.
Brecht Van Lommel [Tue, 25 Jul 2017 14:37:55 +0000 (16:37 +0200)]
Build: add scripts to build dependencies for Windows and macOS.

Note these are intended for platform maintainers, we do not intend to
support users making their own builds with these. For that precompiled
libraries from lib/ should be used.

Implemented by Martijn Berger, Ray Molenkamp and Brecht Van Lommel.

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

2 years agoFix Cycles shadow catcher objects influencing each other.
Brecht Van Lommel [Tue, 1 Aug 2017 21:40:38 +0000 (23:40 +0200)]
Fix Cycles shadow catcher objects influencing each other.

Since all the shadow catchers are already assumed to be in the footage,
the shadows they cast on each other are already in the footage too. So
don't just let shadow catchers skip self, but all shadow catchers.

Another justification is that it should not matter if the shadow catcher
is modeled as one object or multiple separate objects, the resulting
render should be the same.

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

2 years agoFix Windows build errors with recent Cycles SIMD refactoring.
Brecht Van Lommel [Mon, 7 Aug 2017 13:30:01 +0000 (15:30 +0200)]
Fix Windows build errors with recent Cycles SIMD refactoring.

2 years agoRefactor ID copying (and to some extent, ID freeing).
Bastien Montagne [Mon, 7 Aug 2017 14:39:55 +0000 (16:39 +0200)]
Refactor ID copying (and to some extent, ID freeing).

This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714

2 years agoCycles: Cleanup, space after keyword
Sergey Sharybin [Mon, 7 Aug 2017 12:47:51 +0000 (14:47 +0200)]
Cycles: Cleanup, space after keyword

2 years agoCycles tests: CMake side changes to support recent files split in the SVN repo
Sergey Sharybin [Mon, 7 Aug 2017 12:31:40 +0000 (14:31 +0200)]
Cycles tests: CMake side changes to support recent files split in the SVN repo

2 years agoCycles: add HTML report to inspect failed test images.
Brecht Van Lommel [Thu, 3 Aug 2017 14:41:50 +0000 (16:41 +0200)]
Cycles: add HTML report to inspect failed test images.

Shows new, reference and diff renders, with mouse hover to flip between
new and ref for easy comparison. This generates a report.html in
build_dir/tests/cycles, stored along with the new and diff images.

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

2 years agoCode refactor: use float4 instead of intrinsics for CPU denoise filtering.
Brecht Van Lommel [Tue, 18 Jul 2017 23:54:56 +0000 (01:54 +0200)]
Code refactor: use float4 instead of intrinsics for CPU denoise filtering.

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

2 years agoCode refactor: add, remove, optimize various SSE functions.
Brecht Van Lommel [Wed, 2 Aug 2017 00:23:03 +0000 (02:23 +0200)]
Code refactor: add, remove, optimize various SSE functions.

* Remove some unnecessary SSE emulation defines.
* Use full precision float division so we can enable it.
* Add sqrt(), sqr(), fabs(), shuffle variations, mask().
* Optimize reduce_add(), select().

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

2 years agoCode refactor: split defines into separate header, changes to SSE type headers.
Brecht Van Lommel [Wed, 2 Aug 2017 00:09:08 +0000 (02:09 +0200)]
Code refactor: split defines into separate header, changes to SSE type headers.

I need to use some macros defined in util_simd.h for float3/float4, to emulate
SSE4 instructions on SSE2. But due to issues with order of header includes this
was not possible, this does some refactoring to make it work.

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

2 years agoCycles: remove option to disable transparent shadows globally.
Brecht Van Lommel [Wed, 2 Aug 2017 13:23:50 +0000 (15:23 +0200)]
Cycles: remove option to disable transparent shadows globally.

We already detect this automatically based on shading nodes and per shader
settings, and performance of this option is ok now all devices.

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

2 years agoFix T52278: 'Default' application template fails
Campbell Barton [Mon, 7 Aug 2017 11:17:14 +0000 (21:17 +1000)]
Fix T52278: 'Default' application template fails

Own error in 7398b3b7

2 years agoFix Cycles CUDA adaptive megakernel build error.
Brecht Van Lommel [Sat, 5 Aug 2017 13:46:40 +0000 (15:46 +0200)]
Fix Cycles CUDA adaptive megakernel build error.

2 years agoFix broken API doc generation: Partially revert rBa372638a76e0
Bastien Montagne [Sun, 6 Aug 2017 15:35:41 +0000 (17:35 +0200)]
Fix broken API doc generation: Partially revert rBa372638a76e0

Making those arrays static remove them from exported symbols, which
breaks API doc generation script.

To be backported to 2.79 branch.

2 years agoCycles: CUDA split performance tweaks, still far from megakernel.
Brecht Van Lommel [Sat, 5 Aug 2017 02:06:39 +0000 (04:06 +0200)]
Cycles: CUDA split performance tweaks, still far from megakernel.

On Pabellon, 25.8s mega, 35.4s split before, 32.7s split after.

2 years agoView3D: expose normal from depth publicly
Campbell Barton [Fri, 4 Aug 2017 21:28:15 +0000 (07:28 +1000)]
View3D: expose normal from depth publicly

2 years agoCycles: remove min bounces, modify RR to terminate less.
Brecht Van Lommel [Wed, 2 Aug 2017 20:53:55 +0000 (22:53 +0200)]
Cycles: remove min bounces, modify RR to terminate less.

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

2 years agoTracking: Undefine temporary define
Sergey Sharybin [Fri, 4 Aug 2017 19:12:11 +0000 (21:12 +0200)]
Tracking: Undefine temporary define

Missed this in previous commit.

2 years agoTracking: Remove limit of 50 points of the track history
Sergey Sharybin [Fri, 4 Aug 2017 07:11:26 +0000 (09:11 +0200)]
Tracking: Remove limit of 50 points of the track history

Was quite stupid reason for this: static size of array.

Now we allocate needed amount of points in heap if requested path length is
getting too big.

2 years agoTracking: Cleanup of transform code
Sergey Sharybin [Fri, 4 Aug 2017 06:13:38 +0000 (08:13 +0200)]
Tracking: Cleanup of transform code

2 years agoTracking: Cleanup, use boolean instead of integer
Sergey Sharybin [Fri, 4 Aug 2017 05:21:01 +0000 (07:21 +0200)]
Tracking: Cleanup, use boolean instead of integer

2 years agoCMake: test build configuration support
Campbell Barton [Thu, 3 Aug 2017 22:11:42 +0000 (08:11 +1000)]
CMake: test build configuration support

D2765 by @akitula

2 years agoCycles: Extra tweaks to performance of header expansion
Sergey Sharybin [Thu, 3 Aug 2017 05:53:18 +0000 (07:53 +0200)]
Cycles: Extra tweaks to performance of header expansion

Two main things here:

1. Replace all unsafe for #line directive characters into a single loop,
   avoiding multiple iterations and multiple temporary strings created.

2. Don't merge token char by char but calculate start and end point and
   then copy all substring at once.

This gives about 15% speedup of source processing time. At this point
(with all previous commits from today) we've shrinked down compiled
sources size from 108 MB down to ~5.5 MB and lowered processing time
from 4.5 sec down to 0.047 sec on my laptop running Linux (this was a
constant time which Blender will always spent first time loading kernel,
even if we've got compiled clbin).

2 years agoRemove volatile, causing issues w/ GCC/ubsan
Campbell Barton [Wed, 2 Aug 2017 21:10:20 +0000 (07:10 +1000)]
Remove volatile, causing issues w/ GCC/ubsan

Was Cygwin workaround, no longer needed.

2 years agomikktspace: minor optimization
Campbell Barton [Wed, 2 Aug 2017 21:03:59 +0000 (07:03 +1000)]
mikktspace: minor optimization

Add a safe version of normalize since all uses of normalize
did zero length checks, move this into a function.

Also avoid unnecessary conversion.

Gives minor speedup here (approx 3-5%).

2 years agoCycles: Avoid some expensive operations in header expansions
Sergey Sharybin [Wed, 2 Aug 2017 18:23:14 +0000 (20:23 +0200)]
Cycles: Avoid some expensive operations in header expansions

Basically gather lines as-is during traversal, avoiding allocating
memory for all the lines in headers.

Brings additional performance improvement abut 20%.

2 years agoCycles: Support "precompiled" headers in include expansion algorithm
Sergey Sharybin [Wed, 2 Aug 2017 18:10:36 +0000 (20:10 +0200)]
Cycles: Support "precompiled" headers in include expansion algorithm

The idea here is that it is possible to mark certain include statements
as "precompiled" which means all subsequent includes of that file will
be replaced with an empty string.

This is a way to deal with tricky include pattern happening in single
program OpenCL split kernel which was including bunch of headers about
10 times.

This brings preprocessing time from ~1sec to ~0.1sec on my laptop.

2 years agoCycles: Speed up #include expansion algorithm
Sergey Sharybin [Tue, 1 Aug 2017 18:34:40 +0000 (20:34 +0200)]
Cycles: Speed up #include expansion algorithm

The idea is to re-use files which were already processed. Gives about 4x speedup
of processing time (~4.5sec vs 1.0sec) on my laptop for the whole OpenCL kernel.

For users it will mean lower delay before OpenCL rendering might start.

2 years agoFix T52250: Glitch in UI in the addon panel regression
Aleksandr Zinovev [Wed, 2 Aug 2017 14:41:26 +0000 (17:41 +0300)]
Fix T52250: Glitch in UI in the addon panel regression

2 years ago2.79 release: new splash, yeah!
Bastien Montagne [Tue, 1 Aug 2017 17:23:19 +0000 (19:23 +0200)]
2.79 release: new splash, yeah!

2 years ago2.79 release: update version numbers & readfile versionning code.
Bastien Montagne [Tue, 1 Aug 2017 17:22:31 +0000 (19:22 +0200)]
2.79 release: update version numbers & readfile versionning code.

2 years agoTweak multi-units tests to match new precision handling in conversion from raw value...
Bastien Montagne [Tue, 1 Aug 2017 14:43:40 +0000 (16:43 +0200)]
Tweak multi-units tests to match new precision handling in conversion from raw value to prety-printed one.

Note that new code allows to enable again the '1 million miles' tests.

2 years agoFix multi-units drawing re precision handling.
Bastien Montagne [Tue, 1 Aug 2017 14:35:07 +0000 (16:35 +0200)]
Fix multi-units drawing re precision handling.

This is still far from prefect, but yet much better than what we had so
far (more consistent with inheritent precision available in floats).

Note that this fixes some (currently commented out) units unittests, and
requires adjusting some others, will be done in next commit.

2 years agoBLI_math: add simple helper to get amount of 'integer' digits in a float number.
Bastien Montagne [Tue, 1 Aug 2017 14:34:02 +0000 (16:34 +0200)]
BLI_math: add simple helper to get amount of 'integer' digits in a float number.

2 years agoCleanup: warnings from last commit
Campbell Barton [Tue, 1 Aug 2017 02:31:19 +0000 (12:31 +1000)]
Cleanup: warnings from last commit

2 years agoCleanup: use static vars where appropriate
Campbell Barton [Mon, 31 Jul 2017 23:06:34 +0000 (09:06 +1000)]
Cleanup: use static vars where appropriate

2 years agoFix fcurve color assignment
Campbell Barton [Mon, 31 Jul 2017 22:27:35 +0000 (08:27 +1000)]
Fix fcurve color assignment

2 years agoCorrect accidental variable declaration
Campbell Barton [Mon, 31 Jul 2017 21:55:01 +0000 (07:55 +1000)]
Correct accidental variable declaration

2 years agoFix T52224: auto IK not respecting length, after recent bugfix.
Brecht Van Lommel [Mon, 31 Jul 2017 17:22:03 +0000 (19:22 +0200)]
Fix T52224: auto IK not respecting length, after recent bugfix.

2 years agoCode cleanup: fix warning with clang.
Brecht Van Lommel [Mon, 31 Jul 2017 17:07:29 +0000 (19:07 +0200)]
Code cleanup: fix warning with clang.

2 years agoFix T52232: Crash in RNA_enum_from_value while inspecting compositor image node prope...
Bastien Montagne [Mon, 31 Jul 2017 14:50:36 +0000 (16:50 +0200)]
Fix T52232: Crash in RNA_enum_from_value while inspecting compositor image node properties in outliner.

Bug was in RNA nodes code actually, itemf functions shall never, ever
return NULL!

Note that there were other itemf functions there that were potentially
buggy. Also harmonized a bit their code.

2 years agoFix two issues with recent changes to number display while editing them.
Bastien Montagne [Mon, 31 Jul 2017 13:40:26 +0000 (15:40 +0200)]
Fix two issues with recent changes to number display while editing them.

* Numbers with units (especially, angles) where not handled correctly
regarding number of significant digits (spotted by @brecht in T52222
comment, thanks).
* Zero value has no valid log, need to take that into account!

2 years agoProperty path generation fixes
Aleksandr Zinovev [Sat, 29 Jul 2017 12:23:01 +0000 (15:23 +0300)]
Property path generation fixes

2 years agoCleanup: quiet picky ubsan warnings
Campbell Barton [Fri, 28 Jul 2017 22:42:32 +0000 (08:42 +1000)]
Cleanup: quiet picky ubsan warnings

2 years agoCleanup: multistatement-macros warning
Campbell Barton [Fri, 28 Jul 2017 22:18:20 +0000 (08:18 +1000)]
Cleanup: multistatement-macros warning

2 years agoReplace magic numbers with deprecated names
Campbell Barton [Fri, 28 Jul 2017 20:25:54 +0000 (06:25 +1000)]
Replace magic numbers with deprecated names

The names aren't meaningful but means it wont
accidentally use valid names.

Also remove textured-font setting

2 years agoFix T52195: Sculpt from Python fails
Campbell Barton [Fri, 28 Jul 2017 19:59:17 +0000 (05:59 +1000)]
Fix T52195: Sculpt from Python fails

When calling sculpt from Python,
setting 3D 'location' but not 2D 'mouse' stopped working in 2.78.

Now check if the operator is running non-interactively and
skip the mouse-over check.

2 years agoWM: OP_IS_INVOKE was being incorrectly set
Campbell Barton [Fri, 28 Jul 2017 19:40:33 +0000 (05:40 +1000)]
WM: OP_IS_INVOKE was being incorrectly set

Calling an operator with EXEC_* context would still set the invoke flag.

2 years agoFix T52213: Enum drivers no longer work
Campbell Barton [Fri, 28 Jul 2017 16:39:16 +0000 (02:39 +1000)]
Fix T52213: Enum drivers no longer work

Regression in D1812: PyDriver variables as Objects

Taking the Python representation is nice in general
but for enums it would convert them into strings,
breaking some existing drivers.

2 years agoResolve T45301 by adding option for old behavior
Campbell Barton [Fri, 28 Jul 2017 15:35:07 +0000 (01:35 +1000)]
Resolve T45301 by adding option for old behavior

Some users really liked previous behavior,
so making it an option.

Cursor Lock Adjustment can be disabled to give something close to
2.4x behavior of cursor locking.

When lock-adjustment is disabled placing the cursor the view.
This avoids the issue reported in T40353
where the cursor could get *lost*.

2 years agoCleanup: clear deprecated UI flags
Campbell Barton [Fri, 28 Jul 2017 15:28:58 +0000 (01:28 +1000)]
Cleanup: clear deprecated UI flags

Also adds cursor-lock flag, to be used in next commit.

2 years agoFix T52156: Hair dynamics broken with density texture
Luca Rood [Fri, 28 Jul 2017 13:24:48 +0000 (15:24 +0200)]
Fix T52156: Hair dynamics broken with density texture

Even strands that were excluded by the density texture were being added
to the DM passed to cloth, but these ended up having some invalid data,
because they were not fully constructed.

This simply excludes `UNEXISTED` particles from the DM generation, as
would be expected.

2 years agoFix T52148: Point Density Texture ID User decrement error related to the Object field.
Bastien Montagne [Fri, 28 Jul 2017 10:43:06 +0000 (12:43 +0200)]
Fix T52148: Point Density Texture ID User decrement error related to the Object field.

Note that fix is not perfect, systematically make refcounting of all IDs
assigned to node's id pointer, which breaks the 'do not refcount
scene/object/text datablocks' principle...

But besides that principle being far from ideal in general, it becomes
pretty much impossible to apply when using //generic// ID pointer,
unless we add some kind of type data to that pointer somehow.

So for now, better to live with that, than having broken usercount.

2 years agoFix T52212: Vgroups doesn't work after Carve Boolean
Sergey Sharybin [Fri, 28 Jul 2017 09:55:24 +0000 (11:55 +0200)]
Fix T52212: Vgroups doesn't work after Carve Boolean

2 years agoFix potential 'divide-by-zero' in our UI fitting code.
Bastien Montagne [Fri, 28 Jul 2017 08:56:41 +0000 (10:56 +0200)]
Fix potential 'divide-by-zero' in our UI fitting code.

Reported by coverity, better fix even if highly unlikely to happen...

2 years agoFix T52208: Using UI_BUT_REDALERT flag for UI_BTYPE_KEY_EVENT buttons crashes Blender.
Bastien Montagne [Fri, 28 Jul 2017 08:38:47 +0000 (10:38 +0200)]
Fix T52208: Using UI_BUT_REDALERT flag for UI_BTYPE_KEY_EVENT buttons crashes Blender.

but pointer was not assigned in that case...

2 years agoCleanup: Remove gitignore for api images
Aaron Carlisle [Thu, 27 Jul 2017 20:04:42 +0000 (16:04 -0400)]
Cleanup: Remove gitignore for api images

2 years agoFix UI messages...
Bastien Montagne [Thu, 27 Jul 2017 13:20:44 +0000 (15:20 +0200)]
Fix UI messages...

2 years agoFix factory setup using user scripts path still
Campbell Barton [Thu, 27 Jul 2017 12:22:26 +0000 (22:22 +1000)]
Fix factory setup using user scripts path still

2 years agoFix T51776: Make sure button icons are updated on Ctrl-ScrollWheel
Jeff Knox [Thu, 27 Jul 2017 10:55:17 +0000 (12:55 +0200)]
Fix T51776: Make sure button icons are updated on Ctrl-ScrollWheel

2 years agoFix button text overlapping with shortcut text in popups
Julian Eisel [Thu, 27 Jul 2017 09:49:41 +0000 (11:49 +0200)]
Fix button text overlapping with shortcut text in popups

The purpose of the keymap strings is probably for un-embossed menu items
like seen in most pulldowns. I can't see a reason for also adding that
string for regularly drawn buttons within popups, we don't add it
anywhere else in the UI either. So this commit makes sure shortcut
strings are only added to buttons that are drawn like pulldown-menu
items.

2 years agoMinor code style corrections
Julian Eisel [Thu, 27 Jul 2017 09:44:51 +0000 (11:44 +0200)]
Minor code style corrections

2 years agoFix Label colors in popups
Aleksandr Zinovev [Thu, 27 Jul 2017 07:27:29 +0000 (10:27 +0300)]
Fix Label colors in popups