* Sculpt now has an API to get brush channel settings.
If a sculpt cache exists it will use the channels there
(ss->cache->channels_final), otherwise it pulls them
from a brush and Sculpt toolsettings. Exampes:
float f = SCULPT_get_float(ss, "setting", sd, brush);
itn i = SCULPT_get_int(ss, "setting", sd, brush);
* Improved the UI a bit
* The input device curves for brush channels
now use a copy on write mechanism.
+ It's based on a global cache of curves.
The alternative is to reference count
BrushChannels, which I also implemented
then abandoned.
+ Profiling showed that copying CurveMapping
instances was actually a problem.
* Lots of small fixes to the old<-> new brush setting
conversion code;
* Brush commands can now, sortof, have individual
spacing. The default brush spacing still acts
as a minimum though.
* Added a BLI_ghash_lookup_p_ex method that
returns the key ptr inside the ghash (it
returns the actual key, not a pointer to
Entry.key).
* Added a general 1d CurveMapping preset operator
that uses an RNA path to get the curve.
BrushChannels are now stored in linked lists
instead of simple arrays. This helps to
avoid memory corruption.
I had originally wanted to be able to pass
BrushChannels by value, but that doesn't really
work since they heap allocd data (the input
mapping curves).
Command Lists
* The new system will be based on command lists
generated by (eventually) a node editor.
* For now, the lists will be hardcoded.
* Idea is to make a minimal viable
brush engine that won't cause file breakage
when the upgrade to node-based brushes happen.
Brush Channels
* Wrote new structures and API to wrange
brush parameters: BrushChannel.
* Supports, floats, ints, enums, bitmasks,
with plans for vec3 and vec4.
* This will replace UnifiedPaintStruct,
most of the members of Brush and the
DynTopoSettings struct.
* Brush channels can
be mapped to various input device
channels (e.g. pen pressure); each
mapping has its own associated curve
(CurveMapping instance) and bounds.
Brush channel inheritence chaining
* Brush channels can form inheritence chains
* Channel sets are stored in three places:
in the scene toolsettings, in Brush, and in
individual brush commands.
* Node groups will also have a channel set.
* Channels in each set can be flagged to
inherit from the parent set.
* Inheritence happens in seperate merged
channel sets at runtime. The final
Brush channels live in Brush->channels_final,
while the final command channels live in
BrushCommand->params_final.
design study (note that it's #ifdef'd out).
Basic idea is to put all the sculpt brush code
in a single large template. This template
takes a PBVH adaptor class (of which there
would be three, one per PBVH_XXX type)
as a template argument.
Basically we're using the compiler to generate
three complete copies of every brush implementation.
C++20 concepts are used to validate the pbvh classes.
An example brush implementation:
pbvh->forVertsInRange(
{
.brush = ss->cache->brush,
.radius = radius,
.use_threads = true,
.use_original = false
},
[&offset](auto viter, int node_i, void *userdata) {
//add offset to vertex coordinates
madd_v3_v3fl(viter.co, offset, viter.fade);
},
[](PBVHNode *node, int node_i, void *userdata) {
BKE_pbvh_node_mark_update(node);
});
Seperate enabling PBVH_BMESH from enabling DynTopo:
* Created a new option to globally disabled
DynTopo.
* The DynTopo panel header now reads "Dynamic Mode",
to hopefully signal that turning on PBVH_BMESH is
a seperate step from enabling or disabling DynTopo
itself.
* The first checkbox in the panel is "DynTopo" so it
should be clear enough (it's on by default, with multiple
layers of file versioning checks).
PBVH_BMesh's undo system:
* CD_MESH_ID layers are now permanently saved once
they are created (by default they are not). This
fixed a *lot* of bugs:
Before this the undo system had to save maps between
mesh indices and mesh IDs on transitioning
between sculpt and global undo steps. This was
extremely error prone, and it simply wasn't possible
to cover all of the corner cases
* Note that there is still an odd bug where the first
global undo push after a sculpt step gets ignored,
I dunno what's up with this.
* Dyntopo undo should be nearly (hopefully completely)
bug-free after this commit.
C++20
* Made a few small changes to get blender to compile
with c++20. std::result_of was removed, had to
replace a couple of usages of it with std::invoke_result.
* I'm planning to do some design studies on rewriting
sculpt into C++.
* I strongly suspect we are going to need C++20'a new
concepts feature if we move sculpt into C++.
I'm planning to do some design studies on how
that might work.
* Fixed noise on using autosmooth with tools that use original
coorinates. While this was most prominent with DynTopo,
it did happen with other tools.
* The solution is to smooth the original coordinates as well
as the explicit coordinates if the active tool requires
original data.
* I decided to replace the original coordinates system for
PBVH_FACES and PBVH_GRIDS with the same MDynTopoVert structure
DynTopo uses. The alternative would have been extremely messy
code.
* Todo: Rename MDynTopoVert to. . .SculptInfoVert?
* Todo: Cache boundary flag and corner info in MDynTopoVert->flag
for PBVH_FACES/GRIDS similar to PBVH_BMESH.
* Collapse now uses code from decimate to detect
degenerate cases.
* Remaining, unknown (and rare) degenerate cases
are now detected (via presence of duplicate verts
in faces) and fixed.
* DynTopo fills in undo size properly now,
so undo memory limiting works.
* BLI_table_gset now internally uses a SmallHash instead of
a GHash. Profiling revealed this to be quite a bit
faster.
* This is something of a stopgap until C++-afication of
pbvh, when we'll have our pick of a bunch of
really nice C++ hashmap libs.
* pbvh_collapse_edge bites the dust; dyntopo now uses
BM_collapse_edge. Of the three topology operations
(subdivide edge, collapse edge, dissolve 3/4 valence
vertex) only dissolve still has a dyntopo-specific
implementation.
* Fixed a bunch of annoying memory corruption bugs.
* Non-manifold triangles are now detected in more
places.
SmallHash changes:
* Enabled removal
* Fixed infinite loop bug caused by
improperly counting free*d* cells
versus free cells.
* Added a BLI_smallhash_ensure_p method
that works just like the GHash version.
Sculpt replay system
* Roughed out a simple system to record and
play back sculpt strokes using a simple
text format.
* This is exclusively for
performance profiling and unit tests.
* For each brush stroke the system saves a copy
of the active StrokeCache and PaintStroke
and parts of Sculpt.
This should make profiling DRAM thrashing a lot
easier.
* Changed brush defaults a bit. New defaults
are for organic modeling.
* autosmooth_fset_slide now defaults to 1, so
face set boundaries are smoothed but stick to mesh
surface (if 0 they would function as hard edges).
* Weight by area smooth mode is on by default for all
brushes.
* Cleaned up versioning code and made it
kick in at 3.00:21, with some simple checks to
try and detect existing data from beta testers.
* Also fixed a small crash bug.
* Wrote a simple fix for drawing face sets
in inverse (ctrl) mode with face set automasking
on.
* Various fixes related to hard edges and smoothing.
* Started writing some code to defragment bmesh mempools.
Need to figure out how to avoid triggering excessive
PBVH node rebuilds.
I might write a paper on this. Topology rake now locally
updates a vector field, which it uses to smooth the input
and constrain to mesh (including face set) boundaries.
This can make an enormous difference for things like
smoothing.
Note that this is different from the existing 'curvature rake'
mode, which also builds a field and which is fed into the input
of this new one.
The only oddity is that the field is stored in a CD_PROP_COLOR
since we don't have a CD_PROP_FLOAT4, and this shows up in the UI
(not sure if I'm messing up the CD_TEMPORARY flags or if the UI
doesn't check for them).
* Fixed crash in dyntopo collapse. The
loops around vertex iterator dyntopo uses
doesn't actually work on non-manifold meshes,
or meshes with invalid normals, this was not
being checked in pbvh_bmesh_collapse_edge.
* Rotate tool now works with dyntopo.
* Added a minimal edge API to query edge
boundary states.
* This is necassary because the previous approximation,
testing if two adjacent verts are boundaries, breaks
for triangles.
Added an option to split face set boundaries on mirror
boundaries; currently only DynTopo supports this.
Very useful for making hard edges along mirror lines.
* Sharp edge flags are now supported and are
treated much the same as face set boundaries:
+ Dyntopo preserves them
+ Interior smoothing treats them as boundaries
+ Corners are detected and pinned in smoothing
+ TODO: add a brush flag to ignore sharp boundaries
for smoothing.
* Seams are also preserved, but don't affect smoothing.
* BMLog now saves edges.
* The new edge split function is enabled.
* Dyntopo now pushes new combined BMLog entries in
its top-level function, to avoid scary id reuse
edge cases.
* SCULPT_vertex_is_boundary/corner now take a bitmask
of which types of boundaries you wish to query instead
of check_face_sets.
* New function SCULPT_vertex_is_corner, similar to
SCULPT_vertex_is_boundary it takes argument to
check face sets. PBVH_FACES/GRIDS version is
incomplete. It returns a bitmask of whether
the vert is a boundary corner and/or a face
set one.
* PBVH_BMESH uses a somewhat more expensive
calculation to detect corners of face set islands by
edge angle. This is currently not done for boundary
corners.
Corner pinning now happens in:
* The internal smoother dyntopo uses for stability reasons.
* SCULPT_vertex_neighbor_average_interior.
* Topology rake.
* Dyntopo collapse.
Note that DynTopo always pins face set corners
but everything else only does so if preserve face
sets is on.
* All of the smooth brushes now use the SculptCustomLayer
system for temporary data, so all work with dyntopo now.
* You can now use a flat array in SculptCustomLayer with
PBVH_BMESH (though you have to build the structure manually).
The mesh filter code uses this.
* Smooth (and autosmooth) now have an option to preserve face
set boundaries. Corners are currently not handled.
* Simplify brush has preserve face set boundaries autosmooth
flag set by default.
* SCULPT_vertex_is_boundary now takes an addition argument
for whether to check for face set boundaries.
* Added an option to weight smooth by face areas
* Dyntopo now caches face areas in a CD_PROP_FLOAT layer
* Dyntopo also caches number of edges around verts inside of
MDynTopoVert. To avoid increasing the struct size flag was
made a short.
* Cleanup mode (dissolves 3/4-valence verts) now piggybacks on
subdivide code to build list of verts; this is much faster.
To run, in the python console enter:
bpy.msgbus.pbvh_bmesh_do_cache_test()
The output will be in the regular console. The test
build a half-million vert cube and smooths it. It runs
several passes (all of which perform the same smoothing
operation):
1; Randomized order pass
2. Ordered pass (by vertex clustering)
3. Same as 2 but with a purely data-oriented version
of the bmesh structs.
4. Same as 2, but using a version of the bmesh structs
with all pointers replaced by integer indices.
At least on my laptop #3 and #2 are about a third faster
then #1, and #2 tends to be around 15%.
* Fixed multires apply base feeding bad original coordinates to
deform modifiers.
* Roughed out some code for cache performance testing.
* Wrote skeleton code for a PBVH texel API; hasn't been tested
yet and may be removed.
* Added a limited "fast draw" mode to pbvh drawing
that tries to limit data sent to the GPU.
- Facesets and mask data are disabled.
- Indexed mode is forced.
- Does not work (at all) for multires.
* Finally fixed some outstanding bmesh sculpt undo bugs:
- Forgot to mark pbvh nodes to update their bounds, which
produced a bug I had thought was caused by something else.
- Hopefully fixed a long-standing occasional memory corruption
bug.
This commit fixes boundary brush for multires which
broke two commits ago.
This required implementing the geodesic api for PBVH_GRIDS,
which I did by building topology maps in a rather. . .
haphazard fashion.
Basically I built a vert->edge map and then used it to
derive a pseudo edge to quads mapping (it maps edges
to all the verts in the two surrounding quads except
the edge's own verts).
Just for fun I enabled geodesic mode in mask expand;
it seems to work.
(still a wip)
The boundary brush now builds a geodesic distance
field (from the boundary) from which it derives a tangent
field:
* These now define the rotation plane for bend mode.
* Rotation origins snap to these planes.
There is also typedef'd code for visualization tangents
in a temporary object (note the sculpt object), to enable
define VISBM in sculpt_boundary.c. This will be removed
lated.
Additional changes:
* Added a function to get the number of edges around verts,
SCULPT_vertex_valence_get.
* Added an API to calculate cotangent weights for vert fans,
SCULPT_cotangents_begin (call in main thread first) and
SCULPT_get_cotangents.
* Sculpt neighbors for PBVH_FACES now uses ss->vemap if it exists.
* The Mesh topology mapping code now takes extra parameters for
sorting vert/edge cycles geometrically.
* Similarly, there is now a function to sort BMesh edge cycles,
BM_sort_disk_cycle.
* MDynTopoVert->flag now has a bitflag for when the disk cycle
sorting needs to be redone, DYNVERT_NEED_DISK_SORT.
* The sculpt geodesic code now supports passing in custom vertex
coordinates.
* The geodesic API can also build an optional map of which vertex
in the initial vertex list is closest to any other vertex.
* The PBVH draw subsystem is now told whether any viewports
have drawtype >= OB_MATERIAL before anything in any windows
are drawn. There are no alternatives given the design
constraints of sculpting, where simply uploading data to the GPU
quickly becomes a bottleneck.
* Fixed flat vcol shading mode.
Also:
* added BMLog function to save mesh IDs.
- Used by SCULPT_UNDO_DYNTOPO_BEGIN/END instead of
saving the whole mesh, which was the previous behavior.
* SCULPT_UNDO_DYNTOPO_BEGIN no longer pushes a non-dyntopo
geomtry undo node, as this is no longer necassary.
This greatly speeds up going into/out of sculpt mode
with dyntopo enabled, as before it was copying
the mesh twice.
* PBVH_BMESH now supports faces other then triangles;
* Dyntopo triangulates faces as it finds them.
- I looked into methods of preserving quads and failed to
find anything that worked well in practice; it actually
worked better to use topology rake to align triangles
into quads and then mark diagonal edges for later dissolving
then to try to preserve quads explicitly (I've not
implementated that here, that was research code).
- To avoid excessive cache-destroying loops over vertex-faces,
DynTopo flags which verts have non-triangle faces.
* PBVHTriBuf now builds edge buffers so we can avoid drawing
tesselation phantom edges.
* BMLog also now supports arbitrary faces. It still does not
support edges though.
TODO:
* Fix vcol cell shading mode
* Make sure indexed drawing works
* Face set boundaries are now preserved on dyntopo remeshing.
* MDynTopoVert->flag now has a DYNVERT_FSET_BOUNDARY flag
in addition to DYNVERT_BOUNDARY.
* Instrumented uiBut with ASAN poison regions to hopefully
find the super evil memory corruption bug that's been driving
me insane. It's frustratingly intermittent. There are five
poison regions.
* Prototyped a threaded bmesh->Mesh converter function. It's about
20-30% faster. Currently disabled.
* Tried to fix more of the bugs when stepping between sculpt and
other undo step types in the global undo stack.
instead of leaving that to the client.
Also semi-fixed uninitialized memory bug in bmesh unit test (dunno
how best to memset a C struct in C++ won't won't run afoul of some
random compiler somewhere).
It uses a simple LSCM-like solver; hold ctrl to do simple
laplacian relaxation.
There are some interesting artistic possibilities to using
DynTopo with UV maps, the point of this tool is to help
explore them.
Note that I'm not planning to merge this into master with
the rest of this branch. When the time comes I plan to
move it into a new branch for sculpt research stuff.
pbvh drawing.
* Dyntopo now stores a list of PBVHTriBufs in leaf nodes, one per material
used by the node.
* Actual drawing buffers live in a new mat_draw_buffers PBVHNode member.
A few notes:
* MESH_ID layers are not saved on conversion to Mesh unless
you ask for it in BM_mesh_bm_to_me's params.
* Still need to test the box/lasso trim tools.
* Need to find some way to test loop/edge ids, which aren't
used by dyntopo.
layers to a bmesh at once. Helpful since bmesh customdata
layers are allocated in single blocks, thus adding
layers individually can lead to lots of memory
copying.
bmesh
* System is per element type. So you can have unique ids for verts and
faces, but not edges and loops.
* Supports an optional id to element lookup table.
* Uses single id space for all elements
* Added a new CD_FLAG_ELEM_NOCOPY flag to tell
customdata_bmesh_copy_data to ignore that layer.
* IDs are stored as a temporary customdata layer with
CD_FLAG_ELEM_NOCOPY set.
* Got automasking to work with dyntopo properly.
- AutomaskingCache->factor
has been replaced with the new temp layer API (which works for all
PBVH modes).
- AutomaskingCache->factor is, however, only initialized for
topology and face set boundary modes (if DynTopo is enabled)
since it's probably better to calculate the rest dynamically
in that case.
* Fixed stats bug
* Got threaded mesh->bmesh conversion working (it's disabled
pending further testing however).
Note that SCULPT_dynamic_topology_enable_ex calls BKE_scene_graph_update_tagged,
which in tests was adding ~1 second to conversion time for larger
meshes. Do we need this call?
a new one from scratch, an operation that can be slow despite being
threaded.
PBVH building is a memory bound operation (not just on the CPU side
either, remember the draw buffers have to be fully regenerated too).
Incrementally updating it this way is enormously faster (about as fast
as non-dyntopo undo).
The downside is we don't have the convienience of users regularly
building the pbvh from scratch anymore. Dyntopo does try to
join empty PBVH nodes (which happens after every stroke), but
that's not a complete substitute for a decent tree balancer.
That's on the todo list.
* Wrote a new API for wrangling temporary customdata layers across pbvh types:
- SCULPT_temp_customlayer_ensure: makes sure a (named) customdata
layer exists. Works for multires; since these are temporary
layers we can safely allocate them in a temporary CustomData
structure (in ss->temp_vdata).
- SCULPT_temp_customlayer_get: initializes a special structure,
SculptCustomLayer, that is used to get per elem customdata.
- SCULPT_temp_cdata_get: Uses a SculptCustomLayer ref along with
a SculptVertexRef to look up the data.
* Sculpt code seems to be memory bandwidth bound.
* Some key topology loops will have to be written manually
instead of using BM_ITER.
I wrote a function to re-allocate a bmesh with elements ordered by
PBVH leaf nodes, SCULPT_reorder_bmesh. It's currently disabled.
This is going to take more profiling, but my original proxy refactor
idea might be worth revisiting. Might be more cache efficient.
The good news is that the worst case is the smooth code, which I can speed
up significantly by keeping a bit of state around.
* Sculpt expand now works with dyntopo in more cases
* Fixed various dyntopo face set bugs
Stuff from several commits ago:
* There is now an API to get face sets using SculptFaceRef's.
+ SCULPT_face_set_get
+ SCULPT_face_set_set
* Prototyped a faster geodesic propagation function, but it currently
doesn't work.
* Dyntopo triangulation now preserves face flags (took some work as BM_triangulate_face explicitly prevents selection flags from being preserved).
* Also face smooth flags are no longer being overriden.
* Most of the faceset create operators work (I'm not sure I've tested
all of them though).
* SCULPT_face_set.c now has helper functions that checks if a pbvh
is *not* PBVH_BMESH, in which case it builds a temporary bmesh,
otherwise ss->bm is used (sculpt_faceset_bm_begin and sculpt_faceset_bm_end).
+ Note that some functions were able to use SCULPT_face_set_XXX
instead and avoid bmesh entirely.
reference counted. This fixes various undo bugs caused by dyntopo
needing to execute an undo push but not being able too (e.g. during
file load, and I think it also happens sometimes with global undo).
A much better way of fixing this would be to add unique IDs to mesh
verts and faces, perhaps as a customdata layer.
The root problem is that BMLog assigns unique IDs to mesh elements,
which it does via a series of GHash's. I imagine this is a fairly
serious violation of the undo system's design rules, since it means
BMLogs are tied to specific instances of the bmesh in SculptSession->bm.
There were some hacks to try and get around this, but they were buggy
and needed to push the unstack stack to work, which wasn't possible in
all cases (e.g. if G_MAIN->wm.first->undo_stack is NULL, as it is during
file loading and apparently global undo).
Anyway, long story short each chain of SculptUndoNodes needs some way
to reconstruct their ID GHash's when exiting/entering the chain. The
only way I could think to do this was to make BMLog reference counted,
with BMLogEntry the users.
Like I said, having a proper system to assign unique IDs to mesh
elements would be *much* better.
things that need custom spacing (that is coaser than the brush radius),
and refactored the existing dyntopo spacing code to use it.
* Added option to topology rake to ignore brush falloff settings
(it forcibly uses Smooth falloff).
* Smooth and topology rake support custom spacing now.
+ This is especially important for the clay brush, which works
better at smaller spacings and with a bit of autosmoothing.
Now you can tell it to override the smooth spacing to be coarser,
leading to much better performance.
* Topology rake now has a projection setting similar to autosmooth
which defaults to 1.0 (to preserve current behavior).
The main motivation for this commit was to make topology rake work
better for normal brushes. This is now possible, however it tends to
make the brush slower and also the settings are a bit fiddly.
We might want to make dedicated brush presets for this.
Btw, the UI for brush settings are becoming a real mess. Help!
projection neighboring vertices onto the current smooth vert's normal
plane, multiplied by a "projection" factor. This is extremely similar
to what the surface laplacian produces, but is much simpler, uses
no temporary state and thus can be used in more places.
certain degenerate cases that produce lots of bad geometry (and
also bad PBVHs that slows down the whole mesh).
+ A very small amount of surface smoothing is now applied by dyntopo.
+ The recursive functions that expand the region considered by dyntopo
now ignore "front face only" for depths less then 5.
+ The number of edges dyntopo can split or collapse in one run has been cut in
half to 4k.
- This limit is also now dynamically adjusted by a measure
of how skinny the edges are.
- This required implementing SCULPT_UNDO_GEOMETRY for dyntopo.
That turned out to be more work then I expected. Basically
it writes an entire Mesh to BMLogEntry, which can be swapped
with current bmesh. Tricky part was patching bm log ids.
SCULPT_boundary_info_ensure, instead PBVH_BMESH keeps
track of boundary vert flags internally. This prevents
nasty first-click lag on the smooth brush as well as anything
with autosmooth.
Making multiply layers sequentially can lead to corrupted offsets.
Instead, ensure all layers exist with SCULPT_dyntopo_ensure_templayer
first,
then get all the offsets at once.
- To do this I made a little API to make scratch
customdata layers: SCULPT_dyntopo_[ensure/get]_templayer.
Takes a customdata type and a layer name (e.g.
'__dyntopo_bleh") and returns a customdata offset.
- Note that I also did this for the persistent base code.
* Added a macro to check if a tool supports splitting the PBVH
during a stroke, DYNTOPO_HAS_DYNAMIC_SPLIT. It is in sculpt_intern.h
(for now) to avoid the enormous amount of recompiling that is
triggered if DNA_brush_enum.h is modified.
* TODO: Right now the undo code resets original vertex coordinates for
bmesh PBVH. This means tools that rely on original data (sharp and
layer) can't split the pbvh during the stroke, since that will
allocate new undo nodes and reset original coords.
The solution is to move the original data API entirely out of the undo
code.
for DynTopo. Profiling consistently showed it to be a bottleneck.
I've now written scalar versions of this function four times.
For now I'm committing this inaccuration version. I'm also committing
code for a vectorized version I found in a paper. Still need to rejigger
the dyntopo code to use it though.
This system is designed to inherit settings from scene dyntopo defaults
in a highly flexible way; settings can be individually overridden via the
.inherit bitmask.
At stroke time the scene settings and brush->dyntopo are merged
and stored in brush->cached_dyntopo.
Note that brush->flag has a bit flag, DYNTOPO_DISABLED, with a few
subtlies. It does not switch the PBVH back to PBVH_FACES mode, it
simply disbles dyntopo topology update. It also doesn't inherit from
any default settings. And it's the only setting
that's currently exposed in the UI.
It stores:
- Original coordiates, colors and mask (which were previously four
seperate layers).
- A bitmask with (currently) one bitflag, whether or not a vertex is
on a boundary.
I needed to cache calculating vertex boundary state (which involves
iterating over the edges surrounding a vertex) and got fed up with
having so many CD layers for dyntopo. This struct consolidates them
and saves having yet another layer just to store a flag.
uniform triangle tesselations (dyntopo). This will be used for
a version of topological rake that aligns edge flows to lines of curvature
automatically.
Hopefully this will become a mask filter that can grow/shrink and smooth/
sharpen any mask shape interactively by dragging the pen, like the rest
of the filters.
Following code from D8627 this patch corrects multi threaded processing
of proxies, where a 60 sec proxy generation drops to 35 sec.
Differential Revision: https://developer.blender.org/D8659
Allow use all system threads for frame encoding/decoding. This is very
straightforward: the value of zero basically disables threading.
Change threading policy to slice when decoding frames. The reason for
this is because decoding happens frame-by-frame, so inter-frame threading
policy will not bring any speedup.
The change for threading policy to slice is less obvious and is based on
benchmark of the demo files from T78986. This gives best performance so
far.
Rendering the following file went down from 190sec down to 160sec.
https://storage.googleapis.com/institute-storage/vse_simplified_example.zip
This change makes both reading and writing faster. The animation render
is just easiest to get actual time metrics.
Differential Revision: https://developer.blender.org/D8627
USD version 21.02 includes two of the changes Blender used to patch in,
which have now been removed from `usd.diff`. Unfortunately 21.02
introduces another issue where LZ4 symbols are accidentally exported,
causing linker errors. Fortunately these symbols are only used for
resting, so I added a patch hunk that simply removes their `extern "C"`
declaration.
The LZ4 linker issue has been reported upstream at
https://github.com/PixarAnimationStudios/USD/issues/1447.
Reviewed By: sebbas, mont29
Differential Revision: https://developer.blender.org/D10367
Straight up version bump
Things of note:
They started using API calls only available in windows 8, however given
the Python 3.9 update will forcibly bump us to 8.1+ anyhow this is not
an issue.
Will require some minor tweaks to platform_win32.cmake after adding the
libs to svn which are not included in this diff so this diff can land
without having to have the libs in place yet.
Reviewed By: sebbas, sybren
Differential Revision: https://developer.blender.org/D10349
Straight forward version bump, some of the variables to detect a static
OpenEXR changed and the folder structure seemingly changed a little
requiring updates to the diff
Reviewed By: sebbas, sybren
Differential Revision: https://developer.blender.org/D10340
Version bump + no longer using Boost.
Building Alembic with Boost gave compiler errors, and having one less
inter-dependency is good as well.
Reviewed By: sebbas, sybren
Differential Revision: https://developer.blender.org/D10329
Straight forward version bump.
2020U2 is significantly louder in the deprecated header usage warning
department, we should probably see if we need to act on this: P1949
Differential Revision: https://developer.blender.org/D10359
Previously `mesh.attributes.new(...)` would return a generic attribute that
one could not do much with. Now it returns refined attributes like `FloatAttribute`.
Add a boundary check, avoiding access past actual data.
Ideally would need to report error to the user somehow,
but it doesn't seem to be easy to do.
This is a minimal safe patch. The proper complete fix is
being worked on by Jesse.
Differential Revision: https://developer.blender.org/D10357
This adds a location option to the trim lasso tool to position the shape
in the middle of the volume of the object instead of in the surface
under the cursor.
{F9349724}
In order to make this work, the SCULPT_cursor_geometry_info_update can
now also get the depth of the geometry from the raycast. The depth is
calculated as the second further intersecting triangle in the raycast
over the entire mesh. This information will also be used to improve and
create new tools.
Differential Revision: https://developer.blender.org/D9622
Stop with an error when the Clang-Tidy executable cannot be found.
Without this check, CMake will happily report "Found Clang-Tidy" but with
the fallback version (0, 0, 0), when `CLANG_TIDY_EXECUTABLE` points to a
non-existing executable.
Nicer appearance for the progress bar that is drawn over the application icon during long processes on macOS.
Differential Revision: https://developer.blender.org/D9398
Reviewed by Brecht Van Lommel
When using Optimal Display, some edges are not flagged `ME_EDGEDRAW` |
`ME_EDGERENDER`.
When the modifier is applied through the UI in the modifier stack this is
not an issue because the `modifyMesh` callback is run with
`MOD_APPLY_TO_BASE_MESH` (this will effectively turn of Optimal
Display).
When converting to mesh though, this will just get an evaluated mesh
(where the edge flags are still the same as with the subdivision
modifier).
Now ensure every edge is flagged to draw after conversion.
Maniphest Tasks: T81997
Differential Revision: https://developer.blender.org/D9331
Caused by rBb077de086e14.
Not entirely sure why this was rebuilding the tree prior to above
commit, but sending an ND_OB_SHADING notifier is appropriate (and also
what the Outliners listener listens to).
Maniphest Tasks: T82251
Differential Revision: https://developer.blender.org/D9396
This is caused by the TAA being reset after the init phase, leading to
1 sample being kept as valid when it is clearly not.
To fix this, we run the lookdev validation before TAA init.
Reviewed By: Jeroen Bakker
Differential Revision: https://developer.blender.org/D9452
This adds a Box option to the Text strip's style properties, plus related Box Margin value:
{F9208309}
When enabled the text is placed on top of a solid-filled rectangle of a chosen color, as shown below:
{F9208324}
When the box option is disabled the text strip works the same as it does now. When the box option is enabled the meaning of the Shadow option changes to provide a drop-shadow on the rectangle (and not on the text itself). The latter made more sense to me.
The box margin is specified as a fraction of the image width. The offset of the drop-down box shadow is fixed to a specific fraction of the image width as well.
I tested this feature on a movie of a couple of minutes containing dozens of text strips (all with box background), edge cases like multi-line strings and text overlapping the image edges.
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D9468
Proxies are expected to be fast to read. Storing them in cache has
little to no effect on performance.
This change also allows to omit invalidation of cache when user switch
between proxies and original media.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9473
Variables renaned:
- cfra -> timeline_frame
- nr -> frame index
- cfra_over -> overlap_frame
Function seq_give_stripelem_index was renamed to seq_give_frame_index.
Use bool return type where possible instead of int (the return values from fluid object are already boolean instead of int).
Also removed several if guards in API functions. If one of the arguments is in fact invalid / nullptr (should not happen though), it better to catch them directly where they failed and not silently escape them.
Refactor material assignment code such that:
- `build_mat_map()` just returns the built map (instead of relying on
modifying a map passed as parameter),
- `LISTBASE_FOREACH` is used to loop over a `ListBase` (instead of a
hand-crafted for-loop),
- just `return` when not enough material slots can be created (instead
of setting a boolean to false, then doing some useless work, then
checking the boolean),
- reorder some code for clarity, and
- rename `mat_map` to `matname_to_material` so that the semantics are
clearer.
No functional changes.
So a keyframed e.g. location slider would stay yellow/green even if its
corresponding channel was removed.
Needs a appropriate notifier so the listeners (e.g.
buttons_area_listener, view3d_buttons_region_listener) would cause a
redraw.
Maniphest Tasks: T82364
Differential Revision: https://developer.blender.org/D9438
accelerations
Caused by rB45dbc38a8b15.
Above commit would place parentheses surrounding a block until the next
operator was found.
For velocities and accelerations though, the '/' in 'm/s' or 'ft/s'
should not be considered an operator.
Maniphest Tasks: T82407
Differential Revision: https://developer.blender.org/D9467
This fix makes sure new files save `wmWindow.global_areas` under a different
name, so old Blender versions don't recognize and 0-initialize it.
Since enabling global area writing (ef4aa42ea4), loading a file in old
Blender versions would cause `wmWindow.global_areas` to be read, because there
was already reading code for it and `ScrAreaMap` was in SDNA.
However the `ScrArea.global` of the global areas would be NULL, because it was
*not* in SDNA (`ScrGlobalAreaData` was excluded).
Now, issue is that the code assumes that areas in the global area-map have a
valid ScrArea.global pointer.
Think this was a mistake in rB5f6c45498c92. We should have cleared all this data
on reading, until the global area writing was enabled.
Differential Revision: https://developer.blender.org/D9442
Reviewed by: Brecht Van Lommel
When editbones were selected from the Outliner (and they were connected
to a parent) with the 'Sync Selection' option turned ON, they could not
get duplicated.
For duplication to work, the (connected) parent bone's tip also has to
be selected [which was not the case when selection is done from the
Outliner under above circumstances]. The reason being that
armature_duplicate_selected_exec ->
ED_armature_edit_sync_selection clears the BONE_ROOTSEL flag if the
parent bone's BONE_TIPSEL is not set.
Caused by rB71eb65328078 btw.
The correct "parent-tip-selection" would actually happen in activation
- `tree_element_active_ebone`
-- `tree_element_active_ebone__sel`
but for 'Sync Selection' this happens [also] in
- `outliner_sync_selection_from_outliner`
-- `outliner_select_sync_to_edit_bone`
which did not do the "flushing" to the parent bone's tip
Now use existing dedicated function for this.
ref. T82347
Reviewers: Zachman
Differential Revision: https://developer.blender.org/D9470
Using configue_file(..) would have avoided the breakage from
1daa3c3f0a, caused by buildinfo not properly escaping quotes.
Rely on CMake to escaping strings instead using configure_file().
Use common prefix as this collided with existing API's (eg BLI_voronoi).
Also expand some non-obvious abbreviations:
- 'g' -> 'generic'
- 'vl' -> 'variable_lacunarity'
- 'V' -> 'v3'
The draw face sets brush uses the poly center when used in meshes to increase
its precision when working in low poly geometry. For this to work with deformed
meshes, the deformed coordinates from the PBVH should be used instead.
Reviewed By: sergey
Maniphest Tasks: T81915
Differential Revision: https://developer.blender.org/D9424
BKE_mesh_free() seems to not free the meshes correctly, so using BKE_id_free() instead.
The looptri array was also not freed.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9426
Used the sampled cursor normal when available instead of the raycast face normal.
This makes the preview match the previous orientation of the cursor.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9460
"Camera Parent Lock" can be useful when rigging cameras, but it is not
intuitive, and has also generated a lot of confusion (bug reports).
This is because it breaks the fundamental parent <-> child relationship
conventions in Blender, and there is no indication that it's intended
without diving into the preferences.
This commit moves the setting to the object level, and exposes it in
the relations panel in the property editor. It is exposed for every
object type because any object type can be "View Locked" in the 3D view.
The property description is also updated to reflect this change and be
more specific without getting too long.
In the future this could become a more general feature of the transform
system, but for now it is limited to "Lock Camera to View".
Differential Revision: https://developer.blender.org/D9239
Commit rBf5080c82dd915db6c7b9dd68a52aaaccf2600137
accidentally remove the Shift modifier key from
the `AUTOCONSTRAINPLANE` shortcut.
Differential Revision: https://developer.blender.org/D9480
Since it is possible to have multiple draw callbacks, (some of which
use bgl and others gpu), check and force the reset of the drawing status
at the end of each callback.
Differential Revision: https://developer.blender.org/D9476
The two entries `TFM_MODAL_AUTOCONSTRAINT` and
`TFM_MODAL_AUTOCONSTRAINTPLANE` had the same name
displayed in the UI. The latter is now includes
"plane" in it's name.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D9474
Also fixed SCULPT_HIDE_FACE_SETS. It was 1<<16, which overlaps
SCULPT_DYNTOPO_DETAIL_MANUAL. Changed it to 1<<17. Someone should do
this in master too.
stroke) for dyntopo. Instead it updates the original vertex color
customdata layer.
Calling into the undo system destroys threading with dyntopo, as its
undo code is single-threaded.
multithreaded.
* Worked on ProxyVert system, but it still needs more work. Issue is keeping
topological layers (reasonably) up to date without it being slow.
* Fixed memory leak in bmlog.
TODO:
- Handle face (loop) data
- Figure out what to do about edge data (warn user? actually handle
it?)
- Handle sculpt color undo push nodes properly (shouldn't be hard).
NOTE: I've added a new function, DRW_make_cdlayer_attr_aliases, for
this. It's patterned after extract_uvs. The appropriate devs from the
draw engine team should take a look.
It seems fast enough for simple cases, I make no promises that it
will be fast in crazy cases lots if there's lots of vgroup layers.
Note I still need to interface properly with the sculpt colors code.
much of the usage of integer indices. Meshes and grids simply store the
index here, but bmesh stores a pointer to a BMVert. This greatly speeds
up DynTopo by reducing the need to maintain flat pointer arrays in bmesh.
To prevent the accidental casting of ScuptVertexRef to indices and vice
versa SculptVertRef is defined as a struct:
typedef struct {intptr_t i} SculptVertRef;
There are also two functions to convert flat index indices to
SculptVertRefs and back:
ScultpVertRef BKE_pbvh_table_index_to_vertex(PBVH *pbvh, int index);
int BKE_pbvh_vertex_index_to_table(PBVH *pbvh, SculptVertRef *ref);
Note that these functions require the aforementioned maintanance of
flat pointer arrays in bmesh, so make sure to call
SCULPT_ensure_vertex_random_access().
Changes:
* Brought back bmesh_mdisps_space_set, written from scratch using
subdiv api, not ccg.
* Wrote a function to smooth multigres grids from within bmesh. I might
not need it; unless anyone thinks of a use for it I'll go ahead and
delete it.
Todo:
* Purge code of all usages of CCG for multires.
This commit:
* Wrote a utility function to dump multires displacements into a (new)
scene object.
* Consequently, I now know that the CCG_based multires code is not
compatible with the OpenSubdiv based code. The former produces gaps
between grids when converting displacements to object space.
// case we go again to ensure the task can do whatever it
// was awakened to do. Once we successfully take the count
// to zero, we stop.
- size_t old = count;
+ std::size_t old = count;
do { _fn(); } while (
!count.compare_exchange_strong(old, 0));
});
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.