Table of Contents

Class Core

Namespace
Core

Methods

cloneEntity

Clone an entity

core.cloneEntity(entity) -> core.Entity

Parameters

entity Entity

The entity to clone

Returns

Entity

The cloned entity

configureFunctionLogger

core.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)

Parameters

functionName String
enableFunction Boolean
enableParameters Boolean
enableExecutionTime Boolean

deleteEntities

Delete a set of entities

core.deleteEntities(entities)

Parameters

entities EntityList

List of entity to delete

resetSession

Clear all the current session (all unsaved work will be lost)

core.resetSession()

unsavedUserChanges

Returns true if the user has made changes to the project

core.unsavedUserChanges() -> core.Bool

Returns

Bool

Boolean checking if the project has been modified

updateDocumentation

Update the documentation of available functions and plugins in HTML format

core.updateDocumentation()

getEvent

get EventDesc of an event

core.getEvent(moduleName, eventName) -> core.EventDesc

Parameters

moduleName String

Target module name

eventName String

Returns

EventDesc

getEvents

get events of a group

core.getEvents(moduleName, groupName) -> core.EventDescList

Parameters

moduleName String

Target module name

groupName String

Target group name

Returns

EventDescList

getFunction

get FunctionDesc of a function

core.getFunction(moduleName, functionName) -> core.FunctionDesc

Parameters

moduleName String

Target module name

functionName String

Target function name

Returns

FunctionDesc

getFunctions

get functions of a group

core.getFunctions(moduleName, groupName) -> core.FunctionDescList

Parameters

moduleName String

Target module name

groupName String

Target group name

Returns

FunctionDescList

getGroup

get a group desc from a specific module

core.getGroup(moduleName, groupName) -> core.GroupDesc

Parameters

moduleName String

Target module name

groupName String

Target group name

Returns

GroupDesc

getGroups

get all group desc of a module

core.getGroups(moduleName) -> core.GroupDescList

Parameters

moduleName String

Target module name

Returns

GroupDescList

getModuleTypes

get TypeDescList from a module name

core.getModuleTypes(moduleName) -> core.TypeDescList

Parameters

moduleName String

Target module name

Returns

TypeDescList

getModules

get all modules desc

core.getModules() -> core.ModuleDescList

Returns

ModuleDescList

getModulesName

get all modules name

core.getModulesName() -> core.StringList

Returns

StringList

getType

get TypeDesc from a type name

core.getType(moduleName, typeNameStr) -> core.TypeDesc

Parameters

moduleName String

Target module name

typeNameStr String

Target type name

Returns

TypeDesc

getTypeAttributes

get attributes TypeDesc from a type name

core.getTypeAttributes(moduleName, typeNameStr) -> core.StringPairList

Parameters

moduleName String

Target module name

typeNameStr String

Target type name

Returns

StringPairList

softStopAsyncEventManager

Ask the async EventManager to join the main thread, enableEventManagerAsync must be enable

core.softStopAsyncEventManager()

lockProcessing

Lock the mutex that ensure no processing is done between lock/unlock

core.lockProcessing()

tryLockProcessing

Try to lock the mutex that ensure no processing is done between lock/unlock, returns true if the mutex has been locked, false if it was already locked

core.tryLockProcessing() -> core.Bool

Returns

Bool

True if the mutex has been successfully locked

unlockProcessing

Unlock the mutex that ensure no processing is done between lock/unlock

core.unlockProcessing()

askString

Invite the user to enter a string

core.askString(msg, defaultValue) -> core.String

Parameters

msg String

Message to display

defaultValue String

Message to display

Returns

String

The string entered by the user

askYesNo

Ask a question which need a Yes/No answer

core.askYesNo(question, defaultValue) -> core.Boolean

Parameters

question String

Question to display

defaultValue Boolean

Default value (if interfactive mode is disabled)

Returns

Boolean

True if the user say Yes, else False

choose

Invite the user to choose one value between multiple choice

core.choose(message, values, defaultValue) -> core.Int

Parameters

message String

Message to display

values StringList

Possible values to choose

defaultValue Int

Default value index

Returns

Int

Index of the chosen value in the values list

isInteractiveMode

Returns True if the script is in interactive mode, else returns false

core.isInteractiveMode() -> core.Boolean

Returns

Boolean

True if interactive, else false

message

Display a message (or a MessageBox in GUI)

core.message(msg)

Parameters

msg String

Message to display

setInteractiveMode

Switch between interactive mode and non-interactive mode, UI functions will no ask user on non-interactive mode and will return default values

core.setInteractiveMode(interactive=True)

Parameters

interactive Boolean

True if you want to enter interactive mode, else False

entityExists

core.entityExists(entity) -> core.Boolean

Parameters

entity Entity

The wanted entity

Returns

Boolean

True if it exists.

getAllEntities

returns all the entities on the database

core.getAllEntities() -> core.EntityList

Returns

EntityList

All entities

getCurrentPiXYZFile

Get current (loaded) Pixyz file path

core.getCurrentPiXYZFile() -> core.FilePath

Returns

FilePath

The current Pixyz file

getEntityType

returns the type id of the entity

core.getEntityType(entity) -> core.Int

Parameters

entity Entity

The wanted entity

Returns

Int

Type id of the entity

getEntityTypeFromString

returns the type id of the entity

core.getEntityTypeFromString(entityTypeString) -> core.Int

Parameters

entityTypeString String

The wanted entity type

Returns

Int

Type id of the entity

getEntityTypeString

returns the type name of the entity

core.getEntityTypeString(entity) -> core.String

Parameters

entity Entity

The wanted entity

Returns

String

Name of the entity type

getTypeStats

Get the database stats

core.getTypeStats() -> core.IntListList

Returns

IntListList

isCurrentPiXYZFileModified

Return true, if the current (loaded) file has been modified since last load or save

core.isCurrentPiXYZFileModified() -> core.Boolean

Returns

Boolean

True if the file is modified

load

Load a new scene

core.load(fileName)

Parameters

fileName FilePath

Path to load the file

lockEntityRegistration

Lock Entity registration, use with Caution. All entities created after this call will not be saved on .pxz file and will not be listed as existing entities on the Database. Be careful to not references these entities with other registered entities

core.lockEntityRegistration()

save

Save the scene

core.save(fileName)

Parameters

fileName OutputFilePath

Path to save the file

unlockEntityRegistration

Unlock Entity registration

core.unlockEntityRegistration()

addWantedToken

Add a license token to the list of wanted optional tokens

core.addWantedToken(tokenName)

Parameters

tokenName String

Wanted token

checkLicense

check the current license

core.checkLicense() -> core.Boolean

Returns

Boolean

checkWebLogin

Check if authentification on the Web license API is sucessfull

core.checkWebLogin(login, password) -> core.Boolean

Parameters

login String

WEB account login

password Password

WEB account password

Returns

Boolean

configureLicenseServer

Configure the license server to use to get floating licenses

core.configureLicenseServer(address, port, flexLM=True)

Parameters

address String

Server address

port UShort

Server port

flexLM Boolean

Enable FlexLM license server

generateActivationCode

Create an activation code to generate an offline license

core.generateActivationCode(filePath)

Parameters

filePath OutputFilePath

Path to write the activation code

generateDeactivationCode

Create an deactivation code to release the license from this machine

core.generateDeactivationCode(filePath)

Parameters

filePath OutputFilePath

Path to write the deactivation code

getCurrentLicenseInfos

get information on current installed license

core.getCurrentLicenseInfos() -> core.LicenseInfos

Returns

LicenseInfos

getLicenseServer

Get current license server

core.getLicenseServer() -> core.String, core.UShort, core.Bool

Returns

String

Server host name or IP

installLicense

install a new license

core.installLicense(licensePath)

