* Replace G.quiet by CLG_quiet_set/get
* CLOG_INFO_NOCHECK prints are now suppressed when quiet, these were
typically inside a if (!G.quiet) conditional already.
* Change some prints for blend files, color management and rendering to
use CLOG, that were previously using if (!G.quiet) printf().
Pull Request: https://projects.blender.org/blender/blender/pulls/143138
Change default shape of Bubble and Foam, to be able to notice potential
artifacts in the Viewport. The shape for bubble was changed to circle, and
the shape for Foam was changed to cross.
It allows users to notice and fix artifacts in early stages for reports like:
#79995#81011#85533#97063
Pull Request: https://projects.blender.org/blender/blender/pulls/138681
This patch moves the rules that alias Image to Combined for pass names
to the context implementations. This is because this only makes sense
for contexts that deal with passes, while it wouldn't make much sense
for other possible contexts like VSE modifiers.
Pull Request: https://projects.blender.org/blender/blender/pulls/143419
All supported versions of Blender are capable of handling the Unicode
prim and property names now.
It's difficult to determine how much of the USD ecosystem is using
version 24.03 or greater so there is some risk of our files (when they
make use of Unicode names) not loading correctly for other DCC
applications.
Pull Request: https://projects.blender.org/blender/blender/pulls/142747
wm.progress displayed a percentage in a cryptic
2x2 grid of numbers, so:
```
75
23
```
Represents `75.23%`. This is now shown as `75.23%`
on systems that support RGBA cursors.
- Adding `/` to signatures to indicate that arguments are accepted only
as positional.
- Document default values and optional arguments in consistent way with
other docs.
- Use `Literal` for strings to indicate set of allowed string values
(later it can also be used in typing stubs).
- Document some undocumented arguments.
Ref !143278
The term "length" is too easily confused with the `strlen(..)`
length without the null byte. Most string functions that take a static
buffer size use the suffix `maxncpy` to avoid off by one errors.
When we first enabled FreeType font caching we purposely constrained it
so that we could see it was working, dropping and loading font faces
and sizes as needed. But that was years ago now and it is still running
with no more than 4 faces, 8 sizes, and only 400KB of cache. At minimum
we run with 3 simultaneous faces (main UI font and two copies of the
mono font), so allowing it 4 max seems pretty small. This PR changes
the max_faces to 8, sizes to 16, and the cache size to 1MB. Note that
these changes will give NO noticable user change, good or bad, under
normal circumstances. FreeType will churn a bit less, but the time
taken to do these things is very little.
Pull Request: https://projects.blender.org/blender/blender/pulls/143240
Use `BLI_strncpy_utf8` & `BLI_snprintf_utf8` for fixed size buffers in
DNA and screen data structures such as panels, menus & operators.
This could be considered a fix as copying a UTF8 string into a smaller
buffer without proper truncation can create an invalid UTF8 sequence.
However identifying which of these users are likely to run into would
be time consuming and not especially useful.
While this didn't cause errors, the resulting text was often used in
situations where UTF8 is expected (data-block names & UI labels).
Ensure names are UTF8 to avoid encoding related errors in the future.
When auto-naming based on axis, the string concatenation didn't take
UTF8 encoding into account, adding the suffix could create names
which raised an exception when accessed from Python.
Resolve using UTF8 string truncation.
Also resolve a logical error reading past the buffer bounds if the name
passed in was longer than MAXBONENAME.
- Order class variables before functions
- Use this-> to access non-private members
- Remove unnecessary BKE prefix
- Remove useless comments
- Use standard "uv_map" name for variable
- Use consistent order for mesh span variables
- Use C++ vector types instead of raw pointers
- Use Span instead of raw pointers
- Pass Span-like variables by value
The RNA `Mesh.calc_tangents()` function used a mesh tangents API wrapper
function that existed at a different abstraction level than the other
functions. That wrapper was only used in this single place, so just
inline its logic into the RNA code. Also give the base tangents API
function a name that makes its limitations clear.
Caused by b19696c0b8.
I misunderstood the meaning of the vertex buffer allocation size.
Even though the attributes aren't interleaved, the fact that there
are multiple attributes is still included in the "element size" that's
multiplied with the size argument to `GPU_vertbuf_data_alloc`.
Also switch to spans and indices rather than incrementing raw pointers,
which would have made this much faster to debug.
Make sure `mask_size` is calculated correctly in
`UI_view2d_view_to_region_rcti_clip` since the rcti is inclusive and the
size functions do not take this into consideration. This function is
only used from NLA and VSE drawing code.
It allows to implement tricks based on a knowledge whether the path
ever cam through a portal or not, and even something more advanced
based on the number of portals.
The main current objective is for strokes shading: stroke shader
uses Ray Portal BSDF to place ray to the center of the stroke and
point it in the direction of the surface it is generated for. This
gives stroke a single color which matches shading of the original
object. For this usecase to work the ray bounced from the original
surface should ignore the strokes, which is now possible by using
Portal Depth input and mixing with the Transparent BSDF. It also
helps to make shading look better when there are multiple stroke
layers.
A solution of using portal depth is chosen over a single flag due
to various factors:
- Last time we've looked into it it was a bit tricky to implement
as a flag due to us running out of bits.
- It feels to be more flexible solution, even though it is a bit
hard to come up with 100% compelling setup for it.
- It needs to be slightly different from the current "Is Foo"
flags, and be more "Is Portal Descendant" or something.
An extra uint16 is added to the state to count the portal depth,
but it is only allocated for scenes that use Ray Portal BSDF.
Portal BSDF still increments Transparent bounce, as it is required
to have some "limiting" factor so that ray does not get infinitely
move to different place of the scene.
Ref #125213
Pull Request: https://projects.blender.org/blender/blender/pulls/143107
In the video below you will see how VSE labels can jiggle vertically
while the area is resized. This is caused by the incorrect calculation
of rect height in UI_view2d_view_to_region_y. Our BLI_rcti_size_y does
not return the correct size, but max-min, which one unit too small for
our inclusive integer rects like v2d->mask or region->winrct. This PR
corrects the calculation in UI_view2d_region_to_view_y, and also in
UI_view2d_region_to_view_x because these are so similar.
Pull Request: https://projects.blender.org/blender/blender/pulls/143095
Caused by 29b90af679
When deleting the first/basis shape key, all successive keys are
deleted. `shapenr` remains 1 during entire iteration and `BLI_findindex`
returns 1 for every keyblock as first element is deleted. This
eventually clears the entire list. To fix this, change `shapenr` value to 0
when deleting the first element.
Pull Request: https://projects.blender.org/blender/blender/pulls/142946
Assert when overlapping keys are removed. This is due to drawing count
mismatch, more specifically when drawing is not removed/overwritten but
early check validation caused it. Remove `validate_drawing_user_counts`
from `remove_drawings_with_no_users`. If Drawing is actually removed
(`drawings_to_remove` non empty), validation function will be called at
the end.
Pull Request: https://projects.blender.org/blender/blender/pulls/143057
Instead of zeroing out a C++ wrapper for a DNA struct, zero out just the
DNA struct itself.
The C++ wrapper adds no extra fields, and also no virtual functions, so
the old code was already safe. Now it's also semantically correct :)
No functional changes.
Reviewed by Omar, by locally applying my diff.
Pull Request: https://projects.blender.org/blender/blender/pulls/143184