Allow renaming F-curve modifier #104949
|
@ -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
|
||||
|
|
|
@ -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. */
|
||||
|
||||
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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
It's unclear how calling
BKE_fmodifier_name_set(fcm, "")
(so with an emptyname
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.Updated code comments. This is handled within BLI_uniquename (see defname parameter).