Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

batch-processing multiple prims

Mechanique Thirty
Pretty Spider
Join date: 15 Mar 2005
Posts: 60
12-03-2005 20:52
Hey. I'm working on a primsuit made of a bunch of fairly identical prims linked to a handful of invisiprims. I'd like to do the same change to all of the visible prims, as I look for juuuust the right look for it.

I was able to work out a script using llGetPrimitiveParams and llSetPrimitiveParams to do the change I want, but it's only going to work on one prim at a time. I don't want to have to rez out the attachment, modify the invisiprim that contains everything so I can access the child prims, and drop the script on every single one of them. (I certainly don't want to modify 60-70 prims by hand, especially if automation can let me quickly try out several options.)

But ll(G|S)etPrimitiveParams only works on the prim the script lives in. Is there an easy way to dump one script onto the parent prim, and have it dump itself onto all the child prims, then execute? (Auto-deleting itself like Jeff Gomez' prim mirror scripts would be a nice bonus.) I could get a script to clone itself, but then it stops dead. And dropping an llSetRemoteScriptAccessPin script on every prim will be kinda maddening...
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
12-03-2005 21:12
From: Mechanique Thirty
I could get a script to clone itself, but then it stops dead.


Do that, then Tools -> Reset Scripts in Selection. Or maybe Set Scripts to Running. Some combination of the above.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Mechanique Thirty
Pretty Spider
Join date: 15 Mar 2005
Posts: 60
12-03-2005 21:48
Ah, thanks! I'd even halfway noticed those options when browsing through the menus the other day, but they didn't stick. Now I can tweak my Rez-inspired avatar's prims to happiness.
SiRiS Asturias
Chaotic Coder
Join date: 27 Sep 2005
Posts: 93
12-04-2005 00:58
There is a couple 1 script options depending exactly on what your trying to do. As I did not see a specific goal, like change color or texture on all, I will list a few that are plausible. Feel free to IM me in game if these don't match up to what your trying to accomplish in the end.


Change color:

EX: llSetLinkColor(LINK_SET, <1,1,1>, ALL_SIDES);
This will set every prim within the link set to the color white without needing a script in every prim.

Change Opacity/Alpha:

EX: llSetLinkAlpha(LINK_SET, 0.5, ALL_SIDES);
This would set every prim within the link set to 50% opacity.

Unfortunatly there is not an llSetLinkTexture command, but below I have included the link to the manual work-around Wiki page provided by Jeffrey Gomez.
http://secondlife.com/badgeo/wakka.php?wakka=llSetLinkTexture

Hope this helps you out a little. :)
Mechanique Thirty
Pretty Spider
Join date: 15 Mar 2005
Posts: 60
12-04-2005 13:06
From: SiRiS Asturias
There is a couple 1 script options depending exactly on what your trying to do. As I did not see a specific goal, like change color or texture on all, I will list a few that are plausible. Feel free to IM me in game if these don't match up to what your trying to accomplish in the end.


I'm programmatically altering the <i>geometry</i>, not the color/texture/alpha/etc, and also trying to avoid putting a listener script in ~80 prims by hand.
Mechanique Thirty
Pretty Spider
Join date: 15 Mar 2005
Posts: 60
12-04-2005 13:20
Well. This is strange. Tools->reset scripts in selection/set scripts to running in selection did nothing, regardless of which order I tried them in.

Tools->recompile scripts in selection fired them off, but this is incredibly time-consuming to wait for, and probably prone to being interrupted by lag. Most strange. Of course it's quite possible there's something broken in my self-replicating script, too. Time to collapse it down to a test case of just that.
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
12-04-2005 18:31
There was a time when some of those commands would only work on a few out of the many prims one had selected, I'm not sure if that got fixed.

If you're just testing stuff out, finding a quiet sim and firing up your 80 listeners isn't going to do anything terrible. Alternatively... link messages?
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
12-04-2005 18:33
If I have to recompile a lot of scripts I shift click all the objects with scripts in I want to compile then go get some coffee :D
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.
---------------
Zapoteth Designs, Temotu (100,50)
---------------
Jackal Ennui
does not compute.
Join date: 25 May 2005
Posts: 548
12-05-2005 02:29
From: Mechanique Thirty

But ll(G|S)etPrimitiveParams only works on the prim the script lives in. Is there an easy way to dump one script onto the parent prim, and have it dump itself onto all the child prims, then execute? (Auto-deleting itself like Jeff Gomez' prim mirror scripts would be a nice bonus.) I could get a script to clone itself, but then it stops dead. And dropping an llSetRemoteScriptAccessPin script on every prim will be kinda maddening...


I've been doing some vaguely similar stuff; it is a pain to manually distribute an llSetRemoteScriptAccessPin() script to all child prims, but only needed once. After that, just update the scripts via llRemoteLoadScriptPin (don't forget to set them to running). The updating takes a long while, though, especially with ~200 prims, so in the end I had the script in the child prim parse link messages for the values for the llSetPrimitiveParameter call, and the parent prim reading the values from a notecard and link messaging the individual prims in that linkset, so that the child prim script did not have to be updated everytime I decided on another color scheme ;) If you're interested in seeing the code, I can drop the scripts onto your inventory later today.
_____________________
Lassitude & Ennui - Fine prim jewelry & footwear, Nouveau(60,60)

http://lassitudeennui.blogspot.com/
Oasis Perun
Registered User
Join date: 2 Oct 2005
Posts: 128
12-05-2005 12:20
This thread may help ... /54/c4/73704/1.html

storing the listen script in each prim and assigning it a "group number" may help..then you just have to send one linked message and include the "group number" for the child prims to listen for..Also I have a simple subgroup script in the library that will remember and relink a set of prims(based on keys now so no re-rezzing)/15/73/71754/1.html .. I am working on an more efficient/faster version once i get time to write the code but this is a good base