jMonkeyEngine / jmonkeyengine

A complete 3-D game development suite written in Java.
http://jmonkeyengine.org
BSD 3-Clause "New" or "Revised" License
3.78k stars 1.12k forks source link

ShaderNodeDefinition.write(): serialization error of the variable 'outputs' #2034

Closed capdevon closed 1 year ago

capdevon commented 1 year ago

https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/shader/ShaderNodeDefinition.java#L204

    /**
     * jme serialization (not used)
     *
     * @param ex the exporter
     * @throws IOException from the exporter
     */
    @Override
    public void write(JmeExporter ex) throws IOException {
        OutputCapsule oc = ex.getCapsule(this);
        oc.write(name, "name", "");
        String[] str = new String[shadersLanguage.size()];
        oc.write(shadersLanguage.toArray(str), "shadersLanguage", null);
        oc.write(shadersPath.toArray(str), "shadersPath", null);
        oc.write(type, "type", null);
        oc.writeSavableArrayList((ArrayList) inputs, "inputs", new ArrayList<ShaderNodeVariable>());
        oc.writeSavableArrayList((ArrayList) outputs, "inputs", new ArrayList<ShaderNodeVariable>()); // <-- error
        //oc.writeSavableArrayList((ArrayList) outputs, "outputs", new ArrayList<ShaderNodeVariable>()); // <-- correction
    }
stephengold commented 1 year ago

Good catch! Thanks for bringing it to our attention.