Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesdna/DNA_ID.h
| Show First 20 Lines • Show All 386 Lines • ▼ Show 20 Lines | typedef struct ID { | ||||
| * | * | ||||
| * - When this #ID is deleted, the #BPy_StructRNA can be invalidated | * - When this #ID is deleted, the #BPy_StructRNA can be invalidated | ||||
| * so accessing it from Python raises an exception instead of crashing. | * so accessing it from Python raises an exception instead of crashing. | ||||
| * | * | ||||
| * This is of limited benefit though, as it doesn't apply to non #ID data | * This is of limited benefit though, as it doesn't apply to non #ID data | ||||
| * that references this ID (the bones of an armature or the modifiers of an object for e.g.). | * that references this ID (the bones of an armature or the modifiers of an object for e.g.). | ||||
| */ | */ | ||||
| void *py_instance; | void *py_instance; | ||||
| void *_pad1; | |||||
| /** | |||||
| * Weak reference to an ID in a given library file, used to allow re-using already appended data | |||||
| * in some cases, instead of appending it again. | |||||
| * | |||||
| * May be NULL. | |||||
| */ | |||||
| struct LibraryWeakReference *library_weak_reference; | |||||
| } ID; | } ID; | ||||
| /** | /** | ||||
| * For each library file used, a Library struct is added to Main | * For each library file used, a Library struct is added to Main | ||||
| * WARNING: readfile.c, expand_doit() reads this struct without DNA check! | * WARNING: readfile.c, expand_doit() reads this struct without DNA check! | ||||
| */ | */ | ||||
| typedef struct Library { | typedef struct Library { | ||||
| ID id; | ID id; | ||||
| Show All 17 Lines | typedef struct Library { | ||||
| struct PackedFile *packedfile; | struct PackedFile *packedfile; | ||||
| /* Temp data needed by read/write code, and liboverride recursive resync. */ | /* Temp data needed by read/write code, and liboverride recursive resync. */ | ||||
| int temp_index; | int temp_index; | ||||
| /** See BLENDER_FILE_VERSION, BLENDER_FILE_SUBVERSION, needed for do_versions. */ | /** See BLENDER_FILE_VERSION, BLENDER_FILE_SUBVERSION, needed for do_versions. */ | ||||
| short versionfile, subversionfile; | short versionfile, subversionfile; | ||||
| } Library; | } Library; | ||||
| /** | |||||
| * A weak library/ID reference for local data that has been appended, to allow re-using that local | |||||
| * data instead of creating a new copy of it in future appends. | |||||
| * | |||||
| * NOTE: This is by design a week reference, in other words code should be totally fine and perform | |||||
| * a regular append if it cannot find a valid matching local ID. | |||||
| * | |||||
| * NOTE: There should always be only one single ID in current Main matching a given linked | |||||
campbellbarton: *picky* use `NOTE:` | |||||
| * reference. | |||||
| */ | |||||
| typedef struct LibraryWeakReference { | |||||
| /** Expected to match a `Library.filepath`. */ | |||||
| char library_filepath[1024]; | |||||
| /** MAX_ID_NAME. May be different from the current local ID name. */ | |||||
| char library_id_name[66]; | |||||
| char _pad[2]; | |||||
| } LibraryWeakReference; | |||||
| /* for PreviewImage->flag */ | /* for PreviewImage->flag */ | ||||
| enum ePreviewImage_Flag { | enum ePreviewImage_Flag { | ||||
| PRV_CHANGED = (1 << 0), | PRV_CHANGED = (1 << 0), | ||||
| PRV_USER_EDITED = (1 << 1), /* if user-edited, do not auto-update this anymore! */ | PRV_USER_EDITED = (1 << 1), /* if user-edited, do not auto-update this anymore! */ | ||||
| PRV_UNFINISHED = (1 << 2), /* The preview is not done rendering yet. */ | PRV_UNFINISHED = (1 << 2), /* The preview is not done rendering yet. */ | ||||
| }; | }; | ||||
| /* for PreviewImage->tag */ | /* for PreviewImage->tag */ | ||||
| ▲ Show 20 Lines • Show All 523 Lines • Show Last 20 Lines | |||||
*picky* use NOTE: