3 months agoCleanup: MovieClip: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Mon, 9 Mar 2020 15:24:23 +0000 (16:24 +0100)]
Cleanup: MovieClip: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: Silence warnings
Dalai Felinto [Mon, 9 Mar 2020 15:34:55 +0000 (16:34 +0100)]
Cleanup: Silence warnings

3 months agoGPencil: Refactor of Draw Engine, Vertex Paint and all internal functions
Antonio Vazquez [Mon, 9 Mar 2020 15:27:24 +0000 (16:27 +0100)]
GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions

This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.

Also, a huge code cleanup has been done at all levels.

Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.

Differential Revision:

3 months agoDepsgraph: fix crash caused by removing too many NO-OP nodes
Sybren A. Stüvel [Mon, 9 Mar 2020 15:05:06 +0000 (16:05 +0100)]
Depsgraph: fix crash caused by removing too many NO-OP nodes

Unused no-op operation nodes are not bound to a callback function, and
have no outgoing relations. Incoming relations of such nodes are removed
since ff60dd8b18ed00902e5bdfd36882072db7af8735. However, this was done
too broadly, causing too many relations to be lost and indirectly linked
objects to be unevaluated.

This commit introduces a `DEPSOP_FLAG_FAKE_USER` flag for operation
nodes, which indicates they are not to be removed, even when they appear
to be unused.

Reviewed By: sergey

Differential Revision:

3 months agoFix T74533: Crash when entering sculpt mode
Germano Cavalcante [Mon, 9 Mar 2020 14:59:57 +0000 (11:59 -0300)]
Fix T74533: Crash when entering sculpt mode

Apparently this happened when the object is in a flat view and has
customdata `CD_SCULPT_FACE_SETS`

Differential Revision:

3 months agoCleanup: Replace ABS/SQUARE/CUBE with function calls
Sergey Sharybin [Fri, 6 Mar 2020 16:18:10 +0000 (17:18 +0100)]
Cleanup: Replace ABS/SQUARE/CUBE with function calls

While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.

There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).

For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.

Differential Revision:

3 months agoCleanup: clang-format
Germano Cavalcante [Mon, 9 Mar 2020 13:11:31 +0000 (10:11 -0300)]
Cleanup: clang-format

3 months agoTransform Snap Object: Remove depsgraph when creating context
Germano Cavalcante [Mon, 9 Mar 2020 13:02:11 +0000 (10:02 -0300)]
Transform Snap Object: Remove depsgraph when creating context

Currently, this change does not bring functional changes.
But it is necessary to extend the use of the snap system for gizmos,
since, after a Undo, the `depsgraph` pointed by the `snap_context`
has its memory invalidated.

Reviewed By: campbellbarton

Differential Revision:

3 months agoCleanup: ParticleSettings: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Mon, 9 Mar 2020 11:48:32 +0000 (12:48 +0100)]
Cleanup: ParticleSettings: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: PaintCurve: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Mon, 9 Mar 2020 11:35:25 +0000 (12:35 +0100)]
Cleanup: PaintCurve: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: CacheFile: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Mon, 9 Mar 2020 11:21:45 +0000 (12:21 +0100)]
Cleanup: CacheFile: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: WorkSpace: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Mon, 9 Mar 2020 11:06:49 +0000 (12:06 +0100)]
Cleanup: WorkSpace: Move to IDTypeInfo  and remove unused BKE API.

3 months agoCleanup: WindowManager: Move to IDTypeInfo and remove unused WM API.
Bastien Montagne [Mon, 9 Mar 2020 10:17:37 +0000 (11:17 +0100)]
Cleanup: WindowManager: Move to IDTypeInfo and remove unused WM API.

Getting rid of one static 'registered' callback in BKE, yeah!

3 months agoRevert "Constraints: remove special meaning of Local Space for parentless Objects."
Sybren A. Stüvel [Mon, 9 Mar 2020 09:44:55 +0000 (10:44 +0100)]
Revert "Constraints: remove special meaning of Local Space for parentless Objects."

This reverts commit 7728bfd4c45c634ba6b62e149176425ec5779945.

