Commit Graph

70061 Commits

Author SHA1 Message Date
Bastien Montagne d59c2d12b1 Fix modifier freeing code re. ID refcounting.
Free code should not handle ID refcounting at all. This has to be done
at higher level, since in some case we want to free (temp) data that
actually did not refcount at all its IDs.

This change seems to be working OK, but as usual in that area, only
lots of testing in real-case situation will say whether there are some
hidden bugs or not.
2018-04-04 14:58:52 +02:00
Sergey Sharybin 0c7ec58966 Depsgraph: Make sure textures used by modifiers are in the graph 2018-04-04 12:56:04 +02:00
Mai Lavelle 49f77b0d83 Proper fix for T54337
Accidentally checked the wrong variable in fa01a1738b.
2018-04-04 06:36:16 -04:00
Bastien Montagne 677d699645 Tweak ID->tag reset on file load (no visible change expected!).
Issue was, *some* IDs (like infamous nodetrees from materials etc.)
would not go through the 'main' read_libblock() func, so their tags were
never reset.

So now, we ensure direct_link_id() always clear the tags, and move
setting them in read_libblock() after the call to direct_link_id().

Needed for depsgraph, but general healthier fix actually.
2018-04-04 11:59:16 +02:00
Sergey Sharybin c128738926 Depsgraph: Ensure root pchan is always found 2018-04-04 11:49:01 +02:00
Sergey Sharybin 909efe6be5 Depsgraph: Assert that pchan index is always valid 2018-04-04 10:35:32 +02:00
Sergey Sharybin f913e69093 Depsgraph: Add missing expansion od custom bone shapes
This was fixed in 2.8 branch but not in master.
2018-04-04 10:15:45 +02:00
Sergey Sharybin 4674e02562 Depsgraph: Only bind ID-data and indices to depsgraph callbacks
This is a part of copy-on-write sanitization, to avoid all the checks
which were attempting to keep sub-data pointers intact.

Point is: ID pointers never change for CoW datablocks, but nested
data pointers might change when updating existing copy.

Solution: Only bind ID data pointers and index of sub-data.
This will make CoW datablock 7update function was easier in 2.8.

In master we were only using pose channel pointers in callbacks,
this is exactly what this commit addresses. A linear lookup array
is created on pose evaluation init and is thrown away afterwards.

One thing we might consider doing is to keep indexed array of
poses, similar to chanhash.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D3124
2018-04-04 09:48:41 +02:00
Mai Lavelle fa01a1738b Fix T54337: Cycles crash with simple subd object in debug build 2018-04-03 23:37:12 -04:00
Mai Lavelle 8c4d28cdb9 Fix T54400: Some GCN 1 cards available to select for use with Cycles
Hainan was missing from the list of GCN 1 cards.
2018-04-03 23:15:07 -04:00
Campbell Barton 2f723a414f BMesh: remove redundant loop in select-next-active
Thanks to @nBurn for spotting
2018-04-03 18:32:55 +02:00
Campbell Barton ab695c3297 Undo: make id-map use binary search to keep sorted 2018-04-03 18:07:51 +02:00
Campbell Barton 1f0f234b07 Fix own error w/ undo ID lookup
Was testing with small number of items, so this went unnoticed.
2018-04-03 17:58:37 +02:00
Campbell Barton b2c9fdfe87 Cleanup: rename BMesh count_ex -> count_at_most 2018-04-03 17:06:36 +02:00
Campbell Barton bfdb88f3f4 Cleanup: rename list count_ex -> count_at_most 2018-04-03 17:05:21 +02:00
Campbell Barton 06a62d4e06 Undo: use with_prev verisons of id-map lookups 2018-04-03 17:03:33 +02:00
Campbell Barton 5a7deab65a Undo: use general id-map for image undo lookups.
Was doing own name based lookups to keep compatible w/ global undo.
2018-04-03 17:03:33 +02:00
Campbell Barton 75de21f072 Undo System: id-map avoid duplicate add/lookup
Add versions of add/lookup that check the previous item.
2018-04-03 17:03:33 +02:00
Campbell Barton 53f068454e Fix mistake logging w/ undo 2018-04-03 17:03:33 +02:00
Bastien Montagne 96f565b380 Fix T54477: Broken utf8 strings in old .blend files
Back in the days (2.4x and before), it was rather easy to get some
invalid utf-8 strings in Blender. This is totally breaking modern code,
so this commit adds a simple 'check & fix strings' operator, available
from the main File menu.
2018-04-03 16:03:11 +02:00
Bastien Montagne 601835cd31 Fix (unreported) crash when accessing some bl_rna.properties.
E.g. typing `bpy.data.bl_rna.properties[8].<tab>` in console would hard-crash
trying to dereference NULL pointer. Was a missing check in rna_Property_tags_itemf().
2018-04-03 14:32:23 +02:00
Campbell Barton b3004d30f5 Undo: remove particle undo push
Was only called on copy particle system
which is already doing an undo push.
2018-04-03 08:57:01 +02:00
Campbell Barton 72ae0e1b6d Cleanup: editor BKE_main includes 2018-04-03 08:42:12 +02:00
Campbell Barton a0eb54142f Undo: replace global access w/ ED_undo_stack_get
While I'd like to avoid using this too much since the operator
system should handle.
It's less trouble than accessing it inline each time.
2018-04-03 08:35:42 +02:00
Campbell Barton 31f2a6755d PyAPI: Add PyC_Tuple_Pack_F64 utility 2018-04-02 19:48:34 +02:00
Brecht Van Lommel 71d7d6cd8c Build: add WITH_OPENVDB_3_ABI_COMPATIBLE option.
Better fix for T54457. It seems Debian compiles OpenVDB without ABI 3
compatibility, while Arch does enable it as is the default in the OpeVDB
CMake build system.

