daz3d / DazToMaya

Daz To Maya Bridge
https://www.daz3d.com/daz-to-maya-bridge
Other
32 stars 20 forks source link

Daz To Maya Bridge

A Daz Studio Plugin based on Daz Bridge Library, allowing transfer of Daz Studio characters and props to Maya.

Table of Contents

  1. About the Bridge
  2. Prerequisites
  3. How to Install
  4. How to Use
  5. How to Build
  6. How to Develop
  7. Directory Structure

1. About the Bridge

This is an updated version of the original DazToMaya Bridge that is rewritten in C++ using the Daz Bridge Library as a foundation. This allows it to share the same source code and features with other bridges such as the DazToUnreal and DazToBlender Bridges.

The Daz To maya Bridge consists of two parts: a Daz Studio Plugin which exports assets to Maya and a Maya module to import the assets and help recreate the look of the original Daz Studio asset in Maya.

2. Prerequisites

3. How do I install the Daz To Maya Bridge?

Daz Studio:

Maya:

  1. The Daz Studio Plugin comes embedded with an installer for the Maya Bridge module. From the Daz To Maya Bridge dialog, there is now a section in the Advanced Settings section for Installing the Maya module.
  2. Click the “Install Plugin...” button. You will see a window popup to choose a folder to install the Maya module. The starting folder should be the default location for maya plugins and modules.
  3. On Windows, the path to install modules should be “Documents\maya\modules”. On Mac, the path should be “/Users//Library/Preferences/Autodesk/maya/modules”.
  4. For most Maya setups, you should be able to just click “Select Folder”. You will then see a confirmation dialog stating if the plugin installation was successful.
  5. If Maya is running, you will need to restart for the Daz To Maya Bridge module to load.
  6. In Maya, you should now see a “DazToMaya” tab in the Maya Shelf toolbar. Click this tab to find the DazToMaya options.
  7. If you have tabs disabled in the Maya Shelf, you may need to click the “cog” icon and select “Shelf Tabs” to find and select the “DazToMaya” tab.
  8. From the DazToMaya tab of the Shelf, you should now see an icon for “DAZ IMPORT”. You are done installing Daz To Maya Bridge!
  9. If you recieve an error when trying to click the "DAZ IMPORT" icon, make sure you have PyMEL installed.

4. How do I use the Maya Bridge?

  1. Open your character in Daz Studio.
  2. Make sure any clothing or hair is parented to the main body.
  3. From the main menu, select File -> Send To -> Daz To Maya. Alternatively, you may select File -> Export and then choose "Maya Ascii File" or "Maya Binary File" from the Save as type drop down option.
  4. A dialog will pop up: choose what type of conversion you wish to do, “Static Mesh” (no skeleton), “Skeletal Mesh” (Character or with joints), "Animation", or "Environment" (all meshes in scene).
  5. To enable Morphs or Subdivision levels, click the CheckBox to Enable that option, then click the "Choose Morphs" or "Bake Subdivisions" button to configure your selections.
  6. Click Accept, then wait for a dialog popup to notify you when to switch to Maya.
  7. From Maya, click the “DAZ IMPORT” icon from the DazToMaya toolshelf to open the DazToMaya Bridge dialog window.
  8. Select “Auto-Import”.

Morphs:

Animation:

Subdivision Support:

5. How to Build

Setup and configuration of the build system is done via CMake to generate project files for Windows or Mac. The CMake configuration requires:

(Please note that you MUST use the Qt 4.8.1 build libraries that are built-into the Daz Studio SDK. Using an external Qt library will result in build errors and program instability.)

Download or clone the DazToMaya github repository to your local machine. The Daz Bridge Library is linked as a git submodule to the DazBridge repository. Depending on your git client, you may have to use git submodule init and git submodule update to properly clone the Daz Bridge Library.

The build setup process is designed to be run with CMake gui in an interactive session. After setting up the source code folder and an output folder, the user can click Configure. CMake will stop during the configurtaion process to prompt the user for the following paths:

Once these paths are correctly entered into the CMake gui, the Configure button can be clicked and the configuration process should resume to completion. The project files can then be generated and the project may be opened. Please note that a custom version of Qt 4.8 build tools and libraries are included in the DAZ_SDK_DIR. If another version of Qt is installed in your system and visible to CMake, it will likely cause errors with finding the correct version of Qt supplied in the DAZ_SDK_DIR and cause build errors and failure.

The resulting project files should have “DzBridge-Maya", “DzBridge Static” and "MayaModule ZIP" as project targets. The DLL/DYLIB binary file produced by "DzBridge-Maya" should be a working Daz Studio plugin. The "MayaModule ZIP" project contains the automation scripts which package the Maya Module files into a zip file and prepares it for embedding into the main Daz Studio plugin DLL/DYLIB binary.

6. How to Modify and Develop

The Daz Studio Plugin source code is contained in the DazStudioPlugin folder. The main C++ class entrypoint for the plugin is "DzBlenderAction" (.cpp/.h). The Maya Module source code and resources are available in the /Maya/MAYA_APP_DIR/modules/DazToMaya folder. Daz Studio SDK API and Qt API reference information can be found within the "DAZ Studio SDK Docs" package. On Windows, the main page of this documentation is installed by default to: C:\Users\Public\Documents\My DAZ 3D Library\DAZStudio4.5+ SDK\docs\index.html.

DZ_BRIDGE_NAMESPACE: The DazToMaya Bridge is derived from base classes in the Daz Bridge Library that are within the DZ_BRIDGE_NAMESPACE (see bridge.h). Prior published versions of the official Daz Bridge plugins used custom namespaces to isolate shared class names from each plugin. While this theoretically works to prevent namespace collisions for platforms that adhere to C++ namespaces, it may not hold true for some implementations of Qt and the Qt meta-object programming model, which is heavily used by Daz Studio and the Bridge plugins. Notably, C++ namespaces may not be isolating code on the Mac OS implementation of Qt. With these limitations in mind, I have decided to remove the recommendation to rename the DZ_BRIDGE_NAMESPACE in order to streamline and reduce deployment complexity for potential bridge plugin developers.

In order to link and share C++ classes between this plugin and the Daz Bridge Library, a custom CPP_PLUGIN_DEFINITION() macro is used instead of the standard DZ_PLUGIN_DEFINITION macro and usual .DEF file (see bridge.h). NOTE: Use of the DZ_PLUGIN_DEFINITION macro and DEF file use will disable C++ class export in the Visual Studio compiler.

7. Directory Structure

Within the Maya directory are hierarchies of subdirectories that correspond to locations on the target machine. Portions of the hierarchy are consistent between the supported platforms and should be replicated exactly while others serve as placeholders for locations that vary depending on the platform of the target machine.

Placeholder directory names used in this repository are:

Name Windows macOS
appdir_common The directory containing the primary executable (.exe) for the target application. Sub-hierarchy is common between 32-bit and 64-bit architectures. The directory containing the primary application bundle (.app) for the target application. Sub-hierarchy is common between 32-bit and 64-bit architectures.
MAYA_APP_DIR The directory that represents your personal Maya application directory - see Maya Documentation Same on both platforms.
MAYA_SCRIPT_PATH The search path for MEL scripts - see Maya Documentation Same on both platforms.

The directory structure is as follows: