2026-01-01
This commit is contained in:
@@ -25,6 +25,7 @@ project.
|
||||
|
||||
import bpy
|
||||
import os
|
||||
from ..utils import version, compat
|
||||
|
||||
|
||||
def get_missing(data):
|
||||
@@ -37,12 +38,29 @@ def get_missing(data):
|
||||
do_not_flag = ["Render Result", "Viewer Node", "D-NOISE Export"]
|
||||
|
||||
for datablock in data:
|
||||
# Skip library-linked and override datablocks
|
||||
if compat.is_library_or_override(datablock):
|
||||
continue
|
||||
|
||||
# the absolute path to our data-block
|
||||
abspath = bpy.path.abspath(datablock.filepath)
|
||||
|
||||
# Check if data-block is packed
|
||||
# Blender 5.0+: Image objects use 'packed_files' (plural), Library objects use 'packed_file' (singular)
|
||||
# Blender 4.2/4.5: Both Image and Library objects use 'packed_file' (singular)
|
||||
is_packed = False
|
||||
if version.is_version_at_least(5, 0, 0):
|
||||
# Blender 5.0+: Check type-specific attributes
|
||||
if isinstance(datablock, bpy.types.Image):
|
||||
is_packed = bool(datablock.packed_files) if hasattr(datablock, 'packed_files') else False
|
||||
elif isinstance(datablock, bpy.types.Library):
|
||||
is_packed = bool(datablock.packed_file) if hasattr(datablock, 'packed_file') else False
|
||||
else:
|
||||
# Blender 4.2/4.5: Both use 'packed_file' (singular)
|
||||
is_packed = bool(datablock.packed_file) if hasattr(datablock, 'packed_file') else False
|
||||
|
||||
# if data-block is not packed and has an invalid filepath
|
||||
if not datablock.packed_files and not os.path.isfile(abspath):
|
||||
if not is_packed and not os.path.isfile(abspath):
|
||||
|
||||
# if data-block is not in our do not flag list
|
||||
# append it to the missing data list
|
||||
@@ -50,7 +68,7 @@ def get_missing(data):
|
||||
missing.append(datablock.name)
|
||||
|
||||
# if data-block is packed but it does not have a filepath
|
||||
elif datablock.packed_files and not abspath:
|
||||
elif is_packed and not abspath:
|
||||
|
||||
# if data-block is not in our do not flag list
|
||||
# append it to the missing data list
|
||||
|
||||
Reference in New Issue
Block a user