Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-19 02:58:58



Reply to topic  [ 15 posts ]  Go to page 1, 2  Next
Derendering All Avatars 
Author Message

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
This is a simplistic Lua script which uses a command pulled from chat text to enable derendering avatars rezzing after the command is invoked. It leverages the callbacks OnSendChat() and OnAvatarRezzing() via Cool VL Viewer's Lua scripting as defined here. Once loaded, it is invoked with /da [on|off]. Passing no argument displays the current state.

When enabled, all newly rezzing avatars (except friends) will be requested to derender via DerenderObject(). An array (Lua table) will hold the ids of derendered avatars, such that when the function is disabled, the viewer can be instructed to allow rendering again for those avatars when a server update occurs for them. Note: avatars will not derender/rerender immediately. See the documentation listed above for details.

I make no warranties for this script and it is a 'use at your own risk'. The enabled state is not preserved between viewer restarts or indeed Lua script reloads. I have extracted the attached script from my larger, master script. Feel free to use and alter as you will. I will try to answer questions related to it.

Enjoy!


Attachments:
derenderAvatars.txt [3.22 KiB]
Downloaded 382 times
2020-02-07 20:54:22
Profile

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
A coupe of small corrections to the file in the op.
  • corrected function comments
  • renamed variable


Attachments:
derenderAvatars_1.txt [3.25 KiB]
Downloaded 399 times
2020-02-07 23:33:07
Profile

Joined: 2021-06-21 12:39:03
Posts: 137
Reply with quote
Awesome! thank you!!!


2022-06-28 14:23:16
Profile

Joined: 2021-06-21 12:39:03
Posts: 137
Reply with quote
Hi Zane!

Thank you for the script. It took me some time to figure out how to implement it in the automation script but now it's working great and gives me the opportunity to use my old PC from 2006 ;) a bit longer. Only one feature I'm missing and want to ask for, if this is anyhow possible to implement:
Sometimes there come Avatars to my shows that I know but who are not yet on my friends list. Would there be any good chance to change the script to let me select one or more avatars from the Radar Floater to become rendered again?


2022-09-03 08:42:31
Profile

Joined: 2021-06-21 12:39:03
Posts: 137
Reply with quote
Hi Zane,

I'm so happy to have that script, thank you for it!

I tried to adjust it a bit for me but I'm just not experienced enough in Lua scripting.

May I ask for you help, please?

As I don't want my list of friends to become too much blown but there are some people out there that I want be possible to see although they are no AgentFriends. I thought about putting these names in a list into the script (or somewhere else) in order to exclude them from the auto-drendering. Do you know an easy way to do it? When it comes to arrays I'm just too much a noob...

Many thanks in advance for your help!
Frank


2022-09-16 16:54:54
Profile

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Unfortunately, I'm in the process of moving across country. I won't have time or even my 'rig' to add such an improvement at this time.

In your copy of the script, you could create a Lua table, keyed by the avatar's UUID for those that you wish to omit from derendering. Change the line with:
Code:
if not IsAgentFriend(id) and runtime.derenderAvatars then
to something like
Code:
if not IsAgentFriend(id) and not bypassedAvatars[id] and runtime.derenderAvatars then
The Lua table might be something like:
Code:
-- Avatar UUIDs to skip during derender (obtained from their profile)
local bypassedAvatars = {
  '64e1d876-1854-4214-9c5d-753d7f1391f0' = true,
  '64e1d876-1854-4214-9c5d-753d7f1391f1' = true
}

Changing the value to false for a UUID would allow that one to be derendered, but stay in the list, for future bypassing.

This is completely untested and just 'off the cuff', so to speak, from memory. I make no warranty or guarantee about these snippets, but they might point you in the right direction.


2022-09-16 22:22:01
Profile

Joined: 2021-06-21 12:39:03
Posts: 137
Reply with quote
Hi Zane,

I thank you very much! I'll defenitely try that.

PS: I wish for you that your moving is not "unfortunately" for your but only for me here in this case of needing help ;)


2022-09-16 23:10:27
Profile

Joined: 2021-06-21 12:39:03
Posts: 137
Reply with quote
ZaneZimer wrote:

Code:
-- Avatar UUIDs to skip during derender (obtained from their profile)
local bypassedAvatars = {
  '64e1d876-1854-4214-9c5d-753d7f1391f0' = true,
  '64e1d876-1854-4214-9c5d-753d7f1391f1' = true
}



The script sends an error message when using " = true," , but without it it seems to work (at least no error message). I'l try that for real today.


2022-09-17 12:23:43
Profile

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Try using " (double-quote). I think Lua requires them for strings. My time away from it and in other languages lead me to using ' (single-quote). BTW, you will need the = true for the test to work properly.


2022-09-17 14:02:21
Profile

Joined: 2021-06-21 12:39:03
Posts: 137
Reply with quote
ZaneZimer wrote:
Try using " (double-quote). I think Lua requires them for strings. My time away from it and in other languages lead me to using ' (single-quote). BTW, you will need the = true for the test to work properly.


That's unfortunately not working:
Lua: ...\AppData\Roaming\SecondLife\user_settings\automation.lua:476: unexpected symbol near '='

Here my Code:
Code:
local bypassedAvatars = {
  "178c647a-33a1-4eca-a2ba-e4416b06a0cc", = true -- (Artist)
  "8da0d492-c629-452d-81f6-06f15c7360ba" = true -- (Artist)
}


And when I use the 'xxx' with = true at the end of the line, I get the same error message :/

With regards to the = true / false -> I thought I could just make the ones/lines that I do want to get derendered make comments with --


Last edited by DonFranko on 2022-09-18 15:24:44, edited 1 time in total.



2022-09-18 14:09:17
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 15 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.