diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-10-12 15:27:34 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-10-12 15:27:34 +0400 |
commit | 237cd688aaead5592393db58cf2e39e2ab3ce9b2 (patch) | |
tree | 9a03690d8ea68f67a4d552ce7e4db7650f31c3a2 | |
parent | b4a113669d8fecad28369b3d777aa285addacf46 (diff) |
Animation Editors: 'Only Selected' filtering option now works on Pose Channels too
* Only F-Curves and Drivers that affect selected bones will be visible when this happens.
* Moved the function to grab text within a pair of "" following some prefix to blenlib.
-rw-r--r-- | source/blender/blenlib/BLI_string.h | 11 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string.c | 24 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 14 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 123 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ipo_utils.c | 28 |
5 files changed, 125 insertions, 75 deletions
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index 53563f85eb9..fb345de72e9 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -68,6 +68,17 @@ char *BLI_strdupn(const char *str, int len); */ char *BLI_strncpy(char *dst, const char *src, int maxncpy); + /* Makes a copy of the text within the "" that appear after some text 'blahblah' + * i.e. for string 'pose["apples"]' with prefix 'pose[', it should grab "apples" + * + * - str: is the entire string to chop + * - prefix: is the part of the string to leave out + * + * Assume that the strings returned must be freed afterwards, and that the inputs will contain + * data we want... + */ +char *BLI_getQuotedStr(const char *str, const char *prefix); + /** * Returns a copy of the cstring @a str into a newly mallocN'd * string with all instances of oldText replaced with newText, diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index de4b53cbd93..405f8c6db97 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -100,6 +100,30 @@ char *BLI_sprintfN(const char *format, ...) return n; } +/* Makes a copy of the text within the "" that appear after some text 'blahblah' + * i.e. for string 'pose["apples"]' with prefix 'pose[', it should grab "apples" + * + * - str: is the entire string to chop + * - prefix: is the part of the string to leave out + * + * Assume that the strings returned must be freed afterwards, and that the inputs will contain + * data we want... + */ +char *BLI_getQuotedStr (const char *str, const char *prefix) +{ + int prefixLen = strlen(prefix); + char *startMatch, *endMatch; + + /* get the starting point (i.e. where prefix starts, and add prefixLen+1 to it to get be after the first " */ + startMatch= strstr(str, prefix) + prefixLen + 1; + + /* get the end point (i.e. where the next occurance of " is after the starting point) */ + endMatch= strchr(startMatch, '"'); // " NOTE: this comment here is just so that my text editor still shows the functions ok... + + /* return the slice indicated */ + return BLI_strdupn(startMatch, (int)(endMatch-startMatch)); +} + /* Replaces all occurances of oldText with newText in str, returning a new string that doesn't * contain the 'replaced' occurances. */ diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 62341a5d6ae..9d39911548b 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -78,10 +78,7 @@ void ED_anim_object_flush_update(const bContext *C, Object *ob) * 3) Grouping (only for pose to action for now) */ -/* XXX OBSOLETE CODE WARNING: - * With the Animato system, the code below is somewhat obsolete now... - */ - + /* Notifier from Action/Dopesheet (this may be extended to include other things such as Python...) * Channels in action changed, so update pose channels/groups to reflect changes. * @@ -90,12 +87,14 @@ void ED_anim_object_flush_update(const bContext *C, Object *ob) */ void ANIM_action_to_pose_sync (Object *ob) { - bAction *act= (bAction *)ob->action; - bActionChannel *achan; +#if 0 + AnimData *adt= ob->adt; + bAction *act= adt->act; + FCurve *fcu; bPoseChannel *pchan; /* error checking */ - if ((ob == NULL) || (ob->type != OB_ARMATURE) || ELEM(NULL, act, ob->pose)) + if (ELEM3(NULL, ob, ob->adt, ob->pose) || (ob->type != OB_ARMATURE)) return; /* 1b) loop through all Action-Channels (there should be fewer channels to search through here in general) */ @@ -120,6 +119,7 @@ void ANIM_action_to_pose_sync (Object *ob) } // TODO: add grouping changes too? For now, these tools aren't exposed to users in animation editors yet... +#endif } /* Notifier from 3D-View/Outliner (this is likely to include other sources too...) diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 13b050e4497..6b953d2460d 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -77,6 +77,7 @@ #include "BLI_blenlib.h" #include "BKE_animsys.h" +#include "BKE_action.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_key.h" @@ -676,7 +677,7 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s /* ----------------------------------------- */ -static int animdata_filter_fcurves (ListBase *anim_data, FCurve *first, bActionGroup *grp, void *owner, short ownertype, int filter_mode, ID *owner_id) +static int animdata_filter_fcurves (ListBase *anim_data, bDopeSheet *ads, FCurve *first, bActionGroup *grp, void *owner, short ownertype, int filter_mode, ID *owner_id) { bAnimListElem *ale = NULL; FCurve *fcu; @@ -686,6 +687,35 @@ static int animdata_filter_fcurves (ListBase *anim_data, FCurve *first, bActionG * NOTE: we need to check if the F-Curves belong to the same group, as this gets called for groups too... */ for (fcu= first; ((fcu) && (fcu->grp==grp)); fcu= fcu->next) { + /* special exception for Pose-Channel Based F-Curves: + * - the 'Only Selected' data filter should be applied to Pose-Channel data too, but those are + * represented as F-Curves. The way the filter for objects worked was to be the first check + * after 'normal' visibility, so this is done first here too... + * - we currently use an 'approximate' method for getting these F-Curves that doesn't require + * carefully checking the entire path + * - this will also affect things like Drivers, and also works for Bone Constraints + */ + if ( ((ads) && (ads->filterflag & ADS_FILTER_ONLYSEL)) && + ((owner_id) && (GS(owner_id->name) == ID_OB)) ) + { + Object *ob= (Object *)owner_id; + + /* only consider if F-Curve involves pose_channels */ + if ((fcu->rna_path) && strstr(fcu->rna_path, "pose_channels")) { + bPoseChannel *pchan; + char *bone_name; + + /* get bone-name, and check if this bone is selected */ + bone_name= BLI_getQuotedStr(fcu->rna_path, "pose_channels["); + pchan= get_pose_channel(ob->pose, bone_name); + if (bone_name) MEM_freeN(bone_name); + + /* can only add this F-Curve if it is selected */ + if ((pchan) && (pchan->bone) && (pchan->bone->flag & BONE_SELECTED)==0) + continue; + } + } + /* only include if visible (Graph Editor check, not channels check) */ if (!(filter_mode & ANIMFILTER_CURVEVISIBLE) || (fcu->flag & FCURVE_VISIBLE)) { /* only work with this channel and its subchannels if it is editable */ @@ -710,7 +740,7 @@ static int animdata_filter_fcurves (ListBase *anim_data, FCurve *first, bActionG return items; } -static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter_mode, void *owner, short ownertype, ID *owner_id) +static int animdata_filter_action (ListBase *anim_data, bDopeSheet *ads, bAction *act, int filter_mode, void *owner, short ownertype, ID *owner_id) { bAnimListElem *ale=NULL; bActionGroup *agrp; @@ -718,16 +748,21 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter int items = 0; /* loop over groups */ - // XXX in future, we need to be prepared for nestled groups... + // TODO: in future, should we expect to need nested groups? for (agrp= act->groups.first; agrp; agrp= agrp->next) { + ListBase tmp_channels = {NULL, NULL}; + short grp_channel=0; + int tmp_items = 0; + + /* add this group as a channel first */ if ((filter_mode & ANIMFILTER_CHANNELS) || !(filter_mode & ANIMFILTER_CURVESONLY)) { /* check if filtering by selection */ if ( ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) ) { ale= make_new_animlistelem(agrp, ANIMTYPE_GROUP, NULL, ANIMTYPE_NONE, owner_id); if (ale) { - BLI_addtail(anim_data, ale); - items++; + BLI_addtail(&tmp_channels, ale); + grp_channel=1; } } } @@ -758,28 +793,30 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter { if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { // XXX the 'owner' info here needs review... - items += animdata_filter_fcurves(anim_data, agrp->channels.first, agrp, owner, ownertype, filter_mode, owner_id); - - /* remove group from filtered list if last element is group - * (i.e. only if group had channels, which were all hidden) - */ - // XXX this is really hacky... it should be fixed in a much more elegant way! - if ( (ale) && (anim_data->last == ale) && - (ale->data == agrp) && (agrp->channels.first) ) - { - BLI_freelinkN(anim_data, ale); - items--; - } + tmp_items += animdata_filter_fcurves(&tmp_channels, ads, agrp->channels.first, agrp, owner, ownertype, filter_mode, owner_id); } } } } + + /* check group had any F-Curves visible */ + // TODO: this needs more work to truly work so that closed group with no visible channels, and visible group with visible channels are differentiated between + if (/*tmp_items*/1) { + /* add the temp channels to the list of filtered channels */ + addlisttolist(anim_data, &tmp_channels); + + /* increase the counts as appropriate */ + items += tmp_items + grp_channel; + } + else { + BLI_freelistN(&tmp_channels); + } } /* loop over un-grouped F-Curves (only if we're not only considering those channels in the animive group) */ if (!(filter_mode & ANIMFILTER_ACTGROUPED)) { // XXX the 'owner' info here needs review... - items += animdata_filter_fcurves(anim_data, (lastchan)?(lastchan->next):(act->curves.first), NULL, owner, ownertype, filter_mode, owner_id); + items += animdata_filter_fcurves(anim_data, ads, (lastchan)?(lastchan->next):(act->curves.first), NULL, owner, ownertype, filter_mode, owner_id); } /* return the number of items added to the list */ @@ -794,7 +831,7 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter * - for normal filtering (i.e. for editing), we only need the NLA-tracks but they can be in 'normal' evaluation * order, i.e. first to last. Otherwise, some tools may get screwed up. */ -static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id) +static int animdata_filter_nla (ListBase *anim_data, bDopeSheet *ads, AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id) { bAnimListElem *ale; NlaTrack *nlt; @@ -996,9 +1033,9 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, if (FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) { ANIMDATA_FILTER_CASES(ma, { /* AnimData blocks - do nothing... */ }, - items += animdata_filter_nla(anim_data, ma->adt, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);, - items += animdata_filter_fcurves(anim_data, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);, - items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);) + items += animdata_filter_nla(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(anim_data, ads, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);) } } } @@ -1056,9 +1093,9 @@ static int animdata_filter_dopesheet_particles (ListBase *anim_data, bDopeSheet if (FILTER_PART_OBJD(psys->part) || (filter_mode & ANIMFILTER_CURVESONLY)) { ANIMDATA_FILTER_CASES(psys->part, { /* AnimData blocks - do nothing... */ }, - items += animdata_filter_nla(anim_data, psys->part->adt, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);, - items += animdata_filter_fcurves(anim_data, psys->part->adt->drivers.first, NULL, psys->part, ANIMTYPE_DSPART, filter_mode, (ID *)psys->part);, - items += animdata_filter_action(anim_data, psys->part->adt->action, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);) + items += animdata_filter_nla(anim_data, ads, psys->part->adt, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);, + items += animdata_filter_fcurves(anim_data, ads, psys->part->adt->drivers.first, NULL, psys->part, ANIMTYPE_DSPART, filter_mode, (ID *)psys->part);, + items += animdata_filter_action(anim_data, ads, psys->part->adt->action, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);) } } } @@ -1138,9 +1175,9 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad /* filtering for channels - nla, drivers, keyframes */ ANIMDATA_FILTER_CASES(iat, { /* AnimData blocks - do nothing... */ }, - items+= animdata_filter_nla(anim_data, iat->adt, filter_mode, iat, type, (ID *)iat);, - items+= animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat);, - items += animdata_filter_action(anim_data, iat->adt->action, filter_mode, iat, type, (ID *)iat);) + items+= animdata_filter_nla(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(anim_data, ads, iat->adt->action, filter_mode, iat, type, (ID *)iat);) } /* return the number of items added to the list */ @@ -1182,7 +1219,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B { /* AnimData blocks - do nothing... */ }, { /* nla */ /* add NLA tracks */ - items += animdata_filter_nla(anim_data, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + items += animdata_filter_nla(anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); }, { /* drivers */ /* include drivers-expand widget? */ @@ -1197,7 +1234,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B /* add F-Curve channels (drivers are F-Curves) */ if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) { // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, ob, ANIMTYPE_OBJECT, filter_mode, (ID *)ob); + items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, ob, ANIMTYPE_OBJECT, filter_mode, (ID *)ob); } }, { /* action (keyframes) */ @@ -1213,7 +1250,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B /* add F-Curve channels? */ if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) { // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) - items += animdata_filter_action(anim_data, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); } } ); @@ -1240,7 +1277,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B /* add NLA tracks - only if expanded or so */ if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) - items += animdata_filter_nla(anim_data, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + items += animdata_filter_nla(anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); }, { /* drivers */ /* include shapekey-expand widget? */ @@ -1254,7 +1291,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B /* add channels */ if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) { - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, key, ANIMTYPE_DSSKEY, filter_mode, (ID *)key); + items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, key, ANIMTYPE_DSSKEY, filter_mode, (ID *)key); } }, { /* action (keyframes) */ @@ -1272,7 +1309,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B /* add channels */ if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) { - items += animdata_filter_action(anim_data, adt->action, filter_mode, key, ANIMTYPE_DSSKEY, (ID *)key); + items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, key, ANIMTYPE_DSSKEY, (ID *)key); } } ); @@ -1384,14 +1421,14 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads if ( (EXPANDED_SCEC(sce) == 0) && !(filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) ) return items; - /* Action, Drivers, or NLA for Scene */ + /* Action, Drivers, or NLA for Scene */ if ((ads->filterflag & ADS_FILTER_NOSCE) == 0) { adt= sce->adt; ANIMDATA_FILTER_CASES(sce, { /* AnimData blocks - do nothing... */ }, { /* nla */ /* add NLA tracks */ - items += animdata_filter_nla(anim_data, adt, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); + items += animdata_filter_nla(anim_data, ads, adt, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); }, { /* drivers */ /* include drivers-expand widget? */ @@ -1405,7 +1442,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads /* add F-Curve channels (drivers are F-Curves) */ if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) { - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, sce, ANIMTYPE_SCENE, filter_mode, (ID *)sce); + items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, sce, ANIMTYPE_SCENE, filter_mode, (ID *)sce); } }, { /* action */ @@ -1420,7 +1457,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads /* add F-Curve channels? */ if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) { - items += animdata_filter_action(anim_data, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); + items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); } } ) @@ -1434,7 +1471,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads { /* AnimData blocks - do nothing... */ }, { /* nla */ /* add NLA tracks */ - items += animdata_filter_nla(anim_data, adt, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); + items += animdata_filter_nla(anim_data, ads, adt, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); }, { /* drivers */ /* include world-expand widget? */ @@ -1449,7 +1486,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads /* add F-Curve channels (drivers are F-Curves) */ if (FILTER_WOR_SCED(wo)/*EXPANDED_DRVD(adt)*/ || !(filter_mode & ANIMFILTER_CHANNELS)) { // XXX owner info is messed up now... - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, wo, ANIMTYPE_DSWOR, filter_mode, (ID *)wo); + items += animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, wo, ANIMTYPE_DSWOR, filter_mode, (ID *)wo); } }, { /* action */ @@ -1464,12 +1501,14 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads /* add channels */ if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) { - items += animdata_filter_action(anim_data, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); + items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); } } ) } + // TODO: scene compositing nodes (these aren't standard node-trees) + /* return the number of items added to the list */ return items; } @@ -1861,7 +1900,7 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode /* firstly filter the data */ switch (datatype) { case ANIMCONT_ACTION: - items= animdata_filter_action(anim_data, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact); + items= animdata_filter_action(anim_data, NULL, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact); break; case ANIMCONT_SHAPEKEY: diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 1590aa57463..088fddd2e7e 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -93,30 +93,6 @@ int geticon_anim_blocktype(short blocktype) } } -/* helper function for getname_*() - grabs the text within the "" that starts with 'blahblah' - * i.e. for string 'pose["apples"]' with prefix 'pose[', it should grab "apples" - * - * - str: is the entire string to chop - * - prefix: is the part of the string to leave out - * - * Assume that the strings returned must be freed afterwards, and that the inputs will contain - * data we want... - */ -static char *grab_quoted_text (const char *str, const char *prefix) -{ - int prefixLen = strlen(prefix); - char *startMatch, *endMatch; - - /* get the starting point (i.e. where prefix starts, and add prefixLen+1 to it to get be after the first " */ - startMatch= strstr(str, prefix) + prefixLen + 1; - - /* get the end point (i.e. where the next occurance of " is after the starting point) */ - endMatch= strchr(startMatch, '"'); // " NOTE: this comment here is just so that my text editor still shows the functions ok... - - /* return the slice indicated */ - return BLI_strdupn(startMatch, (int)(endMatch-startMatch)); -} - /* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings) * WARNING: name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.c for details) */ @@ -164,8 +140,8 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu) */ if (strstr(fcu->rna_path, "pose_channels") && strstr(fcu->rna_path, "constraints")) { /* perform string 'chopping' to get "Bone Name : Constraint Name" */ - char *pchanName= grab_quoted_text(fcu->rna_path, "pose_channels["); - char *constName= grab_quoted_text(fcu->rna_path, "constraints["); + char *pchanName= BLI_getQuotedStr(fcu->rna_path, "pose_channels["); + char *constName= BLI_getQuotedStr(fcu->rna_path, "constraints["); /* assemble the string to display in the UI... */ structname= BLI_sprintfN("%s : %s", pchanName, constName); |