maxon

Note

Core members documented here are defined directly in maxon; there is no maxon.frameworks.core module. See the Maxon API section of the API Overview for more information about the special conventions of this API.

Module for fundamental Maxon API types and operations.

Interfaces

Hardware and Software Information

MachineInterface(*args)

This class is the entry point to access machine interfaces.

MachinesInterface()

This class declares functions to access and manage machines.

Application()

Application wide functions.

System()

Application wide system functions.

I/O

FileFormatHandlerInterface(*args)

FileFormatHandlerInterface implements a handler for a specific FileFormat.

FileFormatInterface(*args)

maxon.FileFormatInterface allows to implement and register file formats with its detection algorithm.

IoHandlerInterface(*args)

The IoHandler class offers some I/O functionality for filenames.

IoConnectionInterface(*args)

The connection interface a given maxon.Url.

IoBrowseInterface(*args)

The IoBrowseIterator interface for a given maxon.Url.

BaseStreamInterface(*args)

Interface is the base interface for all stream interfaces.

InOutputStreamInterface(*args)

Creates an maxon.InOutputStreamInterface class to read/write bytes from/into streams.

InputStreamInterface(*args)

Interface for input streams. It allows to read data from streams.

OutputStreamInterface(*args)

Creates an maxon.OutputStreamInterface class to write bytes into streams.

UrlInterface(*args)

Interface class for maxon.Url.

Network

NetworkIpInterface()

Static interface to access network functionality.

NetworkIpAddrInterface(*args)

Represents an Internet Protocol (IP) address.

NetworkIpAddrPortInterface(*args)

Provides an Internet Protocol (IP) address + port.

Logger

LoggerTypeInterface(*args)

Each object of maxon.LoggerLine represents an entry in the logger with several meta information.

LoggerInterface(*args)

The logger interface allows to create new custom loggers for specific tasks and to access existing loggers.

Misc

Timer()

A timer class to retrieve the current time.

GradientKnot([otherOrColor, brightness, …])

Initializes the appropriate C++ Data object and store it within the _data member.

GradientInterface()

This is the interface for the Gradient data type.

Gradient(*args)

Reference class for maxon.GradientInterface.

GradientRenderDataInterface()

GradientRenderData(*args)

Reference class for maxon.GradientRenderDataInterface.

Core

DataDictionaryObjectInterface(*args)

Class to store and find any maxon.Data type under any type of key.

DataDictionaryInterface(*args)

Class to store and find any data type under any type of key.

RegistryInterface([C])

maxon.RegistryInterface is used internally by maxon.Registry.

StringInterface([C])

Class to store unicode strings. String stores 16bit unicode characters.

CStringInterface([C])

Class to store ASCII strings. CString stores 8 bit characters.

UuidInterface()

Resource()

Class that handles resources.

LanguageInterface()

DataDescriptionInterface()

Core Helper

ClassInterface(*args)

A maxon.ClassInterface object represents an object class at runtime.

ObjectInterface(*args)

Object is the root of the interface hierarchy of the MAXON API.

AutoIterator(array[, beginIndex])

AutoIterator implements a foreach iterator for a BaseArray

ObserverObjectInterface(*args)

maxon.Component to allow maxon.ObjectInterface interfaces to use the observable concept.

References

Hardware and Software Information

MachineRef(*args)

Reference class of maxon.MachineInterface.

I/O

FileFormatHandler(*args)

Reference class of maxon.FileFormatHandlerInterface.

FileFormat(*args)

Reference class of maxon.FileFormatInterface.

IoHandler(*args)

Reference class of maxon.IoHandlerInterface.

IoConnectionRef(*args)

Reference class of maxon.IoConnectionInterface.

IoBrowseRef(*args)

Reference class of maxon.IoBrowseInterface.

InOutputStreamRef(*args)

Reference class of maxon.InOutputStreamInterface.

InputStreamRef(*args)

Reference class of maxon.InputStreamInterface.

OutputStreamRef(*args)

Reference class of maxon.OutputStreamInterface.

Url(*args, **kwargs)

Reference class of maxon.UrlInterface.

Network

