Age | Commit message (Collapse) | Author |
|
|
|
|
|
Operators are one of the last places in Blender to use older UI designs
that don't fit in with recent style conventions. This commit updates
these custom operator UI callbacks for consistency and clarity.
Some of the code is also simplified a lot. Some of the older operator layouts
were much more complex (in terms of code) than they needed to be.
See the differential revision for a before and after screenshot
of each operator.
Differential Revision: https://developer.blender.org/D8326
|
|
When overriding a whole linked collection from a single object in
3DView, said 'reference' object would be removed by code. We only want
that behavior when overriding from an instanciating Empty.
|
|
This is to match the option name and to avoid confusion with
workbench xray mode.
|
|
Added support for transforming only origins with greasepencil objects.
The new functions is based on BKE_gpencil_transform. That is why there is FIXME statements in there.
Reviewed By: Campbell, Antonio
Differential Revision: http://developer.blender.org/D8303
|
|
in some cases.
Having a directly linked object does not always mean it should be
considered as really overridable...
|
|
That project cannot be opened correctly ayway, it has recursive
collections intanciating themselves...
But at least now we have a check at startup to detect and 'fix' those
nasty cycles in collections.
|
|
Custom driver functions need access to the dependency graph that is
triggering the evaluation of the driver. This patch passes the
dependency graph pointer through all the animation-related calls.
Instead of passing the evaluation time to functions, the code now passes
an `AnimationEvalContext` pointer:
```
typedef struct AnimationEvalContext {
struct Depsgraph *const depsgraph;
const float eval_time;
} AnimationEvalContext;
```
These structs are read-only, meaning that the code cannot change the
evaluation time. Note that the `depsgraph` pointer itself is const, but
it points to a non-const depsgraph.
FCurves and Drivers can be evaluated at a different time than the
current scene time, for example when evaluating NLA strips. This means
that, even though the current time is stored in the dependency graph, we
need an explicit evaluation time.
There are two functions that allow creation of `AnimationEvalContext`
objects:
- `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float
eval_time)`, which creates a new context object from scratch, and
- `BKE_animsys_eval_context_construct_at(AnimationEvalContext
*anim_eval_context, float eval_time)`, which can be used to create a
`AnimationEvalContext` with the same depsgraph, but at a different
time. This makes it possible to later add fields without changing any
of the code that just want to change the eval time.
This also provides a fix for T75553, although it does require a change
to the custom driver function. The driver should call
`custom_function(depsgraph)`, and the function should use that depsgraph
instead of information from `bpy.context`.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D8047
|
|
Only the delete shortcut applies here, although the move up and down
operators can optionally be assigned in the keymap.
See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
grease pencil modifier panel implementation, which is the same.
Some refactoring of the constraint delete operator was necessary,
including adding an invoke function.
Differential Revision: https://developer.blender.org/D8238
|
|
BKE_lib_override.
This code is fairly complex and can be used in more places, better not
duplicate that logic and just have it in BKE area.
|
|
|
|
When the mesh is linked, the materials can not be available or be the same assigned to mesh. Now, if the mesh is linked, a simple two materials conversion is used.
To get the full list of materials, the mesh must not be linked.
Also checked some indexes to be sure never get a wrong value and that materials are not created again and again.
|
|
Removed the 'select main object to override' menu when overriding an
instanced collection, this was no more used anyway.
Added new behavior allowing to select which directly linked collection
to override when trying to override an inderctly linked object. This
allows to link collections without instancing them with an empty object,
select one of their objects, and call override operator.
|
|
This reverts commit 03c8b048a166584a72ceff08432401cd7047648c.
This commit re-introduced T76837.
While there is a comment explaining why this function is needed,
the naming of the poll function does make this confusing.
The API could be changed to avoid confusion here.
|
|
|
|
This is fairly generic code that can be re-used in other places.
|
|
Code is mature enough now to not need this anymore, people who do not
want to use liboverrides can just not create them.
|
|
overrides.
This is long work, we are still likely missing a lot of cases...
|
|
|
|
Note that this behavior is enforced on user level for now, but on code
side it is controlled with a flag, which should make it easy to refine
that behavior if needed.
Only exception is when we duplicate a linked ID directly (then we assume
user wants a local deep-copy of that linked data, and we always also
duplicate linked sub-data-blocks).
Note that this commit also slightly refactor the handling of actions of
animdata, by simplifying `BKE_animdata_copy_id_action()` and adding an
explicit new `BKE_animdata_duplicate_id_action()` to be used during ID
duplication (deep copy).
This also allows us to get rid of the special case for liboverrides.
|
|
Duplication and deletion code of modifiers was totally wrong for
particle system, that special weird thing needs its own custom
management.
Note that for now I chose not to duplicate the particle settings ID when
duplicating the modifier...
|
|
This can be useful to save the result of a cloth simulation as a
shape key without destroying the simulation, so it's possible to
e.g. re-run it to get other shapes, or simply use the new shape
key to start the simulation already in a draped state.
It also makes sense to allow applying as shape key even when the
mesh is shared, because the operation itself just adds a shape
key. To support this, split the apply operator into Apply and
Apply As Shapekey so that they can have different poll callbacks.
Differential Revision: https://developer.blender.org/D8173
|
|
|
|
Only the delete shortcut applies here, although the move up and down
operators can optionally be assigned in the keymap.
See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
grease pencil modifier panel implementation, which is the same.
|
|
This adds a notification type for shaderfx so the properties editor can
be properly notified to redraw.
Another possible solution would be to also redraw the shaderfx tab
with a ND_MODIFIER update, but this solution allows us to avoid
some unecessary redraws too. There were no existing cases of
ND_OBJECT | NC_MODIFIER updates, so those cases were
removed from buttons_area_listener.
Differential Revision: https://developer.blender.org/D8159
|
|
|
|
Instead of manually checking the pinned object, use the existing
ED_object_active_context function. This requires adding const
to the context in that function.
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/object` module.
No functional changes.
|
|
|
|
Reviewed By: sergey
Maniphest Tasks: T78525
Differential Revision: https://developer.blender.org/D8181
|
|
|
|
Caused by refactor of duplicate code in rBad6cccf058d0, we need to take
into account the duplication of groups of objects here too...
|
|
Prevent operators that should not perform on override data to be
callable in those cases.
|
|
This one now uses a generic 'dependency detection' process to decide
which IDs should be overridden.
This will e.g. allow to override mesh and shapekeys when those have some
values controlled by drivers using an armature bone...
|
|
See rB1fa40c9f8a81 for more details. The implementation is the same.
The only difference to the mesh modifier commit is a slight rework of
edit_modifier_invoke_properties in order to pass through to check for
other keymap items with the same shortcut.
|
|
The shortcuts act on the modifier with its panel under the mouse.
The following shortcuts are enabled by default:
- Remove modifier: X, Delete
- Apply modifier: Ctrl A
- Duplicate modifier: Shift D
More shortcuts can be added in the keymap.
Each panel can now store a custom data RNA pointer, and a new
function is added to get the custom data for the panel under the
cursor. This custom data could be used to refactor the "List Panel
System" to generalize it and integrate it further with RNA.
The same functionality will be added in further commits where it
applies to constraints, grease pencil modifiers, and effects.
Differential Revision: https://developer.blender.org/D8031
|
|
|
|
Previously, the text rotation was always calculated in object space, so
the text rotation always had the object rotation applied. Now the
rotation is calculated in world space, so it always aligns correctly to
the view. Same applies to text scale not taking into account the object
position.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8068
|
|
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time.
This commit includes:
- SCULPT_UNDO_COLOR for undo support in sculpt mode
- SCULPT_UPDATE_COLOR and PBVH flags and rendering
- Sculpt Color API functions
- Sculpt capability for sculpt tools (only enabled in the Paint Brush for now)
- Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint)
- Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint)
- Remesher reprojection in the Voxel Remehser
- Paint Brush and Smear Brush with color smoothing in alt-smooth mode
- Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors
- Color Filter
- Color picker (uses S shortcut, replaces smooth)
- Color selector in the top bar
Reviewed By: brecht
Maniphest Tasks: T72866
Differential Revision: https://developer.blender.org/D5975
|
|
This replaces the cmake options `WITH_NEW_OBJECT_TYPES` and
`WITH_NEW_SIMULATION_TYPE` with two experimental userpref settings:
* `use_new_particle_system`: Enables the point cloud type and the simulation editor.
* `use_new_hair_type`: Only displays the add-operator in the add menu for now.
Note, in the current state you can't do anything productive with the new particle
system or the new hair type. Features will be added step by step in the upcoming
weeks and months.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D8096
|
|
When neither bounds or median is selected, snapping the cursor to
the selection was using bounds which often doesn't give useful results.
Resolves T78135
|
|
Instead to use ShaderFx, use Effect and also fixed some wrong cases using Modifier word.
|
|
This patch implements the list panel system D7490 for grease pencil
shader effects. It also moves their drawing to a callback in
ShaderFxTypeInfo in line with the extensible architecture refactoring
goal T75724.
The implementation is basically exactly the same as for the modifier
patch (9b099c86123fc82).
Thanks to Matias Mendiola (@mendio) for helping to develop the layout
changes.
Differential Revision: https://developer.blender.org/D7985
|
|
This patch implements the list panel system D7490 for grease pencil
modifiers. It also moves their drawing to a callback in
GpencilModifierTypeInfo in line with the extensible architecture
refactoring goal T75724.
This also adds the "set_error" function for grease pencil modifiers,
which hadn't been copied from mesh modifiers yet.
The implementation is basically exactly the same as for the modifier
patch (9b099c86123fc82).
Thanks to Matias Mendiola (mendio) for providing mockups for many
of the layout changes.
Differential Revision: https://developer.blender.org/D7978
|
|
This patch implements the list panel system D7490 for constraints.
In this case the panels are still defined in Python.
The layouts are also updated to use subpanels and the a more organized
single column layout. There may be more tweaks necessary for the
layouts.
Reviewed By: Severin, billreynish, Mets
Differential Revision: https://developer.blender.org/D7499
|
|
|
|
|
|
|
|
This way "New Collection" is always assigned the same shortcut (N).
Whereas previously it would be automatically assigned the leftover key
from the list of available collections.
Nice side effect is that since N is next to M in most keyboard layouts,
moving to a new collection is super fast by hitting M then N.
{F8630575, size=full}
Paper-cut pointed out by DerekWatts on [devtalk](https://devtalk.blender.org/t/blender-ui-paper-cuts/2596/4211) (thanks!):
{F8630492, size=full}
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D8067
|