Although this brings back an inconsistency in the behaviour of
constraints on objects and bones, people were relying on the old
behaviour, and the new behaviour broke their files.

It is still desired to remove this inconsistency, but it will happen
more gradually.

3 months agoFix T74537: Fixed out of bounds memory access in Cycles' PMJ sampler.
Stefan Werner [Sun, 8 Mar 2020 20:31:47 +0000 (21:31 +0100)]
Fix T74537: Fixed out of bounds memory access in Cycles' PMJ sampler.

3 months agoCleanup: Sound: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Sun, 8 Mar 2020 19:45:00 +0000 (20:45 +0100)]
Cleanup: Sound: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: Speaker: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Sun, 8 Mar 2020 19:10:07 +0000 (20:10 +0100)]
Cleanup: Speaker: Move to IDTypeInfo and remove unused BKE API.

3 months agoInstall_deps: fix wrong `XR_OPENXR_ROOT_DIR` parameter for CMake.
Bastien Montagne [Sun, 8 Mar 2020 16:14:58 +0000 (17:14 +0100)]
Install_deps: fix wrong `XR_OPENXR_ROOT_DIR` parameter for CMake.


3 months agoFix T74395: Box interpolation does not support repeat extrapolation
Jacques Lucke [Sun, 8 Mar 2020 13:43:06 +0000 (14:43 +0100)]
Fix T74395: Box interpolation does not support repeat extrapolation

Reviewers: fclem

Differential Revision:

3 months agoCleanup: comments in main()
Campbell Barton [Sun, 8 Mar 2020 02:48:52 +0000 (13:48 +1100)]
Cleanup: comments in main()

Clarify references to functions.

3 months agoRevert "Outliner: Allow deleting entire selection"
Campbell Barton [Sun, 8 Mar 2020 02:48:17 +0000 (13:48 +1100)]
Revert "Outliner: Allow deleting entire selection"

This reverts commit 62f238a65e334ccecae85134da0b05ba58382ae9.

This prevents undo steps from being stored.

3 months agoOutliner: Allow deleting entire selection
Nathan Craddock [Sat, 7 Mar 2020 21:46:22 +0000 (14:46 -0700)]
Outliner: Allow deleting entire selection

This allows deleting both collections and objects in the outliner
selection at the same time. This only works using the keyboard shortcuts
(X or Delete).

While this works, a more robust solution should be implemented later to
allow deleting the whole selection from the context menu as well.

3 months agoFluid: Optimization for smoke simulation (multigrid)
Sebastián Barschkis [Sat, 7 Mar 2020 18:56:51 +0000 (19:56 +0100)]
Fluid: Optimization for smoke simulation (multigrid)

The solver will now automatically detect static scenes (no moving obstacles) and use a slightly faster pressure solve in those cases.

3 months agoCleanup: Outliner: Remove unused parameter
Nathan Craddock [Sat, 7 Mar 2020 18:19:39 +0000 (11:19 -0700)]
Cleanup: Outliner: Remove unused parameter

Searching back in the outliner did not require the unused SpaceOutliner

3 months agoFix T74513: Wrong naming in some Face Set comments and operators
Pablo Dobarro [Fri, 6 Mar 2020 23:33:46 +0000 (00:33 +0100)]
Fix T74513: Wrong naming in some Face Set comments and operators

Missing changes from one of the renamings of the initial face sets

Reviewed By: brecht

Maniphest Tasks: T74513

Differential Revision:

3 months agoFix T74501: Wrong initial iteration when using mask expand
Pablo Dobarro [Fri, 6 Mar 2020 15:44:17 +0000 (16:44 +0100)]
Fix T74501: Wrong initial iteration when using mask expand

The initial iteration for all symmetry areas is always 0. We were using
1 for the main stroke, so it was 1 step behind.

This was broken for expanding masks and face sets, but with face sets it
is more noticeable.

Reviewed By: brecht

Maniphest Tasks: T74501

Differential Revision:

3 months agoFix T74498: Do not iterate over hidden vertices when using the transform tool
Pablo Dobarro [Fri, 6 Mar 2020 15:04:55 +0000 (16:04 +0100)]
Fix T74498: Do not iterate over hidden vertices when using the transform tool

