A few things in SDK developments (VisualAsset, OffScenePanel)

@normen : I hope you don’t feel hard about a stuborn , annoying boy like I was :stuck_out_tongue:

Here is some screen shot of what I’m doing and I really need helps, I know you wrote almost the SDK codes …



So my questions are :



1) VisualAsset Plugin: What is the best way to retrieve a Collection of Image of Assets thumbanil?

I want to make a visual asset, the model, texture, sound… and all the things from AssetPack 'll shown in visual way (with thumbnail image for example)…

UDK Content Browser is what I’m coming toward:



http://www.worldofleveldesign.com/categories/udk/images/udkbasics/007.jpg



The features are list below (some should and some may not be implemented yet):

  1. Thumbnail (zoom in, out , tooltips) (Got it , but need a lot of improvements )
  2. Add to project and scene editor ( Done!)
  3. Tags, Category, sort



    My implementation so far:

    http://farm8.staticflickr.com/7210/6872036119_7ae9723197_z.jpg



    Data : I take the rootNodes from JME AssetBrowserTopComponent :



    GridLayout : I used JGrid (has a good algorimth for optimize drawing when scrolling)



    http://www.guigarage.com/2011/09/jgrid-tutorial-1/

    https://blogs.oracle.com/geertjan/entry/jgridview



    Sort: I wrote my sort , tags, filter algorimth with

    http://www.glazedlists.com/



    Now for the JME rendering parts :

    I want to genarate the thumnail for model, texture, sound… the first time the plugin run and add a tag



    <file type=“thumb” …



    to each of Asset in assetpack.xml



    As I read “AssetPackLoader” already has function to load asset, but the just the “Model” type-Node are wraped. Texture, sound is not really implements, so I extends “AssetPackLoader” a little bit …!!! SO GOOD SO FAR!



    Now what I really concern is about read all the models and generate the thumnails, because this job take a lot of time!

    What should I do, or just “brute-force” the render of all Nodes at one time ?=> May cause crash to the SDK!



    I really want to ask @nehon and @momoko_fan and all you guys too :stuck_out_tongue:

No need to rewrite all this, AssetPacks are already there, its only bout adding the metadata and improving the browser (display the thumbs etc. in the properties window).

Now for the JME rendering parts :

I want to genarate the thumnail for model, texture, sound… the first time the plugin run and add a XML tag



file type=“thumb” …



in to Asset tag



This job is quite time comsumtion …May cause crash to the SDK!


Sorry because I post some XML => the post is missing some lines!

I want to know the best way to do this???
@normen said:
No need to rewrite all this, AssetPacks are already there, its only bout adding the metadata and improving the browser (display the thumbs etc. in the properties window).


1)The thumb in the Property window will be 16x16 restriction...?? So what I want to do is to make another TopComponent for viewing.
2) As I play around with my solution for now, I take the AssetBrowserTopComponent 's rootNode and take the Dom Element from it,
But really in the code, we don't have the funtion that parse Sound and Texture... to Node (can load it but not parse to Netbean Node!!!!) => So I extends AssetPackLoader... (A lot of Hack but the result is quite enough now)

Yeah, thats the issue when you try to implement some function as it is in another editor, it just doesn’t fit to whats there… Rather see how you get along with not hacking stuff and see what you need to do yourself (e.g. caching previews etc).

What about the “generate thumbnail” function, can you point me a good way? ( I can do sound and texture, but hell Models are headaches)

Just render it in a preview…

yes but a lot of Models will cause a crash ,you know!



I know we can make a preview out of our SceneApplication for the “thumbnail” job but from time to time I really think about a light-weight renderer (application) who is in a separate thread should take care of the job?

I don’t think so. Just catch errors appropriately and check the models, save the thumbnails so you don’t have to regenerate them each time etc.

1 Like

Maybe this will help: http://www.philreeve.com/java_high_quality_thumbnails.php



Use it to generate thumbs for your textures. As for your model thumbs, you can render them, store the view as a temp image and then convert it.



Then, as normen said, save your generated thumbs for fast restoring later.



-Feen

1 Like

@atomix it wont crash.

a) lets say it takes 50ms to render 100 models, ok, you store those “images” in the memory/ texture, no extra performance cost, no crash.

1 Like

Also since it gets rendered on the OpenGL thread you have no waiting in the UI at all.

OK, here is my scenerio when loading official “WorldForge” asset pack, 390MB of model and texture, my new ( i5 and 1G Graphics Card Computer) take 24s to generate all the thumbnails, cause a remarkable delay on the SceneComposer!!!



I will try the recommended solution above and tell you guys the result… Thank a lot and cheer :stuck_out_tongue:

You click one model, the preview is generated for the properties window. Why would it be all at once?

May be I didn’t say it very clear…



At the first time the plugin run, the user can choose to generate all at once previews for asset packs.

After that, if they scroll through the windows, the preview which cached shown up…

If they click on thumbnail, the real Model, Texture, Sound will be generate in on the fly and refresh…



And I don’t want to show anything in the Property Window, this one is another TopComponent.

Still it should be based on nodes and properties, if you display it in that window or not.

The reason I concern about make attach previewv to SceneApplication thread is, the preview will be render before the real scene which showing in the SceneComposerTopComponent ~ Cause the delay for it, which is ugly !



That why I want a light-weight renderer which should take care of the generation by it self, not affect the run-time component , I will try to plot my stragegy first , then ask more, because now I still not very clear about the low level renderer my self .

Just don’t do that. It will definitely not be taken in the SDK if its done like that.

@normen said:
Still it should be based on nodes and properties, if you display it in that window or not.

Yes, my TopComponent take data out of the real AssetBrowserTopComponent, you can say it depend and take all the benefit from that component, I dont rewrite much of course, consider it a clone but with extra feauture for that Component because I want two of them live well together, as see in other netbean platform application.

P/s:
I use ,

getTopComponent("AssetBrowserTopComponent").getExplorerManager().getRootNodes() <= One line of code, then use it for my display purpose, not extends anything!