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
3ac80d7e
Commit
3ac80d7e
authored
2 years ago
by
David Parks
Browse files
Options
Downloads
Plain Diff
Merge branch 'DRTVWR-559' of
ssh://bitbucket.org/lindenlab/viewer
into DRTVWR-559
parents
07bca31e
15ac2f67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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/lllocalgltfmaterials.cpp
+75
-65
75 additions, 65 deletions
indra/newview/lllocalgltfmaterials.cpp
with
75 additions
and
65 deletions
indra/newview/lllocalgltfmaterials.cpp
+
75
−
65
View file @
3ac80d7e
...
@@ -134,83 +134,93 @@ bool LLLocalGLTFMaterial::getValid()
...
@@ -134,83 +134,93 @@ bool LLLocalGLTFMaterial::getValid()
/* update functions */
/* update functions */
bool
LLLocalGLTFMaterial
::
updateSelf
()
bool
LLLocalGLTFMaterial
::
updateSelf
()
{
{
bool
updated
=
false
;
bool
updated
=
false
;
if
(
mLinkStatus
==
LS_ON
)
if
(
mLinkStatus
==
LS_ON
)
{
{
// verifying that the file exists
// verifying that the file exists
if
(
gDirUtilp
->
fileExists
(
mFilename
))
if
(
gDirUtilp
->
fileExists
(
mFilename
))
{
{
// verifying that the file has indeed been modified
// verifying that the file has indeed been modified
#ifndef LL_WINDOWS
#ifndef LL_WINDOWS
const
std
::
time_t
temp_time
=
boost
::
filesystem
::
last_write_time
(
boost
::
filesystem
::
path
(
mFilename
));
const
std
::
time_t
temp_time
=
boost
::
filesystem
::
last_write_time
(
boost
::
filesystem
::
path
(
mFilename
));
#else
#else
const
std
::
time_t
temp_time
=
boost
::
filesystem
::
last_write_time
(
boost
::
filesystem
::
path
(
utf8str_to_utf16str
(
mFilename
)));
const
std
::
time_t
temp_time
=
boost
::
filesystem
::
last_write_time
(
boost
::
filesystem
::
path
(
utf8str_to_utf16str
(
mFilename
)));
#endif
#endif
LLSD
new_last_modified
=
asctime
(
localtime
(
&
temp_time
));
LLSD
new_last_modified
=
asctime
(
localtime
(
&
temp_time
));
if
(
mLastModified
.
asString
()
!=
new_last_modified
.
asString
())
if
(
mLastModified
.
asString
()
!=
new_last_modified
.
asString
())
{
{
LLPointer
<
LLGLTFMaterial
>
raw_material
=
new
LLGLTFMaterial
();
LLPointer
<
LLGLTFMaterial
>
raw_material
;
if
(
loadMaterial
(
raw_material
,
mMaterialIndex
))
if
(
mWorldID
.
notNull
())
{
{
// decode is successful, we can safely proceed.
// update existing material
// will create a new one if material doesn't exist yet
raw_material
=
gGLTFMaterialList
.
getMaterial
(
mWorldID
);
}
else
{
raw_material
=
new
LLGLTFMaterial
();
}
if
(
loadMaterial
(
raw_material
,
mMaterialIndex
))
{
// decode is successful, we can safely proceed.
if
(
mWorldID
.
isNull
())
if
(
mWorldID
.
isNull
())
{
{
mWorldID
.
generate
();
mWorldID
.
generate
();
}
}
mLastModified
=
new_last_modified
;
mLastModified
=
new_last_modified
;
// will replace material if it already exists
// will replace material if it already exists
gGLTFMaterialList
.
addMaterial
(
mWorldID
,
raw_material
);
gGLTFMaterialList
.
addMaterial
(
mWorldID
,
raw_material
);
mUpdateRetries
=
LL_LOCAL_UPDATE_RETRIES
;
mUpdateRetries
=
LL_LOCAL_UPDATE_RETRIES
;
updated
=
true
;
updated
=
true
;
}
}
// if decoding failed, we get here and it will attempt to decode it in the next cycles
// if decoding failed, we get here and it will attempt to decode it in the next cycles
// until mUpdateRetries runs out. this is done because some software lock the material while writing to it
// until mUpdateRetries runs out. this is done because some software lock the material while writing to it
else
else
{
{
if
(
mUpdateRetries
)
if
(
mUpdateRetries
)
{
{
mUpdateRetries
--
;
mUpdateRetries
--
;
}
}
else
else
{
{
LL_WARNS
()
<<
"During the update process the following file was found"
<<
"
\n
"
LL_WARNS
()
<<
"During the update process the following file was found"
<<
"
\n
"
<<
"but could not be opened or decoded for "
<<
LL_LOCAL_UPDATE_RETRIES
<<
" attempts."
<<
"
\n
"
<<
"but could not be opened or decoded for "
<<
LL_LOCAL_UPDATE_RETRIES
<<
" attempts."
<<
"
\n
"
<<
"Filename: "
<<
mFilename
<<
"
\n
"
<<
"Filename: "
<<
mFilename
<<
"
\n
"
<<
"Disabling further update attempts for this file."
<<
LL_ENDL
;
<<
"Disabling further update attempts for this file."
<<
LL_ENDL
;
LLSD
notif_args
;
LLSD
notif_args
;
notif_args
[
"FNAME"
]
=
mFilename
;
notif_args
[
"FNAME"
]
=
mFilename
;
notif_args
[
"NRETRIES"
]
=
LL_LOCAL_UPDATE_RETRIES
;
notif_args
[
"NRETRIES"
]
=
LL_LOCAL_UPDATE_RETRIES
;
LLNotificationsUtil
::
add
(
"LocalBitmapsUpdateFailedFinal"
,
notif_args
);
LLNotificationsUtil
::
add
(
"LocalBitmapsUpdateFailedFinal"
,
notif_args
);
mLinkStatus
=
LS_BROKEN
;
mLinkStatus
=
LS_BROKEN
;
}
}
}
}
}
}
}
// end if file exists
}
// end if file exists
else
else
{
{
LL_WARNS
()
<<
"During the update process, the following file was not found."
<<
"
\n
"
LL_WARNS
()
<<
"During the update process, the following file was not found."
<<
"
\n
"
<<
"Filename: "
<<
mFilename
<<
"
\n
"
<<
"Filename: "
<<
mFilename
<<
"
\n
"
<<
"Disabling further update attempts for this file."
<<
LL_ENDL
;
<<
"Disabling further update attempts for this file."
<<
LL_ENDL
;
LLSD
notif_args
;
LLSD
notif_args
;
notif_args
[
"FNAME"
]
=
mFilename
;
notif_args
[
"FNAME"
]
=
mFilename
;
LLNotificationsUtil
::
add
(
"LocalBitmapsUpdateFileNotFound"
,
notif_args
);
LLNotificationsUtil
::
add
(
"LocalBitmapsUpdateFileNotFound"
,
notif_args
);
mLinkStatus
=
LS_BROKEN
;
mLinkStatus
=
LS_BROKEN
;
}
}
}
}
return
updated
;
return
updated
;
}
}
bool
LLLocalGLTFMaterial
::
loadMaterial
(
LLPointer
<
LLGLTFMaterial
>
mat
,
S32
index
)
bool
LLLocalGLTFMaterial
::
loadMaterial
(
LLPointer
<
LLGLTFMaterial
>
mat
,
S32
index
)
...
...
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