Outliner: Port grease pencil effect elements to new tree-element code design #110371

Merged
Julian Eisel merged 157 commits from :temp-gpencil-effect-refactor into main 2023-07-27 18:42:15 +02:00
Contributor

No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds new classes for grease pencil effect elements.

No user visible changes expected. Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce. Refer to these for a motivation and design overview. Adds new classes for grease pencil effect elements.
Almaz-Shinbay added 1 commit 2023-07-22 12:23:55 +02:00
Almaz-Shinbay added 1 commit 2023-07-22 12:24:19 +02:00
Almaz-Shinbay requested review from Julian Eisel 2023-07-22 12:24:29 +02:00
Almaz-Shinbay added 1 commit 2023-07-24 11:10:19 +02:00
Julian Eisel requested changes 2023-07-27 12:16:43 +02:00
@ -246,2 +246,4 @@
id = static_cast<EditBoneElementCreateData *>(idv)->armature_id;
}
else if (type == TSE_GPENCIL_EFFECT) {
id = reinterpret_cast<ID *>(static_cast<GPencilEffectElementCreateData *>(idv)->object);
Member

id = &static_cast<GPencilEffectElementCreateData *>(idv)->object->id;

`id = &static_cast<GPencilEffectElementCreateData *>(idv)->object->id;`
Almaz-Shinbay marked this conversation as resolved
@ -353,2 +361,2 @@
TSE_SEQUENCE_DUP,
TSE_GENERIC_LABEL))
TSE_SEQUENCE_DUP) ||
type == TSE_GENERIC_LABEL)
Member

Can use a second ELEM() here. (I expect this will conflict with #110245.)

Can use a second `ELEM()` here. (I expect this will conflict with #110245.)
Almaz-Shinbay marked this conversation as resolved
@ -0,0 +32,4 @@
LISTBASE_FOREACH_INDEX (ShaderFxData *, fx, &object_.shader_fx, index) {
TreeElement *ten = outliner_add_element(
&space_outliner, &legacy_te_.subtree, &object_, &legacy_te_, TSE_GPENCIL_EFFECT, index);
ten->name = fx->name;
Member

Shouldn't be needed (handled by TreeElementGPencilEffect constructor). Same for the following lines in this loop.

Shouldn't be needed (handled by `TreeElementGPencilEffect` constructor). Same for the following lines in this loop.
Almaz-Shinbay marked this conversation as resolved
Almaz-Shinbay added 151 commits 2023-07-27 16:24:16 +02:00
c43d773826 Cleanup: simplify uv parametrizer state information
Just use RAII, no need to track extra initializer state.
8517e7dc6b Cleanup: Convert 'ViewOpsData' functions into methods
This commit refactors the code by converting the data manipulation
functions of 'ViewOpsData' into methods.

This change adopts a more object-oriented approach, resulting in
improved code organization and enhanced reusability.

Pull Request: #110209
084219734a Fix #110253: Regression: Extruding bone from root fails
Caused by 0b7d8a20bf
Above commit broke the operation because of this change: `if (do_extrude != 0)`
Earlier True/False/2 were used to determine the point of extrude.
Use enum to fix this and to improve the code readability.

Pull Request: #110256
c48fb73df7 Cleanup: split 'ViewOpsData::init_navigation' into specific functions
The logic of `ViewOpsData::dyn_ofs` was scattered and confusing.

Confining it to a function makes initialization and usage clearer.
90be7ed2dc Cleanup: split 'view3d_navigate.cc' operators into their own files
This reorganization makes the code more modular and makes it easier to
identify and fix possible errors in the future.
611c9ae824 View3D Refactor: use structs to confine the Operator's navigation data
Adopt the use of structs to enclose and organize operator-specific
navigation data.

With this, we create well-defined boundaries for the navigation data of
individual operators.

This makes the code more flexible and easier to maintain and avoid
errors.
73fd418684 View3D Refactor: support 'ViewOpsType' for Orbit
This deduplicates the code and will make it easier to integrate this
operator into the overall navigation utility.
464e7b334c View3D Refactor: support 'ViewOpsType' for Roll
This deduplicates the code and will make it easier to integrate this
operator into the overall navigation utility.
8541d70e13 View3D Refactor: rename view operator files
Use the `view` prefix to better identify the hierarchy of these files.
a11632e7f0 I18n: do not translate one message already translated with tip_()
The "Name Collisions:" UI message does not need to be translated as
part of the label, as it is already through an explicit call to
tip_().

Pull Request: #110319
55fcaa2794 Cycles: Update Velvet BSDF to Sheen BSDF with new Microfiber sheen model
This patch extends the old Velvet BSDF node with a new shading model,
and renames it to Sheen BSDF accordingly.

The old model is still available, but new nodes now default to the
"Microfiber" model, which is an implementation of
https://tizianzeltner.com/projects/Zeltner2022Practical/.

Pull Request: #108869
8ff688c373 Transform: Use alternative hotkeys for Transform Navigation
In order to avoid navigation hotkey conflicts during transform
operations, this commit implements the "Transform Navigation with Alt"
option.

This option is enabled by default and makes navigation hotkeys require
the `Alt` key during a transforming in the 3D View.

Pull Request: #109754
42d3414fd9 Refactor: Anim, simplify Armature drawing code a little bit
Reduce indentation in two armature drawing functions, by flipping
conditions and using `continue` (instead of having the entire `for`-body
inside two nested conditions).

No functional changes.
0f5f713e68 Cycles: Don't store SVM closure weight in ShaderData
This is only used as temporary state while evaluating SVM nodes,
there's no point in storing it in the ShaderData for later.
Since ShaderData size is relevant for GPU performance, we should
save the space and only keep it where needed.

Pull Request: #110366
05342a17d7 Fix compiler error when building without `WITH_INPUT_NDOF`
Some declarations were outside the `#ifdef WITH_INPUT_NDOF`, but still
referred to things inside that block. Now everything is inside the file.
847fc464db Fix #110336 Regression: Speaker ignoring of the starting position in NLA track
Porting fix from upstream:

Bugfix for reading an animated property with a negative time value.

This can now happen in SequenceHandle::seek.
7fd51492f3 I18n: restore unit messages after c++ migration broke extraction
The units defined in blenkernel/intern/unit.c were extracted using a
regex which contained `NULL`. Commit 129f78eee7 converted this file to
c++, and these `NULL` were replaced with `nullptr`, breaking the
regex.

This commit changes the regex to `nullptr` as well to restore the
translations.

Pull Request: #110420
94b0c99d12 GPv3: Stroke mode for the Eraser tool
Implementation of the stroke mode of the eraser tool for grease pencil.
In this mode, the eraser removes each stroke that it touches, meaning each stroke that either intersects the eraser or that has all points inside of it.

Pull Request: #110304
76614df611 Cleanup: Simplify removing curves in GP erasor stroke mode
Avoid the initial copy, and avoid moving from a const reference.
aad85694d6 UI: fix and improve a few messages
- "Rename Channels": only one channel can be renamed at a time, use
  singular.
- "Copy Markers to Scene": rephrase erroneous operator description.
- "Axis tag names with": grammar.
- "Close or open the selected stroke adding an edge from last to first
  point": "segment" is preferred to "edge" elsewhere in the context of
  curves or Grease Pencil.
- "Number of subdivisions [points] by edge[s]": replace "by edge" with
  "per segment" for the same reason.
- "Compatibility mode for SL, OpenSim...": expand to explain that SL
  and OpenSim are respectively Second Life and OpenSimulator.
- "W/m^2" -> "W/m²". This symbol is widely supported and should be
  preferred for exponentiation outside of code.
- "Effect on tracks which are tracked less than specified amount of frames",
  "Effect on tracks which have a larger reprojection error":
  Use "Affect" and "number" instead of "amount".
- "Hull curve" -> "Envelope". This is a calque from German Hüllkurve
  meaning envelope.
- "Frquency Cutoff" -> "Frequency Cutoff" (typo)
- "Check if Select Left or Right": rephrase to "Based on Mouse
  Position" as it better explains the action of the operator.
- "Make cut event if strip is not selected ..." -> even (typo)
- "Shear selected items along the horizontal screen axis":
  Rephrase as this transform operator can act in many different axes.
- Tonemapping compositing node: the two algorithms "R/D Photoreceptor"
  and "Rh Simple" only had names, but no description. Add ones
  explaining at least the basic principle and where the names come
  from.
- In the "Matte dilate/erode side" description for the Keying node's
  Dilate/Erode socket, "side" was likely a typo for "size".
  Reformulate the description to make it clearer, inspired by similar
  ones.
- "Width of the blur edge" -> "Width of the blur for the transition";
  "Edge angle" -> "Angle of the transition";
  "Wipe direction" -> "Whether to fade in or out":
  Better explains the sequencer wipe transition (inspired by the manual).
- OSL shaders now supported on some GPU backends.
- "Add a new repeat input and output nodes " -> "Add new" (typo).

Pull Request: #110321
98e853c1e0 Mesh: Rename "polys" to "faces"
Implements part of #101689.

The "poly" name was chosen to distinguish the `MLoop` + `MPoly`
combination from the `MFace` struct it replaced. Those two structures
persisted together for a long time, but nowadays `MPoly` is gone, and
`MFace` is only used in some legacy code like the particle system.

To avoid unnecessarily using a different term, increase consistency
with the UI and with BMesh, and generally make code a bit easier to
read, this commit replaces the `poly` term with `poly`. Most variables
that use the term are renamed too. `Mesh.totface` and `Mesh.fdata` now
have a `_legacy` suffix to reduce confusion. In a next step, `pdata`
can be renamed to `face_data` as well.

Pull Request: #109819
107fc3faae UI: Only Show Spreadsheet Scroll Bars When Necessary
Hides Spreadsheet editor scroll bars when not needed.

Pull Request: #110403
b0cd9e4a9a Fix #109663: Allow Animation Keymap in Spreadsheet Editor
Allow starting and stopping animation, changing frames, etc while in
the Spreadsheet Editor.

Pull Request: #110404
5f4d2d8666 Cleanup: typedef uchar, ushort, uint & ulong in freestyle
source/blender/freestyle wasn't fillowing Blender's own
conventions for integer types.

This had the down-side of making the code_clean.py utility attempt to
replace `unsigned int` types which always failed.
While this edit could have been manually ignored for all files in
freestyle, add the typedef's to `FreestyleConfig.h` and follow Blender's
convention instead.
74a1e586d7 Tools: improve code_clean's 'use_brief_types' edit to skip typedef's
`typedef unsigned int uint;` could be converted into
`typedef uint uint;`.

Resolve by skipping instances of unsigned that follow a typedef.
40aec41871 Tools: improve code_clean's 'remove_struct' edit to avoid CPU overhead
Many struct removals were being tested which always failed.
Avoid testing removal of forward declarations & struct declarations.
66fe13166d Tools: code_clean: add a default value for '--edits' & '--match'
Each edit-generate now declares if it's generally considered safe
(isn't likely to make changes that break on other platforms for e.g.)
Default edits are now used when --edits is omitted.

The match argument now defaults to files with c/cc/cpp extensions when
omitted.

It's now possible to run:

  ./tools/utils_maintenance/code_clean.py {BUILD_DIR}

Which gives results that can be used with a very low risk of causing
functional changes or breaking other platforms.
af17297a11 Cleanup: make class doc-strings directly above classes
In some cases it wasn't clear if a comment before a class was meant
to be it's doc-string. Remove blank lines between the class & it's
doc-string.
65d027d30b Fix #109720: load_post can't be used to initialize the driver namespace
Regression in [0] changed the order of execution for the load_post
handler which previously (in 3.5x) ran before driver evaluation.

Calling either load_post/load_post_fail handlers after loading was
changed intentionally to simplify the code-path for calling handlers
however it meant the handler couldn't be used to setup drivers,
so restore the original logic.

[0]: 46be42f6b1
8d88a6636d BLI: update blender::Set vs std::unordered_set benchmark results
Also give more details about the used CPU and compiler.
7a91b4e71f Cleanup: Small changes to GP smooth operator
- Avoid calling `.finish()` twice, only pass span
- Fix "opcities" typo
- Remove unnecessary "is_empty()" check
- Group creation of "src_data" in one block
- Remove periods after doxygen titles
- Remove unnecessary "curves" argument
- Order mutable argument last

Pull Request: #110428
9898e9764e Cycles: oneAPI: fix kernel host-side compilation with MSVC 17.7
<algorithm> header include is missing from some sycl headers, this will
be fixed upstream with https://github.com/intel/llvm/pull/10424,
meanwhile, we work around it by including it directly.
b29540e753 Fix missing redraws of affected regions with dynamically sized regions
Regions that change their size in the layout phase (something that is
supported for a while now) might affect the size of following regions.
For example the asset shelf design forsees that it takes space away from
the tool- and sidebar. When its size changes, tool- and sidebar need to
redraw.

Without this there is a crash in the `asset-shelf` branch:
- Open sidebar
- In the asset shelf Display Settings popover, toggle "Names" twice.

At first the sidebar will be empty, when toggling the second time a
null-dereference will cause a crash. This is because the layout phase of
the sidebar does not run, but after that the region size is updated,
it's tagged for redraw and the draw phase runs (without any layout).

Pull Request: #110212
e9bd61e414 UI: Attempt to restore region for redo from Adjust Last Operation panel
The Adjust Last Operation panel would attempt to use the main region,
even when the operator was initially executed in a different region.
This becomes an issue when the operator relies on context of the region.
For example the pose library gets the active asset from context, which
is only available in the region (e.g. asset shelf) displaying the
assets. In general it seems like redo should restore the region of
invocation.

This uses the region type from the initial operator call context to
lookup a region to restore on redo. While not completely bullet proof
(multiple regions of the same type may be present), this should mitigate
the issue quite a bit.

Required for #104831.

Pull Request: #108892
db3a11fb02 Fix 'bl_keymap_validate' test
Exporting & importing the key-map changed results,
resolve by using float literals.
0ca437c95d Depsgraph: tag relations update from Set Active Object As Camera.
Dependency building assumes scene.camera is fixed due to #107081.
Thus it is necessary to do a relations update when it does change.

Pull Request #110139
26352a5346 Depsgraph: tag relations update when marker camera refs are changed.
Since markers are used to animate scene.camera, changing their camera
links carries the same consequences as changing scene.camera directly.
This means relations need rebuilding in case a new camera was added.

Pull Request #110139
71e11fb0d8 Depsgraph: change the fix for #107081 to handle any Scene references.
The cause of that bug is any dependency on Scene COW, because that is
triggered by selection. Context properties merely are the most reasonable
way for that to happen. Therefore, the special rule should really apply
to any Scene references.

The real motivation is this removes dependency on dvar for when this
code is extracted as a new method in the next commit.

Pull Request #110139
b0b60e8f45 Depsgraph: handle camera switching via markers in context drivers.
Blender allows animating the active camera selection (i.e. scene.camera)
by binding cameras to markers in the timeline. The dependency graph was
completely ignoring this by not building nodes for these cameras (it is
possible to reference a camera not directly included in the scene), and
not taking this into account in driver relations.

This change ensures that all cameras are included in the dependency
graph, and any drivers referencing scene.camera get dependencies on
all cameras of the timeline, and also time itself to ensure switches
are processed.

Pull Request #110139
6a7cc8ab42 Fix tests failing from errors in the users startup file
Tests should never depend on the users startup.blend which can have
settings that interfere with tests.

Failure to load the user startup.blend for e.g. prevented
bl_alembic_io_test from passing.
ccb0587ead Keymap: avoid 3D View transform inheritance
Move shared transform operations out of the 3D viewport key-map into a
template function which each modes key-map uses.

This allows sculpt mode to key-bindings which where bound to transform
actions that don't make sense in sculpt mode.

Note that this enables `alt_navigation` for some 2D viewport actions
where it's not yet used.

Based on design task: #105298.

PR !110019.

Co-authored-by: Julien Kaspar <JulienKaspar>
c35c791c6d UI: Refactor quick label tooltip implementation for buttons
No user visible changes expected. Used in the asset shelf branch,
see #104831.

These tooltips only show a label string and appear after a shorter timeout
than the regular tooltips. After the regular tooltip timeout they expand to
the full tooltip. The toolbar and properties editor navigation tabs make use
of this already.

The changes here enable more control over quick label tooltips, making them
usable in more cases, and less ad-hoc. Main changes:
- Refactors internal logic so a single `UI_BUT_HAS_TOOLTIP_LABEL` button flag
  can be used to enable quick label tooltips. This decentralizes logic in a
  way that's more consistent and extensible.
- Custom callback to return a quick label. This is useful when a label tooltip
  should be displayed even when there is no button string set. E.g. in the
  asset shelf with "Show Names" disabled.

Pull Request: #110200
698bf79953 CMake: revert last weeks modernizations
The cleanup of blenkernel last weeks , caused the house of cards to
collapse on  top of bf_gpu's shader_builder, which is off by default
but used on a daily basis by the rendering team.

Given the fixes forward in #110394 ran into a ODR violation in OSL that
was hiding there for years, I don't see another way forward without
impeding the rendering teams productivity for "quite a while" as there
is no guarantee the OSL issue would be the end of it.

the only way forward appears to be back.

this reverts :

19422044ed
a670b53abe
0f541db97c
be516e8c81
3e88a2f44c
4e64b772f5
9547e7a317
07fe6c5a57

The problematic commit was 07fe6c5a57
as blenkernel links most of blender, it's a bit of a link order issue
magnet. Given all these commits stack, it's near impossible to revert
just that one without spending a significant amount of time resolving
merge conflicts. 99% of that work was automated, so easier to just
revert all of them, and re-do the work, than it is to deal with the
merge conflicts.

Pull Request: #110438
3b96a74c87 Fix #88752: overlapping IK constraints with zero-influence misbehave
Bones with overlapping IK constraints would jump about unpredictably
when at least one of those constraints was either zero-influence or
disabled.

The underlying issue appears to be that depsgraph construction assumes
all IK constraints are enabled (which is necessary for e.g. animating
influence), but the IK solver code excludes disabled and zero-influence
constraints from the solve.  This in turn leads to
`BKE_pose_where_is_bone` not getting called when needed in some cases.

This commit addresses the issue by always including all IK targets in
the solve even when disabled or zero-influence, and simply excluding
them from being applied.

See the discussion in #88752 for more details.

This patch was primarily authored by Brecht, but with a minor fix
by me after testing.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: #110417
c2240615e9 Cleanup: Simplify iteration over mesh faces, use utility functions
Utility functions make accessing the next and previous corner of a face
more obvious, and range based for loops make iterating over corners
or vertices in a face simpler too.
e7406e5559 Cleanup: Avoid passing redundant face index in normal calculation
The current face index can always be retrieved from the "loop_to_face"
map, so passing it around and updating it manually just adds more
state to track.
851ab9cf37 Cycles: add /jumptablerdata to MSVC compiler flags
Starting with MSVC 17.7 preview 3, /jumptablerdata is available and
allows to ensure switch tables don't get mixed with the code, helping on
performance when there is contention in a large switch statement, such
as in svm.h.

Pull Request: #110470
62fa8dda2d Fix grease pencil crash with render engines that don't deliver Z pass
Found during Hydra render engine development, could also happen with
render engine add-ons.
7ce36af1bf Cycles: refine MSVC version check for /jumptablerdata
MSVC_VER 1937 included 17.7 preview 1 and 2 that didn't support the flag
while developers may be using these versions already because of the
issues with 17.6. We now check for preview 3 specifically.
92dbf81ccd Cleanup: Rename mesh custom data fields
Implements the rest of #101689, after 5e9ea9243b.

- `vdata` -> `vert_data`
- `edata` -> `edge_data`
- `pdata` -> `face_data`
- `ldata` -> `loop_data`

A deeper rename of `loop` to `corner` will be proposed as a next
step, and renaming `totvert` and `totedge` can be done separately.

Pull Request: #110432
ce485f35b8 Cleanup: Make format
Sorry for the noise, I thought I ran this in the previous commit.
c108febb5c Fix #110475: 'Use Mouse Position' option for navigation not working
Caused by 384c2e1f36

The 'Use Mouse Position' option was always being false which caused
navigation operators to behave as if the cursor was in the middle of
the region.
01c1337820 Cleanup: Access more mesh data with C++ methods
Recent C++ conversions have enabled more changes like
af53207b43 and 7826aed105.
226ba48517 Cleanup: Remove unnecessary manual mesh edit data destruction
Also slightly improve comments about original indices.
5cbc4a8150 Tools: fixes/improvements for 'check_struct_comments' check
- Fix using forward declarations when extracting struct information as
  it causing this check to be ignored.
- Fix extracting comments which sometimes included code fragments.
- Fix extracting the outer comment for struct declarations on a single
  line.
- Skip source files in the build directory.
0c3c180d24 Cleanup: use doxygen formatting in UI_interface.h, DNA_screen_types.h
Also use doxygen type references & correct some typos.
2fa8ab1a05 Cleanup: restore parenthesis in ME_FACE_TRI_TOT macro
This was removed in a recent refactor, also use a more meaningful
argument name.
6af365a5a3 UI: change the name of RGN_TYPE_UI in the enum to "Sidebar"
This is the term used in the interface, using this term means enum items
can be used in UI code without having to use a separate name mapping.
9eed1f94ea Keymap: add experimental "Toolbar Toggle Pie" preference
When pressing N-key a pie menu is shown which can toggle regions,
typically the toolbar, sidebar and the header.

This supports toggling regions without having to add a separate shortcut
for each one.

The pie menu locations selected based on the region alignment.

See #107785.
e68d2dfecf Fix build error in fcacebbfb1
The header was not included, define ulong locally.
10b71a688b GPv3: Prevent crashes from the dopesheet functions
Some animation operators are not yet implemented for Grease Pencil 3, and trigger asserts. This patch prevents the asserts to be triggered in case of grease pencil channels, so that  Grease Pencil 3 can be tested until the operators are properly implemented.

Pull Request: #110486
c18b2ea317 GPv3: Add filtering for channels in the grease pencil dopesheet
Take into account the filtering flags while filtering grease pencil channels in the grease pencil dopesheet.
This PR also adds two API functions for layers :
* `is_empty` checks if a layer contains no frame, and
* `is_selected` checks if a layer is selected.

Pull Request: #110484
9744e729dc GPU: Make shader tests pass on OpenGL
There was some inconsistencies between GLSL and MSL
regarding vector comparison.
18b7079b14 DRW: Add missing defines for tests
Prior to that, the Draw tests would be missing.
03bd36ee1b DRW: Make tests pass
These were just changes that changed the test
output but not the behavior.
3ef4fe037d Keymap: rename "Toolbar Toggle" to "Region Toggle"
The toolbar is only one kind of region that can be toggled.
c4281e1819 PyAPI: expose missing show_region_* properties
Add show_region_channels access for animation editors &
show_region_tools for the spreadsheet.

These could be hidden by resizing the region, there was just not way to
do this from Python.

Exposing these means they can be toggled from WM_MT_region_toggle_pie.
ba05cf5685 GeometrySet: Add new `GreasePencilComponent`
This is mostly boilerplate code to add a new `GeometryComponent` as well as making sure
the new `GeometryComponent::Type` is handled in all the `switch` statements.

Pull Request: #110457
3d7d1a331b Cleanup: Address clang-tidy warnings in UI views
Unused header warning and `modernize-use-override` warnings.

I would like to selectively disable warnings about redundant `virtual` and
`override` keywords, since both together are useful (`override` enables
important compiler warnings that can avoid bugs, `virtual` helps quickly
identifying API functions available for overriding). But this doesn't
seem to be possible, only all of `modernize-use-override` can be
disabled, so simply keep the `virtual` but comment it out.
a431e610c7 Fix API design issue with activating UI view items
The `on_activate()` function of an item should only be called when the
item was activated through the view, not through an external data change
(e.g. changing an active item through Python). That is important because
`on_activate()` is expected to do things like sending an undo push. This
is now respected in tree and grid views.
3e5857914f Refactor: Deduplicate view item active state logic
Much of this was duplicated between grid view and tree view items which
keeping them in sync was becoming a hassle already. Now the logic is
shared via the base class. I find this makes the interfaces easier to
scan through visually as well.

Had to add a virtual iterator function that can be called on an
`AbstractView`.
8b40e4331e Refactor: Pass context to UI view item activate function
The `on_activate()` function is expected to do undo pushes, call
operators, send notifiers and things like that as needed. Context is
necessary for such things, so seems reasonable to provide it as
argument.

Also needed for #110378.
6123e25307 Fix #109583: Avoid non-threadsafe writing to custom normals data
Currently, while calculating face corner normals, Blender retrieves
custom normal data with write access. When the the custom normals in a
single smooth corner fan don't match, they are reset to the average
value.

This behavior is very old, but it comes from when Blender didn't have a
strong idea of const correctness. Indeed, modifying custom normal data
while calculating normals isn't threadsafe, which is important because
normals are calculated for viewport drawing, for example. And in the
future, properly caching face corner normals (see #93551) will require
the ability to calculate normals on a properly const mesh.

The fix is to still use the average of custom normals in a fan, but
not write that back to the custom data array. In my testing the results
are the same. Setting custom normals still fills the same value for all
corners in a fan.

Pull Request: #110478
f44890f2ea Modifiers: Add `idname` field to `ModifierTypeInfo`
Previously the panel type name of a modifier (e.g. "MOD_PT_Smooth") was
created by copying from the ModifierTypeInfos name.
This meant that modifiers with the same default name would use
the same identifier for the panels.

Since different object types (e.g. OB_GREASE_PENCIL and OB_MESH)
might want to use the same default modifier name, this PR introduces
an idname field in the ModifierTypeInfo struct. This is then used to
generate the panel type name.

For compatibility reasons, the idname is the same as the name for now.

Note: Because the name was used previously, this means that some
modifiers have spaces in their panel type name.
E.g. "MOD_PT_Volume to Mesh".

Pull Request: #110468
39d9430297 Fix #110170: Cycles CUDA cloud rendering artifacts with spatial splits
The fix in commit d9273d857 exposed a pre-existing issue in the code.
907a8da0d2 GPv3: Keyframe on-click selection
Implementation of the click-selection operator of keyframes in the dopesheet, along with its alternatives : deselect all when no frames is hit, extend selection with shift, column selection with alt, select all keyframes on current channel with ctrl+alt.

Includes the new following API functions :
 * `select_frame_at` : selects a frame in a layer at a specific time (if such frame exists),
 * `select_all_frames` : selects all frames of a layer,
 * `select_layer_channel` : selects a layer, and sets it as active (if layer is not null, otherwise the active layer is set null),
 * `layer_has_frame_selected` : checks if any of the frames in the layer is selected.

Pull Request: #110492
43829d354f Fix #110426: render hanging when drawing metadata in the image editor
Release must be called regardless if the returned image buffer pointer
is null.
818c4980a7 Cycles: Replace Sheen model in the Principled BSDF
This replaces the Sheen model used in the Principled BSDF with the
model from #108869 that is already used in the Sheen BSDF now.

The three notable differences are:
- At full intensity (Sheen = 1.0), the new model is significantly
  stronger than the old one. For existing files, the intensity is
  adjusted to keep the overall look similar.
- The Sheen Tint input is now a color input, instead of the
  previous blend factor between white and the base color.
- There is now a Sheen roughness control, which can be used to
  tweak the look between velvet-like and dust-like.

Pull Request: #109949
587abd7c86 Update OBJ parser tests for Principled BSDF Sheen versioning change
Eventually this will need to be updated for the new Sheen in general,
but we should probably wait with that until all breaking changes for
the Principled BSDF are done.
d1a67e2d74 code_clean: skip "parenthesis_cleanup" in macro definitions
Don't remove parenthesis in macro definitions as it's important to keep
parenthesis around arguments.
68907d0371 Cleanup: various C++ cleanups
- Use C++ headers.
- Use function style cast.
- Use boolean literals.
- Remove redundant struct, void.
- Correct struct comment ID's.
63fd15ade0 Cleanup: use snake case, especially for structs that define callbacks
Use snake case for ShaderFxTypeInfo, ModifierTypeInfo,
GpencilModifierTypeInfo & bConstraintTypeInfo.
381299e04c Keymap: restore mirror transform shortcut in weight paint mode
Unintentionally removed in [0]. Weight paint transform should always
follow pose-mode transform.

[0]: d7558a243c
7b328093cc Fix: Mesh face normal calculation can give zero vectors
Triangles and quads don't check for degenerate faces (where the normal
might be zero), while ngons already set the Z component to 1 for that,
which is also what we do for vertex normals.

Also reorder the face size checks to put quads and triangles before
N-gons, since they are typically more common on high-poly meshes.
And change the check for 2 sided faces into an assert.
c784aee832 Fix #110508: Text Object Select Attributes in Object Mode
Status of selected bold, italics, underline, and small caps requires
that the curve have an editfont object. Not checking for this works
interactively but can cause errors in Python. This PR adds explicit
getters and setters that check for editfont.

Pull Request: #110513
f44541077c RNA: fail with an error when unused callbacks are assigned
Exit and fail when set callbacks are assigned to read-only properties
as well as array callbacks for non-array properties.
036bdac08a Cleanup: internal keymap function names
- Use km_edit_ prefix for edit-modes.
- Rename "curve" to "curve_legacy".
- Consistent naming for naming for vertex/face selection mask.
- Group object/grease-pencil/paint/edit mode key-map functions together.
65fe463f22 Fix paint stroke "mode" property being reused when weight painting
Binding a key to weight-paint with mode set (invert/smooth for e.g.)
caused regular weight painting to reuse this setting.

Don't reuse paint "mode" between strokes.
This also allows the default to be removed from the key-map.
bb025beebc Fix region toggle pie menu exception on unknown regions
Loading a blend file with unknown regions would raise an exception.
Also remove exception where channels were skipped when the attribute
isn't found as it's no longer needed.
46e1f2c7a3 Keymap: simplify default keymap for paint modes
Part of design task #105298 to improve overall consistency.

This removes various shortcuts unused or blocking shortcuts:

- Brush tool shortcuts
  - Mesh sculpt mode shortcuts
     - `X` = Draw
     - `Shift S` = Smooth
     - `P` = Pinch
     - `I` = Inflate
     - `G` = Grab
     - `L` - Layer
     - `Shift T` = Flatten
     - `C` = Clay
     - `Shift C` = Crease
     - `K` = Snake Hook
     - `M` = Mask
  - `D` = Gpencil Vertex Paint - Draw brush

- Duplicate dyntopo shortcut for editing detail size

- Grease Pencil: Undocumented draw tool specific guide shortcuts:
  - `O`, `J`, `Alt J`, `K`, `Alt K`, `Shift K`, `L`, `Alt L`, `Ctrl L`,
    `V`, `M`, `C` & `Alt C`

- `L` = Gpencil: "Alternate" operator shortcut

Also moved erasing box and lasso gesture shortcuts out of specific tools
and into the Draw mode overall.

Ref !108712.
9d946123f7 Animation: Disable NLA mapping if no NLA tracks are present
The drawing code executed NLA mapping code
even though there were no tracks to be mapped.

Disabling this takes the `draw_fcurve` function
from ~1130μs to ~985μs (heavy example scene with dense data)
~13% faster
Of course this only applies when not using the NLA.
And the performance benefit is larger, the more curves are on screen

Pull Request: #110306
05790971ec GPv3: Cleanup: Looping over frames in a layer
Use structured binding declaration to unwrap the item into `frame_number` and `frame`.
Makes the code more readable.

Pull Request: #110525
1cb6abf282 Refactor: anim, small refactor of armature drawing code
- Introduce `UnifiedBonePtr` to avoid having to pass `(EditBone *eBone,
  pPoseChannel *pchan)` everywhere.
- Introduce `eArmatureDrawMode` and store that on the
  `ArmatureDrawContext`, to avoid having to pass `bArmature *arm` and
  then doing `arm->flag & ARM_POSEMODE` everywhere.
- Use the `eBone_Flag` type instead of `int`.
- Deprecate the `ARM_POSEMODE` armature flag. It is no longer necessary,
  and also it was changing DNA data from the draw functions. The flag
  was basically purely runtime-only, to pass some information to
  lower-level drawing code, yet it was stored in DNA. It has been
  replaced by the `eArmatureDrawMode`  on the context.

Note that some comparisons `eBone != nullptr` (often using the implicit
conversion of pointer to boolean) have been replaced by a comparison to
`ctx->draw_mode`. This is used in cases where the pointer comparison was
actually indicative of the draw mode, and to help get the `else if
(draw_mode == ARM_DRAW_MODE_POSE)` symmetrical.

Disclaimer: this `UnifiedBonePtr` can probably be used in many other
places in Blender as well. We might move it somewhere else in the
future, but to keep things simple I just want to see how it behaves
locally first.

Pull Request: #110424
bfce13fbef GPv3: Send notifiers and undo push when changing the active layer
Use RNA to update the active layer and also do an undo
push in `on_activate` function of tree-view. This is now
possible after recent refactor: 741c684bf6, 2e9bc6373c

Part of: #110133

Pull Request: #110378
f385870900 Refactor: anim, avoid passing `constflag` everywhere
Add a `UnifiedBonePtr::constflag()` function to grab the `constflag` from
the bone, so that it doesn't have to be passed as a separate parameter
to every drawing-related function.

No functional changes.
fdc0ba7e8f Refactor: anim, drawing code, split up `get_pchan_color` into three funcs
In the Armature drawing code, split up `get_pchan_color()` into three
separate functions. It was basically one big `switch` with three
`case`s, and there were three calls of the function, each with its own
hard-coded parameter value, one for each `case`.

This now also makes it clear that two of those functions always write to
their return parameter, and thus copying a default color 'just in case'
is no longer necessary, reducing the parameter counts even more.

No functional changes.
37764d9ed5 GPv3: Return correct mode in `BKE_paintmode_get_active_from_context`
Previously this function would return `PAINT_MODE_TEXTURE_2D`.
This would result `paint_space_stroke_enabled` to return true, when it
shouldn't for Grease Pencil .
eec2f80803 Refactor: anim, make `ArmatureDrawContext *ctx` parameters `const`
In the Armature drawing code, make `ArmatureDrawContext *ctx` parameters
`const` wherever possible.

No functional changes.
d0c9fc6666 Fix #107918: Weight Gradient tool paints over locked vertex groups
Exit the operator code if `DG_LOCK_WEIGHT` flag is set
for active vertex group to avoid painting over locked vertex
group. New function `BKE_object_defgroup_active_is_locked`
created to handle this.
d0e63143fd Refactor: Move tile highlight logic outside of Render
Allows to generalize the API a bit more, getting closer to
a situation when RenderEngine::re points to a baseclass of
the Render.
1c124a5769 Cleanup: Remove unused argument from the tile highlight API
The Render is always an owner of the highlighted tiles, and freeing
is never needed.

Pull Request: #110294
bc989d38f3 GPv3: Option to use tablet pressure for the eraser
The eraser tool now calibrates its radius according to the pressure only if the Use Pressure option is enabled.

Pull Request: #110460
bfc956443c Fix image projection paint with "mode" set to "Smooth"
Setting the paint.image_paint mode to smooth did nothing,
now it uses the soften tool as expected.
a949575785 Fix: avoid appending graph inputs multiple times
This didn't lead to problems in practice, because the sockets
were deduplicated later on in `GraphExecutor` by putting
them into a `VectorSet`.
1fb8210dfe Fix #110497: Quick favorites can be duplicated
Mistake in adb370e6ba
Skip "add to quick favorites" button from context menu when button is
found in user_menu.

Pull Request: #110517
87aff3429f Fix vertex paint color sample on some GPU's under Wayland
Support sampling vertex colors when WM_CAPABILITY_GPU_FRONT_BUFFER_READ
isn't supported (see #106264).
6ca38a90b4 Cleanup: various C++ cleanups
- Use C++ headers.
- Use function style cast.
- Use boolean literals.
- Remove redundant struct, void.
- Correct struct comment ID's.
c547655a13 UI: Rename 'Proportional Influence' to 'Proportional Editing' in tooltip
"Proportional Editing" is the term officially used by the Blender
community to describe this specific feature.

Also, "Proportional Editing" seems to be more descriptive than
"Proportional Influence", as it emphasizes the ability to
proportionally edit the areas around the selection.
c33ad8f7d5 Cleanup: use boolean for GpencilModifierTypeInfo::is_disabled
Also rename user_render_params to use_render_params
(matching object modifiers).
a9dc8b64fb Fix doc builder using C version of bmesh_opdefines
The file bmesh_opdefines.c was recently converted to bmesh_opdefines.cc,
but the manual builder was not updated accordingly.

Also, update some comments in the code which were still mentioning the C
version of this file.

Pull Request: #110532
9e56c04669 Fix #110210: Hide Value option doesn't work on color sockets
Regression caused by 7026096099.
Original error introduced in 46fff97604.
Name hadling isn't problem of a declaration matching functions.

Pull Request: #110225
99e942228c Refactor: Anim, abstractions for armature layers
Add an API for armature layer access. Instead of accessing `arm->layer`
and friends directly, the code now uses this API. This will make things
easier to replace by bone collections in the future.

The functions are named "bonecoll" (short for "bone collection"), as
that's the soon-to-be-introduced replacement for armature layers. This
API is the first step towards that replacement, and should help to
reduce the changes necessary when functional changes are committed.

This also creates a new module `source/blender/animrig` for Animation &
Rigging code. This will, for example, house the bone collection system
in the near future.

There is a bunch of code currently spread across blenkernel and editors
in a rather ad-hoc way; it is intended that at some point that code gets
moved into `animrig` as well (or at least the subset of that code where
such a move makes sense; brain still required).

Ref: #108941

No functional changes.
755b99f996 Anim: Cleanup: Move `CfraElem` struct to editors
This struct was defined in `BKE_fcurve.h` but only used in editor files.
The only function that used this struct in BKE was marked unused.

This commit removes the unused BKE function and moves the struct
to `ED_keyframes_edit.h`.

Pull Request: #110527
Almaz-Shinbay added 1 commit 2023-07-27 16:27:38 +02:00
Almaz-Shinbay added 2 commits 2023-07-27 17:51:28 +02:00
Julian Eisel approved these changes 2023-07-27 18:41:24 +02:00
Julian Eisel merged commit 790cbeda2c into main 2023-07-27 18:42:15 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#110371
No description provided.