XGen support in 3Delight for Maya is done using a procedural plugin derived from the code published by Autodesk. Many thanks to J Cube Inc. for their contribution.
Requirements
This plugin requires 3Delight Studio Pro 11.0.157 or newer. 3Delight for Maya 7.0.61 or newer can also be used. The AbcExport plug-in that comes with Maya is also used by XGen for its file export operation; it will be automatically loaded by 3Delight for Maya upon rendering a scene with XGen primitives.
Creating and Rendering XGen objects
Spline, Groomable Spline, Card, and Sphere Primitive
- Select the polygon mesh or NURBS primitive that will receive the XGen primitives.
- In the XGen shelf, click the Open the XGen Window button. This displays a wizard that will guide you to set up the XGen collection and description nodes.
- Select the desired primitive type when prompted by the wizard.
- You can assign any shader to the XGen primitives. Just select the XGen description shape and assign it an Hypershade material or RenderMan shader, or click one of the 3Delight materials buttons in the 3Delight shelf.
- Render the scene as usual with 3Delight. The required XGen files are automatically exported, and the scene is rendered.
Archive Primitive
Using any user-defined objects as XGen primitive is a two-step process. The XGen archive must first be created, while 3Delight is set as the XGen renderer. The resulting archive can be used in another scene's XGen description.
Maya 2015 / 2015 Extension Bug
There appears to be a bug in the XGen archiving Python script involving object instances. A fixed xgmArchiveExport.py
file is available here. Keep a copy of the original file and use the fixed file as a replacement for it. The file belongs in the following folder:
Operating System | Path |
---|---|
OS X |
|
Windows | C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\xmaya\ |
Linux | /usr/autodesk/maya2015-x64/plug-ins/xgen/scripts/xgenm/xmaya/ |
This bug has been fixed in Maya 2016, so please do not install the modified xgmArchiveExport.py
mentioned above on Maya 2016 and more recent.
Creating the XGen Archive
- In the XGen Window, go in the Preview / Output tab. In the Output Settings group, make sure that Renderer is set to '3Delight'. You might need to create a XGen description in order to access this setting.
- Make sure the scene is saved.
- Select the objects you want to archive.
- Select the XGen → Export Selection as Archives... menu item (from the main application menu).
- Adjust the export settings and click Export. Note: if nothing seems to happen, try again.
- You should see a Progress Window appear that goes up to 100%.
- The resulting files are a "
.xarc
" file, some ".abc
" files in a subfolder, and some ".rib
" files in another subfolder.
Using the XGen archive as a primitive
- Select the polygon mesh or NURBS object that will receive the XGen description.
- Click the Open the XGen Window shelf button. Follow the wizard to create a new description, choosing Custom Geometry / Archive as the primitive type when asked.
- In the XGen window, select the Primitive tab.
- In the Primitive Attributes group, lower Density to something very low, like 0.02. This is simply to relieve the viewport's initial display.
- In the Archive Files group, click the Add button.
- Choose the .xarc file you exported above.
- You will be prompted to choose if the archive's materials should be imported in the scene. This allows the materials to be edited in the scene; the edits are applied on the archived objects without requiring another archive export. This will be supported in the future but right now it is not supported.
- You should see your archived objects instantiated by XGen in the viewport.
- In the Archive Files group, click the Auto Set button next to the Size slider.
- Change the Density again to trigger a refresh.
- Render the scene with 3Delight.
Rendering a RIB containing XGen primitives with renderdl
For rendering a RIB file containing a XGen object with renderdl, you will need to add the path to the XGen libraries that come with Maya to the PATH
(windows), LD_LIBRARY_PATH
(linux) or DYLD_LIBRARY_PATH
(OS X) environment variable. The XGen objects are procedurally generated during rendering, and this operation uses the XGen libraries.
Operating System | Environment Variable | Environment Variable Example Value |
---|---|---|
OS X | DYLD_LIBRARY_PATH | ${DYLD_LIBRARY_PATH}:/Applications/Autodesk/maya2015/Maya.app/Contents/MacOS:/Applications/Autodesk/maya2015/plug-ins/xgen/lib |
Linux | LD_LIBRARY_PATH | ${LD_LIBRARY_PATH}:/usr/autodesk/maya2015-x64//plug-ins/xgen/lib:/usr/autodesk/maya2015-x64/lib; |
Windows | PATH | C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\bin;C:\Program Files\Autodesk\Maya2015\bin |