Home Technical Talk

Maya custom "Magic" toggle Script

Offline / Send Message
Pinned
Hello!World!A good day to you!

Perhaps somebody know hou can i create One costom key

to assign many kinds of actions.

For example (camera toggle:left,right,top,bottom.4 action on one button)

My idea obout it someway to use Runtime command list

 Waiting for you response!

 Thank You!


Replies

  • throttlekitty
    Offline / Send Message
    throttlekitty ngon master
    Hi kirill, scripts like these are easy to make and edit. The logic here is to check the current panel's camera and toggle to the next one in the list. This script isn't very smart though, so it won't switch if the scene doesn't already have left and right cameras, and they aren't named the same. You can create a custom hotkey, and paste this in.

    edit: is the double line thing still messing with script formatting? This looks nicer than using the code format block.

    string $currentPanel = `getPanel -withFocus`;
    if (`getPanel -to $currentPanel` == "modelPanel") {
        string $currentCamera = `modelPanel -q -cam $currentPanel`;
        if ($currentCamera == "left") {
            lookThroughModelPanel right $currentPanel;
        }
        else if ($currentCamera == "right") {
            lookThroughModelPanel top $currentPanel;
        }
        else if ($currentCamera == "top") {
            lookThroughModelPanel bottom $currentPanel;
        }
        else if ($currentCamera == "bottom") {
            lookThroughModelPanel left $currentPanel;
        }
    }
  • kirill777
    Hi kirill, scripts like these are easy to make and edit. The logic here is to check the current panel's camera and toggle to the next one in the list. This script isn't very smart though, so it won't switch if the scene doesn't already have left and right cameras, and they aren't named the same. You can create a custom hotkey, and paste this in.

    edit: is the double line thing still messing with script formatting? This looks nicer than using the code format block.

    string $currentPanel = `getPanel -withFocus`;
    if (`getPanel -to $currentPanel` == "modelPanel") {
        string $currentCamera = `modelPanel -q -cam $currentPanel`;
        if ($currentCamera == "left") {
            lookThroughModelPanel right $currentPanel;
        }
        else if ($currentCamera == "right") {
            lookThroughModelPanel top $currentPanel;
        }
        else if ($currentCamera == "top") {
            lookThroughModelPanel bottom $currentPanel;
        }
        else if ($currentCamera == "bottom") {
            lookThroughModelPanel left $currentPanel;
        }
    }
    Hello Dear Throttlekitty !Appreciate your fast reply!I will testing these great think,and after that i will write my results!
    Happy New Year to you!=)






Sign In or Register to comment.