By using PBVH_ITER_UNIQUE hidden vertices are skipped, like in the rest of
the brushes and tools.

Reviewed By: brecht

Maniphest Tasks: T74498

Differential Revision:

3 months agoUI: move Cycles adaptive sampling settings to own subpanel
Brecht Van Lommel [Sat, 7 Mar 2020 11:23:09 +0000 (12:23 +0100)]
UI: move Cycles adaptive sampling settings to own subpanel

3 months agoFix key release event activating click-drag
Campbell Barton [Sat, 7 Mar 2020 07:17:47 +0000 (18:17 +1100)]
Fix key release event activating click-drag

A handled release event could still trigger a click-drag afterwards.

3 months agoWM: include repeat value in WM_event_print
Campbell Barton [Sat, 7 Mar 2020 05:25:53 +0000 (16:25 +1100)]
WM: include repeat value in WM_event_print

3 months agoCleanup: replace BLI_make_file_string with BLI_join_dirfile for the file-selector
Campbell Barton [Sat, 7 Mar 2020 02:49:58 +0000 (13:49 +1100)]
Cleanup: replace BLI_make_file_string with BLI_join_dirfile for the file-selector

In these cases the file selectors directory is already expanded.

3 months agoCleanup: replace BLI_make_file_string with BLI_join_dirfile where possible
Campbell Barton [Sat, 7 Mar 2020 02:23:26 +0000 (13:23 +1100)]
Cleanup: replace BLI_make_file_string with BLI_join_dirfile where possible

Use 'BLI_join_dirfile' for joining paths that don't need to expand '//'.

3 months agoInclude file system encoding in 'System Info' operator
Campbell Barton [Sat, 7 Mar 2020 00:53:14 +0000 (11:53 +1100)]
Include file system encoding in 'System Info' operator

Help troubleshooting file system encoding issues.

3 months agoFix T74504: Cycles wrong progress bar with CPU adaptive sampling
Brecht Van Lommel [Fri, 6 Mar 2020 22:13:03 +0000 (23:13 +0100)]
Fix T74504: Cycles wrong progress bar with CPU adaptive sampling

3 months agoFix error in Cycles Optix adaptive sampling after recent cleanup
Brecht Van Lommel [Fri, 6 Mar 2020 22:28:33 +0000 (23:28 +0100)]
Fix error in Cycles Optix adaptive sampling after recent cleanup

3 months agoCleanup: VFont: Move to IDTypeInfo and remove unused BKE API
Dalai Felinto [Fri, 6 Mar 2020 19:00:42 +0000 (20:00 +0100)]
Cleanup: VFont: Move to IDTypeInfo and remove unused BKE API

This was particularly strange because we had a _free_data() function.
But still the one I replaced was of course the _free() one.

And we should rename the _free_data_ function later to avoid confusions.

3 months agoCleanup: Text: Move to IDTypeInfo and remove unused BKE API.
Dalai Felinto [Fri, 6 Mar 2020 18:48:18 +0000 (19:48 +0100)]
Cleanup: Text: Move to IDTypeInfo and remove unused BKE API.

3 months agoAPI Docs: Point to manual for Operator Cheat Sheet
Aaron Carlisle [Fri, 6 Mar 2020 17:49:52 +0000 (12:49 -0500)]
API Docs: Point to manual for Operator Cheat Sheet

3 months agoUI: Remove Windows 3D Object Folder Reference
Harley Acheson [Fri, 6 Mar 2020 17:33:13 +0000 (09:33 -0800)]
UI: Remove Windows 3D Object Folder Reference

Remove Windows special folder FOLDERID_Objects3D. Requires newer SDK.

Differential Revision:

Reviewed by Brecht Van Lommel

3 months agoCleanup: tweak Freestyle #includes in preparation for clang-format sorting
Dalai Felinto [Fri, 6 Mar 2020 15:45:16 +0000 (16:45 +0100)]
Cleanup: tweak Freestyle #includes in preparation for clang-format sorting

