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

Rearranging Image Collection by Image Name #1856

Open
hepari opened this Issue Jan 13, 2018 · 23 comments

Comments

Projects
None yet
3 participants
@hepari

hepari commented Jan 13, 2018

As a developer of an ongoing project, I have to add new images to an existing collection.
The problem is that since the editor shows all images arranged by their id instead of the order of image names, my collection becomes messy very quickly once I start adding new objects.

Example (current)
id1: stone1
id2: window

Now, if I add an image named 'stone2':
id1: stone1
id2: window
id3: stone2

And the system gets lost right away.
That's why I would love to arrange the objects by name. Is it possible?

This is a really pressing matter to me, and would be grateful for an answer

@bjorn

This comment has been minimized.

Owner

bjorn commented Jan 14, 2018

That's why I would love to arrange the objects by name. Is it possible?

In this case, the order in the file is irrelevant and you're just looking for an option to order by name when displaying the tileset, right?

Unfortunately right now this is indeed not an option, but we anyway need a better tileset view that is more suitable for image collections. There should be a thumbnail view, where the tiles are displayed in a uniform size and there should also be an option to display the name. This new view should then definitely also be able to display the tiles sorted by name.

This is a really pressing matter to me, and would be grateful for an answer

It is hard to say when I would get around to this. There are multiple other features on my priority list that I'm currently working on, so it will take at least some weeks. Of course, maybe somebody else would be interested in implementing this.

@hepari

This comment has been minimized.

hepari commented Jan 14, 2018

Yes, an option to do that would be great. =)
I know how hard you work on this, and understand that you don't have time to do this right now. Looking forward to the new view for the image collection!

If somebody else could do this, I'd be immensely grateful.
(I'm working on this game of mine, and I'm fighting a battle against time... )

@bjorn bjorn changed the title from Suggestion: Rearranging Image Collection by Image Name to Rearranging Image Collection by Image Name Jan 31, 2018

@bjorn bjorn added the feature label Jan 31, 2018

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Feb 7, 2018

I will try to devote some time on this issue (although my first internal examination is going to start from 19nth of February so it might take some time) i will be digging up the source code and see how much of the requested feature i can implement.

Just to be sure that i got it correctly, you want the names within that marked region to be sorted based on their names ?
capture

@hepari

This comment has been minimized.

hepari commented Feb 7, 2018

@keshav2010 : Thank you for showing interest in this issue. I actually meant the roster of objects under the 'tilesets' window! Right now, they are always sorted by id numbers which are assigned in the order of being added to the tileset file.

[ID-01] [ID-02] [ID-03]
[ID-04] [ID-05] ...

But I want them to be sorted automatically by their file name, like in the following example!

capture-20180207001

I'd be really, really grateful if you could implement this one.

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Feb 8, 2018

Oh i see, so you basically want to re-arrange those individual tiles in a given Tileset.
as per the build I've on my system, currently their isn't by default any Name property for each tile in a Tileset and although you can sure add a Custom property for name but that wouldn't be really helpful since you might not be willing to assign a name to all tiles in a given tileset.

I will first make sure every tile in a tileset must have a name-property, which by default is same as their ID and so every Tile should then be sorted on the basis of this Name property only. I will be devoting time on this to first understand the source code related to this and then finally moving on further to do the expected change meanwhile preparing for my exams and hope it shouldn't take that long.

@hepari

This comment has been minimized.

hepari commented Feb 8, 2018

@keshav2010 : OK! Could you set the name-property as same as each tile's file name? I forgot to mention that this is a problem with the 'Image Collection', and not the traditional 'tileset'. I really appreciate your help!!

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Feb 8, 2018

Yup name-property could be set to tile's file name, Although i never really worked with Collection of Images before from Tiled User perspective, but still from what I've seen so far by experimenting with it on my system, this is still similar to what i thought about earlier. I will dive into this asap. 😃

@hepari

This comment has been minimized.

hepari commented Feb 10, 2018

@keshav2010 : Hello Keshav, how is it going? I hope it didn't turn out to be much more complicated than thought.

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Feb 10, 2018

@hepari Hello, Yea i did a little bit of sneak peak into the code today and got started with the implementation but still alot of work is to be done, right now im working on adding name property to each tile and inspecting source code to implement this basic fundamental property safely like other existing properties. It will take time also because I've exams coming up from 19nth Feb and they are expected to last 4 to 5 days, so that is another reason why I'm not able to devote much time to this issue.

Rest assured, I've no other issue in my to-do list except this one. 😄

Also here's the short review of what is being done right now, im still working on making sure the name property works properly, i added code to make sure tile name by default is same as tile's file name in case if it is image collection, and so any change in file name should reflect back in name property, so these little actions need to be handled before i actually move on to the main problem of sorting them.
To sum it up, right now im exploring source code and understanding all these little bit of possibilities that can affect name property later in the program.

@hepari

This comment has been minimized.

hepari commented Feb 10, 2018

@keshav2010 : oh, I didn't mean to rush you or anything :) Thank you for giving me some insight into your work!
I assume that without your help, I would have to wait months (or years, in the worst case) until this issue gets addressed. Thank you very much! 😃

capture-20180117007

@bjorn

This comment has been minimized.

Owner

bjorn commented Feb 11, 2018

