Commit Graph

68144 Commits

Author SHA1 Message Date
Antonioya 70c5699734 GP: Move to new layer did not work with autolock
When the autolock layer option was enabled, the move to new layer operator was not working as expected.
2019-02-12 18:15:00 +01:00
mano-wii a1d440de4a Edit Mode: Fix element selection on some old AMD GPUs
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.
2019-02-12 14:12:57 -02:00
Dalai Felinto 09b40aa039 Fix "typo" in show_object_viewport* RNA_def_property_update 2019-02-12 14:27:30 -02:00
Sergey Sharybin f16763a01d Fix T60999: Duplifaced objects are not drawn in edit mode
Seems to be rather trivial change to use proper cage mesh nowadays.
2019-02-12 17:05:32 +01:00
Antonioya 5aacad16e0 Fix T61462: Missing update when toggling GP layer visibility in the Outliner 2019-02-12 17:01:38 +01:00
Sergey Sharybin 027c356e23 Use direct access to evaluated mesh from instancing
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.
2019-02-12 16:42:34 +01:00
Sergey Sharybin 8614f28234 Depsgraph: Special relation for instances and metaballs
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.
2019-02-12 16:42:34 +01:00
Sergey Sharybin 7c03d6c4e6 Cleanup: Make parent relations a bit cleaner
Mainly getting rid of old and somewhat misleading and unclear
comments.
2019-02-12 16:42:34 +01:00
Philipp Oeser 43139bf8b4 Fix T61428: Node editor's 'Interface' panel shows in all tabs
Reviewers: brecht

Maniphest Tasks: T61428

Differential Revision: https://developer.blender.org/D4343
2019-02-12 15:57:05 +01:00
Bastien Montagne 3797fdcfc1 Modifiers: Make Difference default operation for boolean modifier.
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
2019-02-12 14:14:21 +01:00
Jacques Lucke 20f78dc12f Fix T61430: invoke_popup() does not respect ui scale
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4341
2019-02-12 13:30:24 +01:00
Sergey Sharybin 024f5ba2bd Depsgraph: Run rigid body after modifiers are ready
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
2019-02-12 12:32:03 +01:00
Sergey Sharybin 17416b80f6 Weight modifiers: Remove weird looking dependency
Modifiers are part of geometry component, no way they can
be dependent on the geometry component of the same object.
2019-02-12 12:07:59 +01:00
Sergey Sharybin 07ff9e92bb Depsgraph: Add utility function for transform dependency
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.
2019-02-12 12:07:59 +01:00
Sergey Sharybin d3870471ed Fix fur on Spring characters
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!).
2019-02-12 10:57:32 +01:00
Campbell Barton 65ffc414fe Cleanup: move utility functions into dna_utils
Rename old/new to src/dst since renaming happens in both directions
when versioning.
2019-02-12 17:56:35 +11:00
Campbell Barton d968db82b7 makesdna: add shared utility module
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.
2019-02-12 17:09:57 +11:00
Campbell Barton f96bfde4a5 makesdna: use memarena for string allocations
Include it since versioning code will need to perform
small string allocations too, which doesn't fit will into
the currently used fixed size buffers.
2019-02-12 16:52:54 +11:00
Campbell Barton b539aee0c9 BLI_memarena: remove use of BLI_linklist
Preprare for using memarena w/ makesdna, BLI_linklist depends on
BLI_mempool. Since linked list use in here is simple, do it inline.
2019-02-12 16:28:10 +11:00
Campbell Barton 036ec5cae4 Cleanup: use printf define in makesdna 2019-02-12 10:10:04 +11:00
Campbell Barton 3ec4c2f842 DNA: support versioning structs & struct members
This is only to be used rarely because it's not forwards compatible.

