Commit Graph

508 Commits

Author SHA1 Message Date
Campbell Barton
333cdbb410 Cleanup: comment blocks 2019-04-18 07:59:28 +02:00
Campbell Barton
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton
bdeb6743e3 CMake: sort file list 2019-04-15 07:13:41 +02:00
Campbell Barton
47adab4f99 CMake: prepare for BLENDER_SORTED_LIBS removal
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.
2019-04-14 15:37:24 +02:00
Campbell Barton
eff8cc9ccc Cleanup: doxy comments
Use doxy references to function and enums,
also correct some names which became out of sync.
2019-04-14 10:48:42 +02:00
Campbell Barton
a358f6bb69 Cleanup: use STR_ELEM macro 2019-04-10 09:36:06 +02:00
Campbell Barton
b5d1e0ad1e Cleanup: spelling 2019-04-10 00:38:47 +10:00
Brecht Van Lommel
b0037cd0b4 Fix T63219: error in previous commit for makesdna mismatch detection 2019-04-02 13:38:51 +02:00
Brecht Van Lommel
964b5f02ca DNA: add error for DNA computed struct sizes and member offsets mismatch.
Ref T63164, there was a hidden bug like this on Windows 32 bit.
2019-04-02 13:42:13 +02:00
Brecht Van Lommel
1abd909a92 Cleanup: remove DNA_PRIVATE_WORKSPACE hacks.
This is just not practical to do for the code as a whole, and having it as an
exception for one specific data structure is not that helpful. This has only
been in the way for me when refactoring code.
2019-04-02 13:32:25 +02:00
Campbell Barton
c11a317ee1 Cleanup: style, use braces for makesdna, datatoc 2019-03-28 10:11:54 +11:00
Campbell Barton
d47f827019 Cleanup: unused warning 2019-03-19 08:39:48 +11:00
Campbell Barton
e5ab2b9c62 DNA: optimize data reconstruction
Cache the result of DNA_elem_array_size which was being called
for each element when reconstructing each struct.

Also skip padding members during reconstruction.

Gives ~18% overall speedup loading 10_010_A.anim.blend (r3154)
from the spring project.# Please enter the commit message for your changes. Lines starting

Note, this was reverted recently because it caused T62181
Changes to DNA_sdna_patch_struct_member_nr were needed which
caused issues loading old 2.8x files.
2019-03-05 03:10:43 +11:00
Campbell Barton
46f1c1b15d Revert "DNA: optimize data reconstruction"
This reverts commit 657205530c.

This caused an T62181, looking into fix but revert for now.
2019-03-05 00:21:48 +11:00
Campbell Barton
657205530c DNA: optimize data reconstruction
Cache the result of DNA_elem_array_size which was being called
for each element when reconstructing each struct.

Also skip padding members during reconstruction.

Gives ~18% overall speedup loading 10_010_A.anim.blend (r3154)
from the spring project.
2019-03-04 03:00:33 +11:00
Campbell Barton
647c26c5ce DNA: rename BezTriple alfa to tilt 2019-03-04 01:18:06 +11:00
Campbell Barton
dcbc09e429 Cleanup: comma warning 2019-03-03 02:29:43 +11:00
Campbell Barton
f67e81e295 Cleanup: SDNA/DNA naming
Use 'size' instead of 'len' to represent the size of data in bytes,
'len' is used for the result of 'strlen' or the length of an array
in some parts of 'makesdna.c' & 'dna_genfile.c'.

Also clarify comments and some variable names, no functional changes.
2019-03-03 01:29:08 +11:00
Campbell Barton
79171b15e4 makesdna: enforce use of '_pad' naming convention 2019-02-27 15:27:07 +11:00
Campbell Barton
168d3fd528 Cleanup: file rename lamp -> light 2019-02-27 12:36:32 +11:00
Campbell Barton
3051e2f4ae DNA: rename Lamp -> Light
- BKE_lamp -> BKE_light
- Main.lamp -> light
2019-02-27 11:03:16 +11:00
Campbell Barton
186bd4d87b Cleanup: indentation, trailing space 2019-02-26 14:31:48 +11:00
Campbell Barton
af5cfa7544 Cleanup: quiet undeclared variable warning 2019-02-23 19:20:20 +11:00
Campbell Barton
fc10e89918 DNA: rename Object.col -> color
Was confusing, unrelated to:
colbits, col_mask, col_group, actcol & totcol.
2019-02-19 08:48:15 +11:00
Campbell Barton
cc10d86535 DNA: rename Object.size -> scale
Resolves a common cause of confusion.
2019-02-18 15:43:55 +11:00
Campbell Barton
022f339271 DNA: rename Collection.dupli_ofs -> instance_collection 2019-02-18 10:41:04 +11:00
Campbell Barton
cf966f3b38 DNA: support renaming structs that use the old renaming hack 2019-02-18 10:37:57 +11:00
Campbell Barton
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton
a3b3b9d74b DNA: comment on how to avoid DNA rename errors 2019-02-18 08:22:11 +11:00
Campbell Barton
319b9d6501 DNA: rename dup_* struct members to instance_* 2019-02-17 19:00:54 +11:00
Campbell Barton
9d09eda0a3 DNA: rename theme space types
Follow enum naming convention, use "space_" prefix instead of "t".
2019-02-16 16:30:13 +11:00
Campbell Barton
ae375b4cdc DNA: ensure new names exist when renaming
Fail to build on errors in new names - without this renamed values
would be written to DNA breaking backwards & forwards compatibility.

Note that errors in old names aren't detected.
2019-02-16 13:10:32 +11:00
Campbell Barton
2f737c4f47 DNA: rename near/far -> clip_start/clip_end
Rename for Camera, View3D (also CameraParams & Render not DNA)
2019-02-16 12:26:07 +11:00
Campbell Barton
ec471a9b1c DNA: rename SpaceButs -> SpaceProperties 2019-02-16 10:44:15 +11:00
Campbell Barton
419911b1d1 DNA: rename SpaceIpo -> SpaceGraph 2019-02-16 10:23:40 +11:00
Campbell Barton
374cbdc63b DNA: rename SpaceOops -> SpaceOutliner 2019-02-16 09:48:29 +11:00
Campbell Barton
51c034686a DNA: rename camera YF_dofdist -> dof_distance 2019-02-16 09:43:33 +11:00
Campbell Barton
a2f345468c DNA: support DNA type & name aliases
This allows us to rename struct & struct members in the source code
without changing the file format.

This is useful because the code becomes increasingly confusing when
names such as oops, ipo & dupli aren't used anywhere except DNA headers.

dna_rename_defs.h is used to define renaming operations.

The renaming it's self will be done separately.
2019-02-16 09:32:29 +11:00
Campbell Barton
bc657ef16e DNA: warn about old versioning being incomplete
Also sync variable names w/ D4342
2019-02-16 08:51:00 +11:00
Campbell Barton
d17a027034 Fix DNA struct member versioning logic
Possible error changing names which are shared between structs.
While the problem doesn't occur at the moment, avoid future problems.
2019-02-15 18:17:58 +11:00
Campbell Barton
925b202641 Cleanup: sync minor changes from D4342
Use naming conventions from the patch so they match when it's applied.
2019-02-15 17:22:33 +11:00
Campbell Barton
986d480566 makesdna: correct function docs
Also use doxy sections & remove parens from return values.
2019-02-15 10:41:10 +11:00
Campbell Barton
a9da750aee DNA: add in-place stripping utility
Minor change from D4342
2019-02-14 09:59:46 +11:00
Campbell Barton
ba6cf3cdb6 Cleanup: rename variable name for DNA utils
Rename 'elem_dna' to 'elem_full' to signify it has array/pointer chars.
2019-02-13 11:09:07 +11: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
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
1a8cd3a8a7 Cleanup: avoid string copy for comparing int id's
More direct and readable.
2019-02-11 23:53:33 +11:00