本文整理汇总了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
示例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()