Jump to content

Problem using Align Planer & Synchronize Materials on Texture Tab


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

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

Recommended Posts

Hello all,

For three days now I have tried to put diffuse, normal and specular textures to objects and use planer mapping, align textures and then synchronize materials. Say I have one cube object, size <3.00000, 2.00000, 0.50000> and a second cube object size <2.25000, 1.75000, 0.50000>. I align the two side by side and set both to planer mapping. I select Top Face on the 3x2 object and set it to Horizontal Scale 3 and Vertical Scale 2 for the diffuse texture. I apply the same diffuse texture to the top of the smaller object. I select the top face of the smaller object and then select the top face of the 3x2 object and then check Align Planer. Texture looks good and both surfaces are correctly aligned. I then apply the normal texture and the specular texture. When I click synchronize materials, the diffuse texture stays correct and aligned across the two objects at Horizontal 3 and Vertical 2 but the Horizontal Scale and the Vertical Scale will double for both the normal and specular textures to read Horizontal Scale 6 and Vertical Scale 4 with odd vertical and horizontal offsets and it all greys out and will no let me make any changes to the scales of the normal and specular textures. What am I doing incorrectly and how do I properly align and synchronize materials using planer alignment?

Link to comment
Share on other sites

I've seen that problem msyelf and inFirestorm it sometimesseems to help to switch Synchronize materials on and off a few times.

I build in the official viewer most of the time though so I just wrote a simple little script to align the materials. I was thinking of offering it for sale some day but it seems that day will never come so here it is free and CC0 for anybody who want it. Create a new script in your inventory, replace its text with the code below and save. Whenever you need those materials to line up with the diffuse map, drag the script onto the object and the job is done.

 

// 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());
    }
}

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2290 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...