2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-11-14 17:05:25 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2008-11-14 17:05:25 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-11-14 17:05:25 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup spoutliner
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
|
2017-11-20 14:11:45 +11:00
|
|
|
#include "MEM_guardedalloc.h"
|
2008-11-14 17:05:25 +00:00
|
|
|
|
2017-02-22 16:02:43 +01:00
|
|
|
|
2018-08-29 15:32:50 +02:00
|
|
|
#include "DNA_collection_types.h"
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
|
2018-01-25 16:09:50 -02:00
|
|
|
#include "BLT_translation.h"
|
|
|
|
|
|
2009-07-16 04:45:52 +00:00
|
|
|
|
2018-01-25 16:09:50 -02:00
|
|
|
#include "GPU_immediate.h"
|
2018-06-27 19:07:23 -06:00
|
|
|
#include "GPU_state.h"
|
2018-01-25 16:09:50 -02:00
|
|
|
|
2009-07-16 04:45:52 +00:00
|
|
|
#include "RNA_access.h"
|
|
|
|
|
|
2017-02-22 16:02:43 +01:00
|
|
|
#include "UI_interface.h"
|
|
|
|
|
#include "UI_view2d.h"
|
|
|
|
|
|
2013-03-07 02:44:55 +00:00
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
2008-12-22 19:31:23 +00:00
|
|
|
|
2017-11-20 14:11:45 +11:00
|
|
|
#include "ED_screen.h"
|
2018-08-14 10:28:41 +10:00
|
|
|
#include "ED_select_utils.h"
|
2008-12-22 19:31:23 +00:00
|
|
|
|
2017-11-20 14:11:45 +11:00
|
|
|
#include "outliner_intern.h"
|
2008-12-22 19:31:23 +00:00
|
|
|
|
2012-04-26 05:17:54 +00:00
|
|
|
/* ************************** registration **********************************/
|
2008-12-22 19:31:23 +00:00
|
|
|
|
2008-11-14 17:05:25 +00:00
|
|
|
void outliner_operatortypes(void)
|
|
|
|
|
{
|
2016-10-15 00:40:33 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_highlight_update);
|
2009-07-25 13:40:59 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_item_activate);
|
2018-10-05 10:27:04 +10:00
|
|
|
WM_operatortype_append(OUTLINER_OT_select_box);
|
2009-07-25 13:40:59 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_item_openclose);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_item_rename);
|
2017-02-22 16:02:43 +01:00
|
|
|
WM_operatortype_append(OUTLINER_OT_item_drag_drop);
|
2009-07-25 13:40:59 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_operation);
|
2015-08-14 15:15:25 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_scene_operation);
|
2009-07-25 13:40:59 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_object_operation);
|
2015-12-01 15:33:44 +01:00
|
|
|
WM_operatortype_append(OUTLINER_OT_lib_operation);
|
2016-06-22 18:05:55 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_lib_relocate);
|
2009-07-25 13:40:59 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_id_operation);
|
2016-06-22 18:05:55 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_id_delete);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_id_remap);
|
2019-03-21 14:59:25 +01:00
|
|
|
WM_operatortype_append(OUTLINER_OT_id_copy);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_id_paste);
|
2009-07-25 13:40:59 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_data_operation);
|
2011-07-07 03:35:48 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_animdata_operation);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_action_set);
|
2015-02-12 07:25:36 +11:00
|
|
|
WM_operatortype_append(OUTLINER_OT_constraint_operation);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_modifier_operation);
|
2009-07-25 13:40:59 +00:00
|
|
|
|
2009-07-14 11:56:24 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_show_one_level);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_show_active);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_show_hierarchy);
|
2011-01-08 18:37:11 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_scroll_page);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-07-06 14:45:30 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_select_all);
|
2009-07-14 12:23:08 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_expanded_toggle);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-02-11 12:19:42 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_keyingset_add_selected);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_keyingset_remove_selected);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-10-21 05:59:51 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_drivers_add_selected);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_drivers_delete_selected);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2015-02-16 01:15:58 +13:00
|
|
|
WM_operatortype_append(OUTLINER_OT_orphans_purge);
|
2012-01-22 10:20:30 +00:00
|
|
|
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_parent_drop);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_parent_clear);
|
2012-05-29 08:20:11 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_scene_drop);
|
2012-06-10 22:22:26 +00:00
|
|
|
WM_operatortype_append(OUTLINER_OT_material_drop);
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_drop);
|
2017-02-15 17:50:49 +01:00
|
|
|
|
|
|
|
|
/* collections */
|
2017-02-16 10:54:09 +01:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_new);
|
2019-03-01 11:43:30 -03:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_duplicate_linked);
|
2019-03-06 15:09:16 +01:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_duplicate);
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_delete);
|
2018-02-01 15:53:54 -02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_objects_select);
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_objects_deselect);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_link);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_instance);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_exclude_set);
|
2018-07-25 12:26:09 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_exclude_clear);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_holdout_set);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_holdout_clear);
|
2018-07-25 12:26:09 +02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_indirect_only_set);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_indirect_only_clear);
|
2018-11-30 02:24:06 -02:00
|
|
|
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_isolate);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_disable);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_enable);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_hide);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_show);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_disable_render);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_enable_render);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_hide_inside);
|
|
|
|
|
WM_operatortype_append(OUTLINER_OT_collection_show_inside);
|
2019-02-08 19:38:45 -02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_hide);
|
2019-02-08 19:52:28 -02:00
|
|
|
WM_operatortype_append(OUTLINER_OT_unhide_all);
|
2008-11-14 17:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void outliner_keymap(wmKeyConfig *keyconf)
|
2008-11-14 17:05:25 +00:00
|
|
|
{
|
2018-11-08 15:59:51 +11:00
|
|
|
WM_keymap_ensure(keyconf, "Outliner", SPACE_OUTLINER, 0);
|
2008-11-14 17:05:25 +00:00
|
|
|
}
|