Allow renaming F-curve modifier #104949

Merged
Pratik Borhade merged 7 commits from PratikPB2123/blender:T103855-rename-fmodifier into main 2023-05-02 13:07:55 +02:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit 91e27b96eb - Show all commits

View File

@ -25,7 +25,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 5
#define BLENDER_FILE_SUBVERSION 6
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file

View File

@ -4283,6 +4283,17 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
}
}
/* Set fcurve modifier name and check their uniqueness when opening old files. Otherwise
* modifiers would have empty name field. */

It's unclear how calling BKE_fmodifier_name_set(fcm, "") (so with an empty name parameter) would avoid modifiers having an empty name.

If this triggers some kind of special behaviour of BKE_fmodifier_name_set(), that should be mentioned in that function's documentation.

It's unclear how calling `BKE_fmodifier_name_set(fcm, "")` (so with an empty `name` parameter) would avoid modifiers having an empty name. If this triggers some kind of special behaviour of `BKE_fmodifier_name_set()`, that should be mentioned in that function's documentation.

It's unclear how calling BKE_fmodifier_name_set(fcm, "") (so with an empty name parameter) would avoid modifiers having an empty name.

Updated code comments. This is handled within BLI_uniquename (see defname parameter).

> It's unclear how calling BKE_fmodifier_name_set(fcm, "") (so with an empty name parameter) would avoid modifiers having an empty name. Updated code comments. This is handled within BLI_uniquename (see defname parameter).
if (!MAIN_VERSION_ATLEAST(bmain, 306, 6)) {
LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
LISTBASE_FOREACH (FCurve *, fcu, &act->curves) {
LISTBASE_FOREACH (FModifier *, fcm, &fcu->modifiers) {
BKE_fmodifier_name_set(fcm, "");
}
}
}
}
/**
* Versioning code until next subversion bump goes here.
*