Intellij Integration

jetbrains version jetbrains downloads

The plugin is now available on the Intellij MarketPlace

I’ve written a plugin for intellij that integrates jmonkey into the intellij IDE.

To use the plugin, from within intellij IDEA:

  • File → Settings → Plugins → Search “JmonkeyEngine Integration”

Import Models

To import models go to “Tools → Import Model…”

View Models

To view models, go to the resources directory and double-click the j3o.

I’ve been dowloading models from sketchfab.com and they all pretty much seem to “just work” out of the box. Animations work, too. One thing to note is that I did have to increase my memory settings in intellij when importing large models (50mb+).

  • Help → Change Memory Settings…

Another thing I noticed at times is that some of the models import with HUGE sizes and you need to scroll out a lot or move the camera up to even see it. I guess I’ll have to do some scene querying or something to make sure the model is visible in the future.

Source code

https://github.com/jayfella/intellij-integration


Nightly Repository

To subscribe to the nightly plugin repository follow the steps below. This will give you acces to a faster release cycle and avoids the ~48hr jetbrains validation procedure.

  • Navigate to File → Settings → Plugins.
  • Click the gear icon located next to the MarketPlace and Installed tabs.
  • Click Manage Plugin Repositories.
  • Add the URL below to the repository list.
https://intellij.store.jmonkeyengine.org/updatePlugins.xml

After adding the URL, Click Help → Check for Updates and if there is a newer version available in the nightly repository you will be prompted to install it.

17 Likes

are you making new SDK ? ;p

hehe.

well, myself i already no need anything more than u did there, i think.
so you can generate/import to .j3o from other formats, you can preview it.

probably if i would be Intellji fan, i would use it :slight_smile: but i like old good Netbeans too.

Not so much “creating a new SDK” as modernizing it. The engine has kept moving forward and I think using a more modern SDK just makes the whole experience a lot less painful. Just these two mechanisms actually make using models in JME a delight. That’s something I’ve not been able to say before, and not because it was impossible before, but just a long convoluted repetetive process.

5 Likes

Tried this plugin today and while it’s a decent start, it has miles to go before it becomes on par with the sdk. Having to manually find the model file to convert in the filesystem instead of just right clicking on it gets very tiresome. For some reason, my converted models didn’t show up in the model viewer afterwards, not even in wireframe mode, even though the tris count showed ~7k. My last complaint is that there is no way to quickly edit the models. For example, the rotation of a gltf model I imported was wrong, so in sdk I would open the j3o, quickly add a pivot node and rotate it. As far as I can see, there is no way to do it with this plugin yet.
Overall a decent start, but not suitable for my workflow yet.

1 Like

Yeah I agree. This is just the start.

I’ll add that as an option.

That’s probably because you need to zoom out or move up. It might be a very large model, maybe?

My next step is to provide scene editing.

I’m glad you didn’t report any crashes or issues. That’s my main priority. Getting the engine to work from within intelliJ was a large task. Now that’s done and (to me at least) appears to be fine, I can progress implement more functionality.

Thanks for the review :heart:

1 Like

It was a model of a Valve Knuckles controller which showed up just fine when I imported the gltf file or even the same j3o file directly in code. Zooming in/out or moving about didn’t help.

This plugin has just been updated to v1.0.1 and is now available on the intellij marketplace, which means you can install it directly from within intellij and it will automatically update when they are pushed.

To install the plugin, from within intellij IDEA:

File → Settings → Plugins → Search “JmonkeyEngine Integration”.

4 Likes

I was wondering, since you are adding support for Gradle, would it also be possible to get Maven support. I have never written plugins for IDEA, and have no idea what the environment looks like… :wink:

PS: Thank you for your continued work within the community!

1 Like

I feel personally that gradle is the way forward. The jmonkey store only provides gradle links, and in future will also provide the ability to “one-click” software from the store into your IntelliJ project, both as a dependency and a sub-module if it provides sources and you want them. That’s going to mean modifying the build scripts, and supporting multiple build types will mean supporting it along the chain (the store) too. In an ideal world I would, but as a one-man team it would take more than twice as long to get every step done.

