Rewrite of Scale Elements. Main changes related with removing unnecessary
abstractions (like structures of fields). Next, by using grouping approach,
all data is represented as spans. This provide ability to unify code for
different domains. Using of general utils like IndexMask, Group processing
and array utils provides much more parallelism and better memory usage.
In result, this refactoring result in 4-10 average speed improvement in
attached benchmark file with different probability and scale of elements.
See the PR for more before/after timing information and a benchmark file.
Pull Request: https://projects.blender.org/blender/blender/pulls/115142
For our built-in fonts (in our stack) we specify the Unicode page
coverage that they support, to avoid loading fonts unnecessarily to see
if they have a particular character. This way we skip over fonts to
get to symbols, etc. With our CJK (Chinese, Japanese, Korean) font
though we are using the supplied coverage bit values, which includes
more than we want. We only want to load this font for CJK-related pages
to ensure that we use more tailored fonts for other specific languages
and uses later in the font stack.
Pull Request: https://projects.blender.org/blender/blender/pulls/120676
Fall back to CPU subdivision when there are split edges and the mesh
normals domain is face corners. This is required because splitting the
normals on faces adjacent to sharp edges doesn't work well with the
performance requirements of GPU subdivision.
This is related to 1111903416
Pull Request: https://projects.blender.org/blender/blender/pulls/120674
When we iterate through glyph bounding boxes, we should ignore
combining characters, those without an advance. These types of
characters are placed over top of others, like for diacritical marks.
We never have a need to consider these, only for the parent glyph.
Otherwise mouse insertion of text cursor can occur at the wrong
location, at the edge of a diacritical mark.
Pull Request: https://projects.blender.org/blender/blender/pulls/120675
BLF function blf_str_offset_from_cursor_position returns the character
offset in a string given a horizontal cursor position. It currently has
no early exits, but can do so for no string or empty string. For negative
position values (so left of the string), do not exit out with zero but
instead act as if it were zero to ensure we test against the first glyph,
which might not be part of the character.
Pull Request: https://projects.blender.org/blender/blender/pulls/120673
The issue was that `OVERLAY_sculpt_curves_cache_populate` assumes
that the object is a curves object, which was not always the case. Now this
is checked a bit more explicitly.
The solution is still not ideal, because now the cage overlay is not shown
at all when the viewer node is used and the result is something else than
curves, but that needs to be solved separately.
- "Log Encoding with Chroma inset and rotation": add "of primaries" in
the description of the AgX Log color space to better explain the
operation, based on wording in !106355.
- Remove a few double spaces.
- Make Line Art title case everywhere, to convey it's the system /
brand / product name and not the generic concept.
- "Copy Absolute coordinates or Normal vector" -> "of Normal Vector":
typo.
- "Makes a link between selected output in input sockets" ->
"Make...", "output and input": typo.
- "Purge Unused Data From This File" -> "from this": title case as per
HIGs.
- GPencil -> Grease Pencil: no reason to use an abbreviation here.
- "Around Current Frame" -> "Around Frame": actual name of the
onion-skinning method.
- "... (layer height for layer tool, i.e.)" -> "(i.e. the layer height
for the layer tool)": put "i.e." at the start of the sentence.
- Expand description of toe-in stereo camera option.
- "Children collections their parent-collection-specific settings" ->
"Children collections with their...": typo.
- "Generate vertex weights base on..." -> "based on" : typo, lower
case.
- Expand description of GP modifier properties, based on their mesh
counterparts.
- "AEnvelope" -> "Envelope": typo.
- "Falloff type the feather" -> "of the feather": typo.
- "usually make transition as long as effect strip": rephrase.
- "When disabled a users extensions directory is created" -> "a
user's": typo.
- "successfull" -> "successful": typo.
- "Remove all attributes... a single wildcard (*).": remove trailing
".".
- "..., use "Save Preferences."": remove trailing ".".
Some issues reported by Marina Veselkova and Tamar Mebonia.
Pull Request: https://projects.blender.org/blender/blender/pulls/120649
Code was assuming that if an object had a Scene parent ID (in Outliner
context), Outliner was in Scene view and object had to be removed from
whole scene.
However, in ViewLayer view, in case an object is in a Scene's main
collection, its parent item is the scene.
Move into own BLF function, code that returns a text cursor (caret)
position given a string offset. This code is currently just in
interface_widgets.cc but should be a separate BLF function.
Pull Request: https://projects.blender.org/blender/blender/pulls/120622
The case when the tree-path of a node editor is out of date is handled more
gracefully now. Generally, one should also look into eagerly updating the
tree-path in this case, but that can be done separately.
Previously, this conversion would often result in invalid quaternions or
hit an assert in `normalized_to_quat_fast`. It's not super nice to convert
to euler as an intermediate step performance wise, but it seems to be
the easiest solution for now. Extracting rotations from matrices should
not be done all that often anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/120568
Commit 8b9743eb40 already made Blender be compiled with SSE4.2 flags
on x64 architecture, which kicked in the SSE4 code paths in
BLI_math_interp functions.
Which made them faster, e.g. in VSE on Windows/Ryzen5950X, scaling
up an image to 4K resolution:
- Bilinear 5.8ms -> 5.3ms
- Cubic Mitchell 16.3ms -> 15.7ms
This change removes the now-unneeded SSE pre-SSE4 code paths for
_mm_floor_ps, _mm_min_epi32 and _mm_max_epi32 emulation.
Additionally, including BLI_simd.h on SSE4 platform now includes
the necessary SSE4 intrinsics header.
Pull Request: https://projects.blender.org/blender/blender/pulls/120583
When a liquid is created together with collision/effector with default
settings, it often happens that the liquid is leaking through the solid
object/effector.
Change the CFL default value to decrease the chance of this happening.
There appears to be no noticeable performance impact in common cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/120355
This contains two thing:
- default (nothing connected to socket) uses the bounding box min axis.
- transform the value plugged to the socket to world space.
We arbitrarly choose to output the axis with the minimum extent since
it is the axis along which the object is usually viewed at.
Rel #120384
Pull Request: https://projects.blender.org/blender/blender/pulls/120607
Extract
- Statuses for the external text editor
- Newly created enum node item
- Newly created plane track data
- Newly created custom orientation data
- Operator names in drag and drop menu (need to use operator's
translation context)
- GN attribute statistic node inputs
Disambiguate
- Single-letter colors: A and B can mean Alpha and Blue, or simply A
and B as in two operands in an operation
- Dissolve: issue reported by Tamar Mebonia in #43295
- Translate in the User Preferences. This introduces a new
BLT_I18NCONTEXT_EDITOR_PREFERENCES ("Preferences") translation
context
- Planar (reported by deathblood)
This one is incomplete, because there is currently no way to
disambiguate presets or GN fields. I don't see how either could be
achieved cleanly.
The former would need to define the context inside the preset and
evaluate the file prior to showing it in the presets menu, which
sound bad.
The latter would need to introduce an additional string inside
`FieldInput`s, which would be controversial given how little it
would be used.
Remove
- Unused translation `iface_("%s")` in toolbar
- Remove obsolete N_() tags in a few node descriptions.
Pull Request: https://projects.blender.org/blender/blender/pulls/119065
Add an optional keyword argument `keytype` to the
`rna_struct.keyframe_insert()` function.
This makes it possible to set the new key's type. The code for this was
almost all in place, the only thing that was missing was the RNA
wrapper, which is what this commit adds.
Example: `bpy.context.object.keyframe_insert("location",
keytype='JITTER')`
There is no backward compatibility issue here, because the argument is
optional and defaults to the previously hardcoded value of `KEYFRAME`.
Pull Request: https://projects.blender.org/blender/blender/pulls/120578
Add a new keyframe type named 'generated', which is meant to indicate
that the key was set by some automated tool (like an add-on), rather
than manually by an animator.
This is meant for tooling that needs to create keys in a repeatable way.
With this new key type, the tool can know which keys it generated
before, and thus those can be removed and re-generated.
Pull Request: https://projects.blender.org/blender/blender/pulls/120564
When creating a filename for use with a File Handler, we should guard
against problematic characters like "/" and "\\", among others, which are
not safe to use in paths. Sanitize the incoming name with
`BLI_path_make_safe_filename` to ensure the name can be used.
For empty incoming names, or names containing all spaces, we default to
"untitled" before adding the extension.
Pull Request: https://projects.blender.org/blender/blender/pulls/120652
To ease the process of debugging a node group while creating
a node tool, while the group is visible in a node editor, log the socket
values from its last execution. The values are only logged for the
active object is nothing selected. The Viewer node is still not supported
because visualization would probably be very tricky.
Pull Request: https://projects.blender.org/blender/blender/pulls/120596
The problem was that `XXH3_128bits` was called on `len` bytes
and not `HashSizeInBytes + len` as before 51f8bf53b2.
This lead to more compute context duplicates that one would expect.
I changed the code a little bit to make this mistake less likely in case
the hash function is ever changed to something else.
Scrolling the mouse wheel fast can generate multiple click-steps
which were ignored by window manager events.
This meant scrolling fast with a trackpad (with "Multi-touch gestures"
disabled) for e.g. would zoom less than the gesture made more slowly.
Adjust Last Operation dialog gets a title with a line underneath and
slight change to margins to better match other similar dialogs. A
change agreed to in our last UI meeting.
Pull Request: https://projects.blender.org/blender/blender/pulls/120625
Regular topology mapping does not care about deduplication of relations. And
this is correct for a lot of the case where we expect creating difference of this
relations in next operations. But this is not the case for users, since this should
be actually trivial info. Due to this reason, construct full topology map and count
number of unique connections. Performance side: difference linear check and
hash set for different sizes of connections set.
Pull Request: https://projects.blender.org/blender/blender/pulls/118848
This commit ensures that no legacy GP data is shared between GP objects
and annotations, before doing the conversion, by duplicating annotation
data when required.
Conversion code can then completely ignore annotation GPv2 IDs.
Pull Request: https://projects.blender.org/blender/blender/pulls/120581
Now that there is a condition in the loop count there is
possibility the compiler doesn't optimize this. Be
conservative an manually unroll for better codegen.
This fixes a few issues:
- Split of shadows in different direction caused by
the shadow normal bias.
- Fixes#120599 by reverting to light vector to
bias the shadow test.
Cleanup now unused variables.
For socket value logging this needs to be used in a couple other places.
Also remove the operator name argument. For the forseable future this
will only be used with the existing node tools operator anyway.
This add support for the thickness output in a consistent
manner across all BSDF.
If thickness is above zero, for any ray going below the
surface, the object is modeled as a sphere tangent to
the shading point and of diameter equal to the given
thickness. The ray is then intersected with that sphere
and transmitted out.
This model perfectly matches a raytracer behavior
for a sphere model of diameter equal to thickness.
This replaces the old refraction depth model which was
modelling a infinite slab of material.
For simplicity, we do not do 2 microfacet transmission
events. We simply use the main lobe direction for the
first interface. This still matches the raytracer
behavior for smooth surfaces. Weirdly enough the
apparent roughness doesn't need to be amended.
To get shadowing and translucency approximation
to work, this splits the transmission BSDF evaluation
to its own light loop. This simplifies a lot of logic
and assumes only one transmission BSDF is ever
sampled in a nodetree.
This changes the behavior of the thickness output
with regard to the thickness from shadow. We now take
the min instead of the max between both. This
break a lot of file since the default thickness is
set to `0.1`.
This patch doesn't change the default thickness output
behavior but it will be changed in another PR.
Note this might change the shadow sampling pattern
since translucent and non-translucent are now
sampling them separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/120329
Support the new Curves object type in Alembic when exporting curve data.
Make corresponding fixes to importing at the same time.
Summary of changes
- Exporter now supports the `Curves` object type during Export
including when using the convert to mesh option
- Exporter will now enforce that only 1 combination of curve type and
periodicity are in a given object [0].
- Catmul-rom basis curves are now supported and will be used for Hair
data [1].
- Bezier curves are exported with their left/right handle data [2].
- Cyclic bezier and nurbs curves should be handled correctly now.
Along the way this required changes on the Import side as well in order
to be complete
- Importer will now load bezier curve handle data correctly
- Importer could fail to set the correct cyclic data on the last spline
of a multi-curve object
See PR for screenshots
[0] See https://github.com/alembic/alembic/blob/master/lib/Alembic/AbcGeom/OCurves.h#L55
Prior to this change the Alembic exporter could write invalid data to
the file in these cases.
[1] Alembics created with the new Curves Hair object with this patch
will not be loadable in prior versions of Blender. The importer does not
handle the curve data correctly and will crash.
[2] There was a long-standing TODO about how to handle bezier curve data
since nothing is documented on Alembic's side. Bezier data wouldn't even
round-trip properly inside Blender itself. On a hunch, because USD was
influenced by certain aspects of Alembic which came before it, I decided
to try writing out the data the same way as USD. That turned out to work
quite well in at least 1 external software so that's what this patch
will use for both import and export.
Pull Request: https://projects.blender.org/blender/blender/pulls/119894
Error in 0f46e02310
The maximum index in the triangles index buffer was set incorrectly,
causing the GPU code to switch to using 16 bit integers when it shouldn't.