diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-17 16:41:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-18 13:23:05 +0300 |
commit | b0a1cf2c9ae696b07f7a236bc855a5ab4a493dcb (patch) | |
tree | 92295af11db5e984da42bfac7ca60190b8549a3f /source/blender/editors/space_outliner | |
parent | 8dcfd392e4e62f193b666304425bc5ae635ecffe (diff) |
Objects: add Volume object type, and prototypes for Hair and PointCloud
Only the volume object is exposed in the user interface. It is based on OpenVDB
internally. Drawing and rendering code will follow in another commit.
https://wiki.blender.org/wiki/Source/Objects/Volume
https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Volumes
Hair and PointCloud object types are hidden behind a WITH_NEW_OBJECT_TYPES
build option. These are unfinished, and included only to make it easier to
cooperate on development in the future and avoid tricky merges.
https://wiki.blender.org/wiki/Source/Objects/New_Object_Types
Ref T73201, T68981
Differential Revision: https://developer.blender.org/D6945
Diffstat (limited to 'source/blender/editors/space_outliner')
4 files changed, 65 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 1b34f85f800..83ddbe63e9c 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2418,6 +2418,15 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) case OB_LIGHTPROBE: data.icon = ICON_OUTLINER_OB_LIGHTPROBE; break; + case OB_HAIR: + data.icon = ICON_OUTLINER_OB_HAIR; + break; + case OB_POINTCLOUD: + data.icon = ICON_OUTLINER_OB_POINTCLOUD; + break; + case OB_VOLUME: + data.icon = ICON_OUTLINER_OB_VOLUME; + break; case OB_EMPTY: if (ob->instance_collection && (ob->transflag & OB_DUPLICOLLECTION)) { data.icon = ICON_OUTLINER_OB_GROUP_INSTANCE; @@ -2515,6 +2524,15 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) case ID_GR: data.icon = ICON_GROUP; break; + case ID_HA: + data.icon = ICON_OUTLINER_DATA_HAIR; + break; + case ID_PT: + data.icon = ICON_OUTLINER_DATA_POINTCLOUD; + break; + case ID_VO: + data.icon = ICON_OUTLINER_DATA_VOLUME; + break; case ID_LI: if (tselem->id->tag & LIB_TAG_MISSING) { data.icon = ICON_LIBRARY_DATA_BROKEN; diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 1d39dc156b2..fb40ae195ef 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -105,7 +105,10 @@ typedef struct TreeElementIcon { ID_PA, \ ID_GD, \ ID_LS, \ - ID_LP) || /* Only in 'blendfile' mode ... :/ */ \ + ID_LP, \ + ID_HA, \ + ID_PT, \ + ID_VO) || /* Only in 'blendfile' mode ... :/ */ \ ELEM(GS((_id)->name), \ ID_SCR, \ ID_WM, \ diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index a99e1b63119..5bb0d626c2f 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -27,13 +27,16 @@ #include "DNA_armature_types.h" #include "DNA_collection_types.h" #include "DNA_gpencil_types.h" +#include "DNA_hair_types.h" #include "DNA_light_types.h" #include "DNA_linestyle_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meta_types.h" +#include "DNA_pointcloud_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" +#include "DNA_volume_types.h" #include "DNA_world_types.h" #include "DNA_object_types.h" #include "DNA_constraint_types.h" @@ -153,6 +156,9 @@ static void set_operation_types(SpaceOutliner *soops, case ID_CF: case ID_WS: case ID_LP: + case ID_HA: + case ID_PT: + case ID_VO: is_standard_id = true; break; case ID_WM: @@ -230,6 +236,21 @@ static void unlink_material_cb(bContext *UNUSED(C), totcol = mb->totcol; matar = mb->mat; } + else if (GS(tsep->id->name) == ID_HA) { + Hair *hair = (Hair *)tsep->id; + totcol = hair->totcol; + matar = hair->mat; + } + else if (GS(tsep->id->name) == ID_PT) { + PointCloud *pointcloud = (PointCloud *)tsep->id; + totcol = pointcloud->totcol; + matar = pointcloud->mat; + } + else if (GS(tsep->id->name) == ID_VO) { + Volume *volume = (Volume *)tsep->id; + totcol = volume->totcol; + matar = volume->mat; + } else { BLI_assert(0); } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index b8cbb6bb0e3..b942021ca33 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -33,6 +33,7 @@ #include "DNA_cachefile_types.h" #include "DNA_collection_types.h" #include "DNA_gpencil_types.h" +#include "DNA_hair_types.h" #include "DNA_key_types.h" #include "DNA_light_types.h" #include "DNA_material_types.h" @@ -40,7 +41,9 @@ #include "DNA_meta_types.h" #include "DNA_lightprobe_types.h" #include "DNA_particle_types.h" +#include "DNA_pointcloud_types.h" #include "DNA_scene_types.h" +#include "DNA_volume_types.h" #include "DNA_world_types.h" #include "DNA_sequence_types.h" #include "DNA_speaker_types.h" @@ -750,6 +753,25 @@ static void outliner_add_id_contents(SpaceOutliner *soops, Collection *collection = (Collection *)id; outliner_add_collection_recursive(soops, collection, te); } + break; + } + case ID_HA: { + Hair *hair = (Hair *)id; + if (outliner_animdata_test(hair->adt)) + outliner_add_element(soops, &te->subtree, hair, te, TSE_ANIM_DATA, 0); + break; + } + case ID_PT: { + PointCloud *pointcloud = (PointCloud *)id; + if (outliner_animdata_test(pointcloud->adt)) + outliner_add_element(soops, &te->subtree, pointcloud, te, TSE_ANIM_DATA, 0); + break; + } + case ID_VO: { + Volume *volume = (Volume *)id; + if (outliner_animdata_test(volume->adt)) + outliner_add_element(soops, &te->subtree, volume, te, TSE_ANIM_DATA, 0); + break; } default: break; |