"There is no active view" when trying to use MEL command 'lookthru'

"There is no active view" when trying to use MEL command 'lookthru'

Anonymous
Not applicable
1,559 Views
1 Reply
Message 1 of 2

"There is no active view" when trying to use MEL command 'lookthru'

Anonymous
Not applicable

I am trying to look through a particular camera when doing a playblast command from a script.  The object is there, but when I call lookthru, it gives me the error 'There is no active view.'  Here is what script looks like.  Any idea what I am doing wrong?  I don't really have experience with cameras yet.

 

if(`objExists Playblast_Camera`)
{
    lookThru Playblast_Camera;
}

... I also tried this, get same error:

string $camView = `cameraView -camera Playblast_Camera`;
lookThru Playblast_Camera $camView;

 

0 Likes
Accepted solutions (1)
1,560 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

For anyone else who runs into this, I solved it by not using 'lookthru'.  Instead I set all the cameras' renderers to off except for the playblast camera:

 

string $cams[] = `lsType("camera")`;
for ($cam in $cams)
{
    catchQuiet(`setAttr ($cam + ".rnd"0`);
}
catchQuiet(`setAttr ("Playblast_Camera.rnd"1`);

 

0 Likes