Toolui

LXpToolViewEvent

struct st_LXpToolViewEvent

The ‘type’ is the viewport type on the mouse down event position. ‘viewProjection’ is the AGLViewType() one of the LXiVIEWv_xxx

Public Members

struct st_Viewport *vport
struct st_AGLView *view
unsigned flags
unsigned type
unsigned vportType
unsigned viewProjection
  • LXsP_TOOL_VIEW_EVENT

  • LXi_VIEWTYPE_3D

  • LXi_VIEWTYPE_UV

  • LXi_VIEWTYPE_2D

LXpTool3DEvent

struct st_LXpTool3DEvent

The 3D event packet has four sets of coordinates: v0 is the down event position and dv is the vector for from v0 to the current 3D event as it is updated during move events. The read-only rv0 and rdv vectors are the raw vectors fed into the event pipeline, untouched by other tools. This packet is only valid in the context of a stroke list. Primary 3D event information should be calculated using the EventTranslation object.

Public Members

LXtVector v0
LXtVector dv
LXtVector rv0
LXtVector rdv
  • LXsP_TOOL_3D_EVENT

LXpToolScreenEvent

struct st_LXpToolScreenEvent

Public Members

int px
int py
int cx
int cy
float fpx
float fpy
float fcx
float fcy
void *pointer3D
LXtVector ppos
LXtVector pdir
  • LXsP_TOOL_SCREEN_EVENT

LXpToolInputEvent

struct st_LXpToolInputEvent

Public Members

int mode
int input
int count
int part
int type
int haul
  • LXiTIE_TYPE_NONE

  • LXiTIE_TYPE_DOWN

  • LXiTIE_TYPE_MOVE

  • LXiTIE_TYPE_UP

  • LXiTIE_INPUT_I0

  • LXiTIE_INPUT_I1

  • LXiTIE_CURVE_EDIT

  • LXiTIE_CURVE_ADD

  • LXiTIE_CURVE_DELETE

  • LXiTIE_CURVE_DELETE_ALL

  • LXiTIE_CURVE_MOVE

  • LXiTIE_CURVE_MOVE_ALL

  • LXiTIE_CURVE_MOVE_CONS

  • LXiTIE_CURVE_MOVE_CONS_ALL

  • LXiTIE_CURVE_SCALE

  • LXiTIE_CURVE_SCALE_ALL

  • LXiTIE_CURVE_ALT

  • LXiTIE_CURVE_CLOSED

  • LXiTIE_GENERAL_PRI

  • LXiTIE_GENERAL_SEC

  • LXiTIE_GENERAL_TER

  • LXiTIE_GENERAL_PRI_ALT

  • LXiTIE_GENERAL_SEC_ALT

  • LXiTIE_GENERAL_TER_ALT

  • LXiTIE_GENERAL_PRI_CONS

  • LXiTIE_GENERAL_SEC_CONS

  • LXiTIE_GENERAL_TER_CONS

  • LXiTIE_GENERAL_CLICK_1

  • LXiTIE_GENERAL_CLICK_2

  • LXiTIE_GENERAL_PRI_ALT_CONS

  • LXiTIE_GENERAL_SEC_ALT_CONS

  • LXiTIE_GENERAL_TER_ALT_CONS

  • LXiTIE_XFRM_DUPLICATE

  • LXiTIE_XFRM_3RDDIM

  • LXsP_TOOL_INPUT_EVENT

LXpToolTabletEvent

struct st_LXpToolTabletEvent

Tools which can do something useful with tablets can request the tablet event packet. This is the information from the tablet device about the current event (or the event along the stroke). The packet will contain default values if the input comes from a mouse or from some other device that does not support all the inputs. You can also see if the tablet even exists and if the tablet is in use or not (if not in use, default mouse values will be set for the other parameters)

Public Members

int exists
int inUse
double normal
double tangent
double tilt[2]
double twist
  • LXsP_TOOL_TABLET_EVENT

LXpToolColor

struct st_LXpToolColor

Tools can work with colors, the color packet can be used to set the foreground and background colors which can be shared by tools in the pipe.

Public Members

float fg[4]
float bg[4]
  • LXsP_TOOL_COLOR

ILxRaycastPacket

class ILxRaycastPacket

Public Functions

