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
Tile.objectGroup = new ObjectGroup()
does not show group in collision editor till different tile is selected
#3655
Comments
There seem to be a number of assignments you can do that don't trigger a refresh of the relevant displays. Another example is |
I dug into the code a bit. Looks like the Collision Editor stores a clone of the tile's tiled/src/tiled/tilecollisiondock.cpp Lines 417 to 421 in 3b2a3c4
So I think the I'm not sure if we'd hit failures where the user makes changes in the collision editor, but those changes do not immediately get copied to the |
More research: That event is, indeed, intended for the Collision editor. tiled/src/tiled/tilesetdocument.h Lines 152 to 155 in 3b2a3c4
Emit happens here: tiled/src/tiled/tilesetdocument.cpp Lines 428 to 431 in 3b2a3c4
When scripts assign to tiled/src/tiled/editabletile.cpp Lines 172 to 201 in 3b2a3c4
|
When script does this, it should be using |
Describe the bug
When a script programmatically adds a
new ObjectGroup()
to a tile, then adds shapes to thattile.objectGroup
, it does not appear in the Collision Editor. It can be made to appear by switching to a different tile, then back to the original tile.If collision shapes are added in the collision editor before the workaround described above, it seems like the collision editor replaces the scripted
objectGroup
with a new one.It seems like the collision editor UI is not notified about the addition of an
objectGroup
via scripting.To Reproduce
Steps to reproduce the behavior:
Add the following script to a project:
Open a tileset with at least two tiles, that do not have any collision shapes in the collision editor.
Select the first tile.
Open the collision editor before the next step.
Right-click the tile, click "Setup Collision" to run the scripted action.
Observe that the collision editor does not show the new
Point
Click the second tile in the tileset, then click back to the first.
Observe that the collision editor is now showing the new
Point
Expected behavior
When scripting adds an
objectGroup
to a tile, it should appear immediately in the collision editor.Media
Specifications:
The text was updated successfully, but these errors were encountered: