D3DXSaveMeshHierarchyToFile function

Creates a .x file and saves the mesh hierarchy and corresponding animations in it.

Syntax

HRESULT D3DXSaveMeshHierarchyToFile(
  _In_       LPCSTR                    pFilename,
  _In_       DWORD                     XFormat,
  _In_ const D3DXFRAME                 *pFrameRoot,
  _In_       LPD3DXANIMATIONCONTROLLER pAnimController,
  _In_       LPD3DXSAVEUSERDATA        pUserDataSaver
);

Parameters

pFilename [in]

Type: LPCSTR

Pointer to a string that specifies the name of the .x file identifying the saved mesh. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

XFormat [in]

Type: DWORD

Format of the .x file (text or binary, compressed or not). See D3DXF_FILEFORMAT. D3DXF_FILEFORMAT_COMPRESSED can be combined (using a logical OR) with either the D3DXF_FILEFORMAT_BINARY or D3DXF_FILEFORMAT_TEXT flags to reduce the output file size.

pFrameRoot [in]

Type: const D3DXFRAME*

Root node of the hierarchy to be saved. See D3DXFRAME.

pAnimController [in]

Type: LPD3DXANIMATIONCONTROLLER

Animation controller that has animation sets to be stored. See ID3DXAnimationController.

pUserDataSaver [in]

Type: LPD3DXSAVEUSERDATA

Application-provided interface that allows saving of user data. See ID3DXSaveUserData.

Return value

Type: HRESULT

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be: D3DERR_INVALIDCALL.

Remarks

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXSaveMeshHierarchyToFileW. Otherwise, the function call resolves to D3DXSaveMeshHierarchyToFileA.

This function does not save compressed animation sets.

Requirements

Requirement Value
Header
D3dx9anim.h
Library
D3dx9.lib

See also

Animation Functions

X File Reference