Commit Graph

1234 Commits

Author SHA1 Message Date
Hans Goudey
26e9c2147e Blenloader: Add utility function to write double array
It makes sense to support writing double arrays just like floats.
This is just split from a patch (D9697) to slim it down some.
2020-12-15 12:43:21 -06:00
Julian Eisel
e413c80371 Asset System: Support custom asset library paths through Preferences
One of the core design aspects of the Asset Browser is that users can "mount"
custom asset libraries via the Preferences. Currently an asset library is just
a directory with one or more .blend files in it. We could easily support a
single .blend file as asset library as well (rather than a directory). It's
just disabled currently.

Note that in earlier designs, asset libraries were called repositories.

Idea is simple: In Preferences > File Paths, you can create custom libraries,
by setting a name and selecting a path. The name is ensured to be unique. If
the name or path are empty, the Asset Browser will not show it in the list of
available asset libraries.
The library path is not checked for validity, the Asset Browser will allow
selecting invalid libraries, but show a message instead of the file list, to
help the user understand what's going on.
Of course the actual Asset Browser UI is not part of this commit, it's in one
of the following ones.

{F9497950}

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

Differential Revision: https://developer.blender.org/D9722

Reviewed by: Brecht Van Lommel, Hans Goudey
2020-12-15 17:03:48 +01:00
Campbell Barton
525364be31 Cleanup: reduce indirect DNA header inclusion
Remove DNA headers, using forward declarations where possible.

Also removed duplicate header, header including it's self
and unnecessary inclusion of libc system headers from BKE header.
2020-12-15 12:34:14 +11:00
Campbell Barton
e00bb5a4b7 Cleanup: spelling 2020-11-12 11:35:31 +11:00
Jacques Lucke
c2b7e83fae Cleanup: remove unused includes in readfile.c and writefile.c 2020-11-06 19:11:53 +01:00
Jacques Lucke
b0dcabdf65 Cleanup: fix naming and remove unnecessary code 2020-11-06 18:41:03 +01:00
Jacques Lucke
638913a3c0 Refactor: move Object .blend I/O to IDTypeInfo callbacks 2020-11-06 18:25:51 +01:00
Jacques Lucke
2acf01ec62 Refactor: move Pose .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:58:25 +01:00
Jacques Lucke
58e9b51f95 Refactor: move Constraint .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:45:29 +01:00
Jacques Lucke
37ef37711d Refactor: move MotionPath .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:33:13 +01:00
Jacques Lucke
57414e6d1d Refactor: move gpencil modifier .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:22:20 +01:00
Jacques Lucke
019407810b Refactor: move modifier .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:13:16 +01:00
Jacques Lucke
af24532612 Refactor: move ShaderFx .blend I/O to blenkernel
Ref T76372.
2020-11-06 16:42:50 +01:00
Jacques Lucke
f6524aaa80 Refactor: move ParticleSystem .blend I/O to blenkernel
Ref T76372.
2020-11-06 15:58:39 +01:00
Jacques Lucke
140d6cc4a2 Refactor: move Scene .blend writing to IDTypeInfo callback 2020-11-06 14:49:30 +01:00
Jacques Lucke
7dd76329e1 Refactor: move PointCache .blend I/O to blenkernel
Ref T76372.
2020-11-06 14:40:54 +01:00
Jacques Lucke
dfa027fe09 Refactor: move sequencer modifier .blend I/O to sequencer module
Ref T76372.
2020-11-06 14:28:33 +01:00
Jacques Lucke
62223e9851 Refactor: move color settings .blend I/O to blenkernel
Ref T76372.
2020-11-06 14:10:31 +01:00
Jacques Lucke
41db8f2fce Refactor: move LightCache .blend I/O to eevee_lightcache.c
Ref T76372.
2020-11-06 13:35:19 +01:00
Jacques Lucke
da96389dcb Refactor: move remaining ViewLayer .blend I/O to blenkernel
Ref T76372.
2020-11-06 13:22:10 +01:00
Jacques Lucke
3ee9e3a04f Cleanup: remove unnecessary function 2020-11-06 13:17:31 +01:00
Jacques Lucke
9ad2965921 Refactor: move Paint .blend I/O to blenkernel
Ref T76372.
2020-11-06 13:16:17 +01:00
Jacques Lucke
e810a16d75 Refactor: move wmWindowManager .blend I/O to IDTypeInfo callbacks 2020-11-06 13:04:56 +01:00
Julian Eisel
ef4aa42ea4 UI: Enable writing global area data (top-bar, status-bar) to .blend's
There should not be much user visible here (other than T73668 being addressed).

I added the writing code already for the initial implementation of workspaces,
but we decided to keep it disabled until the top-bar design is more clear. It
was never planned to keep this disabled for so long.

