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-03-06Cleanup: Collection: Move to IDTypeInfo, and remove unused BKE API.Dalai Felinto
Note: we still need BKE_collection_free since we call it from scene.c.
2020-03-04Refactor ID make local to use a single flag parameter.Bastien Montagne
Instead of using anonymous booleans flags, also allows to keep the same behavior in all cases, without needing special handling from calling code for our beloved oddballs object proxies...
2020-03-04Cleanup: ID make local: remove `id_in_bmain` argument.Bastien Montagne
This info is now stored in ID tags themselves, so no need to pass an extra anonymous boolean parameter around, yay!
2020-03-04Cleanup: Rename 'make local' functions to new scheme.Bastien Montagne
Also removed some only used locally from the header, `BKE_lib_id.h` is already way too big, no need to overload it with unused things.
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-17Fix memory leak when full-copying a scene after recent changes.Bastien Montagne
Once again, am not exactly sure why that was working before, and not anymore - but in any case, doing that kind of update here is not only useless (since we have to do it at the end of the whole collections/objects duplication and remapping anyway), it is also rather dangerous, as collections are currently in rather invalid states at that point of the code... Note that in ideal world, `BKE_main_collection_sync()` & co would be lazy (setting only a flag, then code actually needing this to be valid again should call some sort of `BKE_main_collection_sync_ensure()`). Then we would not have to worry about such things (and we'd get nice performance improvements in some cases, also in main remapping code, etc.). Food for some refactoring, some day...
2019-10-15Fix T69644 / T68586: objects flag unsynced when drag hidden collectionsDalai Felinto
That would lead to crashes and other issues. The solution is not elegant though, it involves resyncing all the collections again. Differential Revision: https://developer.blender.org/D6043
2019-10-04Fix assert when deleting a RBW constraint object.Bastien Montagne
Side-reported in T70505. Code did not ensure deleted object was removed from the RBW constraints collection, leading to some invalid status (object in constraints collection but without relevant contraints data). Also fixed another issue - code deleting RBW objects would try to remove any constraint one using it as target, in a very bad and broken way, since you cannot iterate over objects of a collection while removing some... Now instead just NULLify relevant pointers... I hope it works, otherwise we'll have to take a different approach. Needless to stress again how weak the whole RBW code is in general, and regarding same object being used by RBW in more than one scene in particular, that is known broken situation anyway.
2019-09-02DatablockManagement: Cleanup: get rid of `BKE_collection_copy_master()`.Bastien Montagne
Now that we 'properly' support private ID data in lib management, there is no reason anymore to have that custom func, badly named and by-passing the whole generic ID management code.
2019-09-02Cleanup: get rid of BKE_collection_master() useless accessor.Bastien Montagne
In its current version that was a totally useless extra layer of crap that we can totally avoid. Plus name was bad too.
2019-09-02Make Scene Master collection 'Private' ID data, like root nodetrees.Bastien Montagne
Same issue here as with root nodetrees, those are private ID data owned by another ID, and not in Main DB. This requires special handling. there are still quiet a few things to do here, like getting rid of special code for master collection (regular ID copying should handle that just as it already does for root nodetrees), cleanup in ID copying code, etc.
2019-08-14Cleanup: move trailing comments to avoid wrapping codeCampbell Barton
Some statements were split across multiple lines because of their trailing comments. In most cases it's clearer to put the comments above.
2019-07-30Fix T66629: Library override - fails when armature and mesh are in separate ↵Bastien Montagne
collections. Some ugly very low-level collection code was using the generic LIB_TAG_DOIT tag... should never happen, that one is for rather high-level code to use, core process shall use own tags.
2019-07-16Fix T66944: Rigid Body Constraint in duplicated collection is not added to ↵Bastien Montagne
RigidBodyConstraints collection. We only had a very limited, specific handling of that in collection duplication code, but this has to be handled at a much more general level in Object copy code itself, since it makes no sense to duplicate rigidbody object data without adding new copy to relevant rigidbody collections... WARNING: This is a fairly risky rework of rigidbody handling logic when copying an Object data-block. It is *NOT* considered safe enough for 2.80 release. I tried to take into account copy flags to not mess with other IDs (collections) when we are copying outside of Main, and also not do deg tags when this is forbidden, but risk of something going wrong here is too high...
2019-06-20Fix T64705: can't drive object visibility in collection instancesBrecht Van Lommel
Not the cleanest solution, but should be fine until we add support for driving collection visibility and revise this system as a whole.
2019-06-17Fix T65674: Rigid bodies in duplicated collections are not automatically ↵Bastien Montagne
added to Rigid Body World. As title says, we need to add back new copies of objects that are RB items to the RBW collections...
2019-06-11Fix T64430: Removing objects from sub-collection doesn't update instances of ↵Bastien Montagne
parent collection. Collections are a tad annoying with all their caching of objects... When we modify content of a children collection, we need to tag DeG for CoW update of all of the ancestors. For now keeping that recursive tagging helper private, but would not be surprised if we found more similar cases and needed to expose it to more code...
2019-06-05Fix T65502: Crash when moving Collection into disabled CollectionDalai Felinto
2019-05-27Fix T63173: Dragging hidden collection inside a visible one unhides itDalai Felinto
Same for holdout, indirect only and exclude. Reviewers: brecht Differential Revision: https://developer.blender.org/D4945
2019-05-23BKE Collection: Add new function to rebuild parent relationships.Bastien Montagne
It's not always possible to keep 'by hand' parent relationships valid in collections hierarchy. Add functions to remake those (re-using/factorizing code from `readfile.c` `lib_link_collection_data()` function). Can't stress again how painful it is to have those kind of backward relationships in our data structures, those *always* end up being serious issues to keep in sync... Should only be generated on the fly when needed, period. :(
2019-05-21Fix T64763: 'Make Proxy' creates Proxy within linked Collection.Bastien Montagne
`BKE_collection_object_add_from()` would not check wether collections were local or not... Trivial to fix. Note that here I assume we do not use that function in some special cases where we would like to edit linked datablocks. Think that is reasonable stance, though.
2019-05-19Cleanup: doxygen parametersCampbell Barton
2019-05-15Outliner Restriction: Naming sanitization and iconDalai Felinto
No major API change here, only in the outliner restriction column variables (e.g., show_restrict_column_selectable > show_restrict_column_select). * Get rid of _INSTANCE (introduced on b1af68200159). * Differentiate (everywhere but the API) between HIDE (temporary) and VIEWPORT (global). * Use the expected icon for restrict viewport (same as objects and modifiers). * selectable > select
2019-05-11Outliner Visibility UpdateDalai Felinto
See T61578 for discussions and mockups. Visibility Options ================== We are adding more granular control over restriction columns in the outliner, exposing "indirect only" and "holdout" as options, and change the way users enable/disable collections in a viewlayer. We also rename the object viewport restriction to hide instance. So the options we have are: Collection ---------- * Render Visibility * Instance Visibility * Selectable (View) Layer Collection ----------------------- * Enable * Holdout * Indirect Only * Viewport Shortcuts ========= Isolate Collection ------------------ * Ctr + click isolates the collection. It turns all its parents and children "visible", and all the other collections "invisible". If ALL the collections were already properly set, we re-set the collections to their default value. Set Collection Inside Collections and Objects --------------------------------------------- * Shift + click: Set/unset inside collections and objects. We only set objects values as well when we are in View Layer mode and (obviously) when the objects have a matching property. Icons ===== Little reminder that we will need better icons for holdout, indirect only, and probably instanced (nothing wrong with the current, but it differs from the proposal when it is turned off). Also, we need to decide where do we want the modifier/bones/... icons to be (in which column) and ideally make sure their icons match the ones we use for collections/objects. At the moment those are using the screen icon, which is not being used by collections. Reviewers: brecht, billrey Subscribers: pablovazquez Differential Revision: https://developer.blender.org/D4823
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-22Cleanup: style, use braces for blenkernelCampbell 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-14Cleanup: doxy commentsCampbell Barton
Use doxy references to function and enums, also correct some names which became out of sync.
2019-03-24Cleanup: redundant use of string formatting functionsCampbell Barton
2019-03-15Fix T62313 - No way to remove object from master collection in 3d viewDalai Felinto
This introduces a new iterator, FOREACH_COLLECTION, that unlike the FOREACH_SCENE_COLLECTION it iterates over all the Blender file collections, including the scene master collection, as well the database ones (bmain). Reviewers: brecht
2019-03-12BKE Collections: add helper to find the scene of a master collection.Bastien Montagne
2019-03-08Partially revert "Collection duplication from Outliner: add a 'duplicate ↵Bastien Montagne
hierarchy' operation." This partially reverts commit a77feabb51470b9cfb71be7f0ea7e774d6591799, removing the shallow 'duplicate hierarchy' option from outliner. Core changes from that commit in BKE_collections are kept.
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-06Collection duplication from Outliner: add a 'duplicate hierarchy' operation.Bastien Montagne
Point is, you may want to duplicate your set of collections, but not duplicate all their objects. Some notes: * Am rather skeptical about the practice of using operator name to define behavior of some common exec code. Imho, that should be a single operator with an enum to refine its behavior (@cambpellbarton may also have an opinion here?). Left it as-is for now, because this seems to be used by other operators too in that code. :/ * @dfelinto, @pablovazquez, @billreynish am not so happy with current names, but cannot find really good short ones either... Also, shouldn't we move those into a dedicated `Duplicate` sub-menu?
2019-03-06Cleanup: remove no-op BKE_collection_copy_full().Bastien Montagne
That one was an empty place-holder, BKE_collection_duplicate() is now doing that. And its call from full scene copying is not needed currently, 'deep copy' in that case is handled in editor's `ED_scene_add()`. Note that at some point, we might want to move that logic into BKE, but for now let's keep thing as they are - working.
2019-03-06Fix T62613: In duplicated collections objects loses patrenting.Bastien Montagne
We need to remap duplicated IDs' ID pointers to new ones if they exist.
2019-03-03Refactor duplicate code for collections.Bastien Montagne
* Fix incorrect handling of children collections being linked more than once in the hierarchy (previous code would make a new copy for each link, instead of just re-linking the first copy for each extra link). * Simplify some aspects of it (we do not need a GHash for new objects, we can use ID->newid pointer instead, and some iterations can be done directly on existing linked lists of old collection, instead of making temp local copies of them). * Move all copy logic into a single private recursive function (it was a bit odd/disturbing to see calling function being indirectly called again by the recursive helper one - not wrong, but that kind of code path can quickly become problematic in recursive patterns). * Added some comments about expected behavior of `BKE_collection_duplicate()` depending on its booleans options.
2019-03-01Outliner: Collection - Duplicate Hierarchy, and Duplicate Linked HierarchyDalai Felinto
As per the suggestion on T57064, this introduces two new options to duplicate collections. We then have: * Duplicate > Collection (New collection with linked content). * Duplicate > Hierachy (Duplicate entire hierarchy and make all contents single user). * Duplicate > Linked Hierarchy (Duplicate entire hierarchy keeping content linked with original). Development TODO: `single_object_users` can/should use the new functions. Reviewers: brecht, mont29 Subscribers: pablovazquez, billreynish, JulienKaspar Differential Revision: https://developer.blender.org/D4394
2019-02-26Cleanup: Spelling in commentSergey Sharybin
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-17DNA: rename dup_* struct members to instance_*Campbell Barton
2019-02-15Fix T61567: Object loose its rigid body data when moving to collectionDalai Felinto
At some I unified the "move to collection" with the remove from all collections functionality. That meant that even when we were still to keep the object in one of the collections we would clear its rigid body data. Now why to even remove the rigidbody data when removing an object from all collections? That mimics the 2.79 behaviour when we were to unlink an object from a scene. I suspect it has to do with the rigid body data being tied to the scene rigid body. Which is a strange design anyways (add to the list?) since an object can be in more than one scene.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-05Cleanup: typo in comment.Bastien Montagne
2019-02-05Cleanup: replace BKE_id_copy_ex by BKE_id_copy where possible.Bastien Montagne
That way it is obvious when we are using default ID copy behaviour, and when we are using advanced/specialized ones.
2019-02-05Cleanup: BKE_library: rename id_copy to BKE_id_copy.Bastien Montagne
Time to follow conventions for that one as well.
2019-02-05Cleanup: BKE_library: remove 'test' param of id_copy.Bastien Montagne
This was used in *one* place only... much better to have a dedicated helper for that kind of things. ;)
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-26Cleanup: remove redundant BKE/BLI/BIF headersCampbell Barton
2019-01-15Cleanup: rename BKE_libblock_delete to BKE_id_delete.Bastien Montagne