RenderContentSerializer

References
public abstract class RenderContentSerializer
Used to import and export custom render content such as materials, environments and textures. You must override RenderPlugIn.RenderContentSerializers() and return an array of derived RenderContentSerializer class types to add to the content browsers.

Constructors

RenderContentSerializer

#
Protected constructor to be called from derived class
protected RenderContentSerializer(
fileExtension,
File extension associated with this serialize object
contentKind,
Kind of content created when importing or exporting this file type.
canRead,
If true then the file type can be imported and will be included in the file open box when importing the specified render content kind.
canWrite
If true then the file type can be exported and will be included in the file save box when exporting the specified render content kind.
)

Properties

CanRead

#Since v5.7
If true then the file type can be imported and will be included in the file open box when importing the specified render content kind.
public bool CanRead { get; }

CanWrite

#Since v5.7
If true then the file type can be exported and will be included in the file save box when exporting the specified render content kind.
public bool CanWrite { get; }

ContentKind

#Since v7.0
Kind of content created when importing or exporting this file type - ie, Material, Texture or Environment
public RenderContentKind ContentKind { get; }

ContentType

#Since v5.7
Kind of content created when importing or exporting this file type. Obsolete - use ContentKind
public RenderContentKind ContentType { get; }
obsoleteUse ContentKind

EnglishDescription

#Since v5.7
English string describing this plug-in
public abstract string EnglishDescription { get; }

FileExtension

#Since v5.7
File extension associated with this serialize object
public string FileExtension { get; }

LocalDescription

#Since v5.7
Localized plug-in description
public virtual string LocalDescription { get; }

Methods

CanLoadMultiple

#Since v7.0
If true the plug-in is capable of loading multiple contents.
public virtual bool CanLoadMultiple()

LoadMultiple

#Since v7.0
Create any number of new render contents loaded from any number of files.
public virtual bool LoadMultiple(
doc,
Rhino document
fileNames,
A list of filenames to load from. Each file can contain any number of render contents.
contentKind,
Only used by I/O plug-ins that support multiple kinds. It tells the plug-in which content kind to create. If the plug-in only supports a single content kind, it can ignore this parameter.
flags
A set of flags from the enum above.
)

Read

#Since v5.7
Called to when importing a file, file should be parsed and converted to a valid RenderContent object.
public abstract RenderContent Read(
pathToFile
Full path of the file to load.
)
Returns a valid RenderContent object such as RenderMaterial if the file was successfully parsed otherwise returns null.

RegisterSerializer

#Since v6.0
Register the RenderContentSerializer
public bool RegisterSerializer(
id
Plug-in id
)

ReportContentAndFile

#Since v7.0
This is called from your implementation of LoadMultiple() to add a content and the file it was loaded from when the LoadMultipleFlags.Preload flag is NOT set. See LoadMultiple() for an explanation of this method's use.
public virtual void ReportContentAndFile(
renderContent,
Render content that was loaded from the file.
pathToFile,
Full path of the file that the render content was loaded from.
flags
Flags for future use; should be passed as zero.
)

ReportDeferredContentAndFile

#Since v7.0
This is called from your implementation of LoadMultiple() to add a 'deferred' content and the file it will be loaded from when the LoadMultipleFlags.Preload flag is set. See LoadMultiple() for an explanation of this method's use. \param c is the deferred content. \param wszFullPath is the full path to the file that 'c' will be loaded from. \param flags is reserved for future use; you should pass zero. \param pReserved is reserved for future use; you should pass nullptr. */
public virtual void ReportDeferredContentAndFile(
renderContent,
Deferred render content - represents all contents that will be loaded from the file.
pathToFile,
Full path of the file that render contents will be loaded from.
flags
Flags for future use; should be passed as zero.
)

Write

#Since v5.7
Called to save a custom RenderContent object as an external file.
public abstract bool Write(
pathToFile,
Full path of file to write
renderContent,
Render content to save
previewArgs
Parameters used to generate a preview image which may be embedded in the exported file.
)