Commit Graph

4744 Commits

Author SHA1 Message Date
Alexander Gavrilov
b1f9799508 Cloth: implement support for a hydrostatic pressure gradient.
When a fluid is put under influence of gravity or acceleration, it
forms an internal pressure gradient, which causes observable effects
like buoyancy. Since now cloth has support for simulating pressure
changes caused by fluid compression or expansion, it makes sense to
also support the effects of gravity.

This is intended for better simulation of objects filled or
surrounded by fluids, especially when constrained by collisions
or pinned vertices, and should result in more realistic shapes.

Obviously, this doesn't actually simulate fluid dynamics; instead
it is assumed that the fluid immediately adapts to changes in the
shape or acceleration of the object without friction or turbulence,
and instantly reaches a new static equilibrium.

Differential Revision: https://developer.blender.org/D6442
2020-06-12 18:19:40 +03:00
Campbell Barton
f79856f9fb Cleanup: minor changes to deform functions
- Use 'float (*)[3]' to avoid casts.
- Remove unnecessary float[3] copy in gpencil_deform_verts.
- Use MEM_SAFE_FREE
- Use const arguments.
2020-06-12 14:39:49 +10:00
Jacques Lucke
3ea04d3e11 Blenloader: Don't just crash when a struct name is not known
Related to T77524.

This brings back the old way of handling corrupted data.
2020-06-10 16:31:41 +02:00
Jacques Lucke
6fe32d7fd6 Fix T77524: Don't try to write storage of node with undefined node
This cannot work, because the storagename is the empty string.
2020-06-10 16:16:03 +02:00
Jacques Lucke
b37fca650e Cleanup: Move pointcache dna to separate file
Reviewers: brecht

Differential Revision: https://developer.blender.org/D7965
2020-06-09 17:01:54 +02:00
Jacques Lucke
6f96dfabe5 Simulations: initial simulation state and cache
The current particle state is stored in a `CustomData` instance and
the cache is stored in `PointCache`.

The current state exists on the copy-on-write copies of the simulation,
while the cache only exists in the original data block.

This patch implements a temporary trivial particle simulation that does not
use the node system yet. It is used for testing and will be replaced soon.

`PointCache` still has some limitations that need to be overcome using
separate refactorings. For example, we need to be able to store the number
of particles in the point cache. Also we need to change which attributes
are stored for a particle system more dynamically than is currently possible afaik.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7836
2020-06-08 15:49:17 +02:00
Jacques Lucke
8f25cfdbfd Refactor: use new api for some remaining functions in writefile 2020-06-07 12:22:19 +02:00
Jacques Lucke
3e07d958f1 Cleanup: remove unused functions 2020-06-07 12:14:17 +02:00
Jacques Lucke
561a81eb24 Refactor: use new api in remaining direct linking code 2020-06-07 12:12:48 +02:00
Jacques Lucke
f6524032ca Refactor: use new api for direct linking pointcache and particle system 2020-06-07 12:05:30 +02:00
Jacques Lucke
a7de01aaa9 Refactor: use new api for direct linking customdata 2020-06-07 11:58:58 +02:00
Jacques Lucke
5f7007a962 Refactor: use new api for direct linking packedfile and dverts 2020-06-07 11:55:27 +02:00
Jacques Lucke
1626c526f8 Refactor: use new api to check if endian switch is required 2020-06-07 11:51:07 +02:00
Jacques Lucke
ab2b9821fc Cleanup: remove unused test_pointer_array function 2020-06-07 11:48:18 +02:00
Jacques Lucke
eb31037503 Refactor: use new api for direct linking movie clip data 2020-06-07 11:47:37 +02:00
Jacques Lucke
01132d4a83 Refactor: use new api for direct linking id properties 2020-06-07 11:42:58 +02:00
Jacques Lucke
5ff8a2ca0e Refactor: use new api to simplify IDP_DirectLinkGroup_OrFree 2020-06-07 11:34:23 +02:00
Jacques Lucke
b8afd4e8bb Refactor: use new api for direct linking bones, view layer and userdef 2020-06-07 11:30:32 +02:00
Jacques Lucke
f0f666541e Refactor: use new api for direct_link_id_common 2020-06-07 11:16:14 +02:00
Jacques Lucke
959267ffcc Refactor: use new api for direct linking preview image 2020-06-07 11:08:38 +02:00
Jacques Lucke
766b3037eb Refactor: use new api for direct linking curvemapping and its callers 2020-06-07 11:07:08 +02:00
Jacques Lucke
ee4732ca22 Refactor: use new api for direct linking gpencil modifiers and shaderfxs 2020-06-07 11:00:48 +02:00
Jacques Lucke
ce9a64c454 Refactor: use new api for direct linking modifiers 2020-06-07 10:56:06 +02:00
Jacques Lucke
a99a8061ae Refactor: use new api for direct linking keying sets, node sockets and pose 2020-06-07 10:35:34 +02:00
Jacques Lucke
6c6658ccc0 Refactor: use new api for direct linking animdata 2020-06-07 10:27:42 +02:00
Bastien Montagne
aed11c673e Fix T77456: Broken vertex paint undo on high-poly objects.
This is a critical fix that should also be backported to 2.83.1

Fairly stupid bug in fact, code detecting changes across undo steps was
assuming that each BHEAD (a block of data in blendfiles) would not be larger
than one memory chunk... Which is the case in alsmost every situation,
besides some super-heavy geometries, and other similar things (images
would also be affected e.g.).
2020-06-06 16:18:39 +02:00
Jacques Lucke
6c114a139b Refactor: use new api for direct linking paint curve, cachefile and workspace 2020-06-06 14:46:27 +02:00
Jacques Lucke
033b6a7fb4 Refactor: use new api for direct linking particlesettings, movieclip, mask, linestyle and palette 2020-06-06 14:43:06 +02:00
Jacques Lucke
9b3fda0357 Refactor: use new api for direct linking armature, action, nodetree and brush 2020-06-06 14:34:57 +02:00
Jacques Lucke
a5e56efc98 Refactor: use new api for direct linking lattice, world, camera, speaker, sound, lightprobe and collection 2020-06-06 14:25:34 +02:00
Jacques Lucke
18b57d3e2c Refactor: use new api for direct linking light, vfong, text, ipo and key 2020-06-06 14:17:27 +02:00
Jacques Lucke
9a3d54943a Refactor: use new api for direct linking mball, material, texture and image 2020-06-06 14:10:43 +02:00
Jacques Lucke
1800127355 Refactor: use new api for direct linking mesh and curve 2020-06-06 14:02:03 +02:00
Jacques Lucke
cf3e617913 Refactor: use new api for direct linking scene and object 2020-06-06 13:55:59 +02:00
Jacques Lucke
125acdf933 Refactor: use new api for direct linking hair, pointcloud, volume and simulation 2020-06-06 13:28:00 +02:00
Jacques Lucke
0eb969dd99 Refactor: use new api for direct linking screen and gpencil 2020-06-06 13:20:20 +02:00
Jacques Lucke
1d066050b6 Refactor: use new api in direct_link_windowmanager 2020-06-06 12:53:59 +02:00
Jacques Lucke
5146034aa9 Blenloader: simplify list reading api 2020-06-06 12:53:36 +02:00
Jacques Lucke
fc672ce8e2 Refactor: use new api for remaining direct data writing 2020-06-05 21:55:45 +02:00
Jacques Lucke
60b8db587f Blenloader: new write_struct_at_address api functions 2020-06-05 21:55:45 +02:00
Jacques Lucke
f0047e6754 Refactor: use new api for write_movieclip and write_keyingsets 2020-06-05 21:55:45 +02:00
Jacques Lucke
5340556710 Refactor: remove temporary IDP_WriteProperty_new_api 2020-06-05 21:22:43 +02:00
Jacques Lucke
7949953b1e Refactor: use new api in write_userdef 2020-06-05 21:19:03 +02:00
Jacques Lucke
a77350cce2 Cleanup: remove unused functions 2020-06-05 20:56:36 +02:00
Jacques Lucke
69c9204026 Refactor: use new api for write_curvemapping and its users 2020-06-05 20:55:42 +02:00
Jacques Lucke
26fb0d4258 Refactor: use new api to finish write_object 2020-06-05 20:46:27 +02:00
Jacques Lucke
c3e88fdd03 Refactor: use new api for write_pointcaches 2020-06-05 20:40:38 +02:00
Jacques Lucke
a943b65f1b Refactor: use new api in write_area_map 2020-06-05 20:34:59 +02:00
Jacques Lucke
4df20c058d Refactor: use new api in write_bone 2020-06-05 20:34:59 +02:00
Hans Goudey
9b099c8612 UI: Drag and Drop Modifiers, Layout Updates
This patch implements the list panel system D7490 for modifiers.
It also moves modifier drawing to a callback in ModifierTypeInfo
in line with the extensible architecture refactoring goal T75724.

This adds a PanelRegister callback and utilities for registering
panels and subpanels. It also adds the callbacks for expansion saving
and drag and drop reordering described in D7490.

These utilities, callbacks, and other common UI elements shared
between modifiers live in MOD_ui_common.c.

Because modifier buttons are now in panels, we can make use of
subpanels for organization. The UI layouts also use the single
column layout style consistently used elsewhere in Blender.
Additionally, the mode-setting buttons are aligned and ordered
consistently with the outliner.

However, the large number of UI changes in this patch may mean
that additional polishing is required in master.

Thanks to William Reynish (@billreynish) who did a fair amount of the
layout work and to Julian Eisel (@Severin) for consistent help.

Differential Revision: https://developer.blender.org/D7498
2020-06-05 10:41:03 -04:00