diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-12-28 19:30:58 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-12-28 19:30:58 +0300 |
commit | 6ecab6dd8e48d564a2b43e0e81e79d079e8b4c77 (patch) | |
tree | 618e2d24eb34a05a81f726dd52eb2b7468e9296d /source/blender/editors/animation | |
parent | 605263177b8eea24c1449e4dbf0138175ec3dddf (diff) |
Revert particle system and point cache removal in blender2.8 branch.
This reverts commit 5aa19be91263a249ffae75573e3b32f24269d890 and b4a721af694817fa921b119df83d33ede7d7fed0.
Due to postponement of particle system rewrite it was decided to put particle code
back into the 2.8 branch for the time being.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 3 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 5 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 72 |
3 files changed, 79 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index de6a17e9d41..f05932db1b2 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -43,6 +43,7 @@ #include "DNA_cachefile_types.h" #include "DNA_camera_types.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" @@ -314,7 +315,7 @@ static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale) offset += U.widget_unit; } /* materials and particles animdata */ - else if (GS(ale->id->name) == ID_MA) + else if (ELEM(GS(ale->id->name), ID_MA, ID_PA)) offset += (short)(0.7f * U.widget_unit); /* if not in Action Editor mode, action-groups (and their children) must carry some offset too... */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index ecaadd78dc2..117b8549712 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -124,6 +124,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datat case ANIMTYPE_DSCUR: case ANIMTYPE_DSSKEY: case ANIMTYPE_DSWOR: + case ANIMTYPE_DSPART: case ANIMTYPE_DSMBALL: case ANIMTYPE_DSARM: case ANIMTYPE_DSMESH: @@ -180,6 +181,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datat case ANIMTYPE_DSCUR: case ANIMTYPE_DSSKEY: case ANIMTYPE_DSWOR: + case ANIMTYPE_DSPART: case ANIMTYPE_DSMBALL: case ANIMTYPE_DSARM: case ANIMTYPE_DSMESH: @@ -281,6 +283,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, eAnimCont_Types d case ANIMTYPE_DSCUR: case ANIMTYPE_DSSKEY: case ANIMTYPE_DSWOR: + case ANIMTYPE_DSPART: case ANIMTYPE_DSMBALL: case ANIMTYPE_DSARM: case ANIMTYPE_DSMESH: @@ -377,6 +380,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, eAnimCont_Types d case ANIMTYPE_DSCUR: case ANIMTYPE_DSSKEY: case ANIMTYPE_DSWOR: + case ANIMTYPE_DSPART: case ANIMTYPE_DSMBALL: case ANIMTYPE_DSARM: case ANIMTYPE_DSMESH: @@ -2728,6 +2732,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, case ANIMTYPE_DSCUR: case ANIMTYPE_DSSKEY: case ANIMTYPE_DSWOR: + case ANIMTYPE_DSPART: case ANIMTYPE_DSMBALL: case ANIMTYPE_DSARM: case ANIMTYPE_DSMESH: diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 7bf146aa171..c12a050e9ba 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -64,6 +64,7 @@ #include "DNA_meta_types.h" #include "DNA_movieclip_types.h" #include "DNA_node_types.h" +#include "DNA_particle_types.h" #include "DNA_space_types.h" #include "DNA_sequence_types.h" #include "DNA_scene_types.h" @@ -801,6 +802,19 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne ale->adt = BKE_animdata_from_id(data); break; } + case ANIMTYPE_DSPART: + { + ParticleSettings *part = (ParticleSettings *)ale->data; + AnimData *adt = part->adt; + + ale->flag = FILTER_PART_OBJD(part); + + ale->key_data = (adt) ? adt->action : NULL; + ale->datatype = ALE_ACT; + + ale->adt = BKE_animdata_from_id(data); + break; + } case ANIMTYPE_DSTEX: { Tex *tex = (Tex *)data; @@ -2073,6 +2087,12 @@ static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data, mtex = (MTex **)(&wo->mtex); break; } + case ID_PA: + { + ParticleSettings *part = (ParticleSettings *)owner_id; + mtex = (MTex **)(&part->mtex); + break; + } default: { /* invalid/unsupported option */ @@ -2268,6 +2288,53 @@ static size_t animdata_filter_ds_modifiers(bAnimContext *ac, ListBase *anim_data /* ............ */ +static size_t animdata_filter_ds_particles(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode) +{ + ParticleSystem *psys; + size_t items = 0; + + for (psys = ob->particlesystem.first; psys; psys = psys->next) { + ListBase tmp_data = {NULL, NULL}; + size_t tmp_items = 0; + + /* if no material returned, skip - so that we don't get weird blank entries... */ + if (ELEM(NULL, psys->part, psys->part->adt)) + continue; + + /* add particle-system's animation data to temp collection */ + BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_PART_OBJD(psys->part)) + { + /* particle system's animation data */ + tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)psys->part, filter_mode); + + /* textures */ + if (!(ads->filterflag & ADS_FILTER_NOTEX)) + tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, (ID *)psys->part, filter_mode); + } + END_ANIMFILTER_SUBCHANNELS; + + /* did we find anything? */ + if (tmp_items) { + /* include particle-expand widget first */ + if (filter_mode & ANIMFILTER_LIST_CHANNELS) { + /* check if filtering by active status */ + if (ANIMCHANNEL_ACTIVEOK(psys->part)) { + ANIMCHANNEL_NEW_CHANNEL(psys->part, ANIMTYPE_DSPART, psys->part); + } + } + + /* now add the list of collected channels */ + BLI_movelisttolist(anim_data, &tmp_data); + BLI_assert(BLI_listbase_is_empty(&tmp_data)); + items += tmp_items; + } + } + + /* return the number of items added to the list */ + return items; +} + + static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode) { ListBase tmp_data = {NULL, NULL}; @@ -2543,6 +2610,11 @@ static size_t animdata_filter_dopesheet_ob(bAnimContext *ac, ListBase *anim_data tmp_items += animdata_filter_ds_obdata(ac, &tmp_data, ads, ob, filter_mode); } + /* particles */ + if ((ob->particlesystem.first) && !(ads->filterflag & ADS_FILTER_NOPART)) { + tmp_items += animdata_filter_ds_particles(ac, &tmp_data, ads, ob, filter_mode); + } + /* grease pencil */ if ((ob->gpd) && !(ads->filterflag & ADS_FILTER_NOGPENCIL)) { tmp_items += animdata_filter_ds_gpencil(ac, &tmp_data, ads, ob->gpd, filter_mode); |