package (lx_package.hpp)

From The Foundry MODO SDK wiki
(Redirected from LXsCHANVEC UVW (index))
Jump to: navigation, search
There are security restrictions on this page


Contents

Item Database

Items are the fundamental scene data element, and the basic unit of animation. Each item represents some data object in the scene -- all things which can have time-varying animation behavior. The items have a standard interface so they can be manipulated in a uniform manner and can be presented to the user in a consistent way. Items also have the ability to interact, so they can also access each other in a uniform manner.

Animation is handled through an animation pipeline. The items are all fed into the pipe with some initial basic animation, and then a series of modifier transforms are applied which alter the state of the items in a coordinated fashion. These modifiers represent the rules for the interaction between items, such as parenting, IK and dynamics. The final state of the items is fed to the renderer for output.

Scene Eval Listener

The Scene Evaluation Listener sends events related to the evaluation of the scene.

The ChannelValue change signals that a channel value has changed. This is called whenever any evaluated channel value changes.

(1) SDK: SceneEvalListener::ChannelValue
         LXxMETHOD( void,
 ChannelValue) (
         LXtObjectID              self,
         LXtObjectID              item,
         unsigned                 index);

It can be useful to know about a series of related evaluated channel changes. These functions wrap the ChannelValue method call to signal the start and end of a series of changes.

(2) SDK: SceneEvalListener::ChannelPreValue, etc.
         LXxMETHOD( void,
 ChannelPreValue) (
         LXtObjectID              self);
 
         LXxMETHOD( void,
 ChannelPostValue) (
         LXtObjectID              self);

(3) SDK: LXu_SCENEEVALLISTENER define
 #define LXu_SCENEEVALLISTENER   "7793643D-FA56-4198-963B-AE8FAC69F48D"

Empty SceneEvalListener Python user class.

(4) PY: empty SceneEvalListener user class
 pass

Scene Item Listener (SIL)

Version 1, used only by recoil. Should be removed for 601.

(5) SDK: SceneItemListener1::SceneCreate, etc.
         LXxMETHOD( void,
 SceneCreate) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 SceneDestroy) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 SceneFilename) (
         LXtObjectID              self,
         LXtObjectID              scene,
         const char              *filename);
 
         LXxMETHOD( void,
 SceneClear) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemPreChange) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemPostDelete) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemAdd) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemRemove) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemParent) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemChild) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemAddChannel) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemLocal) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemName) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemSource) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemPackage) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ChannelValue) (
         LXtObjectID              self,
         const char               *action,
         LXtObjectID              item,
         unsigned                 index);

(6) SDK: LXu_SCENEITEMLISTENER1 define
 #define LXu_SCENEITEMLISTENER1  "BCCD05F8-E560-11D7-B3B8-000393CE9680"

(7) SDK: SceneItemListener2::SceneCreate, etc.
         LXxMETHOD( void,
 SceneCreate) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 SceneDestroy) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 SceneFilename) (
         LXtObjectID              self,
         LXtObjectID              scene,
         const char              *filename);
 
         LXxMETHOD( void,
 SceneClear) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemPreChange) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemPostDelete) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemAdd) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemRemove) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemParent) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemChild) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemAddChannel) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemLocal) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemName) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemSource) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemPackage) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ChannelValue) (
         LXtObjectID              self,
         const char               *action,
         LXtObjectID              item,
         unsigned                 index);

Graph events, added in 501 SP1.

(8) SDK: SceneItemListener2::LinkAdd, etc.
         LXxMETHOD( void,
 LinkAdd) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 LinkRemBefore) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 LinkRemAfter) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 LinkSet) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 ChanLinkAdd) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);
 
         LXxMETHOD( void,
 ChanLinkRemBefore) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);
 
         LXxMETHOD( void,
 ChanLinkRemAfter) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);
 
         LXxMETHOD( void,
 ChanLinkSet) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);

(9) SDK: LXu_SCENEITEMLISTENER2 define
 #define LXu_SCENEITEMLISTENER2  "C72C641E-CDCD-431B-ADD9-D75554D656E1"

