Page MenuHome

Freestyle method join_upred_predicates missing from rel. 2.71 to 2.72b
Closed, InvalidPublic

Description

System Information
Windows 7 Pro

Blender Version
Broken: 2.72b
Worked: 2.71

Short description of error
method join_upred_predicates deleted in module predicates.py. This leads to crash of "Freestyle SVG export" scripts

Exact steps for others to reproduce the error

  • Create some model
  • Use Freestyle rendering
  • Use one of the "Freestyle SVG export" scripts (svg_*.py)
  • render (Blender / Cycles)

> In Blender render freestyle blacklining does not happen, in Cycles screen simply stays black, error message hinting to missing join_upred_predicates

Details

Type
Bug

Event Timeline

Wolfgang Geithner (wgeithner) raised the priority of this task from to Needs Triage by Developer.

Tamito, you should know whether this is a bug or expected API change? Thanks for checking.

Bastien Montagne (mont29) triaged this task as Normal priority.Nov 7 2014, 9:09 AM
Tamito Kajiyama (kjym3) closed this task as Invalid.Nov 7 2014, 3:03 PM

The join_unary_predicates() function (not join_upred_predicates() -- I guess it's a typo) was indeed removed in the Blender 2.72 release as part of Freestyle Python API updates (D623). This function was however a helper function only used in the Parameter Editor implementation and was not part of the public API. I was not expecting that there were application codes that used it.

The removed function was used to concatenate multiple predicate objects with logical AND/OR operators. This function was necessary because the operators (AndUP1D and OrUP1D) were accepting only two predicates. Starting from 2.72 these operators accept more than two operands, so the missing function is no longer needed.

There are several SVG export scripts for Freestyle, but I guess the reported problem concerns the SVG export scripts by Francesco Fantoni and Jarno Leppänen. In their svg_*.py scripts in fact there are lines like below:

preds = [
    pyNatureUP1D(Nature.SILHOUETTE),
    pyNatureUP1D(Nature.CREASE),
    ContourUP1D()
]
upred = join_unary_predicates(preds, OrUP1D)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), upred)

These lines need updating for 2.72, for example as follows:

upred = AndUP1D(QuantitativeInvisibilityUP1D(0),
                OrUP1D(pyNatureUP1D(Nature.SILHOUETTE),
                       pyNatureUP1D(Nature.CREASE),
                       ContourUP1D()))

I've updated the SVG export scripts on github to use 2.72 API