Parameters

licensePath FilePath

Path of the license file

listOwnedTokens

Get the list of actually owned license tokens

core.listOwnedTokens() -> core.StringList

Returns

StringList

Owned token list

listTokens

Get the list of license tokens for this product

core.listTokens(onlyMandatory) -> core.StringList

Parameters

onlyMandatory Bool

If True, optional tokens will not be returned

Returns

StringList

Token list

listWantedTokens

Get the list of license token configured to be requested at initialization

core.listWantedTokens() -> core.StringList

Returns

StringList

Token list

needToken

Ensure that a license token is available, useful to be sure to own floatting licence tokens

core.needToken(tokenName)

Parameters

tokenName String

Token name

ownToken

Returns True if we own a token, without requesting it

core.ownToken(tokenName) -> core.Boolean

Parameters

tokenName String

Token name

Returns

Boolean

True if the token is owned

releaseToken

Release an optional license token

core.releaseToken(tokenName)

Parameters

tokenName String

Token name

releaseWebLicense

release License owned by user WEB account

core.releaseWebLicense(login, password, id)

Parameters

login String

WEB account login

password Password

WEB account password

id Ident

WEB license id

removeWantedToken

remove a license token from the list of wanted optional tokens

core.removeWantedToken(tokenName)

Parameters

tokenName String

Unwanted token

requestWebLicense

request License owned by user WEB account

core.requestWebLicense(login, password, id)

Parameters

login String

WEB account login

password Password

WEB account password

id Ident

WEB license id

retrieveWebLicenses

Retrieves License owned by user WEB account

core.retrieveWebLicenses(login, password) -> core.WebLicenseInfoList

Parameters

login String

WEB account login

password Password

WEB account password

Returns

WebLicenseInfoList

tokenValid

Returns True if a token is owned by the product, request will be done if missing

core.tokenValid(tokenName) -> core.Bool

Parameters

tokenName String

Token name

Returns

Bool

getOutputFilePath

Return a complete output file path for Pixyz Pipeline, this function is useful for online usage when you know where is the output directory

core.getOutputFilePath(fileName, data) -> core.OutputFilePath

Parameters

fileName String

The desired file name (suffix of the path)

data String

Optional data associated with file

Returns

OutputFilePath

The complete generated file path

executeCommand

Execute a command

core.executeCommand(cmd="")

Parameters

cmd String

Command to execute

getModuleDescFromXML

Generate a ModuleDesc from an .xml description

core.getModuleDescFromXML(xmlPath, addToModules) -> core.ModuleDesc

Parameters

xmlPath FilePath

.xml file path

addToModules Boolean

Returns

ModuleDesc

removeModule

Remove a module added via getModuleDescFromXML

core.removeModule(module)

Parameters

module String

Module name

popProgression

Leave current progression level

core.popProgression()

pushProgression

Create a new progression level

core.pushProgression(stepCount, progressName="")

Parameters

stepCount Int

Step count

progressName String

Name of the progression step

stepProgression

Add a step to current progression level

core.stepProgression(stepCount=1)

Parameters

stepCount Int

Step count

addCustomProperty

Add a custom property to an entity that support custom properties

core.addCustomProperty(entity, name, value="", type=0)

Parameters

entity Entity

An entity that support custom properties

name String

Name of the custom property

value String

Value of the custom property

type PropertyType

Type of the custom property

getModuleProperty

Returns the value of a module property

core.getModuleProperty(module, propertyName) -> core.String

Parameters

module String

Name of the module

propertyName String

The property name

Returns

String

The property value

getModulePropertyInfo

Returns the value of a module property

core.getModulePropertyInfo(module, propertyName) -> core.PropertyInfo

Parameters

module String

Name of the module

propertyName String

The property name

Returns

PropertyInfo

The property info

getProperties

Get the property value on entities (if the property is not set on an entity, defaultValue is returned)

core.getProperties(entities, propertyName, defaultValue) -> core.StringList