(10) SDK: SceneItemListener::SceneCreate, etc.
         LXxMETHOD( void,
 SceneCreate) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 SceneDestroy) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 SceneFilename) (
         LXtObjectID              self,
         LXtObjectID              scene,
         const char              *filename);
 
         LXxMETHOD( void,
 SceneClear) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemPreChange) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemPostDelete) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( void,
 ItemAdd) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemRemove) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemParent) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemChild) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemAddChannel) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemLocal) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemName) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemSource) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ItemPackage) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( void,
 ChannelValue) (
         LXtObjectID              self,
         const char               *action,
         LXtObjectID              item,
         unsigned                 index);
 
         LXxMETHOD( void,
 LinkAdd) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 LinkRemBefore) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 LinkRemAfter) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 LinkSet) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         LXtObjectID              itemTo);
 
         LXxMETHOD( void,
 ChanLinkAdd) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);
 
         LXxMETHOD( void,
 ChanLinkRemBefore) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);
 
         LXxMETHOD( void,
 ChanLinkRemAfter) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);
 
         LXxMETHOD( void,
 ChanLinkSet) (
         LXtObjectID              self,
         const char              *graph,
         LXtObjectID              itemFrom,
         unsigned                 chanFrom,
         LXtObjectID              itemTo,
         unsigned                 chanTo);

Item Tag events, added in 901.

(11) SDK: SceneItemListener::ItemTag
         LXxMETHOD( void,
 ItemTag) (
         LXtObjectID              self,
         LXtObjectID              item);

User Channel events, added in 901.

This function is triggered whenever a channel is removed. It is the opposite of the ItemAddChannel event.

(12) SDK: SceneItemListener::ItemRemoveChannel
         LXxMETHOD( void,
 ItemRemoveChannel) (
         LXtObjectID              self,
         LXtObjectID              item);

This function is triggered whenever the name or the username of a channel changes.

(13) SDK: SceneItemListener::ItemChannelName
         LXxMETHOD( void,
 ItemChannelName) (
         LXtObjectID              self,
         LXtObjectID              item,
         unsigned int             index);

This function is triggered whenever the default value of a channel is modified.

(14) SDK: SceneItemListener::ItemChannelDefault
         LXxMETHOD( void,
 ItemChannelDefault) (
         LXtObjectID              self,
         LXtObjectID              item,
         unsigned int             index);

This function is triggered whenever the min/max of a channel is modified.

(15) SDK: SceneItemListener::ItemChannelMinMax
         LXxMETHOD( void,
 ItemChannelMinMax) (
         LXtObjectID              self,
         LXtObjectID              item,
         unsigned int             index);

This function is triggered whenever a channel type is modified.

(16) SDK: SceneItemListener::ItemChannelType
         LXxMETHOD( void,
 ItemChannelType) (
         LXtObjectID              self,
         LXtObjectID              item,
         unsigned int             index);

(17) SDK: LXu_SCENEITEMLISTENER define
 #define LXu_SCENEITEMLISTENER   "AFB67180-EC4F-4E9B-AAF1-67AA47097C29"

Empty SceneItemListener Python user class.

(18) PY: empty SceneItemListener user class
 pass

Packages

Bare items alone can serve as holders for runtime client data and any number of client or user-defined channels. While these are useful individually, it is important to be able to combine these into complete systems which can be manipulated as a whole. Generally these are called packages, which can be combined into heirarchical item types.

The package consists of two different things -- the package and the instance. The package is a set of methods used to manipulate items that use this package in a general way. The package instance is an object that implements the package behaviors and states of a specific item. The instance for each item is allocated by the package.

Package Interface

Packages are defined by a server interface that describes the channels for the package and adds instances to items. The SetupChannels() method is called once when the package is initialized to define the set of channels common to all item with this package. The Attach() method is called for each item to assign as the package is being attached, and should return an object implementing ILxPackageInstance.

(19) SDK: Package::SetupChannels, etc.
         LXxMETHOD( LxResult,
 SetupChannels) (
         LXtObjectID              self,
         LXtObjectID              addChan);
 
         LXxMETHOD( LxResult,
 Attach) (
         LXtObjectID              self,
         void                   **ppvObj);
 
         LXxMETHOD( LxResult,
 TestInterface) (
         LXtObjectID              self,
         const LXtGUID           *guid);
 
         LXxMETHOD( LxResult,
 PostLoad) (
         LXtObjectID              self,
         LXtObjectID              scene);
 
         LXxMETHOD( LxResult,
 CollectItems) (
         LXtObjectID              self,
         LXtObjectID              collection,
         unsigned                 mode);

(20) SDK: LXu_PACKAGE, etc. defines
 #define LXu_PACKAGE     "01DA3920-484A-415F-AFF7-5A274B77AC3A"
 #define LXa_PACKAGE     "package2"

Empty Package Python user class.

(21) PY: empty Package user class
 pass

Package servers can declare their supertype as a tag. The presense of this tag promotes a package to a full item type. For root types with no supertype the tag can be set to ".".

(22) SDK: LXsPKG_SUPERTYPE define
 #define LXsPKG_SUPERTYPE        "super"

Server Tags

Package servers may define their own graphs. This is a string of graph names separated by semicolons. The name may also be followed by a plus-sign and any of these single letter flags:

i Item graph, the default.
c Channel graph, mutually-exclusive with item.
t Tree rules, enforces that all elements in the graph have a single ancestor.
a Acyclic rules, enforces that there are no cycles in the graph. Superset of tree.
N, X Copy rules. Normally when items are copied their links are copied too. If 'N' is set then no copying of links is done, and the owner of the graph is expected to manage the links themself. If 'X' is set then links are copied between members of a group copy, but not outside the group.

By default, the item list shows all locator items, but the LXsPKG_ITEMLIST_HIDE can be used to hide them from users. The LXsPKG_ITEMLIST_ATTRIBUTE tag can be used to include the item as an attribute of the parent's item.

(23) SDK: LXsPKG_ITEMLIST_HIDE, etc. defines
 #define LXsPKG_ITEMLIST_HIDE      "pkg.itemListHide"
 #define LXsPKG_ITEMLIST_ATTRIBUTE "pkg.attribute"

(24) SDK: LXsPKG_GRAPHS define
 #define LXsPKG_GRAPHS           "pkg.graphs"

Item type packages can suppress the normal ability to create from scratch. If the item type requires a special command to create it, set this tag to "-".

(25) SDK: LXsPKG_CREATECMD, etc. defines
 #define LXsPKG_CREATECMD        "pkg.createCmd"
 #define LXs_PKG_NODIRECTCREATE  "-"

Item type packages can also suppress the ability to allow another type to convert to them. This is usually set in the same places as NODIRECTCREATE, but not always (e.g. static meshes)

(26) SDK: LXsPKG_CONVERTCMD, etc. defines
 #define LXsPKG_CONVERTCMD       "pkg.convertCmd"
 #define LXs_PKG_DIRECTCONVERTOK "-"

Package servers can also be tagged as surface or mask item types. The presense of this tag is enough, the value has no meaning.

(27) SDK: LXsPKG_IS_MASK define
 #define LXsPKG_IS_MASK          "isMaskItem"

Package servers can also be tagged with their shader context. By default the context is the render item

(28) SDK: LXsPKG_SHADER_CONTEXT define
 #define LXsPKG_SHADER_CONTEXT           "shaderContext"

We can also tag the serves as shader nodes, this is generally the case for all textures and shader effects

(29) SDK: LXsPKG_SHADER_NODE define
 #define LXsPKG_SHADER_NODE              "shaderNode"

Package servers can also be tagged as surface or mask item types. The presense of this tag is enough, the value has no meaning.

(30) SDK: LXsPKG_CREATE_INDIRECT define
 #define LXsPKG_CREATE_INDIRECT  "createIndirect"