int HitPolygon(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitPolygon *hit)

To allow clients to do raycasting on the mesh, we add an object packet containing a tracing interface. The object itself encodes all the information about the view mapping and active geometry.

int HitEdge(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitEdge *hit)
int HitVertex(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitVertex *hit)
int HitItem(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtHitItem *hit)
int HitPolygon1(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitElement *hit)

  • HitPolygon1

  • HitEdge1

  • HitVertex1

  • HitClosest New hit testing methods for vertex, edge and polygon support UV space as well as 3D mesh element. When the hit position in the structure is in UV space, ‘isUV’ is set. The ‘pol’ in LXtHitElement structure is for discontinuous UV vertex or UV edge. The new structures also contain ‘mesh’ and ‘item’ members. ‘type is type of hit element. LXi_VPHIT_VERT, LXi_VPHIT_EDGE or LXi_VPHIT_POLY is set. ‘lPos’ is the hit position in local mesh space. ‘wPos’ is in world space.

int HitEdge1(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitElement *hit)
int HitVertex1(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitElement *hit)
int HitClosest(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitElement *hit)
  • LXf_LAYER_ACTIVE

  • LXf_LAYER_INACTIVE

LXtHitPolygon

struct st_LXtHitPolygon

  • HitPolygon

  • HitEdge

  • HitVertex

  • HitItem These methods perform ray casting looking for an element of the given type. If none is found under the screen coord.s given, it returns 0. The different ‘hit’ types encode information gleaned from the hit. All have the element ID and 3D position. Polygons have a normal (the interpolated normal from the limit surface) and UV coordinates for the selected UV map. Edges have the fraction from the A to B vertex for the edge. The ‘nrm’ member of the HitItem structure is only set if the item is a surface item, in which case the ‘isMesh’ member will be set to true. ‘layer’ select the layers to be processed: ACTIVE is all current meshes; INACTIVE is all visible but inactive meshes. !!!N.B. the use of opaque LXtPolygonID type pointers may be limiting compared to delivering an ILxMesh and LXtMeshPolyInfo, or the mesh and ID, given that a lookup method is added to the mesh.

Public Members

LXtPolygonID pol
LXtVector pos
LXtVector nrm
float uv[2]
float cosine
float disp
LXtObjectID item
void *mbin

LXtHitEdge

struct st_LXtHitEdge

Public Members

LXtEdgeID edge
LXtVector pos
float t

LXtHitVertex

struct st_LXtHitVertex

Public Members

LXtPointID vrt
LXtVector pos

LXpToolHitEvent

struct st_LXpToolHitEvent

Public Members

LXtHitPolygon hit
float dist

LXtHitItem

struct st_LXtHitItem

Public Members

LXtObjectID item
LXtVector pos
LXtVector nrm
int isMesh
  • LXsP_TOOL_RAYCAST

LXtHitElement

struct st_LXtHitElement

Public Members

LXtObjectID item
LXtObjectID mesh
int isUV
LXtID4 type
LXtPointID vrt
LXtEdgeID edge
LXtPolygonID pol
LXtVector lPos
LXtVector wPos

ILxRaycastPacket1

class ILxRaycastPacket1

This interface was retired in modo 701, and was replaced with an updated one that adds a few more methods.

Public Functions

int HitPolygon(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtHitPolygon *hit)
int HitEdge(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtHitEdge *hit)
int HitVertex(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtHitVertex *hit)
int HitItem(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtHitItem *hit)

ILxRaycastPacket2

class ILxRaycastPacket2

This interface was retired in Modo 11.1, and was replaced with an updated one that adds a few more methods.

Public Functions

int HitPolygon(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitPolygon *hit)
int HitEdge(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitEdge *hit)
int HitVertex(LXtObjectID self, LXtObjectID toolVector, unsigned layer, float x, float y, LXtHitVertex *hit)
int HitItem(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtHitItem *hit)

LXsP_TOOL_HIT_EVENT

When a tool asks for this in its vector type, the 3D view traces the polygon under the mouse at each event, filling in the hit info in the packet. The ‘dist’ is the distance from the default eye ‘pos’ for the event ray. If there is no hit, hit.pol will be NULL.

typedef ILxVectorListID ILxStrokePacketID
  • LXsP_TOOL_STROKE_EVENT