NetworkIpAddr(*args)

Reference class of maxon.NetworkIpAddrInterface.

NetworkIpAddrPort(*args)

Reference class of maxon.OutputStreamInterface.

Logger

LoggerTypeRef(*args)

Reference class of maxon.LoggerTypeInterface.

LoggerRef(*args)

Reference class of maxon.LoggerInterface.

Core

DataDictionary(*args)

Reference class of maxon.DataDictionaryInterface.

Registry()

Registries are used to register specific implementations of a given interface.

String([C])

Reference class of maxon.StringInterface.

CString([C])

Reference class of maxon.CStringInterface.

ThreadRef([C])

Reference to a maxon.ThreadInterface.

LanguageRef(*args)

Reference class of maxon.LanguageInterface.

DataDescription(*args)

Reference class of maxon.DataDescriptionInterface.

Uuid(*args)

Reference class of maxon.UuidInterface.

Core Helper

Class(*args)

Reference class of maxon.ClassInterface.

ObjectRef(*args)

Creates and stores internally the reference of the C++ Data.

Data Types

Simple Data Type

Bool([C])

Boolean type, possible values are only False/True, 8 bits.

Char([C])

Signed 8 bits character.

UChar([C])

Unsigned 8 bits character.

Float

alias of maxon.interface.Float64

Float32([C])

Floating point value 32 bits (float).

Float64([C])

Floating point value 64 bits (double).

Int

alias of maxon.interface.Int64

Int16([C])

Signed integer 16 bits (either positive or negative number).

Int32([C])

Signed integer 32 bits (either positive or negative number).

Int64([C])

Signed integer 64 bits (either positive or negative number).

UInt

alias of maxon.interface.UInt64

UInt16([C])

Unsigned integer 16 bits (always positive number).

UInt32([C])

Unsigned integer 32 bits (always positive number).

UInt64([C])

Unsigned integer 64 bits (always positive number).

Vector / Matrix Data Type

Vec3([x, y, z])

A vector consisting of three components X, Y and Z.

Vector32([x, y, z])

Initializes a new three component vector.

Vector64([x, y, z])

Initializes a new three component vector.

Vector

alias of maxon.vector.Vector64

IntVector32([x, y, z])

Initializes a new three component vector.

IntVector64([x, y, z])

Initializes a new three component vector.

IntVector

alias of maxon.vector.IntVector64

Col3([r, g, b])

Initializes a new three component color.

Color32([r, g, b])

Initializes a new three component color.

Color64([r, g, b])

Initializes a new three component color.

Color

alias of maxon.vector.Color64

Vec4([x, y, z, w])

Initializes a new four component vector.

Vector4d32([x, y, z, w])

Initializes a new four component vector.

Vector4d64([x, y, z, w])

Initializes a new four component vector.

Vector4d

alias of maxon.vector4d.Vector4d64

ColorA32([r, g, b, a])

Initializes a new four component color.

ColorA64([r, g, b, a])

Initializes a new four component color.

ColorA

alias of maxon.vector4d.ColorA64

SqMat3_32([v1_in, v2_in, v3_in])

Initializes a new three components square matrix.

SqMat3_64([v1_in, v2_in, v3_in])

Initializes a new three components square matrix.

SqMat3([v1_in, v2_in, v3_in])

A 3x3 matrix

Matrix32([off_in, v1_or_sqmat_in, v2_in, v3_in])

A 32 bits 3x3 matrix.

Matrix64([off_in, v1_or_sqmat_in, v2_in, v3_in])

A 64 bits 3x3 matrix.

Matrix

Alias for maxon.Matrix64

Collection Data Type

Array([ob, input, count])

Initialize the Array in order to store a given type. At the moment only maxon Data Type are supported.

BaseArray([ob, input, count])

A generic array class template used to stored any kind of data.

Pair(typename)

maxon.Pair provides in-place static storage for elements of arbitrary types.

Tuple(typename)

maxon.Tuple provides in-place static storage for elements of arbitrary types.

Block([C])

A maxon.Block stands for a number of elements with a regular memory layout.

StridedBlock([C])

Similar to a maxon.Block.

Id Data Type

InternedId([C])

maxon.InternedId represents an maxon.Id which has been interned into a pool of unique

Id([C])

maxon.Id represents an identifier consisting of a c-string.

Time Data Type

LocalDateTime([C])

At some point developers have to deal with times, dates and timezones.

UniversalDateTime([C])

Class that represents the Universal date-time (UTC+0000).

TimeValue(seconds)

The maxon.TimeValue class encapsulates a timer value.

Seconds(seconds)

Timer value in seconds.

Core Data Type

ConfigInit([C])

Represents an config entry value.

SourceLocation([f, line])

An object to represents the current file location.

DelegateBase([C])

Delegate base class which can be used for maxon.DataType.

Core Iterator Data Type

PlainIterator([C])

Base class for iterator

RegistryEntryIteratorInterface([C])

RegistryEntryIteratorInterface is used internally by Registry.Iterator().

DataDictionaryIteratorInterface(memory)

maxon.DataDictionaryIteratorInterface is used internally by DataDictionary.Iterator().

DataDictionaryIterator(dict, end)

Iterator to iterate through all elements of a maxon.DataDictionaryIterator.

IoBrowseIterator(iteratorObject)

Represents a python iterator for an maxon.IoBrowseInterface

Base Core Data Type

Data([C])

An object of this class can store every type of data as long as that type has been registered (see maxon.DataType).

DataType(dt)

maxon.DataType provides a set of functions which allow to operate on values of arbitrary

Ref()

Base reference for all objects which hold a data capsule

Struct()

Represents a C++ structure.

Builtin([C])

Represents a built-in maxon.DataType (aka the one that can e converted automatically to python like maxon.Int32 to int)

UnknownDataType([C])

Class for all data objects, that have no proper wrapper class in Python.

Declaration(ids[, entityBaseType, returnType])

Maxon API rely on object that are declared. Such object are stored under a maxon.Declaration object.

Generic([C])

The data type represents the maxon.Generic type.

Component(*INTERFACES)

A component implements the functions of a given interface.

ComponentRoot([data])

maxon.ComponentRoot is the base class of all components (see maxon.MAXON_COMPONENT).

ObjectDefinition(iid, object)

Represent an Object

Registries and Enums

Registries

Classes()

Loggers()

LoggerTypes()

IoHandlers()

FileFormats()

FileFormatHandlers()

ParametricTypes()

Registry of all Parametric Types.

DataTypes()

Decorators

As a 3rd party developer you normally don’t have to deal with decorators.
This is used only to exposes C++ MAXON API Component to Python.

Interface Decorator

MAXON_INTERFACE(REFKIND, ID[, doObjectCheck])

MAXON_INTERFACE_REFERENCE()

Decorator to defines an Interface that can be treated as Reference at the same time.

MAXON_INTERFACE_NONVIRTUAL(REFKIND, ID)

MAXON_STATICMETHOD(identifier[, returnType, …])

MAXON_METHOD([identifier, returnType, …])

MAXON_FUNCTION(identifier)

At the moment MAXON_FUNCTION is just a dummy function to mark the function that it is trampolin code to another function.

MAXON_STATICFUNCTION(identifier)

At the moment MAXON_STATICFUNCTION is just a dummy function to mark the function that it is trampolin code to another function.

MAXON_OVERLOAD()

At the moment MAXON_OVERLOAD is just a dummy function to mark a function being overloaded

MAXON_FUNCTION_EXTEND(identifier)

At the moment MAXON_FUNCTION_EXTEND is just a dummy function to mark the function that it is trampolin code to another function.

MAXON_REFERENCE(SUPERCLASS)

Enum Decorator

MAXON_ENUM_FLAGS(classId[, className])

MAXON_ENUM_LIST(classId[, className])

Registration Decorator

MAXON_COMPONENT([kind])

Decorator to mark an element as a Maxon API component (available from a registry)

MAXON_COMPONENT_OBJECT_REGISTER(impl, …[, …])

MAXON_COMPONENT_OBJECT_REGISTER registers a component, creates an object class which uses the component and

MAXON_COMPONENT_CLASS_REGISTER(impl, …[, …])

MAXON_COMPONENT_OBJECT_REGISTER registers a component, creates an object class which uses the component and

MAXON_REGISTRY(ids[, returnType])

Functions

Methods Signature

maxon.finally_once(func, *args, **kwargs)

Executes a function when the current scope is left.

maxon.MAXON_SOURCE_LOCATION([offset])

Creates a SourceLocation object for the current Python Frame.

maxon.MAXON_ATTRIBUTE(id)

Alias for maxon.InternedId.

maxon.GetDataType(obj)

Retrieves the maxon.DataType of the passed object.

maxon.MaxonConvert(*args)

Convert all passed objects to a maxon or Python object, depending on the passed type.

maxon.ToBlock(data, size[, stride, dt])

Makes a maxon.Block or a maxon.StridedBlock from a pointer, a size and a stride.

maxon.Cast(T, o)

Cast the object o to the type T.

maxon.reinterpret_cast(T, o)

Cast(T, o) Cast the object o to the type T.

Methods Definition

maxon.finally_once(func, *args, **kwargs)

Executes a function when the current scope is left.

Note

An optional parameter canRaise can be passed to notify that func may eventually raise.

Parameters
  • func (function(*args, **kwargs)) – Function to be called.

  • args (Any) – Optional arguments to be passed to func.

  • kwargs (Any) – Optional settings like canRaise to control if func can raise an exception.

cleanup = finally_once(lambda x: MyFunction(x), canRaise=False)
maxon.MAXON_SOURCE_LOCATION(offset=0)

Creates a SourceLocation object for the current Python Frame.

Parameters

offset (Optional[int])) – Optional trace back offset to retrieve the current source location from.

Returns

The source location corresponding to the Python frame calling this function.

Return type

maxon.SourceLocation

maxon.MAXON_ATTRIBUTE(id)

Alias for maxon.InternedId.

maxon.GetDataType(obj)

Retrieves the maxon.DataType of the passed object.

Parameters

type – The object to retrieves the maxon.DataType from.

Type

maxon.Data

Returns

The datatype.

Return type

maxon.DataType

maxon.MaxonConvert(*args)

Convert all passed objects to a maxon or Python object, depending on the passed type.

Note

Latest arguments determine how the conversion is done by passing a maxon.CONVERSIONMODE.

import maxon

# Returns a maxon.Int32 of value 10
print maxon.MaxonConvert(10)

# Returns a int of value 10
print maxon.MaxonConvert(maxon.Int(10))

# Forces a return value to Maxon API type, in this case a maxon.Int32 of value 10
print maxon.MaxonConvert(maxon.Int(10), maxon.CONVERSIONMODE.TOMAXON)

# Forces a return value to Python Builtin, in this case a int of value 10
print maxon.MaxonConvert(10, maxon.CONVERSIONMODE.TOBUILTIN)
Parameters

args (Any) – The object to converts.

Returns

The object converted

Return type

Any

maxon.ToBlock(data, size, stride=None, dt=None)

Makes a maxon.Block or a maxon.StridedBlock from a pointer, a size and a stride.

Parameters
  • data (maxon.Data) – The data to transform to a Block.

  • size (int) – Number of elements.

  • stride (int) – Element stride.

  • dt (maxon.DataType) – The Datatype of the data to be converted as block

Returns

A block of elements for this data and datatype.

Return type

Union[maxon.StridedBlock, maxon.Block]

maxon.Cast(T, o)

Cast the object o to the type T.

Warning

This function is only there to expose a C++ Object to Python.
As a Python developer you normally don’t have to deal with this function.
Parameters
  • T (type) – The type to cast the object to.

  • o (maxon.Data) – The Initial object

Returns

The casted object

Return type

T

maxon.reinterpret_cast(T, o)

Cast(T, o) Cast the object o to the type T.

Warning

This function is only there to expose a C++ Object to Python.
As a Python developer you normally don’t have to deal with this function.
Parameters
  • T (type) – The type to cast the object to.

  • o (maxon.Data) – The Initial object

Returns

The casted object

Return type

T