Outliner: Port deform group elements to new tree-element code design #110003

Merged
Julian Eisel merged 162 commits from :temp-defgroup-refactor into main 2023-07-27 17:36:48 +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 deform group 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 deform group elements.
Almaz-Shinbay added 1 commit 2023-07-12 11:21:40 +02:00
Almaz-Shinbay requested review from Julian Eisel 2023-07-12 11:22:43 +02:00
Almaz-Shinbay added 1 commit 2023-07-17 15:27:09 +02:00
Almaz-Shinbay added 1 commit 2023-07-24 11:08:22 +02:00
Julian Eisel approved these changes 2023-07-27 12:22:19 +02:00
Julian Eisel left a comment
Member

I was wondering if we could have some generic TreeElementIDSubdata type, so we don't have to add a bunch of specific tree element types just containing an ID and some subdata pointer. The subdata could be stored in a generic way, like with std::any. But I'm not sure how much this actually improve. So I think it's better to leave that as a possible further improvement.

I was wondering if we could have some generic `TreeElementIDSubdata` type, so we don't have to add a bunch of specific tree element types just containing an ID and some subdata pointer. The subdata could be stored in a generic way, like with `std::any`. But I'm not sure how much this actually improve. So I think it's better to leave that as a possible further improvement.
@ -246,2 +246,4 @@
id = static_cast<EditBoneElementCreateData *>(idv)->armature_id;
}
else if (type == TSE_DEFGROUP) {
id = reinterpret_cast<ID *>(static_cast<DeformGroupElementCreateData *>(idv)->object);
Member

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

`id = &static_cast<DeformGroupElementCreateData *>(idv)->object->id;`
Almaz-Shinbay marked this conversation as resolved
Almaz-Shinbay added 157 commits 2023-07-27 17:22:50 +02:00
Just use RAII, no need to track extra initializer state.
No functional changes.
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
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
The logic of `ViewOpsData::dyn_ofs` was scattered and confusing.

Confining it to a function makes initialization and usage clearer.
This reorganization makes the code more modular and makes it easier to
identify and fix possible errors in the future.
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.
This deduplicates the code and will make it easier to integrate this
operator into the overall navigation utility.
This deduplicates the code and will make it easier to integrate this
operator into the overall navigation utility.
Use the `view` prefix to better identify the hierarchy of these files.
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
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
Caused by 329cf07499
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
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.
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
Some declarations were outside the `#ifdef WITH_INPUT_NDOF`, but still
referred to things inside that block. Now everything is inside the file.
Porting fix from upstream:

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

This can now happen in SequenceHandle::seek.
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
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
Avoid the initial copy, and avoid moving from a const reference.
- "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
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
Also remove two unused variables
Hides Spreadsheet editor scroll bars when not needed.

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

Pull Request: #110404
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.
`typedef unsigned int uint;` could be converted into
`typedef uint uint;`.

Resolve by skipping instances of unsigned that follow a typedef.
Many struct removals were being tested which always failed.
Avoid testing removal of forward declarations & struct declarations.
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.
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.
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
Also give more details about the used CPU and compiler.
- 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
<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.
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
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
Exporting & importing the key-map changed results,
resolve by using float literals.
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
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
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
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
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.
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>
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
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
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
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.
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.
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
Found during Hydra render engine development, could also happen with
render engine add-ons.
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.
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
Sorry for the noise, I thought I ran this in the previous commit.
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.
Recent C++ conversions have enabled more changes like
af53207b43 and 7826aed105.
Also slightly improve comments about original indices.
- 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.
Also use doxygen type references & correct some typos.
This was removed in a recent refactor, also use a more meaningful
argument name.
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.
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.
The header was not included, define ulong locally.
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
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
There was some inconsistencies between GLSL and MSL
regarding vector comparison.
Prior to that, the Draw tests would be missing.
These were just changes that changed the test
output but not the behavior.
Also see #103343.

Pull Request: #110493
The toolbar is only one kind of region that can be toggled.
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.
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
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.
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.
Also see #103343.

Pull Request: #110495
Also see #103343.

Pull Request: #110489
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`.
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.
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
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
The fix in commit d9273d857 exposed a pre-existing issue in the code.
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
Release must be called regardless if the returned image buffer pointer
is null.
Also see #103343.

Pull Request: #110505
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
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.
Don't remove parenthesis in macro definitions as it's important to keep
parenthesis around arguments.
- Use C++ headers.
- Use function style cast.
- Use boolean literals.
- Remove redundant struct, void.
- Correct struct comment ID's.
Use snake case for ShaderFxTypeInfo, ModifierTypeInfo,
GpencilModifierTypeInfo & bConstraintTypeInfo.
Unintentionally removed in [0]. Weight paint transform should always
follow pose-mode transform.

[0]: d7558a243c
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.
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
Oversight in 8d9422cfe3.
Exit and fail when set callbacks are assigned to read-only properties
as well as array callbacks for non-array properties.
- 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.
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.
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.
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.
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
Use structured binding declaration to unwrap the item into `frame_number` and `frame`.
Makes the code more readable.

Pull Request: #110525
- 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
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
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.
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.
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 .
In the Armature drawing code, make `ArmatureDrawContext *ctx` parameters
`const` wherever possible.

No functional changes.
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.
Allows to generalize the API a bit more, getting closer to
a situation when RenderEngine::re points to a baseclass of
the Render.
The Render is always an owner of the highlighted tiles, and freeing
is never needed.

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

Pull Request: #110460
Setting the paint.image_paint mode to smooth did nothing,
now it uses the soften tool as expected.
This didn't lead to problems in practice, because the sockets
were deduplicated later on in `GraphExecutor` by putting
them into a `VectorSet`.
Also see #103343.

Pull Request: #110529
Mistake in adb370e6ba
Skip "add to quick favorites" button from context menu when button is
found in user_menu.

Pull Request: #110517
Support sampling vertex colors when WM_CAPABILITY_GPU_FRONT_BUFFER_READ
isn't supported (see #106264).
- Use C++ headers.
- Use function style cast.
- Use boolean literals.
- Remove redundant struct, void.
- Correct struct comment ID's.
"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.
Also rename user_render_params to use_render_params
(matching object modifiers).
Also see #103343.

Pull Request: #110509
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
Regression caused by 7026096099.
Original error introduced in 46fff97604.
Name hadling isn't problem of a declaration matching functions.

Pull Request: #110225
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.
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
A continuation of the previous change. It was not enough to
simply point the script to the new file, the actual parsing
needed to be updated as well.

This is a minimalistic change which converts the file to the
old C-style format, just to restore the working state of the
CI/CD.

It is a bit fragile, and surely a more future-proof solution
is possible to work on.

Pull Request: #110536
Since in rare cases there may be needs to expose file subversion here,
the following format was defined:

  <major>.<minor> (sub <subversion>)

Part of #109151 (PR !110109).
Required to make 4.0 files readable by 3.6 once the compatibility
changes are backported to the LTS releases.

Part of #109151 (PR !110109).
This implements the main aspects of changes to blendfile compatibility
as designed in #109151:
* Blender files which file minversion is newer than current Blender
  executable won't be loaded at all.
* Blender files which file version is newer than current Blender will
  triger systematic warning to user:
  * In the status info bar (lower right corner in default UI).
  * When attempting to save (overwrite) them.

This means that the file minversion becomes a hard limit, and not a
soft, warning-only as it used to be. Further more, forward compatibility
warning is now systematic (instead of depending on file minversion),
and more visible for users.

See also https://wiki.blender.org/wiki/Process/Compatibility_Handling
for details over the new policy.

Technically:
* Opening any file with a minversion newer than current Blender file one
  now triggers an early abort, with an error message reported to the user.
  This is handled by a new utils called from `blo_decode_and_check`.
* Any file newer than current Blender version sets a new
  `has_forward_compatibility_issues` flag in Main struct at read time.
* Status bar info area is turned into a template, which uses this flag
  to display special warning UI and tooltip when set.
* A new confirmation popup appears when user tries to save (overwrite)
  such a 'newer' blendfile, stating potential loos of data, and
  proposing by default to 'save as' instead.
* The 'quit unsaved' popup has also been updated to 'save as' instead of
  'save' when the edited file is has potential forward compitibility
  issues.

Part of #109151 (PR !110109).
`BKE_blendfile_is_readable` attempts to open the given file path, and
return `true` on success, `false` on failure.

Part of #109151 (PR !110109).
In case a blend file opening fails (in the context of library content
listing, e.g. for linking or appending), the File Browser would just
show an emtpy window.

With the new comnpatibility policy, this will now become a fairly common
situation, which requires giving proper explanations to the user.

This commit re-uses and extends the system used to display errors
messages from the Asset browser.

Part of #109151 (PR !110109).
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 a new class for particle system elements.

Pull Request: #110245
Almaz-Shinbay added 1 commit 2023-07-27 17:28:11 +02:00
Author
Contributor

I was wondering if we could have some generic TreeElementIDSubdata type, so we don't have to add a bunch of specific tree element types just containing an ID and some subdata pointer. The subdata could be stored in a generic way, like with std::any. But I'm not sure how much this actually improve. So I think it's better to leave that as a possible further improvement.

Okay, I'll will note that and try to look soon

> I was wondering if we could have some generic `TreeElementIDSubdata` type, so we don't have to add a bunch of specific tree element types just containing an ID and some subdata pointer. The subdata could be stored in a generic way, like with `std::any`. But I'm not sure how much this actually improve. So I think it's better to leave that as a possible further improvement. Okay, I'll will note that and try to look soon
Member

I was wondering if we could have some generic TreeElementIDSubdata type, so we don't have to add a bunch of specific tree element types just containing an ID and some subdata pointer. The subdata could be stored in a generic way, like with std::any. But I'm not sure how much this actually improve. So I think it's better to leave that as a possible further improvement.

Okay, I'll will note that and try to look soon

I'd look at it more as an experiment. Honestly I'm not sure if it will be worth it.

> > I was wondering if we could have some generic `TreeElementIDSubdata` type, so we don't have to add a bunch of specific tree element types just containing an ID and some subdata pointer. The subdata could be stored in a generic way, like with `std::any`. But I'm not sure how much this actually improve. So I think it's better to leave that as a possible further improvement. > > Okay, I'll will note that and try to look soon I'd look at it more as an experiment. Honestly I'm not sure if it will be worth it.
Julian Eisel added 1 commit 2023-07-27 17:35:47 +02:00
Julian Eisel merged commit 8214109778 into main 2023-07-27 17:36:48 +02:00
Almaz-Shinbay deleted branch temp-defgroup-refactor 2023-07-27 17:52:24 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#110003
No description provided.