Parameters

entities EntityList

List of entities

propertyName String

The property name

defaultValue String

Default value to return if the property does not exist on an entity

Returns

StringList

Property value on each entity

getProperty

Get a property value as String on an entity (error if the property does not exist on the entity)

core.getProperty(entity, propertyName) -> core.String

Parameters

entity Entity

The entity

propertyName String

The property name

Returns

String

The property value as String

getPropertyInfo

Get a property info on an entity (error if the property does not exist on the entity)

core.getPropertyInfo(entity, propertyName) -> core.PropertyInfo

Parameters

entity Entity

The entity

propertyName String

The property name

Returns

PropertyInfo

The property info

hasProperty

Return true if the property was found on the occurrence, will not throw any exception except if the entity does not exist.

core.hasProperty(entity, propertyName) -> core.Boolean

Parameters

entity Entity

An entity that support properties

propertyName String

Name of the property

Returns

Boolean

True if the entity has the property asked, else False

listEnumLabels

Returns the informations of a module property

core.listEnumLabels(enumType) -> core.EnumPropertyInfo

Parameters

enumType Int

The real enum type number (ie. The one return in subtype of PropertyInfo)

Returns

EnumPropertyInfo

The enum property info

listModuleProperties

Returns all the properties in the given module

core.listModuleProperties(module) -> core.PropertyInfoList

Parameters

module String

Name of the module

Returns

PropertyInfoList

List of module properties info

listProperties

Returns the names and values of the properties available on an entity

core.listProperties(entity) -> core.PropertyInfoList

Parameters

entity Entity

Entity to list

Returns

PropertyInfoList

List of available properties info

listPropertiesBatch

Returns the names and values of the properties available on multiple entities

core.listPropertiesBatch(entities) -> core.PropertyInfoListList

Parameters

entities EntityList

Entities to list

Returns

PropertyInfoListList

List of available properties info

removeCustomProperty

Remove a custom property from an entity that support custom properties

core.removeCustomProperty(entity, name)

Parameters

entity Entity

An entity that support custom properties

name String

Name of the custom property

restoreModulePropertyDefaultValue

Restore the default value of a module property

core.restoreModulePropertyDefaultValue(module, propertyName) -> core.String

Parameters

module String

Name of the module

propertyName String

The property name

Returns

String

The property value as String

setModuleProperty

Set the value of a module property

core.setModuleProperty(module, propertyName, propertyValue) -> core.String

Parameters

module String

Name of the module

propertyName String

The property name

propertyValue String

The property value

Returns

String

The property value as String

setProperty

Set a property value on an entity

core.setProperty(entity, propertyName, propertyValue) -> core.String

Parameters

entity Entity

The entity

propertyName String

The property name

propertyValue String

The property value

Returns

String

The property value as String

supportCustomProperties

Return true if an entity support custom properties

core.supportCustomProperties(entity) -> core.Boolean

Parameters

entity Entity

An entity

Returns

Boolean

True if the entity support custom properties, else False

unsetProperty

Unset an entity's property

core.unsetProperty(entity, propertyName)

Parameters

entity Entity

The entity

propertyName String

The property name

availableMemory

returns available memory

core.availableMemory() -> core.Long, core.Long, core.Long, core.Long

Returns

Long

Available virtual memory in bytes

checkForUpdates

check for software update

core.checkForUpdates() -> core.Bool, core.String, core.String

Returns

Bool

True if there is a new version available of this product

clearOtherTemporaryDirectories

