Asset browser parameter function?

Could there be a parameter function that, when tapped in the side panel, pulls up the asset browser?

1 Like

This is interesting to me. Hope you don’t mind some questions:

What would you use it for?

Would you want it to show a particular subfolder only? Or by default?

Would you want to be able to import assets?

I can’t remember everything off the top of my head but I feel like I think of things all the time that could use this.

I had a project based on making a primitive adventure game for my daughters, and I wanted to turn it into an adventure game building kit, but the difficulty of letting people load and place backgrounds stopped me.

I don’t know if you remember the Craft scene-building project I made, but about 80% of the time I spent making it was trying to figure out how to use the parameter pane to let people load the default models, and even though I did come up with a solution, it was as clunky as can be and it would have been awesome as heck to just pop a parameter panel up there.

The voxel editor upgrade I made could use it—as could the existing one in the example projects.

Recently I’ve been wondering how hard it would be to make a primitive Craft-shader-lab project, and being able to load files and textures would be really great for that.

I attempted to extend my SimpleButtons project into an art program a while back—fwiw the color picker I made for that one is one of the few pieces of code I’ve had someone else use in their own project, which was cool—but again the difficulty of loading saved files made me abandon the concept. I could have used such a parameter panel then. And so could every drawing project everyone has ever made in Codea, for that matter.

I don’t know if you recall a very old project someone made where a little 3D crate rolls around in a maze made of 3D crates, but I added a map editor to it, and there again it would have been way cooler if I’d had an easy way to load saved maps.

I also tried to make a project where you could draw directly on 3D models—another place I could have used an asset picker.

So I guess the general answer is “tools”? Seems like any project that aims to help people make things inside Codea itself could use it.

To your other questions:

  • seems to me the exact current asset picker behavior would be best: open in the main Codea folder

  • absolutely, yes, importing assets would be a key ability. That said, for making things like drawing programs or the Craft model scene builder or the voxel editor I guess it wouldn’t be essential.

Would this solve your use-cases?

parameter.asset("Select Image", function(selected)
    -- selected is an `asset.key` the user picked
parameter.asset("Select Image", "images", function(selected)
    -- selected is an `asset.key` the user picked
    -- tapping on the asset picker in this mode shows only images

Oooooo yes yes yes. That’d do it all right.

By the by is there a reason there’s no “rename” in the edit mode of the asset picker? Since we’re on the topic kinda… :wink:

@Sim while on the subject of assets!…
The .obj models should be accompanied by a .mtl file. When i use ‘add to’ to move an .obj to the assets of my project, i don’t think you automatically copy over the corresponding .mtl?
If not, may i suggest you also display the .mtl files and also allow them to be ‘add to’. In fact, i would prefer to show the extensions of all the asset files. Sometimes a model might be .blend, .stl etc. and it is useful to know what is what.

Is there a way with the files app to move assets directly into a project? I can move assets to the Codea documents.

1 Like

@sim expanding on @UberGoober’s request for a parameter asset browser…
Could it also be an incode function with callback that could be used within the code, even if the sidebar is not visible? Similarly for the colour picker.

1 Like