Age | Commit message (Collapse) | Author |
|
Also add groups in some files.
|
|
This builds off of rBf951aa063f7, adding a weight parameter which can
be used to change the order of items when they have the same match
score. In the future, if string searching gets a C++ API, we could
use an optional parameter for the weight, since it is not used yet.
This will be used for the node link drag search menu (D8286).
Differential Revision: https://developer.blender.org/D13559
|
|
Also move notes about where noise functions come from
into the function body as it's not relavant to the public doc-string.
|
|
Replaces `HOME` environment variable usage for user
directories like in D12802.
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13212
|
|
Some doc-strings were skipped because of blank-lines between
the doc-string and the symbol and needed to be moved manually.
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
Ref T92709
|
|
|
|
|
|
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
|
|
The issue here was that after the seek table check, the underlying file wasn't
rewound to the start, so the code that checks for the BLENDER header
immediately reaches EOF and fails.
Since Blender always writes files with a seek table, this bug isn't triggered
by files saved in Blender itself. However, files compressed in external tools
generally don't have a seek table.
|
|
|
|
Dirty regions when painting are not using rcti. Meaning less
understandable code. Found issue when refactoring the image_gpu partial
update. In a future change gpu partial update API will be using rcti
also what makes the code even cleaner.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D13260
|
|
We often call `parallel_for` in places with very variable
sized workloads. When many elements are processed,
using multi-threading is great, but when processing
few elements (possibly many times) using `parallel_for`
can result in significant overhead.
I measured that this improves performance by >20% in
the refactored realize instances code I'm working on
separately. The change might also help with debugging
sometimes, because the stack trace is smaller and contains
fewer irrevelant symbols.
|
|
|
|
|
|
|
|
Linux distributions are using newer TBB versions than official releases, and
TBB 2021 is an API breaking release.
In general we should avoid using TBB directly and go through the abstractions
in BLI_task.hh, though there is no abstraction for this.
For 3.0 the safe option is to just not cancel the task but instead early out
in the lambda function. Given the grain size of 2048 there should be no
significant performance difference.
Differential Revision: https://developer.blender.org/D13382
|
|
This assert was producing warning in debug builds because
it was never hit under some circumstances.
|
|
This implements four optimizations in the Set Position node:
* Check whether the position input is the current position and ignore
it if it is. This results in a speedup when only the Offset input is used.
* Use multi-threading when copying to computed values to the
position attribute. All geometry types benefit from this.
* Use devirtualization for the offset and position input. This optimizes
the common case that they are either single values or computed
in the fly in a span.
* Write to `Mesh->mvert` directly instead of creating a temporary span.
This makes setting mesh vertex positions even more efficient.
In my simple benchmark I'm using a White Noise node to offset the
position of 1,000,000 vertices. The speed is `20 ms -> 4.5 ms` in the
multi-threaded case and `32 ms -> 22 ms` in the single-threaded case.
|
|
For some underlying data (e.g. spans) we had two virtual array
implementations. One for the mutable and one for the immutable
case. Now that most code does not deal with the virtual array
implementations directly anymore (since rBrBd4c868da9f97a),
we can get away with sharing one implementation for both cases.
This means that we have to do a `const_cast` in a few places, but
this is an implementation detail that does not leak into "user code"
(only when explicitly casting a `VArrayImpl` to a `VMutableArrayImpl`,
which should happen nowhere).
|
|
Those were not implemented consistently and don't really help in practice.
|
|
A parallel loop to create the interesection meshes for each triangle
meant that with parallelism, the output order of the created meshes
could vary with each execution. Keep the parallelism for doing the CDTs
for interesection, but move the extraction of the new faces into a
serial loop afterwards, for repeatability.
|
|
|
|
The compiler is more likely to optimize away the function call
overhead when the used type is simpler and not virtual.
|
|
The parameter name was inconsistent with the declaration.
|
|
windows.h `#defines rct1` as a number which is
problematic if we include `BLI_rect.h` after
`windows.h` .
by renaming `rct1/2` to `rct_a/b` we side step
the collision and straighten up the naming with
the functions directly above it.
|
|
|
|
Conflicts:
source/blender/blenkernel/BKE_blender_version.h
source/blender/blenloader/intern/versioning_300.c
|
|
If a valid matching string is found, return that item, otherwise
fallback to the item matching the given index, if any.
This will be useful in RNA override code, and potentially other
areas where data in lists can be referenced by their names or indices.
|
|
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D13264
|
|
Goals of this refactor:
* Simplify creating virtual arrays.
* Simplify passing virtual arrays around.
* Simplify converting between typed and generic virtual arrays.
* Reduce memory allocations.
As a quick reminder, a virtual arrays is a data structure that behaves like an
array (i.e. it can be accessed using an index). However, it may not actually
be stored as array internally. The two most important implementations
of virtual arrays are those that correspond to an actual plain array and those
that have the same value for every index. However, many more
implementations exist for various reasons (interfacing with legacy attributes,
unified iterator over all points in multiple splines, ...).
With this refactor the core types (`VArray`, `GVArray`, `VMutableArray` and
`GVMutableArray`) can be used like "normal values". They typically live
on the stack. Before, they were usually inside a `std::unique_ptr`. This makes
passing them around much easier. Creation of new virtual arrays is also
much simpler now due to some constructors. Memory allocations are
reduced by making use of small object optimization inside the core types.
Previously, `VArray` was a class with virtual methods that had to be overridden
to change the behavior of a the virtual array. Now,`VArray` has a fixed size
and has no virtual methods. Instead it contains a `VArrayImpl` that is
similar to the old `VArray`. `VArrayImpl` should rarely ever be used directly,
unless a new virtual array implementation is added.
To support the small object optimization for many `VArrayImpl` classes,
a new `blender::Any` type is added. It is similar to `std::any` with two
additional features. It has an adjustable inline buffer size and alignment.
The inline buffer size of `std::any` can't be relied on and is usually too
small for our use case here. Furthermore, `blender::Any` can store
additional user-defined type information without increasing the
stack size.
Differential Revision: https://developer.blender.org/D12986
|
|
|
|
Using `const` on an enum type returned by value doesn't have an effect.
|
|
The `ContainerValue` template can obtain the type of the contained value
via the given `Container` type, simply using `Container::value_type`.
Use this as the default way to determine the value type which simplifies
using the template. If necessary the value type can be passed explicitly
still.
|
|
We run into float precision issues here, clamp the number of octaves to
one less, which has little to no visual difference. This was empirically
determined to work up to 16 before, but with additional inputs like
roughness only 15 appears to work.
Also adds misisng clamp for the geometry nodes implementation.
|
|
The geometry node port of voronoi_smooth_f1 function has a
division by zero when smoothness is set to zero.
Using a safe_divide within the function causes issues
and was noted in the original patch D12725.
Solution in this case is to clamp zero smoothness to FLT_EPSILON.
Reviewed By: JacquesLucke
Maniphest Tasks: T92736
Differential Revision: https://developer.blender.org/D13069
|
|
This resulted in an ASAN warning.
|
|
Accessing the default directory in the file selector
would crash if HOME was undefined.
Add BKE_appdir_folder_default_or_root which never returns NULL.
|
|
|
|
When doing a non portable build of blender, the executable
blender-thumbnailer would be installed in two locations:
/usr/bin/
/usr/
While cleaning up, also make the blender thumbnailer dll optional on
windows to bring the logic in line with what it is on linux and mac.
Reviewed By: Campbell Barton, Ray molenkamp
Differential Revision: http://developer.blender.org/D13014
|
|
|
|
|
|
|
|
Adds an abstraction layer to switch between serialization formats.
Currently only supports JSON. The abstraction layer supports
`String`, `Int`, `Array`, `Null`, `Boolean`, `Float` and `Object`. This
feature is only CPP complaint.
To write from a stream, the structure can be built by creating a value
(any subclass of `blender::io::serialize::Value` can do, and pass it to
the `serialize` method of a `blender::io::serialize::Formatter`. The
formatter is abstract and there is one implementation for JSON
(`JsonFormatter`).
To read from a stream use the `deserialize` method of the formatter.
{D12693} uses this abstraction layer to read/write asset indexes.
Reviewed By: Severin, sybren
Maniphest Tasks: T91430
Differential Revision: https://developer.blender.org/D12544
|
|
This patch improves performance by only assigning
or calculating data for connected sockets.
It is recommended that artists use the lowest dimensions setting
for noise based textures. E.g. Use 2D instead of 3D where possible.
Using a scoped timer and single thread on 256,000 points.
Smooth F1 3D : Debug build
Timer 'Optimised' took 9.39991 s
Timer 'Normal' took 16.1531 s
This optimisation is only for GN and not shaders.
Differential Revision: https://developer.blender.org/D12985
|
|
This value is defined in the UI module, but happens to be used
in string_search.cc too. Note that these references need to be kept in
sync. Use escaped utf-8 sequence since the literal can be avoided.
Also replace BLI_str_utf8_as_unicode calls with constant assignments
as these values are known there is no need to decode a utf-8 sequence.
|
|
|
|
|
|
|
|
Although the documentation says so, the null-terminator was missing.
This could cause crashes when logging shader linking errors as shader
sources are empty in this case.
|
|
Separate the huge test into huge logical parts and add more cases
to check. Also add a utility to check that the matrix is orthogonal,
with arbitrary epsilon values and calculations in double.
A couple of tests deliberately fail, to be fixed in following commits.
Ref D9551
|