Camera type bug

Camera type bug

rolandas_vegis
Advocate Advocate
489 Views
3 Replies
Message 1 of 4

Camera type bug

rolandas_vegis
Advocate
Advocate

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;
}

 

0 Likes
490 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor

Hi @rolandas_vegis .

 

I have experienced this before when I developed this add-in.

https://github.com/kantoku-code/Fusion360_PerspectiveAngleController 

 

Wouldn't PerspektiveWithOrthoFacesCameraType return an OrthographicCameraType if the camera is parallel to the XY, YZ, or XZ plane?

0 Likes
Message 3 of 4

rolandas_vegis
Advocate
Advocate
Yes it does return OrthographicCameraType when camera is parallel to the XY, YZ, or XZ plane. Is this also a bug or is this expected behavior?
0 Likes
Message 4 of 4

kandennti
Mentor
Mentor

@rolandas_vegis .

 

I cannot determine if it is a bug or not.
However, it may be a bug since you even provide an enumerator.

0 Likes