[Bf-blender-cvs] [b466a82] master: Partial fix for T44404: freestyle crashes blender.

Tamito Kajiyama noreply at git.blender.org
Thu Apr 16 06:37:24 CEST 2015


Commit: b466a82fa5b3490a13880a92ce00d01057ae21b3
Author: Tamito Kajiyama
Date:   Thu Apr 16 09:13:40 2015 +0900
Branches: master
https://developer.blender.org/rBb466a82fa5b3490a13880a92ce00d01057ae21b3

Partial fix for T44404: freestyle crashes blender.

Logical predicates AndUP1D and OrUP1D were instantiated even with an empty
list of unary 1D predicates, causing an exception in the constructors of
the logical predicate classes.

This is a regression made in b408d8af31c9fba5898e353c97f95f7ce8dc19c1.

===================================================================

M	release/scripts/freestyle/modules/parameter_editor.py

===================================================================

diff --git a/release/scripts/freestyle/modules/parameter_editor.py b/release/scripts/freestyle/modules/parameter_editor.py
index d476584..3c11c33 100644
--- a/release/scripts/freestyle/modules/parameter_editor.py
+++ b/release/scripts/freestyle/modules/parameter_editor.py
@@ -960,11 +960,11 @@ def process(layer_name, lineset_name):
         if lineset.select_external_contour:
             upred = ExternalContourUP1D()
             edge_type_criteria.append(NotUP1D(upred) if lineset.exclude_external_contour else upred)
-        if lineset.edge_type_combination == 'OR':
-            upred = OrUP1D(*edge_type_criteria)
-        else:
-            upred = AndUP1D(*edge_type_criteria)
-        if upred is not None:
+        if edge_type_criteria:
+            if lineset.edge_type_combination == 'OR':
+                upred = OrUP1D(*edge_type_criteria)
+            else:
+                upred = AndUP1D(*edge_type_criteria)
             if lineset.edge_type_negation == 'EXCLUSIVE':
                 upred = NotUP1D(upred)
             selection_criteria.append(upred)
@@ -989,8 +989,9 @@ def process(layer_name, lineset_name):
         upred = WithinImageBoundaryUP1D(*ContextFunctions.get_border())
         selection_criteria.append(upred)
     # select feature edges
-    upred = AndUP1D(*selection_criteria)
-    if upred is None:
+    if selection_criteria:
+        upred = AndUP1D(*selection_criteria)
+    else:
         upred = TrueUP1D()
     Operators.select(upred)
     # join feature edges to form chains




More information about the Bf-blender-cvs mailing list