This node splits all faces to duplicate each time. Corner edges and
vertices are just ordered sequences of indices. Most likely, due to
historical reasons, this was overlooked and as a result the code became
so complex with potential simplicity. The problem was found in a
benchmark of #109174. The code in the lambda could not be optimized.
Timings improved by about 30%, from 154 to 120 ms.
Pull Request: https://projects.blender.org/blender/blender/pulls/109222
Since 4a3b6bfeac, there should be a loading/wait icon while the previews
are being loaded. However when initially loading the file list, the big
document icon we use when no preview was found showed up for a short
moment. This is because preview loading is only triggered after the file
list is fully loaded, and so the preview loading tag isn't set yet. But
we only checked for this tag. Now the waiting icon is displayed when
either the file list or the preview is still loading.
Current poll functions allows to use these operator only in edit mode.
Correct function would be `active_grease_pencil_poll` (check for active grease
pencil object instead of the context mode)
Pull Request: https://projects.blender.org/blender/blender/pulls/109238
The reference count computation for shader operation outputs is wrong,
because it considers internal links as references to the result, which
is not the case.
This patch fixes that by only consider external links.
Adds a new UI template to view the current layer tree of the active Grease Pencil object.
This UI tree view implements the following features (for now):
- Displaying all the layers with their names and highlighting the active layer.
- Changing the active layer by clicking on an item.
- Adding new layers (using a new operator).
- Removing the active layer (using a new operator).
- Renaming a layer.
Pull Request: https://projects.blender.org/blender/blender/pulls/109197
This commit converts existing callbacks into virtual methods and moves
their associated members from the base class to custom implementations
in subclasses.
These callbacks, (previously used within the main struct), have been
replaced by pure virtual methods in the `Nearest2dUserData` class.
As a result, specific subclasses can now provide their own customized
implementations for these methods.
- Ensure a trailing slash in BKE_blendfile_userdef_from_defaults
instead of in-line platform specific checks.
- Take a buffer size argument for the directory.
- Use the documented size for SHGetSpecialFolderPathW wchar_t argument.
- Remove use of unsafe `wcscat` on WIN32
- By default on Linux the directory would be "/usr/share/" with
"fonts" as the filename, now fonts is always treated as a directory.
- Correct the path for linked library fonts using a relative path.
In order to better identify which is the normal of the point
(see #108711), it is interesting to identify which is the closest bone.
So, instead of testing the snap at each point and then each bone line,
test the bone lines first and after identifying the closest one, test
its points.
With the nearest bone identified, we can use its normal instead.
`sctx` can be accessed internally.
And `clip_planes_enable` makes it clearer what this method does.
Also note that this function had been accidentally removed for Cameras.
This wasn't covered by my other tests because in usually the geometry output
that anonymous attributes are propagated to is the first output, thus the index
was 0. In this case it didn't make it difference whether the `.index_range()` call
was there are not.
This reverts commit ef9d9c6856. Actually probably better to leave
this in, since it may be used by normal computation even if seemed to
work ok in tests.
The root of the bug was wrong edges, but it wasn't necessary to compute
corner edges at all and this was unnecessarily added in 16fbadde36.
Ref #109161
The old subsurf DerivedMesh code creates an edge layer
without initializing it, which makes the proper lazy initialization
of the edge layer later think that it's already finished. To avoid that,
remove the edges when creating the DerivedMesh at first.
Similar to 85bd64ece4
This was due to a wrong mapping of tools in the toolbar.
The fix makes sure that the correct selection tools are used for the
old grease pencil objects.
In order to accomplish this properly, the new grease pencil objects
use their own edit mode context.
This way the two objects are cleanly seperated.
The node title was translated in two steps: first using the
BLT_I18NCONTEXT_ID_NODETREE context, and if that failed, using the
default context.
As far as I could find, the only node using this intentionally is the
Frame node, but its title is only displayed in the Add Menu.
However, at least one node has a bad translation because its name was
extracted independently with the NodeTree context: the compositing
Scale node uses a translation which is only appropriate in a vector
math context.
This commit removes the double translation step. If needed by
translators, a translation context in the node RNA could be introduced
at a later time.
Pull Request: https://projects.blender.org/blender/blender/pulls/108241
The Select Similar UV operator defined multiple enum item arrays, and
returned one depending on current mode in the enum function
uv_select_similar_type_itemf().
The operator prop's enum items used only the vertex items, which
resulted in several items never being extracted because they were
dynamically generated instead of exposed to the RNA.
This commit groups all items in a single array so that they are
exposed, but uses the enum function to filter them.
Issue reported by Satoshi Yamasaki (@SatoshiYamasaki) in #43295.
Pull Request: https://projects.blender.org/blender/blender/pulls/108994
By removing the extra complete check/remapping of ID pointers in undo
case, ebb5643e59 merely revealed how broken the 'undo_preserve' code of
Scene was.
It cumulated a flock of issues, all more or less related to ID pointers:
* 'source of truth' should be the _old_ data (toolsettings), not the new
one, since this is the one kept at the end of the process;
* In some cases, some paint data may exist in one, but not the other
of the two 'old' and 'new' toolsettings data.
* Since this data is preserved to its latest version accross undos, its
ID pointers can become completely unrelated to these read from the
undo memfile, _even when the Scene itself is detected as unchanged_!
This implies that:
+ undo_preserve code has to be called even when there is no liblinking
(when the ID is detected as unchanged and re-used 'as-is').
+ Using existing ID addresses to find/validate an ID pointer in
undo_preserve process is like playing Russian roulette - invalid
memory access and crash is guaranteed at some point or another.
Use `session_uuid` value instead to ensure a valid ID pointer is set
(or null in case none can be found).
NOTE: while these issues also exist in previous releases (including both
latest LTSs), they were hidden by the code later in `setup_app_data`,
preventing any crash to happen. So backporting this fix would be far too
risky for a very minimal benefit imho.
Needed to simplify upcomming fix in Scene undo_preserve code.
NOTE: also renamed 'private' macro parameter names to follow C++ classes
convention (one trailing `_`, instead of one or two leading `_` - the
two `__` leading ones are triggering complains from IDE regarding reserved
identifier names when the relevant macros are used in C++ files).
No expected behavior changes with this commit.