This was because the display shader never did the correct
color transformation.
This is a risky fix as it expects all input texture to be in
the correct colorspace (srgb). If they aren't this will
produce darker result.
If this is a huge issue we can introduce a global setting
(like line width) to set if the attached texture is
in srgb space or linear. This would avoid to change the
drawing code all over the place.
Pull Request: https://projects.blender.org/blender/blender/pulls/141237
The outline perimeter generation was exiting without result for any
curve with less than two points. For single-point curve a simple circle
is now generated with the same resolution as two caps/corners combined.
Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141380
Add three new RNA functions to `bpy.types.CollectionExports`:
- `collection.exporters.new('IO_FH_alembic', name="Alembic")`
- `collection.exporters.remove(exporter)`
- `collection.exporters.move(0, 1)`
which allow to respectively create, remove, and reorder collection
exporters. Previously, they were only achievable using operators and
not the Python data API.
Example usage:
```python
C.collection.exporters.new("test")
# Traceback (most recent call last):
# File "<blender_console>", line 1, in <module>
# TypeError: CollectionExports.new(): error with argument 1, "type" -
# enum "test" not found in ('IO_FH_alembic', 'IO_FH_usd',
# 'IO_FH_obj', 'IO_FH_ply', 'IO_FH_stl', 'IO_FH_fbx')
usd_exporter = C.collection.exporters.new('IO_FH_usd')
usd_exporter.filepath = "//exp.usd"
stl_exporter = C.collection.exporters.new('IO_FH_stl')
C.collection.exporters.move(0, 1)
C.collection.exporters.remove(stl_exporter)
```
The exporter UIList was updated to add arrows calling the move
operator.
Co-authored-by: Pratik Borhade <pratikborhade302@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141076
Drag-drop operation of outliner doesn't allow dragging linked collection
ID. Poll function returns false for non-editable IDs. This make
sense if drop target is `INTO` linked collection.To fix this, support
drag-drop operation for `before/after` case and return false when
insert type is `TE_INSERT_INTO`.
Pull Request: https://projects.blender.org/blender/blender/pulls/140848
Add a new CLI option `--date YYYY-MM-DD` to the weekly log generator. Using
it will make it ignore the `--weeks-ago` parameter, and just show the
activity for that specific day.
This is just something I personally found useful, to occasionally inspect
a specific date (WBSO daily log).
Pull Request: https://projects.blender.org/blender/blender/pulls/141281
- `bpy_struct.id_data` - provide a type.
- `bpy_struct` - add missing return types to
`bpy_struct.get`, `bpy_struct.pop`, `bpy_struct.path_resolve`.
- `bpy_struct` - add missing argument types to some methods.
- `bpy_struct` - provide explicit `/` and `*` in signatures to make it
clear which arguments are positional / keyword-only.
Ref !141334
Allows to use regular constructor/destructors. And standard CPP data
like string, maps, etc.
Main is defined as non-movable and non-copyable for the time being.
The existing creating/deleting API is kept as-is, moving to direct
MEM_new/MEM_delete usages in the code is kept as a later cleanup commit.
The 'ListBase' of split-by-libraries Mains has been replaced by a VectorSet.
This is an unfortunate consequence of making Main a non-trivial C++
struct: it is no more guaranteed that next/prev pointers required for
ListBase remain immediately at the top of the struct anymore - and on
Windows they indeed don't.
So move to a more modern form of storage for split-by-libraries mains,
with a few other related changes to internal readfile code.
WARNING: This is quite a sensitive change, extensively tested locally
(including library-related changes across undos and redos, in complex
production scenes).
Pull Request: https://projects.blender.org/blender/blender/pulls/141086
When dropping an extension onto Blender, the URL lookup would print
errors to the STDOUT if a repository directory was missing.
While this didn't break installation, these kinds of errors should
only be shown when the directory is expected to exist.
The issue was raised in #141212.
The base URL was used when reporting errors accessing a URL,
use the full URL being accessed instead since anything else
is misleading, the full URL is needed to troubleshoot issues.
When playing back render result a separate process is started for
playback. This process didn't call the GPU_context_frame_begin/end
functions resulting in post-poning destroying discarded resources until
the playback process was 'exited'.
Pull Request: https://projects.blender.org/blender/blender/pulls/141376
Previously, if a socket inside a panel has the same name prefix as the
panel name, the panel name will be removed from socket names when
displayed inside nodes, but this is not done when displaying them on the
modifier interface, which is too verbose visually. Now panel names are
removed from these property labels as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/140448
Check the polybuild gizmo is drawn before using it,
also account for it being empty (the cause of the crash), although this
shouldn't happen in practice.
Use `N_` for default labels in case value is invalid.
So no double translation.
Synchronize translation context with related property if exist.
So enum item translated like property with such enum.
Use nodes context for zone labels.
Pull Request: https://projects.blender.org/blender/blender/pulls/138393
Avoid overly long paths in the title bar using the `~` prefix.
Based on feedback from !141059 there is consensus on supporting this
on Linux, that PR also supports abbreviations on other systems but
platform maintainers had concerns (see PR for details).
Apply the functionality for generic Linux/Unix systems,
the functionality for other platforms can be evaluated separately.
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.
----
This is how the message looks like now:
<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">
Pull Request: https://projects.blender.org/blender/blender/pulls/140847
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.
----
This is how the message looks like now:
<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">
Pull Request: https://projects.blender.org/blender/blender/pulls/140847
This commit brings multi-monitor window positioning support to the macOS
GHOST backend. This fixes a plethora of issues with macOS window
creation and positioning, such as:
* Windows not being properly restored when loading a file with Load UI
* Users default startup windows not being properly restored on multiple
screens
* Temporary windows (Settings, Render, Playblast, etc..) wrongly
appearing in unexpected places / other screens
* Duplicating an area into a new window (AKA popping out an editor) not
working on non-primary screens.
* etc..
Internally, this makes all macOS windows coordinates be relative to the
user primary monitor, instead of being local to the currently focused
one. I have tested this to properly work using all sorts of multiple
screen arrangements, and can also confirm that restoring windows from
screens that do not exist anymore / are now out of bounds (due to being
unplugged or re-arranged) also works properly, in which case they get
snapped back to the closest available screen similarly to other backends.
This fixes issue #126410 and implements behavior described in TODO task #69819.
Pull Request: https://projects.blender.org/blender/blender/pulls/141159
Almost all uiLayout methods that creates sub-layouts returns a uiLayout
reference, API users must use the returned sub-layout to add items,
this prevents a accidental copy that could break Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/141051
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141349
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141349
The `CurvesGeometry::resize` function would not work properly when
passing a new size of zero.
1) The `CustomData_realloc` would allocate an array with zero size.
2) A new size of 1 is passed to `implicit_sharing::resize_trivial_array`
for the curve offsets when it should pass 0.
3) A value is written out-of-bounds to `curve_offsets`
This fixes the issues in the following ways:
1) `CustomData_realloc` now doesn't allocate any data when the new
size is 0 and sets the `layer->data` to `nullptr`.
2) When the new number of curves is 0, resize the `curve_offsets` to 0
not to 1. This also ensures that the data pointer is `nullptr`.
3) Make sure to only write the first and last curve offset when the
number of curves is greater than 0.
Pull Request: https://projects.blender.org/blender/blender/pulls/141333