WIP: Intellij Integration

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:

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”.

3 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.

2 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.

I’ve added some checks and dialogs for read and write where applicable. I also noticed a potential issue related to the path of the model. I’ll push an update in the next few days. I’m also in the middle of adding context menus to the scene explorer to add lights and such, so I’ll have to finish that first.

It does also take 2 days for intellij to validate it, so I’ll try to be quick.

Thank you for the report.

I’ve pushed v1.0.2 to intellij. You should recieve an automatic update once it has been validated. I’m confident it should fix your issue, @Mr_Marbles .

1 Like

… OK . Sounds good… but why I cant see the plugin in the Settings ? :see_no_evil:

Click “File -> Settings -> Plugins”.

Make sure you have selected “Marketplace” and not “Installed” at the top. Search “jmonkey” and it should be there.