Item Info

class lwsdk.LWItemInfo(self)

Bases: object

Proxy of C++ PCore::LWItemInfo class

 axisLocks(LWItemID item, LWItemParam type) → unsigned int

Returns bits indicating which channels are locked in the UI. See LWItemInfo::limits().

 chanGroup(LWItemID item) → LWChanGroupID

Returns the channel group associated with an item. Use this with the Animation Envelopes and Channel Info globals.

 controller(LWItemID item, LWItemParam type) → codes[3]

Returns a code indicating which mechanism controls the item's position, rotation, and scale. The type is one of lwsdk.LWIP_POSITION, lwsdk.LWIP_ROTATION, and lwsdk.LWIP_SCALING.

This method returns a Python sequence that holds three integers, one each for the channels, that contains a controller code for keyframes, targeting, alignment to a path, or inverse kinematics. Each code is one of:

lwsdk.LWMOTCTL_KEYFRAMES
lwsdk.LWMOTCTL_TARGETING
lwsdk.LWMOTCTL_ALIGN_TO_VELOCITY
lwsdk.LWMOTCTL_IK
lwsdk.LWMOTCTL_ALIGN_TO_PATH
lwsdk.LWMOTCTL_POLE

 controllerTrans(LWItemID object, LWItemParam type) → (mul[3], add[3])

Returns a Python sequence that contains two 3-tuples that represents the motion controller multiplier and offset values for each channel.

The type is one of:

lwsdk.LWIP_POSITION
lwsdk.LWIP_ROTATION
lwsdk.LWIP_SCALING

The returned values correspond with each of the three channels of the given type. The mul sequence holds the multiplication value for each channel, and the add sequence contains the offset values.

 first(LWItemType type, LWItemID item) → LWItemID

Returns the ID of the first item of a given type, or lwsdk.LWITEM_NULL if there are no items of this type in the scene. Valid types are:

lwsdk.LWI_OBJECT
lwsdk.LWI_LIGHT
lwsdk.LWI_CAMERA
lwsdk.LWI_BONE

If type is lwsdk.LWI_BONE, the second argument is the ID of the boned object. Otherwise it should be lwsdk.LWITEM_NULL.

 firstChild(LWItemID parent) → LWItemID

Returns the first child item of the parent item, or lwsdk.LWITEM_NULL if the parent item has no children.

 flags(LWItemID item) → unsigned int

Returns certain item settings as a set of bit flags:

lwsdk.LWITEMF_ACTIVE
lwsdk.LWITEMF_UNAFFECT_BY_IK
lwsdk.LWITEMF_FULLTIME_IK
lwsdk.LWITEMF_GOAL_ORIENT
lwsdk.LWITEMF_REACH_GOAL
lwsdk.LWITEMF_USE_IKCHAINVALS

 follow(LWItemID object, LWItemParam type) → (follow[3], texture[3])

Returns the motion controller follow settings. The type is one of:

lwsdk.LWIP_POSITION
lwsdk.LWIP_ROTATION
lwsdk.LWIP_SCALING

The returned values correspond with each of the three channels of the given type. The follow sequence contains the channel number that is being followed (0 is X position, 1 is Y position, 2 is Z position, 3 is heading, and so on up to 8 for Z scale). The texture sequence contains the texture IDs if the texture is enabled for the channel, or None otherwise.

 getTag(LWItemID item, int tagnum) → char

Retrieve a tag string associated with an item.The tags are numbered starting at 1. None is returned if tagnum is out of range. Tags strings are stored with the item in the scene file.

 goal(LWItemID item) → LWItemID

Returns the item's goal, if any, or lwsdk.LWITEM_NULL.

 goalObjective(LWItemID item) → unsigned int

Returns the objective for using the item's IK goal. The returned value is one of:

lwsdk.LWMOTGOAL_POSITION
lwsdk.LWMOTGOAL_POINT
lwsdk.LWMOTGOAL_ONYZPLANE

 goalStrength(LWItemID item, LWTime time) → double

Returns the item's IK goal strength at the specified time.

 ikInitialState(LWItemID item) → unsigned int

