0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【MEL】MAYA→UnrealEngine カメラエクスポート

Last updated at Posted at 2022-04-02

2022-04-02_21h19_08.gif

手順

手動での方法とUnrealへのインポートは以下のリンクを参照

【メモ】MAYA to UE4(カメラ)
https://zenn.dev/wawon/articles/33aee68c191939

MELでMAYA内のカメラベイク作業を簡略化

書き出したいカメラを選択後に以下のMELを起動。
BAKE_CAM__(選択したカメラ名)のカメラが作成されるので、fbxでエクスポート

CameraBake.mel
// Set StartFrame and EndFrame //
$stFm =`findKeyframe -w first`;
$edFm = `findKeyframe -w last`;

// Cam Select //
string $selectCam[] = `ls -selection`;
string $selectCamShape[] = `listRelatives -shapes $selectCam`;

// Create Cam //
string $bakeCam[] = `camera`;

// Cam Constraint //
parentConstraint  $selectCam $bakeCam[0];

// focal Length copy //
string $selectFocal = $selectCamShape[0] + ".focalLength";
string $bakeFocal = $bakeCam[1] + ".focalLength";

copyKey -time ($stFm+":"+$edFm) $selectCamShape[0];

if (catch(`pasteKey -time ($stFm+":"+$edFm) -option replace $bakeCam[1]`)){
    setAttr $bakeFocal `getAttr $selectFocal`;
} else{
    print "PasteKey";
}

// Bake Cam //
bakeResults -simulation true -t ($stFm+":"+$edFm) $bakeCam[0];

// Delete Constraint //
delete `listRelatives -typ "constraint" $bakeCam[0]`;

// Bake Cam Rename //
string $newName = "BAKE_CAM__" + $selectCam[0];
rename $bakeCam[0] $newName;
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?