Skip to content

MaterialEditor: MorphWeights - wrong parameter type. #594

Closed
@capdevon

Description

@capdevon

Hi guys,
the MorphWeights parameter is a FloatArray not a Float.

See PBRLighting.j3md

        // For Morph animation
        FloatArray MorphWeights
        Int NumberOfMorphTargets
        Int NumberOfTargetsBuffers

Its representation in the Options tab of the Material Editor is wrong.
image

The problem should be caused by the incorrect defLine.startsWith(string) and defLine.replaceFirst() algorithm when string = "Float" and defLine starts with FloatArray:

https://github.com/jMonkeyEngine/sdk/blob/master/jme3-materialeditor/src/com/jme3/gde/materials/EditableMaterialFile.java#L243

    private static final String[] variableTypes = new String[]{
            "Int", 
            "Boolean", 
            "Float", 
            "Vector2", 
            "Vector3", 
            "Vector4", 
            "Color", 
            "Texture2D", 
            "Texture3D", 
            "TextureArray", 
            "TextureBuffer", 
            "TextureCubeMap" };
        for (String string : variableTypes) {
            if (defLine.startsWith(string)) {
                final String propName = MaterialUtils.trimName(defLine.replaceFirst(string, ""));
                matDefEntries.add(propName);
                ...
            }
        }

Output:
MaterialProperty [type=Float, name=Array ShadowMapSize, value=]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions