Home Technical Talk

Trying to edit bt_autoUnwrap

polycounter lvl 5
Offline / Send Message
deohboeh polycounter lvl 5
I am trying to edit bt_autoUnwrapUVTool.mel (It's the unwrap UV tool with Bonus Tools).
{
string $FrstSel[] = `ls -sl`;

for ($ScndSel in $FrstSel){
    
    select $ScndSel;

// Cycles through selection as the tool wont work with multiple objects.//   


    bt_autoUnwrapUVTool;
    
}
}

I hope to edit bt_autoUnwrapUVTool so that I don't have to click all of the things and just ask it to go from step to step without any interference of mine. All that is needed is that The "Enter Tool and Close" button be pressed as soon as the window is opened.

Any help is much appreciated.

I am attaching the mel file here.

http://www.filedropper.com/btautounwrapuvtool

Regards
N00b

UPDATE:
Ever have a break through while you are posting a problem?
Well I had one and here is the new code:
{
//Brackets are there because there are constant problems with existing variables//

string $FrstSel[] = `ls -sl`;

for ($ScndSel in $FrstSel){
    
    select $ScndSel;
    
    bt_autoUnwrapUVTool;

// This is the command to be executed when the button is pressed. 

    if (`objExists "wrapMapFaces"`) {
        bt_AutoUnwrapMapHUD1;
        } 
    else
    
        bt_defineWrapMapFaces;
        
    deleteUI AutoUnwrapMapWin;

//
    
}
}

Only change in the script is it had comment slashes which caused syntax error (`objExists \"wrapMapFaces\"`)
Any idea why it works in script?

Right now I am trying to figure out a way to get the next few buttons sorted also.

Any help is much appreciated.

Regards

N00b

UPDATE:
Turns out it only works for one object and it cycles through all the other selections without doing anything.

Replies

  • deohboeh
    Options
    Offline / Send Message
    deohboeh polycounter lvl 5
    Figured it out.
    I had to paste the button commands for every each one along the steps of the tool.

    This mel script now calls AutoUnwarpUVTools for every object along the selection for Proportional unwrapping. It's useful to unwrap many objects which don't have a seam. For eg. Hairplanes.
    {
    
    string $FrstSel[] = `ls -sl`;
    
    for ($ScndSel in $FrstSel){
        
        select $ScndSel;
        
        print `ls -sl`;
        
        bt_autoUnwrapUVTool;
        
    //Press Enter Task and Close Button    
        if (`objExists "wrapMapFaces"`) {
            bt_AutoUnwrapMapHUD1;
            } 
        else
        
            bt_defineWrapMapFaces;
            
        deleteUI AutoUnwrapMapWin;
    
    //Continue Button    
        bt_killUnwrapMapHUD; 
        bt_defineWrapMapEdges; 
        if (`optionVar -q AutoUnwrapMapMethod` == 3) { 
        bt_AutoUnwrapMapHUD3; 
        if (`objExists "wrapMapAnchors"`) 
            bt_defineWrapMapAnchors ;
        } 
        else {
            bt_AutoUnwrapMap ; 
            bt_AutoUnwrapMapHUD4; 
            textureWindowBakeEditorImage;
        }
        
    //Done button
        bt_killUnwrapMapHUD; 
        bt_cleanUpAfterUnwrap;
        
    }
    }
    
Sign In or Register to comment.