Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
|
|
Port shader wave texture node
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D12733
|
|
|
|
This adds the ability to mark slots as removed while iterating through
a mutable set.
Differential Revision: https://developer.blender.org/D12867
|
|
noise.cc uses std::min and std::max without
including the algorithm header required.
Newer MSVC versions and GCC implicitly include
it somewhere, which isn't something we should
count on. Best to include what you use.
|
|
Port shader node musgrave texture
Differential Revision: https://developer.blender.org/D12701
|
|
|
|
Commit e1665c3d3190 added math to do 2D affine transformations with 3x3
matrices, but these matrices are also used for 3D transformations.
Remove added functions and use 4x4 matrices for 2D transformation.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D12510
|
|
Port shader Voronoi to GN
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D12725
|
|
Port White Noise shader to geometry nodes.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D12719
|
|
|
|
By argument naming and convention this is the intended argument order.
|
|
This looks a lot nicer than writing `mul_m4_m4_post` instead.
Differential Revision: https://developer.blender.org/D12844
|
|
Previously the functions called `hash_float` instead of `uint_to_float_01`.
This meant that the float was hashed twice instead of once.
The new functions are also compatible with Cycles/Eevee.
Differential Revision: https://developer.blender.org/D12832
|
|
The problem is that the fast triangulator (based on polyfill)
sometimes makes degenerate triangles. Commit 8115f0c5bd91f had
a check for degenerate triangles but it wasn't thorough enough.
This commit uses a more thorough (and pessimistic) test for
degenerate triangles, using the exact triangulator in those cases.
|
|
|
|
|
|
|
|
Match API naming prefix (BKE_vfont_*) and DNA_vfont_types.h.
|
|
This didn't belong on blenlib since it uses DNA data types
and included a bad-level call to BKE_curve.h.
It also meant linking in blenlib would depend on the freetype library,
noticeable for thumbnail extraction (see D6408).
|
|
|
|
Thanks to Patrik Olsson for spotting this.
|
|
Because of legacy reasons (C string compare function returning 0 when
strings are equal), the ghash compare function is expected to return
false when hashes are equal.
|