Code completion for Assets in SDK!

Sooo…

Cleaning up and extending some other things in the SDK I came around to add this long planned and much requested feature :smiley:





Currently supported:

  • .loadModel("
  • .loadMaterial("
  • .loadTexture("
  • .loadSound("
  • .loadFont("
  • .loadFilter("
  • .fromXml("
  • .addXml("
  • new Material(… "
  • new AudioNode(… "

So its basically looking for “.loadModel(” and then doing everything (matching etc) from the last quotation mark to the caret. Works just like the other code completion :slight_smile:

Please hit me with other situations where this can be used, I can’t come up with all off the top of my head.

Cheers,
Normen

12 Likes

Tricky. :slight_smile:

Yeah, scanning the class structure would be overkill, for now its simple text checks for the common situations. ^^ Lets see where and if I can add a generic way to open a list, like with a code generator or so.

Oh my god !!! This is simply marvelous.
If you knew how many times I had missed this one !

So many thanks, @Normen !!!

1 Like

Ho! awesome \o/
This is gonna be soooo handy!!!
Thanks @normen

We have to do something for those icons though!

1 Like

This is really sweet! But nowadays I know I can spell Common/MatDefs/Misc/Unshaded.j3md in my sleep =P

It would be nice if completions worked in j3m/j3md files also (though I suspect most users do not touch them, and those who do know their paths =P).

Also, the auto completions in .vert and .frag files is not that good either… do you know where to find the syntax files for those, I’d like to see if I can improve them =)

1 Like
@kwando said:

It would be nice if completions worked in j3m/j3md files also (though I suspect most users do not touch them, and those who do know their paths =P).

Also, the auto completions in .vert and .frag files is not that good either… do you know where to find the syntax files for those, I’d like to see if I can improve them =)


Those are completely different things. This is about files. I outlined in the unfruitful “SDK plugs look for adopters” thread how to extend the shader syntax.

@normen
There is paths in j3m and j3md files, and I think those is the same thing… the other stuff I mentioned is different I know, but it is still autocompletion.
VertexShader GLSL100 : Common/MatDefs/Misc/Particle.vert
FragmentShader GLSL100 : Common/MatDefs/Misc/Particle.frag

GREAT !!!

How many times i missed images name or materials paths …
Thank you Normen !

1 Like

Level up! Productivity increased by 42.

Can this be added in other editors? Like maybe in the material editor, propose completion on textures pathes? (Just giving out ideas, I’ve myself seldom used this editor, I use procedural thingies for everything).

1 Like

uh…the material editor has a “browse” button for each texture.

@kwando said: @normen There is paths in j3m and j3md files, and I think those is the same thing.. the other stuff I mentioned is different I know, but it is still autocompletion. VertexShader GLSL100 : Common/MatDefs/Misc/Particle.vert FragmentShader GLSL100 : Common/MatDefs/Misc/Particle.frag
Ah, I thought you mean complete material parameters in the SDK, like setColor("Color"). I guess adding it to j3ms and j3mds for *editing* those should be no problem.

Yeah, I just thought about the paths in the j3m/j3md files. Completing material parameters (as you suggested) would be harder I think, since that requires access to the parse three / AST and a whole lot of other stuff… but it would definitely be cool =P

@kwando said: Yeah, I just thought about the paths in the j3m/j3md files. Completing material parameters (as you suggested) would be harder I think, since that requires access to the parse three / AST and a whole lot of other stuff.. but it would definitely be cool =P
Hehe, yeah, wanna have a whack? I have the code to access the class structure of the java file here, you could even check via object type ;) But j3md support is something definitely possible, j3m less so as the text editor for them is (atm) not a "real" NetBeans editor. Maybe in the next iteration of the material editor, @nehon and me will collaborate on that one :) Thanks for the input!

Normen is on a roll :).

I’ve never once managed to write the correct pathname to an asset… this is nice, instead of having to launch the game to get the usual asset not found exception.

1 Like

I could kiss you right now.

1 Like

This is incredibly useful, especially for material paths. For some reason as soon as I get up to “Common/MatDefs”, my mind goes blank :slight_smile:

1 Like

woop woop :slight_smile: awesome work normen

1 Like

Great job as usual @normen! Thanks a lot!

1 Like

I would like to suggest that the context of strings in which the completion work can be set by user in some menu. This would be cool for me for example, when passing a path to an asset indirectly by some function calls, like: “addIcon(String path)”.
For example by using some patterns like: addIcon("