Returns how the IK solver determines the initial state to start solving from. The possible states are:

  lwsdk.LWMOTIK_INIT_FIRSTKEY
    Initialize with the values from the first keyframe for each IK controlled channel.
  lwsdk.LWMOTIK_INIT_MOSTRECENTKEY
    Initialize with the values from the most recent keyframe.
  lwsdk.LWMOTIK_INIT_CURRENTCHAN
    Initialize with the current channel values.
  lwsdk.LWMOTIK_INIT_CUSTOMFRAME
    Initialize with the channel values from a given frame number.

 ikInitialStateFrame(LWItemID item, LWTime time) → LWFrame

If the IK solver initial state is set to lwsdk.LWMOTIK_INIT_CUSTOMFRAME, then the frame number to use is returned by this function.

 ikSoft(LWItemID item, LWTime time) → (softik_type, distance_type, min, max)

Queries the soft IK settings of the item at the specified time. The softik_type value is the type of soft IK applied, if any:

  lwsdk.LWMOTIK_SOFT_OFF
    No soft IK applied.
  lwsdk.LWMOTIK_SOFT_EXPONENTIAL
    Exponential falloff soft IK applied.
  lwsdk.LWMOTIK_SOFT_LINEAR
    Linear falloff soft IK applied.
  lwsdk.LWMOTIK_SOFT_CLAMP
    Clamped soft IK applied.

The distance_type, min, and max values returned will only be valid if softik_type is not lwsdk.LWMOTIK_SOFT_OFF. The distance_type value describes how the min and max soft distances are calculated:

  lwsdk.LWMOTIK_SOFT_CHAINCHORD
    The min and max values are given as a fraction of the straight-line distance between chain root and goal.
  lwsdk.LWMOTIK_SOFT_CHAINLENGTH
    The min and max values are given as a fraction of the distance along the chain from root to goal.
  lwsdk.LWMOTIK_SOFT_CUSTOMDISTANCE
    The min and max values are used as the distances directly.

 ikfkBlending(LWItemID item, LWTime time) → double

Returns the IK/FK blending factor. A value of 0 means fully IK, while a value of 1 means fully FK.

 limits(LWItemID item, LWItemParam type) → (flags, minvec[3], maxvec[3])

Get upper and lower bounds on vector parameters. These may be limits set by the user on joint angles or ranges of movement. The function returns a Python sequence whose first element is an integer containing bit flags that indicate which of the three vector components (in minvec and maxvec) contain limits. The symbols for these bits are

lwsdk.LWVECF_0
lwsdk.LWVECF_1
lwsdk.LWVECF_2

If the bit is set, then the corresponding element of the vector array minvec and maxvec contains a valid limit. If the bit is 0, the channel is unbounded. The type is one of lwsdk.LWIP_POSITION, lwsdk.LWIP_ROTATION, and lwsdk.LWIP_SCALING.

 lookAhead(LWItemID item) → LWTime

Returns the look-ahead interval, in seconds, for motion channels controlled by lwsdk.LWMOTCTL_ALIGN_TO_PATH. This is the amount of time by which changes in orientation of the item anticipate changes in the path direction.

 maxLookSteps(LWItemID item) → unsigned int

Returns the maximum number of steps taken for align to path. If the no reliable distance has been found within the maximum number of steps, path alignment will be considered to be unreliable.

 name(LWItemID item) → char

Returns the name of the item as it appears to the user.

 next(LWItemID item) → LWItemID

Returns the next item of the same type as the item argument. If there are no more, this returns lwsdk.LWITEM_NULL.

 nextChild(LWItemID parent, LWItemID prevChild) → LWItemID

Returns the next child item given a parent item and the previous child, or lwsdk.LWITEM_NULL if there are no more children.

 param(LWItemID item, LWItemParam type, LWTime time) → value[3]

