Added support for Alembic caches.
This commit is contained in:
@@ -581,6 +581,11 @@ class FilePath:
|
|||||||
if block[b'source_mode'] == C_defs.CACHE_LIBRARY_SOURCE_CACHE:
|
if block[b'source_mode'] == C_defs.CACHE_LIBRARY_SOURCE_CACHE:
|
||||||
yield FPElem_block_path(basedir, level, (block, b'input_filepath')), extra_info
|
yield FPElem_block_path(basedir, level, (block, b'input_filepath')), extra_info
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _from_block_CF(block, basedir, extra_info, level):
|
||||||
|
yield FPElem_block_path(basedir, level, (block, b'filepath')), extra_info
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _from_block_SC(block, basedir, extra_info, level):
|
def _from_block_SC(block, basedir, extra_info, level):
|
||||||
block_ed = block.get_pointer(b'ed')
|
block_ed = block.get_pointer(b'ed')
|
||||||
|
BIN
tests/blends/cube-rotating.abc
Normal file
BIN
tests/blends/cube-rotating.abc
Normal file
Binary file not shown.
BIN
tests/blends/cube-rotating.blend
Normal file
BIN
tests/blends/cube-rotating.blend
Normal file
Binary file not shown.
@@ -16,9 +16,11 @@ Run a single test:
|
|||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
import unittest.mock
|
||||||
|
|
||||||
VERBOSE = os.environ.get("VERBOSE", False)
|
VERBOSE = os.environ.get("VERBOSE", False)
|
||||||
if VERBOSE == "0":
|
if VERBOSE == "0":
|
||||||
@@ -1766,6 +1768,30 @@ class BamRemapTest(BamSimpleTestCase):
|
|||||||
self.assertEqual(ret[1][3], "OK")
|
self.assertEqual(ret[1][3], "OK")
|
||||||
|
|
||||||
|
|
||||||
|
class BamDepsTest(unittest.TestCase):
|
||||||
|
@unittest.mock.patch('bam.cli.print')
|
||||||
|
def test_abc_cache_modifier(self, mock_print):
|
||||||
|
from bam.cli import bam_commands
|
||||||
|
|
||||||
|
printed = []
|
||||||
|
|
||||||
|
def record_print(*stuff, sep=' ', end='\n'):
|
||||||
|
printed.append(sep.join(stuff) + end)
|
||||||
|
|
||||||
|
mock_print.side_effect = record_print
|
||||||
|
|
||||||
|
blendpath = Path(__file__).absolute().parent / 'blends' / 'cube-rotating.blend'
|
||||||
|
bam_commands.deps([str(blendpath)], recursive=False, use_json=True)
|
||||||
|
|
||||||
|
output = json.loads(''.join(printed))
|
||||||
|
self.assertEqual([[
|
||||||
|
str(blendpath),
|
||||||
|
'//cube-rotating.abc',
|
||||||
|
str(blendpath.with_name('cube-rotating.abc')),
|
||||||
|
'OK'
|
||||||
|
]], output)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
data = global_setup()
|
data = global_setup()
|
||||||
unittest.main(exit=False)
|
unittest.main(exit=False)
|
||||||
|
Reference in New Issue
Block a user