The benefits are O(1) access to the string size, clearer ownership,
and easily accessible utility functions. For now, only change functions
where the string is clearly non-null. It's not clear in what cases some
other functions recieve null strings.
* Add documentation / comments
* Apply const where possible to cache_init function codepath
* Minor cleanup of conditionals and initialization
Contains changes that were deferred from #117316
Pull Request: https://projects.blender.org/blender/blender/pulls/117651
- Remove unnecessary use of "shelf" namespace inside that namespace
- Remove unused function declaration
- Don't bother passing a pointer to a pointer to the region data,
that didn't accomplish anything and added unnecessary complexity
Use an optional string instead of a manually allocated char pointer.
Optional is used because sometimes `nullptr` was returned. It's
still inconsistent though, because often "" or ".." was returned
instead.
This was caused by global variable `sound_cfra` not being updated when
rendering sequencer data. This global variable could cause problems in
other cases though, so it is removed. Functions that are used to set
anomation buffers now accept frame as argument.
Pull Request: https://projects.blender.org/blender/blender/pulls/117345
Adds vertex groups and basic operator support to the `GreasePencil` data
block.
Vertex groups in the `GreasePencil` ID are used as the source of truth
for vertex groups names and ordering in the UI. Individual drawings also
have vertex group lists, but they should not be modified directly by
users or the API. The main purpose of storing vertex group names in in a
drawing's `CurveGeometry` is to make it self-contained, so that vertex
weights can be associated with names without requiring the
`GreasePencil` parent data.
Vertex group operators are implemented generically for some ID types.
Grease Pencil needs its own handling in these operators. After
manipulating `vertex_group_names` the `validate_drawing_vertex_groups`
utility function should be called to ensure that drawings only contain a
true subset of the `GreasePencil` data block.
Operators for assigning/removing/selecting/deselecting vertices are also
implemented here. To avoid putting grease pencil logic into the generic
`object_deform.cc` file a number of utility functions have been added in
`BKE_grease_pencil_vgroup.hh`.
Fixes#117337
Pull Request: https://projects.blender.org/blender/blender/pulls/117476
Remove transparency weight from other closure weights.
Since closure weights take transparency into account,
scaling closure colors by their weight applies alpha pre-multiplication to them,
causing dithered transparency materials to be darker than they should be.
Pull Request: https://projects.blender.org/blender/blender/pulls/117675
This change makes it so the OIDN is listening to the node execution
being cancelled, allowing for a more instant user feedback on the
compositor graph changes. It is especially visible when dealing with
4k images, and using pre-filter on the guiding passes.
Similar implementation to what Cycles does.
This change covers tiles and full-frame compositors.
The GPU compositor needs extra work to have this supported.
Pull Request: https://projects.blender.org/blender/blender/pulls/117698
This significantly simplifies memory management, mostly by avoiding
the need to free the memory manually. It may also improve performance,
since std::string has an inline buffer that can prevent heap
allocations and it stores the size.
Pull Request: https://projects.blender.org/blender/blender/pulls/117695
Some modifiers were still using `BKE_panel_layout_panel_state_ensure` to
create open/close flag properties at runtime. Should register a RNA
property using `rna_def_modifier_panel_open_prop` instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/117697
Caused by 90c4e2e6ec.
We are now getting the enum item via
`RNA_property_enum_item_from_value_gettexted` (as opposed to
`RNA_property_enum_items_gettexted` prior to 90c4e2e6ec).
The former does not translate the description (whereas the later does)
which I think is just an oversight.
To resolve, now add description translation to
`RNA_property_enum_item_from_value_gettexted`.
Pull Request: https://projects.blender.org/blender/blender/pulls/117693
This can potentially lead to a small speedup when the inline buffer
is very large (we don't use that anywhere), but more importantly
also quiets a wrong gcc `-Warray-bounds` warning.
This is an optional parameter for int properties, which then show up as
enum properties.
Included fix: reset ID properties' enum items when the `items` parameter is `None`.
Example usage:
```python
import rna_prop_ui
# Add a regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=123, min=-3, max=500)
# Change to an enum property with items (min/max are ignored).
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=0, min=-10, max=10, items=[("APPLES", "Apples", ""), ("ORANGES", "Oranges", "")])
# Switch back to regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=1, min=0, max=10)
```
Pull Request: https://projects.blender.org/blender/blender/pulls/117289
This avoid the following error
`Unknown NIR alu instr: div 32 %17 = ineg %16`
This is a debug shader so cost isn't important.
A bug report will be done upstream.
When auto-save is slow it can be very intrusive because it freezes Blender at
unexpected times. Often people have a habit of saving frequently anyway, even
more often than auto-save would. In this case it seems unnecessary to auto-save
as well.
This patch restarts the auto-save timer when the user is saving manually to avoid
the unexpected freeze in many cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/117690
The output of the Color Ramp node in the GPU compositor and EEVEE is
slightly off. That's because the factor is evaluated directly at the
sampler without proper half pixel offsets to account for the sampler's
linear interpolation, which this patch adds.
Pull Request: https://projects.blender.org/blender/blender/pulls/117677