Datasmith のインポート プロセス中に、unreal.DatasmithSceneElement オブジェクトを使用してシーンのオブジェクトに関するメタデータを取得できます。次の関数の詳細については、「Python API リファレンス」 を参照してください。
get_all_metadata(object_class)
Retrieves an array of all metadata objects recorded for all objects in the Datasmith Scene.
get_all_objects_and_values_for_key(key, object_class)
Retrieves a list of all objects in the Datasmith Scene that have a specified key.You'll also get a list of all values recorded for that key across all those objects.
get_metadata_for_object(object)
Retrieves all metadata assigned to a specified object.
get_metadata_value_for_key(object, key)
Retrieves the value of a specified key assigned to a specified object.
get_metadata_keys_and_values_for_value(object, string_to_match)
Retrieves all keys on a specified object whose value matches the second parameter.
上記の Get Datasmith User Data ノードおよび Get All Datasmith User Data ノードでは、Datasmith ユーザー データ オブジェクトのリファレンスを返します。このオブジェクトには、オブジェクトの Datasmith のメタデータを構成するすべてのキーと値/ペアのマップである、メタデータと呼ばれるアクセス可能な変数が 1 つあります。このタイプのオブジェクトを操作するには、出力ピンをドラッグして、[Variables (変数)] > [Get Metadata (メタデータの取得)] を選択します。
Datasmith のインポート プロセスが完了したら、unreal.DatasmithContentLibrary クラスを使用して、すべてのアクタまたは選択したアクタのメタデータにアクセスできます。次の関数の詳細については、「Python API リファレンス」 を参照してください。
get_all_datasmith_user_data(object_class)
Retrieves the full list of all metadata objects for all Actors in the current Level.
get_all_objects_and_values_for_key(key, object_class)
You'll also get a list of all values recorded for that key across all those objects.
get_datasmith_user_data(object)
Retrieves a metadata object that contains all key-value pairs recorded for the specified Actor, so that you can iterate through them yourself.
get_datasmith_user_data_keys_and_values_for_value(object, string_to_match)
Retrieves all keys on the specified Actor that have the value you specify in the second parameter.Use this node if you know the value you're looking for, but not the name of the key.
get_datasmith_user_data_value_for_key(object, key)
Retrieves the value of the metadata with the specified key assigned to the specified Actor.