3ds Max C++ API Reference
Loading...
Searching...
No Matches
ISave Class Referenceabstract

#include <ioapi.h>

+ Inheritance diagram for ISave:

Public Member Functions

virtual ~ISave ()
 
virtual int GetRefID (void *ptarg)=0
 
virtual void BeginChunk (USHORT id)=0
 
virtual void EndChunk ()=0
 
virtual int CurChunkDepth ()=0
 
IOResult WriteVoid (const void *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult WriteEnum (const void *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const char *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const wchar_t *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const int *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const unsigned int *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const INT64 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const UINT64 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const float *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const double *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const short *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const unsigned short *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const long *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const unsigned long *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const BYTE *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const bool *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Point2 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Point3 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Point4 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const AColor *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Color *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Matrix2 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Matrix3 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Box2 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Box3 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const MNVert *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const TVPatch *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Face *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Class_ID *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const VertMove *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const FaceCreate *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const FaceRemap *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const FaceChange *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const FaceSmooth *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const UVVertSet *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const TVFace *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Interval *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const AngAxis *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Quat *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Ray *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const ScaleValue *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const RotationValue *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const FBox2 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const HookPoint *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const PolyPt *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const bindShape *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const EPMapVert *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const EPMapPatch *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const EPMapUVVert *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const RandGenerator *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Interface_ID *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const BlockKeysClass *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Color24 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Color48 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const Color64 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const POINT *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const WINDOWPLACEMENT *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const range *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const MaxSDK::AssetManagement::AssetId *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const MaxSDK::AssetManagement::AssetType *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const ParamType2 *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const FloatChange *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const VertOffset *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const ParticleID *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const PreciseTimeValue *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const DeviceRect *buf, ULONG nbytes, ULONG *nwrit)
 
IOResult Write (const IPoint2 *buf, ULONG nbytes, ULONG *nwrit)
 
virtual IOResult WriteWString (const char *str)=0
 
virtual IOResult WriteWString (const wchar_t *str)=0
 
virtual IOResult WriteCString (const char *str)=0
 
virtual IOResult WriteCString (const wchar_t *str)=0
 
virtual FileIOType DoingWhat ()=0
 
virtual DWORD SavingVersion () const
 
virtual USHORT GetClassDescID (ReferenceMaker *rm)
 
virtual INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
 
virtual const MCHARFileName ()
 
virtual IOResult SaveAssetMetaData (const MaxSDK::AssetManagement::AssetId &assetId, bool saveAssetResolvedFileName)
 
virtual bool SaveAssetAsAssetIDGuid ()
 
virtual UINT CodePage () const
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

Detailed Description

See also
Loading and Saving Plug-in Data, Guidelines for Handling Character Strings, Class ILoad, Class ClassDesc, Class ClassDirectory, Class Interface.

Description:
This class provides methods to save data to disk.

Note: It is not valid to write two CStrs in the same chunk of a 3ds Max file, since ILoad::ReadCStringChunk() sets the size for the string to the ChunkSize. However it is possible to write other data, such as two ints, into the same chunk.

Note about member alignment: Please make sure that when you save data from your plugin you save individual data members using a chunk ID instead of saving the image of a class. Saving (and loading) a class image puts you at risk of running into member alignment problems and as such could potentially corrupt saved files. File IO would be put further at risk when you keep Intel's IA-64 architecture in mind which depends on member alignment. What you should not do is outlined in the following example when loading a class image; iload->Read(&myclass, sizeof(MyClass), &ab);

Once you change the class in such a way that it affects the data size you run the risk of having to support different versions, file IO incompatibility, and member alignment issues.

The following global function is not part of this class but is available for use:

Constructor & Destructor Documentation

◆ ~ISave()

virtual ~ISave ( )
inlinevirtual
206{};

Member Function Documentation

◆ GetRefID()

virtual int GetRefID ( void ptarg)
pure virtual
Remarks
This method is not normally used because the reference hierarchy is saved automatically. In certain cases however this method is quite useful. This method is used in saving a pointer to some object (or a table of pointers). This is a pointer to one of the objects that the scene saves with the reference hierarchy, but it is not a pointer that itself is a reference.
Parameters
ptargThe pointer to save.
Returns
The id that may be saved to disk.

◆ BeginChunk()

virtual void BeginChunk ( USHORT  id)
pure virtual
Remarks
This method is used to begin a chunk. The ID passed need only be unique within the plug-ins data itself.
Parameters
idThe id for the chunk.

◆ EndChunk()

virtual void EndChunk ( )
pure virtual
Remarks
This method is used to end a chunk, and back-patch the length.

◆ CurChunkDepth()

virtual int CurChunkDepth ( )
pure virtual
Remarks
This method is used internally for checking balanced BeginChunk/EndChunk.

◆ WriteVoid()

IOResult WriteVoid ( const void buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
Remarks
This method writes a block of bytes to the output stream.
Parameters
bufThe buffer to write.
nbytesThe number of bytes to write.
nwritThe number of bytes actually written.
Returns
IO_OK - The write was acceptable - no errors.

IO_ERROR - This is returned if an error occurred. Note that the plug-in should not put up a message box if a write error occurs. It should simply return the error status. This prevents a overabundance of messages from appearing.
246 {
247 return Write((void*)buf, nbytes, nwrit);
248 }
IOResult Write(const char *buf, ULONG nbytes, ULONG *nwrit)
Definition: ioapi.h:255

◆ WriteEnum()

IOResult WriteEnum ( const void buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
250 {
251 DbgAssert(nbytes == sizeof(int));
252 return Write((void*)buf, nbytes, nwrit);
253 }
#define DbgAssert(expr)
Definition: assert1.h:83

◆ Write() [1/65]

IOResult Write ( const char *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
256 {
257 DbgAssert(buf == nullptr || strlen(buf) <= nbytes);
258 return Write((void*)buf, nbytes, nwrit);
259 }

◆ Write() [2/65]

IOResult Write ( const wchar_t *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
261 {
262 DbgAssert(buf == nullptr || wcslen(buf) <= nbytes);
263 return Write((void*)buf, nbytes, nwrit);
264 }

◆ Write() [3/65]

IOResult Write ( const int buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
267 {
268 return Write((void*)buf, nbytes, nwrit);
269 }

◆ Write() [4/65]

IOResult Write ( const unsigned int buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
271 {
272 return Write((void*)buf, nbytes, nwrit);
273 }

◆ Write() [5/65]

IOResult Write ( const INT64 *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
275 {
276 return Write((void*)buf, nbytes, nwrit);
277 }

◆ Write() [6/65]

IOResult Write ( const UINT64 *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
279 {
280 return Write((void*)buf, nbytes, nwrit);
281 }

◆ Write() [7/65]

IOResult Write ( const float *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
283 {
284 return Write((void*)buf, nbytes, nwrit);
285 }

◆ Write() [8/65]

IOResult Write ( const double *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
287 {
288 return Write((void*)buf, nbytes, nwrit);
289 }

◆ Write() [9/65]

IOResult Write ( const short *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
291 {
292 return Write((void*)buf, nbytes, nwrit);
293 }

◆ Write() [10/65]

IOResult Write ( const unsigned short *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
295 {
296 return Write((void*)buf, nbytes, nwrit);
297 }

◆ Write() [11/65]

IOResult Write ( const long *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
299 {
300 return Write((void*)buf, nbytes, nwrit);
301 }

◆ Write() [12/65]

IOResult Write ( const unsigned long *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
303 {
304 return Write((void*)buf, nbytes, nwrit);
305 }

◆ Write() [13/65]

IOResult Write ( const BYTE *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
307 {
308 return Write((void*)buf, nbytes, nwrit);
309 }

◆ Write() [14/65]

IOResult Write ( const bool *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
311 {
312 return Write((void*)buf, nbytes, nwrit);
313 }

◆ Write() [15/65]

IOResult Write ( const Point2 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
315 {
316 return Write((void*)buf, nbytes, nwrit);
317 }

◆ Write() [16/65]

IOResult Write ( const Point3 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
319 {
320 return Write((void*)buf, nbytes, nwrit);
321 }

◆ Write() [17/65]

IOResult Write ( const Point4 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
323 {
324 return Write((void*)buf, nbytes, nwrit);
325 }

◆ Write() [18/65]

IOResult Write ( const AColor buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
327 {
328 return Write((void*)buf, nbytes, nwrit);
329 }

◆ Write() [19/65]

IOResult Write ( const Color buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
331 {
332 return Write((void*)buf, nbytes, nwrit);
333 }

◆ Write() [20/65]

IOResult Write ( const Matrix2 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
335 {
336 return Write((void*)buf, nbytes, nwrit);
337 }

◆ Write() [21/65]

IOResult Write ( const Matrix3 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
339 {
340 return Write((void*)buf, nbytes, nwrit);
341 }

◆ Write() [22/65]

IOResult Write ( const Box2 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
343 {
344 return Write((void*)buf, nbytes, nwrit);
345 }

◆ Write() [23/65]

IOResult Write ( const Box3 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
347 {
348 return Write((void*)buf, nbytes, nwrit);
349 }

◆ Write() [24/65]

IOResult Write ( const MNVert buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
351 {
352 return Write((void*)buf, nbytes, nwrit);
353 }

◆ Write() [25/65]

IOResult Write ( const TVPatch buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
355 {
356 return Write((void*)buf, nbytes, nwrit);
357 }

◆ Write() [26/65]

IOResult Write ( const Face buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
359 {
360 return Write((void*)buf, nbytes, nwrit);
361 }

◆ Write() [27/65]

IOResult Write ( const Class_ID buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
363 {
364 return Write((void*)buf, nbytes, nwrit);
365 }

◆ Write() [28/65]

IOResult Write ( const VertMove buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
367 {
368 return Write((void*)buf, nbytes, nwrit);
369 }

◆ Write() [29/65]

IOResult Write ( const FaceCreate buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
371 {
372 return Write((void*)buf, nbytes, nwrit);
373 }

◆ Write() [30/65]

IOResult Write ( const FaceRemap buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
375 {
376 return Write((void*)buf, nbytes, nwrit);
377 }

◆ Write() [31/65]

IOResult Write ( const FaceChange buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
379 {
380 return Write((void*)buf, nbytes, nwrit);
381 }

◆ Write() [32/65]

IOResult Write ( const FaceSmooth buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
383 {
384 return Write((void*)buf, nbytes, nwrit);
385 }

◆ Write() [33/65]

IOResult Write ( const UVVertSet buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
387 {
388 return Write((void*)buf, nbytes, nwrit);
389 }

◆ Write() [34/65]

IOResult Write ( const TVFace buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
391 {
392 return Write((void*)buf, nbytes, nwrit);
393 }

◆ Write() [35/65]

IOResult Write ( const Interval buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
395 {
396 return Write((void*)buf, nbytes, nwrit);
397 }

◆ Write() [36/65]

IOResult Write ( const AngAxis buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
399 {
400 return Write((void*)buf, nbytes, nwrit);
401 }

◆ Write() [37/65]

IOResult Write ( const Quat buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
403 {
404 return Write((void*)buf, nbytes, nwrit);
405 }

◆ Write() [38/65]

IOResult Write ( const Ray buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
407 {
408 return Write((void*)buf, nbytes, nwrit);
409 }

◆ Write() [39/65]

IOResult Write ( const ScaleValue buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
411 {
412 return Write((void*)buf, nbytes, nwrit);
413 }

◆ Write() [40/65]

IOResult Write ( const RotationValue buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
415 {
416 return Write((void*)buf, nbytes, nwrit);
417 }

◆ Write() [41/65]

IOResult Write ( const FBox2 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
419 {
420 return Write((void*)buf, nbytes, nwrit);
421 }

◆ Write() [42/65]

IOResult Write ( const HookPoint buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
423 {
424 return Write((void*)buf, nbytes, nwrit);
425 }

◆ Write() [43/65]

IOResult Write ( const PolyPt buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
427 {
428 return Write((void*)buf, nbytes, nwrit);
429 }

◆ Write() [44/65]

IOResult Write ( const bindShape buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
431 {
432 return Write((void*)buf, nbytes, nwrit);
433 }

◆ Write() [45/65]

IOResult Write ( const EPMapVert *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
435 {
436 return Write((void*)buf, nbytes, nwrit);
437 }

◆ Write() [46/65]

IOResult Write ( const EPMapPatch *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
439 {
440 return Write((void*)buf, nbytes, nwrit);
441 }

◆ Write() [47/65]

IOResult Write ( const EPMapUVVert *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
443 {
444 return Write((void*)buf, nbytes, nwrit);
445 }

◆ Write() [48/65]

IOResult Write ( const RandGenerator buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
447 {
448 return Write((void*)buf, nbytes, nwrit);
449 }

◆ Write() [49/65]

IOResult Write ( const Interface_ID buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
451 {
452 return Write((void*)buf, nbytes, nwrit);
453 }

◆ Write() [50/65]

IOResult Write ( const BlockKeysClass *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
455 {
456 return Write((void*)buf, nbytes, nwrit);
457 }

◆ Write() [51/65]

IOResult Write ( const Color24 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
459 {
460 return Write((void*)buf, nbytes, nwrit);
461 }

◆ Write() [52/65]

IOResult Write ( const Color48 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
463 {
464 return Write((void*)buf, nbytes, nwrit);
465 }

◆ Write() [53/65]

IOResult Write ( const Color64 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
467 {
468 return Write((void*)buf, nbytes, nwrit);
469 }

◆ Write() [54/65]

IOResult Write ( const POINT *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
471 {
472 return Write((void*)buf, nbytes, nwrit);
473 }

◆ Write() [55/65]

IOResult Write ( const WINDOWPLACEMENT *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
475 {
476 return Write((void*)buf, nbytes, nwrit);
477 }

◆ Write() [56/65]

IOResult Write ( const range *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
479 {
480 return Write((void*)buf, nbytes, nwrit);
481 }

◆ Write() [57/65]

IOResult Write ( const MaxSDK::AssetManagement::AssetId buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
483 {
484 return Write((void*)buf, nbytes, nwrit);
485 }

◆ Write() [58/65]

IOResult Write ( const MaxSDK::AssetManagement::AssetType buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
487 {
488 return Write((void*)buf, nbytes, nwrit);
489 }

◆ Write() [59/65]

IOResult Write ( const ParamType2 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
491 {
492 return Write((void*)buf, nbytes, nwrit);
493 }

◆ Write() [60/65]

IOResult Write ( const FloatChange *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
495 {
496 return Write((void*)buf, nbytes, nwrit);
497 }

◆ Write() [61/65]

IOResult Write ( const VertOffset *  buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
499 {
500 return Write((void*)buf, nbytes, nwrit);
501 }

◆ Write() [62/65]

IOResult Write ( const ParticleID buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
503 {
504 return Write((void*)buf, nbytes, nwrit);
505 }

◆ Write() [63/65]

IOResult Write ( const PreciseTimeValue buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
507 {
508 return Write((void*)buf, nbytes, nwrit);
509 }

◆ Write() [64/65]

IOResult Write ( const DeviceRect buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
511 {
512 return Write((void*)buf, nbytes, nwrit);
513 }

◆ Write() [65/65]

IOResult Write ( const IPoint2 buf,
ULONG  nbytes,
ULONG *  nwrit 
)
inline
515 {
516 return Write((void*)buf, nbytes, nwrit);
517 }

◆ WriteWString() [1/2]

virtual IOResult WriteWString ( const char *  str)
pure virtual
Remarks
This method is used to write wide character strings.
Parameters
strThe string to write. The string must be ACP encoded.
Returns
IO_OK - The write was acceptable - no errors.

IO_ERROR - This is returned if an error occurred.

◆ WriteWString() [2/2]

virtual IOResult WriteWString ( const wchar_t *  str)
pure virtual
Remarks
This method is used to write wide character strings.
Parameters
strThe string to write.
Returns
IO_OK - The write was acceptable - no errors.

IO_ERROR - This is returned if an error occurred.

◆ WriteCString() [1/2]

virtual IOResult WriteCString ( const char *  str)
pure virtual
Remarks
This method is used to write single byte character strings.
Parameters
strThe string to write. The string must be ACP encoded.
Returns
IO_OK - The write was acceptable - no errors.

IO_ERROR - This is returned if an error occurred.

◆ WriteCString() [2/2]

virtual IOResult WriteCString ( const wchar_t *  str)
pure virtual
Remarks
This method is used to write single byte character strings.
Parameters
strThe string to write.
Returns
IO_OK - The write was acceptable - no errors.

IO_ERROR - This is returned if an error occurred.

◆ DoingWhat()

virtual FileIOType DoingWhat ( )
pure virtual
Remarks
Determines if we are saving a standard 3ds Max file (.MAX) or a material library (.MAT).
Returns
One of the following values:

IOTYPE_MAX

IOTYPE_MATLIB

◆ SavingVersion()

virtual DWORD SavingVersion ( ) const
inlinevirtual
Remarks
This method returns a value to indicate the current version of the file being saved. It returns 0 for the current version, MAX_RELEASE_R12 for 3ds Max 2010, etc. Call this method to determine the format in which to save the data.
  • Adding a new chunk (unknown to the previous version) should be fine. Plug-ins should be written to skip over unknown chunks.
  • Removing a chunk is not fine. Never delete a chunk id. Plug-ins need to be prepared to save out the data corresponding to the old chunk id when this method returns the version of a previous 3ds Max release.
  • Changing the contents of an existent chunk is not fine, since it can break file compatibility. Add a new chunk to store the modified data structure, and keep the code that loads the old chunk. Be prepared to convert the old data to the new format if that makes sense.
See also
GetSavingVersion(), Version Macros
570 {
571 return 0;
572 }

◆ GetClassDescID()

virtual USHORT GetClassDescID ( ReferenceMaker rm)
inlinevirtual
Remarks
This method is available in release 3.0 and later only.

This method returns a load reference ID for the given Reference Maker's ClassDesc object in the ClassDirectory stream.
Parameters
rmPoints to the reference maker.
Default Implementation:
{ return 0xffff; }
583 {
585 }
#define NO_CLASSDESC_ID_RETURNED
Definition: ioapi.h:175

◆ Execute()

virtual INT_PTR Execute ( int  cmd,
ULONG_PTR  arg1 = 0,
ULONG_PTR  arg2 = 0,
ULONG_PTR  arg3 = 0 
)
inlinevirtual
588 {
589 return 0;
590 }

◆ FileName()

virtual const MCHAR * FileName ( )
inlinevirtual
Remarks
Returns the name of the scene file being saved.
595 {
596 return nullptr;
597 }

◆ SaveAssetMetaData()

virtual IOResult SaveAssetMetaData ( const MaxSDK::AssetManagement::AssetId assetId,
bool  saveAssetResolvedFileName 
)
inlinevirtual
Remarks
This method is used by Asset Manager to save to the scene file the asset meta data.
Parameters
assetIdThe id for the asset.
saveAssetResolvedFileNameWhether to store the asset's resolved filename.
Returns
A return value of IO_ERROR indicates an error occurred, otherwise IO_OK.
605 {
606 return IO_OK;
607 }
@ IO_OK
The result was acceptable - no errors.
Definition: maxtypes.h:195

◆ SaveAssetAsAssetIDGuid()

virtual bool SaveAssetAsAssetIDGuid ( )
inlinevirtual
Remarks
This method is used to tell when to store an asset as a guid rather than as the asset filename.
Returns
A return value of true indicates to store eassets as guids, otherwise as the asset filename.
613 {
614 return false;
615 }

◆ CodePage()

virtual UINT CodePage ( ) const
inlinevirtual
619 {
620 return CP_UTF8;
621 }