3 months agoCleanup: Fix forward declaration of headers
Dalai Felinto [Fri, 6 Mar 2020 15:45:06 +0000 (16:45 +0100)]
Cleanup: Fix forward declaration of headers

3 months agoCleanup: Rename ARegion variables from ar to region
Julian Eisel [Fri, 6 Mar 2020 15:56:42 +0000 (16:56 +0100)]
Cleanup: Rename ARegion variables from ar to region

The old convention was easy to confuse with ScrArea.
Part of

This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.

Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.

Also ran clan clang format on affected files.

3 months agoCleanup: Image: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 16:11:55 +0000 (17:11 +0100)]
Cleanup: Image: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: Texture: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 15:52:42 +0000 (16:52 +0100)]
Cleanup: Texture: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: Material: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 15:38:04 +0000 (16:38 +0100)]
Cleanup: Material: Move to IDTypeInfo and remove unused BKE API.

3 months agoFix build error on windows
Germano Cavalcante [Fri, 6 Mar 2020 15:49:15 +0000 (12:49 -0300)]
Fix build error on windows

Error C4013 '_VA_ELEM1' undefined; assuming extern returning int

3 months agoCleanup: Action: Move to IDTypeInfo, and remove unused BKE API.
Dalai Felinto [Fri, 6 Mar 2020 15:35:23 +0000 (16:35 +0100)]
Cleanup: Action: Move to IDTypeInfo, and remove unused BKE API.

3 months agoCleanup: Armature: Move to IDTypeInfo, and remove unused BKE API.
Dalai Felinto [Fri, 6 Mar 2020 15:03:00 +0000 (16:03 +0100)]
Cleanup: Armature: Move to IDTypeInfo, and remove unused BKE API.

3 months agoBring back code accidentally removed by previous commit
Julian Eisel [Fri, 6 Mar 2020 15:38:58 +0000 (16:38 +0100)]
Bring back code accidentally removed by previous commit

Probably got lost when resolving merge conflicts.

3 months agoCleanup: Reduce context usage in UI functions
Julian Eisel [Fri, 6 Mar 2020 15:22:28 +0000 (16:22 +0100)]
Cleanup: Reduce context usage in UI functions

Part of

There's a chance that this causes some issues becaue in some cases we
change from getting the window from context to getting it from somewhere

3 months agoCleanup: Lattice: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 15:22:49 +0000 (16:22 +0100)]
Cleanup: Lattice: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: MetaBall: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 15:08:24 +0000 (16:08 +0100)]
Cleanup: MetaBall: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: Curve: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 14:51:31 +0000 (15:51 +0100)]
Cleanup: Curve: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: Mesh: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 14:38:52 +0000 (15:38 +0100)]
Cleanup: Mesh: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: move Alembic, AVI, Collada, and USD to `source/blender/io`
Sybren A. Stüvel [Fri, 6 Mar 2020 15:19:35 +0000 (16:19 +0100)]
Cleanup: move Alembic, AVI, Collada, and USD to `source/blender/io`

This moves the `alembic`, `avi`, `collada`, and `usd` modules into a common
`io` directory.

This also cleans up some `#include "../../{somedir}/{somefile}.h"` by
adding `../../io/{somedir}` to `CMakeLists.txt` and then just using
`#include "{somefile}.h"`.

No functional changes.

3 months agoDepsgraph: remove unused no-op nodes after building
Sybren A. Stüvel [Fri, 6 Mar 2020 14:25:37 +0000 (15:25 +0100)]
Depsgraph: remove unused no-op nodes after building

This is the companion of D7031. That patch adds a new DIMENSIONS node to
the depsgraph for each object that has geometry. However, this node is
only necessary when there are drivers using an object's dimensions as
variable. Since this is rare, it's easiest to remove these nodes after
they turn out to be unnecessary. This is what (almost) happens in this

Removing nodes from the depsgraph is hard, and there are no functions to
do this yet. Instead, this patch recursively removes all the incoming
relations from unused no-op nodes (i.e. no-op operation nodes without
outgoing connections). Actually removing the nodes will be left as a
future improvement.