Replace version patching of old 2.80 DNA with a more generic API.
2019-02-12 09:38:46 +11:00
Campbell Barton 2a6d03493c WM: default to opening maximized
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
2019-02-12 09:14:10 +11:00
Bastien Montagne 7cca0f9998 Fix T61391: MeshDeform Modifier does not work on a solidified planar mesh.
`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.
2019-02-11 20:24:07 +01:00
Sebastian Parborg 558d7dd90e Fix T61376 Group Node Node Editor theme property is missing alpha channel
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).
2019-02-11 16:56:20 +01:00
Antonioya b8dc7e9cb8 GP: Avoid crash when bruhs setting are invalid
This change avoids crashes for wrong settings, but we need find why the settings were wrong.

Related to T61413
2019-02-11 15:58:04 +01:00
Campbell Barton 452df3f392 Cleanup: comments 2019-02-12 01:51:03 +11:00
Sergey Sharybin 3117446967 Fix T61362: Hair particles does not appear when rendering
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.
2019-02-11 15:24:11 +01:00
Sergey Sharybin 51d161a89e Depsgraph: Use proper tag source for special case
Special case of handling update tag of 0 was using wrong update
source, causing unwanted point cache resets on file load.
2019-02-11 15:24:11 +01:00
Clément Foucault 23c14a0bba Fix: Eevee SSS not rendering as expected
Remove forcing separate albedo when rendering. It was creating confusion.
2019-02-11 14:50:25 +01:00
Clément Foucault d07cde8de8 Fix T61374 : vertex not visible/selectable if it is at objects origin
It was caused by Null normal if the vertex is at origin. Just add a small
bias to avoid this case.
2019-02-11 14:38:14 +01:00
Campbell Barton 1a8cd3a8a7 Cleanup: avoid string copy for comparing int id's
More direct and readable.
2019-02-11 23:53:33 +11:00
Philipp Oeser b10b77d4f0 Fix T61185: Missing modifiers update on changes to texture
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
2019-02-11 10:38:30 +01:00
Campbell Barton 1724ff29e0 readfile: skip negative sized thumbnails
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.
2019-02-11 19:09:27 +11:00
Campbell Barton 3ce5e5a857 Cleanup: unused speaker flag 2019-02-11 17:55:52 +11:00
Campbell Barton 42368a2321 Cleanup: RNA boolean names (use prefix conventions) 2019-02-11 17:49:35 +11:00
Campbell Barton 826d9ac827 Cleanup: move runtime vars into Camera_Runtime 2019-02-11 16:58:52 +11:00
Campbell Barton e215216958 Cleanup: use "_Runtime" suffix for DNA
Was done everywhere except bPoseChannel.
2019-02-11 16:50:23 +11:00
Campbell Barton 43156d8304 Preferences: remove tweak/drag threshold distinction
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.
2019-02-11 15:48:46 +11:00
Campbell Barton 1daaa74b08 WM: command line args to start blender maximized
Part of D4323 by @DragMZ
2019-02-11 14:46:25 +11:00
Campbell Barton f5249b4e30 Cleanup: use 'struct Main' in header
Causes errors including in some cases.
2019-02-11 14:10:13 +11:00
Campbell Barton 69b2f52681 DNA: remove Object.display struct
We have a display flag already, use it instead.

Object.display is kept in RNA, exposed via a nested struct,
we can move other display options there.
2019-02-11 10:55:22 +11:00
Campbell Barton ffd0fee97c Cleanup: comment indentation & spelling 2019-02-11 10:51:25 +11:00
Howard Trickey 9ca6fc41ae Bevel: Make modal keymap instead of hardcoded.
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.
2019-02-10 16:08:25 -05:00
Pablo Vazquez 09f4505712 UI: Color Picker, make HSV default.
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.
2019-02-10 21:30:08 +01:00
Bastien Montagne 5d2b23766b Link/Append: Instantiate collection rather than objects.
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.
2019-02-10 17:15:15 +01:00
Bastien Montagne 439437fa3a Fix T61141: Append Particle Settings doesn't append the collection properly.
ParticleSettings' duplicollection is now a proper refcounting user of
its collection, which will avoid losing it on save/reload.
2019-02-10 17:15:15 +01:00
Campbell Barton 96a7e06792 Cleanup: unused struct member
Also replace intptr_t -> int (no good reason to cast to intptr here).
2019-02-10 22:50:04 +11:00
Campbell Barton 0b6dbbc306 Cleanup: move clipping shader lib & define into struct
Also compare clipping with the draw context instead of
accessing the RegionView3D, currently they're matching
but this might not always be the case.
2019-02-10 11:16:31 +11:00
Campbell Barton 16d7967c2b Cleanup: use shorter name for shader config
The struct name is descriptive,
this isn't going to be confused with other variables.
2019-02-10 11:02:06 +11:00
Dalai Felinto 66c23ea2b4 Cleanup: Use ID_IS_LINKED instead of id.lib 2019-02-09 18:41:52 -02:00
Dalai Felinto 69f50e6ea9 Fix: objects in outliner cannot be disabled
But introduced on 191b8951f7.
Reported on tracker as a comment on 3f537f30e6.
2019-02-09 14:26:27 -02:00
Bastien Montagne af0eb938b8 Fix T61276: Make Single User unlinks original object.
In that case, we have to consider number of scenes using an object, not
number of collections.
2019-02-09 13:24:31 +01:00
Bastien Montagne bf4f01779d BKE_object: add util to count number of scenes using an object.
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).
2019-02-09 13:24:31 +01:00
Antonioya 1bf8551f00 GP: Missing in previous commit 2019-02-09 11:08:17 +01:00
Antonioya b85d5dd9b1 GP: Init stroke buffer always
Related to T61334

This initialization avoid any crash when user saves the file while he is drawing a stroke session.
2019-02-09 10:59:25 +01:00
Jacques Lucke 7262ac6202 Fix T61332: Python3 syntax errors 2019-02-09 13:10:34 +11:00
Dalai Felinto 191b8951f7 Outliner visibility: Prevent changing linked objects and collections
We still change their base/layer collection visibility, just not what would change the
original ID datablock.
2019-02-08 20:09:37 -02:00
Dalai Felinto e04d6794d0 Outliner Visibility: Alt+H operator to unhide all objects and collections 2019-02-08 19:59:02 -02:00
Dalai Felinto 744223afbf Outliner Visibility: H operator to hide collection or objects 2019-02-08 19:44:37 -02:00
Dalai Felinto 3f537f30e6 Outliner visibility: Ctrl to isolate object
Ideally it would be nice to make all the base parent collections visible as well.
However we do not know this from the outliner.
2019-02-08 19:15:41 -02:00
Bastien Montagne 0e3d1eee15 Fix (unreported) crash when undoing after ID deletion.
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.
2019-02-08 18:54:52 +01:00
Bastien Montagne 6ba8e71fa2 BKE_main: add a util to generate/extend a GSet with all ID pointers of a Main database. 2019-02-08 18:53:09 +01:00
Bastien Montagne 4b4a231250 Cleanup: API doc is to be in implementation, not header file. 2019-02-08 18:53:09 +01:00
Bastien Montagne 389515f441 Outliner: Purge: correct tooltip, add more info for user.
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.
2019-02-08 18:53:09 +01:00
Bastien Montagne a8f28329ad BKE_idcode: Add utils to convert from 'lbarray' index to ID type.
This can be useful to be able to match some random array data with
ListBase array of IDs generated by `set_listbasepointers()`.
2019-02-08 18:53:09 +01:00
Dalai Felinto 02581a7ef8 Fix T61287: Object restrict viewport ignored in instanced collection
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.
2019-02-08 13:57:12 -02:00
Pablo Vazquez 5228a10f6d UI: Marker position slightly offset.
Tested on various interface sizes and thick lines.

Reported by Blender Studio animators.
2019-02-08 16:18:46 +01:00
Sergey Sharybin e925c20f2f Fix T59339: Particle render without baking issues
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.
2019-02-08 15:31:08 +01:00
Howard Trickey 2f0dbdea4f Bevel, fix crash when adjust offsets with inner arc miter.
Previous assumptions about boundary verts always being attached
to edges are now false.
2019-02-08 09:24:43 -05:00
Howard Trickey 29922b6ff5 Bevel: fix regression re even adjustment of offsets.
Mistakenly had left a debugging assignment that disabled
the offset pass. This commit re-enables it.
2019-02-08 09:02:29 -05:00
Campbell Barton 813800f143 DRW: support clipping for stick & wire bones 2019-02-08 23:21:22 +11:00
Pablo Vazquez d723249dcc Typo 2019-02-08 12:55:54 +01:00
Pablo Vazquez 7b03e45202 UI: Icons for some Outliner context menu operations
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.
2019-02-08 12:52:23 +01:00
Sergey Sharybin bf2c5217b3 Fix T61231: File open and undo looses unkeyed changes
Only flush copy-on-write to animation when user makes changes.
2019-02-08 12:17:00 +01:00
Campbell Barton e418777109 DRW: edit-mesh edge clipping broke in recent update 2019-02-08 22:06:14 +11:00
Campbell Barton 2855feb2ae Fix T61196: Mesh select ignores clipping (part 2)
Need to use local clipping planes in this case
2019-02-08 21:52:01 +11:00
Bastien Montagne 0e3475b00d Fix T61255: Mesh Data Transfer: Do not abort when destination has not all source data layers.
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.
2019-02-08 10:16:00 +01:00
Campbell Barton 351b24ac14 Fix T58625: Knife project fails w/ curves 2019-02-08 19:18:35 +11:00
Campbell Barton 0822af4c48 WM: init simulated event from win->eventstate
Ghost event handling code works this way.
2019-02-08 19:01:30 +11:00
Campbell Barton 46ac288a93 Cleanup: rename V3D_MANIP_* -> V3D_ORIENT_*
Wasn't obvious it's related to orientation,
also term manipulator is no longer in use.
2019-02-08 15:22:15 +11:00
Campbell Barton d86894b9e4 Fix T61291: Transform gizmo doesn't update w/ 3D cursor 2019-02-08 15:12:04 +11:00
Campbell Barton a9853a7e6c Fix missing NULL check in recent version patch 2019-02-08 12:10:56 +11:00
Campbell Barton 3d16a268ee Undo System: basic support in background mode
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
2019-02-08 10:15:11 +11:00
Campbell Barton e1edb51699 Correct error in last commit 2019-02-08 09:41:28 +11:00
Campbell Barton 261d42cd84 Cleanup: clear deprecated flags 2019-02-08 09:31:59 +11:00
Campbell Barton 7fdda18ca1 Remove "Keep Session" preference
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.
2019-02-08 08:42:50 +11:00
Campbell Barton 0abf754748 Cleanup: sort struct blocks, description 2019-02-08 07:29:21 +11:00
Campbell Barton 0021273b31 Fix crash drawing loose vertex from recent changes 2019-02-08 07:27:00 +11:00
Bastien Montagne dd6dcf8247 Cleanup: Use new BKE_main_foreach_id() in a few more places... 2019-02-07 21:52:54 +01:00
Bastien Montagne 949bc7aa2a Outliner: modernize Purge operator.
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.
2019-02-07 20:46:53 +01:00
Bastien Montagne 599561de84 BKE_main: add utils to loop over whole IDs of a given Main database.
We are currently having the same boiler plate code in tens of places
accross our code, we can as well have a utils to do that.
2019-02-07 20:46:41 +01:00
Clément Foucault d2afa51ddc Edit Mode: Draw Vertices after edges
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.
2019-02-07 20:40:54 +01:00
Clément Foucault a04dd15193 Edit Mesh: Only draw vertices once
Only add each vertices to point ibo once. That requires tagging each mvert
in the case of modifier preview.
2019-02-07 20:36:29 +01:00
Clément Foucault ea30767997 Edit Mode: Reduce number of edges drawn
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.
2019-02-07 19:11:01 +01:00
Clément Foucault 7584ef85bf Edit Mode: Fix edge partially displayed as selected with modifier preview
Force set the flag vertice selected in this case.
2019-02-07 19:06:54 +01:00
Clément Foucault aa7b013bd5 Edit Mode: Make active face hint part of the face color
This remove the hint on the face edges. This is because the hint was
displayed on both sides and was requiring to draw every edges twice.
2019-02-07 17:47:55 +01:00
Clément Foucault a710af2b25 Edit Mesh: Rework new implementation and use geometry shader to draw lines
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.
2019-02-07 17:30:10 +01:00
Clément Foucault 9b774dfa3b Edit Mode: Fix geometry shader workaround not respecting aspect ratio 2019-02-07 17:30:10 +01:00
Howard Trickey dec4f6d7ed Bevel: better attachment points for unbeveled edges, arc miter. 2019-02-07 10:42:28 -05:00
Antonioya 4c42e949e9 GP: Reduce render noise pixel in blend borders 2019-02-07 16:31:03 +01:00
Antonioya 8cc5b68eb1 GP: Cleanup blend pixel function
Clear the function that blend pixels and change parameter.
2019-02-07 16:31:03 +01:00
Sergey Sharybin 9c68ac0448 Show all useful metadata fields in editors
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
2019-02-07 11:55:07 +01:00
Sergey Sharybin 0885484aa6 Fix T59587: Hair dynamics works different when opened in 2.8
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.
2019-02-07 11:48:42 +01:00
Campbell Barton 937731dff1 Fix T61272: Undo fails to track multi-edit mode enter/exit
Objects leaving edit-mode weren't restored by edit-mode undo steps.
2019-02-07 20:28:33 +11:00
Campbell Barton 075a122190 Fix sculpt undo steps not enabling dyntopo
Logic to disable dyntopo when entering sculpt mode was applied on undo.
2019-02-07 20:28:33 +11:00
Sergey Sharybin 83d78eb32c Close metadata panels by default
They might be rather long, and not that commonly accessed.
2019-02-07 09:38:49 +01:00
Sergey Sharybin 9b86c90193 Fix for images without metadata crashing 2019-02-07 09:34:01 +01:00
Campbell Barton d6c0f3796a Fix T61049: Undo dynamic topology sculpt asserts 2019-02-07 13:29:59 +11:00
Campbell Barton a5869c367e Cleanup: remove unnecessary undo function 2019-02-07 10:09:56 +11:00
Campbell Barton 9df4602035 PyAPI: message subscribe option arg now optional 2019-02-07 09:36:52 +11:00
Campbell Barton f11b5549ea Cleanup: doxy header 2019-02-07 09:36:52 +11:00
Campbell Barton 7325035e60 DRW: support clipping for octahedral & box bones 2019-02-07 08:03:56 +11:00
Campbell Barton 6152f5cd67 Fix refresh on resetting header alignment 2019-02-07 07:49:11 +11:00
Dalai Felinto 5ed27372ab Remove no-longer needed function 2019-02-06 18:48:50 -02:00
Dalai Felinto db231e87fc Fixup for outliner visibility not changing disable state
Show Inside (shift + click) was still forcing objects to be visible.
2019-02-06 18:48:50 -02:00
Bastien Montagne ac9daf3a27 Fix (unreported) crash when iterating on depsgraph instances from RNA.
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...
2019-02-06 21:13:52 +01:00
Dalai Felinto 766741b0aa Outliner visibility: Respect original viewport enable/disable state
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.
2019-02-06 17:06:16 +00:00
Dalai Felinto e3a3782d7f Outliner visibility unification: Prevent master collection visibility to change
Also satinizing the checks for master collection. The outliner tree
iterators already take care of not including the master collection
there.
2019-02-06 16:13:40 +00:00
Sergey Sharybin fb15dfbddf Depsgraph: Fix dependency cycle when rigid body is involved
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.
2019-02-06 17:08:24 +01:00
Sergey Sharybin 49e07dfdfb Fix T61190: Crash in particles distribution
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.
2019-02-06 16:38:03 +01:00
Sergey Sharybin 8c87af7440 Improvements and fixes to Cycles metadata
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
2019-02-06 16:11:51 +01:00
Campbell Barton e8292466bc DRW: Support edit-metaball clipping 2019-02-07 00:07:30 +11:00
Campbell Barton 3e6ebdd2a6 DRW: Support edit-curve clipping 2019-02-06 23:25:31 +11:00
Clément Foucault fea5e1dc3a Fix T57342: Crash on render with workbench render engine via command line 2019-02-06 12:16:24 +01:00
Jacques Lucke 4547815847 Cleanup: Remove deprecated ghosting code
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
2019-02-06 12:05:34 +01:00
Jacques Lucke 6202bc82b8 Fix T60935: More numerically stable distance to ray computation
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
2019-02-06 11:49:12 +01:00
Campbell Barton afd4bf8694 Fix T61136: Header alignment preference has no effect
Users expect this to apply to existing files,
adjust this to apply on load, defaults to off.
2019-02-06 21:20:15 +11:00
Sergey Sharybin 18e67813cd Clip editor: Fix drawing metadata for RGBA images
Need to disable blending prior to drawing metadata. Otherwise
text will be drawn on a transparent background.
2019-02-06 10:48:09 +01:00
Sergey Sharybin f3cc63634a Cleanup: Spelling in comment 2019-02-06 10:12:46 +01:00
Sergey Sharybin a6ef823ac4 Fix T61124: Lag on physics simulation
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.
2019-02-06 10:12:46 +01:00
Philipp Oeser b294600ddc Fix T61051: crash with multi-object mixed mode snapping
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
2019-02-06 09:46:20 +01:00
Campbell Barton 2d5e2de88b Cleanup: remove unused toolbox delay preferences 2019-02-06 18:18:54 +11:00
Campbell Barton ed53c8ea76 Cleanup: use '_pad' prefix for padding vars 2019-02-06 18:15:58 +11:00
Campbell Barton 48a36ff9e9 Cleanup: manually apply changes missed last commit
Automatic edits failed for indented comment blocks,
removed indentation & adjusted.
2019-02-06 15:52:04 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 15ad01492e Cleanup: remove deprecated/unused preferences DNA 2019-02-06 14:34:50 +11:00
Campbell Barton 7f6a4bc416 Cleanup: use doxy headers for preference comments 2019-02-06 14:23:08 +11:00
Campbell Barton cd2bf1fc91 Fix T61191: First undo step missing in text editor 2019-02-06 12:59:38 +11:00
Campbell Barton e535ff44ff Undo System: remove accumulate/store modes
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.
2019-02-06 11:52:04 +11:00
Campbell Barton 8996e26116 Fix T61196: Mesh select ignores clipping
Select clipping now works when x-ray is disabled.
2019-02-06 10:34:09 +11:00
Campbell Barton dbd7f36da8 GPU: refactor clipped drawing from DRW into GPU
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.
2019-02-06 09:15:16 +11:00
Campbell Barton a245d53351 Cleanup: style 2019-02-06 09:14:36 +11:00
Dalai Felinto 897e047374 Outliner visibility unification: Implement 3 levels of viewport visibility
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.
2019-02-05 19:32:58 -02:00
Dalai Felinto e3f7f0c3eb Outliner: eyes for collection affect collection visibility
As oppose to affect the collection objects' visibility.
2019-02-05 18:42:02 -02:00
Dalai Felinto dc7f312326 Outliner: Gray out collections only when they are invisible
Re-factor of 4521d3e707.
2019-02-05 18:42:02 -02:00
Sergey Sharybin 7b22c3269b Fix/workaround issues in pose and edit mode
[re-committing]

Edit mode was unable to select, pose mode was unable to move bones.
2019-02-05 18:42:02 -02:00
Dalai Felinto 3d984aa150 Per view-layer collection visibility
[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.
2019-02-05 18:42:02 -02:00
Dalai Felinto d1ef6be4a7 Fix T61204: Can't select Camera in stereoscopy mode
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.
2019-02-05 18:40:23 -02:00
Brecht Van Lommel 2778ecb58c UI: make drag lock work also when buttons have > 2 states or use callbacks.
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.
2019-02-05 20:21:03 +01:00
Brecht Van Lommel 4c6e7be44b Fix new EEVEE bloom / motion blur defaults not being applied to startup.blend. 2019-02-05 17:19:10 +01:00