Jump to content
Indy Melody

Problem using Align Planer & Synchronize Materials on Texture Tab

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thank you ChinRey! That fixes my problem of getting the materials synchronized. One additional question, if I wanted a nice shiny marble floor, what Glossiness and Environment values would you recommend?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...