Message 1 of 4
Camera type bug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I noticed a bug with Fusion returning wrong camera type when camera is set to PerspectiveWithOrthoFacesCameraType it returns PerspectiveCameraType.
Demo code used in the video:
#include <Core/CoreAll.h>
#include <Fusion/FusionAll.h>
#include <CAM/CAMAll.h>
using namespace adsk::core;
using namespace adsk::fusion;
using namespace adsk::cam;
Ptr<Application> app;
Ptr<UserInterface> ui;
extern "C" XI_EXPORT bool run(const char* context)
{
app = Application::get();
if (!app)
return false;
const auto cameraType = app->activeViewport()->camera()->cameraType();
auto type = "";
switch(cameraType)
{
case OrthographicCameraType:
type = "OrthographicCameraType";
break;
case PerspectiveCameraType:
type = "PerspectiveCameraType";
break;
case PerspectiveWithOrthoFacesCameraType:
type = "PerspectiveWithOrthoFacesCameraType";
break;
}
app->userInterface()->messageBox(type, type);
return true;
}