CSGroup Object

The CSGroup Object represents a 3DCrafter Group.

General GetID
  GetName
  SetName
Hierarchy GetParent
  GetChildCount
  GetChild
  AddChild
  SetParent
Position and Orientation GetPosition
  SetPosition
  GetOrientation
  SetOrientation
  GetTransform
  SetTransform
Shapes AddShape
  GetShapeCount
  GetShape
Animation GetPositionKeyFrameCount
  GetPositionKeyFrame
  GetOrientationKeyFrameCount
  GetOrientationKeyFrame
Skins GetSkin
  GetSkinInfluenceCount
  GetSkinInfluence
General GetCustomFieldValue
  SetCustomFieldValue

 

GetName

Gets the name of the group.

Syntax

shape.GetName() As Variant

SetName

Sets the name of the group.

Syntax

shape.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 CSGroup that is the parent group of the group.

Syntax

shape.GetParent() As CSGroup

GetChildCount

Gets the number of child groups the group has.

Syntax

shape.GetChildCount() As Variant

GetChild

Gets the specified child CSGroup shape.

Syntax

shape.GetChild(Index As Variant) As CSGroup

AddChild

Adds the specified CSGroup shape as a child group.

Syntax

shape.AddChild(Group As Variant)

Remarks

This will add the group to the scene.

SetParent

Sets the parent group for the specified CSGroup shape.

Syntax

shape.SetParent(ParentGroup As Variant)

GetPosition

Gets the position of the group relative to a specific CSGroup shape.

Syntax

shape.GetPosition(RelativeGroup As Variant,
AnimationTime 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.

The AnimationTime parameter allows you to get the position at a particular time in the animation.

SetPosition

Sets the position of the group relative to a specific CSGroup shape.

Syntax

shape.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. Time should be a whole number.

GetOrientation

Gets the orientation of the group relative to a specific CSGroup shape.

Syntax

shape.GetOrientation(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 get the group's orientation in world coordinates.

The AnimationTime parameter allows you to get the orientation at a particular time in the animation.

SetOrientation

Sets the orientation of the group relative to a specific CSGroup shape.

Syntax

shape.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. Time should be a whole number.

GetTransform

Gets the transformation matrix of the group relative to a specific CSGroup shape.

Syntax

shape.GetTransform(RelativeGroup As Variant,
AnimationTime As Variant,
Mat11 As Variant,
Mat21 As Variant,
Mat31 As Variant,
Mat41 As Variant,
Mat12 As Variant,
Mat22 As Variant,
Mat32 As Variant,
Mat42 As Variant,
Mat13 As Variant,
Mat23 As Variant,
Mat33 As Variant,
Mat43 As Variant,
Mat14 As Variant,
Mat24 As Variant,
Mat34 As Variant,
Mat44
As Variant)

Remarks

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

The AnimationTime parameter allows you to get the transform at a particular time in the animation.

SetTransform

Gets the transformation matrix of the group relative to a specific CSGroup shape.

Syntax

shape.SetTransform(RelativeGroup As Variant,
AnimationTime As Variant,
Mat11 As Variant,
Mat21 As Variant,
Mat31 As Variant,
Mat41 As Variant,
Mat12 As Variant,
Mat22 As Variant,
Mat32 As Variant,
Mat42 As Variant,
Mat13 As Variant,
Mat23 As Variant,
Mat33 As Variant,
Mat43 As Variant,
Mat14 As Variant,
Mat24 As Variant,
Mat34 As Variant,
Mat44
As Variant)

Remarks

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

The AnimationTime parameter allows you to set a transform at a particular time in the animation. This allows you to set group animation paths. Time should be a whole number.

AddShape

Adds a CSShape shape to the group.

Syntax

shape.AddShape(shape As Variant)

Remarks

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

GetShapeCount

Gets the number of CSShape shapes in this group.

Syntax

shape.GetShapeCount() As Variant

GetShape

Gets the specified CSShape shape.

Syntax

shape.GetShape(Index As Variant) As CSShape

GetLightCount

Gets the number of CSLight shapes in this group.

Syntax

shape.GetLightCount() As Variant

GetLight

Gets the specified CSLight shape.

Syntax

shape.GetLight(Index As Variant) As CSLight

GetCameraCount

Gets the number of CSCamera shapes in this group.

Syntax

shape.GetCameraCount() As Variant

GetCamera

Gets the specified CSCamera shape.

Syntax

shape.GetLight(Index As Variant) As CSCamera

GetID

Gets the unique identifier for the group.

Syntax

shape.GetID() As Variant

GetPositionKeyFrameCount

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

Syntax

shape.GetPositionKeyFrameCount() As Variant

GetPositionKeyFrame

Gets the specified animation position key-frame.

Syntax

shape.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

shape.GetOrientationKeyFrameCount() As Variant

GetOrientationKeyFrame

Gets the specified animation orientation key-frame.

Syntax

shape.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.

GetCustomFieldValue

Gets the value of a custom field.

Syntax

shape.GetCustomFieldValue(FieldID as Variant) As Variant

Remarks

The FieldID can be determined using GetGroupCustomFieldID of the CSScene shape.

SetCustomFieldValue

Sets the value of a custom field.

Syntax

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

Remarks

The FieldID can be determined using GetGroupCustomFieldID of the CSScene shape.

GetSkin

Gets the Skin (CSShape) affected by this group, if any.

Syntax

shape.GetSkin() As CSShape

Remarks

If this is not Nothing then this group acts as a bone modifying the skin.

GetSkinInfluenceCount

Gets the number of points of the skin influenced by this group.

Syntax

shape.GetSkinInfluenceCount() As Variant

GetSkinInfluence

Gets a point identifier for a point within the skin influenced by this group.

Syntax

shape.GetSkinInfluence(InfluenceID as Variant, PointID as Variant, PointWeight As Variant)