Plugin Compile Error

Hi,



I’m sorry for asking stupid questions, but I can’t seem to figure the following things out:



https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_controls

Custom Controls - YouTube

In that video a custom control is created, and the primitive data types magically appear in the properties window. I tried the same with a Light as member of custom control, it did appear in the properties window but was not editable. Can I make it editable somehow, or does this only work with primitive data types?



Which leads me to my second question:

The SceneExplorer :: jMonkeyEngine Docs

Based upon this documentation, I wrote the following classes:



[java]package com.mycompany.plugins.mylibrary;



import com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode;

import com.jme3.scene.LightNode;

import java.awt.Image;

import org.openide.util.ImageUtilities;

import com.jme3.gde.core.sceneexplorer.nodes.JmeSpatial;

import com.jme3.gde.core.sceneexplorer.nodes.JmeSpatialChildren;

import com.jme3.material.Material;

import com.jme3.scene.Mesh;

import org.openide.nodes.Sheet;



@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)

public class JmeLightNode extends JmeSpatial {



private static Image smallImage =

ImageUtilities.loadImage(“com/jme3/gde/core/sceneexplorer/nodes/icons/geometry.gif”);

private LightNode geom;



public JmeLightNode() {

}



public JmeLightNode(LightNode spatial, JmeSpatialChildren children) {

super(spatial, children);

getLookupContents().add(spatial);

this.geom = spatial;

setName(spatial.getName());

}



@Override

public Image getIcon(int type) {

return smallImage;

}



@Override

public Image getOpenedIcon(int type) {

return smallImage;

}



@Override

protected Sheet createSheet() {

Sheet sheet = super.createSheet();

Sheet.Set set = Sheet.createPropertiesSet();

set.setDisplayName(“LightNode”);

set.setName(LightNode.class.getName());

LightNode obj = geom;//getLookup().lookup(Geometry.class);

if (obj == null) {

return sheet;

}



//set.put(makeProperty(obj, int.class, “getLodLevel”, “setLodLevel”, “Lod Level”));

// set.put(makeProperty(obj, Material.class, “getMaterial”, “setMaterial”, “Material”));

// set.put(makeProperty(obj, Mesh.class, “getMesh”, “Mesh”));



sheet.put(set);

return sheet;



}



public Class getExplorerObjectClass() {

return LightNode.class;

}



public Class getExplorerNodeClass() {

return JmeLightNode.class;

}



public org.openide.nodes.Node[] createNodes(Object key, Object key2, boolean readOnly) {

JmeSpatialChildren children = new JmeSpatialChildren((com.jme3.scene.Spatial)key);

children.setReadOnly(readOnly);

return new org.openide.nodes.Node[]{new JmeLightNode((LightNode) key, children).setReadOnly(readOnly)};

}

}[/java]



[java]package com.mycompany.plugins.mylibrary;



import com.jme3.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialAction;

import com.jme3.gde.core.sceneexplorer.nodes.actions.NewSpatialAction;

import com.jme3.scene.LightNode;

import com.jme3.scene.Node;

import com.jme3.scene.Spatial;



@org.openide.util.lookup.ServiceProvider(service = NewSpatialAction.class)

public class LightNodeSpatialAction extends AbstractNewSpatialAction {



public LightNodeSpatialAction() {

name = “LightNode”;

}



@Override

protected Spatial doCreateSpatial(Node parent) {

Spatial spatial = new LightNode();

return spatial;

}

}[/java]



I did this in a normal project, and even though it did compile, the “LightNode” did not appear in the SceneExplorer window popup as “Add Spatial” item. So my question is does this only work in a plugin project, or did I do something else wrong?



And this finally leads me to my third question:

Creating a jMonkeyEngine SDK plugin :: jMonkeyEngine Docs

Based upon the instructions under “Using jMonkeyEngine SDK for development (preferred)” I created a plugin project, and put those two classes inside the plugin project. When I try building the project, the following error appears in the output window:

“C:UsersconstructorDocumentsjmonkeyNeuer Ordnertrunksdksuite1module1build.xml:7: The following error occurred while executing this line:

C:UsersconstructorDocumentsjmonkeyNeuer Ordnertrunksdksuite1module1nbprojectbuild-impl.xml:22: You must define ‘nbplatform.jMonkeyEngine_SDK_3.0beta.harness.dir’”

What do I have to do to fix that? For starters I can’t even seem to find that xml files, nor do I know what’s meant with defining that harness thingy.



I added a screenshot of my project folder, maybe it helps (probably not). http://i.imgur.com/x9rGk.png

It only works for data types that you either provide an editor for or primitive types / types where editors exist (Vector3f, ColorRGBA etc.), yeah.

The harness problem is strange, check in the suite setzings what “Platform” is defined there, if there is none and none can be selected, add the SDK application folder as a platform and set that for the proejct.

1 Like

Hi,



thanks for your quick reply. I selected the installation folder of jMonkey during the suite creation process, as there was no platform listed at that time. Right now it looks like this: http://i.imgur.com/MtmOI.png

Furthermore this is what it’s options look like: http://i.imgur.com/PMljN.png

Hm, maybe try restarting the SDK or if that doesn’t help try actually defining that path in the project.properties file (possibly under “nbprojects/private” if you inted to share the project later or collaborrate on it with others)

1 Like

I restarted the SDK but the problem remains.

As for adding it to project.properties: I’m not sure what to add there, I suspect I should have a folder called harness, but I can’t find one. Maybe installing a normal netbeans will give me harness folder which I can use.

Thats strange, the harness folder should be in the SDK… or maybe its being installed in its settings folder if the application directory isn’t writable? Do you use the stable version of the SDK with all updates?

1 Like

I’m using the download from http://hub.jmonkeyengine.org/downloads/?did=1

And in Tools->Plugins I activated all Settings options (so I’m using the nightly stuff), and installed all Updates. Plus I also installed a handful of the Plugins available and also installed their Updates.



Right now I chose harness from Netbeans 7.1.2 which seems to work, the error is gone.

Thanks for your quick help. :slight_smile:

1 Like

Okay, happy you got it working. Thanks for reporting back.

1 Like