Alembic_Import: ImporterPlugin

Alembic 読み込みプラグインを MAXScript に公開します。3ds Max 2016 以降で使用可能です。

3ds Max 2019 の新機能: 2019 では、いくつかのプロパティが追加、削除、または変更されました。

2019 2018
AnimTimeRange CacheTimeRange
CustomAttributes 2019 の新機能
EndFrame EndFrameTime
ExtraChannels 2019 の新機能
2019 で削除 StepFrameTime
非表示 2019 の新機能
LayerName 2019 の新機能
MaterialIDs 2019 の新機能
MaterialName 2019 の新機能
法線 2019 の新機能
ObjectID 2019 の新機能
SamplesPerFrame 2019 の新機能
ShapeSuffix ShapeName
StartFrame StartFrameTime
UV 2019 の新機能
速度 2019 の新機能
VertexColors 2019 の新機能
可視性 2019 の新機能

コンストラクタ

Class instances not creatable by MAXScript.

エイリアス:

Alembic_Import
AlembicImport

Alembic_Import インタフェース:

Interface: AlembicImport

プロパティ:

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

読み込まれた Alembic ファイルの座標系を設定します。

AlembicImport.ImportToRoot : boolean : Read|Write

Alembic の読み込みオプションの[ルートに読み込み](Import To Root)の状態をコントロールします。

False (既定値)に設定すると、読み込まれた Alembic オブジェクトは Alembic コンテナの親になります。1 つのオブジェクトとして読み込まれた Alembic を変換または選択する場合に便利です。

True に設定すると、読み込まれた Alembic オブジェクトは親を持たないワールドの子になります。

AlembicImport.FitTimeRange : bool : Read|Write

true の場合は、読み込まれた Alembic アニメーションの時間範囲に合わせてシーンの時間範囲を更新します。

AlembicImport.SetStartTime : bool : Read|Write

true の場合は、読み込まれた Alembic アニメーションの開始時間に合わせて現在のシーン時刻を設定します。

AlembicImport.UVs : bool : Read|Write

true の場合は、メッシュの UV マップ チャネルを読み込みます。このグローバル読み込みオプションは、作成された Alembic ノードにローカルにコピーされます。

AlembicImport.Normals : bool : Read|Write

true の場合は、メッシュの法線を読み込みます。このグローバル読み込みオプションは、作成された Alembic ノードにローカルにコピーされます。

AlembicImport.VertexColors : bool : Read|Write

true の場合は、メッシュの頂点カラー マップ 0 を読み込みます。このグローバル読み込みオプションは、作成された Alembic ノードにローカルにコピーされます。

AlembicImport.ExtraChannels : bool : Read|Write

true の場合は、メッシュの追加マップ チャネルを読み込みます。このグローバル読み込みオプションは、作成された Alembic ノードにローカルにコピーされます。

AlembicImport.Velocity : bool : Read|Write

true の場合は、メッシュの頂点速度データを読み込みます。このグローバル読み込みオプションは、作成された Alembic ノードにローカルにコピーされます。

AlembicImport.MaterialIDs : bool : Read|Write

true の場合は、Alembic フェース セットからメッシュのマテリアル ID を読み込みます。このグローバル読み込みオプションは、作成された Alembic ノードにローカルにコピーされます。

AlembicImport.Visibility : bool : Read|Write

true の場合は、ノードの可視性データを読み込みます。このグローバル読み込みオプションは、作成された Alembic ノードにローカルにコピーされます。

AlembicImport.ShapeSuffix : boolean : Read|Write

true に設定した場合、読み込まれたオブジェクトの名前から「Shape」サフィックスが取り除かれます。このプロパティは既定で false に設定されています。

メソッド:

<void>setDefaults()

AlembicImport のすべてのプロパティを既定値にリセットします。

Alembic ファイル検査メソッド

これらのメソッドは、 3ds Max 2019.1 Update の新機能です。

<TSTR by value> AlembicImport.Inspect <TSTR by value>alembicFile

指定した almembicFile を検査のためにロードして、Alembic ファイル階層の「ルート」パスを返します。このメソッドは、[Alembic の読み込みオプション](Alembic Import Options)ダイアログの[Alembic ファイルを検証](Inspect Alembic File)オプションを公開します。

<integer> AlembicImport.GetNumChildren <TSTR by value>pathToNode

指定したノード パスの子の数を返します。

<TSTR by value> AlembicImport.GetParent <TSTR by value>pathToNode

指定したノードの親ノードのパスを返します。

<TSTR by value> AlembicImport.GetChild <TSTR by value>pathToNode <integer>index

指定したインデックスの、指定したノードの子ノードのパスを返します。

注: これは 0 から始まるインデックスです。

<TSTR by value> AlembicImport.GetABCNodeName <TSTR by value>pathToNode

