Class Core
- Namespace
Methods
cloneEntity
Clone an entity
core.cloneEntity(entity) -> core.Entity
Parameters
entityEntityThe entity to clone
Returns
- Entity
The cloned entity
configureFunctionLogger
core.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
deleteEntities
Delete a set of entities
core.deleteEntities(entities)
Parameters
entitiesEntityListList 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
Returns
getEvents
get events of a group
core.getEvents(moduleName, groupName) -> core.EventDescList
Parameters
Returns
getFunction
get FunctionDesc of a function
core.getFunction(moduleName, functionName) -> core.FunctionDesc
Parameters
Returns
getFunctions
get functions of a group
core.getFunctions(moduleName, groupName) -> core.FunctionDescList
Parameters
Returns
getGroup
get a group desc from a specific module
core.getGroup(moduleName, groupName) -> core.GroupDesc
Parameters
Returns
getGroups
get all group desc of a module
core.getGroups(moduleName) -> core.GroupDescList
Parameters
moduleNameStringTarget module name
Returns
getModuleTypes
get TypeDescList from a module name
core.getModuleTypes(moduleName) -> core.TypeDescList
Parameters
moduleNameStringTarget module name
Returns
getModules
get all modules desc
core.getModules() -> core.ModuleDescList
Returns
getModulesName
get all modules name
core.getModulesName() -> core.StringList
Returns
getType
get TypeDesc from a type name
core.getType(moduleName, typeNameStr) -> core.TypeDesc
Parameters
Returns
getTypeAttributes
get attributes TypeDesc from a type name
core.getTypeAttributes(moduleName, typeNameStr) -> core.StringPairList
Parameters
Returns
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
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
questionStringQuestion to display
defaultValueBooleanDefault 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
messageStringMessage to display
valuesStringListPossible values to choose
defaultValueIntDefault 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
msgStringMessage 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
interactiveBooleanTrue if you want to enter interactive mode, else False
entityExists
core.entityExists(entity) -> core.Boolean
Parameters
entityEntityThe 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
entityEntityThe wanted entity
Returns
- Int
Type id of the entity
getEntityTypeFromString
returns the type id of the entity
core.getEntityTypeFromString(entityTypeString) -> core.Int
Parameters
entityTypeStringStringThe wanted entity type
Returns
- Int
Type id of the entity
getEntityTypeString
returns the type name of the entity
core.getEntityTypeString(entity) -> core.String
Parameters
entityEntityThe wanted entity
Returns
- String
Name of the entity type
getTypeStats
Get the database stats
core.getTypeStats() -> core.IntListList
Returns
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
fileNameFilePathPath 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
fileNameOutputFilePathPath 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
tokenNameStringWanted token
checkLicense
check the current license
core.checkLicense() -> core.Boolean
Returns
checkWebLogin
Check if authentification on the Web license API is sucessfull
core.checkWebLogin(login, password) -> core.Boolean
Parameters
Returns
configureLicenseServer
Configure the license server to use to get floating licenses
core.configureLicenseServer(address, port, flexLM=True)
Parameters
generateActivationCode
Create an activation code to generate an offline license
core.generateActivationCode(filePath)
Parameters
filePathOutputFilePathPath to write the activation code
generateDeactivationCode
Create an deactivation code to release the license from this machine
core.generateDeactivationCode(filePath)
Parameters
filePathOutputFilePathPath to write the deactivation code
getCurrentLicenseInfos
get information on current installed license
core.getCurrentLicenseInfos() -> core.LicenseInfos
Returns
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
licensePathFilePathPath 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
onlyMandatoryBoolIf 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
tokenNameStringToken name
ownToken
Returns True if we own a token, without requesting it
core.ownToken(tokenName) -> core.Boolean
Parameters
tokenNameStringToken name
Returns
- Boolean
True if the token is owned
releaseToken
Release an optional license token
core.releaseToken(tokenName)
Parameters
tokenNameStringToken name
releaseWebLicense
release License owned by user WEB account
core.releaseWebLicense(login, password, id)
Parameters
removeWantedToken
remove a license token from the list of wanted optional tokens
core.removeWantedToken(tokenName)
Parameters
tokenNameStringUnwanted token
requestWebLicense
request License owned by user WEB account
core.requestWebLicense(login, password, id)
Parameters
retrieveWebLicenses
Retrieves License owned by user WEB account
core.retrieveWebLicenses(login, password) -> core.WebLicenseInfoList
Parameters
Returns
tokenValid
Returns True if a token is owned by the product, request will be done if missing
core.tokenValid(tokenName) -> core.Bool
Parameters
tokenNameStringToken name
Returns
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
fileNameStringThe desired file name (suffix of the path)
dataStringOptional data associated with file
Returns
- OutputFilePath
The complete generated file path
executeCommand
Execute a command
core.executeCommand(cmd="")
Parameters
cmdStringCommand to execute
getModuleDescFromXML
Generate a ModuleDesc from an .xml description
core.getModuleDescFromXML(xmlPath, addToModules) -> core.ModuleDesc
Parameters
Returns
removeModule
Remove a module added via getModuleDescFromXML
core.removeModule(module)
Parameters
moduleStringModule name
popProgression
Leave current progression level
core.popProgression()
pushProgression
Create a new progression level
core.pushProgression(stepCount, progressName="")
Parameters
stepProgression
Add a step to current progression level
core.stepProgression(stepCount=1)
Parameters
stepCountIntStep count
addCustomProperty
Add a custom property to an entity that support custom properties
core.addCustomProperty(entity, name, value="", type=0)
Parameters
entityEntityAn entity that support custom properties
nameStringName of the custom property
valueStringValue of the custom property
typePropertyTypeType of the custom property
getModuleProperty
Returns the value of a module property
core.getModuleProperty(module, propertyName) -> core.String
Parameters
Returns
- String
The property value
getModulePropertyInfo
Returns the value of a module property
core.getModulePropertyInfo(module, propertyName) -> core.PropertyInfo
Parameters
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
entitiesEntityListList of entities
propertyNameStringThe property name
defaultValueStringDefault 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
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
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
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
enumTypeIntThe 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
moduleStringName 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
entityEntityEntity 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
entitiesEntityListEntities 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
restoreModulePropertyDefaultValue
Restore the default value of a module property
core.restoreModulePropertyDefaultValue(module, propertyName) -> core.String
Parameters
Returns
- String
The property value as String
setModuleProperty
Set the value of a module property
core.setModuleProperty(module, propertyName, propertyValue) -> core.String
Parameters
moduleStringName of the module
propertyNameStringThe property name
propertyValueStringThe 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
entityEntityThe entity
propertyNameStringThe property name
propertyValueStringThe property value
Returns
- String
The property value as String
supportCustomProperties
Return true if an entity support custom properties
core.supportCustomProperties(entity) -> core.Boolean
Parameters
entityEntityAn entity
Returns
- Boolean
True if the entity support custom properties, else False
unsetProperty
Unset an entity's property
core.unsetProperty(entity, propertyName)
Parameters
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
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
getProductName
get the Pixyz product name
core.getProductName() -> core.String
Returns
getTempDirectory
get the Pixyz temp directory (server side directory in case of remote access)
core.getTempDirectory() -> core.String
Returns
getVersion
get the Pixyz product version
core.getVersion() -> core.String
Returns
pushAnalytic
push custom analytic event (Only for authorized products)
core.pushAnalytic(name, data="")
Parameters
removeDirectory
Remove a directory and all its contents
core.removeDirectory(path)
Parameters
pathDirectoryPathPath 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
getUndoStack
Get the history of actions stack
core.getUndoStack() -> core.StringList
Returns
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
countUInt
startUndoRedoStep
Start a new undo/redo step
core.startUndoRedoStep(stepName)
Parameters
stepNameString
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
countUInt
getColorFromIndex
Returns a unique color associated with an index
core.getColorFromIndex(index) -> core.Color
Parameters
indexIntIndex 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
levelVerboseVerbose level
addLogFileVerbose
add a log file verbose level
core.addLogFileVerbose(level)
Parameters
levelVerboseVerbose level
addSessionLogFileVerbose
add a session log file (lastSession.log) verbose level
core.addSessionLogFileVerbose(level)
Parameters
levelVerboseVerbose level
configureInterfaceLogger
Set new configuration for the Interface Logger
core.configureInterfaceLogger(enableFunction=True, enableParameters=True, enableExecutionTime=True)
Parameters
enableFunctionBooleanIf true, the called function names will be print
enableParametersBooleanIf true, the called function parameters will be print (only if enableFunction=true too)
enableExecutionTimeBooleanIf 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
levelVerboseVerbose level
removeLogFileVerbose
remove a log file verbose level
core.removeLogFileVerbose(level)
Parameters
levelVerboseVerbose level
removeSessionLogFileVerbose
remove a session log file (lastSession.log) verbose level
core.removeSessionLogFileVerbose(level)
Parameters
levelVerboseVerbose 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
pathOutputFilePathPath of the core dump file
setLogFile
set the path of the log file
core.setLogFile(path)
Parameters
pathOutputFilePathPath of the log file
AfterEntityPropertyChanged
def onAfterEntityPropertyChanged(entity, property, entityType):
pass
id = core.addAfterEntityPropertyChangedCallback(onAfterEntityPropertyChanged)
...
core.removeAfterEntityPropertyChangedCallback(id)
Parameters
entityEntityEntity changed
propertyStringProperty changed
entityTypeIntType of the entity changed
AfterModulePropertyChanged
def onAfterModulePropertyChanged(module, property):
pass
id = core.addAfterModulePropertyChangedCallback(onAfterModulePropertyChanged)
...
core.removeAfterModulePropertyChangedCallback(id)
Parameters
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
BeforeModulePropertyChanged
def onBeforeModulePropertyChanged(module, property):
pass
id = core.addBeforeModulePropertyChangedCallback(onBeforeModulePropertyChanged)
...
core.removeBeforeModulePropertyChangedCallback(id)
Parameters
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
OnSessionReset
def onOnSessionReset():
pass
id = core.addOnSessionResetCallback(onOnSessionReset)
...
core.removeOnSessionResetCallback(id)
ProgressChanged
def onProgressChanged(progress):
pass
id = core.addProgressChangedCallback(onProgressChanged)
...
core.removeProgressChangedCallback(id)
Parameters
progressIntCurrent 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
stepNameStringName of the started step
DebugEvent
def onDebugEvent(event_type):
pass
id = core.addDebugEventCallback(onDebugEvent)
...
core.removeDebugEventCallback(id)
Parameters
event_typeIntThe type of signal to emit
UndoRedoStackChanged
def onUndoRedoStackChanged():
pass
id = core.addUndoRedoStackChangedCallback(onUndoRedoStackChanged)
...
core.removeUndoRedoStackChangedCallback(id)