[Bf-extensions-cvs] [8c87cf0a] master: Fix T83386: Use type annotation instead of assignment

Robert Guetzkow noreply at git.blender.org
Sat Dec 5 09:54:49 CET 2020


Commit: 8c87cf0afccb2bb73a3575eaa58016cfec4e177a
Author: Robert Guetzkow
Date:   Sat Dec 5 09:48:04 2020 +0100
Branches: master
https://developer.blender.org/rBA8c87cf0afccb2bb73a3575eaa58016cfec4e177a

Fix T83386: Use type annotation instead of assignment

The Sapling Tree Gen add-on previously assigned the `FloatProperty`
to `bend`. This caused accessing `bend` in calculations to return
a reference to the `FloatProperty` instead of its value. This
commit replaces the assignment with an annotation as it is the
correct usage since the Python API changes for Blender 2.80.

NOTE: The add-on currently has another problem T83360 which
prevents it from working. For the implementation of the patch
I had to comment out the usages of `props.leafDupliObj`.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9747

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

M	add_curve_sapling/__init__.py

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

diff --git a/add_curve_sapling/__init__.py b/add_curve_sapling/__init__.py
index e5b88157..9bcd1492 100644
--- a/add_curve_sapling/__init__.py
+++ b/add_curve_sapling/__init__.py
@@ -701,7 +701,7 @@ class AddTree(Operator):
         items=objectList,
         update=update_leaves
         )
-    bend = FloatProperty(
+    bend: FloatProperty(
         name='Leaf Bend',
         description='The proportion of bending applied to the leaf (Bend)',
         min=0.0,



More information about the Bf-extensions-cvs mailing list