Age | Commit message (Collapse) | Author |
|
MSVC used to warn about const mismatch for arguments passed by value.
Remove these as newer versions of MSVC no longer show this warning.
|
|
Some recent changes re-introduced public-style doc-strings
in the source file.
|
|
|
|
|
|
|
|
Function `blend_color_softlight_float` used math different to compositor and
produced result that had abrupt value changes.
Use math based on modified screen blend mode as compositor does.
|
|
Result of Exclusion and Pin Light blend modes could be greater than 255
which caused artifacts. Limit color value to 0-255 range.
|
|
Span had a slice method with an IndexRange argument, but MutableSpan
did not, yet. This commit makes the two types consistent.
|
|
|
|
|
|
ObjectValue was to confusing as it is the term from JSON.
|
|
This implements the design detailed in T92696 to support virtual
filenames for UDIM textures. Currently, the following 2 substitution
tokens are supported:
| Token | Meaning |
| ----- | ---- |
| <UDIM> | 1001 + u-tile + v-tile * 10 |
| <UVTILE> | Equivalent to u<u-tile + 1>_v<v-tile + 1> |
Example for u-tile of 3 and v-tile of 1:
filename.<UDIM>_ver0023.png --> filename.1014_ver0023.png
filename.<UVTILE>_ver0023.png --> filename.u4_v2_ver0023.png
For image loading, the existing workflow is unchanged. A user can select
one or more image files, belonging to one or more UDIM tile sets, and
have Blender load them all as it does today. Now the <UVTILE> format is
"guessed" just as the <UDIM> format was guessed before.
If guessing fails, the user can simply go into the Image Editor and type
the proper substitution in the filename. Once typing is complete,
Blender will reload the files and correctly fill the tiles. This
workflow is new as attempting to fix the guessing in current versions
did not really work, and the user was often stuck with a confusing
situation.
For image saving, the existing workflow is changed slightly. Currently,
when saving, a user has to be sure to type the filename of the first
tile (e.g. filename.1001.png) to save the entire UDIM set. The number
could differ if they start at a different tile etc. This is confusing.
Now, the user should type a filename containing the appropriate
substitution token. By default Blender will fill in a default name using
the <UDIM> token but the user is free to save out images using <UVTILE>
if they wish.
Differential Revision: https://developer.blender.org/D13057
|
|
|
|
This function node creates a running total of a given Vector, Float, or
Int field.
Inputs:
- Value: The field to be accumulated
- Group Index: The values of this input are used to aggregate the input
into separate 'bins', creating multiple accumulations.
Outputs:
- Leading and Trailing: Returns the running totals starting
at either the first value of each accumulations or 0 respectively.
- Total: Returns the total accumulation at all positions of the field.
There's currently plenty of duplicate work happening when multiple outputs
are used that could be optimized by a future refactor to field inputs.
Differential Revision: https://developer.blender.org/D12743
|
|
This adds `blender::is_same_any_v` which is the almost the same as
`std::is_same_v`. The difference is that it allows for checking multiple
types at the same time.
Differential Revision: https://developer.blender.org/D13673
|
|
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
|
|
This replaces the single-threaded calculation of mesh min and max
positions with a `parallel_reduce` loop. Since the bounding box
of a mesh is retrieved quite often (at the end of each evaluation,
currently 2(?!) times when leaving edit mode, etc.), this makes for a
quite noticeable speedup actually.
On my Ryzen 3700x and a 4.2 million vertex mesh, I observed
a 4.4x performance increase, from 14 ms to 4.4 ms.
I added some methods to `float3` so they would be inlined, but
they're also a nice addition, since they're used often anyway.
Differential Revision: https://developer.blender.org/D13572
|
|
The cast to size_t leads to a build issue on 32
bit archs. cursor_delim_type_utf8 expects an int
so an additional cast to size_t is not required.
Reported by user frispete on devtalk.
|
|
On Windows, encode file paths as UTF-16 before trying to open the file
for reading/writing.
This introduces a new class `blender::fstream`, which wraps
`std::fstream` and provides this UTF-16 encoding. This class should also
be used in other areas, like the Alembic importer/exporter.
Manifest Task: T93960
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13633
|
|
Using `&&` there was a typo. With `&&` the `prepend` method
could not be called with a const reference as argument.
|
|
Differentiate doc-strings from title/section text.
|
|
The RNA setter now ensures that driver variables are uniquely named
(within the scope of the driver).
Versioning code has been added to ensure this uniqueness. The last
variable with the non-unique name retains the original name; this
ensures that the driver will still evaluate to the same value as before
this fix.
This also introduces a new blenlib function `BLI_listbase_from_link()`,
which can be used to find the entire list from any item within the list.
Manifest Task: T94116
Reviewed By: mont29, JacquesLucke
Maniphest Tasks: T94116
Differential Revision: https://developer.blender.org/D13594
|
|
Using the `MEM_*` API from C++ code was a bit annoying:
* When converting C to C++ code, one often has to add a type cast on
returned `void *`. That leads to having the same type name three times
in the same line. This patch reduces the amount to two and removes the
`sizeof(...)` from the line.
* The existing alternative of using `OBJECT_GUARDED_NEW` looks a out
of place compared to other allocation methods. Sometimes
`MEM_CXX_CLASS_ALLOC_FUNCS` can be used when structs are defined
in C++ code. It doesn't look great but it's definitely better. The downside
is that it makes the name of the allocation less useful. That's because
the same name is used for all allocations of a type, independend of
where it is allocated.
This patch introduces three new functions: `MEM_new`, `MEM_cnew` and
`MEM_delete`. These cover the majority of use cases (array allocation is
not covered).
The `OBJECT_GUARDED_*` macros are removed because they are not
needed anymore.
Differential Revision: https://developer.blender.org/D13502
|
|
|
|
|
|
Saving with only a filename (from Python) wasn't being prevented,
while it would successfully write the file to the working-directory,
path remapping and setting relative paths wouldn't work afterwards
as `Main.filepath` would have no directory component.
Disallow this since it's a corner case which only ever occurs
when path names without any directories are used from Python,
the overhead of expanding the working-directory for all data saving
operations isn't worthwhile.
The following changes have been made:
- bpy.ops.wm.save_mainfile() without a filepath argument
fails & reports and error when the file hasn't been saved.
Previously it would write to "untitled.blend" and set the
`G.main->filepath` to this as well.
- bpy.ops.wm.save_mainfile(filepath="untitled.blend")
fails & reports and error as the filename has no directory component.
- `BLI_path_is_abs_from_cwd` was added to check if the path would
attempt to expand to the CWD.
|
|
Renamed or removed parameters which no longer exist.
|
|
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.
|