Help us understand the problem. What is going on with this article?

Maya TransformAttributesの値だけをリセット(改良版)

以前記事を書いた
選択オブジェクトのTranslate, Rotate, Scaleを一度に初期化するMELの改良版です。

主にこのあたりを変更しました。
・locked状態のものはスルーして処理を続ける
・選択項目がない場合のエラー文追加

string $objs[] = `ls -sl`;
if(`size $objs` == 0){
    print "何も選択されていません";
}else{
    for ($objSel in $objs)
    {
        select $objSel;

        if(`getAttr -lock .tx` == 0){
            setAttr .tx 0;
        }
        if(`getAttr -lock .ty` == 0){
            setAttr .ty 0;
        }
        if(`getAttr -lock .tz` == 0){
            setAttr .tz 0;
        }

        if(`getAttr -lock .rx` == 0){
            setAttr .rx 0;
        }
        if(`getAttr -lock .ry` == 0){
            setAttr .ry 0;
        }
        if(`getAttr -lock .rz` == 0){
            setAttr .rz 0;
        }

        if(`getAttr -lock .sx` == 0){
            setAttr .sx 1;
        }
        if(`getAttr -lock .sy` == 0){
            setAttr .sy 1;
        }
        if(`getAttr -lock .sz` == 0){
            setAttr .sz 1;
        }
    }
}

後日、こちらも修正かけるかもしれません
・特定ノードを指定する
・選択オブジェクトの子もすべて初期化
・Connectedがある場合
・Expressionがある場合

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした