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
87fd7cbe
Commit
87fd7cbe
authored
5 years ago
by
andreykproductengine
Browse files
Options
Downloads
Patches
Plain Diff
SL-12289 'Copy media face' support
parent
360f2eb0
No related branches found
No related tags found
1 merge request
!83
Merge Linden 6.6.7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llpanelface.cpp
+68
-15
68 additions, 15 deletions
indra/newview/llpanelface.cpp
with
68 additions
and
15 deletions
indra/newview/llpanelface.cpp
+
68
−
15
View file @
87fd7cbe
...
@@ -2912,6 +2912,7 @@ void LLPanelFace::onCopyFaces()
...
@@ -2912,6 +2912,7 @@ void LLPanelFace::onCopyFaces()
{
{
LLSD
te_data
;
LLSD
te_data
;
// asLLSD() includes media
te_data
[
"te"
]
=
tep
->
asLLSD
();
te_data
[
"te"
]
=
tep
->
asLLSD
();
te_data
[
"te"
][
"glow"
]
=
tep
->
getGlow
();
te_data
[
"te"
][
"glow"
]
=
tep
->
getGlow
();
te_data
[
"te"
][
"shiny"
]
=
tep
->
getShiny
();
te_data
[
"te"
][
"shiny"
]
=
tep
->
getShiny
();
...
@@ -3002,8 +3003,6 @@ void LLPanelFace::onCopyFaces()
...
@@ -3002,8 +3003,6 @@ void LLPanelFace::onCopyFaces()
te_data
[
"material"
]
=
mat_data
;
te_data
[
"material"
]
=
mat_data
;
}
}
//*TODO: Media
mClipboard
.
append
(
te_data
);
mClipboard
.
append
(
te_data
);
}
}
}
}
...
@@ -3116,7 +3115,7 @@ void LLPanelFace::pasteFace(LLViewerObject* objectp, S32 te)
...
@@ -3116,7 +3115,7 @@ void LLPanelFace::pasteFace(LLViewerObject* objectp, S32 te)
// Color / Alpha
// Color / Alpha
if
((
mPasteColor
||
mPasteAlpha
)
&&
te_data
[
"te"
].
has
(
"colors"
))
if
((
mPasteColor
||
mPasteAlpha
)
&&
te_data
[
"te"
].
has
(
"colors"
))
{
{
LLColor4
color
=
objectp
->
getTE
(
te
)
->
getColor
();
LLColor4
color
=
tep
->
getColor
();
LLColor4
clip_color
;
LLColor4
clip_color
;
clip_color
.
setValue
(
te_data
[
"te"
][
"colors"
]);
clip_color
.
setValue
(
te_data
[
"te"
][
"colors"
]);
...
@@ -3167,19 +3166,20 @@ void LLPanelFace::pasteFace(LLViewerObject* objectp, S32 te)
...
@@ -3167,19 +3166,20 @@ void LLPanelFace::pasteFace(LLViewerObject* objectp, S32 te)
}
}
}
}
// Media
// Media
if
(
mPasteMedia
&&
te_data
.
has
(
"media
"
))
//te_data["te"]?
if
(
mPasteMedia
&&
te_data
[
"te"
]
.
has
(
"media
_flags"
))
{
{
//*TODO
U8
media_flags
=
te_data
[
"te"
][
"media_flags"
].
asInteger
();
objectp
->
setTEMediaFlags
(
te
,
media_flags
);
LLVOVolume
*
vo
=
dynamic_cast
<
LLVOVolume
*>
(
objectp
);
if
(
vo
&&
te_data
[
"te"
].
has
(
LLTextureEntry
::
TEXTURE_MEDIA_DATA_KEY
))
{
vo
->
syncMediaData
(
te
,
te_data
[
"te"
][
LLTextureEntry
::
TEXTURE_MEDIA_DATA_KEY
],
true
/*merge*/
,
true
/*ignore_agent*/
);
}
}
}
else
else
{
{
// // Keep media flags on destination unchanged
// Keep media flags on destination unchanged
// // Media is handled later
// if (te_data["te"].has("media_flags"))
// {
// te_data["te"]["media_flags"] = tep->getMediaTexGen();
// }
}
}
}
}
...
@@ -3261,13 +3261,66 @@ struct LLPanelFacePasteTexFunctor : public LLSelectedTEFunctor
...
@@ -3261,13 +3261,66 @@ struct LLPanelFacePasteTexFunctor : public LLSelectedTEFunctor
LLPanelFace
*
mPanelFace
;
LLPanelFace
*
mPanelFace
;
};
};
struct
LLPanelFaceUpdateFunctor
:
public
LLSelectedObjectFunctor
{
LLPanelFaceUpdateFunctor
(
bool
update_media
)
:
mUpdateMedia
(
update_media
)
{}
virtual
bool
apply
(
LLViewerObject
*
object
)
{
object
->
sendTEUpdate
();
if
(
mUpdateMedia
)
{
LLVOVolume
*
vo
=
dynamic_cast
<
LLVOVolume
*>
(
object
);
if
(
vo
&&
vo
->
hasMedia
())
{
vo
->
sendMediaDataUpdate
();
}
}
return
true
;
}
private
:
bool
mUpdateMedia
;
};
struct
LLPanelFaceNavigateHomeFunctor
:
public
LLSelectedTEFunctor
{
virtual
bool
apply
(
LLViewerObject
*
objectp
,
S32
te
)
{
if
(
objectp
&&
objectp
->
getTE
(
te
))
{
LLTextureEntry
*
tep
=
objectp
->
getTE
(
te
);
const
LLMediaEntry
*
media_data
=
tep
->
getMediaData
();
if
(
media_data
)
{
if
(
media_data
->
getCurrentURL
().
empty
()
&&
media_data
->
getAutoPlay
())
{
viewer_media_t
media_impl
=
LLViewerMedia
::
getMediaImplFromTextureID
(
tep
->
getMediaData
()
->
getMediaID
());
if
(
media_impl
)
{
media_impl
->
navigateHome
();
}
}
}
}
return
true
;
}
};
void
LLPanelFace
::
onPasteFaces
()
void
LLPanelFace
::
onPasteFaces
()
{
{
LLObjectSelectionHandle
selected_objects
=
LLSelectMgr
::
getInstance
()
->
getSelection
();
LLPanelFacePasteTexFunctor
paste_func
(
this
);
LLPanelFacePasteTexFunctor
paste_func
(
this
);
LLSelectMgr
::
getInstance
()
->
getSelection
()
->
applyToTEs
(
&
paste_func
);
selected_objects
->
applyToTEs
(
&
paste_func
);
LLPanelFaceUpdateFunctor
sendfunc
(
mPasteMedia
);
selected_objects
->
applyToObjects
(
&
sendfunc
);
LLPanelFaceSendFunctor
sendfunc
;
if
(
mPasteMedia
)
LLSelectMgr
::
getInstance
()
->
getSelection
()
->
applyToObjects
(
&
sendfunc
);
{
LLPanelFaceNavigateHomeFunctor
navigate_home_func
;
selected_objects
->
applyToTEs
(
&
navigate_home_func
);
}
}
}
bool
LLPanelFace
::
pasteCheckMenuItem
(
const
LLSD
&
userdata
)
bool
LLPanelFace
::
pasteCheckMenuItem
(
const
LLSD
&
userdata
)
...
...
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