-
Notifications
You must be signed in to change notification settings - Fork 129
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
Update oc_meshlabel.lsl #933
Conversation
Ref Issue #932
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.
Okay SO... the reason why the nohide tag is set is that the label scripts can turn the label on and off themselves. If we simply remove the nohide tag as per this pull, then if you switch the label off and then hide the collar, these prims will get hidden. When you show the collar again, these prims will then be set opaque and show, despite the label supposedly being hidden.
What needs to be done for the label scripts is to keep the nohide tag, but check for the global_hide variable being set. So in the LM_SETTINGS_RESPONSE section of the link message event, where we check for globals (line 514) add another check after the checkboxes value,
if(sToken=="hide") {
if(sValue=="1") g_iHide==TRUE;
else g_iHide==FALSE;
SetLabelBaseAlpha();
}
Then we need to fix the SetLabelBaseAlpha() function by deleting the if(g_iHide) return; and making it set the alpha to transparent if either g_iHide is true OR g_iShow is false, or opaque if g_IHide is false AND g_iShow is true. So before the for loop, define:
integer iVal=0;
if (g_iHide==FALSE&&g_iShow==TRUE) iVal==1;
Then replace the g_iShow inside the for loop ( lines 262 and 263) with iVal.
Finally, remove the if (iChange & CHANGED_COLOR) section in the changed event. This is attempting to set the g_iHide based on a change event being triggered by the collar going transparent, however it'll break if the root prim is always transparent, and clashes with the if(g_iHide) return inSetLabelBaseAlpha();
I haven't tested any of this of course but I think that'll do it.
I was able, I think, to put the changes suggested into a clean version of the oc_meshlabel script, and it compiled fine in SL. However, the changes didn't have the desired effect. The Meshlable object did not turn alpha with the rest of the collar when using the Collar Hide command. |
Why do we need the label and meshlabel to show/hide independently of the collar? I can't think of any purpose for that and suspect it's been broken for years. Just take out that "feature". |
I revisited this script bug fix and I stand by my comments from February 2.
|
This needs @Medea-Destiny to take another look and clarify, and resolve this so we can move on the pr. |
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.
Yeah this is fine.
So, on closer inspection the setlabel function is called after anything happens in UserCommand, so after hiding the mesh label prims by setting the alpha, it then also overwrites them with spaces. When you use hide then show in the collar settings menu it will indeed show the mesh label prims as I assumed; however because they're showing spaces if they've been hidden, you don't see anything. Setting the mesh label faces to transparent is actually pointless given they're set to spaces immediately afterwards anyway. Ugh.
One small change needed, @Pingout : credit note/date at the top with brief description of the change and ref to issue #932. Thanks!
Revised description based on suggestion from Medea
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.
Works as intended.
Ref Issue #932