Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Camera type bug

3 REPLIES 3
Reply
Message 1 of 4
rolandas.vegis
153 Views, 3 Replies

Camera type bug

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

 

3 REPLIES 3
Message 2 of 4
kandennti
in reply to: rolandas.vegis

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?

Message 3 of 4
rolandas.vegis
in reply to: kandennti

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?
Message 4 of 4
kandennti
in reply to: rolandas.vegis

@rolandas.vegis .

 

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report