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

Fix #463 by allowing other texture settings and only changing Flip an… #467

Merged

Conversation

neph1
Copy link
Contributor

@neph1 neph1 commented Feb 6, 2023

…d Repeat

This is a preliminary fix. Not ready to merge yet.
I'd like a second set of eyes before merging.

So the cause was that all those "new" settings have never been implemented in the Material Editor.
Implementing all those is an undertaking I'm not ready to do right now. So my proposed interim solution is to not care about other settings than "Flip" and "Repeat", but not overwrite them either. This allows advanced users to keep modifying their materials in the Material Editor (but preview might be wrong? I'm not familiar with the settings).

Edit: Still need to update TexturePanelSquare. Only used in shader editor, I think

@@ -54,7 +54,8 @@ public void run() {
if (texPreview == null) {
texPreview = new TexturePreview(manager);
}
texPreview.requestPreview(stripQuotes(textureName), "", 80, 25, texturePreview, null);
final String[] textureNameComponents = textureName.split(" ");
texPreview.requestPreview(stripQuotes(textureNameComponents[textureNameComponents.length-1]), "", 80, 25, texturePreview, null);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split and take last segment to get actual texture name

}
propertyValue += textureName;
property.setValue(propertyValue);
texturePreview.setToolTipText(propertyValue);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't replace whole line, just modify Flip and Repeat, if they exist

}
property.setValue(textureName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler?

@neph1 neph1 linked an issue Feb 7, 2023 that may be closed by this pull request
@neph1 neph1 added this to the 3.6 milestone Feb 10, 2023
@neph1
Copy link
Contributor Author

neph1 commented Feb 11, 2023

The following tests have been performed:

  • Loading/saving settings on the texture line
  • Editing Flip/Repeat with/without other settings on the texture line
  • Loading material in application with/without various settings

If someone wants to test this themselves, please do. Otherwise I'll merge this after an unspecified amount of time.

@neph1 neph1 marked this pull request as ready for review February 11, 2023 08:27
@neph1 neph1 merged commit 472629c into jMonkeyEngine:master Feb 17, 2023
@neph1 neph1 deleted the Fix_for_463_Material_parsing_problem branch May 6, 2023 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Material parsing problem
1 participant