Package servers can also be tagged as internal (core) MODO volumes to differentiate volumetric items from plugins and core. The presense of this tag is enough, the value has no meaning.

(31) SDK: LXsPKG_IS_COREVOLUME define
 #define LXsPKG_IS_COREVOLUME    "isCoreVolume"

Package servers can also be tagged as allowing reads of non-evaluated channels. When this tag is present for a surface item, the surface is allocated using the channel read for the current state if deformers are not enabled, and the current evaluation context if they are. Without the tag, surfaces will always be allocated for the current evaluation context.

The presense of this tag is enough, the value has no meaning.

(32) SDK: LXsPKG_NONEVALREAD define
 #define LXsPKG_NONEVALREAD      "allowNonEvalRead"

Channel Setup

Channels are added to packages using an IlxAddChannel interface. The NewChannel() method starts a channel definition, and the rest of the methods qualify it until the next channel is started.

(33) SDK: AddChannel::NewChannel
         LXxMETHOD( LxResult,
 NewChannel) (
         LXtObjectID              self,
         const char              *name,
         const char              *type);

If the base type for the channel is floating point, then the channel can be made a gradient by calling this function. The gradient will have the base type as output and this type as input.

(34) SDK: AddChannel::SetGradient
         LXxMETHOD( LxResult,
 SetGradient) (
         LXtObjectID              self,
         const char              *inType);

If the base type for the channel is numeric then actions will be able to store animated values for it. Likewise string channels can also have values stored in the action, albeit constant. All other types are assumed to evaluation channels only -- that is their values are only set during evaluation, not stored in actions. Calling this method sets the storage type of the channel, which is the type of value to be stored in the action, and can be different from the evaluation type.

(35) SDK: AddChannel::SetStorage
         LXxMETHOD( LxResult,
 SetStorage) (
         LXtObjectID              self,
         const char              *stType);

Setting the vector type to one of the LXsCHANVEC defines will cause this one channel definition to create multiple channels comprising the vector.

(36) SDK: AddChannel::SetVector
         LXxMETHOD( LxResult,
 SetVector) (
         LXtObjectID              self,
         const char              *vecType);

Numeric defaults can be set easily with these two methods.

(37) SDK: AddChannel::SetDefault, etc.
         LXxMETHOD( LxResult,
 SetDefault) (
         LXtObjectID              self,
         double                   defFlt,
         int                      defInt);
 
         LXxMETHOD( LxResult,
 SetDefaultVec) (
         LXtObjectID              self,
         const double            *defVec);

Text hints are described in detail in their documentation. There is one important difference in handling min/max for angle channels (and only angle channels): they are specified as degrees*10000 instead of radians*10000. This allows for accurate representation of 45 degrees and similar angles. Other places that use text hints (like commands) have access to another mechanism to set min/max that is not yet available to channels, so they don't require this special case.

(38) SDK: AddChannel::SetHint
         LXxMETHOD( LxResult,
 SetHint) (
         LXtObjectID              self,
         const LXtTextValueHint  *hint);

(39) SDK: AddChannel::SetUserHint
         LXxMETHOD( LxResult,
 SetUserHint) (
         LXtObjectID              self,
         const LXtTextValueHint  *hint);

Default values for non-numeric storage channels can also be set by getting the value object for the default.

(40) SDK: AddChannel::SetDefaultObj
         LXxMETHOD( LxResult,
 SetDefaultObj) (
         LXtObjectID              self,
         void                   **ppvObj);

This marks the channel as internal, hiding it from the user.

(41) SDK: AddChannel::SetInternal
         LXxMETHOD( void,
 SetInternal) (
         LXtObjectID              self);

(42) SDK: LXu_ADDCHANNEL, etc. defines

(43) SDK: empty AddChannel User Class

Empty AddChannel Python user class.

(44) PY: empty AddChannel user class
 pass

Item Collections

Item collections are sets of items that can be expanded to include related items.

