- There's only a few unit conversion options, just test all of them
- Use reference instead of pointer when passing export settings struct
- Organize scaling struct fields to keep similar options together
Pull Request: https://projects.blender.org/blender/blender/pulls/133774
Artists often want to quickly switch back and forth between two or more nodes while compositing.
This patch implements two operators `NODE_OT_viewer_shortcut_set` and `NODE_OT_viewer_shortcut_get` that allow users to map a viewer node to a shortcut. For example, pressing `cltr+1` while a node is selected, assigns that node to the shortcut `1`, creates a viewer node if it has none attached and sets that viewer node to active. Pressing `1` will set the active node with shortcut `1` to active.
Shortcuts are saved in DNA to preserve them after saving/loading blend files.
Limitations:
- Only compositor node tree is supported, because shading editor has no viewer node and geometry nodes viewer works differently.
Pull Request: https://projects.blender.org/blender/blender/pulls/123641
Adding an image object using drag and drop can fail without an apparent reason.
This patch shows an error when this happens so that the user can react accordingly (in this example switch to object mode, add the image and switch back to edit mode).
Pull Request: https://projects.blender.org/blender/blender/pulls/132994
In certain setups, nodes whose inputs are single value and whose outputs
are expected to be single value wrongly return an image. That's because
they wrongly join a pixel operation that operates on images.
To fix this, we split pixel operations by their value types. Single
value sub-trees get compiled into their own pixel operation and none
single value sub-trees get compiled into their own pixel operation.
This might unfortunately break up a long chain of pixel operations if
one of them was single value. This is solvable, but will require more
time and research, so we need to fix the bug first then look into it.
Pull Request: https://projects.blender.org/blender/blender/pulls/133701
Regardless of what mem info reports. We can't move this to the host, so
might as well try because the free memory might not be a reliable predictor
of success.
Pull Request: https://projects.blender.org/blender/blender/pulls/132912
With host mapped memory these can be shared, and we can't get back the
original host pointer unless we make a copy which is inefficient.
Also add asserts to verify this doesn't happen.
Pull Request: https://projects.blender.org/blender/blender/pulls/132912
This was not thread safe. And it's better to do them one by one to avoid
moving more than is needed, when another thread already freed up enough.
Thanks to Jorn Visser for investigating and finding this problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/132912
If one of the devices already used host happed memory but another not,
it would previously realloc both.
Thanks to Jorn Visser for investigating and finding this problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/132912
Should be a bit more efficient, and it fixes host memory fallback bugs,
where host memory was incorrectly freed during re-copy. For the case
where memory should get reallocated on the host, a new mem_move_to_host
was added.
Thanks to Jorn Visser for investigating and finding this problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/132912
The scene graph instancing export code contains logic for
determining which instances need to be converted to prototypes
because the original prototypes are not included in the export
(e.g., because they are not visible).
This commit fixes an error in this logic, which incorrectly
assumed that if the root of the original prototype is included
in the export, then the entire original hierarchy beneath the
root is included as well.
To fix this, the logic in AbstractHierarchyIterator::
determine_duplication_references was updated so that if any
descendants of an instance are converted to prototypes, the
parent instance is converted to a prototype as well.
This addresses the bug noted by Brecht in
https://projects.blender.org/blender/blender/pulls/131707#issuecomment-1403309
Pull Request: https://projects.blender.org/blender/blender/pulls/133750
Blender crashes when appending a node group containing a Glare node from
older versions. That's because the Glare node is versioned taking the
scene resolution into account, and in case of appending a node group,
there is associated scene, and accessing a nullptr scene causes the
crash.
To fix this, assume some default resolution in cases where the node
can't be associated with a scene.
Previously, there was a `StringRef.copy` method which would copy the string into
the given buffer. However, it was not defined for the case when the buffer was
too small. It moved the responsibility of making sure the buffer is large enough
to the caller.
Unfortunately, in practice that easily hides bugs in builds without asserts
which don't come up in testing much. Now, the method is replaced with
`StringRef.copy_utf8_truncated` which has much more well defined semantics and
also makes sure that the string remains valid utf-8.
This also renames `unsafe_copy` to `copy_unsafe` to make the naming more similar
to `copy_utf8_truncated`.
Pull Request: https://projects.blender.org/blender/blender/pulls/133677
If the parent editbone is hidden, it will (rightfully) not be taken into
account in `createTransArmatureVerts`.
In `recalcData_edit_armature` though, there was the assumption in a
particular code path that "this bone has a parent tip that has been
moved" even though it wasnt (because it was hidden -- see above).
To resolve, guard this code path with a `EBONE_VISIBLE` check.
Pull Request: https://projects.blender.org/blender/blender/pulls/133707
This commit moves the Convert World Material checkbox under Materials to
a World Dome Light option "under" Lights. Based on feedback this is more
intuitive for artists. Previously artists would try unchecking "Lights"
and be confused why a DomeLight would still be in their scene.
This is only a UI layout change, API remains unchanged.
Authored by Apple
Co-authored-by: Dhruv Govil <dgovil2@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/131829
Move 3D viewport bounds calculation out of the operator callbacks
into utility functions, needed for !129594.
Some minor renaming:
- `ok` -> `changed`.
- `ok_dist` -> `do_zoom`.
When performing a transform operation that drags or tweaks, do not show
the Cancel or Confirm keymap item on the Status Bar if they use the
same mouse button that initiated the operation. For example if you are
RCS and are tweaking an object, don't show Cancel on status bar since
that requires right click. If LCS then don't show Confirm (requires
left click) when tweaking, dragging gizmo parts, etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/131336
ANIM_bone_is_visible_editbone was being used in situations where the
intention is to check if the bone is visible to the user.
In this case, EBONE_VISIBLE makes more sense as it also accounts
for hidden bones too.
The issue here is that motion_steps handling is a bit complex, and the
parallel synchronization of geometry does not play well with it.
The obvious result of this was a crash related to the main thread
checking attributes while the geometry sync was changing them, but
there was also another race condition that could result in ending up
with the wrong motion_steps.
Specific changes:
- Change place where `motion_steps` is set to avoid concurrent access
- Change the default `motion_steps` to zero, since they won't be
explicitly set if there's no motion now
- Don't skip `motion_steps` copy in `sync_X` since it's no longer set
in `sync_object` and we need to transfer the value in case it was set
to 3 by the velocity code since that's no longer the default
Pull Request: https://projects.blender.org/blender/blender/pulls/133669
OSL has OSL::ShaderGlobals, which contains all the state for OSL shader
execution. The renderer fills it out and hands a pointer to OSL, and any
callbacks (e.g. for querying attributes) get the pointer back.
In order to store renderer-specific data in it, there's a few opaque pointers
in the struct, but using those has led to a mess of reinterpret_cast<> and
pointer indirection in order to carry all the data around.
However, there is a way to do this nicer: Good old C-style struct inheritance.
In short: Unless you're doing pointer arithmetic, you can just add additional
data at the end of a base struct, and the rest of the code won't care.
In this case, this means that we can have our own ShaderGlobals struct and
add more Cycles-specific data at the end. Additionally, we can replace the
generic opaque void pointers with ones of the correct type, which saves us
from needing to cast them back.
Since we have a copy of ShaderGlobals for GPU OSL anyways, it's just a matter
of refactoring the code a bit to make use of that.
The advantages of this are:
- Avoids casts all over the place, just needs one cast to turn our
ShaderGlobals into the "base" type that OSL expects and one to turn the
pointer that OSL gives us on callbacks back into our "derived" type.
- Removes indirection, all the relevant stuff (sd, kg, state) is now
directly in the ShaderGlobals
- Removes some OSL-specific state from ShaderData, which helps to keep
memory usage down
Pull Request: https://projects.blender.org/blender/blender/pulls/133689
Reduce the Light Theme Icon Border Intensity from 1.0 to 0.7 to better
match the result in Blender versions prior to SVG icons. The icon
border is now done within the text shader so the result is a bit
stronger than the old method.
Pull Request: https://projects.blender.org/blender/blender/pulls/131396
Loading a custom preview/icon from disk can fail, e.g. if the image file
is corrupted. This was never handled that well, and I think since
315e7e04a8 we'd continuously re-query such previews.
Fixes#133617.
Also needed for #131871.
Pull Request: https://projects.blender.org/blender/blender/pulls/133679
This was caused by using the same factor as in dithered.
But dithered already has the transparency applied from
the dithered transparency. The transparency needs to be
applied to holdout in forward.
Remove the need for a temporary array of colors.
Just put the data directly into the translations vector.
This should provide a small performance improvement.