Fixes T73668.
2020-11-02 18:35:13 +01:00
Richard Antalik
ea1c5a6c15 Rename BKE_sequencer.h
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9349
2020-11-01 21:10:36 +01:00
Jacques Lucke
62e532785d Refactor: move WorkSpace .blend I/O to IDTypeInfo callbacks 2020-10-30 16:32:55 +01:00
Jacques Lucke
12c92433d8 Refactor: move bScreen .blend I/O to IDTypeInfo callbacks
I could not easily move `direct_link_screen` yet, because it
has a return value. That has to be solved differently at some point.
2020-10-30 16:01:26 +01:00
Jacques Lucke
fc9ec1b9d8 Refactor: move Area .blend I/O to blenkernel
There should be no functional changes.
Eventually, it would be good to handle the different space types
using callbacks.

Ref T76372.
2020-10-30 15:28:17 +01:00
Jacques Lucke
bcb612e361 Refactor: move view3dshading .blend I/O to blenkernel
Ref T76372.
2020-10-30 14:44:03 +01:00
Jacques Lucke
ada45463b3 Refactor: move ParticleSettings .blend I/O to IDTypeInfo callbacks 2020-10-30 13:43:34 +01:00
Jacques Lucke
b85504337e Refactor: move Collection .blend I/O to IDTypeInfo callbacks
This one was a bit more tricky, because the file loading is
mixed with versioning code and because collections are
embedded into scenes.

All tests that passed before, still pass.
2020-10-29 19:34:15 +01:00
Campbell Barton
2abfcebb0e Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
2020-10-10 22:04:51 +11:00
Jacques Lucke
762d93a26b DNA: use better type for SDNA->structs
The data layout remains exactly the same..
This change just gives all the elements in `SDNA->structs` names,
making it more comfortable to work with the data.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8926
2020-09-29 12:12:09 +02:00
Sergey Sharybin
216a221876 Implement ID properties support for TimeMarker
Allows scripters to store additional information in the marker itself instead
of using work-around approach based on marker names and such.

Differential Revision: https://developer.blender.org/D8944
2020-09-21 12:25:45 +02:00
Bastien Montagne
5ea1049e75 Sanitize type 'size' parameters in our read/write file code
This patch tries to sanitize the types of our size parameters across our read
and write code, which is currently fairly inconsistent (using `int`, `uint`,
`size_t`...), by using `size_t` everywhere. Since in Blender file themselves
we can only store chunk of size `MAX_INT`, added some asserts to ensure that
as well.

See {T79561} for details.

Differential Revision: https://developer.blender.org/D8672
2020-09-20 18:41:50 +02:00
Campbell Barton
a8fd3df905 Cleanup: spelling 2020-09-15 10:23:41 +10:00
Bastien Montagne
ec6d32b238 Fix T78392: [2.83.5, 2.90, 2.91] Crash on undo/ redo after changing modes.
During undo/redo read code is expected to clear the `OB_MODE_EDIT`
bitflag of `Object.mode`, for some reasons.

This was not done anymore for re-used Objects, we need to add a special
handling case for that too.

Should be backported to 2.90 and 2.83 (will probably not be straight
forward for the latter).
2020-09-14 14:59:29 +02:00
Jacques Lucke
08002eb865 Cleanup: remove unused includes 2020-09-11 12:08:12 +02:00
Jacques Lucke
c27d00cde0 Refactor: move CacheFile .blend I/O to IDTypeInfo callbacks 2020-09-11 11:57:54 +02:00
Jacques Lucke
f8ef7f045c Refactor: move Sound .blend I/O to IDTypeInfo callbacks 2020-09-11 11:52:37 +02:00
Jacques Lucke
218e9e76a8 Refactor: move Simulation .blend I/O to IDTypeInfo callbacks 2020-09-11 11:46:26 +02:00
Jacques Lucke
12693b807e Refactor: move Volume .blend I/O to IDTypeInfo callbacks 2020-09-11 11:39:06 +02:00
Jacques Lucke
ff4578a6e7 Refactor: move PointCloud .blend I/O to IDTypeInfo callbacks 2020-09-11 11:20:57 +02:00
Jacques Lucke
1b6dd42803 Refactor: move Hair .blend I/O to IDTypeInfo callbacks 2020-09-11 11:14:17 +02:00
Jacques Lucke
12f33daad7 Refactor: move GPencil .blend I/O to IDTypeInfo callbacks 2020-09-11 11:06:15 +02:00
Jacques Lucke
16fecdf994 Refactor: move Texture .blend I/O to IDTypeInfo callbacks 2020-09-11 10:35:36 +02:00
Jacques Lucke
11df9cb9fb Refactor: move Key .blend I/O to IDTypeInfo callbacks 2020-09-10 18:01:55 +02:00
Jacques Lucke
e628e8821e Refactor: move LightProbe .blend I/O to IDTypeInfo callbacks 2020-09-10 17:47:04 +02:00
Jacques Lucke
133b7c34dd Refactor: move Armature .blend I/O to IDTypeInfo callbacks 2020-09-10 17:41:04 +02:00
Jacques Lucke
0c7e77d416 Refactor: move Speaker .blend I/O to IDTypeInfo callbacks 2020-09-10 17:31:18 +02:00