CanvasGroup Object

The CanvasGroup object represents a 3D Canvas Group.

General GetID
  GetName
  SetName
Hierarchy GetParent
  GetChildCount
  GetChild
  AddChild
  SetParent
Position and Orientation GetPosition
  SetPosition
  GetOrientation
  SetOrientation
  GetTransformMatrix
Objects AddObject
  GetObjectCount
  GetObject
  GetBoundingBox
Bones GetBoneCount
  GetBone
Animation GetAnimationStyle
  GetPositionKeyFrameCount
  GetPositionKeyFrame
  GetOrientationKeyFrameCount
  GetOrientationKeyFrame
General GetCustomFieldValue
  SetCustomFieldValue

 

GetName

Gets the name of the group.

Syntax

object.GetName() As Variant

SetName

Sets the name of the group.

Syntax

object.SetName(Name As Variant)

Remarks

A group must be made a child of another group using the AddChild method before it can be named.

GetParent

Gets the CanvasGroup that is the parent group of the group.

Syntax

object.GetParent() As CanvasGroup

GetChildCount

Gets the number of child groups the group has.

Syntax

object.GetChildCount() As Variant

GetChild

Gets the specified child CanvasGroup object.

Syntax

object.GetChild(Index As Variant) As CanvasGroup

AddChild

Adds the specified CanvasGroup object as a child group.

Syntax

object.AddChild(Group As Variant)

Remarks

This will add the group to the scene.

SetParent

Sets the parent group for the specified CanvasGroup object.

Syntax

object.SetParent(ParentGroup As Variant)

GetPosition

Gets the position of the group relative to a specific CanvasGroup object.

Syntax

object.GetPosition(RelativeGroup As Variant,
X As Variant,
Y As Variant,
Z
As Variant)

Remarks

Provide Nothing as the RelativeGroup to get the group's position in world coordinates.

SetPosition

Sets the position of the group relative to a specific CanvasGroup object.

Syntax

object.SetPosition(RelativeGroup As Variant,
AnimationTime As Variant,
X As Variant,
Y As Variant,
Z
As Variant)

Remarks

Provide Nothing as the RelativeGroup to set the group's position in world coordinates.

The AnimationTime parameter allows you to set a position at a particular time in the animation. This allows you to set group animation paths.

GetOrientation

Gets the orientation of the group relative to a specific CanvasGroup object.

Syntax

object.GetOrientation(RelativeGroup As Variant,
DirX As Variant,
DirY As Variant,
DirZ As Variant,
UpX As Variant,
UpY As Variant,
UpZ
As Variant)

Remarks

Provide Nothing as the RelativeGroup to get the group's orientation in world coordinates.

SetOrientation

Sets the orientation of the group relative to a specific CanvasGroup object.

Syntax

object.SetOrientation(RelativeGroup As Variant,
AnimationTime As Variant,
DirX As Variant,
DirY As Variant,
DirZ As Variant,
UpX As Variant,
UpY As Variant,
UpZ
As Variant)

Remarks

Provide Nothing as the RelativeGroup to set the group's orientation in world coordinates.

The AnimationTime parameter allows you to set an orientation at a particular time in the animation. This allows you to set group animation paths.

GetTransformMatrix

Gets the transformation matrix of the group relative to a specific CanvasGroup object.

Syntax

object.GetTransformMatrix(RelativeGroup As Variant,
Mat00 As Variant,
Mat01 As Variant,
Mat02 As Variant,
Mat03 As Variant,
Mat10 As Variant,
Mat11 As Variant,
Mat12 As Variant,
Mat13 As Variant,
Mat20 As Variant,
Mat21 As Variant,
Mat22 As Variant,
Mat23 As Variant,
Mat30 As Variant,
Mat31 As Variant,
Mat32 As Variant,
Mat33
As Variant)

Remarks

Provide Nothing as the RelativeGroup to get the group's transformation matrix in world coordinates.

AddObject

Adds a CanvasObject object to the group.

Syntax

object.AddObject(Object As Variant)

Remarks

The object is added to the scene when it is added to a group. If you make any further changes to the object after it is added to a group you will need to update it using the object's WriteScriptOperationLayer method.

GetObjectCount

Gets the number of CanvasObject objects in this group.

Syntax

object.GetObjectCount() As Variant

GetObject

Gets the specified CanvasObject object.

Syntax

object.GetObject(Index As Variant) As CanvasObject

GetBoneCount

Gets the number of CanvasBone objects in this group.

Syntax

object.GetBoneCount() As Variant

GetBone

Gets the specified CanvasBone object.

Syntax

object.GetBone(Index As Variant) As CanvasBone

GetLightCount

Gets the number of CanvasLight objects in this group.

Syntax

object.GetLightCount() As Variant

GetLight

Gets the specified CanvasLight object.

Syntax

object.GetLight(Index As Variant) As CanvasLight

GetID

Gets the unique identifier for the group.

Syntax

object.GetID() As Variant

GetAnimationStyle

Gets the animation style for the group.

Syntax

object.GetAnimationStyle() As Variant

Remarks

0 = a closed (repeating) animation
1 = an open animation

GetPositionKeyFrameCount

Gets the number of animation position key-frames for this group.

Syntax

object.GetPositionKeyFrameCount() As Variant

GetPositionKeyFrame

Gets the specified animation position key-frame.

Syntax

object.GetPositionKeyFrame(Index As Variant,
Time As Variant,
X As Variant,
Y As Variant,
Z
As Variant)

GetOrientationKeyFrameCount

Gets the number of animation orientation key-frames for this group.

Syntax

object.GetOrientationKeyFrameCount() As Variant

GetOrientationKeyFrame

Gets the specified animation orientation key-frame.

Syntax

object.GetOrientationKeyFrame(Index As Variant,
Time As Variant,
X As Variant,
Y As Variant,
Z As Variant,
r
As Variant)

Remarks

An orientation key-frame is a quaternion.

GetBoundingBox

Gets the bounding box for the current group and all groups below it in the hierarchy.

Syntax

object.GetBoundingBox(MinX As Variant,
MinY As Variant,
MinZ As Variant,
MaxX As Variant,
MaxY As Variant,
MaxZ
As Variant)

GetCustomFieldValue

Gets the value of a custom field.

Syntax

object.GetCustomFieldValue(FieldID as Variant) As Variant

Remarks

The FieldID can be determined using GetGroupCustomFieldID of the CanvasApplication object.

SetCustomField

Sets the value of a custom field.

Syntax

object.SetCustomFieldValue(FieldID as Variant, FieldValue As Variant)

Remarks

The FieldID can be determined using GetGroupCustomFieldID of the CanvasApplication object.