Age | Commit message (Collapse) | Author |
|
All callers replace this with OB_MODE_EDIT_GPENCIL.
|
|
|
|
Mode switching passed through when the mode wasn't supported for all
modes except particle edit-mode.
Add a check to ED_object_mode_compat_test to prevent the error message.
|
|
This implements the changes discussed in T87134 for including switch
object funcionality in 2.93. This includes:
- Remove the switch object operator experimental option
- Remove the option for switching objects in Edit Mode.
- Rename switch_object to transfer_mode.
- Enable the operator only in sculpt mode.
- Expose the operator in the Sculpt menu with an eyedropper modal
option.
On later releases, we could revisit enabling the operator in other mode
and object types as well as its place in the UI.
Reviewed By: JulienKaspar, JacquesLucke
Differential Revision: https://developer.blender.org/D10953
|
|
|
|
As proposed in T74432 and already implemented in several commits,
"region" is the preferred name for `ARegion` variables, rather than
any variant of "ar". This commit changes a few "ar" variables that have
popped up over time and also adjusted names of variants like "arnew".
|
|
object.switch_object no longer adds multiple undo steps
from a user perspective.
|
|
Replace ED_transform_snap_object_context_create with
ED_view3d_give_base_under_cursor & ED_view3d_autodist_simple so object
visibility is respected and non-geometry objects can be supported.
Ref D9255
|
|
This fixes the crash and the assert, but undo is done in multiple steps
Reviewed By: campbellbarton
Maniphest Tasks: T81076
Differential Revision: https://developer.blender.org/D9256
|
|
The operator has some problems with Undo, so better put it in
experimental for now.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D9007
|
|
This is for return arguments, also remove redundant NULL check.
|
|
Unused variables, missing include for declaration, missing 'static'
specifier. Also rename function to match naming convention.
|
|
This object operator exits and frees the edit data of the
current object and enters the same mode in another one in a single step,
without going through object mode or keeping multiple edit object data
active. It is assigned to the D key.
This solves all conflicts that the right/click select keymap and the
emulate 3 button mouse produces for this operation and it is independent
of the state of Lock object modes.
Also, as the SculptSession is freed, when using Multires objects go
back to their preview resolution level, so it is possible to work on
high vertex count scenes without slowing down the viewport and other
performance problems.
Reviewed By: #user_interface, pablovazquez
Differential Revision: https://developer.blender.org/D7510
|
|
|
|
Some underlying functionality was not ready for greasepencil:
- BKE_modifiers_get_virtual_modifierlist (now introduce dedicated BKE_gpencil_modifiers_get_virtual_modifierlist)
- BKE_modifiers_is_deformed_by_armature
- checks in drawing code
- checks in (pose) selection code
A couple of changes to make this work:
- `eGpencilModifierType_Armature` has to be respected (not only `eModifierType_Armature`)
- `OB_MODE_WEIGHT_GPENCIL` has to be respected (not only `OB_MODE_WEIGHT_PAINT`) -- (now use new `OB_MODE_ALL_WEIGHT_PAINT`)
- `gpencil_weightmode_toggle_exec` now shares functionality from `wpaint_mode_toggle_exec` -- moved to new `ED_object_posemode_set_for_weight_paint`
This patch will also set the context member "weight_paint_object" for greasepencil (otherwise some appropriate pose operators wont work when in weightpaint mode)
Reviewed By: campbellbarton
Maniphest Tasks: T63125
Differential Revision: https://developer.blender.org/D8483
|
|
|
|
When excluding a collection containing the active object in either
texture paint or particle edit mode, the object could not be reactivated
when the collection was re-enabled. This is because the object's mode
was left in TEXTURE_PAINT or PARTICLE_EDIT, and the activation code did
not have cases to handle these modes.
This moves the code that is run when toggling out of texture paint or
particle edit modes to functions so activation can properly toggle off
the respective interaction mode.
|
|
Functionality here has become confusing over time,
this removes duplicate, similar functions, preferring to set the mode
instead of toggle, enter, exit.
Mode switching utility function behaved differently regarding undo,
'ED_object_mode_toggle' for example didn't skip the undo push
where 'ED_object_mode_set' did.
Some callers chose these functions based on the intended undo behavior,
even when toggling didn't make sense.
There was also ED_object_mode_generic_enter which was similar to
ED_object_mode_set, instead of the reverse of ED_object_mode_generic_exit.
Simplify object mode switching internals:
- Replace ED_object_mode_generic_enter with ED_object_mode_set.
- Remove ED_object_mode_toggle as nearly all callers needed to check
the current mode so toggling would set the mode argument correctly.
- Use ED_object_mode_set for the object mode switching operator
to simplify logic.
- Add ED_object_mode_set_ex which has an argument to disable undo,
needed when loading undo data needs to set the mode.
- Remove unused ED_object_mode_exit.
|
|
In some cases moved the checks into asserts,
to ensure changes in the future don't cause
the checks to become necessary again.
|
|
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.
Also, a huge code cleanup has been done at all levels.
Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.
Differential Revision: https://developer.blender.org/D6293
|
|
While these aren't currently used, its strange to have
extended versions of a function without the non-extended versions
it also avoids callers needing to add them back if they need -
or duplicating the same boiler plate when calling the '_ex' versions.
Reverts 11da3b132aff1, 11da3b132aff1, adds depsgraph argument
so the caller is responsible for the evaluation state.
|
|
This change ensures that operators which needs access to evaluated data
first makes sure there is a dependency graph.
Other accesses to the dependency graph made it more explicit about
whether they just need a valid dependency graph pointer or whether they
expect the graph to be already evaluated.
This replaces OPTYPE_USE_EVAL_DATA which is now removed.
Some general rules about usage of accessors:
- Drawing is expected to happen from a fully evaluated dependency graph.
There is now a function to access it, which will in the future control
that dependency graph is actually evaluated.
This check is not yet done because there are some things to be taken
care about first: for example, post-update hooks might leave scene in
a state where something is still tagged for update.
- All operators which needs to access evaluated state must use
CTX_data_ensure_evaluated_depsgraph().
This function replaces OPTYPE_USE_EVAL_DATA.
The call is generally to be done in the very beginning of the
operator, prior other logic (unless this is some comprehensive
operator which might or might not need access to an evaluated state).
This call is never to be used from a loop.
If some utility function requires evaluated state of dependency graph
the graph is to be passed as an explicit argument. This way it is
clear that no evaluation happens in a loop or something like this.
- All cases which needs to know dependency graph pointer, but which
doesn't want to actually evaluate it can use old-style function
CTX_data_depsgraph_pointer(), assuming that underlying code will
ensure dependency graph is evaluated prior to accessing it.
- The new functions are replacing OPTYPE_USE_EVAL_DATA, so now it is
explicit and local about where dependency graph is being ensured.
This commit also contains some fixes of wrong usage of evaluation
functions on original objects. Ideally should be split out, but in
reality with all the APIs being renamed is quite tricky.
Fixes T67454: Blender crash on rapid undo and select
Speculation here is that sometimes undo and selection operators are
sometimes handled in the same event loop iteration, which leaves
non-evaluated dependency graph.
Fixes T67973: Crash on Fix Deforms operator
Fixes T67902: Crash when undo a loop cut
Reviewers: brecht
Reviewed By: brecht
Subscribers: lichtwerk
Maniphest Tasks: T67454
Differential Revision: https://developer.blender.org/D5343
|
|
|
|
Now the modes are reset for grease pencil objects.
Differential Revision: http://developer.blender.org/D5138
Reviewers: @dfelinto
|
|
Make sure object is properly evaluated to the new state when
it is expected to.
Reviewers: brecht, mont29
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4985
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
Part of T59335.
|
|
|
|
|
|
modes.
Sculpt (and paint) modes rely on valid evaluated data at their initialization.
Added code to ensure that in `ED_object_mode_toggle()`, when relevant
toggle operator requires it (looks like sculpt/paint should be the only
ones affected, although particle edit may be too...).
|
|
Using operators to the object mode was resetting the tool.
See: T56865
|
|
|
|
This commit merge the full development done in greasepencil-object branch and include mainly the following features.
- New grease pencil object.
- New drawing engine.
- New grease pencil modes Draw/Sculpt/Edit and Weight Paint.
- New brushes for grease pencil.
- New modifiers for grease pencil.
- New shaders FX.
- New material system (replace old palettes and colors).
- Split of annotations (old grease pencil) and new grease pencil object.
- UI adapted to blender 2.8.
You can get more info here:
https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/
https://code.blender.org/2018/07/grease-pencil-status-update/
This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible.
Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
|
|
Conflicts:
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureExporter.h
source/blender/collada/DocumentExporter.cpp
source/blender/collada/DocumentExporter.h
source/blender/collada/SceneExporter.cpp
source/blender/collada/SceneExporter.h
source/blender/collada/collada.cpp
source/blender/collada/collada.h
source/blender/editors/armature/armature_edit.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/pose_transform.c
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_screen.h
source/blender/editors/io/io_collada.c
source/blender/editors/object/object_transform.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_window.c
source/blenderplayer/bad_level_call_stubs/stubs.c
|
|
|
|
|
|
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.
This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.
Differential Revision: https://developer.blender.org/D3152
|
|
This adds initial multi-object editing support.
- Selected objects are used when entering edit & pose modes.
- Selection & tools work on all objects however many tools need porting
See: T54641 for remaining tasks.
Indentation will be done separately.
See patch: D3101
|
|
This caused too many problems syncing object modes
with multiple objects/windows/workspaces, see: D3130 for details.
|
|
For 2.8 there is already a utility function for this,
wrap it - avoiding an undo step.
|
|
- Undo that changes modes currently asserts,
since undo is now screen data.
Most likely we will change how object mode and workspaces work
since it's not practical/maintainable at the moment.
- Removed view_layer from particle settings
(wasn't needed and complicated undo).
|
|
- Use a single undo history for all operations.
- UndoType's are registered and poll the context to check if they
should be used when performing an undo push.
- Mode switching is used to ensure the state is correct before
undo data is restored.
- Some undo types accumulate changes (image & text editing)
others store the state multiple times (with de-duplication).
This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`.
- Each undo step stores ID datablocks they use with utilities to help
manage restoring correct ID's.
Needed since global undo is now mixed with other modes undo.
- Currently performs each undo step when going up/down history
Previously this wasn't done, making history fail in some cases.
This can be optimized to skip some combinations of undo steps.
grease-pencil is an exception which has not been updated
since it integrates undo into the draw-session.
See D3113
|
|
Check if mode data exists before attempting to change the modes.
|
|
It was too tricky to know ahead of time if an object would still
be visible in the new window/workspace/scene/layer combination,
especially since other windows may share some of these data-blocks.
So store the context, make the change, then check if the object is
still visible, freeing mode data of it's not.
|
|
|
|
|