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.
The existing name was not clear. Renamed it to: "Clean Files After
Install".
I changed the RNA boolean to be positive, to match the name change.
Note: This only changes the UI label and tooltip.
TODOs to be tackled separately:
* Rename the RNA property to match its UI name.
* Make it True by default.
* Doversion.
Designed with Pablo Vazquez.
Part of #120589.
There were multiple reports with objects having many empty material
slots.
The underlying reason for this is the behavior of adding/assigning
materials [which makes room in the form of empty material slots based on
the current `active_material_index` -- which atm. can be set to
arbitrary values]. So just e.g. setting this to 100 in a fresh file and
assigning a material would create 99 empty slots.
To resolve, now clamp to the existing number of material slots.
NOTE: there is already a range function defined, but this actually only
kicks in from the animation system (so clamping would take place there),
so clamping is expected to happen in the set functions (there is also a
related comment in `RNA_property_int_set`)
Pull Request: https://projects.blender.org/blender/blender/pulls/120434
The problem happens because, on some OSs, `wm->winactive` is `nullptr`.
Another problem is that `wm->winactive->eventstate` sometimes does not
update when the mouse moves. This happens in some OSs when the cursor
is not over the active window. So the snap cursor state doesn't update.
The solution is to use the `eventstate` of the window in the context
(`CTX_wm_window(C)->eventstate`).
This matches other parts where `eventstate` is used.
Pull Request: https://projects.blender.org/blender/blender/pulls/120475
This PR adds an option to specify custom colors for a
motion path. One for frames before the current frame
and one frame for after. With this it is easier to see
the relation of the motion path to the current frame.
That was already the case with the default colors, but
not with custom colors.
On a technical side note, the colors pre and post the current
frame were already different.
The shader multiplied the custom color by 0.25
for anything pre current frame.
Pull Request: https://projects.blender.org/blender/blender/pulls/119375
In the case that "Custom Properties" was enabled in the user preferences,
the keyframing code would key all custom properties, regardless of that
property's type.
This can cause issues since it is keying e.g. the custom property that
cycles adds.
With this PR this is now limited to only Boolean, Int, Float, Double and Array.
Custom properties that have been defined via an addon are also not keyed.
Pull Request: https://projects.blender.org/blender/blender/pulls/119914
In GPv2 there was an option to disable masks during rendering
of a viewlayer. This wasn't implemented for GPv3 yet.
This needs to change the way the draw calls are created,
because we need to skip over drawings at render time.
So to do this, we precompute the drawing offsets,
then check if we need to skip over it and otherwise
create the draw calls.
Pull Request: https://projects.blender.org/blender/blender/pulls/120561
Caused by ca0b02aa96.
The `points.size() > 1` was added because we can't access
`lengths[points.size() - 1]` if the curve has a single point.
The fix just makes sure we default to a `u` value of `0.0f`
for single point cyclic curves.
Pull Request: https://projects.blender.org/blender/blender/pulls/120565
While the drawing code already skipped drawing any key points that are not in view,
it did that with an `if` check within the `for` loop. This can be speed up quite a bit
by calculating the bounding indices beforehand and only iterating that range.
| - | Before | After |
| - | - | - |
| `draw_fcurve_selected_keyframe_vertices` | 44850ns | 3194ns |
| `graph_main_region_draw` | 32ms | 21ms |
Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend
Pull Request: https://projects.blender.org/blender/blender/pulls/120521
- Expected results should come before actual result.
- Add test case for 8192 bytes as apple has a push constants size of 4096.
- Add more variation to the first order test data.
Improvements detected when working on vulkan backend and validated they
work on metal and opengl as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/120557
On heavy scenes, the function `get_graph_keyframe_extents`
takes up a considerable amount of the time (~50%) it takes to draw the Graph Editor.
This function is called to set the `View2D` extents which makes the scrollbars work properly.
I'd argue that level of precision isn't needed just to display scrollbars.
Passing the flag as `false` speeds up the drawing code by 22%.
Timings for `graph_main_region_draw`
| Before | After |
| - | - |
| 32ms | 25ms |
Timings for `get_graph_keyframe_extents`
| Before | After |
| - | - |
| ~16ms | ~8ms |
Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend
Pull Request: https://projects.blender.org/blender/blender/pulls/120519
Inherited from previous versions of this feature, by default the Purge
operation from the Outliner would remove all unused IDs, recursively.
The same operation invoked from the File -> Clean Up main menu would by
default only delete directly unused IDs.
Now both will by default remove all (directly or indirectly) unused data.