1302
1432
/* firstly check that we actuallly have some textures, by gathering all textures in a temp list */
1303
1433
for (a=0; a < MAX_MTEX; a++) {
1304
1434
Tex *tex= (mtex[a]) ? mtex[a]->tex : NULL;
1435
ListBase tmp_data = {NULL, NULL};
1436
size_t tmp_items = 0;
1307
1438
/* for now, if no texture returned, skip (this shouldn't confuse the user I hope) */
1308
if (ELEM(NULL, tex, tex->adt))
1312
ANIMDATA_FILTER_CASES(tex,
1313
{ /* AnimData blocks - do nothing... */ },
1317
if (ok == 0) continue;
1319
/* make a temp list elem for this */
1320
ld= MEM_callocN(sizeof(LinkData), "DopeSheet-TextureCache");
1322
BLI_addtail(&texs, ld);
1325
/* if there were no channels found, no need to carry on */
1326
if (texs.first == NULL)
1329
/* include textures-expand widget? */
1330
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1331
ale= make_new_animlistelem(owner_id, ANIMTYPE_FILLTEXD, owner_id, ownertype, owner_id);
1333
BLI_addtail(anim_data, ale);
1442
/* add texture's animation data to temp collection */
1443
BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_TEX_DATA(tex))
1445
/* texture animdata */
1446
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)tex, filter_mode);
1449
if ((tex->nodetree) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
1450
/* owner_id as id instead of texture, since it'll otherwise be impossible to track the depth */
1451
// FIXME: perhaps as a result, textures should NOT be included under materials, but under their own section instead
1452
// so that free-floating textures can also be animated
1453
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)tex, tex->nodetree, filter_mode);
1339
if ((expanded) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1340
/* for each texture in cache, add channels */
1341
for (ld= texs.first; ld; ld= ld->next) {
1342
Tex *tex= (Tex *)ld->data;
1456
END_ANIMFILTER_SUBCHANNELS;
1458
/* did we find anything? */
1344
1460
/* include texture-expand widget? */
1345
if (filter_mode & ANIMFILTER_CHANNELS) {
1346
/* check if filtering by active status */
1347
if ANIMCHANNEL_ACTIVEOK(tex) {
1348
ale= make_new_animlistelem(tex, ANIMTYPE_DSTEX, owner_id, ownertype, owner_id);
1350
BLI_addtail(anim_data, ale);
1356
/* add texture's animation data
1357
* NOTE: for these, we make the owner/ownertype the material/lamp/etc. not the texture, otherwise the
1358
* drawing code cannot resolve the indention easily
1360
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_TEX_DATA(tex) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1361
ANIMDATA_FILTER_CASES(tex,
1362
{ /* AnimData blocks - do nothing... */ },
1363
items += animdata_filter_nla(ac, anim_data, ads, tex->adt, filter_mode, owner_id, ownertype, (ID *)tex);,
1364
items += animdata_filter_fcurves(anim_data, ads, tex->adt->drivers.first, NULL, owner_id, ownertype, filter_mode, (ID *)tex);,
1365
items += animdata_filter_action(ac, anim_data, ads, tex->adt->action, filter_mode, owner_id, ownertype, (ID *)tex);)
1371
BLI_freelistN(&texs);
1373
/* return the number of items added to the list */
1377
static int animdata_filter_dopesheet_mats (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
1379
ListBase mats = {NULL, NULL};
1382
bAnimListElem *ale=NULL;
1383
Object *ob= base->object;
1386
/* firstly check that we actuallly have some materials, by gathering all materials in a temp list */
1387
for (a=1; a <= ob->totcol; a++) {
1388
Material *ma= give_current_material(ob, a);
1391
/* for now, if no material returned, skip (this shouldn't confuse the user I hope) */
1392
if (ELEM(NULL, ma, ma->adt))
1396
ANIMDATA_FILTER_CASES(ma,
1397
{ /* AnimData blocks - do nothing... */ },
1401
if (ok == 0) continue;
1403
/* make a temp list elem for this */
1404
ld= MEM_callocN(sizeof(LinkData), "DopeSheet-MaterialCache");
1406
BLI_addtail(&mats, ld);
1409
/* if there were no channels found, no need to carry on */
1410
// XXX: textures with no animated owner material won't work because of this...
1411
if (mats.first == NULL)
1414
/* include materials-expand widget? */
1415
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1416
ale= make_new_animlistelem(ob, ANIMTYPE_FILLMATD, base, ANIMTYPE_OBJECT, (ID *)ob);
1418
BLI_addtail(anim_data, ale);
1423
/* add materials? */
1424
if (FILTER_MAT_OBJC(ob) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1425
/* for each material in cache, add channels */
1426
for (ld= mats.first; ld; ld= ld->next) {
1427
Material *ma= (Material *)ld->data;
1429
/* include material-expand widget? */
1430
// hmm... do we need to store the index of this material in the array anywhere?
1431
if (filter_mode & ANIMFILTER_CHANNELS) {
1432
/* check if filtering by active status */
1433
if ANIMCHANNEL_ACTIVEOK(ma) {
1434
ale= make_new_animlistelem(ma, ANIMTYPE_DSMAT, base, ANIMTYPE_OBJECT, (ID *)ma);
1436
BLI_addtail(anim_data, ale);
1442
/* add material's animation data */
1443
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1444
/* material's animation data */
1445
ANIMDATA_FILTER_CASES(ma,
1446
{ /* AnimData blocks - do nothing... */ },
1447
items += animdata_filter_nla(ac, anim_data, ads, ma->adt, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);,
1448
items += animdata_filter_fcurves(anim_data, ads, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);,
1449
items += animdata_filter_action(ac, anim_data, ads, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);)
1452
if (!(ads->filterflag & ADS_FILTER_NOTEX))
1453
items += animdata_filter_dopesheet_texs(ac, anim_data, ads, (ID *)ma, filter_mode);
1459
BLI_freelistN(&mats);
1461
/* return the number of items added to the list */
1465
static int animdata_filter_dopesheet_particles (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
1467
bAnimListElem *ale=NULL;
1468
Object *ob= base->object;
1469
ParticleSystem *psys = ob->particlesystem.first;
1470
int items= 0, first = 1;
1472
for(; psys; psys=psys->next) {
1475
if(ELEM(NULL, psys->part, psys->part->adt))
1478
ANIMDATA_FILTER_CASES(psys->part,
1479
{ /* AnimData blocks - do nothing... */ },
1483
if (ok == 0) continue;
1485
/* include particles-expand widget? */
1486
if (first && (filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1487
ale= make_new_animlistelem(ob, ANIMTYPE_FILLPARTD, base, ANIMTYPE_OBJECT, (ID *)ob);
1489
BLI_addtail(anim_data, ale);
1495
/* add particle settings? */
1496
if (FILTER_PART_OBJC(ob) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1497
if ((filter_mode & ANIMFILTER_CHANNELS)) {
1498
/* check if filtering by active status */
1499
if ANIMCHANNEL_ACTIVEOK(psys->part) {
1500
ale = make_new_animlistelem(psys->part, ANIMTYPE_DSPART, base, ANIMTYPE_OBJECT, (ID *)psys->part);
1502
BLI_addtail(anim_data, ale);
1508
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_PART_OBJD(psys->part) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1509
ANIMDATA_FILTER_CASES(psys->part,
1510
{ /* AnimData blocks - do nothing... */ },
1511
items += animdata_filter_nla(ac, anim_data, ads, psys->part->adt, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);,
1512
items += animdata_filter_fcurves(anim_data, ads, psys->part->adt->drivers.first, NULL, psys->part, ANIMTYPE_DSPART, filter_mode, (ID *)psys->part);,
1513
items += animdata_filter_action(ac, anim_data, ads, psys->part->adt->action, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);)
1518
/* return the number of items added to the list */
1522
static int animdata_filter_dopesheet_obdata (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
1524
bAnimListElem *ale=NULL;
1525
Object *ob= base->object;
1461
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1462
/* check if filtering by active status */
1463
if (ANIMCHANNEL_ACTIVEOK(tex)) {
1464
ANIMCHANNEL_NEW_CHANNEL(tex, ANIMTYPE_DSTEX, owner_id);
1468
/* now add the list of collected channels */
1469
BLI_movelisttolist(anim_data, &tmp_data);
1470
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1475
/* return the number of items added to the list */
1480
static size_t animdata_filter_ds_material (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Material *ma, int filter_mode)
1482
ListBase tmp_data = {NULL, NULL};
1483
size_t tmp_items = 0;
1486
/* add material's animation data to temp collection */
1487
BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_MAT_OBJD(ma))
1489
/* material's animation data */
1490
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)ma, filter_mode);
1493
if (!(ads->filterflag & ADS_FILTER_NOTEX))
1494
tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, (ID *)ma, filter_mode);
1497
if ((ma->nodetree) && !(ads->filterflag & ADS_FILTER_NONTREE))
1498
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)ma, ma->nodetree, filter_mode);
1500
END_ANIMFILTER_SUBCHANNELS;
1502
/* did we find anything? */
1504
/* include material-expand widget first */
1505
// hmm... do we need to store the index of this material in the array anywhere?
1506
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1507
/* check if filtering by active status */
1508
if (ANIMCHANNEL_ACTIVEOK(ma)) {
1509
ANIMCHANNEL_NEW_CHANNEL(ma, ANIMTYPE_DSMAT, ma);
1513
/* now add the list of collected channels */
1514
BLI_movelisttolist(anim_data, &tmp_data);
1515
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1522
static size_t animdata_filter_ds_materials (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
1524
short has_nested = 0;
1528
/* first pass: take the materials referenced via the Material slots of the object */
1529
for (a = 1; a <= ob->totcol; a++) {
1530
Material *ma = give_current_material(ob, a);
1532
/* if material is valid, try to add relevant contents from here */
1535
items += animdata_filter_ds_material(ac, anim_data, ads, ma, filter_mode);
1537
/* for optimising second pass - check if there's a nested material here to come back for */
1538
if (has_nested == 0)
1539
has_nested = give_node_material(ma) != NULL;
1543
/* second pass: go through a second time looking for "nested" materials (material.material references)
1545
* NOTE: here we ignore the expanded status of the parent, as it could be too confusing as to why these are
1546
* disappearing/not available, since the relationships between these is not that clear
1549
for (a = 1; a <= ob->totcol; a++) {
1550
Material *base = give_current_material(ob, a);
1551
Material *ma = give_node_material(base);
1553
/* add channels from the nested material if it exists */
1555
items += animdata_filter_ds_material(ac, anim_data, ads, ma, filter_mode);
1559
/* return the number of items added to the list */
1563
static size_t animdata_filter_ds_particles (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
1565
ParticleSystem *psys;
1568
for (psys = ob->particlesystem.first; psys; psys=psys->next) {
1569
ListBase tmp_data = {NULL, NULL};
1570
size_t tmp_items = 0;
1572
/* if no material returned, skip - so that we don't get weird blank entries... */
1573
if (ELEM(NULL, psys->part, psys->part->adt))
1576
/* add particle-system's animation data to temp collection */
1577
BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_PART_OBJD(psys->part))
1579
/* material's animation data */
1580
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)psys->part, filter_mode);
1582
END_ANIMFILTER_SUBCHANNELS;
1584
/* did we find anything? */
1586
/* include particle-expand widget first */
1587
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1588
/* check if filtering by active status */
1589
if (ANIMCHANNEL_ACTIVEOK(psys->part)) {
1590
ANIMCHANNEL_NEW_CHANNEL(psys->part, ANIMTYPE_DSPART, psys->part);
1594
/* now add the list of collected channels */
1595
BLI_movelisttolist(anim_data, &tmp_data);
1596
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1601
/* return the number of items added to the list */
1605
static size_t animdata_filter_ds_obdata (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
1607
ListBase tmp_data = {NULL, NULL};
1608
size_t tmp_items = 0;
1526
1611
IdAdtTemplate *iat= ob->data;
1527
AnimData *adt= iat->adt;
1528
1612
short type=0, expanded=0;
1531
1614
/* get settings based on data type */
1532
1615
switch (ob->type) {
1577
1675
Mesh *me= (Mesh *)ob->data;
1677
if (ads->filterflag & ADS_FILTER_NOMESH)
1579
1680
type= ANIMTYPE_DSMESH;
1580
1681
expanded= FILTER_MESH_OBJD(me);
1585
/* special exception for drivers instead of action */
1586
if (ads->filterflag & ADS_FILTER_ONLYDRIVERS)
1587
expanded= EXPANDED_DRVD(adt);
1589
/* include data-expand widget? */
1590
if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) {
1591
/* check if filtering by active status */
1592
if ANIMCHANNEL_ACTIVEOK(iat) {
1593
ale= make_new_animlistelem(iat, type, base, ANIMTYPE_OBJECT, (ID *)iat);
1594
if (ale) BLI_addtail(anim_data, ale);
1598
/* add object-data animation channels? */
1599
if (!(filter_mode & ANIMFILTER_VISIBLE) || (expanded) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1600
/* filtering for channels - nla, drivers, keyframes */
1601
ANIMDATA_FILTER_CASES(iat,
1602
{ /* AnimData blocks - do nothing... */ },
1603
items+= animdata_filter_nla(ac, anim_data, ads, iat->adt, filter_mode, iat, type, (ID *)iat);,
1604
items+= animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat);,
1605
items+= animdata_filter_action(ac, anim_data, ads, iat->adt->action, filter_mode, iat, type, (ID *)iat);)
1684
case OB_LATTICE: /* ---- Lattice ---- */
1686
Lattice *lt = (Lattice *)ob->data;
1688
if (ads->filterflag & ADS_FILTER_NOLAT)
1691
type= ANIMTYPE_DSLAT;
1692
expanded= FILTER_LATTICE_OBJD(lt);
1695
case OB_SPEAKER: /* ---------- Speaker ----------- */
1697
Speaker *spk= (Speaker *)ob->data;
1699
type= ANIMTYPE_DSSPK;
1700
expanded= FILTER_SPK_OBJD(spk);
1705
/* add object data animation channels */
1706
BEGIN_ANIMFILTER_SUBCHANNELS(expanded)
1708
/* animation data filtering */
1709
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)iat, filter_mode);
1607
1711
/* sub-data filtering... */
1608
1712
switch (ob->type) {
1609
1713
case OB_LAMP: /* lamp - textures */
1612
1716
if (!(ads->filterflag & ADS_FILTER_NOTEX))
1613
items += animdata_filter_dopesheet_texs(ac, anim_data, ads, ob->data, filter_mode);
1717
tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, ob->data, filter_mode);
1619
/* return the number of items added to the list */
1623
static int animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
1625
bAnimListElem *ale=NULL;
1626
AnimData *adt = NULL;
1722
END_ANIMFILTER_SUBCHANNELS;
1724
/* did we find anything? */
1726
/* include data-expand widget first */
1727
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1728
/* check if filtering by active status */
1729
if (ANIMCHANNEL_ACTIVEOK(iat)) {
1730
ANIMCHANNEL_NEW_CHANNEL(iat, type, iat);
1734
/* now add the list of collected channels */
1735
BLI_movelisttolist(anim_data, &tmp_data);
1736
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1740
/* return the number of items added to the list */
1744
/* shapekey-level animation */
1745
static size_t animdata_filter_ds_keyanim (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, Key *key, int filter_mode)
1747
ListBase tmp_data = {NULL, NULL};
1748
size_t tmp_items = 0;
1751
/* add shapekey-level animation channels */
1752
BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_SKE_OBJD(key))
1754
/* animation data filtering */
1755
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)key, filter_mode);
1757
END_ANIMFILTER_SUBCHANNELS;
1759
/* did we find anything? */
1761
/* include key-expand widget first */
1762
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1763
if (ANIMCHANNEL_ACTIVEOK(key)) {
1764
ANIMCHANNEL_NEW_CHANNEL(key, ANIMTYPE_DSSKEY, ob);
1768
/* now add the list of collected channels */
1769
BLI_movelisttolist(anim_data, &tmp_data);
1770
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1774
/* return the number of items added to the list */
1778
/* object-level animation */
1779
static size_t animdata_filter_ds_obanim (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
1781
ListBase tmp_data = {NULL, NULL};
1782
size_t tmp_items = 0;
1785
AnimData *adt = ob->adt;
1786
short type=0, expanded=1;
1789
/* determine the type of expander channels to use */
1790
// this is the best way to do this for now...
1791
ANIMDATA_FILTER_CASES(ob,
1792
{/* AnimData - no channel, but consider data */},
1793
{/* NLA - no channel, but consider data */},
1795
type = ANIMTYPE_FILLDRIVERS;
1797
expanded = EXPANDED_DRVD(adt);
1800
type = ANIMTYPE_FILLACTD;
1801
cdata = adt->action;
1802
expanded = EXPANDED_ACTC(adt->action);
1805
/* add object-level animation channels */
1806
BEGIN_ANIMFILTER_SUBCHANNELS(expanded)
1808
/* animation data filtering */
1809
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)ob, filter_mode);
1811
END_ANIMFILTER_SUBCHANNELS;
1813
/* did we find anything? */
1815
/* include anim-expand widget first */
1816
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1817
if (type != ANIMTYPE_NONE) {
1818
/* NOTE: active-status (and the associated checks) don't apply here... */
1819
ANIMCHANNEL_NEW_CHANNEL(cdata, type, ob);
1823
/* now add the list of collected channels */
1824
BLI_movelisttolist(anim_data, &tmp_data);
1825
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1829
/* return the number of items added to the list */
1833
/* get animation channels from object2 */
1834
static size_t animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
1836
ListBase tmp_data = {NULL, NULL};
1627
1837
Object *ob= base->object;
1628
Key *key= ob_get_key(ob);
1629
short obdata_ok = 0;
1632
/* add this object as a channel first */
1633
if ((filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) == 0) {
1634
/* check if filtering by selection */
1635
if ANIMCHANNEL_SELOK((base->flag & SELECT)) {
1838
size_t tmp_items = 0;
1841
/* filter data contained under object first */
1842
BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_OBJC(ob))
1844
Key *key= ob_get_key(ob);
1846
/* object-level animation */
1847
if ((ob->adt) && !(ads->filterflag & ADS_FILTER_NOOBJ)) {
1848
tmp_items += animdata_filter_ds_obanim(ac, &tmp_data, ads, ob, filter_mode);
1852
if ((key && key->adt) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)) {
1853
tmp_items += animdata_filter_ds_keyanim(ac, &tmp_data, ads, ob, key, filter_mode);
1857
if ((ob->totcol) && !(ads->filterflag & ADS_FILTER_NOMAT)) {
1858
tmp_items += animdata_filter_ds_materials(ac, &tmp_data, ads, ob, filter_mode);
1863
tmp_items += animdata_filter_ds_obdata(ac, &tmp_data, ads, ob, filter_mode);
1867
if ((ob->particlesystem.first) && !(ads->filterflag & ADS_FILTER_NOPART)) {
1868
tmp_items += animdata_filter_ds_particles(ac, &tmp_data, ads, ob, filter_mode);
1871
END_ANIMFILTER_SUBCHANNELS;
1874
/* if we collected some channels, add these to the new list... */
1876
/* firstly add object expander if required */
1877
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1878
/* check if filtering by selection */
1879
// XXX: double-check on this - most of the time, a lot of tools need to filter out these channels!
1880
if (ANIMCHANNEL_SELOK((base->flag & SELECT))) {
1881
/* check if filtering by active status */
1882
if (ANIMCHANNEL_ACTIVEOK(ob)) {
1883
ANIMCHANNEL_NEW_CHANNEL(base, ANIMTYPE_OBJECT, ob);
1888
/* now add the list of collected channels */
1889
BLI_movelisttolist(anim_data, &tmp_data);
1890
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1894
/* return the number of items added */
1898
static size_t animdata_filter_ds_world (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, World *wo, int filter_mode)
1900
ListBase tmp_data = {NULL, NULL};
1901
size_t tmp_items = 0;
1904
/* add world animation channels */
1905
BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_WOR_SCED(wo))
1907
/* animation data filtering */
1908
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)wo, filter_mode);
1910
/* textures for world */
1911
if (!(ads->filterflag & ADS_FILTER_NOTEX))
1912
items += animdata_filter_ds_textures(ac, &tmp_data, ads, (ID *)wo, filter_mode);
1915
if ((wo->nodetree) && !(ads->filterflag & ADS_FILTER_NONTREE))
1916
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)wo, wo->nodetree, filter_mode);
1918
END_ANIMFILTER_SUBCHANNELS;
1920
/* did we find anything? */
1922
/* include data-expand widget first */
1923
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1636
1924
/* check if filtering by active status */
1637
if ANIMCHANNEL_ACTIVEOK(ob) {
1638
ale= make_new_animlistelem(base, ANIMTYPE_OBJECT, NULL, ANIMTYPE_NONE, (ID *)ob);
1640
BLI_addtail(anim_data, ale);
1647
/* if collapsed, don't go any further (unless adding keyframes only) */
1648
if ( ((filter_mode & ANIMFILTER_VISIBLE) && EXPANDED_OBJC(ob) == 0) &&
1649
!(filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) )
1652
/* Action, Drivers, or NLA */
1653
if (ob->adt && !(ads->filterflag & ADS_FILTER_NOOBJ)) {
1655
ANIMDATA_FILTER_CASES(ob,
1656
{ /* AnimData blocks - do nothing... */ },
1658
/* add NLA tracks */
1659
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
1662
/* include drivers-expand widget? */
1663
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1664
ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLDRIVERS, base, ANIMTYPE_OBJECT, (ID *)ob);
1666
BLI_addtail(anim_data, ale);
1671
/* add F-Curve channels (drivers are F-Curves) */
1672
if (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) {
1673
// need to make the ownertype normal object here... (maybe type should be a separate one for clarity?)
1674
items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, ob, ANIMTYPE_OBJECT, filter_mode, (ID *)ob);
1677
{ /* action (keyframes) */
1678
/* include action-expand widget? */
1679
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1680
ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLACTD, base, ANIMTYPE_OBJECT, (ID *)ob);
1682
BLI_addtail(anim_data, ale);
1687
/* add F-Curve channels? */
1688
if (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) {
1689
// need to make the ownertype normal object here... (maybe type should be a separate one for clarity?)
1690
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
1698
if ((key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)) {
1700
ANIMDATA_FILTER_CASES(key,
1701
{ /* AnimData blocks - do nothing... */ },
1703
/* include shapekey-expand widget? */
1704
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1705
/* check if filtering by active status */
1706
if ANIMCHANNEL_ACTIVEOK(key) {
1707
ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob);
1709
BLI_addtail(anim_data, ale);
1715
/* add NLA tracks - only if expanded or so */
1716
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY))
1717
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)key);
1720
/* include shapekey-expand widget? */
1721
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1722
ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob);
1724
BLI_addtail(anim_data, ale);
1730
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1731
items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, key, ANIMTYPE_DSSKEY, filter_mode, (ID *)key);
1734
{ /* action (keyframes) */
1735
/* include shapekey-expand widget? */
1736
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1737
/* check if filtering by active status */
1738
if ANIMCHANNEL_ACTIVEOK(key) {
1739
ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob);
1741
BLI_addtail(anim_data, ale);
1748
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1749
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, key, ANIMTYPE_DSSKEY, (ID *)key);
1756
if ((ob->totcol) && !(ads->filterflag & ADS_FILTER_NOMAT))
1757
items += animdata_filter_dopesheet_mats(ac, anim_data, ads, base, filter_mode);
1761
case OB_CAMERA: /* ------- Camera ------------ */
1763
Camera *ca= (Camera *)ob->data;
1765
if ((ads->filterflag & ADS_FILTER_NOCAM) == 0) {
1766
ANIMDATA_FILTER_CASES(ca,
1767
{ /* AnimData blocks - do nothing... */ },
1774
case OB_LAMP: /* ---------- Lamp ----------- */
1776
Lamp *la= (Lamp *)ob->data;
1778
if ((ads->filterflag & ADS_FILTER_NOLAM) == 0) {
1779
ANIMDATA_FILTER_CASES(la,
1780
{ /* AnimData blocks - do nothing... */ },
1787
case OB_CURVE: /* ------- Curve ---------- */
1788
case OB_SURF: /* ------- Nurbs Surface ---------- */
1789
case OB_FONT: /* ------- Text Curve ---------- */
1791
Curve *cu= (Curve *)ob->data;
1793
if ((ads->filterflag & ADS_FILTER_NOCUR) == 0) {
1794
ANIMDATA_FILTER_CASES(cu,
1795
{ /* AnimData blocks - do nothing... */ },
1802
case OB_MBALL: /* ------- MetaBall ---------- */
1804
MetaBall *mb= (MetaBall *)ob->data;
1806
if ((ads->filterflag & ADS_FILTER_NOMBA) == 0) {
1807
ANIMDATA_FILTER_CASES(mb,
1808
{ /* AnimData blocks - do nothing... */ },
1815
case OB_ARMATURE: /* ------- Armature ---------- */
1817
bArmature *arm= (bArmature *)ob->data;
1819
if ((ads->filterflag & ADS_FILTER_NOARM) == 0) {
1820
ANIMDATA_FILTER_CASES(arm,
1821
{ /* AnimData blocks - do nothing... */ },
1828
case OB_MESH: /* ------- Mesh ---------- */
1830
Mesh *me= (Mesh *)ob->data;
1832
if ((ads->filterflag & ADS_FILTER_NOMESH) == 0) {
1833
ANIMDATA_FILTER_CASES(me,
1834
{ /* AnimData blocks - do nothing... */ },
1843
items += animdata_filter_dopesheet_obdata(ac, anim_data, ads, base, filter_mode);
1846
if (ob->particlesystem.first && !(ads->filterflag & ADS_FILTER_NOPART))
1847
items += animdata_filter_dopesheet_particles(ac, anim_data, ads, base, filter_mode);
1849
/* return the number of items added to the list */
1853
static int animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
1855
World *wo= sce->world;
1856
bNodeTree *ntree= sce->nodetree;
1857
AnimData *adt= NULL;
1861
/* add scene as a channel first (even if we aren't showing scenes we still need to show the scene's sub-data */
1862
if ((filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) == 0) {
1863
/* check if filtering by selection */
1864
if (ANIMCHANNEL_SELOK( (sce->flag & SCE_DS_SELECTED) )) {
1865
ale= make_new_animlistelem(sce, ANIMTYPE_SCENE, NULL, ANIMTYPE_NONE, NULL);
1867
BLI_addtail(anim_data, ale);
1873
/* if collapsed, don't go any further (unless adding keyframes only) */
1874
if ( (EXPANDED_SCEC(sce) == 0) && !(filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) )
1877
/* Action, Drivers, or NLA for Scene */
1878
if ((ads->filterflag & ADS_FILTER_NOSCE) == 0) {
1880
ANIMDATA_FILTER_CASES(sce,
1881
{ /* AnimData blocks - do nothing... */ },
1883
/* add NLA tracks */
1884
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce);
1887
/* include drivers-expand widget? */
1888
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1889
ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLDRIVERS, sce, ANIMTYPE_SCENE, (ID *)sce);
1891
BLI_addtail(anim_data, ale);
1896
/* add F-Curve channels (drivers are F-Curves) */
1897
if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) {
1898
items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, sce, ANIMTYPE_SCENE, filter_mode, (ID *)sce);
1902
/* include action-expand widget? */
1903
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1904
ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLACTD, sce, ANIMTYPE_SCENE, (ID *)sce);
1906
BLI_addtail(anim_data, ale);
1911
/* add F-Curve channels? */
1912
if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) {
1913
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce);
1920
if ((wo && wo->adt) && !(ads->filterflag & ADS_FILTER_NOWOR)) {
1921
/* Action, Drivers, or NLA for World */
1923
ANIMDATA_FILTER_CASES(wo,
1924
{ /* AnimData blocks - do nothing... */ },
1926
/* add NLA tracks */
1927
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo);
1930
/* include world-expand widget? */
1931
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1932
ale= make_new_animlistelem(wo, ANIMTYPE_DSWOR, sce, ANIMTYPE_SCENE, (ID *)wo);
1934
BLI_addtail(anim_data, ale);
1939
/* add F-Curve channels (drivers are F-Curves) */
1940
if (FILTER_WOR_SCED(wo)/*EXPANDED_DRVD(adt)*/ || !(filter_mode & ANIMFILTER_CHANNELS)) {
1941
// XXX owner info is messed up now...
1942
items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, wo, ANIMTYPE_DSWOR, filter_mode, (ID *)wo);
1946
/* include world-expand widget? */
1947
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1948
ale= make_new_animlistelem(wo, ANIMTYPE_DSWOR, sce, ANIMTYPE_SCENE, (ID *)sce);
1950
BLI_addtail(anim_data, ale);
1956
if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1957
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo);
1962
/* if expanded, check world textures too */
1963
if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) {
1964
/* textures for world */
1965
if (!(ads->filterflag & ADS_FILTER_NOTEX))
1966
items += animdata_filter_dopesheet_texs(ac, anim_data, ads, (ID *)wo, filter_mode);
1970
if ((ntree && ntree->adt) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
1971
/* Action, Drivers, or NLA for Nodetree */
1973
ANIMDATA_FILTER_CASES(ntree,
1974
{ /* AnimData blocks - do nothing... */ },
1976
/* add NLA tracks */
1977
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ntree, ANIMTYPE_DSNTREE, (ID *)ntree);
1980
/* include nodetree-expand widget? */
1981
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1982
ale= make_new_animlistelem(ntree, ANIMTYPE_DSNTREE, sce, ANIMTYPE_SCENE, (ID *)ntree);
1984
BLI_addtail(anim_data, ale);
1989
/* add F-Curve channels (drivers are F-Curves) */
1990
if (FILTER_NTREE_SCED(ntree)/*EXPANDED_DRVD(adt)*/ || !(filter_mode & ANIMFILTER_CHANNELS)) {
1991
// XXX owner info is messed up now...
1992
items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, ntree, ANIMTYPE_DSNTREE, filter_mode, (ID *)ntree);
1996
/* include nodetree-expand widget? */
1997
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
1998
ale= make_new_animlistelem(ntree, ANIMTYPE_DSNTREE, sce, ANIMTYPE_SCENE, (ID *)sce);
2000
BLI_addtail(anim_data, ale);
2006
if (FILTER_NTREE_SCED(ntree) || (filter_mode & ANIMFILTER_CURVESONLY)) {
2007
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, ntree, ANIMTYPE_DSNTREE, (ID *)ntree);
2014
// TODO: scene compositing nodes (these aren't standard node-trees)
2016
/* return the number of items added to the list */
1925
if (ANIMCHANNEL_ACTIVEOK(wo)) {
1926
ANIMCHANNEL_NEW_CHANNEL(wo, ANIMTYPE_DSWOR, sce);
1930
/* now add the list of collected channels */
1931
BLI_movelisttolist(anim_data, &tmp_data);
1932
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1936
/* return the number of items added to the list */
1940
static size_t animdata_filter_ds_scene (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
1942
ListBase tmp_data = {NULL, NULL};
1943
size_t tmp_items = 0;
1946
AnimData *adt = sce->adt;
1947
short type=0, expanded=1;
1950
/* determine the type of expander channels to use */
1951
// this is the best way to do this for now...
1952
ANIMDATA_FILTER_CASES(sce,
1953
{/* AnimData - no channel, but consider data */},
1954
{/* NLA - no channel, but consider data */},
1956
type = ANIMTYPE_FILLDRIVERS;
1958
expanded = EXPANDED_DRVD(adt);
1961
type = ANIMTYPE_FILLACTD;
1962
cdata = adt->action;
1963
expanded = EXPANDED_ACTC(adt->action);
1966
/* add scene-level animation channels */
1967
BEGIN_ANIMFILTER_SUBCHANNELS(expanded)
1969
/* animation data filtering */
1970
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)sce, filter_mode);
1972
END_ANIMFILTER_SUBCHANNELS;
1974
/* did we find anything? */
1976
/* include anim-expand widget first */
1977
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
1978
if (type != ANIMTYPE_NONE) {
1979
/* NOTE: active-status (and the associated checks) don't apply here... */
1980
ANIMCHANNEL_NEW_CHANNEL(cdata, type, sce);
1984
/* now add the list of collected channels */
1985
BLI_movelisttolist(anim_data, &tmp_data);
1986
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
1990
/* return the number of items added to the list */
1994
static size_t animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
1996
ListBase tmp_data = {NULL, NULL};
1997
size_t tmp_items = 0;
2000
/* filter data contained under object first */
2001
BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_SCEC(sce))
2003
bNodeTree *ntree= sce->nodetree;
2004
World *wo= sce->world;
2006
/* Action, Drivers, or NLA for Scene */
2007
if ((ads->filterflag & ADS_FILTER_NOSCE) == 0) {
2008
tmp_items += animdata_filter_ds_scene(ac, &tmp_data, ads, sce, filter_mode);
2012
if ((wo) && !(ads->filterflag & ADS_FILTER_NOWOR)) {
2013
tmp_items += animdata_filter_ds_world(ac, &tmp_data, ads, sce, wo, filter_mode);
2017
if ((ntree) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
2018
tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)sce, ntree, filter_mode);
2021
// TODO: one day, when sequencer becomes its own datatype, perhaps it should be included here
2023
END_ANIMFILTER_SUBCHANNELS;
2025
/* if we collected some channels, add these to the new list... */
2027
/* firstly add object expander if required */
2028
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
2029
/* check if filtering by selection */
2030
if (ANIMCHANNEL_SELOK((sce->flag & SCE_DS_SELECTED))) {
2031
/* NOTE: active-status doesn't matter for this! */
2032
ANIMCHANNEL_NEW_CHANNEL(sce, ANIMTYPE_SCENE, sce);
2036
/* now add the list of collected channels */
2037
BLI_movelisttolist(anim_data, &tmp_data);
2038
BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
2042
/* return the number of items added */
2020
2046
// TODO: implement pinning... (if and when pinning is done, what we need to do is to provide freeing mechanisms - to protect against data that was deleted)
2021
static int animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, int filter_mode)
2047
static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, int filter_mode)
2023
2049
Scene *sce= (Scene *)ads->source;
2028
2053
/* check that we do indeed have a scene */
2029
2054
if ((ads->source == NULL) || (GS(ads->source->name)!=ID_SCE)) {
2030
2055
printf("DopeSheet Error: Not scene!\n");
2032
printf("\tPointer = %p, Name = '%s' \n", ads->source, (ads->source)?ads->source->name:NULL);
2056
if (G.debug & G_DEBUG)
2057
printf("\tPointer = %p, Name = '%s'\n", (void *)ads->source, (ads->source)?ads->source->name:NULL);
2129
2095
/* if only F-Curves with visible flags set can be shown, check that
2130
2096
* datablock hasn't been set to invisible
2132
if (filter_mode & ANIMFILTER_CURVEVISIBLE) {
2098
if (filter_mode & ANIMFILTER_CURVE_VISIBLE) {
2133
2099
if ((ob->adt) && (ob->adt->flag & ADT_CURVES_NOT_VISIBLE))
2137
/* additionally, dopesheet filtering also affects what objects to consider */
2138
if (ads->filterflag) {
2139
/* check selection and object type filters */
2140
if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/) ) {
2141
/* only selected should be shown */
2145
/* check if object belongs to the filtering group if option to filter
2146
* objects by the grouped status is on
2147
* - used to ease the process of doing multiple-character choreographies
2149
if (ads->filterflag & ADS_FILTER_ONLYOBGROUP) {
2150
if (object_in_group(ob, ads->filter_grp) == 0)
2154
/* check filters for datatypes */
2157
if (!(ads->filterflag & ADS_FILTER_NOOBJ)) {
2158
ANIMDATA_FILTER_CASES(ob,
2160
/* for the special AnimData blocks only case, we only need to add
2161
* the block if it is valid... then other cases just get skipped (hence ok=0)
2163
ANIMDATA_ADD_ANIMDATA(ob);
2172
if ((key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)) {
2174
ANIMDATA_FILTER_CASES(key,
2176
/* for the special AnimData blocks only case, we only need to add
2177
* the block if it is valid... then other cases just get skipped (hence ok=0)
2179
ANIMDATA_ADD_ANIMDATA(key);
2187
/* materials - only for geometric types */
2188
matOk= 0; /* by default, not ok... */
2189
if ( !(ads->filterflag & ADS_FILTER_NOMAT) && (ob->totcol) &&
2190
ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL) )
2194
/* firstly check that we actuallly have some materials */
2195
for (a=0; a < ob->totcol; a++) {
2196
Material *ma= give_current_material(ob, a);
2199
/* if material has relevant animation data, break */
2200
ANIMDATA_FILTER_CASES(ma,
2202
/* for the special AnimData blocks only case, we only need to add
2203
* the block if it is valid... then other cases just get skipped (hence ok=0)
2205
ANIMDATA_ADD_ANIMDATA(ma);
2216
// TODO: make this a macro that is used in the other checks too
2217
// NOTE: this has little use on its own, since the actual filtering still ignores if no anim on the data
2218
if (!(ads->filterflag & ADS_FILTER_NOTEX)) {
2221
for (mtInd= 0; mtInd < MAX_MTEX; mtInd++) {
2222
MTex *mtex= ma->mtex[mtInd];
2224
if (mtex && mtex->tex) {
2225
/* if texture has relevant animation data, break */
2226
ANIMDATA_FILTER_CASES(mtex->tex,
2228
/* for the special AnimData blocks only case, we only need to add
2229
* the block if it is valid... then other cases just get skipped (hence ok=0)
2231
ANIMDATA_ADD_ANIMDATA(mtex->tex);
2250
case OB_CAMERA: /* ------- Camera ------------ */
2252
Camera *ca= (Camera *)ob->data;
2254
ANIMDATA_FILTER_CASES(ca,
2255
if ((ads->filterflag & ADS_FILTER_NOCAM)==0) {
2256
/* for the special AnimData blocks only case, we only need to add
2257
* the block if it is valid... then other cases just get skipped (hence ok=0)
2259
ANIMDATA_ADD_ANIMDATA(ca);
2262
dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);,
2263
dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);,
2264
dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);)
2267
case OB_LAMP: /* ---------- Lamp ----------- */
2269
Lamp *la= (Lamp *)ob->data;
2271
ANIMDATA_FILTER_CASES(la,
2272
if ((ads->filterflag & ADS_FILTER_NOLAM)==0) {
2273
/* for the special AnimData blocks only case, we only need to add
2274
* the block if it is valid... then other cases just get skipped (hence ok=0)
2276
ANIMDATA_ADD_ANIMDATA(la);
2279
dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);,
2280
dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);,
2281
dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);)
2284
case OB_CURVE: /* ------- Curve ---------- */
2285
case OB_SURF: /* ------- Nurbs Surface ---------- */
2286
case OB_FONT: /* ------- Text Curve ---------- */
2288
Curve *cu= (Curve *)ob->data;
2290
ANIMDATA_FILTER_CASES(cu,
2291
if ((ads->filterflag & ADS_FILTER_NOCUR)==0) {
2292
/* for the special AnimData blocks only case, we only need to add
2293
* the block if it is valid... then other cases just get skipped (hence ok=0)
2295
ANIMDATA_ADD_ANIMDATA(cu);
2298
dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);,
2299
dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);,
2300
dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);)
2303
case OB_MBALL: /* ------- MetaBall ---------- */
2305
MetaBall *mb= (MetaBall *)ob->data;
2307
ANIMDATA_FILTER_CASES(mb,
2308
if ((ads->filterflag & ADS_FILTER_NOMBA)==0) {
2309
/* for the special AnimData blocks only case, we only need to add
2310
* the block if it is valid... then other cases just get skipped (hence ok=0)
2312
ANIMDATA_ADD_ANIMDATA(mb);
2315
dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);,
2316
dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);,
2317
dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);)
2320
case OB_ARMATURE: /* ------- Armature ---------- */
2322
bArmature *arm= (bArmature *)ob->data;
2324
ANIMDATA_FILTER_CASES(arm,
2325
if ((ads->filterflag & ADS_FILTER_NOARM)==0) {
2326
/* for the special AnimData blocks only case, we only need to add
2327
* the block if it is valid... then other cases just get skipped (hence ok=0)
2329
ANIMDATA_ADD_ANIMDATA(arm);
2332
dataOk= !(ads->filterflag & ADS_FILTER_NOARM);,
2333
dataOk= !(ads->filterflag & ADS_FILTER_NOARM);,
2334
dataOk= !(ads->filterflag & ADS_FILTER_NOARM);)
2337
case OB_MESH: /* ------- Mesh ---------- */
2339
Mesh *me= (Mesh *)ob->data;
2341
ANIMDATA_FILTER_CASES(me,
2342
if ((ads->filterflag & ADS_FILTER_NOMESH)==0) {
2343
/* for the special AnimData blocks only case, we only need to add
2344
* the block if it is valid... then other cases just get skipped (hence ok=0)
2346
ANIMDATA_ADD_ANIMDATA(me);
2349
dataOk= !(ads->filterflag & ADS_FILTER_NOMESH);,
2350
dataOk= !(ads->filterflag & ADS_FILTER_NOMESH);,
2351
dataOk= !(ads->filterflag & ADS_FILTER_NOMESH);)
2354
default: /* --- other --- */
2361
if (!(ads->filterflag & ADS_FILTER_NOPART) && ob->particlesystem.first) {
2362
ParticleSystem *psys = ob->particlesystem.first;
2363
for(; psys; psys=psys->next) {
2365
/* if particlesettings has relevant animation data, break */
2366
ANIMDATA_FILTER_CASES(psys->part,
2368
/* for the special AnimData blocks only case, we only need to add
2369
* the block if it is valid... then other cases just get skipped (hence ok=0)
2371
ANIMDATA_ADD_ANIMDATA(psys->part);
2384
/* check if all bad (i.e. nothing to show) */
2385
if (!actOk && !keyOk && !dataOk && !matOk && !partOk)
2389
/* check data-types */
2390
actOk= ANIMDATA_HAS_KEYS(ob);
2391
keyOk= (key != NULL);
2393
/* materials - only for geometric types */
2394
matOk= 0; /* by default, not ok... */
2395
if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL) && (ob->totcol))
2399
/* firstly check that we actuallly have some materials */
2400
for (a=0; a < ob->totcol; a++) {
2401
Material *ma= give_current_material(ob, a);
2403
if ((ma) && ANIMDATA_HAS_KEYS(ma)) {
2412
case OB_CAMERA: /* ------- Camera ------------ */
2414
Camera *ca= (Camera *)ob->data;
2415
dataOk= ANIMDATA_HAS_KEYS(ca);
2418
case OB_LAMP: /* ---------- Lamp ----------- */
2420
Lamp *la= (Lamp *)ob->data;
2421
dataOk= ANIMDATA_HAS_KEYS(la);
2424
case OB_CURVE: /* ------- Curve ---------- */
2425
case OB_SURF: /* ------- Nurbs Surface ---------- */
2426
case OB_FONT: /* ------- Text Curve ---------- */
2428
Curve *cu= (Curve *)ob->data;
2429
dataOk= ANIMDATA_HAS_KEYS(cu);
2432
case OB_MBALL: /* -------- Metas ---------- */
2434
MetaBall *mb= (MetaBall *)ob->data;
2435
dataOk= ANIMDATA_HAS_KEYS(mb);
2438
case OB_ARMATURE: /* -------- Armature ---------- */
2440
bArmature *arm= (bArmature *)ob->data;
2441
dataOk= ANIMDATA_HAS_KEYS(arm);
2444
case OB_MESH: /* -------- Mesh ---------- */
2446
Mesh *me= (Mesh *)ob->data;
2447
dataOk= ANIMDATA_HAS_KEYS(me);
2450
default: /* --- other --- */
2457
if (ob->particlesystem.first) {
2458
ParticleSystem *psys = ob->particlesystem.first;
2459
for(; psys; psys=psys->next) {
2460
if(psys->part && ANIMDATA_HAS_KEYS(psys->part)) {
2467
/* check if all bad (i.e. nothing to show) */
2468
if (!actOk && !keyOk && !dataOk && !matOk && !partOk)
2103
/* check selection and object type filters */
2104
if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/) ) {
2105
/* only selected should be shown */
2109
/* check if object belongs to the filtering group if option to filter
2110
* objects by the grouped status is on
2111
* - used to ease the process of doing multiple-character choreographies
2113
if (ads->filterflag & ADS_FILTER_ONLYOBGROUP) {
2114
if (object_in_group(ob, ads->filter_grp) == 0)
2472
2118
/* since we're still here, this object should be usable */
2473
2119
items += animdata_filter_dopesheet_ob(ac, anim_data, ads, base, filter_mode);