Page MenuHome

Cleanup: TimeMarker flags now have their own enum
Needs RevisionPublic

Authored by Colin Basnett (cmbasnett) on Aug 15 2022, 7:32 PM.

Details

Summary

There is a new enum type, eTimeMarkerFlags, that holds all the
possible marker flag values.

For back compatibility, the value of TIME_MARKER_FLAG_SELECTED matches
the global flag SELECTED.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 23353
Build 23353: arc lint + arc unit

Event Timeline

Colin Basnett (cmbasnett) requested review of this revision.Aug 15 2022, 7:32 PM
Colin Basnett (cmbasnett) created this revision.

Prefer to keep SELECT, as this convention is typical for selectable elements in DNA, just note in the enum definition that (1 << 0) is reserved for SELECT.

It looks like TIME_MARKER_FLAG_ACTIVE is never set. As far as I can tell it's an error that marker_get_icon_id even checks it (perhaps it made sense when added, would need to check history, nevertheless, it's not set now), it can be removed as part of a separate patch.

Campbell Barton (campbellbarton) requested changes to this revision.Aug 16 2022, 2:05 AM
This revision now requires changes to proceed.Aug 16 2022, 2:05 AM
Campbell Barton (campbellbarton) requested changes to this revision.Sep 1 2022, 1:37 AM
Campbell Barton (campbellbarton) added inline comments.
source/blender/makesdna/DNA_scene_types.h
858

There should be a doc-string describing what the flag is for, as this is a run-time tag, it could be called: TIME_MARKER_FLAG_TAG, with a note that it's expected to be cleared after use.

This revision now requires changes to proceed.Sep 1 2022, 1:37 AM

*Edit* noticed this is operating on a copy of the markers, using a flag in this case seems OK, .

source/blender/editors/animation/anim_markers.c
643–645

Unrelated to this patch, clearing this flag seems unnecessary, this is operating on a copy of the markers.