ILicense

Functions

SET_CID

RED_RC

SetLicense

const Version &

GetSDKVersion

RED_RC

IsProductActivated

RED_RC

IsTemporaryLicense

Detailed Description

class ILicense : public RED::IREDObject

Interface that exposes license management methods.

@related Licensing, class RED::LicenseTime

The RED::ILicense interface exposes the REDsdk licensing API. It enables customers to disarm the REDsdk license checks in order to deploy their applications to their own customers.

There are two licensing modes in REDsdk: per-seat or software vendor licensing. Each mode comes with its own API to set up a license.

Whatever the licensing mode you chose, licensing your REDsdk-based application is the very first step in running it. If you miss or fail to license correctly your application, REDsdk API calls will fail.

In both modes, the customer is provided with a customer ID uniquely identifying him in TechSoft3D’s customers list. This ID is encrypted and privately held to respect customer’s privacy. Alternatively, he may have received a generic customer ID with a temporary license key for evaluation purpose.

Software vendor mode

In this mode, a REDsdk customer must also have received a license key along with his customer ID. Both information need to be supplied to the API to remove REDsdk protection.

Code example

The CID_REDResourceManager is the only object that exposes this interface.

A customer should always have those lines of code inserted into his application after having created a RED::IResourceManager instance and before any call to the other RED::Factory methods:

// create the unique instance of the REDResourceManager:
RED::Object* resmgr = RED::Factory::CreateInstance( CID_REDResourceManager );
if( resmgr == NULL )
  ERROR;

// get the interface to the RED resource manager
RED::IResourceManager *iresmgr = _resmgr->As<RED::IResourceManager>();

// get the interface to the licensing API
RED::ILicense* ilicense = _resmgr->As< RED::ILicense >();

// setup the customer licensing information (software vendor mode)
ilicense->SetLicense( my_license_key );

You can then check if your application is correctly activated by calling RED::ILicense::IsProductActivated.

Upon success, those lines of code definitely disarm the REDsdk protection.

Public Functions

SET_CID(CID_class_REDILicense)
virtual RED_RC SetLicense(const RED::String &iLicenseKey) = 0

Sets a software vendor license.

This method is needed to authorize REDsdk in software vendor mode. If not called, REDsdk will fail to start. See \ref tk_setting_up_a_redsdk_software_vendor_license for details on setting up a software vendor license.

Parameters
  • iLicenseKey – the license key.

  • iCustomerID – the customer ID.

Returns

RED_OK on success,

RED_ALLOC_FAILURE on a memory allocation error,

RED_FAIL otherwise.

virtual const RED::Version &GetSDKVersion() const = 0

Gets the version of Luminate currently in use.

Returns

A constant reference to the REDsdk version.

virtual RED_RC IsProductActivated(bool &oActivated, RED::PRODUCT iProduct) const = 0

Gets the activation state of the application.

A product is activated if it has at least a valid license key associated with it.

Please note that license may be time limited.

Parameters
  • oActivated – Reference to the activation flag value.

  • iProduct – product to check for validity.

Returns

RED_OK on succes,

RED_FAIL otherwise.

virtual RED_RC IsTemporaryLicense(bool &oTemporary, LicenseTime &oEndDate) const = 0

Gets the temporary state of the current license and, if meaningful, the end date of the license.

Parameters
  • oTemporary – Reference to the temporary flag of the license.

  • oEndDate – Reference to the end date of a temporary license. Undefined if the license is not temporary.

Returns

RED_OK on succes,

RED_FAIL otherwise.