3 Likes

@jayfella quick question for you.

Because Android Studio is based on Intellij, does that mean that this plugin will work with it?
Is that the basis for getting jme android support with Intellij?

PS: When you have a solid inplementation in gradle, I will work on a maven PR for it.

To be honest I havent actually tried. It might. I would like to be able to provide support for it but right now it’s untested completely. It would be nice to have a “new game” template for android studio.

1 Like

Yes please. I would also be very much interested.

Just tried out the plugin. When I attempted to open a j3o file I got this exception:

java.lang.IllegalArgumentException: Given root path "D:\dev\workspace\avt\src\main\resources" is not a directory
	at com.jme3.asset.plugins.FileLocator.setRootPath(FileLocator.java:54)
	at com.jme3.asset.ImplHandler$ImplThreadLocal.initialValue(ImplHandler.java:120)
	at java.base/java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:195)
	at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
	at com.jme3.asset.ImplHandler.tryLocate(ImplHandler.java:178)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:359)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:416)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:420)
	at com.jmonkeystore.ide.jme.impl.JmeEngineServiceImpl.loadExternalModel(JmeEngineServiceImpl.java:215)
	at com.jmonkeystore.ide.jme.impl.JmeEngineServiceImpl.loadExternalModel(JmeEngineServiceImpl.java:195)
	at com.jmonkeystore.ide.editor.ui.JmeModelEditorUI.<init>(JmeModelEditorUI.java:94)
	at com.jmonkeystore.ide.editor.impl.JmeModelEditorImpl.<init>(JmeModelEditorImpl.java:26)
	at com.jmonkeystore.ide.editor.impl.JmeModelFileEditorImpl.<init>(JmeModelFileEditorImpl.java:28)
	at com.jmonkeystore.ide.editor.JmeModelEditorProvider.createEditor(JmeModelEditorProvider.java:31)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4Edt(FileEditorManagerImpl.java:875)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$7(FileEditorManagerImpl.java:845)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:630)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:643)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:845)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl3(FileEditorManagerImpl.java:790)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl2$4(FileEditorManagerImpl.java:773)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:773)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:765)
	at com.intellij.openapi.fileEditor.impl.text.FileDropHandler.openFiles(FileDropHandler.java:72)
	at com.intellij.openapi.fileEditor.impl.text.FileDropHandler.handleDrop(FileDropHandler.java:55)
	at com.intellij.openapi.editor.EditorDropHandler.handleDrop(EditorDropHandler.java:31)
	at com.intellij.openapi.editor.impl.EditorImpl.handleDrop(EditorImpl.java:4503)
	at com.intellij.openapi.editor.impl.EditorImpl$MyTransferHandler.importData(EditorImpl.java:4562)
	at java.desktop/javax.swing.TransferHandler$DropHandler.drop(TransferHandler.java:1544)
	at java.desktop/java.awt.dnd.DropTarget.drop(DropTarget.java:452)
	at java.desktop/javax.swing.TransferHandler$SwingDropTarget.drop(TransferHandler.java:1282)
	at java.desktop/sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:547)
	at java.desktop/sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:863)
	at java.desktop/sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:787)
	at java.desktop/sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:48)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4891)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4621)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4483)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:817)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:762)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:405)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:404)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Not sure what’s going on since the directory “resources” clearly exists in my workspace.

would you mind PMing me the model?

model? but he have some dir issue. :slight_smile:

I’ve tried with several different models, including the boat from jme3-testdata. I feel like this could be a permissions issue. Although I’ve never had problems with other intelliJ plugins. Perhaps other plugins open files differently?

So you are opening files from a jar?

Because it may be an issue relating to loading textures and such required by the model.

All files are being loaded from a directory. Namely “src/main/resources/models/”.

Yeah. It might be a permission thing. I don’t check for permissions but I probably should. It doesn’t appear to have read access.