diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-23 02:54:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-23 04:29:36 +0300 |
commit | 716a8241d387180fd8ad69cdec33633bc7a0f963 (patch) | |
tree | d4674969beacfa6f9d50726f5943e050a373f2b5 /source/blender/blenkernel/intern/movieclip.c | |
parent | a573d7e8a14ce5e49b8c05ff762a00e181e905aa (diff) |
Cleanup: rename 'name' to 'filepath' for DNA types
Using 'name' for the full path of a file reads badly,
especially when id.name is used in related code.
Diffstat (limited to 'source/blender/blenkernel/intern/movieclip.c')
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index fe7c2055aef..f0efc9b8c50 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -220,19 +220,19 @@ static void get_sequence_fname(const MovieClip *clip, const int framenr, char *n char head[FILE_MAX], tail[FILE_MAX]; int offset; - BLI_strncpy(name, clip->name, sizeof(clip->name)); + BLI_strncpy(name, clip->filepath, sizeof(clip->filepath)); BLI_path_sequence_decode(name, head, tail, &numlen); /* Movie-clips always points to first image from sequence, auto-guess offset for now. * Could be something smarter in the future. */ - offset = sequence_guess_offset(clip->name, strlen(head), numlen); + offset = sequence_guess_offset(clip->filepath, strlen(head), numlen); if (numlen) { BLI_path_sequence_encode( name, head, tail, numlen, offset + framenr - clip->start_frame + clip->frame_offset); } else { - BLI_strncpy(name, clip->name, sizeof(clip->name)); + BLI_strncpy(name, clip->filepath, sizeof(clip->filepath)); } BLI_path_abs(name, ID_BLEND_PATH_FROM_GLOBAL(&clip->id)); @@ -246,7 +246,7 @@ static void get_proxy_fname( char dir[FILE_MAX], clipdir[FILE_MAX], clipfile[FILE_MAX]; int proxynr = framenr - clip->start_frame + 1 + clip->frame_offset; - BLI_split_dirfile(clip->name, clipdir, clipfile, FILE_MAX, FILE_MAX); + BLI_split_dirfile(clip->filepath, clipdir, clipfile, FILE_MAX, FILE_MAX); if (clip->flag & MCLIP_USE_PROXY_CUSTOM_DIR) { BLI_strncpy(dir, clip->proxy.dir, sizeof(dir)); @@ -395,7 +395,7 @@ static void movieclip_open_anim_file(MovieClip *clip) char str[FILE_MAX]; if (!clip->anim) { - BLI_strncpy(str, clip->name, FILE_MAX); + BLI_strncpy(str, clip->filepath, FILE_MAX); BLI_path_abs(str, ID_BLEND_PATH_FROM_GLOBAL(&clip->id)); /* FIXME: make several stream accessible in image editor, too */ @@ -445,7 +445,7 @@ static void movieclip_calc_length(MovieClip *clip) unsigned short numlen; char name[FILE_MAX], head[FILE_MAX], tail[FILE_MAX]; - BLI_path_sequence_decode(clip->name, head, tail, &numlen); + BLI_path_sequence_decode(clip->filepath, head, tail, &numlen); if (numlen == 0) { /* there's no number group in file name, assume it's single framed sequence */ @@ -531,10 +531,10 @@ static int user_frame_to_cache_frame(MovieClip *clip, int framenr) unsigned short numlen; char head[FILE_MAX], tail[FILE_MAX]; - BLI_path_sequence_decode(clip->name, head, tail, &numlen); + BLI_path_sequence_decode(clip->filepath, head, tail, &numlen); /* see comment in get_sequence_fname */ - clip->cache->sequence_offset = sequence_guess_offset(clip->name, strlen(head), numlen); + clip->cache->sequence_offset = sequence_guess_offset(clip->filepath, strlen(head), numlen); } index += clip->cache->sequence_offset; @@ -674,7 +674,7 @@ static bool put_imbuf_cache( clip->cache->sequence_offset = -1; if (clip->source == MCLIP_SRC_SEQUENCE) { unsigned short numlen; - BLI_path_sequence_decode(clip->name, NULL, NULL, &numlen); + BLI_path_sequence_decode(clip->filepath, NULL, NULL, &numlen); clip->cache->is_still_sequence = (numlen == 0); } } @@ -758,7 +758,7 @@ static void detect_clip_source(Main *bmain, MovieClip *clip) ImBuf *ibuf; char name[FILE_MAX]; - BLI_strncpy(name, clip->name, sizeof(name)); + BLI_strncpy(name, clip->filepath, sizeof(name)); BLI_path_abs(name, BKE_main_blendfile_path(bmain)); ibuf = IMB_testiffname(name, IB_rect | IB_multilayer); @@ -795,7 +795,7 @@ MovieClip *BKE_movieclip_file_add(Main *bmain, const char *name) /* create a short library name */ clip = movieclip_alloc(bmain, BLI_path_basename(name)); - BLI_strncpy(clip->name, name, sizeof(clip->name)); + BLI_strncpy(clip->filepath, name, sizeof(clip->filepath)); detect_clip_source(bmain, clip); @@ -821,7 +821,7 @@ MovieClip *BKE_movieclip_file_add_exists_ex(Main *bmain, const char *filepath, b /* first search an identical filepath */ for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { - BLI_strncpy(strtest, clip->name, sizeof(clip->name)); + BLI_strncpy(strtest, clip->filepath, sizeof(clip->filepath)); BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &clip->id)); if (BLI_path_cmp(strtest, str) == 0) { @@ -1739,7 +1739,7 @@ void BKE_movieclip_filename_for_frame(MovieClip *clip, MovieClipUser *user, char } } else { - BLI_strncpy(name, clip->name, FILE_MAX); + BLI_strncpy(name, clip->filepath, FILE_MAX); BLI_path_abs(name, ID_BLEND_PATH_FROM_GLOBAL(&clip->id)); } } |