I've tested this on a Spring file [1]. Here are there results of blender
--debug-depsgraph-time spring_02_055_A.eevee.blend and letting it run
for a while to stabilise the reported FPS:

    master: 11.7 FPS
    Just D7031: 11.7 FPS
    Just D7033: 11.8 FPS
    Both D7031 + D7033: 12.3 FPS


Differential Revision:

3 months agoCleanup: Move Multiplane Scrape brush to its own file
Pablo Dobarro [Fri, 6 Mar 2020 15:00:33 +0000 (16:00 +0100)]
Cleanup: Move Multiplane Scrape brush to its own file

3 months agoFix narrowing from int to short when removing material slot
Sergey Sharybin [Fri, 6 Mar 2020 14:56:09 +0000 (15:56 +0100)]
Fix narrowing from int to short when removing material slot

3 months agoSculpt: Cleanup, remove macro re-definition
Sergey Sharybin [Fri, 6 Mar 2020 14:52:36 +0000 (15:52 +0100)]
Sculpt: Cleanup, remove macro re-definition

3 months agoFix integer overflow in BLI_mempool_as_arrayN()
Sergey Sharybin [Fri, 6 Mar 2020 14:33:47 +0000 (15:33 +0100)]
Fix integer overflow in BLI_mempool_as_arrayN()

`(size_t)(int * int)` will actually cast overflown integer to size_t,
which isn't what was intended here. Correct thing would be to cast
in the following manner `(size_t)int * int`.

In this particular case can as well use function which is designed to
allocate an array of memory without overflow.

3 months agoCycles: cleanup warning
Dalai Felinto [Fri, 6 Mar 2020 14:26:54 +0000 (15:26 +0100)]
Cycles: cleanup warning

3 months agoCleanup: Collection: Move to IDTypeInfo, and remove unused BKE API.
Dalai Felinto [Fri, 6 Mar 2020 14:17:47 +0000 (15:17 +0100)]
Cleanup: Collection: Move to IDTypeInfo, and remove unused BKE API.

Note: we still need BKE_collection_free since we call it from scene.c.

3 months agoCleanup: Use the SCULPT_ prefix in all sculpt_intern functions
Pablo Dobarro [Fri, 6 Mar 2020 14:24:15 +0000 (15:24 +0100)]
Cleanup: Use the SCULPT_ prefix in all sculpt_intern functions

3 months agoCleanup: bScreen: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 14:19:32 +0000 (15:19 +0100)]
Cleanup: bScreen: Move to IDTypeInfo and remove unused BKE API.

3 months agoCleanup: use ELEM macro for path slash checks
Campbell Barton [Fri, 6 Mar 2020 13:58:48 +0000 (00:58 +1100)]
Cleanup: use ELEM macro for path slash checks

3 months agoFluid: Revert bc2ce31d7940 (changes to open boundaries)
Sebastián Barschkis [Fri, 6 Mar 2020 14:01:19 +0000 (15:01 +0100)]
Fluid: Revert bc2ce31d7940 (changes to open boundaries)

Changes from that commit turned out to be unstable.

3 months agoFix T73842: UI: add cloth collision settings to Hair Dynamics panel
Philipp Oeser [Wed, 4 Mar 2020 16:31:36 +0000 (17:31 +0100)]
Fix T73842: UI: add cloth collision settings to Hair Dynamics panel

Since hair collisions were integrated with the cloth solver
(rBd42a7bbd6ea5), there are a couple of relevant settings which were not
exposed to the User:
- Collision Quality
- Minimum Distance (this was reported in T73842, default of 0.015m was
still limiting in certain scenarios - this can now be made smaller)
- Impulse clamping
- Collision collection

This will add a 'Collisions' panel to Hair Dynamics with those settings

Note: in contrast to 'real' cloth, self-collisions are not supported for

Maniphest Tasks: T73842

Differential Revision:

3 months agoCleanup: bNodeTree: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 13:57:26 +0000 (14:57 +0100)]
Cleanup: bNodeTree: Move to IDTypeInfo and remove unused BKE API.

