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/animation/anim_filter.c | |
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/animation/anim_filter.c')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 8dfc9cd8d1a..0895bd4f8a2 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -46,6 +46,7 @@ #include "DNA_armature_types.h" #include "DNA_camera_types.h" #include "DNA_cachefile_types.h" +#include "DNA_hair_types.h" #include "DNA_light_types.h" #include "DNA_lattice_types.h" #include "DNA_linestyle_types.h" @@ -58,11 +59,13 @@ #include "DNA_node_types.h" #include "DNA_object_force_types.h" #include "DNA_particle_types.h" +#include "DNA_pointcloud_types.h" #include "DNA_space_types.h" #include "DNA_sequence_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_speaker_types.h" +#include "DNA_volume_types.h" #include "DNA_world_types.h" #include "DNA_gpencil_types.h" #include "DNA_brush_types.h" @@ -787,6 +790,42 @@ static bAnimListElem *make_new_animlistelem(void *data, ale->adt = BKE_animdata_from_id(data); break; } + case ANIMTYPE_DSHAIR: { + Hair *hair = (Hair *)data; + AnimData *adt = hair->adt; + + ale->flag = FILTER_HAIR_OBJD(hair); + + ale->key_data = (adt) ? adt->action : NULL; + ale->datatype = ALE_ACT; + + ale->adt = BKE_animdata_from_id(data); + break; + } + case ANIMTYPE_DSPOINTCLOUD: { + PointCloud *pointcloud = (PointCloud *)data; + AnimData *adt = pointcloud->adt; + + ale->flag = FILTER_POINTS_OBJD(pointcloud); + + ale->key_data = (adt) ? adt->action : NULL; + ale->datatype = ALE_ACT; + + ale->adt = BKE_animdata_from_id(data); + break; + } + case ANIMTYPE_DSVOLUME: { + Volume *volume = (Volume *)data; + AnimData *adt = volume->adt; + + ale->flag = FILTER_VOLUME_OBJD(volume); + + ale->key_data = (adt) ? adt->action : NULL; + ale->datatype = ALE_ACT; + + ale->adt = BKE_animdata_from_id(data); + break; + } case ANIMTYPE_DSSKEY: { Key *key = (Key *)data; AnimData *adt = key->adt; @@ -2544,6 +2583,39 @@ static size_t animdata_filter_ds_obdata( expanded = FILTER_SPK_OBJD(spk); break; } + case OB_HAIR: /* ---------- Hair ----------- */ + { + Hair *hair = (Hair *)ob->data; + + if (ads->filterflag2 & ADS_FILTER_NOHAIR) + return 0; + + type = ANIMTYPE_DSHAIR; + expanded = FILTER_HAIR_OBJD(hair); + break; + } + case OB_POINTCLOUD: /* ---------- PointCloud ----------- */ + { + PointCloud *pointcloud = (PointCloud *)ob->data; + + if (ads->filterflag2 & ADS_FILTER_NOPOINTCLOUD) + return 0; + + type = ANIMTYPE_DSPOINTCLOUD; + expanded = FILTER_POINTS_OBJD(pointcloud); + break; + } + case OB_VOLUME: /* ---------- Volume ----------- */ + { + Volume *volume = (Volume *)ob->data; + + if (ads->filterflag2 & ADS_FILTER_NOVOLUME) + return 0; + + type = ANIMTYPE_DSVOLUME; + expanded = FILTER_VOLUME_OBJD(volume); + break; + } } /* add object data animation channels */ |