Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Automap and output as object layer #428

Open
Birmania opened this Issue May 2, 2013 · 5 comments

Comments

Projects
None yet
4 participants

Birmania commented May 2, 2013

Hi,

I tried to create some automap rules wich would create an object layer as output.
The problem occur during the creation of Tiled Object where their positions match perfectly the grid.
Indeed, in this case, the object layer is created but not the Tiled Objects.
If they do not perfectly match the grid, they are normally created.

Here is a reproducer: automap_issue_reproducer.zip

Best regards,
Birmania

P.S : Sorry for my potential bad english.

Contributor

stefanbeller commented May 2, 2013

Hi,

I have tested your example and indeed the cuirass(?) tile object is not copied at Automapping.
However when I replaced the Tile object by a standard rectangle, being at the same location in the rule, it worked (the rectangle was copied over to the map).

I assume tile-objects are broken using Automapping. If you're in need of a workaround fast, this would be using rectangle objects instead of tile objects.
However I'll look into that issue further.

Birmania commented May 2, 2013

Ok, thank you for this fast return. I just try with the rectangle object and it work as you say.
However, I really need a tile object in my case. But there is no problem because we are not in a hurry at all.

Thank you (again) for having take a look on this and bravo for this amazing tool !

Contributor

stefanbeller commented May 14, 2016

sounds similar to #1202

@bjorn bjorn added the bug label May 14, 2016

Hi, grid-aligned polylines are an important thing for me.
So, this bug is cramping my style :)

What is the status of this issue?

An observation:
Say i have a nice square tile.
I go to the object layer output (of the Automap rule), and i use the polyline to draw a rectangle.
if the right OR bottom edge of the polyline is collinear with the grid line (Ctrl-G !),
then the polyline won't be copied over to my map (to whom the automap was applied).

Of course, i'm not using the polyline to create rectangles. And using rectangles is not an option. But, still.
Isn't it supposed to be <= ?

Owner

bjorn commented Oct 26, 2017

This is because objectsInRegion in automappingutils.cpp (and MapObject::boundsUseTile) do not handle tile objects and polygons correctly. In addition to objects sometimes not being copied when they should, there also seems to be the possibility of AutoMapper::copyMapRegion to copy the same object multiple times, in case of larger objects in complex regions.

It would take some effort to make sure this works correctly. It could probably be based on objectBounds in the objectselectiontool.cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment