Page MenuHome

Fix versioning for sequencer color balance modifier.
ClosedPublic

Authored by Josef Raschen (JosefR) on Oct 9 2021, 1:20 PM.

Details

Summary

My last patch adding slope/offset/power controls to the sequencer color balance modifier (D12575) was not setting the defaults for old blend files correctly.

Before, if the old file is using a color balance modifier that is then changed to SOP mode:

With this patch:

Diff Detail

Event Timeline

Josef Raschen (JosefR) requested review of this revision.Oct 9 2021, 1:20 PM
Josef Raschen (JosefR) created this revision.
Richard Antalik (ISS) requested changes to this revision.Oct 11 2021, 10:58 AM

Seems to work Ok, got just minor requests.

source/blender/blenloader/intern/versioning_300.c
465–469

You can do

copy_v3_fl(cb->slope, 1.0f);
copy_v3_fl(cb->offset, 1.0f);
copy_v3_fl(cb->power, 1.0f);
1712–1713

you should include new versioning code at the end of do_versions function inside block

{
  /* Keep this block, even when empty. */
}

Since subversion number can increase often I rather do this manually when committing anyway.

This revision now requires changes to proceed.Oct 11 2021, 10:58 AM

@Richard Antalik (ISS)
Changes as requested. Is it OK to keep the change within the v31 subversion block or shall it be moved out completely? I think this should match to when the original patch was submitted.

@Richard Antalik (ISS)
Changes as requested. Is it OK to keep the change within the v31 subversion block or shall it be moved out completely? I think this should match to when the original patch was submitted.

I guess you are correct in that this should be added to older version when D12575 was committed. Otherwise you would have to check if the fields are uninitalized which is not done in this patch... And yes, BLENDER_FILE_SUBVERSION was set to 31 at the time so this is correct. Sorry for misleading you.

So should be OK to go. Thanks for patch!

This revision is now accepted and ready to land.Oct 13 2021, 10:09 PM
Josef Raschen (JosefR) marked 2 inline comments as done.Oct 13 2021, 11:09 PM

So should be OK to go. Thanks for patch!

Great, we have to thank @Peter Fog (tintwotin) for noticing that.