Error reading texture property value from fusion asset

Error reading texture property value from fusion asset

rolandas_vegis
Advocate Advocate
351 Views
0 Replies
Message 1 of 1

Error reading texture property value from fusion asset

rolandas_vegis
Advocate
Advocate

Hello,

 

When trying to read texture property value from a Fusion library asset I get the following error:

InternalValidationError : pIProperty->GetConnectedAssetCount() > 0 && pIProperty->IsConnectionEnabled().

 

This works fine with assets from our adsk lib and this used to work with assets from fusion library, however has now stoppped working.

 

Demo code:

 

#include <Core/CoreAll.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 lib = app->materialLibraries()->itemByName("Fusion 360 Appearance Library");
	if (!lib)
		return false;

	const auto appearance = lib->appearances()->item(0);
	const auto properties = appearance->appearanceProperties();
	for (auto i = 0; i < properties->count(); ++i) 
	{
		const Ptr<AppearanceTextureProperty> textureProperty = properties->item(i);

		if (!textureProperty)
			continue;

		const auto propertyValue = textureProperty->value();

		std::string error;
		app->getLastError(&error);
		app->userInterface()->messageBox(error);
		break;
	}

	return true;
}

extern "C" XI_EXPORT bool stop(const char* context)
{
	return true;
}

 

 

0 Likes
352 Views
0 Replies
Replies (0)