Commit Graph

10380 Commits

Author SHA1 Message Date
Campbell Barton f051146ae6 Cleanup: clang-format 2021-03-22 14:39:39 +11:00
Campbell Barton dfbaf96753 Revert "Disable clang-format for objective-C bits in GHOST."
This reverts commit 1cb9612d73.

We can now rely on the clang-format version as it's distributed
with pre-compiled binaries.
2021-03-22 14:38:45 +11:00
Campbell Barton e6cf74515f Cleanup: disable clang-format for 'intern/libmv/third_party' headers 2021-03-22 14:35:20 +11:00
Campbell Barton 6db1fb197c Cleanup: spelling, doxygen comment formatting 2021-03-21 13:18:20 +11:00
Harley Acheson b4e96550ce Fix T86643: Win32 Entering Full Screen While Maximized
SetWindowPos must be called after SetWindowLongPtr in order to see changes to window frame style.

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

Reviewed by Ray Molenkamp
2021-03-20 17:24:06 -07:00
Brecht Van Lommel a7f4270748 Fix Cycles NaN assert in random walk SSS due to very small throughput
Now terminate if there are many bounces and the throughput gets so small
that we get precision issues.
2021-03-19 13:20:42 +01:00
Campbell Barton bb6765f28f Cleanup: spelling 2021-03-18 09:36:44 +11:00
Charlie Jolly 266cd7bb82 Nodes: Add support to mute node wires
This patch adds the ability to mute individual wires in the node editor.
This is invoked like the cut links operator but with a new shortcut.

Mute = Ctrl + Alt
Cut = Ctrl

Dragging over wires will toggle the mute state for that wire.
The muted wires are drawn in red with a bar across the center.
Red is used in the nodes context to indicate invalid links, muted links and internal links.

When a wire is muted it exposes the original node buttons which are normally hidden when a wire is connected.

Downstream and upstream links connected using reroute nodes are also muted.

Outside scope of patch:
- Add support for pynodes e.g. Animation Nodes
- Requires minor change to check for muted links using the `is_muted` link property or the `is_linked` socket property.

Maniphest Tasks: T52659

Differential Revision: https://developer.blender.org/D2807
2021-03-17 11:54:16 +00:00
Campbell Barton 81178eca7c Revert removal of lambda usage for Python RNA callbacks
This reverts commits
- 476be3746e
- 8d50a3e19e
- 08dbc4f996 (partially).
2021-03-16 15:18:02 +11:00
Brecht Van Lommel be51d671b5 Fix T86121: Cycles Attribute returning wrong results with OSL
Fix uninitialized variable in the OSL shader.
2021-03-15 20:47:07 +01:00
Brecht Van Lommel 8f93386e62 Fix (apparently harmless) Cycles asan warnings 2021-03-15 20:46:57 +01:00
Mikhail 21bc1a99ba Cycles: optimize ensure_valid_reflection(), reduces render time by about 1%
This is an implementation that is about 1.5-2.1 times faster. It gives a result
that is on average 6° different from the old implementation. The difference is
because normals (Ng, N, N') are not selected to be coplanar, but instead
reflection R is lifted the least amount and the N' is computed as a bisector.

Differential Revision: https://developer.blender.org/D10084
2021-03-15 18:01:57 +01:00
Mikhail Matrosov fbe0165aad Fix T56925: Cycles banding artifacts in dense volumes
Offset the starting point of segments by a random amount to avoid the bounding
box shape affecting the result and creating artifacts.

Differential Revision: https://developer.blender.org/D10576
2021-03-15 17:49:52 +01:00
Brecht Van Lommel cd3fade2aa Fix Cycles rendering crash on OpenBSD
Static initialization order was not guaranteed to be correct for node base
types. Now wrap all initialization in accessor functions to ensure the order
is correct.

Did not cause any known bug on Linux/macOS/Windows, but showed up on this
platform.
2021-03-15 16:47:07 +01:00
Sergey Sharybin 1b29e84c18 Fix Libmv tests after recent fix
Forgot to update regression test to the changed API.
2021-03-15 16:11:37 +01:00
Sergey Sharybin c82f65b096 Fix T86262: Tracking backwards fails after gap in track
The issue was caused by a prediction algorithm detecting tracking the
wrong way. Solved by passing tracking direction explicitly, so that
prediction will always happen correctly regardless of the state of the
Tracks context.
2021-03-15 15:55:09 +01:00
Sergey Sharybin 618c4b9daf Refactor Libmv C-API motion model conversion
Mode to an own utility function and guard missing enumerator values
with a LOG(FATAL).
2021-03-15 15:55:09 +01:00
Sergey Sharybin d8e1750e34 Cleanup: Spelling in Libmv comments 2021-03-15 15:55:09 +01:00
Ankit Meel 448cb5d55b CMake/guardedalloc: add header file to TEST_SRC 2021-03-14 18:11:24 +05:30
Brecht Van Lommel 476be3746e Fix T86332: setting Cycles dicing camera fails after recent changes
Somehow "from __future__ import annotations" and "lambda" are not working
together well here, work around it by not using a lambda function.
2021-03-12 17:49:56 +01:00
Bastien Montagne ef5782e297 CLOG: add support for substring matching.
So that `--log "*undo*"` matches any log identifier containing `undo`.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10647
2021-03-12 16:01:46 +01:00
Brecht Van Lommel 20ee6c0f16 Fix compiler warning when building Cycles without Embree 2021-03-12 15:17:08 +01:00
Kévin Dietrich 8922d177c1 Alembic procedural: specific result type for cache lookups
This type, CacheLookupResult, holds the data for the current time, or an
explanation as to why no data is available (already loaded, or simply
nothing available). This is useful to document the behavior of the code
but also, in future changes, to respond appropriately for missing data.
2021-03-12 01:57:41 +01:00
Kévin Dietrich d72fc36ec5 Alembic procedural: add support for instancing
Inside of the procedural, instances are AlembicObjects which point to
the AlembicObject that they instance.

In Alembic, an instance is an untyped Object pointing to the original
(instanced) one through its source path. During the archive traversal we
detect such instances and, only if the instanced object is asked to be
rendered, set the instance's AlembicObject to point to the original's
AlembicObject.

Cycles Object Nodes are created for each AlembicObject, but only for
non-instances are Geometries created, which are then shared between
Object Nodes. It is supposed, and expected, that all instances share the
same shaders, which will be set to be the ones found on the original
object.

As for caching, the data cache for an AlembicObject is only valid for
non-instances and should not be read to or from as it is implicitly
shared.
2021-03-12 01:30:12 +01:00
Kévin Dietrich 7017844c5e Alembic procedural: move cache building out of object update methods
This will help support instancing as cache building is now decoupled
from the logic to update the Nodes' sockets as data (and cache) will
need to be shared by different Geometries somehow, and also simplify
implementing different data caching methods by centralizing this
operation.
2021-03-12 00:15:17 +01:00
Kévin Dietrich 7a028d5b99 Alembic procedural: fix missing attribute update
We need to explicitely tag the Attribute and AttributeSet as modified if
we change or add/remove data. This is more of a bandaid until attributes
handling is refactored to be able to reuse routines from the Attribute
API.
2021-03-12 00:15:16 +01:00
Kévin Dietrich 62e2fdf40b Cleanup: unused variable 2021-03-12 00:15:16 +01:00
Kévin Dietrich 2ebf4fbbfb Alembic procedural: fix potential zero scale matrix generation
This can happen during user edits or with files missing the global scale
property.
2021-03-12 00:15:15 +01:00
Campbell Barton 5b91a52944 Cleanup: spelling 2021-03-12 00:51:29 +11:00
Patrick Mours f4f8b6dde3 Cycles: Change device-only memory to actually only allocate on the device
This patch changes the `MEM_DEVICE_ONLY` type to only allocate on the device and fail if
that is not possible anymore because out-of-memory (since OptiX acceleration structures may
not be allocated in host memory). It also fixes high peak memory usage during OptiX
acceleration structure building.

Reviewed By: brecht

Maniphest Tasks: T85985

Differential Revision: https://developer.blender.org/D10535
2021-03-11 14:12:35 +01:00
Brecht Van Lommel eb20250d2a Fix wrong white point of Linear ACES in config reading and the bundled config
The Blender/Cycles XYZ color space has a D65 white point instead of E, and
this was not correctly accounted for both in the OpenColor config reading code
and the bundled config.

This meant that since the OpenColorIO v2 upgrade, the Linear ACES color space
was not working correctly, and other OpenColorIO configs defining
aces_interchange were not interpreted correctly.
2021-03-10 16:56:27 +01:00
Corbin Dunn 4069016de8 macOS/Ghost: Simplify pasteboard and screen count code
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:47 +05:30
Corbin Dunn 9d046019e2 macOS/Ghost: Remove unnecessary nil checks.
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:44 +05:30
Corbin Dunn cd1e6df534 macOS/Ghost: Replace NSAutoreleasePool with @autoreleasepool
- Automatic and guaranteed cleanup.
- Improves readability and reduces chances of errors by removing
`[pool drain]` statements.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:41 +05:30
Brecht Van Lommel 3669a3e2e9 Fix Cycles CUDA build error with Visual Studio 2019 v16.9
Something in this update broke the floor() function in CUDA, instead use
floorf() like we do everywhere else in the kernel code. Thanks to Ray
Molenkamp for identifying the solution.
2021-03-08 14:06:16 +01:00
Kévin Dietrich 9c8382e618 Cleanup: do not pass class member to class methods 2021-03-07 17:22:00 +01:00
Kévin Dietrich 00f218602d Alembic procedural: fix missing update when only the transforms change
The missing update has two sources:

The TimeSampling used for looking up transformations in the cache was
uninitialized. To fix this, simply use the TimeSampling from the last
transformation in the hierarchy (that is the object's parent), which
should also contain the time information for all of its parents.

The objects are not tagged for update when their trasformations change.
2021-03-07 17:16:16 +01:00
Kévin Dietrich ac4d45dbf1 Alembic procedural: fix infinite update loop when modifying Object level properties 2021-03-07 17:16:16 +01:00
Sergey Sharybin 0dd9a4a576 Cleanup: Libmv, clang-format
Is based on Google style which was used in the Libmv project before,
but is now consistently applied for the sources of the library itself
and to C-API. With some time C-API will likely be removed, and it
makes it easier to make it follow Libmv style, hence the diversion
from Blender's style.

There are quite some exceptions (clang-format off) in the code around
Eigen matrix initialization. It is rather annoying, and there could be
some neat way to make initialization readable without such exception.

Could be some places where loss of readability in matrix initialization
got lost as the change is quite big. If this has happened it is easier
to address readability once actually working on the code.

This change allowed to spot some missing header guards, so that's nice.

Doing it in bundled version, as the upstream library needs to have some
of the recent development ported over from bundle to upstream.

There should be no functional changes.
2021-03-05 15:05:08 +01:00
Campbell Barton aa86710242 Cleanup: spelling 2021-03-05 14:44:28 +11:00
Campbell Barton b9833860e5 Cleanup: maintain include order without disabling clang format 2021-03-05 14:08:00 +11:00
Harley Acheson 97fabc3c1c Fix T86185: Win32 Multiple Monitor Window Position
Because of D10469 we can now not force child windows onto parent's monitor and allow them to go where they wish.

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

Reviewed by Ray Molenkamp
2021-03-04 17:54:46 -08:00
Jacob Møller 57812c7e4f Windows/CLog: Support color logging on Win 10
Windows 10 supports V100 on all consoles given
you enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag for the console.

This patch enables color logging only on windows
10 and only if the log is not being redirected
to a file.

Differential Revision: https://developer.blender.org/D10546
2021-03-04 18:20:52 -07:00
Corbin Dunn d09b874244 macOS/Ghost: Opt out of AppKit’s automatic window tabbing
Since Blender is single-tabbed, this will prevent extraneous
tab-related options from appearing in "Window" menu in case AppKit's
internals change.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10606
2021-03-04 21:53:27 +05:30
Corbin Dunn 93cdf461f3 macOS/Ghost: Remove redundant nil check after initWithContentRect
AppKit’s NSWindow.h has NS_ASSUME_NONNULL_BEGIN, and only methods/
properties explicitly marked nullable will ever return nil.

Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10603
2021-03-03 21:26:09 +05:30
Corbin Dunn 87c949a3bd macOS/Ghost: Fix memory leak.
`new` allocates a new object that needs to be autoreleased.

Reviewed By: #platform_macos, sebbas, ankitm
Maniphest Tasks: T86222
Differential Revision: https://developer.blender.org/D10597
2021-03-03 21:25:20 +05:30
Campbell Barton 6aec6568a0 Cleanup: spelling, minor corrections
Also use doxygen comments for sculpt functions.
2021-03-03 06:20:27 +11:00
Sergey Sharybin aeb7bc5beb GLog: Lower default logging severity to INFO
Before this change messages of ERROR and above were printed.
This change makes it so LOG(INFO), LOG(WARNING), LOG(ERROR)
and LOG(FATAL) will be printed to the console by default
(without --debug-libmv and --debug-cycles).

On a user level nothing is changed because neither INFO nor
WARNING severity are used in our codebase. For developers this
change allows to use LOG(INFO) to print relevant for debugging
information. Bering able to see WARNING messages is also nice,
since those are not related to debugging, but are about some
detected "bad" state.

After this change the LOG(INFO) is really treated as a printf.
Why not to use printf to begin with? Because it is often more
annoying to print non-scalar types. Why not to use cout? Just
a convenience, so that all type of logging is handled in the
same way. When one is familiar with Glog used in the area, it
is easy to use same utilities during development. Also, it is
easy to change LOG(INFO) to VLOG(2) when development is done
and one wants to keep the log print but make it only appear
when using special verbosity flags.

The initial reason why default severity was set to maximum
possible value is because of misuse of VLOG with verbosity
level 0, which is the same as LOG(INFO). This is also why
back in the days --debug-libmv was introduced.

Now there is some redundancy between --debug-libmv, --debug-cyles
and --verbose, but changes in their meaning will cause user
level side effects.

Differential Revision: https://developer.blender.org/D10513
2021-03-01 16:56:34 +01:00
Sergey Sharybin ea95ea644a Libmv: Avoid use of LOG(INFO) in solver
Usage of LOG(INFO) actually went against own guidelines in the
logging.h: the INFO is for messages which are to be printed
regardless of debug/verbosity settings.
2021-03-01 16:54:14 +01:00
Brecht Van Lommel 5da418d4e6 Fix Cycles build error without Embree on Windows
Don't use ssize_t, it's not available in MSVC.
2021-03-01 16:33:31 +01:00