The same logic was duplicated in two places, now factorize it into its
own function.
This code reads (peeks) _some_ ID info from a blendfile, without actually
reading the full ID data. And it also decides if the given ID BHead
should retained, or skipped.
This is mainly used to show a list of available IDs or assets to link or
append.
Pull Request: https://projects.blender.org/blender/blender/pulls/141103
This PR sets the default frame method for camera background images from
the current `Stretch` to `Fit`. For a lot of use cases, `Fit` is the
desired frame method, rarely `Crop` is used, with `Stretch` being even
more rare. This saves the user from having to manually set the frame
method after adding an image. This can also prevent cases where an
artist adds a reference image that's close to the camera aspect ratio
but doesn't match it completely, giving a slight distortion that they
might not immediately notice, and causing confusion down the line.
Pull Request: https://projects.blender.org/blender/blender/pulls/141075
- Remove "experimental" label from C++ based FBX importer,
- Make drag-n-drop use the C++ FBX importer,
- Add "Legacy" label to the previous Python FBX importer
Pull Request: https://projects.blender.org/blender/blender/pulls/140703
In most (cases functions returning a PyObject pointer
requires it to be used by the caller, declare functions in the Python
API with the `nodiscard` attribute.
Use a separate index for indexing into `Array<TransDataVertSlideVert>
r_sv`, as that only contains the selected items (and not all items
considered for proportional editing).
Since the introduction of the sorted index map (df6d345bb4) the
selected "transform items" are simply visited first, but not sorted to
the front of the array. This means that these array indices cannot be
used to index into other arrays that only contain sorted data, because
they will overflow.
Ref !140976
Introduced with 96e549c092
While the above commit applied versionings to the related flags, it did
not convert either the UI elements or the underlying grease pencil code
to use the now generic `Brush` properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/141001
The same logic was duplicated in two places, now factorize it into its
own function.
This code reads (peeks) _some_ ID info from a blendfile, without actually
reading the full ID data. And it also decides if the given ID BHead
should retained, or skipped.
This is mainly used to show a list of available IDs or assets to link or
append.
This check was meant to catch unknown failure cases but instead it
meant any attribute with an empty array (e.g. from a mesh with no
faces) would not be loaded. Instead the failure case should only be
when there is no data when the array is not meant to be empty.
Pull Request: https://projects.blender.org/blender/blender/pulls/141096
This adds support for scene assets.
* Scenes can be marked like any other ID as assets (e.g. by right-clicking on a scene ID selector).
* Scenes will generate previews by rendering the view from the active camera in solid view.
Note that this requires the scene to have an active camera.
* When dragging a scene asset onto anywhere in a window (except the asset browser itself),
it will import the asset (or use the local ID) and set the scene as the active one in the window.
Pull Request: https://projects.blender.org/blender/blender/pulls/141081
Alt click works perfect to disable restriction toggle (hide/selection
toogle) on selected object tree elements from outliner. But fails when
re-enabling them. This is because `screen_ctx_selected_editable_objects`
returns a list of selectable bases. When above two restriction toggles
are disabled, `selection` flag is cleared from resepective bases. To avoid
such situation, handle outliner case separately inside
`UI_context_copy_to_selected_list ()`, store list of objects that are selected
in outliner (i.e. `TSE_SELECTED` flag is set).
Also added few findings as comments in #133459
Pull Request: https://projects.blender.org/blender/blender/pulls/133469
This PR adds several more built-in variables for path templates:
- `scene_name`: name of the current scene.
- `camera_name`: name of the current camera.
- `node_name`: only for paths owned by a node; the name of the node.
- `blend_name_lib`: name of the blend file of the ID the path property
is on, sans file extension.
- `blend_dir`: path up to (but not including) the currently open blend
file.
- `blend_dir_lib`: path up to (but not including) the blend file of the
ID the path property is on.
Additionally, adding support for `node_name` required re-thinking the
"path template type" system a bit:
Previously, the the `PropertyPathTemplateType` of a property completely
dictated what variables were made available to it. However, if we stuck
with that system then we would need to split
`PROP_VARIABLES_RENDER_OUTPUT` into two enum items: one for "normal"
render output paths like the one that lives on the `Scene`, and one for
"node" render output paths like the ones on the File Output node.
Instead of doing that, this PR makes `PropertyPathTemplateType` only
responsible for dictating the "purpose-specific" variables. In this
case, render-specific variables like fps, resolution, etc. Then the
availability of variables like `node_name` are instead based on what
owns the path (a node or not, in this case). There are also general
variables, like `blend_name`, that are now available to all path
templates.
(Part of #133001)
Pull Request: https://projects.blender.org/blender/blender/pulls/139438
Code to read placeholder IDs from other library vs. reading actual ID
from current library was virtually the same, so de-duplicate it into its
own utils.
NOTE: Done while investigating support of embedded linked IDs in
libraries, which will require some fairly involved changes in this area.
Pull Request: https://projects.blender.org/blender/blender/pulls/141049
Remove the impact of Auto orbit center preference onto Fly mode.
Until now, it was possible to experience dynamic translation speed
changes in the Fly mode with Auto preference enabled for the orbit
center. This was not desired.
Ref !141035
Ensure 'constraint_axis' is unset in the Rotate operator when user
sets 'orient_axis' via the operator panel. This prevents unintended
overrides and aligns with expected behavior.
Change is limited to avoid affecting Shear, Rotate Normals, and
Transform, though Rotate Normals may benefit from similar handling due
to overlapping axis properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/114779
This replaces `uiItemFullOMenuHold_ptr`, `uiItemFullR_with_popover`,
`uiItemFullR_with_menu`, `uiItemPopoverPanel`* and `uiItemSpacer` API
with methods following uiLayout refactors and the Python API.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141050
The code added in commit ffc204d1fa to dissolve redundant 2-edged
vertices after a manifold boolean assumed that after dissolving such
vertices a valid face would remain. This is not true of the face
started out degenerate (all vertices on the same line).
Fixed by checking for such cases and in any case not creating
any faces with less than three vertices.
Our themes have two colors that we use as outlines for the editors, so
that we can differentiate the active area. This PR just fades in the
"Active Editor Outline" color rather than show it instantly. It makes
the change a little less jarring. As this transitions in the old active
area similarly transitions out. Note that this is very fast, only 150
milliseconds, so barely noticeable. Just a "softening" of the effect.
Pull Request: https://projects.blender.org/blender/blender/pulls/140836
Notably, there were several code paths which could end up converting to
strings, sometimes multiple times, when passing data into USD APIs.
Reduce the use of raw `char *` in the asset interface and use
`std::string` instead to match what will be passed into USD. Using
string views, of any variety, will not help here since the APIs don't
natively support those.
Pull Request: https://projects.blender.org/blender/blender/pulls/140997
The code added in commit ffc204d1fa to dissolve redundant 2-edged
vertices after a manifold boolean assumed that after dissolving such
vertices a valid face would remain. This is not true of the face
started out degenerate (all vertices on the same line).
Fixed by checking for such cases and in any case not creating
any faces with less than three vertices.
Unclear if that got lost or was forgotten all together, but the
Sequencer's Strip RNA struct did not have expected access to its system
properties.
Regression since 7276b2009a.
... using Select Box.
This is caused by our hack to make each triangle always output
at least 1 pixel. It stretches the triangle with a specific
winding order that is correct for any geometry even if it is
backfacing as long as it is subpixel. But if the mesh is
negatively scaled, the culling mode is flipped. Which make the
hardcoded offsets winding inverted, and then culled by the rasterizer
(or the fragment shader code).
The fix is to flip the winding order of the offsets depending on
the object matrix negativity.
This is rather expensive so we only do it for the triangles we know
are subpixels.
The VSE preview job was pushing tasks while holding a lock
which is also used by the task. This could lead to a dead-lock
situation if scheduling decides to run the task immediately.
The easiest way to reproduce the issue is to run Blender with
`-t 1` command line argument and add WAV file.
The solution is to iterate over queue and create tasks while
holding a lock, but push them to the pool after releasing the
lock.
Pull Request: https://projects.blender.org/blender/blender/pulls/140972
For some reason the orco vertex buffer is requested after the position
buffer, but they are computed together. In case that happens, just
discard the position buffer.
Pull Request: https://projects.blender.org/blender/blender/pulls/141043