So now there's an option that the distribution can set depending on how
they compile their OpenVDB package.
2018-04-02 19:13:04 +02:00
Campbell Barton 4041385ddd Cleanup: remove redundant imbuf return values
Some functions always returned the input argument
which was never used.

This made code read as if there might be a leak.

Now return a boolean (true the imbuf is modified).
2018-04-02 17:34:52 +02:00
Milan Jaros 888a04c7e4 Build: fixes for the Intel compiler versions 2016, 2017, 2018.
Differential Revision: https://developer.blender.org/D3109
2018-04-02 16:39:04 +02:00
Campbell Barton 692aeb6fe0 Cleanup: newlines left in messages 2018-04-02 15:46:31 +02:00
Campbell Barton 4ffa05c30b Cleanup: move undo into it's own directory
Split out undo API from ED_util.h into ED_undo.h
2018-04-02 15:07:40 +02:00
Campbell Barton b186592b21 Cleanup: move BKE_global include under ifdef's 2018-04-02 14:19:44 +02:00
Campbell Barton 44efbef41e Undo: store active curve shape key in edit-mode 2018-04-02 13:13:57 +02:00
Campbell Barton 017c731cf3 Logging: use for Python API
Adds categories "bpy.context" & "bpy.rna"
2018-04-02 13:13:57 +02:00
Ray Molenkamp 21fcc723e9 imbuf: revert some of the changes of rBb6ba3c682dd6615e760905572a5bcd69bb46371f since they broke the build. 2018-04-01 15:17:17 -06:00
Sergej Reich b29ecbfc6b Fix compiling with Alembic
Still need G.main
2018-04-01 19:50:19 +02:00
Campbell Barton f48895f74a Correct accidental changes by C Logging addition
Error in 891c1cfc9a
2018-04-01 10:23:28 +02:00
Campbell Barton 473f17b3d5 Resolve unsigned comparison error w/ MSVC 2018-04-01 07:41:23 +02:00
Campbell Barton b6ba3c682d Cleanup: remove global header 2018-04-01 07:24:45 +02:00
Campbell Barton 951d89b7b4 Cleanup: warning 2018-03-31 23:51:38 +02:00
Campbell Barton d18116a297 Removed by accident in last commit 2018-03-31 23:47:05 +02:00
Campbell Barton 651b8fb14e Undo: unified undo system w/ linear history
- Use a single undo history for all operations.
- UndoType's are registered and poll the context to check if they
  should be used when performing an undo push.
- Mode switching is used to ensure the state is correct before
  undo data is restored.
- Some undo types accumulate changes (image & text editing)
  others store the state multiple times (with de-duplication).
  This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`.
- Each undo step stores ID datablocks they use with utilities to help
  manage restoring correct ID's.
  Needed since global undo is now mixed with other modes undo.
- Currently performs each undo step when going up/down history
  Previously this wasn't done, making history fail in some cases.
  This can be optimized to skip some combinations of undo steps.

grease-pencil is an exception which has not been updated
since it integrates undo into the draw-session.

See D3113
2018-03-31 20:40:37 +02:00
Campbell Barton 91d0825b55 BLI_sort_utils: add pointer sorting callback
Also rename Pointer -> Ptr
2018-03-31 19:25:27 +02:00
Campbell Barton ae3a1da1e6 Logging: fix own error with formatting 2018-03-31 15:43:47 +02:00
Campbell Barton b237a1c2ea Use int instead of bool
Causes issues when including in some files.
2018-03-31 15:33:15 +02:00
Campbell Barton db8e7f9780 Logging: add argument --log-show-basename
Optionally strips leading path from filenames when logging.
2018-03-31 15:29:46 +02:00
Campbell Barton 5cb440492e Cleanup: --help text output
Some arguments missed their <value>.
2018-03-31 14:53:15 +02:00
Campbell Barton 22d40fdfd8 Cleanup: blf internal struct naming
- use x/y/width/height/max as a suffix.
- replace 'num' prefix /w 'len' suffix.
2018-03-31 13:40:23 +02:00
Campbell Barton ac4513a5b8 Logging: add ability to exclude categories. 2018-03-31 12:52:47 +02:00
Campbell Barton 5f59c22bf1 Docs: doxygen docs for clog 2018-03-31 12:27:18 +02:00
Campbell Barton b8a66973ac Fix clog: own error allocating from static buffer 2018-03-31 11:25:49 +02:00