Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
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
Alchemy Viewer
Alchemy Viewer
Commits
0b677dd2
Commit
0b677dd2
authored
14 years ago
by
Brad Payne (Vir Linden)
Browse files
Options
Downloads
Patches
Plain Diff
SH-1491 WIP - whole model upload for fee request
parent
369b3444
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llmeshrepository.cpp
+43
-0
43 additions, 0 deletions
indra/newview/llmeshrepository.cpp
with
43 additions
and
0 deletions
indra/newview/llmeshrepository.cpp
+
43
−
0
View file @
0b677dd2
...
@@ -1362,6 +1362,12 @@ void LLMeshUploadThread::run()
...
@@ -1362,6 +1362,12 @@ void LLMeshUploadThread::run()
}
}
}
}
void
dumpLLSDToFile
(
LLSD
&
content
,
std
::
string
&
filename
)
{
std
::
ofstream
of
(
filename
);
LLSDSerialize
::
toXML
(
content
,
of
);
}
LLSD
LLMeshUploadThread
::
wholeModelToLLSD
(
bool
include_textures
)
LLSD
LLMeshUploadThread
::
wholeModelToLLSD
(
bool
include_textures
)
{
{
// TODO where do textures go?
// TODO where do textures go?
...
@@ -1376,7 +1382,11 @@ LLSD LLMeshUploadThread::wholeModelToLLSD(bool include_textures)
...
@@ -1376,7 +1382,11 @@ LLSD LLMeshUploadThread::wholeModelToLLSD(bool include_textures)
LLSD
res
;
LLSD
res
;
res
[
"mesh_list"
]
=
LLSD
::
emptyArray
();
res
[
"mesh_list"
]
=
LLSD
::
emptyArray
();
res
[
"texture_list"
]
=
LLSD
::
emptyArray
();
S32
mesh_num
=
0
;
S32
mesh_num
=
0
;
S32
texture_num
=
0
;
std
::
set
<
LLViewerTexture
*
>
textures
;
for
(
instance_map
::
iterator
iter
=
mInstance
.
begin
();
iter
!=
mInstance
.
end
();
++
iter
)
for
(
instance_map
::
iterator
iter
=
mInstance
.
begin
();
iter
!=
mInstance
.
end
();
++
iter
)
{
{
...
@@ -1425,11 +1435,44 @@ LLSD LLMeshUploadThread::wholeModelToLLSD(bool include_textures)
...
@@ -1425,11 +1435,44 @@ LLSD LLMeshUploadThread::wholeModelToLLSD(bool include_textures)
res
[
"mesh_list"
][
mesh_num
]
=
mesh_entry
;
res
[
"mesh_list"
][
mesh_num
]
=
mesh_entry
;
if
(
mUploadTextures
)
{
for
(
std
::
vector
<
LLImportMaterial
>::
iterator
material_iter
=
instance
.
mMaterial
.
begin
();
material_iter
!=
instance
.
mMaterial
.
end
();
++
material_iter
)
{
if
(
textures
.
find
(
material_iter
->
mDiffuseMap
.
get
())
==
textures
.
end
())
{
textures
.
insert
(
material_iter
->
mDiffuseMap
.
get
());
std
::
stringstream
ostr
;
if
(
include_textures
)
// otherwise data is blank.
{
LLTextureUploadData
data
(
material_iter
->
mDiffuseMap
.
get
(),
material_iter
->
mDiffuseMapLabel
);
if
(
!
data
.
mTexture
->
isRawImageValid
())
{
data
.
mTexture
->
reloadRawImage
(
data
.
mTexture
->
getDiscardLevel
());
}
LLPointer
<
LLImageJ2C
>
upload_file
=
LLViewerTextureList
::
convertToUploadFile
(
data
.
mTexture
->
getRawImage
());
ostr
.
write
((
const
char
*
)
upload_file
->
getData
(),
upload_file
->
getDataSize
());
}
LLSD
texture_entry
;
texture_entry
[
"texture_data"
]
=
ostr
.
str
();
res
[
"texture_list"
][
texture_num
]
=
texture_entry
;
texture_num
++
;
}
}
}
mesh_num
++
;
mesh_num
++
;
}
}
result
[
"asset_resources"
]
=
res
;
result
[
"asset_resources"
]
=
res
;
dumpLLSDToFile
(
result
,
std
::
string
(
"whole_model.xml"
));
return
result
;
return
result
;
}
}
...
...
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