3 months agoImprove modifier error message with sculpt mode
Philipp Oeser [Fri, 6 Mar 2020 13:15:38 +0000 (14:15 +0100)]
Improve modifier error message with sculpt mode

Make it obvious that this relates to being in sculpt mode.

ref T74489

Maniphest Tasks: T74489

Differential Revision:

3 months agoCleanup: tweak Cycles #includes in preparation for clang-format sorting
Brecht Van Lommel [Fri, 6 Mar 2020 13:15:21 +0000 (14:15 +0100)]
Cleanup: tweak Cycles #includes in preparation for clang-format sorting

3 months agoCleanup: avoid use of BLI_cleanup_dir
Campbell Barton [Fri, 6 Mar 2020 13:35:55 +0000 (00:35 +1100)]
Cleanup: avoid use of BLI_cleanup_dir

Some cases don't need to add the trailing slash.
Use BLI_cleanup_path in this case.

3 months agoDocumentation: added bpy.msgbus description and examples
Sybren A. Stüvel [Fri, 6 Mar 2020 13:28:54 +0000 (14:28 +0100)]
Documentation: added bpy.msgbus description and examples

The `bpy.msgbus` namespace was not included in the documentation generation.
I've added it, and ported Campbell's examples from P563.

3 months agoCleanup: Message bus, removed incorrect return type from docstring
Sybren A. Stüvel [Fri, 6 Mar 2020 13:27:47 +0000 (14:27 +0100)]
Cleanup: Message bus, removed incorrect return type from docstring

The docstring was likely copy-pasted, and the return type was not adjusted.
Since the `bpy.msgbus.subscribe_rna()` returns nothing, I just removed the
return type documentation.

3 months agoCleanup: remove BLI_cleanup_file
Campbell Barton [Fri, 6 Mar 2020 13:13:03 +0000 (00:13 +1100)]
Cleanup: remove BLI_cleanup_file

In practice, references to files rarely have trailing slashes
(by accident). Remove this function in favor of BLI_cleanup_path.

3 months agoCleanup: spelling
Campbell Barton [Fri, 6 Mar 2020 13:05:27 +0000 (00:05 +1100)]
Cleanup: spelling

3 months agoFix using wrong property name for preserve face sets when remeshing
Pablo Dobarro [Fri, 6 Mar 2020 13:17:30 +0000 (14:17 +0100)]
Fix using wrong property name for preserve face sets when remeshing

Spotted by Roel Koster in the initial face set commit.

3 months agoNodes: fix writing socket default values to file
Jacques Lucke [Fri, 6 Mar 2020 12:29:58 +0000 (13:29 +0100)]
Nodes: fix writing socket default values to file

Previously, `writedata` was used to store `bNodeSocket->default_value`.
There are a couple of issues with that:
* Breaks if someone tries to load the file on a big endian system (afaik).
* There is a `/* do not use for structs */` comment on `writedata`.
* Depends on `MEM_allocN_len` which should be avoided in my opinion.
* Now it is more apparent, that this should be handled by callbacks as well.

The part in `readfile.c` should work just fine still. I could also do a case
distinction there, but the code would be the same for every case for now.
Just `sock->default_value = newdataadr(fd, sock->default_value);`.

This might change, if we want to store more complex socket type specific data
that does not fit into a single struct.

Differential Revision:

Reviewers: brecht

3 months agoCodeCleanup: Added View3DShading enums
Jeroen Bakker [Fri, 6 Mar 2020 11:59:09 +0000 (12:59 +0100)]
CodeCleanup: Added View3DShading enums

Added the core enums that workbench draw engine uses.

3 months agoCleanup: Brush: Move to IDTypeInfo, and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 11:47:26 +0000 (12:47 +0100)]
Cleanup: Brush:  Move to IDTypeInfo, and remove unused BKE API.

3 months agoCleanup: ShapeKey: Move to IDTypeInfo and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 11:16:56 +0000 (12:16 +0100)]
Cleanup: ShapeKey: Move to IDTypeInfo and remove unused BKE API.

3 months agoNodes: Support storing socket link limits in bNodeSocketType
Jacques Lucke [Fri, 6 Mar 2020 11:20:05 +0000 (12:20 +0100)]
Nodes: Support storing socket link limits in bNodeSocketType

Currently the link limit of sockets is stored in bNodeSocket->limit.
This allows for a lot of flexibility, but is also very redundant.
In every case I've had to deal with so far, it would have "more correct"
to set the link limit per socket type and not per socket. I did not enforce
this constraint yet, because the link limit is exposed in the Python API,
which I did not want to break here.

In the future it might even make sense to only support only three kinds of link limits:
a) no links, b) at most one link, c) an arbitrary number links links. The other link
limits usually don't work well with tools (e.g. which link should be removed when a new
one is connected?) and is not used in practice. However, that is for another day.

Eventually, I would like to get rid of bNodeSocket->limit completely and replace it
either with fixed link limits or a callback in bNodeSocketType.

This patch consists of three parts:

**1. Support defining link limit in socket type**
This introduces a new `nodeSocketLinkLimit` function that serves as an indirection to
hide where the link limit of a socket is defined.

**2. Define link limits for builtin sockets on socket type**
Data sockets: one input, many outputs
Virtual sockets: one input, one output
Undefined sockets: many inputs, many outputs (to avoid that links are removed when the type of the socket is not known)

**3. Remove `bNodeSocketTemplate->limit`**
This wasn't used anymore after the second commit. Removing it simplifies socket definitions
in hundreds of places and removes a lot of redundancy.

Differential Revision:

Reviewers: brecht

3 months agoCodeCleanup: move include statements before extern "C"
Jeroen Bakker [Fri, 6 Mar 2020 11:31:38 +0000 (12:31 +0100)]
CodeCleanup: move include statements before extern "C"

Mistake on recent changes that would fail when used in CPP.

3 months agoFix memory leak in the colorio fallback implementation.
Sebastian Parborg [Fri, 6 Mar 2020 11:26:47 +0000 (12:26 +0100)]
Fix memory leak in the colorio fallback implementation.

We would previously not store the transforms that were added to the
group transform node. This would lead to pointer to allocated memory
being lost and not freed.

3 months agoFluid: Added missing UI options for effector objects
Sebastián Barschkis [Fri, 6 Mar 2020 11:26:22 +0000 (12:26 +0100)]
Fluid: Added missing UI options for effector objects

UI was missing some of the new functionality introduced in a5c4a44df67e.

3 months agoCodeCleanup: Use eDrawType
Jeroen Bakker [Fri, 6 Mar 2020 11:21:39 +0000 (12:21 +0100)]
CodeCleanup: Use eDrawType

This patch will make use of the eDrawType where it was used as a
variable or parameter name. The eObjectDrawType was renamed to eDrawType
as it is also used by `View3DShading.type`.

3 months agoCleanup: move camera, lights, world to IDTypeInfo
Brecht Van Lommel [Fri, 6 Mar 2020 10:51:17 +0000 (11:51 +0100)]
Cleanup: move camera, lights, world to IDTypeInfo

3 months agoCodeCleanup: Added enums to opengl render functions
Jeroen Bakker [Fri, 6 Mar 2020 11:08:03 +0000 (12:08 +0100)]
CodeCleanup: Added enums to opengl render functions

Motivation the functions get 3 different kind of flag parameters (ImBuf,
DrawType, OffscreenRendering) the naming of the flags were not clear,
leading to mistakes and unnecessary time spend debugging.

3 months agoCleanup: remove MLOOPUV_EDGESEL
Philipp Oeser [Fri, 7 Feb 2020 10:31:20 +0000 (11:31 +0100)]
Cleanup: remove MLOOPUV_EDGESEL

This was not set anywhere, code relies on MLOOPUV_VERTSEL everywhere.

BMLoopUV.select_edge was never returning True and wasnt updating uv
select state when set manually.

Afaict, there were no official Addons using this from python.

Resolves T65836

Maniphest Tasks: T65836

Differential Revision:

3 months agoAttempt to fix build errors on macOS
Julian Eisel [Fri, 6 Mar 2020 10:43:13 +0000 (11:43 +0100)]
Attempt to fix build errors on macOS

