On 11/07/2013 at 22:02, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R13+
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
There is no camera in sight in my document. The current scene camera is the Editor Camera. When I call:
bd->GetSceneCamera(pDoc);
it always returns a camera! I've tried both GetActiveBaseDraw() and GetRenderBaseDraw(), same result. I need to put a clone of the Editor Camera into the document for export purposes. So, what use is GetSceneCamera() and GetEditorCamera() if they both always return the Editor Camera when no other is active?
Frustrating - and it completely invalidates all four uses in the cinema4dsdk examples - because it doesn't work that way.
// Get Camera
// - Always clone camera and give unique name to avoid the possibility of showing the wrong camera
// - which can otherwise happen if there are multiple cameras with the same name in the scene.
BaseDraw* bd = pDoc->GetRenderBaseDraw();
if (!bd)
{
m_pLivePanel->AddToLog("PushScene: No Active BaseDraw");
return;
}
StopAllThreads();
BaseObject* camera = bd->GetSceneCamera(pDoc);
if (!camera)
{
camera = bd->GetEditorCamera();
camera = CreateCameraClone(pDoc, camera);
if (camera)
{
bd->SetSceneCamera(camera);
EventAdd();
}
}
else m_pLivePanel->AddToLog("PushScene: There is a Scene Camera!");
The else condition always happens.