LXpToolPaintTarget

struct st_LXpToolPaintTarget

The paint target is the image that is being edited (read only), the (xc,yc) coordinates of the paint operation (usually the brush center) and the (xp,yp) coordinates of the pixel (usually the brush’s pixel coordinates in the image). This packet is used by most paint tools to know what the current paint position is. ‘projMode’ is enabled when projection painting is used. ‘projWidth\Height’ are set with the current pane size used for projection painting.

Public Members

ILxImageID image
int projMode
int projWidth
int projHeight
int xc
int yc
int xp
int yp
float fxp
float fyp
  • LXsP_TOOL_PAINT_TARGET


LXsP_TOOL_PAINT_STROKE

The paint stroke packets holds the information about the current stroke with the ‘start’ and ‘end’ points in pixel coordinates (note that we use floats because positions are interpolated). ‘length’ is the stroke length in pixels (between ‘start’ and ‘end’). ‘total’ is the total stroke length since mouse DOWN. ‘current’ is the position on the stroke for the current paint operation. ‘align’ is true if the brush is aligned to the stroke.

LXpToolPaintStroke

struct st_LXpToolPaintStroke

Public Members

float start[2]
float end[2]
float length
float total
float current
int align
int colorEval

LXfPAINTBRUSH_2D

The paint brush is an object packet that can be used by paint tools. Paint brushes can be 2D or 3D or both, thus we provide a set of methods to compute values in 2D and 3D.

  • Flags This method returns brush flags, these indicate what type of brush (2D and\or 3D).

  • LXfPAINTBRUSH_3D

  • LXfPAINTBRUSH_3D_RGBA

ILxPaintBrushPacket

class ILxPaintBrushPacket

Public Functions

int Flags(LXtObjectID self)

  • Size This method returns the brush size in screen space (the size is expressed in pixels).

  • BBox This method sets the brush bounding box given the brush center in 3D space and the size multiplier. Returns 0 if the brush is not 3D.

  • Eval2D This method returns a brush as a bitmap. The arguments are the toolvector, the size multiplier and the brush to set. The brush returned can be of any size though the size should be set according to the multiplier. So if the tool ise set to have a 20 pixel size and the multiplier comes in as 0.5 then the brush size should be 10. This function returns 0 in case of failure.

  • Eval3D For 3D brushes, this method returns the brush ‘falloff’ at the given position in space. If the brush also defines the volume color, then ‘rgba’ will be set with that color. ‘wpos’ is the wordl position ‘bpos’ is the position in brush space. ‘rad’ is the brush radius.

float Size(LXtObjectID self)
int BBox(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, double size, LXtBBox *bbox)
int Eval2D(LXtObjectID self, LXtObjectID toolVector, float multiplier, LXtPaintBrush *brush)
double Eval3D(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector wpos, const LXtVector bpos, double rad, float *rgba)

LXtPaintBrush

struct st_LXtPaintBrush

The paint brush is a very simple structure with a width and a height, a pointer to the weight values and an optional pointer to color values.

  • mode Specifies how pixels are transferred from the brush to the canvas.

  • stepFlags Painting usually uses brush stepping to speedup painting. This is sometimes not desirable though, for example when the brush is very smooth and painting on the bump channel because steps become very visible. With the stepFlags the brush can activate stepping in the bump channel. ‘roller’ should be set for ‘roller’ brushes. The LXfPAINT_SCREEN flag is used to indicate that the positions passed to the Eval3D method are in screen space.

Public Members

int width
int height
float *wgt
float *rgb
float rotation
int mode
int flags
  • LXiPAINTMODE_SET

  • LXiPAINTMODE_ADD

  • LXiPAINTMODE_MAX

  • LXfPAINTSTEP_BUMP

  • LXfPAINT_ROLLER

  • LXfPAINT_STAMP

  • LXfPAINT_NOROT

  • LXfPAINT_SCREEN

  • LXsP_TOOL_PAINT_BRUSH


LXf_PAINT_INK_PERPIXEL

