A mistake in some of the previous refactor which was aimed to make the
byte buffer to be stored as uint8_t. One of the array size calculation
was missing multiplication by 4 channels.
Pull Request: https://projects.blender.org/blender/blender/pulls/112508
Add bone collections to the outliner, underneath the Armature.
This basically follows the same approach as the bone groups (which were
removed from the outliner in the previous commit).
Bone groups have been replaced by bone collections. The data in DNA is
there just for versioning & forward compatibility, so the UI elements are
being removed from Blender 4.0.
The NDEBUG is a toggle define, and in debug builds it is not defined.
This change solves the warning
mtl_context.mm:2282:5: warning: 'NDEBUG' is not defined, evaluates to 0 [-Wundef]
Pull Request: https://projects.blender.org/blender/blender/pulls/112504
srna_from_self had logic to replace the exception unless there was
already an exception set. This logic isn't needed, except in some
disabled code which has been updated. If srna_from_self ran with an
exception set it would leak memory in Python 3.12.
This makes it clearer other "safe" functions should be used in
combination with the resulting offsets.
Also correct doc-string which wasn't updated from the "or_error()"
version of this function.
- rna_Event_unicode_length would return -1 if utf8_buf wasn't a valid
unicode sequence, while this shouldn't happen, assert and return zero
instead of returning a bad length.
- Move comment on wmEvent::utf8_buf null termination to a doc-string.
The functions used to calculate the UTF8 code-points already used the
safe versions (count_utf8_code_points & BLI_str_utf8_as_unicode_step).
So it makes sense to use safe accessors elsewhere too.
There were enough cases of callers ignoring a potential the error value,
using the column width for e.g. to calculate pixel sizes, or the size in
bytes to calculate buffer offsets.
Since text fields & labels can include characters that return an error
from BLI_str_utf8_as_unicode, add the suffix to make this explicit.
- Moving the cursor to the beginning/end of the line didn't work
with word-wrap enabled.
- Moving the cursor up/down without word-wrap enabled
didn't maintain the column.
Resolve using column conversion functions with tab support.
The cursor & selection weren't updated after converting between tabs
& spaces, meaning they could be invalid (in the middle of a UTF8 byte
sequence or out of bounds).
Resolve by storing the column and restoring it afterwards.
Strings that include Latin1 encoding or corrupt UTF8 byte sequences
could read past the buffer bounds (stepping over the null terminator).
Resolve by passing in the string length.
Other changes to support non-UTF8 byte sequences:
- BLI_str_utf8_offset_{to/from}_index were accumulating
the UTF8 offset without accounting for non-UTF8 characters
which could cause a buffer underflow or enter an eternal loop.
- BLI_str_utf8_offset_to_index would read past the buffer bounds if the
offset passed in if it was in the middle of a UTF8 byte sequence.
Since 34b44878449d67a56fd2, attributes are always made mutable when
accessed from the RNA API. This can result in unnecessary copies, which
increases memory usage and reduces performance.
Cycles is the only user of the C++ RNA API, which we'd like to remove
in the future since it doesn't really make sense in the big picture.
Hydra is now a better alternative for external render engines.
To start that change and fix the unnecessary copies, this commit
moves to use Blender headers directly for accessing attribute and
other geometry data. This also removes the few places that still had
overhead from the RNA API after the changes ([0]) in 3.6. In a simple
test with a large grid, I observed a 1.76x performance improvement,
from 1.04 to 0.59 seconds to extract the mesh data to Cycles.
[0]: https://wiki.blender.org/wiki/Reference/Release_Notes/3.6/Cycles#Performance
Pull Request: https://projects.blender.org/blender/blender/pulls/112306
The main goal of this refactor is to simplify how a geometry node group is executed.
Previously, there was duplicated logic that turned the lazy-function graph of a node
group into a single lazy-function. Now this is done only in one place and others can
just execute the lazy-function directly, without having to worry about the underlying graph.
Pull Request: https://projects.blender.org/blender/blender/pulls/112482
Goals of the refactor:
* Simplify adding (named) graph inputs and outputs.
* Add ability to refer to a graph input or output with an index.
* Get rid of the "dummy" terminology which doesn't really help.
Previously, one would add "dummy nodes" which can then serve as input
and output nodes of the graph. Now one directly adds input and outputs
using `Graph.add_input` and `Graph.add_output`. There is one interface
node that contains all inputs and another one that contains all outputs.
Being able to refer to a graph input or output with an index makes it
more efficient to implement some algorithms. E.g. one could have a
bit span for a socket that contains all the information what graph
inputs this socket depends on.
Pull Request: https://projects.blender.org/blender/blender/pulls/112474
Characters with an unknown width (control characters for e.g.)
caused word wrap not to work properly, the text cursor was out of sync
with the displayed text.
Use BLI_str_utf8_char_width_safe which is the convention for the
text editor.
- Restore the selection if auto-closing a selection fails.
- Simplify auto-close selection by ordering the selection.
- Call text_update_line_edited on the selection when auto-closing
a selection to ensure formatting is recalculated for the region.
- Internal changes needed to support multi-byte auto-closing
although this is still limited to ASCII at the moment.
Entering non ascii characters would truncate the code-point to char
when passing it to text_closing_character_pair_get(), which could then
match bracket values. Resolve by checking the characters are ascii.
It wasn't possible to select the position between two tab characters
with the mouse cursor in the UI. Don't handle characters with an unknown
width as combining.
Follow up to [0] which changed this for cursor motion.
[0]: bc51449ff1a8f2083c5b06998f1b448f184357ea
Change to handling of control characters in [0] caused tests to fail,
now the cursor no longer skips over control characters,
update test to account for this.
[0]: bc51449ff1a8f2083c5b06998f1b448f184357ea
Since [0] modal transform in the 3D viewport caused key-maps to be
rebuilt by the event system. Creating a temporary copy for
ViewOpsData_Utility flagged the key-map as outdated.
This could crash (resolved by [1] - for the most-part), but would still
rebuild the whole key-map, adding unnecessary overhead.
This would also reset the KMI_EXPANDED flag, causing transform
to hide key-map items when using Blender with the key-map editor open.
Add a function to temporarily suppress key-map updates.
While not ideal, full support for temporary key-maps that behave
differently to user key-maps is a bigger project for something
that's only needed in one place.
[0]: 017d4912b26155cc01a09f382c3545eed5ce219d
[1]: 9a0eaa2062f2ebda1381f9ab42f161b1b0f587b2
- Add IDP_EnsureProperties,
- Remove create_if_needed argument from IDP_GetProperties.
Split access & creation so intention reads more clearly without
looking up function arguments.
* Add icon to "Reset Color Ramp" (same used by Reset to Default Value)
* Add icon to "Flip Color Ramp" (sideways arrows, similar to invert
vertex groups).
* Add separators after stops distribution operators, and before
reset since they have pretty different purposes.
This is a light weight solution to passing in some extra context into
a lazy-function that is invoked by the graph executor.
The new functionality is used by #112421.