Test Test if an item is part of the collection
Count, ByIndex Enumerate through the items in the collection of a certain type.
Add Add an item to the collection.
(45) SDK: ItemCollection::Test, etc.
         LXxMETHOD( LxResult,
 Test) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( LxResult,
 Count) (
         LXtObjectID              self,
         int                      type,
         unsigned                *count);
 
         LXxMETHOD( LxResult,
 ByIndex) (
         LXtObjectID              self,
         int                      type,
         unsigned                 index,
         void                   **ppvObj);
 
         LXxMETHOD( LxResult,
 Add) (
         LXtObjectID              self,
         LXtObjectID              item);

(46) SDK: LXu_ITEMCOLLECTION define
 #define LXu_ITEMCOLLECTION      "8D37934E-F517-45F1-90F0-8C17F595DC7D"

(47) SDK: empty ItemCollection User Class

Python method gets list of items.

(48) PY: ItemCollection.ItemList method
 def ItemList(self):
     """list of items = ItemList()
     """
     return [ self.ByIndex(lx.symbol.iTYPE_ANY,i) for i in range(self.Count(lx.symbol.iTYPE_ANY)) ]

Packages can manipulate collections with their CollectItems() method. The package then adds other items based on the mode.

NONE Can be used where a collection mode is used but none desired.
IMPORT Add items that should also be imported if the collection is an import. Note that this same collection is also used for export, because an export is an import when viewed from the other side.
DEL_SHALLOW Add items that must also be deleted if the collection is a deletion. This is a shallow delete and should leave any items that the user might still want.
DEL_DEEP Add items that can also be deleted if the collection is a deletion. This is a deep delete, so we want to get rid of anything that would be superfluous once the main items are deleted.
INSTANCES This just gets all the instances of any items in the collection. The packages aren't involved in this one; it's a core feature.
(49) SDK: LXiCOLLECT_NONE, etc. defines

Instance Interface

The implementation of a package (or item type) is a package instace object. These are allocated by the Attach() method of the package interface, and may optionally implement this interface to be informed of changes to the item.

N5: init and cleanup are not really necessary. The arguments to init can be sent to attach, and cleanup can be done in instance destroy.

Initialize This is called when package is attached to the item. The item is passed, and for item types with supertypes the package instance for the supertype package is also passed. The item is not yet part of the scene, so any complex processing should wait until the Newborn() or Loaded() methods.
SynthName This allows the package to set the synthetic name for an item with no explicitly set user name. Return NOTIMPL to get default behavior.
DupType Returns the item type code to use when an item of this type is instanced. Return zero to use the same item type.
TestParent Can return LXe_FALSE to disallow this item from being parented to the candidate parent.
Newborn, Loading One of these is called (depending on how the item was created) after the item has been added to the scene. For item duplication or instancing the Newborn() method gets the original item. This is only called the first time, and so only undoable actions should be performed.
AfterLoad Called after load (or import) of the scene is complete.
Add Called after item is added to the scene. This will be called the first time and any subsequent times caused by undos.
Remove Called as the item is being removed from the scene. This will be called the first time and any subsequent times caused by undos.
Doomed Called while the item is still part of the scene, but is destined to be destroyed. This may allow the item to clean up any links or related items. This is only called the first time so should make changes that can be undone.
Cleanup Called just before deletion.
(50) SDK: PackageInstance::Initialize, etc.
         LXxMETHOD( LxResult,
 Initialize) (
         LXtObjectID              self,
         LXtObjectID              item,
         LXtObjectID              super);
 
         LXxMETHOD( void,
 Cleanup) (
         LXtObjectID              self);
 
         LXxMETHOD( LxResult,
 SynthName) (
         LXtObjectID              self,
         char                    *buf,
         unsigned                 len);
 
         LXxMETHOD( unsigned,
 DupType) (
         LXtObjectID              self);
 
         LXxMETHOD( LxResult,
 TestParent) (
         LXtObjectID              self,
         LXtObjectID              item);
 
         LXxMETHOD( LxResult,
 Newborn) (
         LXtObjectID              self,
         LXtObjectID              original,
         unsigned                 flags);
 
         LXxMETHOD( LxResult,
 Loading) (
         LXtObjectID              self);
 
         LXxMETHOD( LxResult,
 AfterLoad) (
         LXtObjectID              self);
 
         LXxMETHOD( void,
 Doomed) (
         LXtObjectID              self);
 
         LXxMETHOD( LxResult,
 Add) (
         LXtObjectID              self);
 
         LXxMETHOD( LxResult,
 Remove) (
         LXtObjectID              self);

