Age | Commit message (Collapse) | Author |
|
Showing the expression alone may not be enough to track down an error
evaluating a py-driver. Show information about the target ID & property
in the error message as well.
|
|
These kinds of leaks are relatively harmless, it reduces the number of
un-freed data reported by valgrind on exit.
|
|
Also use __func__ for printing the funciton name.
|
|
|
|
Error in [0] which assumed the struct member was renamed however
byte-code access from PyCodeObject now requires an API call.
Thanks to @music for pointing this out.
[0]: 780c0ea097444c3be60314dffd203c099720badb
|
|
When in Object Mode, any of the active- and edit-related snapping
options (Include Active, Include Edited, Include Non-Edited) should be
ignored when in Object Mode, otherwise snapping could be effectively
disabled.
This commit forces snap code to ignore the active- and edit-related
options when in Object Mode.
Reviewed By: Germano Cavalcante (mano-wii)
Differential Revision: https://developer.blender.org/D15366
|
|
The tooltips added for shader nodes in D15309 are very helpful already.
This commit makes a few tweaks to make them more consistent, concise,
and includes some fixes. Note that this might move some descriptions
further away from the wording in the manual.
* Make wording more concise
* Start fewer new sentences
* Use "For Example" slightly less
* Avoid repeating the node's name unnecessarily
* Spelling/grammar fixes
* Don't capitalize some words
* Use consistent verb conjugation
* Use ASCII characters/more common quote symbols
* Corrections to information
* Plural/singular corrections
* "smoke domains" -> "volume grids"
* Fix tooltip for separate and combine color nodes
* Refer to color sockets as colors rather than "images"
* Avoid "advice" in a few places, which should be left for the manual
* Remove information for sockets and could be in their tooltips
* Avoid referring to the locations of a property in the UI
* Avoid manual newlines (mostly reserve for "Note:")
* Leave UI code in control of wrapping, which is more consistent
* Add some information
* That the UV map and color attribute nodes use a default
* That Voronoi is "based on the distance to random points"
* Add "(Deprecated)" to old color combine and separate nodes
Differential Revision: https://developer.blender.org/D15381
|
|
Previous code was doing N collection syncs when duplicating N objects.
New code avoids all the intermediate syncs by using
BKE_layer_collection_resync_forbid and
BKE_layer_collection_resync_allow, and then does one
BKE_main_collection_sync + BKE_main_collection_sync_remap for the
whole operation. There is some complexity involved where the Base
things of newly duplicated objects can't be found yet, without the
sync, so some work on them (marking them selected, active, ...) has
to be deferred until after the sync.
Timings: scene with 10k cubes, each with unique mesh (Windows, VS2022
Release build, AMD Ryzen 5950X):
- Shift+D duplicate: 13.6s -> 9.2s
- Alt+D duplicate: 4.76s -> 1.53s
Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D14150
|
|
The brush transform was not applied to the view direction.
|
|
Reviewed By: jbakker
Maniphest Tasks: T99343
Differential Revision: https://developer.blender.org/D15354
|
|
Allow for a small epsilon to improve handling of uvs that are on edges.
Generally, when using reverse uv sampling, we expect that the sampling
is supposed to succeed.
|
|
Caused by [0] which made accessing the drag-start require a function
instead of being the value written into the event cursor coordinates.
[0]: b8960267dd51f9108b3b49e9b762e6b4d35ae1dc
|
|
Pre-fills movie clip from the scene to the following nodes:
- Keying Screen
- Plane Track Deform
- Track Position
The rest of tracking related nodes were already doing so.
Differential Revision: https://developer.blender.org/D15377
|
|
assignment
The importer parts that were doing assignment of materials to the
imported objects/meshes were essentially having a quadratic complexity
in terms of scene object count. For each material assigned to each
object, they were scanning the whole scene, checking which other
Objects use the same Mesh data, in order to resize their material
arrays to match the size.
Performance details (Windows, Ryzen 5950X):
- Import OBJ Blender 3.0 splash scene (24k objects): 43.0s -> 32.9s
- Import USD Disney Moana scene (260k objects): saves two hours
(~7400s). Note that later on this crashes when trying to render the
imported result; crashes in the same way/place both in master and
this patch.
Implementation details:
The importers were doing "scan the world" basically twice for each
object, for each material: once when creating a new material slot
(assigns an empty material), and then again when assigning the
material.
However, all these importers (USD, Alembic, OBJ) always create one
Object for one Mesh. So that whole quadratic complexity resulting
from "scan the world for possible other users of this obdata" is
completely not needed; it just never finds anything. So add a new
dedicated function BKE_object_material_assign_single_obdata that skips
the expensive part, but should only be used when the caller knows that
the obdata has exactly one user (the passed object).
Reviewed By: Bastien Montagne, Michael Kowalski
Differential Revision: https://developer.blender.org/D15145
|
|
Usual same issue with outliner operations, where you apply it on one
item, and then try to apply it again on same item listed somewhere else
in the tree...
Fixed by using the 'multi-tagged deletion' code we now have for IDs,
that way tree-walking function just tags IDs for deletion, and they all
get deleted at once at the end.
|
|
The new OBJ/MTL importer was already handling case T89421
correctly, but there was no test coverage to prove it. Extend
the tests to parse various forms of "-o" and "-s" (one, two, three
numbers).
|
|
|
|
Use consistent class/struct declaration in forward declarations.
Differential Revision: https://developer.blender.org/D15382
|
|
When committing D14389 I assumed that the output arrays didn't need
to be initialized, but the UV parameterizer uses the intial values of UVs.
|
|
The offsets were filled with the same value,
but they must be the total accumulated point count.
Differential Revision: https://developer.blender.org/D15374
|
|
This commit moves the subdivide curve node implementation to the
geometry module, changes it to work on the new curves data-block,
and adds support for Catmull Rom curves. Internally I also added
support for a curve domain selection. That isn't used, but it's
nice to have the option anyway.
Users should notice better performance as well, since we can avoid
many small allocations, and there is no conversion to and from the
old curve type.
The code uses a similar structure to the resample node (60a6fbf5b599)
and the set type node (9e393fc2f125). The resample curves node can be
restructured to be more similar to this soon though.
Differential Revision: https://developer.blender.org/D15334
|
|
This helps to separate concerns, and makes the functionality
available for edit mode.
|
|
|
|
Move headers to node files which actually need those.
There is no need for all nodes to have all those headers
included indirectly.
|
|
It used size_t type without including any header to define it.
|
|
|
|
This makes it possible to use this function without having
to call an operator. This is currently used by D14864.
|
|
This approach is still far from ideal, but at least it has linear
complexity in the common case instead of quadratic.
|
|
|
|
This utility struct is useful outside of sculpting code as well.
|
|
This is not strictly speaking a regression, this worked before partial
resync was introduced purely because the whole override hierarchy was
systematically re-built.
But support for material pointers in obdata (meshes etc.) was simply not
implemented.
NOTE: This commit also greatly improves general support of materials in
liboverrides, although there is still more work needed in that area to
consider it properly supported.
|
|
object/collection.
We do not (currently) consider other ID types as 'end points' justifying
to create an override hierarchy, however if the 'root' ID (i.e. the ID
the user selected as base to create the override) is not an object or
collection, we still want to check all of its dependencies.
This fixes e.g. if a material depends on another Empty object, and user
tries to hierarchy-override that material, its Empty dependency not
being overridden.
|
|
The description incorrectly mentioned it changes the start frame as well,
but it changes the strip's repeats or the action's end frame.
|
|
|
|
No functional changes.
|
|
Change the behavior of the "Frame start" and [Frame] "End" fields of an
NLA Strip in the NLA editor.
Frame Start now behaves like translating with {key G} and moving the
mouse. It also updates the Frame End to ensure the strip remains the
same length.
Frame End changes the length of the strip, based on the Repeat property.
If there are no repeats (i.e. number of repeats = 1) the underlying
Action will change length, such that more or less of its keyframes will
be part of the NLA strip. If there are repeats (i.e. number of repeats
smaller or larger than 1), the number of repeats will change. Either
way, the effective end frame off the strip will be the one set in the
Frame End slider.
The old behavior of stretching time has been removed. It is still
possible to stretch time of a strip, but this no longer automatically
happens when manipulating the Frame Start and Frame End sliders.
**Technical details:** new RNA properties `frame_start_ui` and
`frame_end_ui` have been added. Changing those values (for example via
the sliders, but also via Python) trigger the above behavior. The
behavior of the already-existing `frame_start` and `frame_end`
properties has been simplified, such that these can be set from Python
without many side-effects, simplifying import of data into the NLA.
Reviewed By: sybren, RiggingDojo
Differential Revision: https://developer.blender.org/D14658
|
|
|
|
|
|
- Use API calls to access frame-data as PyFrameObject is now opaque.
- Update opcodes allowed for safe driver evaluation.
**Details**
Some opcodes have been added for safe-driver evaluation.
Python 3.11 removes many opcodes - the number of accepted opcodes in
Blender's listing dropped from 65 to 43) however some new opcodes
also needed to be added. As this relates to security details about newly
added opcodes have been noted below (see [0] for full documentation).
Newly added opcodes:
- CACHE:
Used to control caching instructions.
- RESUME:
A no-op. Performs internal checks.
- BINARY_OP:
Implements the binary and in-place operators,
replacing specific binary operations.
- CALL, PRECALL, KW_NAMES:
Used for calling functions, replacing some existing opcodes.
- POP_JUMP_{FORWARD/BACKWARD}_IF_{TRUE/FALSE/NONE/NOT_NONE}.
Manipulate the byte-code counter.
- SWAP, PUSH_NULL.
Stack manipulation.
Resolves T99277.
[0]: https://docs.python.org/3.11/library/dis.html
|
|
New opcodes added since 3.7 meant some actions such as `len()`
were disabled in safe py-driver execution.
The following opcodes have been added, see [0] for details:
- ROT_FOUR: similar to existing ROT_* opcodes, added v3.8.
- ROT_N: similar to existing ROT_* opcodes, added v3.10.
- GET_LEN: Push len(TOS) onto the stack, added v3.10.
- IS_OP: for ternary operator, added v3.9.
- BUILD_SLICE: access `slice` built-in, doesn't expose new
functionality beyond existing `__getitem__` access.
[0]: https://docs.python.org/3.10/library/dis.html
|
|
Blender wouldn't start with Python 3.11 because of an error in
Py_TPFLAGS_HAVE_GC usage for `bpy.app.handlers.persistent`.
Remove this flag as it's not necessary.
Part of fix for T99277.
|
|
This is just a theoretical improvement currently, I won't try to justify
it with some microbenchmark, but it should be better to use the
specialized single and span virtual arrays when slicing a `GVArray`,
since any use of `GVArrayImpl_For_SlicedGVArray` has extra overhead.
Differential Revision: https://developer.blender.org/D15361
|
|
|
|
|
|
|
|
This was reported as part of D15219 but it is a problem in master, not
in the patch.
EEVEE is drawing with a cheap sampling when navigating or painting, but
we need to clear the painting flag when we are done painting.
For a rainy day: DRW_state_is_navigating() should be renamed to indicate
that it also checks for the painting flag.
|
|
|
|
|
|
The problem was the last point had the original point, but the previous one not, so the loop ends before checking last point.
The solution is avoid the loop exist if the function is checking the previous point before last one.
|
|
|