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
2018-03-30Collections: API to select all scene collection objectsDalai Felinto
2018-03-30Collections: API to get collection from indexDalai Felinto
2018-03-30Collections: API to check if object is in collectionDalai Felinto
2018-03-28Move to Collection - initial operatorDalai Felinto
How to use: Select a few objects, and press "M" in the viewport. If you hold ctrl the objects will be added to the selected collection. Otherwise they are removed from all their original collections and moved to the selected one instead. Development Notes ================= The ideal solution would be to implement an elegant generic multi-level menu system similar to toolbox_generic() in 2.49. Instead I used `uiItemMenuF` to acchieve the required nesting of the menus. The downside is that `uiItemMenuF` requires the data its callback uses to be always valid until the menu is discarded. But since there is no callback we can call when the menu is discarded for operators that exited with `OPERATOR_INTERFACE`. That means we are using static allocated data, that is only freed next time the operator is called. Which also means there will always be some memory leakage. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D3117
2018-03-09Cleanup: iterator macrosCampbell Barton
- put render iterator in own scope (would shadow it's own variable if used multiple times). - enforce semicolon at end of iterator macros. - no need to typedef one-off macro structs.
2018-03-01Cleanup: macro's w/ an _END need a matching _BEGINCampbell Barton
Convention from 2.7x, since some looping macros don't need an '_END', it avoids confusion to keep this.
2018-02-19Fix warning after fix for crash on renaming group collectionsDalai Felinto
Warning introduced on: 73079e01fd4.
2018-02-15Cleanup: style, warningCampbell Barton
2018-02-09Fix collection syncing when creating new collections from the outlinerDalai Felinto
We were not passing a scene collection parent to the BKE_collection_add function, which in turn made syncing not work. Right now we: * Explicitly pass the master collection in this case * Fallback to the master collection in other cases With unittest.
2018-02-02Collections: Operator to duplicate a collectionDalai Felinto
When duplicating a layer collection directly linked to the view layer we copy the collection and link it. For all the not directly linked layer collectionns, we try to sync the layer collection flags, overrides, ... Also we make sure the new collection is right after the original collection. We also expose this in RNA, via collection.duplicate().
2018-01-22Collections/Layer cleanup: Remove all reference to filter objectsDalai Felinto
This was not implemented yet. So it's a bit pointless to have all this placeholder code around without any functionality coming out of it.
2018-01-19Fix collections names no longer unique when moved aroundDalai Felinto
We were not checking for uniqueness after moving. And in some cases the new siblings of our collection may have conflicting names.
2018-01-19Collections: Fix for auto-named children when parent name is MAX_NAMEDalai Felinto
Reported via IRC by Vuk Gardašević (lijenstina).
2018-01-15Outliner/Collections: Fix objects disappearing when moving to collectionsDalai Felinto
Bug introduced on fb4cd136a7c (multi-object drag-and-drop). How to reproduce the bug: * Create a new collection * Move the Cube to the new collection * Move the Camera to the new collection (Cube disappears) * Move the Lamp to the new collection (Camera disappears) Explanation of the bug: The moved object was still selected, so we were trying to add the object to the collection were the object was already inserted (which would fail silently) and then remove it.
2018-01-04Fix FOREACH_SCENE_COLLECTION/FOREACH_SCENE_OBJECT for nested collectionsDalai Felinto
This fixes any function that relied on these iterators such as: * Outliner Same Type * Metaballs * scene.objects We were not considering the collections when there was collections nested to the collections nested to the master collection. It includes a unittest.
2018-01-02Layers/Collections: Fix crash when deleting collectionDalai Felinto
If the collection to be deleted has a nested collection that is directly linked to a view layer, we were getting a crash.
2017-12-28Cleanup after collection rename commitDalai Felinto
Related to c9cb5dc3dab0.
2017-12-28Collections: Allow collections from different "parents" to have the same nameDalai Felinto
This allows users to have "Support", "Rig", "Characters" collections nested to different collections without having to resort to "House.Rig", "House.Characters" or "Rig.001", "Characters.003" :/ This is part of T53495.
2017-12-23Collections: deletea collection move objects to master collection if users=0Dalai Felinto
The mental model is that a scene collection is a small wrap on top of the master collection, so all objects are in the master collection at all times. When we remove a collection there is no reason to remove an object. So if the object was not linked to any other collection, we add link it to the master one.
2017-12-22Collection: Name collection based on parent's nameDalai Felinto
So they are: House -> House 1 -> House 2 -> ... The exception is when the parent collection is the master collection. In this case we get: Master Collection -> Collection 1 -> Collection 2 -> ... This is part of "T53495: View layer and collection editing - Design Task"
2017-12-01Groups and collection: create group from collectionDalai Felinto
You could still create groups as before, with Ctl + G. This will create a group with a single visible collection. However you can also create a group from an existing collection. Just go to the menu you get in the outliner when clicking in a collection and pick "Create Group". Remember to instance the group afterwards, or link it into a new scene or file. The group and the collection are not kept in sync afterwards. You need to manually edit the group for further changes.
2017-12-01Groups and collection: initial integrationDalai Felinto
Since we are ditching layers from Blender (2.8) we need a replacement to control groups visibility. This commit introduces collections as the building blocks for groups, allowing users to control visibility as well as overrides for groups. Features ======== * Groups now have collections This way you can change the visibility of a collection inside a group, and add overrides which are part of the group and are prioritized over other overrides. * Outliner Groups can inspect their collections, change visibility, and add/remove members. To change an override of a group collection, you need to select an instance of the group, and then you can choose "group" in the collection properties editor to edit this group active collection instead of the view layer one. * Dupli groups overrides We can now have multiple instances of the same group with an original "override" and different overrides depending on the collection the instanced object is part of. Technical ========= * Layers We use the same api for groups and scene as much as possible. Reviewers: sergey (depsgraph), mont29 (read/write and user count) Differential Revision: https://developer.blender.org/D2892
2017-11-23Rename any instance of scene layer or render layer in code with view layerDalai Felinto
The RenderResult struct still has a listbase of RenderLayer, but that's ok since this is strictly for rendering. * Subversion bump (to 2.80.2) * DNA low level doversion (renames) - only for .blend created since 2.80 started Note: We can't use DNA_struct_elem_find or get file version in init_structDNA, so we are manually iterating over the array of the SDNA elements instead. Note 2: This doversion change with renames can be reverted in a few months. But so far it's required for 2.8 files created between October 2016 and now. Reviewers: campbellbarton, sergey Differential Revision: https://developer.blender.org/D2927
2017-11-07Sanitize use of BLI_iteratorDalai Felinto
We now initialize iter.valid as true as part of the main iterator (and manually when using via Python). And we don't even bother setting iter->current to NULL if it's invalid. Let's stick to using iter->valid only.
2017-07-28Fix crash when duplicating objectSergey Sharybin
This fixes null pointer check fiasco.
2017-07-27Prevent crash when duplicating object which doesn't have evaluated base ↵Sergey Sharybin
properties yet This mainly happens when copy on write is enabled.
2017-06-30Fix T51877: Deleting a scene uses freed memoryDalai Felinto
At the moment libblock_remap_data_preprocess is using FOREACH_SCENE_OBJECT to iterate over all the objects of the scene and unlink them. However we were storing a reference to the Base of the removed object. Anyways, the loop is now sanitized so that this crash no longer happens. Also now we have an unittest for this.
2017-06-27Scene object iterator: minor optimizationCampbell Barton
Avoid an extra hash when adding to gset
2017-06-14Add an option to free scene without doing id-countersSergey Sharybin
This is similar to some other datablocks. Mainly applies to collections, so freeing scene does not involve changing any non-directly owned data. There are two main usecases foreseen for the future: - Less CPU ticks on bmain free, where everything is freed anyway and there is no need to preserve id counters. - Easier freeing of temporary data, including data which is used by depsgraph's copy-on-write mechanism. Neither of those are currently implemented, but will be shortly.
2017-06-13Better Fix for T51777: Separating objects by selected verticesDalai Felinto
This reverts commit 47b9d0d040300fcd56db20a8a898166d47520bcc. And implement a fix that doesn't require Depsgraph refresh.
2017-06-06Scene object iterator: Replace recursion with loopSergey Sharybin
This way we are not afraid of recursion being too deep. That could have happened when having two collections which are sharing same list of 1000s of objects.
2017-05-18Rename Iterator struct to BLI_IteratorDalai Felinto
2017-04-24Collection: __FUNCTION__ > __func__Dalai Felinto
2017-04-24Layer cleanup: Rename _Iterator_ > _iterator_Dalai Felinto
2017-04-01Blender 2.8: Hook of layer collections evaluation in DEGSergey Sharybin
This moves selectability/visibility flag flush from some hardcoded places in the code to depsgraph. This way it is possible to simply tag depsgraph to update those flags and rest it'll do on its own. Using depsgraph for such flush is an overkill: those flags are fully static and can not be animated, so it doesn't really make sense to hook only those to depsgraph. However, in the future we will have overrides on collections, which ideally would need to be animatable and drivable and easiest way to support this is to do this on depsgraph level, so it ensures proper order of evaluation for animation and drivers. And it seems logical to do both overrides and flags flush from depsgraph from this point of view. This commit also includes the evaluation of IDProperty for collections, which basically are just another form of override. So once we implement the other kind of overrides the flushing and collection evaluation won't change. Patch by Sergey Sharybin and Dalai Felinto
2017-03-10Outliner: Support dragging objects into different collectionsJulian Eisel
Doing so will remove the object from the old collection and insert it into the new one.
2017-03-10Layers util function to move objects aroundDalai Felinto
This is required for outliner, so we can move an object from a collection into another
2017-03-09Layers: move SceneCollectionDalai Felinto
This is to be used from the Outliner, when dragging and dropping. It does not include moving LayerCollection (from Active Render Layer)
2017-03-06Fix T50841: Scene object iterator did not get data from LinkData for the ↵Sergey Sharybin
master collection Debug session with Dalai Felinto.
2017-03-02Outliner: add hooks for (yet to be implemented) layer reordering routinesDalai Felinto
2017-03-01Fix collection renaming not checking for unique name in entire hierarchyJulian Eisel
Only checked for unique name in direct children of the master collection. Also added missing listener for outliner.
2017-03-01Outliner: Make sure collection name is unique after renamingJulian Eisel
2017-02-23Fix issues when reordering nested collectionsJulian Eisel
Item was inserted at the head of the top-level collection list, instead of parent-level one.
2017-02-22Cleanup: StyleJulian Eisel
2017-02-22UI: Support drag & drop reordering of collectionsJulian Eisel
This adds initial support for reordering collections from the Outliner using drag & drop. Although drag & drop support is limited to collections for now, this lays most foundations for general drag & drop reordering support in the Outliner. There are some design questions to be answered though: * Would reordering of other data types (like objects) be a purely visual change or would it affect the order in which they are stored? (Would that make a difference for the user?) * Should/can we allow mixing of different data types? (e.g. mixing render layers with objects) * How could we realize this technically? Notes: * "Sort Alphabetically" has to be disabled to use this ("View" menu). * Reordering only works with collections on the same hierarchy level. * Added some visual feedback that should work quite well, it's by far not a final design though: {F493806} * Modified collection orders are stored in .blends. * Reordering can be undone. * Did minor cleanups here and there.
2017-02-14Layer Macros: create the instance as part of the macroDalai Felinto
Instead of pre-initializing an instance prior to the macro, we do it as part of the macro itself now.
2017-02-09Fix crashes on outliner (fixup for rB2a16a4ee)Dalai Felinto
FOREACH_SCENE_OBJECT was wrong (skipping an object), but rB2a16a4ee made it crash. Things should be better now.
2017-02-08Fix uninitialized var with FOREACH_SCENE_OBJECTCampbell Barton
2017-02-07Layers: get/update CollectionEngineSettings (depsgraph placeholder)Dalai Felinto
Every time: * A collection settings is set * A collection visibility changes * An object is added/removed/ ... We need to recalculate the "accumulated" CollectionEngineSettings that the render engine should use for an object. This is to be handled by the depsgraph. Meanwhile this code should allow us to start using those settings in the render engines. Note: We are storing this in the objects, which means we can only have one active calculated option every time. This is intended to get the conversation with the Depsgraph department going.
2017-02-07Render Layers and Collections (merge from render-layers)Dalai Felinto
Design Documents ---------------- * https://wiki.blender.org/index.php/Dev:2.8/Source/Layers * https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised User Commit Log --------------- * New Layer and Collection system to replace render layers and viewport layers. * A layer is a set of collections of objects (and their drawing options) required for specific tasks. * A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers. * All Scenes have a master collection that all other collections are children of. * New collection "context" tab (in Properties Editor) * New temporary viewport "collections" panel to control per-collection visibility Missing User Features --------------------- * Collection "Filter" Option to add objects based on their names * Collection Manager operators The existing buttons are placeholders * Collection Manager drawing The editor main region is empty * Collection Override * Per-Collection engine settings This will come as a separate commit, as part of the clay-engine branch Dev Commit Log -------------- * New DNA file (DNA_layer_types.h) with the new structs We are replacing Base by a new extended Base while keeping it backward compatible with some legacy settings (i.e., lay, flag_legacy). Renamed all Base to BaseLegacy to make it clear the areas of code that still need to be converted Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp * Unittesting for main syncronization requirements - read, write, add/copy/remove objects, copy scene, collection link/unlinking, context) * New Editor: Collection Manager Based on patch by Julian Eisel This is extracted from the layer-manager branch. With the following changes: - Renamed references of layer manager to collections manager - I doesn't include the editors/space_collections/ draw and util files - The drawing code itself will be implemented separately by Julian * Base / Object: A little note about them. Original Blender code would try to keep them in sync through the code, juggling flags back and forth. This will now be handled by Depsgraph, keeping Object and Bases more separated throughout the non-rendering code. Scene.base is being cleared in doversion, and the old viewport drawing code was poorly converted to use the new bases while the new viewport code doesn't get merged and replace the old one. Python API Changes ------------------ ``` - scene.layers + # no longer exists - scene.objects + scene.scene_layers.active.objects - scene.objects.active + scene.render_layers.active.objects.active - bpy.context.scene.objects.link() + bpy.context.scene_collection.objects.link() - bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None) + bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None) - bpy.context.object.select + bpy.context.object.select = True + bpy.context.object.select = False + bpy.context.object.select_get() + bpy.context.object.select_set(action='SELECT') + bpy.context.object.select_set(action='DESELECT') -AddObjectHelper.layers + # no longer exists ```