globals
Some functions and data items have been added to the Lua global table, primarily for convenience of access.
Global Data
The following data items have been added to the Lua global table:
prog
This is a table which is expected and supported by the Lua standard library. Inside of Strata Design 3D CX it's declared with name = "Strata 3D CX"
prog = { name [, banner ] [, purpose ] [, notes ] [, usage ] }
_Debug
This is a reference to the data item s3d.env.qDebug
_Mac
This is a reference to the data item s3d.env.qMac
_Win
This is a reference to the data item s3d.env.qWin
Global Functions
The following functions have been added to the Lua global table:
astext
astext (...)
This is a reference to the function s3d.util.AsText
class
class (name)
name -> string
The luabind class creation bottleneck function, modified and augmented to integrate these classes with the Strata Design 3D CX built-in C++ classes. Call this function with the name of the class you want to create. The result is another function, which may optionally be called with the arguments ('baseClass, uuid, vers) all of which are in turn optional.
Typical syntax is: (remembering that you can call a function taking a single string argument without parenthesis)
class 'MyClass' (s3d.some_table.some_class)
Provide a base class if you want this class to derive from and extend another class. Provide a UUID to ensure that this class will be uniquely identified even if it is subsequently replaced by another class of the same name, and provide a positive version number if objects of this class are going to be stored in files or other persistent containers.
console
console (fmt, ...)
fmt -> string
This is a reference to the function s3d.util.Console
enablewarnings
enablewarnings (doEnable)
doEnable -> boolean
This is a reference to the function s3d.util.EnableWarnings
getfield
getfield (t, f) -> any value
t -> table
f -> any key
This is a reference to the function s3d.util.GetField
help
help ()
This is a reference to the function s3d.util.Help
isvaliduuid
isvaliduuid (uuid)
uuid -> string
This is a reference to the function s3d.util.IsValidUUID
makeinvaliduuid
makeinvaliduuid () -> string
This is a reference to the function s3d.util.MakeInvalidUUID
makeuuid
makeuuid () -> string
This is a reference to the function s3d.util.MakeUUID
printf
printf (...)
This is a reference to the function s3d.util.Printf
printmeta
printmeta (...)
This is a reference to the function s3d.util.PrintMeta
printobj
printobj (...)
This is a reference to the function s3d.util.PrintObj
setfield
setfield (t, f, v)
t -> table
f -> any key
v -> any value
This is a reference to the function s3d.util.SetField
setmode
setmode (t, mode)
t -> table
mode -> string
This is a reference to the function s3d.util.SetMode
_CHECK
_CHECK (assertion [, message])
assertion -> boolean
message -> optional string
This is a reference to the function s3d.env.CHECK
_INFORM
_INFORM (format, ...)
format -> string
This is a reference to the function s3d.env.INFORM
_DEBUG_ONLY
_DEBUG_ONLY (func, ...)
func -> function (...)
This is a reference to the function s3d.env.DEBUG_ONLY
_NONDEBUG_ONLY
_NONDEBUG_ONLY (func, ...)
func -> function (...)
This is a reference to the function s3d.env.NONDEBUG_ONLY
_MAC_ONLY
_MAC_ONLY (func, ...)
func -> function (...)
This is a reference to the function s3d.env.MAC_ONLY
_NONMAC_ONLY
_NONMAC_ONLY (func, ...)
func -> function (...)
This is a reference to the function s3d.env.NONMAC_ONLY
_WIN_ONLY
_WIN_ONLY (func, ...)
func -> function (...)
This is a reference to the function s3d.env.WIN_ONLY
_NONWIN_ONLY
_NONWIN_ONLY (func, ...)
func -> function (...)
This is a reference to the function s3d.env.NONWIN_ONLY
_WARNING
_WARNING (message, level)
message -> string
level -> integer
This is a reference to the function s3d.env.WARNING