The paint ink is an object packet that can be used by paint tools. It mostly consists of a method used to obtain a color at a given position.

  • Flags This method returns the ink flags. By default the color is the same for the entire brush. There is a flag that tells if the ink should be evaluated for each pixel and another one if the ink requires 3D parameters (which may require interpolating costly geometric parameters).

  • LXf_PAINT_INK_3D

  • LXf_PAINT_INK_STAMP

  • LXf_PAINT_INK_REPLACE_RGB

  • LXf_PAINT_INK_REPLACE_ALPHA

  • LXf_PAINT_INK_REPLACE_RGBA

ILxPaintInkPacket

class ILxPaintInkPacket

Public Functions

int Flags(LXtObjectID self, LXtObjectID toolVector)

  • Color This method returns a color with alpha. The arguments are the toolvector, the mode and the color itself as a float vector. The ‘mode’ specifies which paint color should be used in combination with the ink color. ‘raw’ means that the color returned is the raw image color, other modes multiply the selected color with the pixel image color.

  • Stamp This method returns a stamp brush used to override the tool vector brush.

int Color(LXtObjectID self, LXtObjectID toolVector, int flags, LXtColorRGBA rgba)
int Stamp(LXtObjectID self, LXtPaintBrush *brush)
  • LXsP_TOOL_PAINT_INK

ILxPaintNozzlePacket

class ILxPaintNozzlePacket

Public Functions

int Paint(LXtObjectID self, LXtObjectID toolVector, float brushSize)

The paint nozzle is an object packet that can be used by paint tools.

  • Paint This method returns true if a paint operation should happen for the given paint target.

  • Jitter This method returns a position used to paint a brush. The arguments are the toolvector, the image, the brush size and the jittered brush position in the image. The base paint position can be read from the paint target.

  • Nozzle The is the main method which sets the strength, size and rotation values.

int Jitter(LXtObjectID self, LXtObjectID toolVector, float brushSize, int *xj, int *yj)
int Nozzle(LXtObjectID self, LXtObjectID toolVector, float *strength, float *size, float *rotation)
  • LXsP_TOOL_PAINT_NOZZLE

LXpToolProfile

struct st_LXpToolProfile

The profile packet set the profile destination object of the selected profile preset.

Public Members

LXtObjectID xobj
int dimension
  • LXsP_TOOL_PROFILE

LXpToolImage

struct st_LXpToolImage

Public Members

char *path
int flags
  • LXsP_TOOL_IMAGE

LXpToolSnapElement

struct st_LXpToolSnapElement

The Snapped Element packet set the informations when element snap tool made an element snapped. This is a packet to communicate element snap tools and the downstream tools.

Public Members

LXtMeshID mesh
LXtMeshMapID vmap
LXtID4 type
LXtPolygonID pol
LXtPointID vrt0
LXtPointID vrt1
LXtVector pos
double cx
double cy
double dist
struct st_AGLView *view
  • LXsP_TOOL_SNAPELEMENT

  • LXsP_TOOL_SUBJECT2

ILxItemReplacement1

class ILxItemReplacement1

This interface was retired in modo11a, in order to update ReplaceItems function

Public Functions

LxResult ReplaceItems(LXtObjectID self, LXtObjectID current, LXtObjectID replacement)
LxResult Types(LXtObjectID self, const char *curType, const char **repTypes)
LxResult NotifierCount(LXtObjectID self, const char *itemType, const char *channelName, unsigned *count)
LxResult NotifierByIndex(LXtObjectID self, const char *itemType, const char *channelName, unsigned index, char *buf, unsigned len)

ILxItemReplacement

class ILxItemReplacement

This interface was retired in modo11a, in order to update ReplaceItems function

Public Functions

LxResult ReplaceItems(LXtObjectID self, LXtObjectID current, LXtObjectID replacement, int targetType)

The server is given an ItemCollection object with the selected items matching the initial type. The server should return a new collection to replace the selected items.

LxResult Types(LXtObjectID self, const char *curType, const char **repTypes)

Given an item type name, this method should return the types of items that would be used to replace it. It can be a list of type names separated by white space.

LxResult NotifierCount(LXtObjectID self, const char *itemType, const char *channelName, unsigned *count)

The replacement can also define additional notifiers for an item.channel using the replacement. This can be useful for updating controls if graphs change that define the redirection. Notifiers are given by a string containing the notifier name and args.

LxResult NotifierByIndex(LXtObjectID self, const char *itemType, const char *channelName, unsigned index, char *buf, unsigned len)