Incorporated the cleanup and tweaks from Hans Goudey to return CurvesGeometry directly.
Part of #113602.
Co-authored-by: Hans Goudey <hans@blender.org>
Ref !113721
When clicking or dragging a Panel's drag handle, a PANEL_STATE_DRAG
state transition is followed immediately by a PANEL_STATE_ANIMATE
transition. Both transitions start a timer.
Unfortunately, a subtle change introduced in
f3ab698951 meant the first timer would no
longer be destroyed before starting the second one.
The fix is to just reuse the timer if it's already present so that a
second one is not created in the first place.
Pull Request: #113711
When fractional scaling was used with libdecor the window decorations
would not match the window size on startup, drawing small and on top
of Blender's window.
While there are still glitches with fractional-scaling & libdecor
(which doesn't support fractional scaling),
see #109194 this at least resolves one of the worst issues.
When a new window is created the final buffer scale isn't known
so setting the buffer scale assuming the final state was just a guess
and only had the minor advantage of preventing rounding the window size
on startup.
Removing this to resolve a bug with LIBDECOR & fractional scaling
relating to #109194 (will commit separately).
After the recent introduction of node panels, the utility that
allowed scripters to connect sockets to or from a virtual socket was
broken. This happens when creating an interface before connecting
sockets. Sockets can have a subtype, while interfaces cannot.
For instance, the `NodeSocketFloatFactor` type cannot be used
directly, it has to be converted to `NodeSocketFloat`.
This commit chooses an appropriate type for the new interface before
creating it, based on the socket's `type` property.
Pull Request: #113630
This helps solving the problem encountered in #113553. The problem is that we
currently can't support link-drag-search for nodes which have a dynamic declaration.
With this patch, there is only a single `declare` function per node type, instead of
the separate `declare` and `declare_dynamic` functions. The new `declare` function
has access to the node and tree. However, both are allowed to be null. The final
node declaration has a flag for whether it depends on the node context or not.
Nodes that previously had a dynamic declaration should now create as much of
the declaration as possible that does not depend on the node. This allows code
like for link-drag-search to take those sockets into account even if the other
sockets are dynamic.
For node declarations that have dynamic types (e.g. Switch node), we can also
add extra information to the static node declaration, like the identifier of the socket
with the dynamic type. This is not part of this patch though.
I can think of two main alternatives to the approach implemented here:
* Define two separate functions for dynamic nodes. One that creates the "static
declaration" without node context, and on that creates the actual declaration with
node context.
* Have a single declare function that generates "build instructions" for the actual
node declaration. So instead of building the final declaration directly, one can for
example add a socket whose type depends on a specific rna path in the node.
The actual node declaration is then automatically generated based on the build
instructions. This becomes quite a bit more tricky with dynamic amounts of sockets
and introduces another indirection between declarations and what sockets the node
actually has.
I found the approach implemented in this patch to lead to the least amount of
boilerplate (doesn't require a seperate "build instructions" data structure) and code
duplication (socket properties are still only defined in one place). At the same time,
it offers more flexibility to how nodes can be dynamic.
Pull Request: #113742
The menu structure currently needs to be duplicated in the code to avoid
adding assets to more than one menu. This was done for geometry nodes
in b49c84276c but was missed for the compositor and shader
nodes. Also remove an unnecessary separator.
With #113707 text cursor position is set using the character's visible
bounds, so special care is needed for those without bounds like space.
Forgot this also applies to 4.0.
With #113707 text cursor position is set using the character's visible
bounds, so special care is needed for those without bounds like space.
Pull Request: #113749
For regular UI text entry, place the text caret exactly between
adjacent glyph bounds instead of just using partial text length to
position it.
Pull Request: #113707
`attributes_to_propagate` is map of all attributes to propagate from different
components. For attribute propagation three different components is taken.
Each one can have named attribute with specific type. Current implementation
of propagation: Try to make implicit share attribute. Or create/copy.
This doesn't takes into account `attributes_to_propagate`' data type info.
So, this cause crash for case, there multiple component have same name attribute
with different type.
Fix: Try to make implicit share attribute with correct type. Or create, copy typed version.
Pull Request: #110146
Fix papercuts with the info panel:
1. Make the panel extend behind hidden nodes
2. Don't let it become smaller than the node itself, when resizing
Pull Request: #113411
Only expand image sequences when a single file is passed in.
This allows shell globing to expand images without expanding each.
Prepare for support multiple file drag & drop where it also doesn't
make sense to expand sequences when dropping multiple files.
When loading a font, gather metrics and other information that can help
use it more correctly. Default weight and slant, X-height, cap height,
locations for underline, strike-through, subscripts, etc. Family and
style flags, etc.
Pull Request: #113432
BLF_width_to_strlen measures text with reduced accuracy with Hinting or
subpixel anti-aliasing enabled. blf_font_width_to_strlen_glyph_process
does not take into account these changes when iterating through glyphs.
Pull Request: #113698
Previously the first group of deform modifiers didn't need to access
original coordinates explicitly because the deformation wasn't included
in the mesh positions. After d20f992322 the mesh is deformed
directly though, so the original coordinates need to be added first.
In the case of this report, the particle system (which is a "deform"
modifier for reasons) didn't have original coordinates to work with, so
it created the child particles at the deformed positions from the shape
keys every time. Though for some reason it only did that for renders.
Pull Request: #113679
If an asset library was pointing to the same path as the current file is saved
in, the assets from this library wouldn't be loaded. This is because the asset
library service assumed the absolute library root path is a way to uniquely
identify an asset library.
Instead, identify the asset library using both the root path and the library
type.
This speeds up saving the following production file by about 10%:
`240ms -> 220ms`
`heist/pro/shots/060_fight/060_0080/060_0080.anim.blend`
This is a fairly low hanging fruit. Ideally we wouldn't have to duplicate
the string at all, but changing that is a larger undertaking.
Replaces all usage by the the gpu_shader_math
equivalent. This is because the old shader
library was quite tangled.
This avoids dependency hell trying to
mix libraries.
Changes are split into isolated commits until
I had to do mass changes because of inter-
dependencies.
Pull Request: #113631