指定したノードの名前を返します。これは、[Alembic ファイルを検証](Inspect Alembic File)ダイアログのツリー ビューに表示される文字列です。

<boolean> AlembicImport.IsPropertyNode <TSTR by value>pathToNode

3ds Max 2019.2 Update で削除: 指定したノードでプロパティが定義されている場合は、true を返します。

<enum> AlembicImport.GetABCNodeType <TSTR by value>pathToNode
       GetABCNodeType enums: {#Compound|#Scalar|#Array

3ds Max 2019.2 Update で削除: 指定したノードのプロパティ タイプを返します。

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

3ds Max 2019.2 Update で削除: 指定したノードのデータ タイプを返します。

<integer> AlembicImport.GetABCNodeExtent <TSTR by value>pathToNode

3ds Max 2019.2 Update で削除: 指定したノードの範囲を返します。

これらのメソッドは、 3ds Max 2019.2 Update の新機能です。

<TSTR by value>  AlembicImport.GetABCNodeProperties <TSTR by value>pathToNode

指定したノードのオブジェクト プロパティ ノードを返します。pathToNode は「path/to/alembic/object」の形式の文字列です。

<integer> AlembicImport.GetNumProperties <TSTR by value>pathToNode 
  <TSTR by value>pathToProperty

指定したプロパティ ノードに保持されているプロパティの数を返します。

pathToNode 引数は、「path/to/alembic/object」の形式の文字列です。

pathToProperty 引数は、「path/to/parent/property」の形式の文字列です。: 子を持つことができるのは、合成プロパティのみです。

<TSTR by value>  AlembicImport.GetChildPropertyFromIndex <TSTR by value>pathToNode
  <TSTR by value>pathToProperty <integer> index

指定した index にある子プロパティ ノードのパスを返します。index の基数は 0 です。

pathToNode 引数は、「path/to/alembic/object」の形式の文字列です。

pathToProperty 引数は、「path/to/parent/property」の形式の文字列です。: 子を持つことができるのは、合成プロパティのみです。

<TSTR by value>  AlembicImport.GetChildPropertyFromName <TSTR by value>pathToNode
  <TSTR by value>pathToProperty <TSTR by value>name);

指定した名前を持つ最初のプロパティのプロパティ ノードのパスを取得します。この関数は再帰的であるため、指定したプロパティに孫を設定できます。

pathToNode 引数は、「path/to/alembic/object」の形式の文字列です。

pathToProperty 引数は、「path/to/parent/property」の形式の文字列です。: 子を持つことができるのは、合成プロパティのみです。

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

指定したプロパティ ノードのタイプを取得します。

pathToNode 引数は、「path/to/alembic/object」の形式の文字列です。

pathToProperty 引数は、「path/to/parent/property」の形式の文字列です。: 子を持つことができるのは、合成プロパティのみです。

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

指定したプロパティ ノードのデータ タイプを取得します。

pathToNode 引数は、「path/to/alembic/object」の形式の文字列です。

pathToProperty 引数は、「path/to/parent/property」の形式の文字列です。: 子を持つことができるのは、合成プロパティのみです。

<integer> AlembicImport.GetPropertyExtent <TSTR by value>pathToNode 
  <TSTR by value>pathToProperty

指定したプロパティ ノードの範囲を取得します。

pathToNode 引数は、「path/to/alembic/object」の形式の文字列です。

pathToProperty 引数は、「path/to/parent/property」の形式の文字列です。: 子を持つことができるのは、合成プロパティのみです。

カスタム アトリビュートとオブジェクト アトリビュートのメソッド

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

基本オブジェクトまたはモディファイヤに追加するリストにカスタム アトリビュートを追加します。

location は、カスタム アトリビュートの保存場所(#Modifier または #BaseObject)を示します。

alembicObjectPath は、カスタム アトリビュートを所有する Alembic オブジェクトのパスです。

propertyPath は、カスタム アトリビュートのプロパティのパスです。

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

カスタム アトリビュートを書き出すスクリプトを作成して、Alembic ファイルに接続します。

<void> AlembicImport.CA_SetNode <node>node <TSTR by value>alembicFile

Alembic ファイルにノードを関連付けます。このメソッドは、ノードにプロパティを追加する前に呼び出す必要があります。

    <bool> AlembicImport.OA_SetBool <node>node <TSTR by value>name <bool>val
    <bool> AlembicImport.OA_SetInt <node>node <TSTR by value>name <integer>val
    <bool> AlembicImport.OA_SetFloat <node>node <TSTR by value>name <float>val
    <bool> AlembicImport.OA_SetPoint3 <node>node <TSTR by value>name <point3>val
    <bool> AlembicImport.OA_SetString <node>node <TSTR by value>name <TSTR by value>val

これらのメソッドは、指定したノードにオブジェクト アトリビュートを設定して、このアトリビュートが正常に設定された場合は true を返します。

アクション:

アクションは公開されません。

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

検査の例

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