Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
7c211114
Commit
7c211114
authored
1 year ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix loading local GLTF materials on case sensitive file systems
parent
25f82bb8
No related branches found
No related tags found
2 merge requests
!3
Update to main branch
,
!2
Rebase onto current main branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/lltinygltfhelper.cpp
+6
-9
6 additions, 9 deletions
indra/newview/lltinygltfhelper.cpp
with
6 additions
and
9 deletions
indra/newview/lltinygltfhelper.cpp
+
6
−
9
View file @
7c211114
...
@@ -194,26 +194,23 @@ bool LLTinyGLTFHelper::loadModel(const std::string& filename, tinygltf::Model& m
...
@@ -194,26 +194,23 @@ bool LLTinyGLTFHelper::loadModel(const std::string& filename, tinygltf::Model& m
std
::
string
error_msg
;
std
::
string
error_msg
;
std
::
string
warn_msg
;
std
::
string
warn_msg
;
std
::
string
filename_lc
=
filename
;
LLStringUtil
::
toLower
(
filename_lc
);
// Load a tinygltf model fom a file. Assumes that the input filename has already been
// Load a tinygltf model fom a file. Assumes that the input filename has already been
// been sanitized to one of (.gltf , .glb) extensions, so does a simple find to distinguish.
// been sanitized to one of (.gltf , .glb) extensions, so does a simple find to distinguish.
bool
decode_successful
=
false
;
bool
decode_successful
=
false
;
if
(
std
::
string
::
npos
==
filename_lc
.
rfind
(
".gltf
"
)
)
if
(
exten
==
"glb
"
)
{
// file is binary
{
// file is binary
decode_successful
=
loader
.
LoadBinaryFromFile
(
&
model_in
,
&
error_msg
,
&
warn_msg
,
filename
_lc
);
decode_successful
=
loader
.
LoadBinaryFromFile
(
&
model_in
,
&
error_msg
,
&
warn_msg
,
filename
);
}
}
else
else
{
// file is ascii
{
// file is ascii
decode_successful
=
loader
.
LoadASCIIFromFile
(
&
model_in
,
&
error_msg
,
&
warn_msg
,
filename
_lc
);
decode_successful
=
loader
.
LoadASCIIFromFile
(
&
model_in
,
&
error_msg
,
&
warn_msg
,
filename
);
}
}
if
(
!
decode_successful
)
if
(
!
decode_successful
)
{
{
LL_WARNS
(
"GLTF"
)
<<
"Cannot load, error: Failed to decode"
<<
error_msg
LL_WARNS
(
"GLTF"
)
<<
"Cannot load, error: Failed to decode
with error: '
"
<<
error_msg
<<
", warning:"
<<
warn_msg
<<
"
'
, warning:
'
"
<<
warn_msg
<<
" file: "
<<
filename
<<
"
'
file: "
<<
filename
<<
LL_ENDL
;
<<
LL_ENDL
;
return
false
;
return
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment