当前位置: 首页>>代码示例>>Python>>正文


Python Sequence.create方法代码示例

本文整理汇总了Python中conductor.native.lib.sequence.Sequence.create方法的典型用法代码示例。如果您正苦于以下问题:Python Sequence.create方法的具体用法?Python Sequence.create怎么用?Python Sequence.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在conductor.native.lib.sequence.Sequence的用法示例。


在下文中一共展示了Sequence.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: scout_frame_sequence

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
def scout_frame_sequence(node):
    """Generate Sequence from value in scout_frames parm."""
    try:
        spec = node.parm("scout_frames").eval()
        return Sequence.create(spec)
    except (ValueError, TypeError):
        return None
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:9,代码来源:frame_spec_ui.py

示例2: test_counts_from_1_to_10

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_counts_from_1_to_10(self):
     s = Sequence.create("1-10")
     ss = s.subsample(1)
     self.assertEqual(len(ss), 1)
     self.assertEqual(list(ss), [6])
     ss = s.subsample(2)
     self.assertEqual(len(ss), 2)
     self.assertEqual(list(ss), [3, 8])
     ss = s.subsample(3)
     self.assertEqual(len(ss), 3)
     self.assertEqual(list(ss), [2, 6, 9])
     ss = s.subsample(4)
     self.assertEqual(len(ss), 4)
     self.assertEqual(list(ss), [2, 4, 7, 9])
     ss = s.subsample(5)
     self.assertEqual(len(ss), 5)
     self.assertEqual(list(ss), [2, 4, 6, 8, 10])
     ss = s.subsample(6)
     self.assertEqual(len(ss), 6)
     self.assertEqual(list(ss), [1, 3, 5, 6, 8, 10])
     ss = s.subsample(7)
     self.assertEqual(len(ss), 7)
     self.assertEqual(list(ss), [1, 3, 4, 6, 7, 8, 10])
     ss = s.subsample(8)
     self.assertEqual(len(ss), 8)
     self.assertEqual(list(ss), [1, 2, 4, 5, 6, 7, 9, 10])
     ss = s.subsample(9)
     self.assertEqual(len(ss), 9)
     self.assertEqual(list(ss), [1, 2, 3, 4, 6, 7, 8, 9, 10])
     ss = s.subsample(10)
     self.assertEqual(len(ss), 10)
     self.assertEqual(list(ss), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
     ss = s.subsample(11)
     self.assertEqual(len(ss), 10)
     self.assertEqual(list(ss), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:37,代码来源:test_sequence.py

示例3: test_best_chunk_size

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_best_chunk_size(self):
     s = Sequence.create("1-100")
     s.chunk_size = 76
     self.assertEqual(s.best_chunk_size(), 50)
     s.chunk_size = 37
     self.assertEqual(s.best_chunk_size(), 34)
     s.chunk_size = 100
     self.assertEqual(s.best_chunk_size(), 100)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:10,代码来源:test_sequence.py

示例4: test_chunk_count

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_chunk_count(self):
     s = Sequence.create("1-100")
     s.chunk_size = 7
     self.assertEqual(s.chunk_count(), 15)
     s.chunk_size = 15
     self.assertEqual(s.chunk_count(), 7)
     s.chunk_size = 10
     self.assertEqual(s.chunk_count(), 10)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:10,代码来源:test_sequence.py

示例5: test_include_parts_of_sequence_that_exist

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
    def test_include_parts_of_sequence_that_exist(self):
        seq = Sequence.create("96-105")
        result = [
            f for f in dependency_scan.fetch(
                self.node, seq, 3) if f.startswith("/path/to/shader3")]

        self.assertIn("/path/to/shader3/tex.0097.jpg", result)
        self.assertEqual(len(result), 5)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:10,代码来源:test_dependency_scan.py

示例6: test_create_chunks_cycle

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_create_chunks_cycle(self):
     s = Sequence.create("1-100")
     s.chunk_size = 10
     s.chunk_strategy = "cycle"
     chunks = s.chunks()
     self.assertEqual(list(chunks[0]), list(range(1, 100, 10)))
     s.chunk_size = 7
     chunks = s.chunks()
     self.assertEqual(list(chunks[0]), list(range(1, 100, 15)))
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:11,代码来源:test_sequence.py

示例7: _attribute_sequence

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
def _attribute_sequence(attr, **kw):
    """Get the sequence associated with a filename attribute.

    Many attributes have an associated sequence_mode attribute, which
    when set to 1 signifies varying frames, and makes availabel start,
    end, and offset attributes to help specify the sequence.

    If the keyword intersector is given, then work out the intersection
    with it. Why? Because during dependency scanning, we can optimize
    the number of frames to upload if we use only those frames specified
    in the sequence attribute, and intersect them with the frame range
    specified in the job node.
    """
    intersector = kw.get("intersector")

    obj = attr.get_parent_object()
    mode_attr = obj.attribute_exists("sequence_mode")
    if not (mode_attr and mode_attr.get_long()):
        ix.log_error("Attribute is not a sequence mode")

    global_frame_rate = ix.application.get_prefs(
        ix.api.AppPreferences.MODE_APPLICATION).get_long_value(
            "animation", "frames_per_second")
    attr_frame_rate = obj.get_attribute("frame_rate").get_long()
    if not attr_frame_rate == global_frame_rate:
        ix.log_error(
            "Can't get attribute sequence when global \
            fps is different from fps on the attribute")

    start = obj.get_attribute("start_frame").get_long()
    end = obj.get_attribute("end_frame").get_long()



    if intersector:
        # If there's a frame offset on the attribute, then we need to 
        # do the intersection in the context of that offset.
        offset = obj.get_attribute("frame_offset").get_long()
        return Sequence.create(start, end, 1).offset(
            offset).intersection(intersector).offset(-offset)

    return Sequence.create(start, end, 1)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:44,代码来源:dependencies.py

示例8: range_frame_sequence

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
def range_frame_sequence(node):
    """Generate Sequence from value in the standard range parmTuple."""
    try:
        chunk = _chunk_parameters(node)
        start, end, step = node.parmTuple("fs").eval()
        return Sequence.create(
            start, end, step,
            chunk_size=chunk["size"],
            chunk_strategy=chunk["strategy"])
    except (ValueError, TypeError):
        return None
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:13,代码来源:frame_spec_ui.py

示例9: custom_frame_sequence

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
def custom_frame_sequence(node):
    """Generate Sequence from value in custom_range parm."""
    try:
        spec = node.parm("custom_range").eval()
        chunk = _chunk_parameters(node)
        return Sequence.create(
            spec,
            chunk_size=chunk["size"],
            chunk_strategy=chunk["strategy"]
        )
    except (ValueError, TypeError):
        return None
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:14,代码来源:frame_spec_ui.py

示例10: _get_sources

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
    def _get_sources(self):
        """Get the images, along with associated Sequence objects.

        If we are not rendering a custom range, then the sequence for
        each image may be different.
        """

        images = ix.api.OfObjectArray()
        self.node.get_attribute("images").get_values(images)

        use_custom = self.node.get_attribute("use_custom_frames").get_bool()

        # cast to list because OfObjectArray is true even when empty.
        if not list(images):
            ix.log_error(
                "No render images. Please reference one or more image items")
        seq = self.sequence["main"]
        result = []
        for image in images:
            if not use_custom:
                seq = Sequence.create(*frames_ui.image_range(image))
            result.append({"image": image, "sequence": seq})
        return result
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:25,代码来源:job.py

示例11: test_create_from_start_only

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_create_from_start_only(self):
     s = Sequence.create(1)
     self.assertEqual(s.start, 1)
     self.assertEqual(s.end, 1)
     self.assertEqual(s.step, 1)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:7,代码来源:test_sequence.py

示例12: test_bad_spec_step

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_bad_spec_step(self):
     with self.assertRaises(ValueError):
         Sequence.create("1-10xf")
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:5,代码来源:test_sequence.py

示例13: test_bad_spec

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_bad_spec(self):
     with self.assertRaises(ValueError):
         Sequence.create("f")
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:5,代码来源:test_sequence.py

示例14: test_invalid_template_raises

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def test_invalid_template_raises(self):
     s = Sequence.create("8-12")
     template = "image.26.exr"
     with self.assertRaises(ValueError):
         s.expand(template)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:7,代码来源:test_sequence.py

示例15: setUp

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import create [as 别名]
 def setUp(self):
     self.seq = Sequence.create("1-10")
     self.node = hou.node("job1")
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:5,代码来源:test_dependency_scan.py


注:本文中的conductor.native.lib.sequence.Sequence.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。