перепиши код для maya 3d  с python2 на python 3     global int $quickShelfWidth = 200;

global proc QuickShelf() {
    global int $quickShelfWidth;
    global string $quickShelfWindow;
    global int $quickShelfHeight;
    global string $gShelfTopLevel;
    global string $currentShelves[];

    //Set shelves on first run
    if ($quickShelfWindow == "") {
        string $filePath = `whatIs QuickShelf`;
        $filePath = fromNativePath(`substitute "Mel procedure found in: " $filePath ""`) + "userData.txt";
        if (`filetest -f $filePath`) {
            int $fileID = `fopen $filePath "r"`;
            $currentShelves = freadAllLines($filePath);
            fclose $fileID;
        }
        QuickShelfSet($currentShelves);        
    }
    if ($currentShelves[0]=="") {
        string $curShelf = `shelfTabLayout -q -st $gShelfTopLevel`;
        $currentShelves = {$curShelf};
        QuickShelfSet($currentShelves); 
    }
    //toggle window vis
    if (`window -q -vis $quickShelfWindow`) {
        $quickShelfWidth = 200;
        $quickShelfHeight = 250;        
        window -e -vis 0 $quickShelfWindow;
        }
    else {
        int $cursorX = `python "from PySide2.QtGui import QCursor; QCursor.pos().x()"`;
        int $cursorY = `python "QCursor.pos().y()"`;
        int $ver = `about -version`;

        if ($ver < 2023) {
        	window -e -vis 1 $quickShelfWindow;
        } else {
    		showWindow($quickShelfWindow);
    	}
        window -e -widthHeight $quickShelfWidth $quickShelfHeight -tlc (($cursorY-($quickShelfHeight/2))-20) ($cursorX-($quickShelfWidth/2)) $quickShelfWindow;
        }
}

global proc QuickShelfSet(string $argShelves[]) {
    
    global string $gShelfTopLevel;
    saveAllShelves $gShelfTopLevel;
    //Collect variables
    global string $currentShelves[];
    global string $quickShelfWindow;
    global int $quickShelfHeight;
   
    $currentShelves = $argShelves;

    //Calculate window height
    $quickShelfHeight = 250; 
    
    //delete current window
    if ($quickShelfWindow != "") {
        deleteUI -window $quickShelfWindow;
    }


//Create parent shelf window
$quickShelfWindow = `window -ret -tlc -500 0 -tlb 1 -title "Quick Shelf" "QuickShelfWindow"`;
paneLayout -configuration "vertical2";
gridLayout -numberOfColumns 2 -cellWidthHeight 200 250;

int $shelfID = 0;

for ($shelf in $currentShelves) {
    
    //Get shelf contents
    string $shelfPath = getenv("MAYA_APP_DIR") + "/" + `about -v` + "/prefs/shelves/shelf_" + $shelf + ".mel";
    string $shelfLines[] = freadAllLines($shelfPath);

    string $shelfButtons = "";
            
    for ($i=6; $i<(size($shelfLines)-2); $i++) {
        
        $shelfButtons = $shelfButtons + $shelfLines[$i] + "\n";
        
    }

    //Add shelf
    string $shelf = `shelfLayout`;
    eval ($shelfButtons);
    setParent ..;
    $shelfID++;
        
}


    //Save current shelves
    
    string $filePath = `whatIs QuickShelf`;
    $filePath = fromNativePath(`substitute "Mel procedure found in: " $filePath ""`) + "userData.txt";
    int $fileID = `fopen $filePath "w"`;
    
    for ($shelf in $currentShelves) {
        fprint $fileID ($shelf + "\n");
    }
    fclose $fileID;
   
}
global proc QuickShelfUpdate(string $mode, int $shelfID) {
    global string $gShelfTopLevel;
    global string $currentShelves[];
    QuickShelf();
    string $activeShelf = `tabLayout -q -selectTab $gShelfTopLevel`;
    if ($mode == "replace") {
        $currentShelves[$shelfID] = $activeShelf;
    }
    if ($mode == "remove") {
        stringArrayRemoveAtIndex($shelfID, $currentShelves);
    }
    if ($mode == "add") {
        $numShelves = size($currentShelves);
        if ($numShelves<4) {
            $currentShelves[$numShelves] = $activeShelf;
        }
    }
    if ($mode == "reload") {
    }
    evalDeferred "QuickShelfSet($currentShelves)";
    evalDeferred "QuickShelf()";
}