Returns vector parameters associated with an item at the specified time. The type argument identifies which parameter vector you want. The parameters are:

  lwsdk.LWIP_POSITION
    The keyframed position before parenting. Equivalently, if the item is parented, this is its position relative to its parent.
  lwsdk.LWIP_W_POSITION
    The keyframed position in world coordinates (after parenting).
  lwsdk.LWIP_ROTATION
    The keyframed rotation, in radians (relative to its parent's rotation).
  lwsdk.LWIP_SCALING
    The keyframed scale factors (relative to the parent's scale).
  lwsdk.LWIP_PIVOT
  lwsdk.LWIP_PIVOT_ROT
    The item's pivot point position and rotation, in its own coordinates. The pivot point is the origin for the item's rotations.
  lwsdk.LWIP_RIGHT
  lwsdk.LWIP_UP
  lwsdk.LWIP_FORWARD
    +X, +Y and +Z direction vectors for the item, in world coordinates. Together they form the item's rotation and scale transformation matrix. Since they include scaling, these vectors aren't normalized.
  lwsdk.LWIP_W_RIGHT
  lwsdk.LWIP_W_UP
  lwsdk.LWIP_W_FORWARD
    +X, +Y and +Z direction vectors for the world, in item coordinates. In other words, these are the inverse of the previous parameters.

 parent(LWItemID item) → LWItemID

Returns the item's parent, if any, or lwsdk.LWITEM_NULL.

 pole(LWItemID item) → LWItemID

Returns the item's pole, if any, or lwsdk.LWITEM_NULL.

 reliableDistance(LWItemID item) → double

Returns the distance which is considered reliable for align to path.

 sameItem(LWItemID item, LWItemParam type) → LWItemID

Returns the item's "Same As Item" item for the given parameter, or lwsdk.LWITEM_NULL if none is set. The type is one of:

lwsdk.LWIP_POSITION
lwsdk.LWIP_ROTATION
lwsdk.LWIP_SCALING

 sameItemBlend(LWItemID item, LWItemParam type, LWTime time) → double

Returns the item's "Same As Item" blending factor at a given time. The type is one of:

lwsdk.LWIP_POSITION
lwsdk.LWIP_ROTATION
lwsdk.LWIP_SCALING

 sameItemBlendMethod(LWItemID item, LWItemParam type) → unsigned int

Returns the item's "Same As Item" blending method for the given type. The type is one of:

lwsdk.LWIP_POSITION
lwsdk.LWIP_ROTATION
lwsdk.LWIP_SCALING

The returned method is one of:

lwsdk.LWMOTCTL_SAMEITEM_INTERPOLATE
lwsdk.LWMOTCTL_SAMEITEM_COMPENSATE

 sameItemFlags(LWItemID item, LWItemParam type) → unsigned int

Returns any flags for the item's "Same As Item" setting. The type is one of:

lwsdk.LWIP_POSITION
lwsdk.LWIP_ROTATION
lwsdk.LWIP_SCALING

The returned value is zero or more of the following bitflags:

lwsdk.LWMOTCTL_SAMEITEM_WORLD

 selected(LWItemID item) → unsigned int

Returns a Boolean value (0 for False, 1, for True) that indicates whether or not the object is currently selected in the scene.

 server(LWItemID item, char class_name, int class) → char

Returns the name of a plug-in applied to an item. The class argument is the class name, and the index refers to the position in the server list for that class. The first server in the list has an index of 1. Returns None if no plug-in matching the arguments can be found. This function can also be used to query the names of servers that aren't associated with items, such as pixel and image filters and volumetrics, and for those the item ID is ignored.

 serverFlags(LWItemID item, char server_name, int class) → unsigned int

Returns flags for the plug-in identified by the item, class name and server list index. Currently the possible flags are:

lwsdk.LWSRVF_DISABLED
lwsdk.LWSRVF_HIDDEN

 setTag(LWItemID item, int tagnum, char tag)

Associate a tag string with an item. If tagnum is 0, a new tag is created for the item. If tagnum is the number of an existing tag, the tag string for that tag is replaced. If tagnum is outside these values, the call is ignored.

splineFit(self, LWItemID arg1) → unsigned int
splineItem(self, LWItemID arg1) → LWItemID
splineT(self, LWItemID arg1, LWTime arg2) → double
 stiffness(LWItemID item, LWItemParam type) → vector[3]

Returns the item's joint stiffness settings for position, rotation, or scale. Use one of lwsdk.LWIP_POSITION, lwsdk.LWIP_ROTATION, and lwsdk.LWIP_SCALING as the type.

 target(LWItemID item) → LWItemID

Returns the item's target, if any, or lwsdk.LWITEM_NULL.

 type(LWItemID item) → LWItemType

Returns the type of an item:

lwsdk.LWI_OBJECT
lwsdk.LWI_LIGHT
lwsdk.LWI_CAMERA
lwsdk.LWI_BONE

Previous topic

List Info

Next topic

Object Info

This Page