Package autodesk_toxik :: Module init
[frames] | no frames]

Module init

Initialization module.

This module implements the wrappers the Toxik dynamic libraries require to safely perform initialization and finalization. The Toxik libraries have a sophisticated system of initialization that implements a dependency-based initialization order.

Developers need only to remember that before importing a Toxik module, you must always import the init module first as follows:

  import autodesk_toxik.init

Script developers should never have to import the Toxik dynamic libraries directly. Instead, a Python module has been implemented for each of the corresponding dynamic libraries. Each of these modules not only ensures that the initialization module is loaded first, it also provides additional functionality in Python itself. You import these modules within a script as follows:

  import autodesk_toxik.<modulename>

Or as follows:

  from autodesk_toxik import <modulename>

Project and User Files Auto-Save

When a script is ran in an external python interpreter, the files of the current project and user are automatically saved on finalization by default (however, project and user files are never automatically saved in the Toxik embedded interpreter). The following functions control this behavior:

Access to Interpreter Type

As mentioned in the script execution section, there are two types of Python interpreter in which a script can be run. First, in the Toxik embedded Python interpreter, i.e. within the Toxik process ("toxik.exe" executable). And secondly, in an external Python interpreter, i.e. within a Python process, typically from a shell ("python.exe" executable).

See also: inEmbeddedInterpreter.

Classes
  BuildInfo
Object that contains various pieces of information about the build.
  InitError
  ToxikIterator
Python interface for Toxik iterators.
Functions
 
enableProjectSaveOnFinalization(...)
Enables/disables current project save on script finalization in an external python interpreter.
 
enableUserSaveOnFinalization(...)
Enables/disables current user save on script finalization in an external python interpreter.
BuildInfo
getBuildInfo(...)
Returns: A BuildInfo object.
str
getInstanceIdentificationString(...)
Returns: The instance information string.
Variables
  inEmbeddedInterpreter = False
This global variable is a bool, set to True when the initialization module was loaded by an embedded Toxik Python interpreter, and False when loaded by in an external (command-line) interpreter.
  __package__ = 'autodesk_toxik'
Function Details

enableProjectSaveOnFinalization(...)

 

Enables/disables current project save on script finalization in an external python interpreter. This feature is enabled by default.

Parameters:
  • enable (bool)

enableUserSaveOnFinalization(...)

 

Enables/disables current user save on script finalization in an external python interpreter. This feature is enabled by default.

Parameters:
  • enable (bool)

getBuildInfo(...)

 
Returns: BuildInfo
A BuildInfo object.

getInstanceIdentificationString(...)

 
Returns: str
The instance information string. It is a string that uniquely represents an installable version of Toxik. This string is used by the installer to differentiate registry keys, Add/Remove Program entries, etc. For example: Autodesk Toxik 2010 - 2093.WinNT_intel_x86_64_opt

Variables Details

inEmbeddedInterpreter

This global variable is a bool, set to True when the initialization module was loaded by an embedded Toxik Python interpreter, and False when loaded by in an external (command-line) interpreter. This value should not be modified.

Value:
False