remove all other session temporary directories (warning: make sure that no other instance of pixyz is running

core.clearOtherTemporaryDirectories()

getCustomVersionTag

get the Pixyz custom version tag

core.getCustomVersionTag() -> core.String

Returns

String

getMemoryUsagePeak

Returns the memory usage peak of the current process in MB ( only available on windows yet )

core.getMemoryUsagePeak() -> core.Long

Returns

Long

Maximum physical memory used by the process until now (in MB)

getPixyzWebsiteURL

get the Pixyz website URL

core.getPixyzWebsiteURL() -> core.String

Returns

String

getProductName

get the Pixyz product name

core.getProductName() -> core.String

Returns

String

getTempDirectory

get the Pixyz temp directory (server side directory in case of remote access)

core.getTempDirectory() -> core.String

Returns

String

getVersion

get the Pixyz product version

core.getVersion() -> core.String

Returns

String

pushAnalytic

push custom analytic event (Only for authorized products)

core.pushAnalytic(name, data="")

Parameters

name String

Analytic event name

data String

Analytic event data

removeDirectory

Remove a directory and all its contents

core.removeDirectory(path)

Parameters

path DirectoryPath

Path to the directory to remove

setCurrentThreadAsProcessThread

Set the process thread. Use this function when you want to get progress changed callbacks from another thread as the one you initialized Pixyz on.

core.setCurrentThreadAsProcessThread()

clearUndoRedo

Clear undo/redo history

core.clearUndoRedo()

endUndoRedoStep

End current undo/redo step

core.endUndoRedoStep()

getRedoStack

Get the history of actions stack

core.getRedoStack() -> core.StringList

Returns

StringList

getUndoStack

Get the history of actions stack

core.getUndoStack() -> core.StringList

Returns

StringList

hasRecordingStep

Has recording step

core.hasRecordingStep() -> core.Boolean

Returns

Boolean

True if there is recoding step, else False

redo

redo some steps

core.redo(count=1)

Parameters

count UInt

startUndoRedoStep

Start a new undo/redo step

core.startUndoRedoStep(stepName)

Parameters

stepName String

stopProcess

Stop process (works if there is recording step)

core.stopProcess()

toggleUndoRedo

Toggle undo/redo

core.toggleUndoRedo()

undo

undo some steps

core.undo(count=1)

Parameters

count UInt

getColorFromIndex

Returns a unique color associated with an index

core.getColorFromIndex(index) -> core.Color

Parameters

index Int

Index of the color (index must be less than 2^24)

Returns

Color

The unique color associated to the given index

addConsoleVerbose

add a console verbose level

core.addConsoleVerbose(level)

Parameters

level Verbose

Verbose level

addLogFileVerbose

add a log file verbose level

core.addLogFileVerbose(level)

Parameters

level Verbose

Verbose level

addSessionLogFileVerbose

add a session log file (lastSession.log) verbose level

core.addSessionLogFileVerbose(level)

Parameters

level Verbose

Verbose level

configureInterfaceLogger

Set new configuration for the Interface Logger

core.configureInterfaceLogger(enableFunction=True, enableParameters=True, enableExecutionTime=True)

Parameters

enableFunction Boolean

If true, the called function names will be print

enableParameters Boolean

If true, the called function parameters will be print (only if enableFunction=true too)

enableExecutionTime Boolean

If true, the called functions execution times will be print

getInterfaceLoggerConfiguration

Get the current Interface Logger configuration

core.getInterfaceLoggerConfiguration() -> core.Boolean, core.Boolean, core.Boolean

Returns

Boolean

True if the called function names are printed

removeConsoleVerbose

remove a console verbose level

core.removeConsoleVerbose(level)

Parameters

level Verbose

Verbose level

removeLogFileVerbose

remove a log file verbose level

core.removeLogFileVerbose(level)

Parameters

level Verbose

Verbose level

removeSessionLogFileVerbose

remove a session log file (lastSession.log) verbose level

core.removeSessionLogFileVerbose(level)

Parameters

level Verbose

Verbose level

setCoreDumpFile

set the path of the core dump file that will be written when a crash occurs (default=none)

Warning

This function is tagged as EXPERIMENTAL.

core.setCoreDumpFile(path)

Parameters

path OutputFilePath

Path of the core dump file

setLogFile

set the path of the log file

core.setLogFile(path)

Parameters

path OutputFilePath

Path of the log file

AfterEntityPropertyChanged

def onAfterEntityPropertyChanged(entity, property, entityType):
    pass

id = core.addAfterEntityPropertyChangedCallback(onAfterEntityPropertyChanged)

...

core.removeAfterEntityPropertyChangedCallback(id)

Parameters

entity Entity

Entity changed

property String

Property changed

entityType Int

Type of the entity changed

AfterModulePropertyChanged

def onAfterModulePropertyChanged(module, property):
    pass

id = core.addAfterModulePropertyChangedCallback(onAfterModulePropertyChanged)

...

core.removeAfterModulePropertyChangedCallback(id)

Parameters

module String

Module changed

property String

Property changed

AtExit

def onAtExit():
    pass

id = core.addAtExitCallback(onAtExit)

...

core.removeAtExitCallback(id)

BeforeEntityPropertyChanged

def onBeforeEntityPropertyChanged(entity, property):
    pass

id = core.addBeforeEntityPropertyChangedCallback(onBeforeEntityPropertyChanged)

...

core.removeBeforeEntityPropertyChangedCallback(id)

Parameters

entity Entity

Entity changed

property String

Property changed

BeforeModulePropertyChanged

def onBeforeModulePropertyChanged(module, property):
    pass

id = core.addBeforeModulePropertyChangedCallback(onBeforeModulePropertyChanged)

...

core.removeBeforeModulePropertyChangedCallback(id)

Parameters

module String

Module changed

property String

Property changed

BeforeSessionReset

def onBeforeSessionReset():
    pass

id = core.addBeforeSessionResetCallback(onBeforeSessionReset)

...

core.removeBeforeSessionResetCallback(id)

CurrentFileChanged

def onCurrentFileChanged():
    pass

id = core.addCurrentFileChangedCallback(onCurrentFileChanged)

...

core.removeCurrentFileChangedCallback(id)

EnteringUnsafeMode

def onEnteringUnsafeMode():
    pass

id = core.addEnteringUnsafeModeCallback(onEnteringUnsafeMode)

...

core.removeEnteringUnsafeModeCallback(id)

LeavingUnsafeMode

def onLeavingUnsafeMode():
    pass

id = core.addLeavingUnsafeModeCallback(onLeavingUnsafeMode)

...

core.removeLeavingUnsafeModeCallback(id)

OnConsoleMessage

def onOnConsoleMessage(text, verboseLevel):
    pass

id = core.addOnConsoleMessageCallback(onOnConsoleMessage)

...

core.removeOnConsoleMessageCallback(id)

Parameters

text String

Message content

verboseLevel Verbose

Verbose level

OnSessionReset

def onOnSessionReset():
    pass

id = core.addOnSessionResetCallback(onOnSessionReset)

...

core.removeOnSessionResetCallback(id)

ProgressChanged

def onProgressChanged(progress):
    pass

id = core.addProgressChangedCallback(onProgressChanged)

...

core.removeProgressChangedCallback(id)

Parameters

progress Int

Current progression

ProgressStepFinished

def onProgressStepFinished():
    pass

id = core.addProgressStepFinishedCallback(onProgressStepFinished)

...

core.removeProgressStepFinishedCallback(id)

ProgressStepStart

def onProgressStepStart(stepName):
    pass

id = core.addProgressStepStartCallback(onProgressStepStart)

...

core.removeProgressStepStartCallback(id)

Parameters

stepName String

Name of the started step

DebugEvent

def onDebugEvent(event_type):
    pass

id = core.addDebugEventCallback(onDebugEvent)

...

core.removeDebugEventCallback(id)

Parameters

event_type Int

The type of signal to emit

UndoRedoStackChanged

def onUndoRedoStackChanged():
    pass

id = core.addUndoRedoStackChangedCallback(onUndoRedoStackChanged)

...

core.removeUndoRedoStackChangedCallback(id)