Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material parsing problem #463

Closed
neph1 opened this issue Feb 3, 2023 · 1 comment · Fixed by #467
Closed

Material parsing problem #463

neph1 opened this issue Feb 3, 2023 · 1 comment · Fixed by #467

Comments

@neph1
Copy link
Contributor

neph1 commented Feb 3, 2023

As reported in: https://hub.jmonkeyengine.org/t/textures-materials-and-sdk/46413/7

Some material properties have problem parsing:
Error while locating rapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_diffuse.jpg
com.jme3.asset.AssetNotFoundException: rapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_diffuse.jpg (Flipped)

I did some changes to make the editor parse the values of the materials correctly a while back. It could be related to that. Or, the SDK has had issues parsing the texture line before, the quotation marks, several years ago. Maybe it's a left over from that.

@neph1
Copy link
Contributor Author

neph1 commented Feb 3, 2023

The problem seems to lie in TexturePanel:

protected void readProperty() {
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                if (property.getValue().startsWith("Flip Repeat ")) {
                    flip = true;
                    repeat = true;
                    textureName = property.getValue().replaceFirst("Flip Repeat ", "").trim();
                } else if (property.getValue().startsWith("Flip ")) {
                    flip = true;
                    textureName = property.getValue().replaceFirst("Flip ", "").trim();
                } else if (property.getValue().startsWith("Repeat ")) {
                    repeat = true;
                    textureName = property.getValue().replaceFirst("Repeat ", "").trim();
                } else {
                    textureName = property.getValue();
                }
                jLabel1.setText(property.getName());
                jLabel1.setToolTipText(property.getName());
                displayPreview();
                texturePreview.setToolTipText(property.getValue());
                MaterialProperty prop = property;
                property = null;
                jCheckBox1.setSelected(flip);
                jCheckBox2.setSelected(repeat);
                property = prop;
            }
        });
    }

This is all that's handled. Commenting out this loads the material, at least...

To be continued...

@neph1 neph1 added this to the 3.6 milestone Feb 3, 2023
neph1 added a commit to neph1/sdk that referenced this issue Feb 6, 2023
neph1 added a commit to neph1/sdk that referenced this issue Feb 6, 2023
neph1 added a commit that referenced this issue Feb 17, 2023
#467)

* Fix #463 by allowing other texture settings and only changing Flip and Repeat

* updated TexturePanelSquare

* formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant