Added support for Alembic caches.

This commit is contained in:
2017-04-21 11:40:49 +02:00
parent 0304489db0
commit 8994385c63
4 changed files with 31 additions and 0 deletions

View File

@@ -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')

Binary file not shown.

Binary file not shown.

View File

@@ -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)