Cinema - Material
To create a new Maxwell Material, either use C4D's Material Manager (as with any material), or click the 'Material' item in the plugin's main menu.
Plugin Materials and Maxwell MXM Files
Firstly, it is important to recognize that there is a difference between an MXM file on your hard disk and a Maxwell Material contained in a C4D file – they are not the same thing, though they are very similar. It is necessary for the plugin to have its own 'version' of Maxwell MXM materials, so that it can save them directly inside of C4D documents. If it did not do so, Maxwell materials could only exist as file paths stored in the document which reference MXM files on your disk.
While this is entirely possible to do, and even preferable for some workflows, it means that in addition to a C4D file, you also need to bring along any number of physical MXM files with you when you want to transfer a document from one machine to another. Furthermore, it is prone to error, since directory structures most likely will not match from one machine to the next, and this often results in broken MXM links, and material assignments which do not produce any valid Maxwell material during export.
As such, a Maxwell Material in the Maxwell for Cinema 4D plugin may operate in one of two modes: either linked to an MXM file on your machine, or embedded directly in the C4D document. To control whether a Material behaves as linked or as embedded, use the MXM path and 'Link to' options in the Material's C4D Attribute Manager interface:
When a material is linked to an MXM file, the 'Material Editor' button will be disabled; linked materials must be edited using Maxwell MXED. Similarly, the user-interface shown in the plugin's Material Editor window will be the same as what is found in Cinema's Attribute Manager; this is done for the same reason – any edits made to the linked material would be lost next time the document was opened. To understand why this is the case, continue reading about MXM Linking on the next page.
In order for a Material to use Linked mode, it is necessary that its MXM path points to a valid MXM file. When this is true, and the Linked mode is enabled, the Material's preview will appear (in the Attribute and Material Managers and in Texture Tags) with a green border:
If a Material is set to use Linked mode, but the specified MXM file is not able to be found, it will appear with a red border:Â Â Â Â
If a Material is not set to use Linked mode, no border will appear:
How does MXM Linking work?
MXM Linking is completely optional; that is, the full definition of the Material is always stored (i.e. embedded) in the C4D document. This ensures that no matter where you open a C4D document, it will still be able to be rendered in Maxwell the same as it did the last time it was saved. How it works in practice is this:
A C4D document is opened.
The plugin reads the Materials stored inside.
For each Material which was saved with MXM Linking enabled, the plugin reads its MXM path, and checks whether an MXM file is found at this location (or at any location found in the various search paths).
If the MXM file is found, the Material is immediately updated with the contents of that MXM file. If however, the MXM file is not found, nothing further happens – the definition of the Material which was found in the document will be used at render-time.
Therefore, the MXM Linking feature of the plugin offers the ability to reference central MXM files in individual C4D documents, thereby allowing you to change how Materials in multiple documents render just by editing one MXM file, while simultaneously handling scenarios where a specified MXM file is not found, or where the Material is not set to reference any MXM file at all.
Note that, it is possible to modify a Material using the plugin's Material Editor, regardless if it is linked or not – these changes will not be written back out into any linked MXM file. If you do not wish to lose such changes (i.e. next time the document is opened, the linked MXM will be read again), use the 'Export as MXM' item in the Material Editor's MXM Options menu.