Jump to content

Selectively recoloring certain prims


mrzeus7
 Share

You are about to reply to a thread that has been inactive for 4757 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi, I'm pretty new to scripting and this project (if its possible) will be my biggest attempt at scripting.  Basically, I have an avatar (a free iron man one) and I want to be able to recolor certain prims at one time (also possibly changing glow and shininess parameters).  What I was originally planning is to go and name the prims I want to recolor something (say, "color1") and then using a script, I would find all with that name and use llSetPrimativeParams on each one.  Buuuut I've noticed that you can't seem to use that on a prim that isn't the scripted prim.  Is there any other way to do this?  

Thanks!

Link to comment
Share on other sites

you can use the name or description fields to label your parts, then recolor/etc all the parts with that name or description...

but I'm guessing you only found the llGetObjectName and llGetObjectDesc functions, and missed the constants PRIM_NAME and PRIM_DESC for llGetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast ?

those are the ones you want =)

Link to comment
Share on other sites

Functions you will need to look into.

llSetLinkPrimitiveParamsFast set the parameter of any prim in a link

llGetLinkPrimitiveParams use to get name/description.

I have done something like this for a whole house. where in the name I have "Wall,Floor,Cieling" the description then contains the faces associated with each such as "1,2&3,4&5,6,7". so if you wanted to change the color of the Cieling the script would search thru all the prim looking for the word Cieling. It finds it is the 3rd word on a prim it then get the description looking for the 3rd set of numbers "5,6,7". can changes the colors for those faces.

Plus the advantage is you can do this all from one script in the root prim of each attachment. the set up may seem a little work changing the name and description for each prim but the pay off is great using very few scripts to manage! Putting a script in every prim in my opinion is not the best thing to do.

Link to comment
Share on other sites

Ok, this sounds good.  I was hoping for something more like one script for the whole avatar, but it seems one per attachment is the next best :)  Besides that change, it's pretty much what I was thinking of doing.  I'm having trouble finding the function that would get all the linked prims, though.  After that, I would loop through and check if the name/desc has some keyword in it and, if it does, act on it using llSetLinkPrimativeParamsFast?

Link to comment
Share on other sites

you could have all attachments listen for a command, and then when heard each one processes it's own linkset.

and llGetLinkPrimParams( LINK_SET, [PRIM_NAME, PRIM_DESC] ); will return all the names and descriptions in a single link set at once, in order. (or you can check them one at a time by looping through)

Link to comment
Share on other sites

well that is even a better idea granted you have enough free memory in the script. If you have a large linkset could be a large list. I may have to go back and revist some of my older builds. The thought of getting all names in the link set never even occured to me.

But being able to change only cetain prims at once has been a little annoying. You can can change all, one or all others.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4757 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...