Need help re Material Alignment Script

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

Need help re Material Alignment Script

Post by Natalie Oe »

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
Australian Digital Creator | She/Her | Coffee Addict | Book Lover | Aspiring Scrapbooker.

Kitely Marketplace
True Blue Digital Designs
Instagram
User avatar
John Mela
Posts: 91
Joined: Tue Feb 04, 2014 9:50 pm
Has thanked: 139 times
Been thanked: 127 times
Contact:

Re: Need help re Material Alignment Script

Post by John Mela »

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 Mela for the post (total 3):
Ilan TochnerNatalie OeZed deTremont
User avatar
Natalie Oe
Posts: 48
Joined: Mon May 07, 2018 10:15 am
Has thanked: 21 times
Been thanked: 21 times
Contact:

Re: Need help re Material Alignment Script

Post by Natalie Oe »

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 :-)
Australian Digital Creator | She/Her | Coffee Addict | Book Lover | Aspiring Scrapbooker.

Kitely Marketplace
True Blue Digital Designs
Instagram
Post Reply