Need help re Material Alignment Script

Creating scripts
Post Reply
User avatar
Natalie Oe
Posts: 41
Joined: Mon May 07, 2018 10:15 am
Has thanked: 21 times
Been thanked: 19 times
Contact:

Need help re Material Alignment Script

Post by Natalie Oe » Thu May 23, 2019 6:54 am

Hi All,

wondering if someone can help fix this script (or advise of a working one).

I am trying to align my Normal & Specular maps to my diffuse in a house, firestorms sync materials option just isn't working. I know I can do it manually but with over 100 prims it's a tedious job.

This script was created for use in SL. When trying it here it throws the following error:

llSetLinkPrimitiveParamsFast: Error running rule #1: arg #0 - unsupported parameter.

Code: Select all

// Rey's Automagic Map Aligner
// Published under a CC0 license, no rights reserved

float rot;
integer specenv;
integer specgloss;
integer x;
integer y;
integer linksize;
key nrmmap;
key specmap;
list data;
vector offset;
vector repeats;
vector speccolor;


default{

    state_entry(){
        linksize=llGetNumberOfPrims( );
        if(linksize==1){
            for(y=0;y<=8;++y){
                data=llGetLinkPrimitiveParams(0,[17,y,37,y,36,y]);
                repeats=llList2Vector(data,1);
                offset=llList2Vector(data,2);
                rot=llList2Float(data,3);
                nrmmap=llList2Key(data,4);
                specmap=llList2Key(data,8);
                speccolor=llList2Vector(data,12);
                specgloss=llList2Integer(data,13);
                specenv=llList2Integer(data,14);
                llSetLinkPrimitiveParamsFast(x,[37,y,nrmmap,repeats,offset,rot,36,y,specmap,repeats,offset,rot,speccolor,specgloss,specenv]);
            }
        }
        else{          
            for(x=1;x<=linksize;++x){
                for(y=0;y<=8;++y){
                    data=llGetLinkPrimitiveParams(x,[17,y,37,y,36,y]);
                    repeats=llList2Vector(data,1);
                    offset=llList2Vector(data,2);
                    rot=llList2Float(data,3);
                    nrmmap=llList2Key(data,4);
                    specmap=llList2Key(data,8);
                    speccolor=llList2Vector(data,12);
                    specgloss=llList2Integer(data,13);
                    specenv=llList2Integer(data,14);
                    llSetLinkPrimitiveParamsFast(x,[37,y,nrmmap,repeats,offset,rot,36,y,specmap,repeats,offset,rot,speccolor,specgloss,specenv]);
                }
            }
        }
        llRemoveInventory(llGetScriptName());
    }
}
I've no idea what part the error relates to nor how to go about fixing it.
These users thanked the author Natalie Oe for the post (total 2):
Ilan TochnerChris Namaste
User avatar
John Hopkin
Posts: 18
Joined: Tue Feb 04, 2014 9:50 pm
Has thanked: 7 times
Been thanked: 11 times

Re: Need help re Material Alignment Script

Post by John Hopkin » Thu May 23, 2019 6:27 pm

I've done a bit of experimentation with this code, and it looks to me like what you're trying to do is not currently possible in OpenSim.

This Mantis report seems to describe what I'm seeing, and it's still flagged as an open issue, even in OpenSim 0.9. In short, you still can't set the properties of normal and specular materials from a script in OpenSim. You can only do that using the editor.

Sorry to be the bearer of bad news. :(
These users thanked the author John Hopkin for the post (total 3):
Ilan TochnerNatalie OeZed deTremont
User avatar
Natalie Oe
Posts: 41
Joined: Mon May 07, 2018 10:15 am
Has thanked: 21 times
Been thanked: 19 times
Contact:

Re: Need help re Material Alignment Script

Post by Natalie Oe » Fri May 24, 2019 3:51 am

John Hopkin wrote:
Thu May 23, 2019 6:27 pm
I've done a bit of experimentation with this code, and it looks to me like what you're trying to do is not currently possible in OpenSim.

This Mantis report seems to describe what I'm seeing, and it's still flagged as an open issue, even in OpenSim 0.9. In short, you still can't set the properties of normal and specular materials from a script in OpenSim. You can only do that using the editor.

Sorry to be the bearer of bad news. :(
Thanks for the reply John. Its unfortunate that it's not yet option but for now I will just work around it. I ended up removing the materials until such a time as I can align them all.

Again, thank you :-)
Post Reply