(51) SDK: LXu_PACKAGEINSTANCE, etc. defines
 #define LXu_PACKAGEINSTANCE     "68DD1902-E5AB-4591-BF93-B83C856D1908"
 #define LXa_PACKAGEINSTANCE     "packageInstance2" 
 #define LXfNEWBORN_REPLACE       0x01

(52) PY: empty PackageInstance user class
 pass

ILxAssemblyAlias

The assembly alias allows one item type to act as an alias for an alias. This interface is added to any package that can act as an alias for an assembly.

The assembly alias interface is relatively simple; when an assembly alias is created, the test function is called to see if the operation is allowed. If it is, the alias is created and the configure function is called to perform any required setup. When the properties of the assembly change, the configure will be called again, describing the change.

(53) SDK: LXa_ASSEMBLYALIAS, etc. defines
 #define LXa_ASSEMBLYALIAS       "assemblyAlias"
 #define LXu_ASSEMBLYALIAS       "1794FFAE-1E80-4211-B1E8-CE09B470B20C"

The test function is called with two items; the assembly and item within the assembly that provides some unique functionality for the assembly. The function should return LXe_TRUE if the assembly can be aliased by this AssemblyAlias, and LXe_FALSE if it cannot.

(54) SDK: AssemblyAlias::Test
         LXxMETHOD(  LxResult,
 Test) (
         LXtObjectID              self,
         LXtObjectID              assembly,
         LXtObjectID              other);

The Configure function is used for sending events to the alias, allowing it to configure it's properties, and initialize any state.

ALIAS The ALIAS event is sent when the item is initially aliased. This should only be sent once when the alias is first created and can be used for any initial setup.
UNALIAS The UNALIAS event is sent when the alias is about to be destroyed. This should only be sent once when the alias is removed or deleted, and can be used for any final cleanup.
CHANNELS The CHANNELS event is sent whenever the state of channels on the alias has changed in some way. This could be channels being added, removed, or the hints on the channel changing that define the username, min, max...etc.
LOADPRESET The LOADPRESET event is sent when the assembly alias is loaded from a preset. The function can do whatever setup is needed to integrate the loaded alias item into the scene.
(55) SDK: LXf_ALIAS_ALIAS, etc. defines
 #define LXf_ALIAS_ALIAS         0x001
 #define LXf_ALIAS_UNALIAS       0x002
 #define LXf_ALIAS_CHANNELS      0x004
 #define LXf_ALIAS_LOADPRESET    0x008

(56) SDK: AssemblyAlias::Configure
         LXxMETHOD(  LxResult,
 Configure) (
         LXtObjectID              self,
         LXtObjectID              assembly,
         LXtObjectID              other,
         LXtObjectID              alias,
         const unsigned int       change);

The SuperType function should return the supertype of the item that will be created for the alias. For example, if the assembly alias intends to act like a channel modifier, the function should return the chanmodify supertype.

(57) SDK: AssemblyAlias::SuperType
         LXxMETHOD(  LxResult,
 SuperType) (
         LXtObjectID              self,
         LXtItemType             *type);

The Flags function is called to query the assembly alias for flags.

(58) SDK: LXf_ALIAS_NEEDSOURCE define
 #define LXf_ALIAS_NEEDSOURCE    0x001

(59) SDK: AssemblyAlias::Flags
         LXxMETHOD(  LxResult,
 Flags) (
         LXtObjectID              self,
         unsigned int            *flags);