getPrimitives

getPrimitives

Returns the settings of a primitive object (Box, Sphere, Cylinder, etc.).

Signature

getPrimitives(name: string): Promise<PrimitiveNodeSettings | null>

Parameters

Name
Type
Required
Description

name

string

Yes

Name of the primitive object

Returns

Promise<PrimitiveNodeSettings | null> — Settings specific to the primitive type, or null if object not found or not a primitive.

The returned type depends on the primitive:

type PrimitiveNodeSettings =
  | PrimitiveBoxSettings
  | PrimitiveSphereSettings
  | PrimitiveCylinderSettings
  | PrimitiveConeSettings
  | PrimitiveTorusSettings
  | PrimitiveTubeSettings
  | PrimitivePolyhedronSettings
  | PrimitiveSquarePlaneSettings
  | PrimitiveInfinitePlaneSettings;

Usage

Primitive Types

PrimitiveBoxSettings:

PrimitiveSphereSettings:

Notes

  • Returns null for non-existent objects or non-primitives (no error thrown)

  • Dimension values are returned as strings, not numbers

  • Also works with Backdrop object

Last updated