Freestyle method join_upred_predicates missing from rel. 2.71 to 2.72b #42508

Closed
opened 2014-11-05 21:05:42 +01:00 by Wolfgang Geithner · 8 comments

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

**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

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @WolfgangGeithner

Added subscriber: @WolfgangGeithner
Tamito Kajiyama was assigned by Bastien Montagne 2014-11-07 09:09:13 +01:00

Added subscriber: @mont29

Added subscriber: @mont29

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

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

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

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

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](https://archive.blender.org/developer/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 ](https://github.com/hvfrancesco/freestylesvg) 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())) ```

Added subscriber: @hva

Added subscriber: @hva

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

I've updated the SVG export scripts on github to use 2.72 API
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#42508
No description provided.