CanvasObject Object

The CanvasObject object represents a 3D Canvas Object.

General GetID
  GetName
  SetName
  GetType
  Clear
  AddObject
  Transform
  InverseTransform
  GetBoundingBox
  WriteScriptOperationLayer
Faces CreateFace
  GetFaceCount
  GetFace
Points AddPoint
  GetPointCount
  GetPoint
  SetPoint
  GetPointTextureCoordinate
  SetPointTextureCoordinate
Normals AddNormal
  GetNormalCount
  GetNormal
  SetNormal
  GenerateNormals
Bones GetBoneCount
  GetBone
Materials and Textures GetMaterialCount
  GetMaterial
  SetObjectMaterial
  GetFaceMaterialIndex
  SetTextureTopology
Hierarchy GetParentFrame

GetID

Gets the unique identifier for the object.

Syntax

object.GetID() As Variant

GetName

Gets the name of the object.

Syntax

object.GetName() As Variant

SetName

Sets the name of the object.

Syntax

object.SetName(Name As Variant)

Remarks

An object must be made a child of a frame using the AddObject method before it can be named.

GetType

Gets the object type.

Syntax

object.GetType() As Variant

Remarks

0 = 3D Canvas Object
1 = 3D Canvas Skin
2 = 3D Canvas Placeholder

Clear

Clears the contents of the object.

Syntax

object.Clear()

AddObject

Adds a CanvasObject object to the object.

Syntax

object.AddObject(Object As Variant)

Transform

Transforms the object from model coordinates to world coordinates.

Syntax

object.Transform()

InverseTransform

Transforms the object from world coordinates to model coordinates.

Syntax

object.InverseTransform()

GetBoundingBox

Gets the object's bounding box.

Syntax

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

WriteScriptOperationLayer

Writes a Script Operation Layer for the object.

Syntax

object.WriteScriptOperationLayer()

Remarks

After you make any change to an object you must use this method to notify 3D Canvas that the change should be saved the next time 3D Canvas saves the document.

This method does not need to be done after changes made while animating.

CreateFace

Creates a CanvasFace object and adds it to the object.

Syntax

object.CreateFace() As CanvasFace

GetFaceCount

Gets the number of CanvasFace objects in the object.

Syntax

object.GetFaceCount() As Variant

GetFace

Gets the specified CanvasFace object.

Syntax

object.GetFace(Index As Variant) As CanvasFace

GetPointCount

Gets the number of points in the object.

Syntax

object.GetPointCount() As Variant

GetPoint

Gets the specified point.

Syntax

object.GetPoint(Index As Variant,
X As Variant,
Y As Variant,
Z As Variant)

SetPoint

Sets the specified point.

Syntax

object.SetPoint(Index As Variant,
X As Variant,
Y As Variant,
Z As Variant)

AddPoint

Adds a point to the object.

Syntax

object.AddPoint(X As Variant,
Y As Variant,
Z As Variant)

GetPointTextureCoordinate

Gets a point's texture coordinate.

Syntax

object.GetPointTextureCoordinate(Index As Variant,
U As Variant,
V As Variant)

SetPointTextureCoordinate

Sets a point's texture coordinate.

Syntax

object.SetPointTextureCoordinate(Index As Variant,
U As Variant,
V As Variant)

AddNormal

Adds a normal to the object.

Syntax

object.AddNormal(X As Variant,
Y As Variant,
Z As Variant)

GenerateNormals

Generates normals for the object.

Syntax

object.GenerateNormals(CreaseAngle As Variant)

Remarks

The crease angle is in Radians. pi Radians = 180 degrees.

GetNormalCount

Gets the number of normals in the object.

Syntax

object.GetNormalCount() As Variant

GetNormal

Gets the specified normal.

Syntax

object.GetNormal(Index As Variant,
X As Variant,
Y As Variant,
Z As Variant)

SetNormal

Sets the specified normal.

Syntax

object.SetNormal(Index As Variant,
X As Variant,
Y As Variant,
Z As Variant)

GetBoneCount

Gets the number of bones that affect this object.

Syntax

object.GetBoneCount() As Variant

GetBone

Gets the specified CanvasBone object.

Syntax

object.GetBone(Index As Variant) As CanvasBone

GetMaterialCount

Gets the number of materials used by this object.

Syntax

object.GetMaterialCount() As Variant

GetMaterial

Gets the specified CanvasMaterial object.

Syntax

object.GetMaterial(Index As Variant) As CanvasMaterial

SetObjectMaterial

Sets a material for the object.

Syntax

object.SetMaterial(Material As Variant)

Remarks

This material will be applied to each face that makes up the object.

GetFaceMaterialIndex

Gets an index to the material that has been applied to a face.

Syntax

object.GetFaceMaterialIndex(FaceIndex As Variant) As Variant

Remarks

Use this in conjunction with GetMaterial to retrieve the specific material applied to a face.

SetTextureTopology

Sets the texture topology for the object.

Syntax

object.SetTextureTopology(WrapU As Variant,
WrapV As Variant)

Remarks

This texture topology will be applied to each face that makes up the object.

Flat wraps require 0, 0 as arguments.
Cylindrical wraps require 1, 0 as arguments.
Spherical wraps require 1, 1 as arguments.

GetParentFrame

Gets the CanvasFrame that is the parent frame of the object.

Syntax

object.GetParentFrame() As CanvasFrame