Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-02-10Refactor: move `Library`-specific functions into proper `BKE_library` file.Bastien Montagne
Even though we do not have much of those, this might change in the future, and in any case having specific functions for this ID type in generic `BKE_lib` area was really confusing.
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2020-01-20Cleanup: remove redundant functionBrecht Van Lommel
2020-01-20Fix T73129: sculpt mode slow on mesh with fake userBrecht Van Lommel
We can't use the fast path when the mesh is used by mulitple objects and so slower sculpting is expected then. But fake users should not affect this. This also fixes the same type of error in a few other areas.
2019-12-24Cleanup: correct filenames in commentsCampbell Barton
2019-12-20Cleanup: in ID name management code: root_name -> base_name.Bastien Montagne
`root_name` did not really meant much here, `base_name` is much more accurate.
2019-12-20ID Management: Improve speed of code used when creating/renaming and ID.Bastien Montagne
This commit affects `id_sort_by_name()` and `check_for_dupid()` helper: * Add a new parameter, `ID *id_sorting_hint`, to `id_sort_by_name()`, and when non-NULL, check if we can insert `id` immediately before or after it. This can dramatically reduce time spent in that function. * Use loop over whole list in `check_for_dupid()` to also define the likely ID pointer that will be neighbor with our new one. This gives another decent speedup to all massive addition cases: | Number and type of names of IDs | old code | new code | speed improvement | | -------------------------------- | -------- | -------- | ----------------- | | 40K, mixed (14k rand, 26k const) | 39s | 33s | 18% | | 40K, fully random | 51s | 42s | 21% | | 40K, fully constant | 40s | 34s | 18% | Combined with the previous commits, this makes massive addition of IDs more than twice as fast as previously.
2019-12-20ID Management: Improve speed of code used when creating/renaming and ID.Bastien Montagne
This commit affects `check_for_dupid()` helper: * Add a special, quicker code path dedicated to sequential addition of a large number of IDs using the same base name. This gives a significant speedup to adding 'randomly'-named IDs: | Number and type of names of IDs | old code | new code | speed improvement | | -------------------------------- | -------- | -------- | ----------------- | | 40K, mixed (14k rand, 26k const) | 49s | 39s | 26% | | 40K, fully random | 51s | 51s | 0% | | 40K, fully constant | 71s | 40s | 78% | Note that 'random' names give no improvement as expected, since this new code path will never be used in such cases.
2019-12-20ID Management: Improve speed of code used when creating/renaming and ID.Bastien Montagne
This commit affects `check_for_dupid()` helper: * Further simplify the general logic of the code (we now typically only do one loop over the list of data-blocks, instead of two). This gives a significant speedup to adding 'randomly'-named IDs: | Number and type of names of IDs | old code | new code | speed improvement | | -------------------------------- | -------- | -------- | ----------------- | | 40K, mixed (14k rand, 26k const) | 62s | 49s | 27% | | 40K, fully random | 76s | 51s | 49% | | 40K, fully constant | 77s | 71s | 8% | Note that 'constant' names give little improvement, as in that case the first loop over the list of IDs (checking whether base given name was already in use) was aborting very quickly.
2019-12-20ID Management: Fix/Sanitize code used when creating or renaming an ID.Bastien Montagne
This commit affects `check_for_dupid()` helper: * Fix (serious though rare) bug where several IDs could end up with exact same name (happened with over 10k IDs with same very long name). * Fix (relatively harmless) func reporting it did not change the given name when it actually had truncated it. * Sanitize handling of supported min/max number suffixes (it now handles between 1 and 1 billion, which should be way more than enough). * Sanitize general logic to (hopefully!) make it easier to follow. * General cleanup (naming, comments, variables scope, remove dead code, etc.). Note that general performances here remain the same, there is no measurable gain or loss. Algorithm remain also the same globally. Attempt to use a GHash to speed up checks of used names proved to be much worse, just building the GHash would already take as much time as the whole process with current code...
2019-12-20ID Management: Improve speed of code used when creating/renaming and ID.Bastien Montagne
This alone can make e.g. adding 40k IDs with default name (i.e. 'fully constant' case in table below) about 15-20% faster: | Number and type of names of IDs | old code | new code | speed improvement | | -------------------------------- | -------- | -------- | ----------------- | | 40K, mixed (14k rand, 26k const) | 75s | 62s | 21% | | 40K, fully random | 90s | 76s | 18% | | 40K, fully constant | 94s | 77s | 22% | Idea is to use a first pass, where we just check one item every nth ones, until we have found the chunk in which we want to insert the new item, then do a basic linear comparison with all items in that chunk as before. Also, list is now walked backward, as in most common 'massive insertion' cases new ID's names have higher number, hence ends up towards the end of the list. This new sorting function can be between a few percents and 50% quicker than original code, depending on various factors (like length of common parts of ID names, whether new IDs should be added towards the end or not, how high in numbering we are, etc.). Note: another, full bisecting approach was also tried, which gives a massive reduction of comparisons (from n items to log2(n)), but it only gave minor improvements of speed from original fully linear code, while adding a fair amount of complexity to the logic. Only case it was shining was the unlikely 'very long, almost similar ID names' case (since `strcasecmp()` is rather costly then).
2019-11-24Cleanup: doxygen commentsCampbell Barton
Also correct some outdated symbol references, add missing 'name' commands.
2019-10-14Fix T70787: Duplicating objects with custom property of type ID creates ↵Bastien Montagne
bogus links. Note that the issue also affected animdata handling... Checked all usages of the `BKE_libblock_copy_ex()` function, and think never handling user count here is valid, although a bit risky maybe. But other solution would be to add yet another copy flag, so would rather go with that one for now.
2019-09-19Fix T66154: viewlayer hide/exclude settings getting lost for linked collectionsBrecht Van Lommel
The problem was that the object and collection pointers in Base and LayerCollection would get lost of file read. Normally such ID pointers would be resolved by pointing to an ID_ID placeholder which has the datablock name, and then replacing it will the real datablock. However ID_ID is only written for directly linked datablocks. This adds the concept of an indirectly linked datablock with a weak reference to it. For this we write an ID_ID_WEAK_REF code, which is a reference that will only be resolved if the datablock was read for another reason. Differential Revision: https://developer.blender.org/D4416
2019-09-19Cleanup: spellingCampbell Barton
2019-09-17Fix T69931: Materials with keyframes duplicated by 'make single user' are ↵Bastien Montagne
linked. Another sneaky bite from the infamous private ID data: While those monsters are not in bmain, the actions used by their animdata are regular cute little ID's, living with the herd in the safe and sound Main DB... So we have to be careful not to propagate the nasty black magic required to handle the formers when we duplicate their animdata. Saying it again: private ID datablocks should never have had their own animdata & actions, this is endless issue also with RNA paths... And makes copying of animation between materials and such needlessly complicated.
2019-09-12Fix T69789: Assert when create a new Full Copy scene base on 2D template.Bastien Montagne
Private ID data (nodetrees and scene collections...) need special care and handling of their copy flags, and checks must be adapted too. In that case, issue came from the fact that even though those IDs have to be copied outside of bmain, we may still require usercount handling. That commit also fixes a somewhat related issue - we cannot use the non-id private data copying flag for private IDs copying, due to difference in handling of usercount again.
2019-09-11DNA: defaults for ID typesCampbell Barton
2019-09-09DNA: use defaults for Object, Mesh, MaterialCampbell Barton
2019-09-02DatablockManagement: Cleanup logic of private IDs handling in ↵Bastien Montagne
`BKE_libblock_copy_ex()`. Now that we have the private ID data flag, we can be more simple *and* generic here.
2019-08-29BKE_libblock_relink_ex: pass all remapping flags instead of a single boolean.Bastien Montagne
There is no reasons to limit access to remapping flags here, we may want to use other options than only the ID_REMAP_SKIP_NEVER_NULL_USAGE one...
2019-08-28Fix T68971: Copy As New Driver from Material node creates a bad reference.Alexander Gavrilov
NodeTree structures of materials and some other data blocks are effectively node group datablock objects that are contained inside the parent block. Thus, direct references to them are only valid while blender is running, and are lost on save. Fix Copy As New Driver to create a reference that goes through the owner datablock, by adding a new ID flag to mark private pseudo-datablocks. Also fix functions that return full paths to structures and properties, e.g. used in python tooltips. Functions for paths from ID to struct or property can't be changed because of Animation Data related code. Reviewers: mont29 Differential Revision: https://developer.blender.org/D5559
2019-08-16Cleanup: spellingCampbell Barton
2019-08-08Cleanup: Typo in naming (BLE instead of BKE, tssttt).Bastien Montagne
2019-08-01Cleanup: misc spelling fixesCampbell Barton
T68035 by @luzpaz
2019-07-19Cleanup messed-up comment formating from codestyle apply...Bastien Montagne
2019-07-07Cleanup: use BKE_packedfile prefix for function namesCampbell Barton
Avoid ambiguity with terms check & compare.
2019-07-02Cleanup: move comments onto own lines to avoid breaking linesCampbell Barton
2019-06-24Fix T63828, T62005: copy/paste or append loses rigid body objectBrecht Van Lommel
Previously settings were removed, now add to the rigid body world automatically even if it's a bit ill defined, since this is confusing for users. Fundamentally the concept of a rigid body world collection could be revised, and left only as an optional thing.
2019-06-15Cleanup: Rename: Static Override -> Library Override.Bastien Montagne
Better to make internal code naming match official/UI naming to some extent, this will reduce confusion in the future. This is 'breaking' scripts and files that would use that feature, but since it is not yet officially supported nor exposed in 2.80, as far as that release is concerned, it is effectively a 'no functional changes' commit.
2019-06-12Cleanup: spelling in commentsCampbell Barton
2019-05-31Cleanup: style, use braces in source/ (include disabled blocks)Campbell Barton
2019-05-23Cleanup: modernize code of new `BLE_main_id_refcount_recompute()`.Bastien Montagne
No functional change expected!
2019-05-23Merge branch 'blender2.7'Bastien Montagne
Conflicts: source/blender/blenkernel/intern/library.c source/blender/blenloader/intern/readfile.c source/blender/editors/screen/screen_edit.c
2019-05-22BKE Library handling: add function to recompute usercounts of IDs.Bastien Montagne
This will be needed in undo/redo case, since we do not re-read linked IDs, their usercounts become total garbage (especially in 'used by local ID' cases)...
2019-05-20Cleanup: reorder report argument for pointer assignmentCampbell Barton
Most code uses ReportList argument last (or at least not first) when an optional report list can be passed in.
2019-05-17Python: Raise an error even NO_MAIN data is assigned to objectSergey Sharybin
The goal is to prevent assignment of temporary or evaluated meshes to objects from the main database. Majority of the change is actually related on passing reports around. On a positive side there are more error prints which can become more visible to scripters. There are still possible further improvements in the related areas. For example, disable user counting for evaluated ID datablocks when assignment happens. But can also happen later on as a separate improvement. Reviewers: brecht, campbellbarton, mont29 Reviewed By: brecht Differential Revision: https://developer.blender.org/D4884
2019-05-10Fix T64304: Objects in appended scene from 2.79 file disappear after saving.Bastien Montagne
Versionning code generating collections from old 2.79 scene layers was setting new collections' library from scene, but it also needs to properly set the `LIB_TAG_INDIRECT` tag, otherwise localizing code does not know what to do, and most of append process fails.
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-22Cleanup: style, use braces for blenkernelCampbell Barton
2019-04-20Cleanup: add missing macros to clang-formatCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
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-16Fix T62913: datablock append removing unrelated rigid body objects.Brecht Van Lommel
2019-04-16Fix proxy remapping on make local failing for more than one object.Brecht Van Lommel
2019-03-29Cleanup: Fix comment.Bastien Montagne
2019-03-11Add WorkSpace to list of ID types that are not supported by standard copy ↵Bastien Montagne
mechanism for now. Am not sure whether we want to support that at some point, but at least if we don’t, make it safe and get out of copy code early, previously trying to duplicate workspace through BKE_id_copy() would have given a very bad a broken result...
2019-03-10Fix T62393: Materials made from 'Make Single User' have linked animation.Bastien Montagne
`id_single_user()` was still code from older ID management, now we can use modern code to handle animdata duplication for us (which allows to keep handling of nasty sub-data ID horrors like nodtrees in a single place, much safer and simpler).
2019-03-08Cleanup: use plural names for Main listsCampbell Barton
Convention was not to but after discussion on 918941483f7e we agree its best to change the convention. Names now mostly follow RNA. Some exceptions: - Use 'nodetrees' instead of 'nodegroups' since the struct is called NodeTree. - Use 'gpencils' instead of 'grease_pencil' since 'gpencil' is a common abbreviation in the C code. Other exceptions: - Leave 'wm' as it's a list of one. - Leave 'ipo' as is for versioning.
2019-03-06Cleanup: remove useless extra-processing after BKE_id_new_name_validate() call.Bastien Montagne
This function already handles sorting of ID in its listbase.
2019-03-06Cleanup: use default ID type's name instead of generic 'Untitled' for new IDs.Bastien Montagne