Intellij Integration

Are you going to restore this repo? I’ve been playing around with the unity editor to get a few ideas and I wanted to test something to see if it would work.

Yep.

I’ve updated quite a few things, so it’s in front of one on the store. I’ll get back into updating this in the next few days and push an update.

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

If I recall I added:

  • Add Nodes (Right-Click on a node in scene explorer).
  • Add Lights (Right-Click a spatial in scene explorer)
  • Drag models into the scene explorer from the project tab.
  • Delete things (right-click in scene explorer).
  • Save Changes(?) in Scene Explorer. Not sure if that’s new or not but you can save scenes now.
  • NOT FINISHED: Add a SkyBox (Right Click in Scene Explorer). I just need to create a dialog to choose the texture. I think the texture is hard-coded right now.
  • Generate LightProbes. Add a lightprobe and select the node to use to build it. For example, choose the skybox and not the whole scene.
4 Likes

Sweet! It looks like you are coming along.

So i’m looking into a few things right now. The first is building the particle system i’ve worked on into this plugin which looks pretty straightforward. The feedback has been pretty overwhelmingly to not put it into the core so i’ve put it up on bintray for the moment. Is there a clear way you want outside plugins to integrate with your plugin? This kind of leads into my next point…

I’ve been playing around with unity a lot this last week and one of the things i’ve been really impressed with is it’s ability to dynamically change the editor with project code. In unity you can annotate a class to tie it to tie it to specific types so when you attempt to edit them it will build a gui from that class file. You can also use it to add menu options. I think this would be really cool to allow users to extend the plugin in game specific ways but I also think it would be a huge boon to people making plugins. Along with store integration I think this would be pretty killer. You already have to do some sort of classpath scanning anyways to add custom controls in the scene editor so this isn’t too far past that.

Any thoughts? I’ve mostly just verified that it’s possible but I wanted to hear your plans / thoughts first before I dove in to get a prototype.

tldr: just make a regular IntelliJ plugin and ref my plugin as a dependency.

IntelliJ has a very good plugin system and mostly great docs with it. Plugins can have dependencies to other plugins, too. If it were me I’d leverage that concept. My plugin uses a service system so it’s virtually a static call to use the running engine.

My plugin also has methods to automatically create a swing panel with a separate root node so it’s a simple process mostly.

My plugin is primarily intended for core functionality - a running engine, editor, etc. Any additional functionality will be a separate plugin. To me it makes maintenance so much smoother.

The great thing about IntelliJ plugins is that it will tell you there’s a plugin available for extensions. So if you have a j3p (particle) extension it will detect your plugin.

The software store can also market these products, so the customer base will be aware they exist, too.

Yea, I know doing a plugin for integration would work and isn’t too difficult, but the idea was to not require something so heavy handed. It would be really cool to add a single java file to your project and add basic editing capability for things like ‘Items’ or ‘Block Definitions’ that is more accessible than json or xml to someone that isn’t a coder. This would also prevent the extra overhead of having an artist install multiple plugins.

As far as the particle system goes, I don’t think you’d want a separate file type. I think you would want it integrated directly into the scene editor. There are too many integrations where you would need a scene editor to setup an effect.

Hm.

I’ve used unity. I understand where you’re coming from. To some extent it can be replicated via reflection but right now it would only work for scene objects. I guess a particle emitter falls into this category.

Actually you can already register editors.

https://github.com/jayfella/intellij-integration/blob/master/src/main/java/com/jmonkeystore/ide/scene/explorer/impl/SceneExplorerServiceImpl.java#L234

It could potentially scan a package name of dependencies and load them automatically. I’ll do some testing to see if this is as easy as it appears in my head.

Updated to 1.0.3
As per-usual it takes intellij a couple of days or so to validate the update.

  • Add Nodes (Right-Click on a node in scene explorer).
  • Drag models into the scene explorer from the project tab.
  • Delete things (right-click in scene explorer).
  • Save Changes in Scene Explorer
  • Add a SkyBox (Right Click in Scene Explorer)
  • Generate LightProbes

To generate a lightprobe you select the node of the environment you want to be mapped. This is usually a SkyBox, but can be a regular scene, too.

@glh3586 i’m still looking into the things we discussed, I just wanted to make sure I’d completed anything else I’d left half-finished before I moved on.

2 Likes

So I’ve started accessing and displaying properties of the scene graph via reflection - so anything with a get/set method will show automatically. Some things require a custom control such as the animation controls and particle emitters. It’s a step in the right direction for injecting external editors so others can extend the ide and make their own.

7 Likes

Intellij has updated - so this plugin no longer works right now. It’s annoying me, too, because I use this a lot to import models and modify the scene. I’ll be updating it to work with 2019.3 as soon as possible.

5 Likes

A new version has been sent to jetbrains supporting the new 2019.3 IDE. Again - jetbrains takes a couple of days or so to validate the plugin, so it will be available officially when that is done.

This is quite a large update in that properties in the scenegraph are now reflected - meaning a lot more properties are now visible and available to edit - including materials.

This is a step toward being able to create your own editors - much like unity does in its IDE. We’re not quite there yet - but this is the first stage in doing so. I understand this is a much requested and needed feature. I need this feature myself(!) so progress - although slow - is on its way. I am a one-man team right now, so please try to keep that in mind.

Please do report any bugs you may find.

Cheers,
Jayfella.

11 Likes

The plugin was rejected. I had to fix a few things and re-upload it. Just awaiting the approval again…

4 Likes

I’ve come a long way into integrating things into the SDK.

It will allow you to add objects into the scene from dependencies and your current project. So if you’re using Lemur as a dependency it will register Label, Container, etc… If you’re creating something in your current project, you can also add that, too. So this is basically the functionality we need to create custom editors - both from dependencies and your current project.

The property editor can only display properties for types that it knows (Vector3f, Quaternion, etc). So if you have a type that the SDK does not know about, it can’t display it. There’s a function that allows you to register Types with an editorControl, so for example you can registerType(MyObject.class, MyEditor.class) - and whenever it finds a get/set of that type, it will display your control.

Finally, but only partially implemented so far - you can register input commands for a type. So if i click on a CrazyNode in the scene editor - it will let you bind input to the LMB or KEY_W or whatever. This means you can add debug stuff to the scene when your object is selected and interact with it,

The basic premise is this:

  • I have something (a Node, Geometry, Mesh, Control) that I want to add to the scene. In this example I just created a pointless class that extends Node and has an additional property.
  • I register that object using the intellij-integration-api interface PluginRegistrar
  • I can now add them to the scene by right-clicking a node or whatever.
public class CrazyNode extends Node {

    private float crazyFLoat;

    public float getCrazyFLoat() {
        return crazyFLoat;
    }

    public void setCrazyFLoat(float crazyFLoat) {
        this.crazyFLoat = crazyFLoat;
    }
}
public class TestIntegration extends PluginRegistrar {

    @Override
    public void registerItems() {
        registerNode(CrazyNode.class);
        registerControl(RotateControl.class, RotateControlEditor.class);
        registerType(MyCustomObject.class, CustomObjectEditor.class);
    }

}

  1. Right-click and add your new node
  2. The class that I’m actually adding (live editing in existing project)
  3. The custom properties of the node being displayed (CrazyFloat)

Yay for SDK custom editors!

I should probably mention @glh3586 since I know you’re particularly interested in this.

6 Likes

Ooooooo. This looks awesome! Is the plugin live yet? I’ve been holding off on finishing my particle editor for this :slight_smile:

No not yet. I’m still toying with the implementation. Like some things need constructor args. I can work with that, too. Like string, vector, known types could be provided. Just display a dialog for them with a drop down for which constructor they want to use.

A few days, a week maybe. :crossed_fingers:

1 Like

A new release has been pushed to IntelliJ. v1.0.5 - and will be available in around 48 hours.

Continuing on into other areas of the SDK, a few bugs were fixed, a lot of code was tidied up - and a new feature has been added: The ability to choose game templates.

This is the beginning of being able to choose pre-created templates when creating a new project. Currently only Basic and First Person Shooter are available. More will become available in future updates.

In addition, to try to push the “JME can look good” opinion, all templates have moved from the default Lighting.j3md to PBRLighting.j3md. Alongside that some default processors have been added (shadows, SSAO, FXAA, ToneMap). This just makes games look a lot better. Competing engines also do this by default, and it’s probably about time we started pushing this, too.

I hope these changes are met with positive feelings. Below is a video showcasing the two currently available templates: Basic and First Person Shooter.

8 Likes

Nice! The default post processing and a switch to PBRLighting.j3md were really needed, I’m glad they’re now a part of the default templates.

@Darkchaos any chances we get the same templates into the sdk?

2 Likes

Hi @jayfella , thanks for the plugin first of all but I can’t create a new project. The error I get is from the jmonkey integration plugin. Here is the stacktrace:

java.lang.NoClassDefFoundError: org/jetbrains/plugins/gradle/settings/GradleProjectSettings
at com.jmonkeystore.ide.newproject.JmeModuleType.createModuleBuilder(JmeModuleType.java:24)
at com.jmonkeystore.ide.newproject.JmeModuleType.createModuleBuilder(JmeModuleType.java:13)
at com.intellij.ide.util.projectWizard.ModuleBuilder.getAllBuilders(ModuleBuilder.java:63)
at com.intellij.ide.projectWizard.ProjectTypeStep.fillTemplatesMap(ProjectTypeStep.java:250)
at com.intellij.ide.projectWizard.ProjectTypeStep.<init>(ProjectTypeStep.java:102)
at com.intellij.ide.projectWizard.NewProjectWizard.init(NewProjectWizard.java:51)
at com.intellij.ide.projectWizard.NewProjectWizard.<init>(NewProjectWizard.java:40)
at com.intellij.ide.actions.NewProjectAction.actionPerformed(NewProjectAction.java:26)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:266)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:83)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:149)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:281)
at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:442)
at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:427)
at com.intellij.ui.components.labels.ActionLink$1.linkSelected(ActionLink.java:45)
at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:142)
at com.intellij.ui.components.labels.ActionLink.doClick(ActionLink.java:54)
at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:330)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6416)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
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.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
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:906)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:844)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:776)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:422)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:421)
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)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.plugins.gradle.settings.GradleProjectSettings PluginClassLoader[com.jmonkeystore.intellij-integration, 1.0.4.1] com.intellij.ide.plugins.cl.PluginClassLoader@5df66706
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:77)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 54 more
1 Like

It’s a compatibility issue when I updated the plugin from IJ 2019.2 to 2019.3 and it’s fixed in 1.0.5. It takes a couple days for IntelliJ to validate it though.

Oh, sorry, I read about the issue on the thread but thought the plugin was already updated

Yeah. The 2 day wait thing is really annoying tbh. I might set up a nightly custom update repo.

1 Like