Listing assets in directory

Hi!



I have a question: is there any way to list assets in specified directory using AssetManager? I’m creating a map editor and I want to let the user choose the model, whatever he wants.



Regards.

I’d be surprised if asset manager gives you a way, as this is a notoriously tricky topic in Java in general. (Try googling “list of classes in a package” - which is essentially the same thing).



You may be best off just opening a file explorer and having a folder somewhere they store the models. You can always drop your starting/example models in that folder for them. Easiest way would be to store them all in a zip and then unpack them to that folder.

(By open a file explorer I don’t mean the swing gui element (unless you are using a swing canvas already) - I mean a list of files in that folder using whatever gui elements are currently being used in your project.

1 Like

Make a text file thats generated by the build.xml that lists all files and save it in the assets folder, later load it to create lists.

1 Like
@normen said:
Make a text file thats generated by the build.xml that lists all files and save it in the assets folder, later load it to create lists.

But I'm using Eclipse :P Is there any way to do it in this IDE?

If not, I think that making that list manually would be ok.
@m4tx said:
But I'm using Eclipse :P Is there any way to do it in this IDE?

Standard projects in Eclipse are not very flexible, I don't think so.
1 Like
@m4tx said:
But I'm using Eclipse :P Is there any way to do it in this IDE?

If not, I think that making that list manually would be ok.


You can run Ant from Eclipse.
1 Like
@m4tx said:
But I'm using Eclipse :P Is there any way to do it in this IDE?

If not, I think that making that list manually would be ok.


You could stop using Eclipse and start using the given jME SDK.
1 Like

@Shirkit, If I don’t use jME SDK, I have some reasons, OK? If you really want to know them, there are they:

  • - Eclipse uses SWT instead of Swing. SWT uses native widgets, so it's muuch faster, it integrates with Unity AppMenu nicely and doesn't look like shit on Linux.

  • - Eclipse is much more comfortable for me, it has got great "New class/interface" dialog, cool perspectives and better keymap by default

  • - Eclipse has got nice Git integration by default

  • - Eclipse has got Eclipse Metrics plugin <3

@m4tx said:
If I don't use jME SDK, I have some reasons, OK? f you really want to know them, there are they:
  • - Eclipse uses SWT instead of Swing. SWT uses native widgets, so it's muuch faster, it integrates with Unity AppMenu nicely and doesn't look like shit on Linux.

  • - Eclipse is much more comfortable for me, it has got great "New class/interface" dialog, cool perspectives and better keymap by default

  • - Eclipse has got nice Git integration by default

  • - Eclipse has got Eclipse Metrics plugin <3




I think this is your video:

http://www.youtube.com/watch?v=XglN7yZ-Njo
1 Like

@Shirkit, Let me just choose the IDE that I want, ok?

You are welcome to choose the IDE that you want. That’s your decision. However you will find that the support you can get here is more limited because you are using a non-standard SDK and you will find that people are less inclined to help you solve problems if they are ones where the easiest solution is “use the SDK”.



It’s your choice, just don’t expect other people to put their time out because of your choice.

1 Like

I won’t argue with you, just pick whatever IDE you want. I really liked that Metrics plugin, looks cool, but throwing out a SDK is a risky shot.

No… I’m not throwing out a SDK. I use it sometimes (for converting models, testing some features, developing GUI in NiftyGUI fastly, etc.), but my main IDE is Eclipse now. The main reason is: Eclipse is much faster. When NetBeans will be as fast as Eclipse (but GUI library change is neccessary for that, what is - I think - impossible in that case), I can use jME SDK. Even especially for this 1 (or maybe more :>) project.

I’ve used both extensively. Can’t say I notice any speed difference at all on a decent computer. Eclipse had a few nice features but seemed to make some really simple stuff horrifically complex for no apparent reason. It’s personal preference though. Everyone has their favourite :slight_smile:

@zarch said:
Everyone has their favourite :)


True.

Mine is the tool, whatever it is, that is closest to what the end result will be used with. SDK with jME3. QTRadiant with "Doom" games. Hammer with source. You can make source or "Doom" maps using notepad, but... you know... Point is, nobody can force me not to invent a new tool or use an inappropriate (in a large sense) tool. It just makes my life not so easy. In the end it's my choice though and I've got to live with the consequences...

That's all I'll say on the subject. :)
1 Like

use ant in eclipse to build your ressource jar (or similar)

1 Like

Ok, so thanks everyone for help :slight_smile:

@m4tx : regarding the question about listing assets , I don’t think there is a solution , although you can list by serveral methods, one of those mentioned by @normen. But it’s Netbean and Ant specific.



In the world of Eclipse (and its RCP) (Yes I use Eclipse as much as Netbean because of my job :p) when Ant and Maven come handy, you can also tell Ant and Maven generate that kind of text file which list all the *.j3o, *.xml, *.png etc… Then let you AssetBroswer look at that text file. It’s not dynamic I know, but the structure of a Project can be very complex ( zip, jar, disk, online…) in which you will find your self meet a lot of difficulty if you don’t got good support by the SDK ( Like here with Netbean Platform ) …



So… your choice!

…with the exception that the SDK already has an ant-based build process which is also specific to asset handling etc. Eclipse does not only mean you work on your own, it also means you cannot contribute any improvements you make to the build or deployment process.