-
Notifications
You must be signed in to change notification settings - Fork 312
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
image uri fix #688
image uri fix #688
Conversation
Thanks for the fix, I'll take a look at this first thing tomorrow! |
Alright, looks good for the most part, I'd just like to add a warning to our output window when we are placing textures in a directory that's not in a subdirectory of the glTF |
|
||
if (!PathUtilities.IsBelowPath(selectedFolderPath, absoluteModelPath)) | ||
{ | ||
MessageBox.Show("WARNING: folderPath should be below model file path"); | ||
CreateWarningMessage("WARNING: textures path should be below model file path, not all client renderer support this feature",0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: can you change "client renderer" to "client renderers"?
} | ||
else | ||
{ | ||
textureUri = Path.Combine(textureUri, name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On windows, we end up having backslashes in our image URI path, after getting this relative path. should we replace that with forward slashes?
@@ -482,7 +482,7 @@ private List<GLTFBufferView> SwitchImagesFromUriToBinary(GLTF gltf) | |||
|
|||
foreach (GLTFImage gltfImage in gltf.ImagesList) | |||
{ | |||
var path = Path.Combine(gltf.OutputFolder, Uri.UnescapeDataString(gltfImage.uri)); | |||
var path = Path.Combine(gltf.OutputFolder, gltfImage.uri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we no longer escaping the symbols in our path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is already unescaped in Path.GetRelativePath..this was a repetition.
the gltfimage uri is set only in L176
Everything is now managed in GetRelativePath() method Also, I do not remove the first "./" the second warning has been added too, in case a model path is set after the textures one we end up with this 3 cases:
If I did not forget some case, should be ok |
@@ -470,7 +470,11 @@ private string gltfToJson(GLTF gltf) | |||
// Use the bounded writer in case some values are infinity () | |||
using (var jsonWriter = new JsonTextWriterBounded(sw)) | |||
{ | |||
#if DEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! This did expose some issue with our model loader, but the current location designator doesn't violate the glTF uri schema. I filed BabylonJS/Babylon.js#7210 to address this properly.
I don't think this is an issue in your formatting.
This should be ok
I also changed the UI as requested
#685