[SOLVED] SDK Scene Composer Properties Question/Issue with Custom Controls

I’m using the RC2 SDK (not nightly), so this might of been fixed or is/was never an issue.

But I just started playing with the Scene Composer by following the online docs. I followed the “Video: jMonkeyEngine SDK - Custom Controls”, and everything worked just fine. However when I edited the “Speed” in the Properties window then saved, the speed set in the Properties is not being saved.

So I guess, my question is: should the SDK save items (values) in the properties window to the .j3o files for custom controls?

You have to implement the write/read methods, else it will not be saved, no.

1 Like

Thank you.

I added the following lines and works now:

[java]
@Override
public void write(JmeExporter ex) throws IOException
{
super.write(ex);
OutputCapsule oc = ex.getCapsule(this);
oc.write(speed, “Speed”, 1.0f);
}

@Override
public void read(JmeImporter im) throws IOException
{
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    speed = ic.readFloat("Speed", 1.0f);
}

[/java]

1 Like