seltypes (lx_seltypes.hpp)

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


Contents

Selection Types and Translation Interfaces

This defines common selection types and their packet translation interfaces. The interface can be acquired by querying the selection packet object for the selection type which can be found from the selection service global.

The autoInit() method is common to all the packet translation user classes. It simply inits the user class by getting the type implementation from the global service.

(1) Packet Translation $$ autoInit
         bool
 autoInit ()
 {
         CLxLoc_SelectionService  svc;
         LXtObjectID              obj;
 
         if (LXx_FAIL (svc.Allocate (LXsSELTYP_$$, &obj)))
                 return false;
 
         return take (obj);
 }

Scene Selection

Scene selection determines which scene is currently active for commands. The selection packet can be read or encoded.

(2) SDK: LXsSELTYP_SCENE, etc. defines
 #define LXsSELTYP_SCENE                 "cinema"
 #define LXu_SCENEPACKETTRANSLATION      "A63F8E08-94D8-11D9-96D3-000A956C2E10"

(3) SDK: ScenePacketTranslation::Scene, etc.
         LXxMETHOD(  LxResult,
 Scene) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              scene);

(4) SDK: CLxUser_ScenePacketTranslation::GetScene method
         ''[[#C1|Packet Translation SCENE autoInit]]''
 
         bool
 GetScene (
         void                    *packet,
         CLxLoc_Scene            &scene)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Scene (packet, &obj)))
                 return false;
 
         return scene.take (obj);
 }

Empty ScenePacketTranslation Python user class.

(5) PY: empty ScenePacketTranslation user class
 pass

Item Selection

Selected items can be of different types, and each packet encodes a single item selection.

(6) SDK: LXsSELTYP_ITEM, etc. defines
 #define LXsSELTYP_ITEM                  "item"
 #define LXu_ITEMPACKETTRANSLATION       "029663CC-9571-11D9-B9AD-000A956C2E10"

(7) SDK: ItemPacketTranslation::Item, etc.
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              item);

(8) SDK: CLxUser_ItemPacketTranslation::GetItem method
         ''[[#C1|Packet Translation ITEM autoInit]]''
 
         bool
 GetItem (
         void                    *packet,
         CLxLoc_Item             &item)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Item (packet, &obj)))
                 return false;
 
         return item.take (obj);
 }

Empty ItemPacketTranslation Python user class.

(9) PY: empty ItemPacketTranslation user class
 pass

Node Selection

Selected nodes can be of different types, and each packet encodes a single node selection.

(10) SDK: LXsSELTYP_NODE, etc. defines
 #define LXsSELTYP_NODE                  "schmNode"
 #define LXu_NODEPACKETTRANSLATION       "5A560F1B-DC73-4efb-8579-C6C7D9373C60"

(11) SDK: NodePacketTranslation::Node, etc.
         LXxMETHOD(  LxResult,
 Node) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              node);

(12) SDK: CLxUser_NodePacketTranslation::GetNode method
         ''[[#C1|Packet Translation NODE autoInit]]''
 
         bool
 GetNode (
         void                    *packet,
         CLxLoc_Item             &node)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Node (packet, &obj)))
                 return false;
 
         return node.take (obj);
 }

Empty NodePacketTranslation Python user class.

(13) PY: empty NodePacketTranslation user class
 pass

Channel Selection

Selected channels are wrapped in a COM object that contains an item/channel pair.

(14) SDK: LXsSELTYP_CHANNEL, etc. defines
 #define LXsSELTYP_CHANNEL               "channel"
 #define LXu_CHANNELPACKETTRANSLATION    "00DE9D39-6A83-46DC-9C28-360662922CE5"

(15) SDK: ChannelPacketTranslation::Item, etc.
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  unsigned int,
 Index) (
         LXtObjectID              self,
         void                    *packet);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              item,
         unsigned int             index);

(16) SDK: CLxUser_ChannelPacketTranslation::GetItem method
         ''[[#C1|Packet Translation CHANNEL autoInit]]''
 
         bool
 GetItem (
         void                    *packet,
         CLxLoc_Item             &item)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Item (packet, &obj)))
                 return false;
 
         return item.take (obj);
 }

Empty ChannelPacketTranslation Python user class.

(17) PY: empty ChannelPacketTranslation user class
 pass

Center Selection

Selected centers are identical to selected items, but need a different translation interface.

(18) SDK: LXsSELTYP_CENTER, etc. defines
 #define LXsSELTYP_CENTER                "center"
 #define LXu_CENTERPACKETTRANSLATION     "52B10EAB-9EA6-4F28-81D1-2FEC51E02933"