Mistake in 5be0e3430d13

3 months agoAnimation: improved error handling when adding/deleting keyframes
Sybren A. Stüvel [Fri, 6 Mar 2020 10:36:37 +0000 (11:36 +0100)]
Animation: improved error handling when adding/deleting keyframes

There are two ways in which adding/deleting keyframes can fail, but only
one of those was handled. The other would be shown as a successful
add/delete of -2 keyframes.

3 months agoCleanup: Animation, renamed and clarified 'success' variable
Sybren A. Stüvel [Fri, 6 Mar 2020 10:32:38 +0000 (11:32 +0100)]
Cleanup: Animation, renamed and clarified 'success' variable

The `ANIM_apply_keyingset()` returns a value that indicates the number of
changed channels (if nonnegative) or an error state (negative). In the
places where the return value was actually used, this value was stored in
a badly named variable.

3 months agoCleanup: Library: Move to IDTypeInfo, and remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 10:27:29 +0000 (11:27 +0100)]
Cleanup: Library: Move to IDTypeInfo, and remove unused BKE API.

3 months agoCleanup: Object: remove unused BKE API.
Bastien Montagne [Fri, 6 Mar 2020 10:18:14 +0000 (11:18 +0100)]
Cleanup: Object: remove unused BKE API.

3 months agoCleanup: Scene: New IDTypeInfo, and remove unused API from BKE.
Bastien Montagne [Fri, 6 Mar 2020 10:10:10 +0000 (11:10 +0100)]
Cleanup: Scene: New IDTypeInfo, and remove unused API from BKE.

3 months agoFix T73254: Drivers with the object.dimension variable are not updated
Sybren A. Stüvel [Thu, 5 Mar 2020 16:37:30 +0000 (17:37 +0100)]
Fix T73254: Drivers with the object.dimension variable are not updated

This fixes an issue where drivers using `object.dimension` only add a dependency on `GEOMETRY` to the depsgraph, whereas they should also depend on `TRANSFORM`.

This patch adds a new no-op operation that depends on the geometry and transform components to the Parameters component.

An alternative implementation would be to have `RNANodeQuery::construct_node_identifier` return multiple node identifiers. However, this would spread throughout the depsgraph code and unnecessarily force many other functions to either return or handle multiple nodes where in 99.999% of the time a single node would suffice.

The new `DIMENSIONS` node is added for each object. An upcoming patch will go over all no-op operation nodes and remove them from the depsgraph. Since this is a more dangerous operation, it'll be reviewed separately.

Differential Revision:

3 months agoFluid: Cleanup naming for emmission bounding box
Sebastián Barschkis [Fri, 6 Mar 2020 10:03:21 +0000 (11:03 +0100)]
Fluid: Cleanup naming for emmission bounding box

Since the bounding boxes are now also being used for effector objects, there needs to be a better name for them. Instead of calling them EmissionMap, which caters only to emission objects, they will now be called FluidObjectBB.

3 months agoKeymap: ignore repeat events for transform actions
Campbell Barton [Fri, 6 Mar 2020 07:12:56 +0000 (18:12 +1100)]
Keymap: ignore repeat events for transform actions

Resolves T54297

3 months agoCodeCleanup: eevee_materials Use Struct Assignments
Jeroen Bakker [Fri, 6 Mar 2020 09:28:02 +0000 (10:28 +0100)]
CodeCleanup: eevee_materials Use Struct Assignments

3 months agoCleanup: typo in function name
Philipp Oeser [Fri, 6 Mar 2020 08:47:27 +0000 (09:47 +0100)]
Cleanup: typo in function name

contect -> context

3 months agoGHOST/Keymap: support for detecting repeat events
Campbell Barton [Fri, 6 Mar 2020 06:24:12 +0000 (17:24 +1100)]
GHOST/Keymap: support for detecting repeat events

- Keymap items now have 'repeat' boolean which can be set
  to make keymap items respond to key repeat events or not.
- Support for X11 & WIN32 (not macOS currently).

This allows for the possibility to perform actions while a key is held
and finish the action upon release.

Thanks to @Severin for review and WIN32 support.