The most tricky bit here will be to implement a new tileset view, probably based on QListView, and the ability to switch between that view and the current QTableView based one. Apart from sorting, such a view would offer additional advantages:

  • Displaying each tile with the same size (or at least it could be an option). That would solve the layout issues where much space is wasted because of a single larger tile.

  • Dynamically wrapping the tiles instead of having to set a "column count" property somewhere.

I assume that without your help, I would have to wait months (or years, in the worst case) until this issue gets addressed. Thank you very much! 😃

This is an issue I'd want to get around to sooner rather than later, but of course you may be right. It's mostly since I'm just one person and there are so many things to do.

@hepari

This comment has been minimized.

hepari commented Feb 11, 2018

@bjorn : of course! I hope that didn't read like a bash directed at you. I'm grateful to you for making Tiled, and I'm fully aware of how busy you are. There is only so much one man can do.

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Feb 11, 2018

@bjorn Thank you for valuable feedback, I've added the Name property in the property-dock widget and for non Image-Collection tilesets name is equal to ID however for Image-Collections based tilesets, it is by default equal to the file name. As of now, I've not made name property mutable so user won't be able to change it directly but only by changing file name, although this is done only to keep things simpler at the initial stage as I'm not sure if making it mutable would mean going more deeper into the code, which at the moment im trying to avoid (due to exams).
Here's a picture for reference
capture

below picture shows how Name property by default is equal to ID in case of non Image Collection tilesets.
capture1

@hepari

This comment has been minimized.

hepari commented Feb 11, 2018

@keshav2010 : I don't think we'd need to make the property name mutable, as long as we can replace the file! :)

@hepari

This comment has been minimized.

hepari commented Mar 10, 2018

Hello @keshav2010 , have you made any progress on this feature? :)

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Mar 15, 2018

@hepari Hey, I've been working on implementing the new tileset view lately based on QListView as suggested by @bjorn however due to quite a hectic schedule I'm not able to devote much time to it, though I'm making progress however its still slow, I will try to gear up the progress as soon as possible. As I'm working on this, I'm learning new things side by side about Qt and Tiled code organization and even though I might not able to meet coding standards being followed, I will make sure to update my own personal fork Tiled with the changes you requested so you can use the new Tileset View without waiting for it to come to official Tile release.😃
A note to Bjorn and anyone else interested in this Issue
I hope I'm not blocking anyone's motive to work on this Issue. if anyone is willing to work on this, they should do it ❤️ , I just kind of feel like I might take a bit longer to implement this and this might be causing others to think of this issue as being completely reserved to me. ❤️

@hepari

This comment has been minimized.

hepari commented Mar 15, 2018

@keshav2010 Thank you very much for all your effort! Please let me know when you have updated a new fork, I'm eager to try it out :D I'm so gonna credit you in the 'Special Thanks to' section of our game...

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Mar 18, 2018

@hepari I've recently pushed a very small alternate solution to the problem, Since as I said before, implementing whole new tileset view would take some time since I've to follow code guidelines as well as understand various other aspects, I've done some changes in tilesetModel instead and what it basically does, it will internally store data sorted based on its Name property rather than ID. Note that it will only be affected for image collections and not general tileset as we discussed earlier. There sure are some problem that you might face since they are currently sorted based on character-by-character ASCII code comparison, so that means in a collection, for example, file namely "9" is considered greater than file namely "10", although I've made sure such behavior should not be shown for non-collection tilesets and they work as expected. I won't be pushing this on Tiled's official repository since this isn't actually a strong fix as it still does not solve issue of extra spacing as mentioned by Bjorn, so if in case it is very urgent for you, you can see my fork of Tiled and instead build it to try it out: https://github.com/keshav2010/tiled

Meanwhile, I will be work on the dedicated tileset view and rather not alter the existing one. 😄 ❤️ Let me know if that solves your problem for some time as I work on a more concrete solution. ❤️

@hepari

This comment has been minimized.

hepari commented Mar 18, 2018

@keshav2010 Thank you so much. It sounds like your build will solve my problem - though I don't know how to compile the build. (I've downloaded qt and opened the unzipped tiled.qbs, but building process just spits some error messages and I don't know what I'm doing wrong XD)

capture-20180318004

Could you help me with this, or give me a link to a compiled build? I'm really sorry for the hassle. :(

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Mar 18, 2018

Yea, you can find me on facebook and we can use team viewer to resolve issues and build Tiled on your system: https://www.facebook.com/keshav15157
If you are not on facebook, you can also find me on Twitter : https://twitter.com/crap_crafter (although I'm most active on Facebook)

@hepari

This comment has been minimized.

hepari commented Mar 18, 2018

@keshav2010 : Thank you for your friendly offer! Though I don't use Team Viewer ever since, like, ever. I'll just try my luck some other way. 'Readme' is kept so simple and presumes that I know everything about the witchery of compiling...

@keshav2010

This comment has been minimized.

Contributor

keshav2010 commented Mar 18, 2018

No problem, do let me know if the fork solved the issue for you since it is working fine so far. If you face trouble, I will try to build tiled from my fork and provide you with the download link.

@hepari

This comment has been minimized.

hepari commented Mar 18, 2018

@keshav2010: Thank you very much, our programmer compiled it for me, and at first it gave us the error message that the app can't find qwindows plugin, but we got that one solved.
The objects sorting is working as I wanted it to, and it hasn't made any boo-boo so far!
I must say, this is already a big improvement over the vanilla version. Thank you! I'll happily wait for the rest of the features, and hope maybe @bjorn could incorporate this change to the master branch so everyone can benefit from it :)

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