Previous code would consider two different face groups sharing no common
edges as fully isolated from each other, and could assign them the same
bitflag facegroup value.
Following FBX recent option to export these bitflags smoothgroups (!135646),
also consider that two different face groups are connected if they only share
common vertices, and assign them different bitflags values.
NOTE: This seems to be the expected behavior in major DCCs actually
using smoothgroups, only considering boundary edges create groups that
generate broken shading when imported by these tools.
NOTE: The 'unique integer identifers' option is kept for OBJ exporter,
as such OBJ files are also found on internet, depending on which app
generated them.
Pull Request: https://projects.blender.org/blender/blender/pulls/135998
- Use const in more places
- Use more appropriate headers and forward decls elsewhere
- Remove one instance of variable shadowing
- Rename an internal rna enum list and the USD operator property object
to follow surrounding code and naming guidelines
Pull Request: https://projects.blender.org/blender/blender/pulls/136112
This seems to be remains of code from time when sound offsets were
clamped to non negative values and start/endstill offsets were used to
offset strip handles from sound content.
Since start/endstill offsets were merged with start/endofs, this limit
should have been removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/136015
Using clang-tidy "cppcoreguidelines-pro-type-cstyle-cast" to find them.
This PR touches `bf_animrig` & `bf_editor_animation` & `bf_editor_armature`
NOTE: Also some case where untouched (not straightforward) same as
expanded macros (e.g. `LISTBASE` or `GS`)
NOTE: a couple of cases of "inconsistent-declaration-parameter" as well
Pull Request: https://projects.blender.org/blender/blender/pulls/136044
The `pxr::VtArray<T>` type is based on a copy-on-write scheme that is
very easy to trigger unnecessarily because of how the C++ type system
works[1].
Here we bypass unneeded copies by ensuring we always call the `const`
version of various accessor functions. The offending call-sites were
found by using the `VT_LOG_STACK_ON_ARRAY_DETACH_COPY` env variable.
This yields a very small 2-3% performance benefit when loading in a
typical, mixed-use, asset like e.g. the "4004 Moore Lane" scene.
[1] https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/base/vt/array.h#L139
Pull Request: https://projects.blender.org/blender/blender/pulls/136014
To fix this in the most non-intrusive way, we essentially do what
the modifiers do which is to convert everything to poly curves.
This is also what GPv2 used to do.
Ideally, we would export non-poly curves as bézier curves in the
supported SVG format.
Pull Request: https://projects.blender.org/blender/blender/pulls/136088
This reduces the API and make it more clear where there
is the global access.
This also removes some of these global access by merging
the `DRW_context_get()` calls.
When a input event is handled but `status.opmodal` is not explicitly
requested, `WM_window_modal_keymap_status_draw` will override the status
bar message, then the tool hint would be incorrect. This applies to
shear and edge slide operators. Seemingly introduced by 6d5d3ce. The
fix is to not ignore mouse move event when updating status bar as they
also causes viewport redraw.
Pull Request: https://projects.blender.org/blender/blender/pulls/136063
The import nodes are considered complete enough to expose without
the experimental option. This commit removes the option so they will
be exposed in 4.5. There are still some possible future improvements,
including automatic caching, possibly exposing more input sockets,
and possibly including imported paths in the "Internal Dependencies"
panel. Those are considered non blocking though.
Pull Request: https://projects.blender.org/blender/blender/pulls/135957
This is just the shader change.
It allows more freedom for the UI team to tweak the appearance.
The is not functional changes in this patch.
Rel #126334
Blender crashes when canceling a compositor job if a transform node is
used. This is because freeing shared data didn't reset data members, so
it still thinks it has allocated data, which will be double freed
causing crashes. To fix this, we simply clear data members if data is
still shared.
Fix the `ANIMDATA_FILTER_CASES` macro, so that layered/slotted Actions
no longer take precedence over NLA control curves. Now they're handled
with the same priority as legacy Actions were.
Pull Request: https://projects.blender.org/blender/blender/pulls/136072
Fix the `ANIMDATA_FILTER_CASES` macro, so that layered/slotted Actions
no longer take precedence over NLA control curves. Now they're handled
with the same priority as legacy Actions were.
Pull Request: https://projects.blender.org/blender/blender/pulls/136072
Don't attempt to add region draw callbacks in background mode.
This caused by the regions runtime being null.
Even if the runtime was initialized, drawing callbacks aren't needed
in background mode.
Ref !136078
This removes the old `DrawEngineType` and use the new `DrawEngine`
virtual class instead.
This removes a lot of boilerplate functions that were only there for
legacy reason.
To this end, some engines that were based on static functions have been
refactored into `Instance` classes. This was particularly cumbersome
for the Grease pencil engine which needed some more refactoring.
The `Engine` class that is in each namespace is a workaround to isolate
the internal implementation (i.e. the `Instance`) to the engine
modules. Without this, the whole engine is getting included in each
compile unit that includes the `Instance` class. Eventually, if we get
rid of these intricate dependencies, we could remove the `Engine` class.
Pull Request: https://projects.blender.org/blender/blender/pulls/136001
When a marker exists always return the nearest instead of using an
arbitrary large threshold which caused region_position_is_over_marker to
crash when a non-empty marker list returned a null nearest marker.
Ref !136060
BLF tests for font file opening, display name, metrics, variable
weight changing, width, height, advances, etc. Also tests for current
minimal word wrapping.
Pull Request: https://projects.blender.org/blender/blender/pulls/135891
Since internally `BKE_image_add_generated` uses 4 channel colors (no
matter what depth/planes is specified), just set alpha to 1 if the
option is unchecked.
Same as what 35dd09a9ef did for `IMAGE_OT_new`
Pull Request: https://projects.blender.org/blender/blender/pulls/135972
When images in the VSE use mirror and then get rotated, they rotate in
the wrong direction.
Multiply rotation by X and Y component of mirror value (-1). This is
the same approach as used by translation.
Co-authored-by: Aradgus <ramonklauck987@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/136004
Add support for using BLF to draw into an ImBuf image buffer.
Once the imbuf context has been set, draw calls for that font_id will draw into the image.
This works by binding an imbuf to BLF which is then used as the target when drawing.
```
with blf.bind_imbuf(font_id, imbuf):
blf.draw_buffer(font_id, text)
```
See the example in the Python API documentation for reference.
The following BLF API's have been added to support a Python context manager.
- `BLF_buffer_state_push`.
- `BLF_buffer_state_pop`
- `BLF_buffer_state_free`
Ref !135772
This used custom data types before, which was misleading and didn't
scale well because the set of attribute types is different than the set
of grid types we can store. Now just use the grid data type, like how
the store named attribute node uses the attribute type.
This covers backward compatibility, but not forward compatibility.
Pull Request: https://projects.blender.org/blender/blender/pulls/135814
The main reason that didn't work before because undefined custom node groups
have the undefined `bNodeType` (and thus are ignored in various places) but are
actually still groups that can be evaluated. The fix is just to handle custom
node groups a bit more explicitly.
In the future, we may want to have a separate "undefined custom group"
`bNodetype`, but that might a be a bit bigger project.
Pull Request: https://projects.blender.org/blender/blender/pulls/135974
Fix an issue with library overrides that was caused by Action
assignments getting versioned too late in the versioning process. Now
the versioning of Action assignments (which assigns the
created-by-versioning action slots) happens in the 'after linking'
stage, as well as in the 'after setup' stage. The latter is still
necessary for the conversion of pre-2.5x animation data.
It is likely that the versioning code can now be simplified, as the
tagging for "this needs upgrading" may no longer be necessary. We're now
too close to the 4.4 release to comfortably make such bigger refactors,
though, so I'd rather keep the overall code structure as-is.
Pull Request: https://projects.blender.org/blender/blender/pulls/135988
Use a cleaner approach to the WindowManager handling in the "blendfile
loading unit test" base class, to ensure it is freed properly.
The commit following this one changes the Action versioning code, which
writes to RNA properties, which in turn sends WindowManager
notifications, which in turn have to be freed properly whenever the test
exits.
Pull Request: https://projects.blender.org/blender/blender/pulls/135988
Looks like a logic inversion mistake.
Not clear how bad this issue is, as other code related to image metadata
seems to expect 1024 char max size too (e.g. `MAX_METADATA_STR` define
in `ed_draw.cc`. But this is potentially a very bad issue, and the fix
seems safe enough for 4.4 still.
Should also be backported to active LTSs.
Pull Request: https://projects.blender.org/blender/blender/pulls/135983
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.
This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.
MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.
NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.
Pull Request: https://projects.blender.org/blender/blender/pulls/135994