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


Python Operators.reset方法代码示例

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


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

示例1: lineset_post

# 需要导入模块: from freestyle.types import Operators [as 别名]
# 或者: from freestyle.types.Operators import reset [as 别名]
    def lineset_post(cls, scene, layer, lineset):
        if not cls.poll(scene, lineset.linestyle):
            return

        # reset the stroke selection (but don't delete the already generated strokes)
        Operators.reset(delete_strokes=False)
        # Unary Predicates: visible and correct edge nature
        upred = AndUP1D(
            QuantitativeInvisibilityUP1D(0),
            OrUP1D(ExternalContourUP1D(),
                   pyNatureUP1D(Nature.BORDER)),
            )
        # select the new edges
        Operators.select(upred)
        # Binary Predicates
        bpred = AndBP1D(
            MaterialBP1D(),
            NotBP1D(pyZDiscontinuityBP1D()),
            )
        bpred = OrBP1D(bpred, AndBP1D(NotBP1D(bpred), AndBP1D(SameShapeIdBP1D(), MaterialBP1D())))
        # chain the edges
        Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred))
        # export SVG
        collector = StrokeCollector()
        Operators.create(TrueUP1D(), [collector])

        builder = SVGFillBuilder(create_path(scene), render_height(scene), layer.name + '_' + lineset.name)
        builder.write(collector.strokes)
        # make strokes used for filling invisible
        for stroke in collector.strokes:
            for svert in stroke:
                svert.attribute.visible = False
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:34,代码来源:render_freestyle_svg.py

示例2: lineset_post

# 需要导入模块: from freestyle.types import Operators [as 别名]
# 或者: from freestyle.types.Operators import reset [as 别名]
    def lineset_post(scene, layer, lineset):
        if not (scene.render.use_freestyle and scene.svg_export.use_svg_export and scene.svg_export.object_fill):
            return

        # reset the stroke selection (but don't delete the already generated strokes)
        Operators.reset(delete_strokes=False)
        # shape detection
        upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
        Operators.select(upred)
        # chain when the same shape and visible
        bpred = SameShapeIdBP1D()
        Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
        # sort according to the distance from camera
        Operators.sort(pyZBP1D())
        # render and write fills
        shader = SVGFillShader(create_path(scene), render_height(scene), lineset.name)
        Operators.create(TrueUP1D(), [shader, ])
        shader.write()
开发者ID:miklobit,项目名称:myblenderaddons,代码行数:20,代码来源:render_freestyle_svg.py


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