listcache (lx_listcache.hpp)

From The Foundry MODO SDK wiki
Jump to: navigation, search
There are security restrictions on this page

Item List Cache

This module procides a service for caching lists of items. There are many circumstances when a list of items is useful and the same list needs to be accessed repeatedly at different times. Caching provides that this access is efficient, and a plug-in server type provides flexibility in the types of lists.

List Type Servers

Different types of item lists can be created based on item list type servers. Each server gets passed an argument string and root item and is then required to generate a list matching those settings.

The force interface allows clients to compute forces from positions and other element features.

(1) SDK: LXu_ITEMLISTTYPE, etc. defines
 #define LXu_ITEMLISTTYPE        "14EC78B2-8DAB-4E8B-8D38-142092950AE8"
 #define LXa_ITEMLISTTYPE        "itemlisttype"

Invalidation will happen on any scene change event or any selection event UNLESS any of these server tags are set.

ITEMTYPES This can be set to a list of item types that affect this list type. Changes to items of a different type will not invalidate lists of this type.
GRAPHS This can be set to a list of graph names that affect this list type. Changes different graphs will not invalidate lists of this type.
NOSELECTION This tag can be set to any value, and if set then item selection events will not invalidate lists of this type.
(2) SDK: LXsILT_ITEMTYPES, etc. defines
 #define LXsILT_ITEMTYPES        "itemlist.itemtypes"
 #define LXsILT_GRAPHS           "itemlist.graphs"
 #define LXsILT_NOSELECTION      "itemlist.nosel"

When first created an item list type object will have the argument string and root item set to define the context for this list.

(3) SDK: ItemListType::SetArgument, etc.
         LXxMETHOD(  LxResult,
 SetArgument) (
         LXtObjectID              self,
         const char              *arg);
         LXxMETHOD(  LxResult,
 SetRootItem) (
         LXtObjectID              self,
         LXtObjectID              item);

To generate the list the item is passed an empty item collection. The server should add the items to the collection in order. The scene will be assured to contain the root item, if any.

(4) SDK: ItemListType::GenerateList
         LXxMETHOD(  LxResult,
 GenerateList) (
         LXtObjectID              self,
         LXtObjectID              scene,
         LXtObjectID              collection);

(5) SDK: empty ItemListType User Class

(6) PY: empty ItemListType user class

Common List Types

The "by-type" list will list all items matching a set of types. The types are given by whitespace delimited list of type names in the argument string. By default the type will test for subtypes but if the name is preceded by "=" then the type must match exactly.

 #define LXsITEMLIST_BYTYPE      "list.byType"

The "sub-items" list will include any items are are parented to the root item for the list. Like "by-type" the argument string is a list of types to include.

 #define LXsITEMLIST_SUBITEMS    "list.subItems"