Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesdna/DNA_collection_types.h
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | typedef struct Collection { | ||||
| struct PreviewImage *preview; | struct PreviewImage *preview; | ||||
| unsigned int layer DNA_DEPRECATED; | unsigned int layer DNA_DEPRECATED; | ||||
| float instance_offset[3]; | float instance_offset[3]; | ||||
| short flag; | short flag; | ||||
| /* Runtime-only, always cleared on file load. */ | /* Runtime-only, always cleared on file load. */ | ||||
| short tag; | short tag; | ||||
| char _pad[4]; | |||||
| short color; | |||||
Severin: Better call this `color_id` to make clear in the name that this is not the actual color. It's… | |||||
| char _pad[2]; | |||||
| /* Runtime. Cache of objects in this collection and all its | /* Runtime. Cache of objects in this collection and all its | ||||
| * children. This is created on demand when e.g. some physics | * children. This is created on demand when e.g. some physics | ||||
| * simulation needs it, we don't want to have it for every | * simulation needs it, we don't want to have it for every | ||||
| * collections due to memory usage reasons. */ | * collections due to memory usage reasons. */ | ||||
| ListBase object_cache; | ListBase object_cache; | ||||
| /* Runtime. List of collections that are a parent of this | /* Runtime. List of collections that are a parent of this | ||||
| Show All 17 Lines | |||||
| /* Collection->tag */ | /* Collection->tag */ | ||||
| enum { | enum { | ||||
| /* That code (BKE_main_collections_parent_relations_rebuild and the like) | /* That code (BKE_main_collections_parent_relations_rebuild and the like) | ||||
| * is called from very low-level places, like e.g ID remapping... | * is called from very low-level places, like e.g ID remapping... | ||||
| * Using a generic tag like LIB_TAG_DOIT for this is just impossible, we need our very own. */ | * Using a generic tag like LIB_TAG_DOIT for this is just impossible, we need our very own. */ | ||||
| COLLECTION_TAG_RELATION_REBUILD = (1 << 0), | COLLECTION_TAG_RELATION_REBUILD = (1 << 0), | ||||
| }; | }; | ||||
| /* Collection->color */ | |||||
| enum { | |||||
| COLLECTION_COLOR_NONE = 0, | |||||
SeverinUnsubmitted Done Inline ActionsWhy not use -1 from the get-go for this, like you suggested? Severin: Why not use -1 from the get-go for this, like you suggested? | |||||
| COLLECTION_COLOR_01 = 1, | |||||
| COLLECTION_COLOR_02 = 2, | |||||
| COLLECTION_COLOR_03 = 3, | |||||
| COLLECTION_COLOR_04 = 4, | |||||
| COLLECTION_COLOR_05 = 5, | |||||
| COLLECTION_COLOR_06 = 6, | |||||
| COLLECTION_COLOR_07 = 7, | |||||
| COLLECTION_COLOR_08 = 8, | |||||
| }; | |||||
Better call this color_id to make clear in the name that this is not the actual color. It's also not clear at all what this relates to. So I'd suggest giving the enum a name, say CollectionColorID and using that named type here (CollectionColorID color_id;). Since the enum definition is in the same header, that will work.