Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-02-17 13:21:07 +0300
committerJoshua Leung <aligorith@gmail.com>2010-02-17 13:21:07 +0300
commita6e19982221dcc82d350d77cdb9bc16a2337ad9d (patch)
treeb8087c65b2e0d40a343fb1afe80cce0d49d03348 /source
parentc011bbbdb9013ed8a6a42ae728ccdb018ff661cd (diff)
Animation Editors - Texture Animation:
Texture animation is now shown in the animation editors. Texture stacks are shown for each Material/Lamp/World block that uses them. There is currently still a bit of a bug with this which means that unless the owner of the texture stack is animated too, the animation data for the textures won't show up. This will get rectified soon though.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/texture.c1
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c240
-rw-r--r--source/blender/editors/animation/anim_filter.c232
-rw-r--r--source/blender/editors/animation/keyframes_edit.c1
-rw-r--r--source/blender/editors/include/ED_anim_api.h9
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/makesdna/DNA_action_types.h1
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h4
-rw-r--r--source/blender/makesdna/DNA_material_types.h5
-rw-r--r--source/blender/makesdna/DNA_texture_types.h1
-rw-r--r--source/blender/makesdna/DNA_world_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_action.c6
12 files changed, 495 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index feeb98a5a8c..10fdbc7fa14 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -420,6 +420,7 @@ void free_texture(Tex *tex)
if(tex->env) BKE_free_envmap(tex->env);
if(tex->pd) BKE_free_pointdensity(tex->pd);
if(tex->vd) BKE_free_voxeldata(tex->vd);
+ BKE_free_animdata((struct ID *)tex);
BKE_previewimg_free(&tex->preview);
BKE_icon_delete((struct ID*)tex);
tex->id.icon_id = 0;
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 696a3553a46..3e711ccc2c1 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -55,6 +55,7 @@
#include "DNA_lamp_types.h"
#include "DNA_mesh_types.h"
#include "DNA_material_types.h"
+#include "DNA_texture_types.h"
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
#include "DNA_userdef_types.h"
@@ -255,8 +256,9 @@ static short acf_generic_indention_flexible(bAnimContext *ac, bAnimListElem *ale
short indent= 0;
if (ale->id) {
- /* special exception for materials and particles */
- if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
+ /* special exception for materials, textures, and particles */
+ // xxx should tex use indention 2?
+ if (ELEM3(GS(ale->id->name),ID_MA,ID_PA,ID_TE))
indent++;
}
@@ -290,8 +292,25 @@ static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
short offset= acf_generic_basic_offset(ac, ale);
if (ale->id) {
+ /* special exception for textures */
+ if (GS(ale->id->name) == ID_TE) {
+ /* minimum offset */
+ offset += 21;
+
+ /* special offset from owner type */
+ switch (ale->ownertype) {
+ case ANIMTYPE_DSMAT:
+ offset += 21;
+ break;
+
+ case ANIMTYPE_DSLAM:
+ case ANIMTYPE_DSWOR:
+ offset += 14;
+ break;
+ }
+ }
/* special exception for materials and particles */
- if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
+ else if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
offset += 21;
/* if not in Action Editor mode, groupings must carry some offset too... */
@@ -329,13 +348,19 @@ static short acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale
static short acf_generic_dsexpand_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
{
switch (setting) {
- /* only expand supported */
+ /* only expand supported everywhere */
case ACHANNEL_SETTING_EXPAND:
return 1;
- /* visible - only available in Graph Editor */
+ /* visible
+ * - only available in Graph Editor
+ * - NOT available for 'filler' channels
+ */
case ACHANNEL_SETTING_VISIBLE:
- return ((ac) && (ac->spacetype == SPACE_IPO));
+ if (ELEM3(ale->type, ANIMTYPE_FILLMATD, ANIMTYPE_FILLPARTD, ANIMTYPE_FILLTEXD))
+ return 0;
+ else
+ return ((ac) && (ac->spacetype == SPACE_IPO));
default:
return 0;
@@ -1166,6 +1191,112 @@ static bAnimChannelType ACF_FILLPARTD=
acf_generic_dsexpand_setting_ptr /* pointer for setting */
};
+/* Textures Expander ------------------------------------------- */
+
+/* offset for groups + grouped entities */
+static short acf_filltexd_offset(bAnimContext *ac, bAnimListElem *ale)
+{
+ short offset= acf_generic_basic_offset(ac, ale);
+
+ if (ale->id) {
+ /* materials */
+ switch (GS(ale->id->name)) {
+ case ID_MA:
+ offset += 21;
+ break;
+
+ case ID_LA:
+ case ID_WO:
+ offset += 14;
+ break;
+ }
+ }
+
+ return offset;
+}
+
+// TODO: just get this from RNA?
+static int acf_filltexd_icon(bAnimListElem *ale)
+{
+ return ICON_TEXTURE_DATA;
+}
+
+static void acf_filltexd_name(bAnimListElem *ale, char *name)
+{
+ strcpy(name, "Textures");
+}
+
+/* get pointer to the setting (category only) */
+static void *acf_filltexd_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ ID *id= (ID *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ {
+ switch (GS(id->name)) {
+ case ID_MA:
+ {
+ Material *ma= (Material *)id;
+ GET_ACF_FLAG_PTR(ma->flag);
+ }
+
+ case ID_LA:
+ {
+ Lamp *la= (Lamp *)id;
+ GET_ACF_FLAG_PTR(la->flag);
+ }
+
+ case ID_WO:
+ {
+ World *wo= (World *)id;
+ GET_ACF_FLAG_PTR(wo->flag);
+ }
+ }
+ }
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_filltexd_setting_flag(bAnimContext *ac, int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ /* NOTE: the exact same flag must be used for other texture stack types too! */
+ return MA_DS_SHOW_TEXS;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* particles expander type define */
+static bAnimChannelType ACF_FILLTEXD=
+{
+ "Textures Filler", /* type name */
+
+ acf_generic_dataexpand_color, /* backdrop color */
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_flexible, /* indent level */
+ acf_filltexd_offset, /* offset */
+
+ acf_filltexd_name, /* name */
+ acf_filltexd_icon, /* icon */
+
+ acf_generic_dsexpand_setting_valid, /* has setting */
+ acf_filltexd_setting_flag, /* flag for setting */
+ acf_filltexd_setting_ptr /* pointer for setting */
+};
+
/* Material Expander ------------------------------------------- */
// TODO: just get this from RNA?
@@ -1324,6 +1455,101 @@ static bAnimChannelType ACF_DSLAM=
acf_dslam_setting_ptr /* pointer for setting */
};
+/* Texture Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dstex_icon(bAnimListElem *ale)
+{
+ return ICON_TEXTURE_DATA;
+}
+
+/* offset for texture expanders */
+static short acf_dstex_offset(bAnimContext *ac, bAnimListElem *ale)
+{
+ short offset = 21;
+
+ /* special offset from owner type */
+ // FIXME: too much now!
+ switch (ale->ownertype) {
+ case ANIMTYPE_DSMAT:
+ offset += 14;
+
+ case ANIMTYPE_DSLAM:
+ case ANIMTYPE_DSWOR:
+ offset += 7;
+ }
+
+ return offset;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dstex_setting_flag(bAnimContext *ac, int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return TEX_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ return ADT_UI_SELECTED;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dstex_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Tex *tex= (Tex *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(tex->flag);
+
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (tex->adt)
+ GET_ACF_FLAG_PTR(tex->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* material expander type define */
+static bAnimChannelType ACF_DSTEX=
+{
+ "Texture Data Expander", /* type name */
+
+ acf_generic_channel_color, /* backdrop color */
+ acf_generic_channel_backdrop, /* backdrop */
+ acf_generic_indention_0, /* indent level */
+ acf_dstex_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dstex_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dstex_setting_flag, /* flag for setting */
+ acf_dstex_setting_ptr /* pointer for setting */
+};
+
/* Camera Expander ------------------------------------------- */
// TODO: just get this from RNA?
@@ -2260,6 +2486,7 @@ void ANIM_init_channel_typeinfo_data (void)
animchannelTypeInfo[type++]= &ACF_FILLDRIVERS; /* Drivers Expander */
animchannelTypeInfo[type++]= &ACF_FILLMATD; /* Materials Expander */
animchannelTypeInfo[type++]= &ACF_FILLPARTD; /* Particles Expander */
+ animchannelTypeInfo[type++]= &ACF_FILLTEXD; /* Textures Expander */
animchannelTypeInfo[type++]= &ACF_DSMAT; /* Material Channel */
animchannelTypeInfo[type++]= &ACF_DSLAM; /* Lamp Channel */
@@ -2272,6 +2499,7 @@ void ANIM_init_channel_typeinfo_data (void)
animchannelTypeInfo[type++]= &ACF_DSMBALL; /* MetaBall Channel */
animchannelTypeInfo[type++]= &ACF_DSARM; /* Armature Channel */
animchannelTypeInfo[type++]= &ACF_DSMESH; /* Mesh Channel */
+ animchannelTypeInfo[type++]= &ACF_DSTEX; /* Texture Channel */
animchannelTypeInfo[type++]= &ACF_SHAPEKEY; /* ShapeKey */
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index b519be88595..9f6f76dc3c1 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -71,6 +71,7 @@
#include "DNA_sequence_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "DNA_texture_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
@@ -556,6 +557,35 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
ale->datatype= ALE_NONE;
}
break;
+ case ANIMTYPE_FILLTEXD:
+ {
+ ID *id= (ID *)data;
+
+ switch (GS(id->name)) {
+ case ID_MA:
+ {
+ Material *ma= (Material *)id;
+ ale->flag= FILTER_TEX_MATC(ma);
+ }
+ break;
+ case ID_LA:
+ {
+ Lamp *la= (Lamp *)id;
+ ale->flag= FILTER_TEX_LAMC(la);
+ }
+ break;
+ case ID_WO:
+ {
+ World *wo= (World *)id;
+ ale->flag= FILTER_TEX_WORC(wo);
+ }
+ break;
+ }
+
+ ale->key_data= NULL;
+ ale->datatype= ALE_NONE;
+ }
+ break;
case ANIMTYPE_DSMAT:
{
@@ -687,6 +717,19 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
ale->adt= BKE_animdata_from_id(data);
}
break;
+ case ANIMTYPE_DSTEX:
+ {
+ Tex *tex= (Tex *)data;
+ AnimData *adt= tex->adt;
+
+ ale->flag= FILTER_TEX_DATA(tex);
+
+ ale->key_data= (adt) ? adt->action : NULL;
+ ale->datatype= ALE_ACT;
+
+ ale->adt= BKE_animdata_from_id(data);
+ }
+ break;
case ANIMTYPE_GROUP:
{
@@ -1220,6 +1263,133 @@ static int animdata_filter_gpencil (ListBase *anim_data, bScreen *sc, int filter
}
#endif
+/* NOTE: owner_id is either material, lamp, or world block, which is the direct owner of the texture stack in question */
+static int animdata_filter_dopesheet_texs (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, int filter_mode)
+{
+ ListBase texs = {NULL, NULL};
+ LinkData *ld;
+ MTex **mtex = NULL;
+ short expanded=0;
+ int ownertype = ANIMTYPE_NONE;
+
+ bAnimListElem *ale=NULL;
+ int items=0, a=0;
+
+ /* get datatype specific data first */
+ if (owner_id == NULL)
+ return 0;
+
+ switch (GS(owner_id->name)) {
+ case ID_MA:
+ {
+ Material *ma= (Material *)owner_id;
+
+ mtex= (MTex**)(&ma->mtex);
+ expanded= FILTER_TEX_MATC(ma);
+ ownertype= ANIMTYPE_DSMAT;
+ }
+ break;
+ case ID_LA:
+ {
+ Lamp *la= (Lamp *)owner_id;
+
+ mtex= (MTex**)(&la->mtex);
+ expanded= FILTER_TEX_LAMC(la);
+ ownertype= ANIMTYPE_DSLAM;
+ }
+ break;
+ case ID_WO:
+ {
+ World *wo= (World *)owner_id;
+
+ mtex= (MTex**)(&wo->mtex);
+ expanded= FILTER_TEX_WORC(wo);
+ ownertype= ANIMTYPE_DSWOR;
+ }
+ break;
+ default:
+ {
+ /* invalid/unsupported option */
+ if (G.f & G_DEBUG)
+ printf("ERROR: unsupported owner_id (i.e. texture stack) for filter textures - %s \n", owner_id->name);
+ return 0;
+ }
+ }
+
+ /* firstly check that we actuallly have some textures, by gathering all textures in a temp list */
+ for (a=0; a < MAX_MTEX; a++) {
+ Tex *tex= (mtex[a]) ? mtex[a]->tex : NULL;
+ short ok = 0;
+
+ /* for now, if no texture returned, skip (this shouldn't confuse the user I hope) */
+ if (ELEM(NULL, tex, tex->adt))
+ continue;
+
+ /* check if ok */
+ ANIMDATA_FILTER_CASES(tex,
+ { /* AnimData blocks - do nothing... */ },
+ ok=1;,
+ ok=1;,
+ ok=1;)
+ if (ok == 0) continue;
+
+ /* make a temp list elem for this */
+ ld= MEM_callocN(sizeof(LinkData), "DopeSheet-TextureCache");
+ ld->data= tex;
+ BLI_addtail(&texs, ld);
+ }
+
+ /* if there were no channels found, no need to carry on */
+ if (texs.first == NULL)
+ return 0;
+
+ /* include textures-expand widget? */
+ if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
+ ale= make_new_animlistelem(owner_id, ANIMTYPE_FILLTEXD, owner_id, ownertype, owner_id);
+ if (ale) {
+ BLI_addtail(anim_data, ale);
+ items++;
+ }
+ }
+
+ /* add textures */
+ if ((expanded) || (filter_mode & ANIMFILTER_CURVESONLY)) {
+ /* for each texture in cache, add channels */
+ for (ld= texs.first; ld; ld= ld->next) {
+ Tex *tex= (Tex *)ld->data;
+
+ /* include texture-expand widget? */
+ if (filter_mode & ANIMFILTER_CHANNELS) {
+ /* check if filtering by active status */
+ if ANIMCHANNEL_ACTIVEOK(tex) {
+ ale= make_new_animlistelem(tex, ANIMTYPE_DSTEX, owner_id, ownertype, owner_id);
+ if (ale) {
+ BLI_addtail(anim_data, ale);
+ items++;
+ }
+ }
+ }
+
+ /* add texture's animation data
+ * NOTE: for these, we make the owner/ownertype the material/lamp/etc. not the texture, otherwise the
+ * drawing code cannot resolve the indention easily
+ */
+ if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_TEX_DATA(tex) || (filter_mode & ANIMFILTER_CURVESONLY)) {
+ ANIMDATA_FILTER_CASES(tex,
+ { /* AnimData blocks - do nothing... */ },
+ items += animdata_filter_nla(ac, anim_data, ads, tex->adt, filter_mode, owner_id, ownertype, (ID *)tex);,
+ items += animdata_filter_fcurves(anim_data, ads, tex->adt->drivers.first, NULL, owner_id, ownertype, filter_mode, (ID *)tex);,
+ items += animdata_filter_action(ac, anim_data, ads, tex->adt->action, filter_mode, owner_id, ownertype, (ID *)tex);)
+ }
+ }
+ }
+
+ /* free cache */
+ BLI_freelistN(&texs);
+
+ /* return the number of items added to the list */
+ return items;
+}
static int animdata_filter_dopesheet_mats (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
{
@@ -1254,6 +1424,7 @@ static int animdata_filter_dopesheet_mats (bAnimContext *ac, ListBase *anim_data
}
/* if there were no channels found, no need to carry on */
+ // XXX: textures with no animated owner material won't work because of this...
if (mats.first == NULL)
return 0;
@@ -1287,11 +1458,16 @@ static int animdata_filter_dopesheet_mats (bAnimContext *ac, ListBase *anim_data
/* add material's animation data */
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) {
+ /* material's animation data */
ANIMDATA_FILTER_CASES(ma,
{ /* AnimData blocks - do nothing... */ },
items += animdata_filter_nla(ac, anim_data, ads, ma->adt, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);,
items += animdata_filter_fcurves(anim_data, ads, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);,
items += animdata_filter_action(ac, anim_data, ads, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);)
+
+ /* textures */
+ if (!(ads->filterflag & ADS_FILTER_NOTEX))
+ items += animdata_filter_dopesheet_texs(ac, anim_data, ads, (ID *)ma, filter_mode);
}
}
}
@@ -1443,7 +1619,18 @@ static int animdata_filter_dopesheet_obdata (bAnimContext *ac, ListBase *anim_da
{ /* AnimData blocks - do nothing... */ },
items+= animdata_filter_nla(ac, anim_data, ads, iat->adt, filter_mode, iat, type, (ID *)iat);,
items+= animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat);,
- items += animdata_filter_action(ac, anim_data, ads, iat->adt->action, filter_mode, iat, type, (ID *)iat);)
+ items+= animdata_filter_action(ac, anim_data, ads, iat->adt->action, filter_mode, iat, type, (ID *)iat);)
+
+ /* sub-data filtering... */
+ switch (ob->type) {
+ case OB_LAMP: /* lamp - textures */
+ {
+ /* textures */
+ if (!(ads->filterflag & ADS_FILTER_NOTEX))
+ items += animdata_filter_dopesheet_texs(ac, anim_data, ads, ob->data, filter_mode);
+ }
+ break;
+ }
}
/* return the number of items added to the list */
@@ -1788,6 +1975,13 @@ static int animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_dat
}
}
)
+
+ /* if expanded, check world textures too */
+ if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) {
+ /* textures for world */
+ if (!(ads->filterflag & ADS_FILTER_NOTEX))
+ items += animdata_filter_dopesheet_texs(ac, anim_data, ads, (ID *)wo, filter_mode);
+ }
}
/* nodetree */
if ((ntree && ntree->adt) && !(ads->filterflag & ADS_FILTER_NONTREE)) {
@@ -2025,10 +2219,40 @@ static int animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDo
matOk= 1;,
matOk= 1;,
matOk= 1;)
- }
+
+ if (matOk)
+ break;
- if (matOk)
- break;
+ /* textures? */
+ // TODO: make this a macro that is used in the other checks too
+ // NOTE: this has little use on its own, since the actual filtering still ignores if no anim on the data
+ if (!(ads->filterflag & ADS_FILTER_NOTEX)) {
+ int mtInd;
+
+ for (mtInd= 0; mtInd < MAX_MTEX; mtInd++) {
+ MTex *mtex= ma->mtex[mtInd];
+
+ if (mtex && mtex->tex) {
+ /* if texture has relevant animation data, break */
+ ANIMDATA_FILTER_CASES(mtex->tex,
+ {
+ /* for the special AnimData blocks only case, we only need to add
+ * the block if it is valid... then other cases just get skipped (hence ok=0)
+ */
+ ANIMDATA_ADD_ANIMDATA(mtex->tex);
+ matOk=0;
+ },
+ matOk= 1;,
+ matOk= 1;,
+ matOk= 1;)
+
+ if (matOk)
+ break;
+ }
+ }
+ }
+
+ }
}
}
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 6511a022718..ca1df14e14c 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -642,6 +642,7 @@ static short snap_bezier_nearmarker(BeztEditData *bed, BezTriple *bezt)
static short snap_bezier_horizontal(BeztEditData *bed, BezTriple *bezt)
{
if (bezt->f2 & SELECT) {
+ // XXX currently this snaps both handles to the nearest horizontal value, but perhaps user just wants to level out handles instead?
bezt->vec[0][1]= bezt->vec[2][1]= (float)floor(bezt->vec[1][1] + 0.5f);
if ((bezt->h1==HD_AUTO) || (bezt->h1==HD_VECT)) bezt->h1= HD_ALIGN;
if ((bezt->h2==HD_AUTO) || (bezt->h2==HD_VECT)) bezt->h2= HD_ALIGN;
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 5f966b9ddc3..2f089a41a3f 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -134,6 +134,7 @@ typedef enum eAnim_ChannelType {
ANIMTYPE_FILLDRIVERS,
ANIMTYPE_FILLMATD,
ANIMTYPE_FILLPARTD,
+ ANIMTYPE_FILLTEXD,
ANIMTYPE_DSMAT,
ANIMTYPE_DSLAM,
@@ -146,6 +147,7 @@ typedef enum eAnim_ChannelType {
ANIMTYPE_DSMBALL,
ANIMTYPE_DSARM,
ANIMTYPE_DSMESH,
+ ANIMTYPE_DSTEX,
ANIMTYPE_SHAPEKEY,
@@ -225,8 +227,13 @@ typedef enum eAnimFilter_Flags {
/* 'Sub-object/Action' channels (flags stored in Action) */
#define SEL_ACTC(actc) ((actc->flag & ACT_SELECTED))
#define EXPANDED_ACTC(actc) ((actc->flag & ACT_COLLAPSED)==0)
- /* 'Sub-AnimData' chanenls */
+ /* 'Sub-AnimData' channels */
#define EXPANDED_DRVD(adt) ((adt->flag & ADT_DRIVERS_COLLAPSED)==0)
+ /* Texture expanders */
+#define FILTER_TEX_MATC(ma) ((ma->flag & MA_DS_SHOW_TEXS))
+#define FILTER_TEX_LAMC(la) ((la->flag & LA_DS_SHOW_TEXS))
+#define FILTER_TEX_WORC(wa) ((wo->flag & WO_DS_SHOW_TEXS))
+#define FILTER_TEX_DATA(tex) ((tex->flag & TEX_DS_EXPAND))
/* Actions (also used for Dopesheet) */
/* Action Channel Group */
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 12e0066c53c..c327d4515d3 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -105,6 +105,8 @@ void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr)
uiItemR(row, "", 0, ptr, "display_material", 0);
if (mainptr && mainptr->lamp.first)
uiItemR(row, "", 0, ptr, "display_lamp", 0);
+ if (mainptr && mainptr->tex.first)
+ uiItemR(row, "", 0, ptr, "display_texture", 0);
if (mainptr && mainptr->camera.first)
uiItemR(row, "", 0, ptr, "display_camera", 0);
if (mainptr && mainptr->curve.first)
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 278f54db3a9..f76a7f6140e 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -537,6 +537,7 @@ typedef enum eDopeSheet_FilterFlag {
ADS_FILTER_NOMBA = (1<<17),
ADS_FILTER_NOARM = (1<<18),
ADS_FILTER_NONTREE = (1<<19),
+ ADS_FILTER_NOTEX = (1<<20),
/* NLA-specific filters */
ADS_FILTER_NLA_NOACT = (1<<25), /* if the AnimData block has no NLA data, don't include to just show Action-line */
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index 665cb1c3819..cb458708b3e 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -115,6 +115,10 @@ typedef struct Lamp {
/* flag */
#define LA_DS_EXPAND 1
+ /* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
+ * otherwise anim-editors will not read correctly
+ */
+#define LA_DS_SHOW_TEXS 4
/* type */
#define LA_LOCAL 0
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index fa6cddd8227..f8eb6e76693 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -181,6 +181,11 @@ typedef struct Material {
#define MA_IS_USED 1
/* for dopesheet */
#define MA_DS_EXPAND 2
+ /* for dopesheet (texture stack expander)
+ * NOTE: this must have the same value as other texture stacks,
+ * otherwise anim-editors will not read correctly
+ */
+#define MA_DS_SHOW_TEXS 4
/* mode (is int) */
#define MA_TRACEBLE 1
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index be8c909271b..5747669d015 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -357,6 +357,7 @@ typedef struct TexMapping {
#define TEX_REPEAT_XMIR 128
#define TEX_REPEAT_YMIR 256
#define TEX_FLAG_MASK ( TEX_COLORBAND | TEX_FLIPBLEND | TEX_NEGALPHA | TEX_CHECKER_ODD | TEX_CHECKER_EVEN | TEX_PRV_ALPHA | TEX_PRV_NOR | TEX_REPEAT_XMIR | TEX_REPEAT_YMIR )
+#define TEX_DS_EXPAND 512
/* extend (starts with 1 because of backward comp.) */
#define TEX_EXTEND 1
diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h
index 0c0317ac444..66d31467c4a 100644
--- a/source/blender/makesdna/DNA_world_types.h
+++ b/source/blender/makesdna/DNA_world_types.h
@@ -186,6 +186,10 @@ typedef struct World {
/* flag */
#define WO_DS_EXPAND (1<<0)
+ /* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
+ * otherwise anim-editors will not read correctly
+ */
+#define WO_DS_SHOW_TEXS (1<<2)
#endif
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 3e56ce7f562..3033999ecde 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -142,6 +142,12 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ prop= RNA_def_property(srna, "display_texture", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);
+ RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data");
+ RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+
prop= RNA_def_property(srna, "display_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR);
RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of Curve related Animation data");