Page MenuHome

Sapling Tree Gen: Use type annotation instead of assignment
ClosedPublic

Authored by Robert Guetzkow (rjg) on Dec 4 2020, 2:02 PM.

Details

Summary

This is a fix for T83386. The 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 patch replaced the assignment with an annotation. This is the correct usage since the Python API changes for Blender 2.80.

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

Diff Detail

Event Timeline

Robert Guetzkow (rjg) requested review of this revision.Dec 4 2020, 2:02 PM
This revision is now accepted and ready to land.Dec 4 2020, 2:34 PM

Can someone explain the reasoning behind incorrect annotations that dont actually comply well with PEP-526?

https://devtalk.blender.org/t/recommended-type-annotations-in-ops/16575

@Kein (Kein) that's a valid question, I would suggest you ask members of the Python module about this, perhaps on blender.chat.

Edit: Further discussion happens in T83626, D8782 (for Blender developers) and the DevTalk thread.