diff options
author | Roman Pogribnyi <pogribnyi@gmail.com> | 2015-03-15 21:57:06 +0300 |
---|---|---|
committer | Roman Pogribnyi <pogribnyi@gmail.com> | 2015-03-15 21:57:06 +0300 |
commit | 5c64aa25541b973db4ec90c97e30b02d09b00075 (patch) | |
tree | 0cd3a8912d8b0cbfc5fe0bb94a2a42751e98dcd6 /source/blender/blenkernel/intern/ipo.c | |
parent | 2a1a6bc5720a4310e42a67754998e0480bf7c59b (diff) | |
parent | 225027ce5dea3785626908b58b01fb3959cf8362 (diff) |
Merge branch 'master' into soc-2014-fluid
Diffstat (limited to 'source/blender/blenkernel/intern/ipo.c')
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 51cf26063c7..09ce9484a69 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -161,21 +161,24 @@ static AdrBit2Path ma_mode_bits[] = { { \ *tot = sizeof(items) / sizeof(AdrBit2Path); \ return items; \ - } + } (void)0 /* This function checks if a Blocktype+Adrcode combo, returning a mapping table */ static AdrBit2Path *adrcode_bitmaps_to_paths(int blocktype, int adrcode, int *tot) { /* Object layers */ - if ((blocktype == ID_OB) && (adrcode == OB_LAY)) - RET_ABP(ob_layer_bits) - else if ((blocktype == ID_MA) && (adrcode == MA_MODE)) - RET_ABP(ma_mode_bits) + if ((blocktype == ID_OB) && (adrcode == OB_LAY)) { + RET_ABP(ob_layer_bits); + } + else if ((blocktype == ID_MA) && (adrcode == MA_MODE)) { + RET_ABP(ma_mode_bits); + } // XXX TODO: add other types... /* Normal curve */ return NULL; } +#undef RET_ABP /* *************************************************** */ /* ADRCODE to RNA-Path Conversion Code - Standard */ @@ -919,11 +922,11 @@ static char *get_rna_access(int blocktype, int adrcode, char actname[], char con BLI_snprintf(buf, sizeof(buf), "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname); } else if (actname && actname[0]) { - if ((blocktype == ID_OB) && strcmp(actname, "Object") == 0) { + if ((blocktype == ID_OB) && STREQ(actname, "Object")) { /* Actionified "Object" IPO's... no extra path stuff needed */ buf[0] = '\0'; /* empty string */ } - else if ((blocktype == ID_KE) && strcmp(actname, "Shape") == 0) { + else if ((blocktype == ID_KE) && STREQ(actname, "Shape")) { /* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */ strcpy(buf, "data.shape_keys"); } @@ -1323,7 +1326,7 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i * - we now need as 'frames' */ if ( (id) && (icu->blocktype == GS(id->name)) && - (fcu->rna_path && strcmp(fcu->rna_path, "eval_time") == 0) ) + (fcu->rna_path && STREQ(fcu->rna_path, "eval_time")) ) { Curve *cu = (Curve *)id; @@ -1400,9 +1403,9 @@ static void ipo_to_animato(ID *id, Ipo *ipo, char actname[], char constname[], S * F-Curves for bones). This may be added later... for now let's just dump without them... */ if (actname) { - if ((ipo->blocktype == ID_OB) && (strcmp(actname, "Object") == 0)) + if ((ipo->blocktype == ID_OB) && STREQ(actname, "Object")) actname = NULL; - else if ((ipo->blocktype == ID_OB) && (strcmp(actname, "Shape") == 0)) + else if ((ipo->blocktype == ID_OB) && STREQ(actname, "Shape")) actname = NULL; } @@ -1523,7 +1526,7 @@ static void ipo_to_animdata(ID *id, Ipo *ipo, char actname[], char constname[], if (G.debug & G_DEBUG) { printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s curves:%d\n", id->name + 2, ipo->id.name + 2, (actname) ? actname : "<None>", (constname) ? constname : "<None>", (seq) ? (seq->name + 2) : "<None>", - BLI_countlist(&ipo->curve)); + BLI_listbase_count(&ipo->curve)); } /* Convert curves to animato system (separated into separate lists of F-Curves for animation and drivers), @@ -1648,6 +1651,9 @@ static void nlastrips_to_animdata(ID *id, ListBase *strips) nlt = add_nlatrack(adt, NULL); BKE_nlatrack_add_strip(nlt, strip); } + + /* ensure that strip has a name */ + BKE_nlastrip_validate_name(adt, strip); } /* modifiers */ |