Automating the Datasmith Export with MAXScript

Describes the MAXScript interface exposed by Datasmith, and how to use it to export your 3ds Max scene.

Windows
MacOS
Linux

The Datasmith Export Plugin for 3ds Max adds a small DatasmithExport interface to the MAXScript environment whenever it is installed and activated. You can use this interface to automate the process of exporting your 3ds Max scene to a .udatasmith file, instead of following the manual process described under Exporting Datasmith Content from 3ds Max.

Example

The following MAXScript code example shows how to export a 3ds Max scene with all scene objects and animations included.

DatasmithExport.IncludeTarget = #VisibleObjects               -- or #SelectedObjects
DatasmithExport.AnimatedTransforms = #ActiveTimeSegment       -- or #CurrentFrame
DatasmithExport.Export "D:\path\filename.udatasmith" false    -- set your own path and filename

The DatasmithExport MAXScript Interface

The following sections describe the properties and methods exposed by the DatasmithExport interface.

IncludeTarget

  • Type: enum

  • Access: Read, write

Determines which objects in the scene are included in the exported file.

  • #VisibleObjects - The exported file will contain all of the objects in your scene that are currently visible in 3ds Max. This is the default value.

  • #SelectedObjects - The exported file will contain only the visible objects that you currently have selected.

AnimatedTransforms

  • Type: enum

  • Access: Read, write

Determines how the exporter handles objects with animated 3D transforms. Accepts either of the following values:

  • #CurrentFrame - The exported file will include only the objects in the scene as they appear in the current frame, without any animation data. This is the default value.

  • #ActiveTimeSegment - The exported file will include animation data for any objects whose 3D transforms are animated within the time segment that is currently active in the 3ds Max timeline. The importer converts this animation data into a Level Sequence, which you can use to play back the animations inside the Unreal Engine.

Regardless of the value you choose for this setting, the Datasmith exporter always bases its exported data on the state of the scene objects in the current frame in 3ds Max. If you have animated mesh deformations or other sub-object animations, the Assets and Actors you'll see in the Unreal Engine after import will reflect the state of those objects at the frame that you have selected when you export the scene.

Version

  • Type: int

  • Access: Read-only

Returns the version number of the Unreal Engine that this version of the Datasmith Exporter for 3ds Max was compiled against, expressed as an integer.

Export(strFilename, boolSuppressWarnings)

  • Type: method

Starts the export process. This method requires the following parameters:

Parameter

Type

Description

strFilename

string

The absolute path and filename of the .udatasmith file that the exporter should create.

boolSuppresWarnings

Boolean

Determines whether the automated export should hide the window that normally shows notes and warnings about how the content in your scene was exported. Set this to true if you want your script to run unattended or unobtrusively without requiring the user to close a window when the export completes.

Select Skin
Light
Dark

새로운 언리얼 엔진 4 문서 사이트에 오신 것을 환영합니다!

문서 사이트에 대한 의견을 모을 수 있는 피드백 시스템을 포함해서 여러가지 새로운 기능을 준비하고 있습니다. 아래 Documentation Feedback 포럼(영문) 또는 언리얼 엔진 네이버 공식 카페(한글) 중 편하신 곳에 의견이나 문제점을 알려 주세요.

새 시스템이 준비되면 알려 드리겠습니다.

네이버 카페
공식 포럼