Tested on an `AMD Radeon HD 7570M`.
It seems that a VBO containing only `unsigned bytes` or `unsigned shorts` can't be read correctly in a shader.
Strange that if the index buffer repeats the drawing of the vertices (as was done before rBa04dd15193e6) the problem disappears.
The disadvantage of this solution is that the memory size for a selection VBO increases by about 4 times.
But the loss in optimization is negligible.
Thanks to @fclem for pointing out the possible source of the problem and reviewing the fix.
It is supposed to be already evaluated. If for some reason it's not
doing such direct evaluation will not be reliable anyway (indirect
dependencies for example).
This fixes an assert part of T61431.
Ensures that object which is set for instance-vert or instance-face
is evaluated prior to metaball. This is because metaball will request
list of instances during evaluation.
This should fix issue reported T61431 in release build. The assert is
still there and is to be addressed separately.
Make Difference a default value for boolean modifier operation property.
Currently operation property of the boolean modifier is set to Intersect, which is the least frequently used boolean operation of the three available. It is also goes out of sync with Intersect (Boolean) tool, where Difference is a default operation.
Reviewers: mont29, brecht, sergey
Reviewed By: mont29, brecht, sergey
Subscribers: mont29, brecht, campbellbarton, sergey, billreynish
Tags: #modifiers
Differential Revision: https://developer.blender.org/D4340
This makes it so modifiers are using object transform prior
to the rigid body simulation, and then result of modifier
stack is fed to the solver.
Solves dependency cycle which was happening when object's
modifier was dependent on the modifier transform.
While now it is not possible to change simulation, things
are somewhat more clear and reliable in other ways.
For example previously, solver was using derives mesh from
a previous step in time, which causes unfixable simulation
issues (with intersections and such)
Fixex T57589: 2.79 Rigid Body Sim. Does Not Behave The Same In 2.8
Fixex T61256: Compositing scenes causes crash, but rendering separately does not
Fixes T61262: Armature and rigid body crash
Fixes T61346: Rigid body with modifiers incorrect work
This is what modifiers are to use to indicate that they depend
on a transformation of the object itself.
Currently should be no functional changes, but in the future
this will allow to easily change transform operation depending
on whether there is a simulation associated with the object.
There is an issue of hair being completely messed up when
switching to a simulation view layer for Autumn.
Restoring back the code which was re-setting particles on
file load. This will re-set unbacked particles on file load
but this appears to be happening in 2.7 as well.
Can not reproduce bugs which were fixed in this area recently,
so maybe it's finally tackled (fingers crossed!).
Currently only a single function was duplicated which isn't so bad,
this change is to allow DNA versioning code to be shared between
dna_genfile.c and makesdna.c.
Blender is typically used maximized or fullscreen,
load maximized instead of attempting to fill the screen bounds.
To load un-maximized use '--window-border' argument.
See D4332
`BKE_modifier_get_evaluated_mesh_from_evaluated_object()` used by
modifiers needing access to other objects' geometry probably skipped out
of the radar when cage and final evaluated meshes were added to
BMEditMesh? In any case, we do not need to duplicate (and then free!) a
temp mesh from editdata anymore, and we can even add instead a parameter
to get cage instead of final. Also makes modifiers code a bit simpler.
It is now possible to adjust the group node background alpha.
The defaults are the same as before, but you can now adjust the alpha
level via the theme preferences (and the alpha value is no longer hard
coded).
Fix T61406: Particles don't render
Consider initial dependency graph evaluation as a file load.
Is still resetting too much, but that we can solve later.
Also update relations when modifier texture changes.
Basically same as rB6e00415a85a9, rBca2680aaeb1 but this time for
VertexWeight modifiers
Reviewers: sergey
Maniphest Tasks: T61185
Differential Revision: https://developer.blender.org/D4305
We may want to use 'TEST' BCode in the future for including data
besides thumbnails. This allows negative values to be used w/o
attempting to load a thumbnail.
Currently the preferences have both tweak and drag threshold,
this is confusing because most actions users would consider
dragging use the 'tweak' setting.
Now one drag threshold is used for both, with a maximum limit of half
the button unit-size in case of dragging UI elements.
Also added keys for toggling harden normals,
and cycling through miter types.
Still to do: add some shortcuts for affecting the
spread value for arc miters.
Most artists agree that RGB by default is not as flexible as HSV.
It's just the first time it opens anyway, since it will remember whatever
was set last like it always does.
When one is indirectly linking collections, better add collection to the
scene, than instantiating its objects into master collection of the
scene. That is much cleaner.
Noted/related to T61141.
Issue is, ob->id.us is not relevant anymore here, since several
collection might be referencing it inside of a same scene, that is still
only one usage from user perspective...
Note that for now we are just counting scenes instantiating an object,
time will say wether we need more refined/complete check (as a reminder,
most [all?] other Object usages are *not* refcounting ones).
Yes, we do can undo an ID deletion now.
However, this requires extra care in UI 'remapping' to new IDs step
(when undoing, we do not fully reload the UI from saved .blend).
Otherwise, new UI (i.e. one from saved .blend file) might reference
IDs that where freed in old bmain (the one before the undo), we cannot
use those to get ID name then, that would be a nasty use-after-free!
To prevent this, we generate a GSet of all valid ID pointers at that
time (i.e. those found in both old and new Main's), and ensure any ID
we try to remap by its name is in that GSet. Otherwise, there is no
possible remapping, just return NULL.
While ideally we could have a complete detailed list of deleted IDs,
that would require more work UI wise, think for now we can live with
just a rough summary.
Related to T61209.
make_duplis_collection() depends on the collection object cache,
which was not freed upon object viewport disable change.
The best way to reproduce the bug was to instance the default
collection, disable the cube, save and re-open the file.
Now even if you set the original cube to be enabled, you wouldn't see
the instanced one until you forced collection cache to be freed (e.g.,
changing a collection disable state.
Fix T61289: Emitting particles from instances not working properly
The first issue has been re-introduced by a code which was dealing
with missing hair after opening the file. That was re-setting all
particle systems all the time because modifier flags were not copied
back to original. This made every modifier run to be seem as an
initial file open.
Now we copy flags back to an original modifier. But also we are
trying to not do any resets unless needed in that case. This way
we can preserve in-memory caches.
Other part of the change is related on re-setting particle system
if number of mesh elements changed. But we only do it if the
modifier has been already evaluated once.
Mainly 'X' icon for Delete, which was already on modifiers and constraints,
but not for objects. Select icon for object selection and refresh for library reload.
Originally, when transferring all source data layers to destination
meshes, code would abort in case destination did not have all needed
layers, and creating them was not allowed.
Now, it will instead transfer data to layers that exists, merely
skipping source ones for which it cannot find a matching destination.
Some developers were using undo for their scripts, this allows for undo
pushes in background mode, however - as with 2.7x, undo isn't
initialized at startup in background mode.
See replies to T60934
As far as we know this wasn't widely used, and relied no storing data
in the temp dir which may be cleared on reboot.
More generally, alternative behavior for a core area like file IO
is not something to keep if it has unresolved issues.
See D4310 for details.
That guy was still from the era where only way to remove an ID was to
save & reload the .blend file. Use modern code instead, should also be
much, much more efficient in big production files.
And that’s another nice occasion to add/test new batch ID deletion code, too. ;)
Related to T61276 Make Single User unlinks original object.
This avoid edges covering a part of vertices.
This comes at a (very minor) perf cost as vertices can cover some edges
pixels and early discard them with the depth test. But this only happens
in artificialy dense mesh and is not a real problem for common cases.
This make sure only one line is drawn per edge.
It makes the function mesh_create_edit_loops_points_lines() non-thread safe
but this is fine as of now because nothing is multithreaded at this point.
Also this is the only function use this flag so it might be OK.
The side effect is that we don't need to use depth test in edit mode
overlay so the masking artifact will not appear.
This make it (theoriticaly) compatible with all supported hardware with
consistent results.
Also we now draw the lines with analytic anti-aliasing instead of relying
on MSAA (which offers less benefits in our case).
The remaining aliasing comes from edges cut in half by the mesh which is
not rendered with MSAA. Hopefully this is not too much distracting and only
happen if the face is almost parallel to the view.
Is available when doing "View -> Show Metadata". Will draw all the
fields which are not part of the stamp at the bottom of the image.
Couple of hand-picked fields are ignored, since those are not very
useful to be seen.
Aimed to ease review of rendered shots.
Reviewers: brecht
Reviewed By: brecht
Subscribers: fsiddi
Differential Revision: https://developer.blender.org/D4316
Is a missing do-verisoning code in e3d31b8dfb.
Unfortunately, at this point it is rather tricky to tell old and new
hair dynamics modifiers apart. Probably easier to accept possible
breackage of the files which were created in 2.7 and saved during
2.8 which had incomplete do-version code.
This is a follow-up to rBb44e6f2b3d32, for some reason that issue was
not detected back then: in some cases, DEG_iterator_objects_next() will
free the temp list of dupli objects once it does not need it anymore,
henceforth freeing the dupli_object_current memory of the DEGObjectIterData
that we are storing in the RNA_Depsgraph_Instances_Iterator struct.
And yes, the uglyness of that hack is getting even better now...
Found while trying to export dupliobjects with FBX...
Note: We still change it to the collection we are directly isolating/making
visible and its parents (in the case of isolating). But no longer its children.
Feedback and discussion on D4011. The motivation is that if we don't keep those
locked the disable state becomes useless.
Was introduced by point cache reset on manual edits. Needed to
split evaluation and introduce an explicit init key, which allows
to hook up relations which are "monitoring" manual edits to the
channel.
Noticed while looking into T61190.
Was visible with certain configuration only, is a numeric
instability caused by degenerate ray direction.
Not sure the distribution is correct, just fixing crash
which was caused by usage of watertight intersection.
This is a request by the studio here to make it possible to see how
many samples were used to render a specific shot or a frame. It is a
bit more tricky than simply stamping number of samples from a scene
since rendering is happening in multiple ranges of samples.
This change makes it so Cycles saves configured number of samples for
the specific view layer, and also stores start sample and number of
samples when rendering only a subrange of all samples.
The format used is "cycles.<view_layer_name>.><field>", which allows
to have information about all layers in a multi-layer EXR file.
Ideally we can store simplified "cycles.<field>" if we know that there
is only one render layer in the file, but detecting this is somewhat
tricky since Cycles operates on an evaluated scene which always have
single view layer.
The metadata is shown in the Metadata panels for clip, image and
sequencer spaces.
Example screenshot which shows the metadata:
{F6527727}
Reviewers: brecht
Reviewed By: brecht
Subscribers: fsiddi
Differential Revision: https://developer.blender.org/D4311
Most of this code is deprecated for many years already and does not
work at all in Blender 2.8.
Reviewers: brecht, aligorith
Differential Revision: https://developer.blender.org/D4271
The old function was numerically very unstable for 2 reasons:
computing the square and then subtracting the results.
In the example in T60935 all precision was lost and it returned the distance 0
for all points.
I also removed the `depth` parameter since it wasn't used and computing
it would have made the code more complicated.
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D4308
Need to synchronize simulated frame back to original object.
Solves the lag during transformation, but amount of floppyness is
lower for some reason. Final animated object behaves the same as
in older Blender though.
rBec3357e03ab1 introduced multi-object snapping.
Seems like this was done without mixed-mode selections in mind.
So code assumed that all selected objects are actually armatures [which
can fail].
In 2.7 this was not a problem, because code only took active object into
account, 2.8 was iterating over all selected_editable_objects.
Now just iterate over objects in posemode instead
Reviewers: brecht, dfelinto
Maniphest Tasks: T61051
Differential Revision: https://developer.blender.org/D4287
This complicated handling of undo steps in a generic way
especially switching between undo systems that stored data to ones
that accumulated changes.
Now each undo system must treat it's steps as check-point,
internally it can apply/rewind changes.
This commit also fixes projection paint where the object mode wasn't
following the undo steps.
Needed to fix T61196, supporting clipped back-buffer in the 3D view
which is done outside the draw module.
It was also inconvenient having DRW_shader_* versions of GPU_shader_*
API calls.
- Clipping distances are now supported as a shader configuration
for builtin shaders.
- Add shader config argument when accessing builtin shaders.
- Move GPU_shader_create_from_arrays() from DRW to GPU.
Now collection and objects can be either:
* Disabled for all the view layers.
* Hidden for a view layer but not necessarily for all others.
* Visible for a view layer but not necessarily for all others.
Regarding icons: Whatever we decide to use for the "Hidden for all view
layers" needs to be a toggle-like icon. Because when viewing "Scenes"
instead of "View Layer" in the outliner we should be able to edit the
collection "Hidden for all the view layers" as an on/off option.
The operators are accessible via a Visibility context menu or shortcuts:
* Ctrl + Click: Isolate collection (use shift to extend).
* Alt + Click: Disable collection.
* Shift + Click: Hide/Show collection and its children (objects and collections)
Things yet to be tackled:
* Object outliner context menu can also get a Visibility sub-menu.
* Get better icons for viewport enable/disable.
Note:
* When using emulate 3 button mouse alt+click is used for 2d panning.
In this case users have to use the operator from the menu.
See T57857 for discussion.
Patch: https://developer.blender.org/D4011
Reviewers: brecht and sergey
Thanks to the reviewers and William Reynish and Julien Kasper in
particular for the feedback.
[re-committing]
We still control this in the viewport collections visibility menu. But
now we are actually changing the visibility of the collections, not of
the objects.
If a collection is indirectly invisible (because one of its parents are
invisible) we gray it out.
Also if you click directly in the collection names, it "isolates" the
collection by hiding all collections, and showing the direct parents and
all the children of the selected collection.
Development Note:
Right now I'm excluding the hidden collections from the depsgraph.
Thus the need for tagging relations to update.
If this proves to be too slow, we can change.
This was deliberately disabled since I didn't get the drawing working
originally. It is fully working now.
Note: camera lens widget still needs to be fixed since it still draws it
wrongly.
This will help with upcoming outliner visibility icons with 3 states.
It is done by using the icon to identify the state. If that is not unique
there is no visible difference to users anyway.