Skip to content

Layer groups do not appear to be working #124

Open
@dawsoneliasen

Description

@dawsoneliasen

When I try to use a .tmx with all layers stored in layer groups, I get this error

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytmx/pytmx.py", line 682, in get_layer_by_name
    return self.layernames[name]
KeyError: 'background'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "convoke/world.py", line 81, in <module>
    Scene(landscape_path).run()
  File "convoke/world.py", line 34, in __init__
    bg_layer = scene_data.get_layer_by_name('background')
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytmx/pytmx.py", line 686, in get_layer_by_name
    raise ValueError
ValueError

I tried printing the value in .layernames and .layers, both were empty. I changed the map to not use layer groups at all, and PyTMX recognized all of the layers. Seems like it is failing to recognize layer groups.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions