Age | Commit message (Collapse) | Author |
|
|
|
Use the newly added node topology cache to find the node that contains
a socket rather than looping through all nodes every time. The change
improves performance of drawing a some large node trees by 2-3x.
|
|
There were two problems:
* The stroke was deleted if the last point was selected. Now
the stroke is flipped because is faster.
* If the second point was selected, the first point was removed
because the internal api, removed one point strokes by
default. This was done becaus ethe tools that used this API
did not need one point strokes as result. Now this optional
and keep one point strokes.
|
|
BLI_path_slash_ensure was appending to fixed sized buffers without
a size check.
|
|
When pushing down an Action to a new NLA track, the track is now named
after the Action.
|
|
|
|
* External engines do not use the PBVH and need slower depsgraph updates.
* Final depsgraph tag after stroke finishes was missing for sculpt color
painting, caused missing updates for other viewports as well as any
modifiers or nodes on other objects using the colors.
|
|
Updates for cursor could cause the paint data to be continuously refreshed,
which is pretty cheap by itself, but not when it starts tagging the depsgraph.
The paint slot refresh code ideally should not be doing depsgraph tags at all,
but checking if there were changes at least avoids continuous updates.
|
|
The bug has existed since crasy space was implemented.
rBbf8a26b7453d made the error even worse as the
`modifiers_disable_subsurf_temporary` function, which works like a
toggle, did not temporarily re-enable subsurf.
The main problem is that the derived mesh is modified but not marked as
dirty at the end.
|
|
Internal links are run-time/derived data. Therefore it is not necessary
to load them from .blend files where invalid internal links may be stored.
They will be regenerated after a node tree is loaded anyway.
|
|
This could result in wrong behavior depending on the order in which the
Image.filepath and Image.source fields are set from within Python for
example.
Caused by rB72ab6faf5d80
|
|
For the JPG preview, the only thing that was changed in the image
format was the format itself. However, the colorspace code now also
checks the bitdepth through BKE_image_format_is_byte, so the depth
needs to be explicitly set to 8-bit for the JPG preview output.
|
|
Code adding stash track was clearing out track flags, instead of editing
them as it should have...
Note that there are a lot of other weaknesses in action stash code (like
relying on the (translated!!!!!!) name of the track to know whether it's
a stah or not).
|
|
Previously, the Blender video renderer did not have support for
encoding video to AV1 (not to be confused with the container AVI).
The proposed solution is to leverage the existing FFMpeg renderer
to encode to AV1.
Note that avcodec_find_encoder(AV_CODEC_ID_AV1) usually returns
"libaom-av1" which is the "reference implementation" for AV1 encoding
(the default for FFMpeg, and is slow). "libsvtav1" is faster and
preferred so there is extra handling when fetching the AV1 codec for
encoding such that "libsvtav1" is used when possible.
This commit should only affect the options available for video
rendering, which includes the additional AV1 codec to choose from, and
setting "-crf".
Also note that the current release of FFMpeg for ArchLinux does not
support "-crf" for "libsvtav1", but the equivalent option "-qp" is
supported and used as a fallback when "libsvtav1" is used (as
mentioned here: https://trac.ffmpeg.org/wiki/Encode/AV1#SVT-AV1 ).
(Actually, both "-crf" and "-qp" is specified with the same value in
the code. When a release of FFMpeg obtains support for "-crf" for
"libsvtav1" is released, the code shouldn't be needed to change.)
The usage of the AV1 codec should be very similar to the usage of the
H264 codec, but is limited to the "mp4" and "mkv" containers.
This patch pertains to the "VFX & Video" module, as its main purpose
is to supplement the Video Sequencer tool with the additional AV1
codec for encoded video output.
Differential Revision: https://developer.blender.org/D14920
Reviewed By: sergey , ISS, zeddb
|
|
Reduce amounts of viewlayer updates during remapping while relocating
libraries. Gives some improvements on relocating process, depending on
complexity of existing scene and reloaded libraries, whether there is
liboverrides to resync, etc., can give up to 10% speedup.
|
|
Liboverrides that were using a missing linked reference ID would not get
their 'MISSING' tag properly cleared afer relocating, in case their
linked reference is no more missing.
Reported by Andy (@eyecandy) from Blender studio.
|
|
Remove NURBS or Bezier specific attributes after removing points or
curves. In theory we could avoid copying those attributes in the
first place, but that doesn't seem worth the extra complexity here,
since we don't necessarily know the result curve type counts before
copying attributes.
|
|
`V2D_VIEWSYNC_AREA_VERTICAL` flag was mistakenly set to the sequencer
toolbar region instead of the channels region.
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D16155
|
|
The instance attributes assignment operators were broken in multiple
ways: there wasn't a move constructor (probably causing performance
issues), and the destination attributes weren't freed before they
were replaced.
|
|
Attribute copying often uses identical logic for copying selected
elements or copying with an index map. Instead of reimplementing
this in each file, use the common implementation in the array_utils
namespace. This makes the commonality more obvious, gives improved
performance (this implementation is multithreaded), reduces binary
size (I observed a 173KB reduction), and probably reduces compile time.
|
|
Mistake in own rB358155a8da60, change ended up discarding the case where
we need to also delete IDs using a tagged-to-be-deleted ID in a 'never
NULL' way. Typical example: Whene deleting a Mesh ID, one also needs to
delete all the Objects using that mesh, since obdata pointer is of type
'never NULL'.
Note that luckily, this fix does not affect the performance improvements
from rB358155a8da60.
Noted by Brecht and Clement because of failing unittests, shame on me.
|
|
Oversight in rBf8b1483566cc which resulted in fonts/surfaces not having
their draw caches being tagged dirty.
Not only OB_CURVES_LEGACY have their object data of type ID_CU_LEGACY,
but also OB_SURF/OB_FONT objects.
Maniphest Tasks: T101922
Differential Revision: https://developer.blender.org/D16298
|
|
Add the eModifierMode_Editmode to the required modes for curves modifier
evaluation. Only this way the modifier can be skipped in evaluation.
Maniphest Tasks: T101888
Differential Revision: https://developer.blender.org/D16280
|
|
batch-deleting IDs.
Batch-delete by-passes a lot of ID usages handling in to-be-deleted IDs,
so usercount of deleted IDs needs to be manually reset to avoid the
annoying error messages in the console.
|
|
Simplify and optimize remapping handling in bacth ID deletion, by moving
it outside of the initial loop gathering all IDs to be deleted, and and
by using batch remapping code.
Speedup can be over 100 times faster in complex production scenes using
thousands of IDs, when e.g. deleting a whole library.
Examples before/after times on my machine (deleting two different libraries):
lib1: 5.55 sec/0.03 sec
lib2: 13.60 sec/0.13 sec
Found while investigating T101903.
|
|
Remapping in batch deletion could end up calling viewlayer resync code
on partially invalid BMain (some IDs still in Main using IDs removed
from Main).
Think this code can actually be further optimized, but this fix should
be safe enough for 3.3 (and potentially 2.93).
Thanks to Jeroen (@jbakker) for the initial investigation.
|
|
Currently harmless (since atm. it is not possible to trigger this part
of the code from curves sculpting), but in a future fix (for T101518), it
would be good to use `BKE_paint_init` (and having the correct ob_mode
for the brush would be nice).
Differential Revision: https://developer.blender.org/D16286
|
|
This is used to represent unknown state, so there is no need to be
able to store it's pressed state.
|
|
|
|
Caused by 21f2bacad977d3fd83d which misunderstood the logic handling
shape keys in this function. The shape key on the original mesh in the
main data-base should be cleared if the "no-main" mesh doesn't have any
shape key layers and the vertex count has changed. The complexity is
necessary because shape keys are stored differently on original and
evaluated meshes.
Also change to "Warn" because this is expected behavior in some cases,
like when applying a geometry nodes modifier that creates a new mesh
from scratch.
|
|
String attributes are intentionally not fully supported in geometry nodes
yet because more design work is necessary to decide how they should behave.
For now just disable handling string attributes to avoid crashes.
|
|
|
|
`Brush` has two attributes for holding texture information (`MTex`).
One for color textures (`mtex`) and one for mask textures (`mask_mtex`).
Unfortunately sculpt mode due to reasons used `mtex` to store mask textures.
Changes like brush asset/paint mode require modes/tools to read the mask/color texture from
one place.
To start sanatizing this we isolate the attributes in functions.
`BKE_brush_color_texture_get` and `BKE_brush_mask_texture_get`. All object
paint modes should use these functions.
|
|
Checking for polygon and loop data to be referenced is too fragile
re changes in geometry node implementations. Instead, compare counts
of polygons, face corners and vertices: topology changes are unlikely
to keep all three unchanged.
Ref D15501
|
|
Also remove automasking_cavity_factor default from RNA for brushes.
Data-blocks set their defaults via `DNA_brush_defaults.h`
Continuation from previous commit and rBdb40b6
Thanks to Dalai for the help!
|
|
|
|
Recent changes to path handling (most likely [0]) caused
AssetCatalogTest.create_catalog_after_loading_file to fail on WIN32.
The test relied on the resulting path to be joined with "/" as a path
separator. The resulting path used both forward and back-slashes.
While these do work for some API's on WIN32, mixing both in a file path
isn't expected behavior in most cases, so update the tests to use native
slash direction for file-paths.
[0]: 9f6a045e23cf4ab132ef78eeaf070bd53d0c509f
|
|
Differential Revision: https://developer.blender.org/D16203
|
|
This makes instance handling more consistent with all the other geometry
component types. For example, `MeshComponent` contains a `Mesh *` and
now `InstancesComponent` has a `Instances *`.
Differential Revision: https://developer.blender.org/D16137
|
|
These functions are almost identical, the main difference being
BLI_join_dirfile didn't trim existing slashes when joining paths
however this isn't an important difference that warrants a separate
function.
|
|
Using varargs had the disadvantages, replace with a macro which has
some advantages.
- Arguments are type checked.
- Less verbose.
- Unintended NULL arguments would silently terminate joining paths.
- Passing in a NULL argument warns with GCC.
|
|
|
|
BKE_sculpt_mask_layers_ensure now takes a depsgraph argument and
will evaluate the depsgraph if a multires mask layer is added.
This is necassary to update the multires runtime data so that
pbvh knows it has a grids mask layer.
Also added code to update pbvh->gridkey.
|
|
When a scene copy is called, all viewlayers are ensured before they are
copied. In case of multiple viewlayers, a viewlayer can be out of sync.
This triggers an assert in the BKE_view_layer_copy_data.
Reviewed By: mont29
Maniphest Tasks: T101394
Differential Revision: https://developer.blender.org/D16214
|
|
Problem here was that layer_collection_objects_sync wasn't called when
the holdout property is updated due to frame change, so the changed
visibility flag was never applied to ob->base_flag.
Turns out there's no real reason to handle the per-object holdout
property through the layer system. So, instead of merging both the
layer holdout and object holdout into base_flag and checking that
from the render engines, only handle the layer holdout (which can't
be animated, so no issue here) through base_flag and explicitly also
check the object holdout in the render engines.
|
|
PBVH_FACES and PBVH_GRIDS do not store faces directly in nodes;
instead they store 'primitives', which are tesselation triangles
for PBVH_FACES and grids (which are per-loop) for PBVH_GRIDS.
Primitives from the same face could sometimes end up in different
PBVH nodes. This is now prevented in two ways:
* All primitives of the same face are given the same boundary
during PBVH build. This prevents them from being swapped
away from each other during partitioning.
* build_sub adjusts the final partition midpoint to fall
between primitives of different faces.
|
|
|
|
In some situations, layers were filled with their default value
when converting from Mesh to BMesh (entering edit mode, for example).
This was caused by the recently added "copy mesh to bmesh" or "merge
mesh to bmesh" custom data functions creating a difference custom
data format than was used for the copying functions used later.
`CustomData_to_bmesh_block` is not robust enough to handle simple
differences in layout between the layout of the source and result
CustomData layers, because it relies on the order of the types and
the number of layers within each type.
As a fix, make the "mesh to bmesh" special case more explicit in
the conversion functions. This makes the difference in the API
smaller, which is a nice improvement anwyay.
Fixes T101796
|
|
Instead of allocating three separate ThreadMutex pointers,
just embed std::mutex into the struct directly.
|
|
This commit replaces the `Mesh_Runtime` struct embedded in `Mesh`
with `blender::bke::MeshRuntime`. This has quite a few benefits:
- It's possible to use C++ types like `std::mutex`, `Array`,
`BitVector`, etc. more easily
- Meshes saved in files are slightly smaller
- Copying and writing meshes is a bit more obvious without
clearing of runtime data, etc.
The first is by far the most important. It will allows us to avoid a
bunch of manual memory management boilerplate that is error-prone and
annoying. It should also simplify future CoW improvements for runtime
data.
This patch doesn't change anything besides changing `mesh.runtime.data`
to `mesh.runtime->data`. The cleanups above will happen separately.
Differential Revision: https://developer.blender.org/D16180
|