-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automapping: Output objects don't contribute to output region #3473
Comments
With this change, output object layers are taken into account when determining the rule output regions. The support for outputting objects by AutoMapping is still lacking support for many cases, like polygon/polyline objects or the object alignment setting, but it is at least meant to work for basic rectangle or tile objects. This change also adjusts tileRegionOfObjectGroup to the change that made object position and size be stored in pixels rather than tiles (55e7767), as was already done for objectsToErase before (521a40a). Closes mapeditor#3473
The linked PR fixes the general issue, but does not make AutoMapping work correctly for polygon or polyline objects. I believe since it works only with the object's rectangle, it will handle these as if they were point objects. When I would fix it, I'd likely use the bounding box, even if it may cause unintentional merging of rules in some cases. I just think that any more complicated handling of that case is not worth the effort given how rare it must be in practice. Eventually, it would be good to add a rule regions visualization, which would help spot such cases when they do happen. |
@eishiya I haven't tested it yet, but isn't this behavior consistent with tile layers? As far as I know, |
|
With this change, output object layers are taken into account when determining the rule output regions. The support for outputting objects by AutoMapping is still lacking support for many cases, like polygon/polyline objects or the object alignment setting, but it is at least meant to work for basic rectangle or tile objects. This change also adjusts tileRegionOfObjectGroup to the change that made object position and size be stored in pixels rather than tiles (55e7767), as was already done for objectsToErase before (521a40a). Closes #3473
@eishiya I'm open to explore better options for deletion, but I've closed this issue since I think that one has been fixed now. Thanks for testing and the additional feedback! :-) |
When determining what parts of a rule to output, Automapping only seems to look at tiles, and if objects are present, they are only output if they overlap an output tile as well. This is unintuitive and feels like a bug.
For example, these two rules that look for "NonEmpty" on the input layer and have just an object output layer will output nothing:
My input, unmodified by this rule:
But this is what I expect:
And this rule that outputs a tile in a location other than the object's location will output the tile, but not the object:
However, this rule, which outputs both an object and a tile at the same location, will work correctly:
If I want to make a rule that outputs only an object at some location, I have to have a tile output layer with a tile on it that will be ignored:
I think any tile touched by an output object should count as part of the output region. For example, this small object would add the selected tile to the output region:
Care would need to be taken with non-rectangular objects. For example, these are the total regions I expect these two rules to have:
But if the bounding box of the object is used instead of checking whether a tile actually overlaps the object, then the regions would be like this, and considered a single rule:
Alternatively, if it's intended that objects don't contribute to the output region (e.g. to avoid specifically this kind of weirdness with the shapes), then the fact that they don't contribute and may need output Tile Layers with Ignore tiles to output should be documented (I can add it to my rewrite draft).
The text was updated successfully, but these errors were encountered: