The ruler code would add new (GP) ID and link it to current scene outside
of any depsgraph tagging and/or undo step writing.
Now always add this 'util' GP data earlier, in a context where there is a clear
undo step written. Also fixes the missing tagging and relations updates.
Pull Request: https://projects.blender.org/blender/blender/pulls/116751
This adds support for rendering the hardness curve attribute.
The attribute cannot be written from within GPv3, but is added when
converting from the legacy Grease Pencil type.
The struct `SpaceText_Runtime` already separates runtime data from
`SpaceText`, however it is still allocated inside `SpaceText`, read and
write file operations still copy this data, but is override on read.
This changes separate allocation of `SpaceText_Runtime` from
`SpaceText`.
Ref !115418
After undo, a depsgraph update could free run-time modifier data.
In the case of the subsurf modifier a reference to this is held
in the meshes run-time data which also needs to be cleared.
When the "before" state of the face set brush gets stored in an undo step
and there is no face set attribute yet, 0 was stored instead of 1. 0 currently
has special meaning and isn't the default white color.
Area for clicking on keys was wider than strip which caused problems.
Instead of finding best strip candidate and then a key, make clickable
area wider, but inside of the strip itself.
These UIs don't display previews, now need to load them.
Currently the UI code doesn't actually know which previews will be
visible, so it loads them all. This adds quite some memory overhead.
Likely fixes#115372.
Pull Request: https://projects.blender.org/blender/blender/pulls/116987
This fixes an issue where a CacheFile was always created for the USD
file, causing USD_create_handle() to be called unnecessarily even if the
USD does not have animating meshes or transforms.
This bug would sometimes result in the stage remaining open in a
CacheArchiveHandle after import (because the CacheFile is never
freed), preventing the USD from being reloaded from disk.
The cache file is now accessible to readers through an
ImportSettings::get_cache_file function wrapper which creates a
CacheFile as needed, the first time the function is called.
The allocated CacheFile pointer is now stored in a new
ImportJobData::cache_file member.
Pull Request: https://projects.blender.org/blender/blender/pulls/116242
This adds a Python API for layout panels that have been introduced in #113584.
Two new methods on `UILayout` are added:
* `.panel(idname, text="...", default_closed=False) -> Optional[UILayout]`
* `.panel_prop(owner, prop_name, text="...") -> Optional[UILayout]`
Both create a panel and return `None` if the panel is collapsed. The difference lies
in how the open-close-state is stored. The first method internally manages the
open-close-state based on the provided identifier. The second one allows for
providing a boolean property that stores whether the panel is open. This is useful
when creating a dynamic of panels and when it is difficult to create a unique idname.
For the `.panel(...)` method, a new internal map on `Panel` is created which keeps
track of all the panel states based on the idname. Currently, there is no mechanism
for freeing any elements once they have been added to the map. This is unlikely to
cause a problem anytime soon, but we might need some kind of garbage collection
in the future.
```python
import bpy
from bpy.props import BoolProperty
class LayoutDemoPanel(bpy.types.Panel):
bl_label = "Layout Panel Demo"
bl_idname = "SCENE_PT_layout_panel"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
def draw(self, context):
layout = self.layout
scene = context.scene
layout.label(text="Before")
if panel := layout.panel("my_panel_id", text="Hello World", default_closed=False):
panel.label(text="Success")
if panel := layout.panel_prop(scene, "show_demo_panel", text="My Panel"):
panel.prop(scene, "frame_start")
panel.prop(scene, "frame_end")
layout.label(text="After")
bpy.utils.register_class(LayoutDemoPanel)
bpy.types.Scene.show_demo_panel = BoolProperty(default=False)
```
Pull Request: https://projects.blender.org/blender/blender/pulls/116949
Caused bu 5af8b839cf.
This solution tags both mesh positions and normals for update when
drawing happens from the modifier stack evaluation result.
This is needed because the sculpt session modifies original mesh
positions, and the modifier stack is not guaranteed to modify them
further (and hence tag normals for update).
Pull Request: https://projects.blender.org/blender/blender/pulls/117033
The issue is caused by 087612c042 which changed type of
vpd->paintcol from byte to float. Some of the code was
expecting it to be byte, and did C-style cast to a pointer
of uchar.
This is a minimalistic fix, which makes it so the
paint_and_tex_color_alpha() operates on proper types and
avoids reading from the result color before overriding the
value.
Pull Request: https://projects.blender.org/blender/blender/pulls/117030
The bone collection unit tests in Python were failing, but this failure
was not propagated to `ctest` and thus went unnoticed.
Both issues are now fixed.
There is currently a bug with autopep8 and Python 3.12, resulting in
the contents of f-strings getting modified when they shouldn't.
As a workaround, "make format" now uses the Python binary bundled with
the precompiled libraries on Linux by default. This matches existing
behavior on macOS and Windows.
Pull Request: https://projects.blender.org/blender/blender/pulls/116993
This PR cleans up shader builder CMake files and fixes vulkan includes
that could not be found on all platforms.
* Reduce code duplication
* Use private var for MANIFEST on windows
* Add system includes when compiling
Pull Request: https://projects.blender.org/blender/blender/pulls/115889
When anisotropic filtering is enabled on a sampler its value must be
between 1 and 16. In blender it is possible to set a value lower than 1.
0 actually means that anisotropic filtering is disabled in Blender.
This would trigger a validation error in Vulkan.
Pull Request: https://projects.blender.org/blender/blender/pulls/117018
Starting with Blender 4.0, Blender refuses to load a userpref.blend file
that had been generated on a macoOS machine, exiting immediately with an
unsupported GPU error. This is because when the userdef was written on
the macOS machine (assuming a recent version), it has gpu_backend set to
GPU_BACKEND_METAL (which is rejected). The same is true in reverse.
Prior to commit cdb8a8929c there was a runtime fallback such
that the setting for Metal backend would be ignored on non-Metal
platforms.
This adds a check in blo_do_versions_userdef() for if gpu_backend is set
to an unsupported backend; if so, it is set to a default supported value
for the current platform (Metal on macOS, OpenGL otherwise). This
replaces the current versioning check, as this isn't strictly related to
versioning. The new logic handles the narrower versioning case (a macOS
user upgrading to 4.0+ with a userprefs selecting OpenGL) as well.
This should be future-proof for other GPU backends, as it only overrides
in the case of an unsupported value. The logic could be generalized in
the future, perhaps.
Co-authored-by: Andrew Oates <andrew@andrewoates.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/116861
Oversight in [0] which assumed the cage meshes vertices were aligned
with the edit-mesh vertices which isn't always the case.
Check the cage mesh only has deformations applied before using it.
[0]: 29a338811c
While the shortcuts would be shown for menus & panels,
there was no way to edit them from the context menu.
This was reported as a bug since moving "Undo History" from an operator
to a menu meant it was no longer possible to assign a shortcut from
the context menu.
Resolves: #97431.
Replaces this search by representing the 3 edge lengths of each triangle
as 3d points and searching with a KD-tree.
On a mesh with ~20k Tris the old method runs in 40s while the new method
takes 0.23s with a difference of <0.001%.
Ref !113720