(19) SDK: CenterPacketTranslation::Item, etc.
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              item);

(20) SDK: CLxUser_CenterPacketTranslation::GetItem method
         ''[[#C1|Packet Translation CENTER autoInit]]''
 
         bool
 GetItem (
         void                    *packet,
         CLxLoc_Item             &item)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Item (packet, &obj)))
                 return false;
 
         return item.take (obj);
 }

Empty CenterPacketTranslation Python user class.

(21) PY: empty CenterPacketTranslation user class
 pass

Pivot Selection

Pivots have an item and a type.

NOTE: define the types here...

(22) SDK: LXsSELTYP_PIVOT, etc. defines
 #define LXsSELTYP_PIVOT                 "pivot"
 #define LXu_PIVOTPACKETTRANSLATION      "9744D68E-D6CD-4652-AD33-073A24E16901"

(23) SDK: PivotPacketTranslation::Item, etc.
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  unsigned int,
 Type) (
         LXtObjectID              self,
         void                    *packet);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              item,
         unsigned int             type);

(24) SDK: CLxUser_PivotPacketTranslation::GetItem method
         ''[[#C1|Packet Translation PIVOT autoInit]]''
 
         bool
 GetItem (
         void                    *packet,
         CLxLoc_Item             &item)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Item (packet, &obj)))
                 return false;
 
         return item.take (obj);
 }

Empty PivotPacketTranslation Python user class.

(25) PY: empty PivotPacketTranslation user class
 pass

Link Selection

Links are defined by a starting item and channel, and an ending item and channel.

NOTE: shouldn't we also know the graph?

(26) SDK: LXsSELTYP_LINK, etc. defines
 #define LXsSELTYP_LINK                  "link"
 #define LXu_LINKPACKETTRANSLATION       "EEA9F625-EB3C-43FD-A156-C8552D6D18C9"

(27) SDK: LinkPacketTranslation::From, etc.
         LXxMETHOD(  LxResult,
 From) (
         LXtObjectID              self,
         void                    *packet,
         int                     *channel,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 To) (
         LXtObjectID              self,
         void                    *packet,
         int                     *channel,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              fromItem,
         int                      fromChannel,
         LXtObjectID              toItem,
         int                      toChannel);

(28) SDK: CLxUser_LinkPacketTranslation::GetFrom method
         ''[[#C1|Packet Translation LINK autoInit]]''
 
         bool
 GetFrom (
         void                    *packet,
         CLxLoc_Item             &item,
         int                     *channel)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (From (packet, channel, &obj)))
                 return false;
 
         return item.take (obj);
 }
 
         bool
 GetTo (
         void                    *packet,
         CLxLoc_Item             &item,
         int                     *channel)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (To (packet, channel, &obj)))
                 return false;
 
         return item.take (obj);
 }

Empty LinkPacketTranslation Python user class.

(29) PY: empty LinkPacketTranslation user class
 pass

Vertex Selection

A selected vertex is part of a mesh, which can be read from the packet. The selected vertex may also be discontinuous, in which case the polygon associated with the selected vertex will be non-null.

(30) SDK: LXsSELTYP_VERTEX, etc. defines
 #define LXsSELTYP_VERTEX                "vertex"
 #define LXu_VERTEXPACKETTRANSLATION     "D77B8382-9572-11D9-AFDE-000A956C2E10"

(31) SDK: VertexPacketTranslation::Vertex, etc.
         LXxMETHOD(  LxResult,
 Vertex) (
         LXtObjectID              self,
         void                    *packet,
         LXtPointID              *vertex);
 
         LXxMETHOD(  LxResult,
 Polygon) (
         LXtObjectID              self,
         void                    *packet,
         LXtPolygonID            *polygon);
 
         LXxMETHOD(  LxResult,
 Mesh) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtPointID               vertex,
         LXtPolygonID             polygon,
         LXtObjectID              mesh);
 
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);

(32) SDK Common user: mesh and item methods
         bool
 GetMesh (
         void                    *packet,
         CLxLoc_Mesh             &mesh)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Mesh (packet, &obj)))
                 return false;
 
         return mesh.take (obj);
 }
 
         bool
 GetItem (
         void                    *packet,
         CLxLoc_Item             &item)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Item (packet, &obj)))
                 return false;
 
         return item.take (obj);
 }

