phlam
01-17-2008, 04:21 PM
Hi there,
I think this is a tough question, as I have tested different ways with no result :
I'd like to get the name of the camera node that is used at render time, in a batch render process (no UI-based functions available), in a render layer that has more than one renderable viewport.
The script is called by a pre-frame-render event.
Test1:
renderSettings -firstImageName
> doesnt update its result when changing camera.
Test2:
string $currentPanel = getPanel ("-withFocus");
string $camera = modelPanel ("-q", "-camera", $currentPanel);
> No UI, no panel, no modelPanel
Test3:
(borrowed procedure from the base script renderWindowPanel.mel)
$camera = getCurrentCamera();
> doesn't return a valid name (0)
Test4:
string $camera = lookThru ("-q");
> No viewport, no way
Test5:
Listing the global variables with env()
> No camera-related global variable
Test6:
(boorowed procedure from the base script FurPluginCreateUI.mel)
$camera = HfGetRenderCamera();
> Returns the first renderable camera
... I don't remember the other tests I made.
Does anyone see a solution ?
Cheers
Philippe
I think this is a tough question, as I have tested different ways with no result :
I'd like to get the name of the camera node that is used at render time, in a batch render process (no UI-based functions available), in a render layer that has more than one renderable viewport.
The script is called by a pre-frame-render event.
Test1:
renderSettings -firstImageName
> doesnt update its result when changing camera.
Test2:
string $currentPanel = getPanel ("-withFocus");
string $camera = modelPanel ("-q", "-camera", $currentPanel);
> No UI, no panel, no modelPanel
Test3:
(borrowed procedure from the base script renderWindowPanel.mel)
$camera = getCurrentCamera();
> doesn't return a valid name (0)
Test4:
string $camera = lookThru ("-q");
> No viewport, no way
Test5:
Listing the global variables with env()
> No camera-related global variable
Test6:
(boorowed procedure from the base script FurPluginCreateUI.mel)
$camera = HfGetRenderCamera();
> Returns the first renderable camera
... I don't remember the other tests I made.
Does anyone see a solution ?
Cheers
Philippe
