Page MenuHome

Tree Gen
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: Radeon RX 580 Series ATI Technologies Inc. 4.5.13587 Core Profile Context 20.4.2 26.20.15029.27017

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: rB0f45cab862b8
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: Sapling Tree Gen (0, 3, 4)
Author: Andrew Hale (TrumanBlending), Aaron Buchler, CansecoGPC

Short description of error

Python: Traceback (most recent call last):
  File "D:\Games\Steam\steamapps\common\Blender\2.91\scripts\addons\add_curve_sapling\__init__.py", line 1110, in invoke
    return self.execute(context)
  File "D:\Games\Steam\steamapps\common\Blender\2.91\scripts\addons\add_curve_sapling\__init__.py", line 1102, in execute
    utils.addTree(self)
  File "D:\Games\Steam\steamapps\common\Blender\2.91\scripts\addons\add_curve_sapling\utils.py", line 1537, in addTree
    leafDupliObj = props.leafDupliObj
  File "D:\Games\Steam\steamapps\common\Blender\2.91\scripts\modules\bpy_types.py", line 720, in __getattribute__
    return getattr(properties, attr)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 0: invalid start byte

location: <unknown location>:-1

Exact steps for others to reproduce the error
Ctrl+A - Curve - Tree Gen - Error

Event Timeline

Robert Guetzkow (rjg) changed the task status from Needs Triage to Needs Information from User.EditedDec 3 2020, 2:27 PM

This appears to be an encoding issue. Does this happen in every project or just a particular file? If it's the latter, could you please create a minimal example that allows us to reproduce this and ideally share how you created this file?

The problem may be the same as T74510.

Robert Guetzkow (rjg) added a comment.EditedDec 3 2020, 2:42 PM

While I cannot reproduce the exact issue with my current locale/language settings, I can reproduce something that is likely related.

  1. Name an object ж
  2. Add > Curve > Sapling Tree Gen
  3. Switch settings to Leaves
  4. Query the Leaf Objects and select the one named ж

The name is not properly displayed for the enum and every time it is selected there character changes (it's either blank, p_, ðZ, Đ]).

Looking further into this, it seems to be caused by the dynamic construction of the enum. The leafDupliObj EnumProperty is defined as:

leafDupliObj: EnumProperty(
    name='Leaf Object',
    description='Object to use for leaf instancing if Leaf Shape is DupliFaces or DupliVerts',
    items=objectList,
    update=update_leaves
    )

The enum items are dynamically populated based on the return value of objectList implemented in AddTree (__init__.py).

def objectList(self, context):
    objects = []
    bObjects = bpy.data.objects

    for obj in bObjects:
        if (obj.type in ['MESH', 'CURVE', 'SURFACE']) and (obj.name not in ['tree', 'leaves']):
            objects.append((obj.name, obj.name, ""))

    return (objects if objects else
            [('NONE', "No objects", "No appropriate objects in the Scene")])

According to the Python API docs using a callback for items is known to cause issues when not keeping a reference to the returned strings:

There is a known bug with using a callback, Python must keep a reference to the strings returned by the callback or Blender will misbehave or even crash.

Robert Guetzkow (rjg) changed the task status from Needs Information from User to Confirmed.Dec 3 2020, 4:19 PM

I'm marking this ticket as confirmed. Either the add-on has to be updated to work with the current limitations of the API or this has to be addressed in the Python API to fix the underlying issue.

Dear Robert

I found issue of my problem

If I use cyrillic letter like "Ж" on my ICOsphere, this problem appear
BUT if I use cyrillic letters on any plane - all correct

Please, check my file.
https://drive.google.com/file/d/1yCjH3MmheHVn8IXVZt1LBEUQguZmwV9p/view?usp=sharing