(33) User Class: VertexPacketTranslation method
 ''[[#C1|Packet Translation VERTEX autoInit]]''
 ''[[#C32|SDK Common user: mesh and item methods]]''

Empty VertexPacketTranslation Python user class.

(34) PY: empty VertexPacketTranslation user class
 pass

Edge Selection

A selected edge is given by a pair of vertices in a mesh. As with vertices, edge selections may be discontinuous in which case the polygon will be non-null.

(35) SDK: LXsSELTYP_EDGE, etc. defines
 #define LXsSELTYP_EDGE                  "edge"
 #define LXu_EDGEPACKETTRANSLATION       "CA4DFE14-957E-11D9-AC64-000A956C2E10"

(36) SDK: EdgePacketTranslation::Vertices, etc.
         LXxMETHOD(  LxResult,
 Vertices) (
         LXtObjectID              self,
         void                    *packet,
         LXtPointID              *vertexA,
         LXtPointID              *vertexB);
 
         LXxMETHOD(  LxResult,
 Polygon) (
         LXtObjectID              self,
         void                    *packet,
         LXtPolygonID            *polygon);
 
         LXxMETHOD(  LxResult,
 Mesh) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtPointID               vertexA,
         LXtPointID               vertexB,
         LXtPolygonID             polygon,
         LXtObjectID              mesh);
 
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);

(37) User Class: EdgePacketTranslation method
 ''[[#C1|Packet Translation EDGE autoInit]]''
 ''[[#C32|SDK Common user: mesh and item methods]]''

Empty EdgePacketTranslation Python user class.

(38) PY: empty EdgePacketTranslation user class
 pass

Polygon Selection

Polygon selection is just a polygon ID in a mesh.

(39) SDK: LXsSELTYP_POLYGON, etc. defines
 #define LXsSELTYP_POLYGON               "polygon"
 #define LXu_POLYGONPACKETTRANSLATION    "2E0929DC-9583-11D9-B058-000A956C2E10"

(40) SDK: PolygonPacketTranslation::Polygon, etc.
         LXxMETHOD(  LxResult,
 Polygon) (
         LXtObjectID              self,
         void                    *packet,
         LXtPolygonID            *polygon);
 
         LXxMETHOD(  LxResult,
 Mesh) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtPolygonID             polygon,
         LXtObjectID              mesh);
 
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);

(41) User Class: PolygonPacketTranslation method
 ''[[#C1|Packet Translation POLYGON autoInit]]''
 ''[[#C32|SDK Common user: mesh and item methods]]''

Empty PolygonPacketTranslation Python user class.

(42) PY: empty PolygonPacketTranslation user class
 pass

Vertex Map Selection

A selected vertex map consists entirely of a name and a type. Commands affect all selected mesh items that contain a vertex map with that name and type.

(43) SDK: LXsSELTYP_VERTEXMAP, etc. defines
 #define LXsSELTYP_VERTEXMAP             "vmap"
 #define LXu_VMAPPACKETTRANSLATION       "BBCB6B90-9586-11D9-A3B8-000A956C2E10"

(44) SDK: VMapPacketTranslation::Name, etc.
         LXxMETHOD(  LxResult,
 Name) (
         LXtObjectID              self,
         void                    *packet,
         const char             **name);
 
         LXxMETHOD(  LxResult,
 Type) (
         LXtObjectID              self,
         void                    *packet,
         LXtID4                  *type);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtID4                   type,
         const char              *name);

(45) User Class: VMapPacketTranslation method
 ''[[#C1|Packet Translation VERTEXMAP autoInit]]''

Empty VMapPacketTranslation Python user class.

(46) PY: empty VMapPacketTranslation user class
 pass

(47) SDK: LXsSELTYP_PRESETPATH, etc. defines
 #define LXsSELTYP_PRESETPATH                    "preset"
 #define LXu_PRESETPATHPACKETTRANSLATION         "6b95c2ac-9a9e-471f-9771-cf10fd5c6bcb"

Preset Path Selection

The preset path selection packet includes the path to a preset on disk, and an optional client identifier that can be used as a selection sub-type. These identifiers are usually associated with a Preset Browser viewport instance. See the Preset Browser documentation for more information on the preset path selection packet.

These return the path and identifier. If these strings are not set or empty in the packet, the pointers returned will be NULL.

(48) SDK: PresetPathPacketTranslation::Path, etc.
         LXxMETHOD(  LxResult,
 Path) (
         LXtObjectID               self,
         void                     *packet,
         const char              **path);
 
         LXxMETHOD(  LxResult,
 Identifier) (
         LXtObjectID               self,
         void                     *packet,
         const char              **identifier);

This creates anew packet from a given path and identifier. This packet is only valid until the next call to this function.

(49) SDK: PresetPathPacketTranslation::Packet
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         const char              *path,
         const char              *identifier);

(50) SDK: CLxUser_PresetPathPacketTranslation::GetPath method
         ''[[#C1|Packet Translation PRESETPATH autoInit]]''
 
         const char *
 GetPath (
         void                    *packet)
 {
         const char              *path;
 
         if (LXx_FAIL (Path (packet, &path)))
                 return NULL;
 
         return path;
 }
 
         const char *
 GetIdentifier (
         void                    *packet)
 {
         const char              *identifier;
 
         if (LXx_FAIL (Identifier (packet, &identifier)))
                 return NULL;
 
         return identifier;
 }

Empty PresetPathPacketTranslation Python user class.

(51) PY: empty PresetPathPacketTranslation user class
 pass

ILxItemChannel

This simple read-only interface is used to represent a single channel in an item as a single entity.

(52) SDK: LXu_ITEMCHANNEL, etc. defines
 #define LXu_ITEMCHANNEL                 "3cfab0aa-8e8c-452c-81e5-272842fff935"
 #define LXa_ITEMCHANNEL                 "itemchannel"

(53) SDK: ItemChannel::Item, etc.
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                   **ppvObj);
 
         LXxMETHOD(  unsigned int,
 ChannelIndex) (
         LXtObjectID              self);

(54) SDK: CLxUser_ItemChannel::GetItem method
         bool
 GetItem (
         CLxLoc_Item             &item)
 {
         LXtObjectID              obj;
 
         if (LXx_FAIL (Item (&obj)))
                 return false;
 
         return item.take (obj);
 }

Empty ILxItemChannel Python user class.

(55) PY: empty ItemChannel user class
 pass

Vector Shape Selection

Vector Shapes provide a shape, the canvas the shape belongs to, as well as the vector item.

(56) SDK: LXsSELTYP_VECTORSHAPE, etc. defines
 #define LXsSELTYP_VECTORSHAPE                   "vectorShape"
 #define LXu_VECTORSHAPEPACKETTRANSLATION        "33C886D1-1574-4D8E-9DFD-D8D1CB7A21FE"

(57) SDK: VectorShapePacketTranslation::Shape, etc.
         LXxMETHOD(  LxResult,
 Shape) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 Canvas) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
 
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              shape);

(58) User Class: VectorShapePacketTranslation method
 ''[[#C1|Packet Translation VECTORSHAPE autoInit]]''

Empty VectorShapePacketTranslation Python user class.

(59) PY: empty VectorShapePacketTranslation user class
 pass

Vector Path Selection

Vector Paths provide a path, the shape and canvas the path belongs to, as well as the vector item.

(60) SDK: LXsSELTYP_VECTORPATH, etc. defines
 #define LXsSELTYP_VECTORPATH                    "vectorPath"
 #define LXu_VECTORPATHPACKETTRANSLATION         "C3E6DF29-7217-4D89-9E84-DA6D45B9396E"

(61) SDK: VectorPathPacketTranslation::Path, etc.
         LXxMETHOD(  LxResult,
 Path) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 Shape) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 Canvas) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
 
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtObjectID              path);

(62) User Class: VectorPathPacketTranslation method
 ''[[#C1|Packet Translation VECTORPATH autoInit]]''

Empty VectorPathPacketTranslation Python user class.

(63) PY: empty VectorPathPacketTranslation user class
 pass

Vector Knot Selection

Vector Knots provide a knot, the path, shape and canvas the knot belongs to, as well as the vector item.

(64) SDK: LXsSELTYP_VECTORKNOT, etc. defines
 #define LXsSELTYP_VECTORKNOT                    "vectorKnot"
 #define LXu_VECTORKNOTPACKETTRANSLATION         "F4DDFFEA-3077-4931-8384-81C49AD1C41C"

(65) SDK: VectorKnotPacketTranslation::Knot, etc.
         LXxMETHOD(  LxResult,
 Knot) (
         LXtObjectID              self,
         void                    *packet,
         LXtVectorKnotID         *knot);
 
         LXxMETHOD(  LxResult,
 Path) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 Shape) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 Canvas) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
 
         LXxMETHOD(  LxResult,
 Item) (
         LXtObjectID              self,
         void                    *packet,
         void                   **ppvObj);
 
         LXxMETHOD(  void *,
 Packet) (
         LXtObjectID              self,
         LXtVectorKnotID          knot);

(66) User Class: VectorKnotPacketTranslation method
 ''[[#C1|Packet Translation VECTORKNOT autoInit]]''

Empty VectorKnotPacketTranslation Python user class.

(67) PY: empty VectorKnotPacketTranslation user class
 pass