カメラを選択する

コード

(function () {
    function switchCam(mCamLabelName)
    {
        mCam = Scene.findNodeByLabel(mCamLabelName);
        if ( mCam ) {
            var mVwmgr = MainWindow.getViewportMgr();   
            if ( mVwmgr ) {     
                var mVwport = mVwmgr.getActiveViewport();   
                if ( mVwport ) {            
                    var mTdvwport = mVwport.get3DViewport();
                    if ( mTdvwport ) {
                        mTdvwport.setCamera( mCam );
                        return;
                    }
                }
            }
        }
        print('ERROR : nocamera (' + mCamLabelName + ')');
    }

    switchCam('camScene1');
})();