mainPython TMX Library - Support: sr #110162, Rotated elipse error

 
 

sr #110162: Rotated elipse error

Submitter:  None
Submitted:  Sun 15 Dec 2019 01:53:29 PM UTC
   
 
Severity:  3 - Normal Status:  Wont Do
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 15 Dec 2019 04:01:22 PM UTC, comment #2: 

Ah, also another note, if you do create a new project page, do send a link; I'd be happy to point people who land on this project page to the new one.

Layla Marchant <onpon4>
Group administrator
Sun 15 Dec 2019 04:00:08 PM UTC, comment #1: 

Hey, just a note that python-tmx is orphaned. I was unable to keep up with constant changes/additions by the TMX developers unfortunately. If you would like to take up maintenance of it, the code is pretty simple and it's pretty straightforward. I myself won't be fixing any issues, however.

If you would like to be added to the project on Savannah so that you can maintain it, do let me know (and let me know your username so I can add you). Alternatively, feel free to create a new project page elsewhere.

Layla Marchant <onpon4>
Group administrator
Sun 15 Dec 2019 01:53:29 PM UTC, original submission:  

Hi.

While trying out this module, I've encountered following beheviour:

I used Tiled v 1.3.1 to create tmx file with 3 layers image, tiles and objects. In objects layer, I've added rotated elipses.

As you can see bellow, ogchild.attrib.get() can be float-based string in some instances, which fails to convert to int.

Simply changing 'int' typecast to 'float' for x, y, width, height and rotation fixed this issue for me.

Code:

import tmx
t=tmx.TileMap.load('heightmapped01.tmx')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-6e387764c4ce> in <module>
----> 1 t=tmx.TileMap.load('heightmapped01.tmx')

~/PycharmProjects/SocialAgents/venv/lib/python3.6/site-packages/tmx/__init__.py in load(cls, fname)
    511                 self.layers.append(get_layer(child))
    512             elif child.tag == "objectgroup":
--> 513                 self.layers.append(get_objectgroup(child))
    514             elif child.tag == "imagelayer":
    515                 self.layers.append(get_imagelayer(child))

~/PycharmProjects/SocialAgents/venv/lib/python3.6/site-packages/tmx/__init__.py in get_objectgroup(layer_root)
    318                     oname = ogchild.attrib.get("name", "")
    319                     otype = ogchild.attrib.get("type", "")
--> 320                     ox = int(ogchild.attrib.get("x", 0))
    321                     oy = int(ogchild.attrib.get("y", 0))
    322                     owidth = int(ogchild.attrib.get("width", 0))


ValueError: invalid literal for int() with base 10: '224.669'

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48065:  heightmapped01.tmx added by None (21KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by onpon4 (Posted a comment)
  •  

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-15 onpon4 StatusNone Wont Do
    2019-12-15 None Attached File- Added heightmapped01.tmx, #48065

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code