Share

Alembic_Import : ImporterPlugin

Exposes the Alembic Importer plugin to MAXScript. Available in 3ds Max 2016 and higher.

Several properties have been added, removed, or changed in 2019. Available in 3ds Max 2019 and higher.

2019 2018
AnimTimeRange CacheTimeRange
CustomAttributes new in 2019
EndFrame EndFrameTime
ExtraChannels new in 2019
gone in 2019 StepFrameTime
Hidden new in 2019
LayerName new in 2019
MaterialIDs new in 2019
MaterialName new in 2019
Normals new in 2019
ObjectID new in 2019
SamplesPerFrame new in 2019
ShapeSuffix ShapeName
StartFrame StartFrameTime
UVs new in 2019
Velocity new in 2019
VertexColors new in 2019
Visibility new in 2019

Constructor

Class instances not creatable by MAXScript.

Aliases:

Alembic_Import
AlembicImport

Alembic_Import interfaces:

Interface: AlembicImport

Properties:

AlembicImport.CoordinateSystem : enum : Read|Write
CoordinateSystem enums: {#Max|#Maya|#ZUp|#YUp}

Set the coordinate system of the imported Alembic file.

AlembicImport.ImportToRoot : boolean : Read|Write

Controls the state of the "Import To Root" option of the Alembic Importer.

When set to False (default), the imported Alembic objects will be parented to an Alembic Container. This is useful if you want to transform or select all imported Alembic objects as one.

When set to True, the imported Alembic objects will become Children Of The World without a parent.

AlembicImport.FitTimeRange : boolean : Read|Write

When true, update the scene time range to match the imported Alembic animation time range.

AlembicImport.SetStartTime : boolean : Read|Write

When true, set the current scene time to match the imported Alembic animation start time.

AlembicImport.UVs : boolean : Read|Write

When true, import the mesh UV map channel. This global import option is copied locally into the created Alembic node.

AlembicImport.Normals : boolean : Read|Write

When true, import the mesh normals. This global import option is copied locally into the created Alembic node.

AlembicImport.VertexColors : boolean : Read|Write

When true, import the mesh vertex color map 0. This global import option is copied locally into the created Alembic node.

AlembicImport.ExtraChannels : boolean : Read|Write

When true, import the mesh extra map channels. This global import option is copied locally into the created Alembic node.

AlembicImport.Velocity : boolean : Read|Write

When true, import the mesh vertex velocity data. This global import option is copied locally into the created Alembic node.

AlembicImport.MaterialIDs : boolean : Read|Write

When true, import the mesh material IDs from Alembic face sets. This global import option is copied locally into the created Alembic node.

AlembicImport.Visibility : boolean : Read|Write

When true, import the node visibility data. This global import option is copied locally into the created Alembic node.

AlembicImport.ShapeSuffix : boolean : Read|Write

When set to true, the "Shape" suffix is stripped from the name of the imported objects. This property is set to false by default.

Methods:

<void>setDefaults()

Reset all AlembicImport properties to their default values.

Alembic File Inspection Methods

<string> AlembicImport.Inspect <string>alembicFile

Loads the specified almembicFile for inspection, and returns the "root" path of the Alembic file hierarchy. This method exposes the Inspect Alembic File option on the Alembic Import Options dialog.

Available in 3ds Max 2019.1 Update and higher.

<integer> AlembicImport.GetNumChildren <string>pathToNode

Returns the number of children for the specified node path.

Available in 3ds Max 2019.1 Update and higher.

<string> AlembicImport.GetParent <string>pathToNode

Returns the path of the parent node of the specified node.

Available in 3ds Max 2019.1 Update and higher.

<string> AlembicImport.GetChild <string>pathToNode <integer>index

Returns the path of the child node for the specified node, at the specified index.

Note: Index is 0-based.

Available in 3ds Max 2019.1 Update and higher.

<string> AlembicImport.GetABCNodeName <string>pathToNode

Returns the name of the specified node. This is the string displayed in the tree view in the Inspect Alembic File dialog.

Available in 3ds Max 2019.1 Update and higher.

<boolean> AlembicImport.IsPropertyNode <string>pathToNode

Removed in 3ds Max 2019.2 Update: Returns true if the specified node defines a property.

<enum> AlembicImport.GetABCNodeType <string>pathToNode
       GetABCNodeType enums: {#Compound|#Scalar|#Array

Removed in 3ds Max 2019.2 Update: Returns the property type of the specified node.

<enum> AlembicImport.GetABCNodeDataType <string>pathToNode
       GetABCNodeDataType enums: {#Bool|#Int8|#UInt8|#Int16|#UInt16|#Int32|#UInt32|#Int64|#UInt64|#Float16|#Float32|#Float64|#String|#WString|#Unknown

Removed in 3ds Max 2019.2 Update: Returns the data type of the specified node.

<integer> AlembicImport.GetABCNodeExtent <string>pathToNode

Removed in 3ds Max 2019.2 Update: Returns the extent of the specified node.

<string>  AlembicImport.GetABCNodeProperties <string>pathToNode

Returns the object properties node for the specified node, where pathToNode is a string in the form of "path/to/alembic/object".

Available in 3ds Max 2019.2 Update and higher.

<integer> AlembicImport.GetNumProperties <string>pathToNode 
  <string>pathToProperty

Returns the number of properties held in the specified property node.

The pathToNode argument is a string in the form "path/to/alembic/object".

The pathToProperty argument is a string in the form "path/to/parent/property". Note: only compounded properties can have children.

Available in 3ds Max 2019.2 Update and higher.

<string>  AlembicImport.GetChildPropertyFromIndex <string>pathToNode
  <string>pathToProperty <integer> index

Returns the path to the child property node at the specified index. The index is 0-based.

The pathToNode argument is a string in the form "path/to/alembic/object".

The pathToProperty argument is a string in the form "path/to/parent/property". Note: only compounded properties can have children.

Available in 3ds Max 2019.2 Update and higher.

<string>  AlembicImport.GetChildPropertyFromName <string>pathToNode
  <string>pathToProperty <string>name);

Gets the property node path for the first property with the specified name. The named property can be a grandchild, since this function is recursive.

The pathToNode argument is a string in the form "path/to/alembic/object".

The pathToProperty argument is a string in the form "path/to/parent/property". Note: only compounded properties can have children.

Available in 3ds Max 2019.2 Update and higher.

<enum> AlembicImport.GetPropertyType <string>pathToNode 
  <string>pathToProperty
  GetPropertyType enums: {#Compound|#Scalar|#Array

Gets the type of the specified property node.

The pathToNode argument is a string in the form "path/to/alembic/object".

The pathToProperty argument is a string in the form "path/to/parent/property". Note: only compounded properties can have children.

Available in 3ds Max 2019.2 Update and higher.

<enum> AlembicImport.GetPropertyDataType <string>pathToNode 
  <string>pathToProperty
  GetPropertyDataType enums: {#Bool|#Int8|#UInt8|#Int16|#UInt16|#Int32|#UInt32|#Int64|#UInt64|#Float16|#Float32|#Float64|#String|#WString|#Unknown

Gets the data type of the specified property node.

The pathToNode argument is a string in the form "path/to/alembic/object".

The pathToProperty argument is a string in the form "path/to/parent/property". Note: only compounded properties can have children.

Available in 3ds Max 2019.2 Update and higher.

<integer> AlembicImport.GetPropertyExtent <string>pathToNode 
  <string>pathToProperty

Gets the extent of the specified property node.

The pathToNode argument is a string in the form "path/to/alembic/object".

The pathToProperty argument is a string in the form "path/to/parent/property". Note: only compounded properties can have children.

Available in 3ds Max 2019.2 Update and higher.

Custom Attribute and Object Attribute Methods

    <void> AlembicImport.CA_AddProperty <enum>location <string>alembicObjectPath <string>propertyPath
       CA_AddProperty - no automatic redraw after invoked
       location enums: {#Modifier|#BaseObject}

Adds a custom attribute to the list to be added to a base object or modifier.

location indicates where the custom attribute will be stored, either #Modifier or #BaseObject.

alembicObjectPath is the path alembic object that owns the custom attribute.

propertyPath is the path to the property of the custom attribute.

    <void> AlembicImport.CA_Build()
       CA_Build - no automatic redraw after invoked 

Builds the script that writes out the custom attributes and connects them to the alembic file.

<void> AlembicImport.CA_SetNode <node>node <string>alembicFile

Associates a node with an alembic file. This method needs to be called before adding properties to a node.

    <boolean> AlembicImport.OA_SetBool <node>node <string>name <boolean>val
    <boolean> AlembicImport.OA_SetInt <node>node <string>name <integer>val
    <boolean> AlembicImport.OA_SetFloat <node>node <string>name <float>val
    <boolean> AlembicImport.OA_SetPoint3 <node>node <string>name <point3>val
    <boolean> AlembicImport.OA_SetString <node>node <string>name <string>val

These methods set object attributes on the specified node, and return true if the attribute was successfully set.

Actions:

No actions exposed.

EXAMPLE

--This example uses the files created in the 
--AlembicExport:ExporterPlugin topic:  
resetMaxFile #noprompt --reset the scene
AlembicImport.ZUp = true --tell the importer to expect Z up (Max mode)
AlembicImport.ImportToRoot = false --parent to an Alembic Container
importFile (GetDir #export +"\\alembictest_hdm5_max.abc") #noPrompt using:AlembicImport
--RESULT: The loaded Cone matches the original animation

resetMaxFile #noprompt --reset the scene
--note that the importer is still in Max Z up mode
importFile (GetDir #export +"\\alembictest_ogawa_maya.abc") #noPrompt 
--RESULT: The Cone will be imported with the wrong orientation 
--because the file contains Y up data.

resetMaxFile #noprompt --reset the scene
AlembicImport.ZUp = false --tell the importer the file is not Z-up
AlembicImport.ImportToRoot = true --import as Child Of The World
--import the Maya file with Z up disabled:
importFile (GetDir #export +"\\alembictest_ogawa_maya.abc") #noPrompt 
--RESULT: The Cone will now be oriented correctly

INSPECTION EXAMPLE

mypath = @"C:\My Documents\3ds Max\export\helicopter.ABC"

pathToParent = AlembicImport.Inspect mypath

fn getAllChildren pathToParent =
(
    numChildren = AlembicImport.GetNumChildren pathToParent

    for i = 1 to numChildren do
    (
        pathToChild = AlembicImport.GetChild pathToParent (i-1)
        
        -- Also possible to get the parent by calling
        -- pathToParent = AlembicImport.GetParent pathToChild 
        
        nodeName = AlembicImport.GetABCNodeName pathToChild

        format "Name: %\n" nodeName
        
        propPath = AlembicImport.GetABCNodeProperties pathToChild
        
        if propPath != undefined then
        (
            numProps = AlembicImport.GetNumProperties pathToChild propPath
            nodeType = AlembicImport.GetPropertyType pathToChild propPath
            dataType = AlembicImport.GetPropertyDataType pathToChild propPath
            extent = AlembicImport.GetPropertyExtent pathToChild propPath
            
            format "%, %, %, %\n" numProps nodeType dataType extent
        )

      getAllChildren pathToChild
   )
)

getAllChildren pathToParent

Was this information helpful?