Age | Commit message (Collapse) | Author |
|
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
|
|
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
|
|
This clarifies logic in ED_object_add_generic_get_opts (see comments in
code).
Also following issues are adressed:
- do not enforce setting the op UI to WORLD when rotation is set (e.g.
on redo). This is not wrong (happens in world space), but is more
confusing than helpful (was added in own rB3b8a14a3c072).
- respect setting the User Preference to WORLD properly (could fail when
set to something else, then back to WORLD)
Maniphest Tasks: T69576
Differential Revision: https://developer.blender.org/D6943
|
|
Avoid accessing inline since it's often used multiple times.
In some cases it was already defined.
|
|
|
|
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.
Part of T72604.
|
|
Old Name New Name
========= =========
init_def_material BKE_materials_init
BKE_material_gpencil_default_free BKE_materials_exit
test_object_materials BKE_object_materials_test
test_all_objects_materials BKE_objects_materials_test_all
give_matarar BKE_object_material_array
give_totcolp BKE_object_material_num
give_current_material_p BKE_object_material_get_p
give_current_material BKE_object_material_get
assign_material BKE_object_material_assign
assign_matarar BKE_object_material_array_assign
give_matarar_id BKE_id_material_array
give_totcolp_id BKE_id_material_num
assign_material_id BKE_id_material_assign
clear_matcopybuf BKE_material_copybuf_clear
free_matcopybuf BKE_material_copybuf_free
copy_matcopybuf BKE_material_copybuf_copy
paste_matcopybuf BKE_material_copybuf_paste
BKE_material_init_gpencil_settings BKE_gpencil_material_attr_init
BKE_material_add_gpencil BKE_gpencil_material_add
BKE_material_gpencil_get BKE_gpencil_material
BKE_material_gpencil_default_get BKE_gpencil_material_default
BKE_material_gpencil_settings_get BKE_gpencil_material_settings
|
|
|
|
|
|
|
|
|
|
|
|
We can't use the fast path when the mesh is used by mulitple objects and so
slower sculpting is expected then. But fake users should not affect this. This
also fixes the same type of error in a few other areas.
|
|
Consistent with similar API functions.
|
|
### Description of the problem
Until now, it is only possible to correctly add a lightprobe in python via an operator:
`bpy.ops.object.lightprobe_add()`
### Description of the proposed solution
The idea of this patch is to fix the lack of consistency lightprobe creation without operator.
It allow creation of different lightprobe type directly via `bpy.data.lightprobes.new(name, type)` (such as for curves).
In order to make it possible I had to:
1. Add a function `BKE_lightprobe_configure` in charge of lightprobe settings configuration (avoid code redundancy)
2. Allow an object to take lightprobe datablock as data during is initialization.
### A short example of this patch usage
```
lp = bpy.data.lightprobes.new('some_name','PLANAR')
bpy.data.objects.new('toto', lp)
```
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6396
|
|
|
|
2.79 also did this [select the new instances] which was useful.
2.79 also kept the instancer selected [this patch deselects]
Reviewed By: mont29
Maniphest Tasks: T68191
Differential Revision: https://developer.blender.org/D6233
|
|
Comparison function of the of the parent ghash was not fully correct,
could lead to some false positives in some cases...
|
|
This was detected fixing T69459
Part of Differential Revision: https://developer.blender.org/D6045
Note: done in a separated commit to keep track of changes done not directly related to bug reported in T69459.
|
|
Also changed to create a grease pencil object for each curve.
Part of differential revision: https://developer.blender.org/D6045
|
|
Users now can turn on in a viewport collections that are temporarily
hidden (eye) in the view layer.
Design task: T61327
As for the implementation, I had to decouple the visibility in the
depsgraph from the visibility in the view layer.
Also there is a "bug" that in a way was there before which is some
operators (e.g., writing a text inside of a text object, tab into edit
mode) run regardless of the visibility of the active object. The bug was
present already (with object type visibility restriction) in 2.80 so if
we decide to tackle it, can be done separately (I have a patch for it
though P1132).
Reviewed by: brecht (thank you)
Differential Revision: D5992
|
|
|
|
Convention is to use (s) postfix for cases where there can be one or multiple,
so stay consistent with that.
This reverts commit 3e8276311ed17d12e8b47b4fe8e2f68c1ce8c603.
|
|
Differential Revision: https://developer.blender.org/D5729
|
|
Differential Revision: https://developer.blender.org/D5716
|
|
This commit adds support to convert curves to Grease Pencil strokes and create the materials too.
Also, there is a new python API. This API is required by the modified SVG import addon to create strokes( see T67065).
All curves selected in one operation are converted in the same Grease Pencil object.
|
|
Adds a toggle to the filter menu for outliner synced selection. Enabled
by default, this ensures selection is synced between objects, bones, and
sequences. An active outliner element theme color is added to indicate
which element is active.
Synced selection is controlled on the operator level. Each operator
that modifies selection for objects, bones, sequences, or outliner
elements needs to call the respective ED_outliner_select_sync_from..
function to tag outliners to be synced.
Syncing is done lazily on outliner draw.
|
|
No need to use BKE_object_where_is_calc() in this case: there is no
parenting or constraint system involved on object add.
So simply use direct object matrix calculation from it's local
transform. No need in dependency graph either in this case.
|
|
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
|
|
When `BKE_mesh_new_from_object()` cannot convert an object to a mesh, it
returns `NULL`. This case was not handled at all in
`BKE_mesh_new_from_object_to_bmain()` or `curvetomesh()`, causing a
segmentation fault.
This commit fixes the segmentation fault, and leaves the curve object as
a curve object.
Reviewed By: mont29, brecht, sergey
Differential Revision: https://developer.blender.org/D5217
|
|
instancing.
Preserving/rebuilding relashionships in recursive instancing was simply
not supported at all, code handling that was assuming a single level of
instancing.
This commit makes the following changes:
* Mixing DupliCollection and DupliVerts/Faces in the recursive chain is
now supported (by using a same GHash in all cases, differences of
persistent_id handling in hashing and comparison is now down inside the
relevant functions).
* When both "keep hierarchy" and "parent" options are enabled, code will
attempt to parent new objects to their version of instancer (instead of
parenting them systematically to the root object). This will preserve
the hierarchy much better.
* Collection is removed from dupli empties that have been made 'real'
(the duplication flag itself was already cleared, but the link to the
instantiated collection was kept).
|
|
|
|
|
|
This reverts commit 741967079c393a9eb6babd60c92a716fafa5d3e9.
We are in UI and API freeze, and this changes both.
|
|
The new name is consistent with the 'Transfer Shape' operator.
- Updated the UI descriptions for both transfer operators.
|
|
isosurface.
Not much to be done here really, besides adding yet another hack to that
giant pile of hacks that are mballs...
So to avoid newly created copy of basis of mball to influence to mball
computation, we simply switch it to Empty object for the depsgraph
update run.
Not nice, but working (besides a weird change of basis obflag which
should not happen), and presumably reasonably safe change.
|
|
Part of T56648
|
|
argument into account
- if a rotation is given, always take it into account [which means
setting alignment to ALIGN_WORLD prior]
- caused by recent rB06fe2a5e0c5d
Reviewers: brecht
Maniphest Tasks: T65878
Differential Revision: https://developer.blender.org/D5085
|
|
A lot of areas were querying sound information directly using audio handle
which does not exist on an original sound IDs.
This change basically makes it so it's possible to query information about
given sound ID, without worrying about whether it's loaded or not: if it is
needed to load it first it happens automatically (no automatically-opened
handles are left behind though).
While this seems a bit extreme to open files on such queries it is still
better than the old situation when all sound handles were opened on file
load, no matter if it's needed or not. Besides, none of the changed code
paths are performance critical, just handful of tools.
Fixes T65696: Sequencer fails to create a new sound sequence strip via Python
Fixes T65656: Audio strip - SHIFT K crashes Blender
Reviewers: brecht
Reviewed By: brecht
Subscribers: ISS
Maniphest Tasks: T65696, T65656
Differential Revision: https://developer.blender.org/D5061
|
|
This code now expects to wrok from fully evaluated data, however when we
keep original, we are actually working from data just copied from orig
one.
Ideally, we'd do a single depsgraph update/eval *after* we have created
all new required data, but that is tricky to do properly in that code
without risking breaking one thing or another.
So for now, just going for the simple, if not optimal solution, and just
repeatedly re-evaluating whole deg every time we duplicate an object to
be converted. Yep, dummy, but simple and... safe. ;)
|
|
That was a dummy typo in `duplibase_for_convert()` in fact...
|
|
panel."
This reverts commit rB78bbf374f475 (and part of rB702d85d7cddbf81).
Fix for this is actually simpler, done in next commit.
|
|
Redo panel would be hidden (when 'keep original' was not set), due to
same kind of (un)selected issue as in T65301 (see previous commit).
Further more, not all MBall objects of the family were properly removed.
|
|
We need to properly select new objects (and deselect 'source' ones) when
converting to another type while keeping original ones. Otherwise poll
check of the operator fails, and redo panel cannot be shown.
Note that this is actually a design flaw in redo system currently, since
*new* state has to still allow last operator to be ran, when it should
actually be previous step in history that matters here...
|
|
These things are somewhat arbitrary, but since there are separate shortcuts
and menu entries this seems the more expected behavior.
|
|
Use evaluated object as an input for mesh construction. This ensures
all dependencies are ready.
Reviewers: brecht, mont29
Reviewed By: brecht, mont29
Differential Revision: https://developer.blender.org/D4955
|
|
This was the only remaining cases that used a string lookup, which didn't
work anymore now that it's no longer a real value in the context.
|
|
This is old logic that no longer makes sense in the new depsgraph, and causes
issues when multiple threads try to modify the same bevel object.
Differential Revision: https://developer.blender.org/D4913
|
|
|
|
|