-
Notifications
You must be signed in to change notification settings - Fork 0
Overview
The Daz Max Bridge project is a small collection of plugins/libraries that transfer data between Daz Studio and 3DS Max, using their SDKs.
The plugins are loaded automatically by their hosts. On the Max side, the plugin contains a GUI which can be used to interact with the bridge.
Data is exchanged via named pipes, the plugins find each other automatically.
A diagram showing the flow of data from Daz to Max
Daz Studio allows its functionality to be extended with Daz Scripts, or plugins written in C++ using the Daz Studio 4.5+ SDK.
Daz is written using Qt, a portable and very mature framework to assist in developing applications, specifically the UI. Daz's choice of Qt provides significant benefits to the plugin developer:
- Daz Studios scripting functionality uses QScript - meaning the syntax is familiar and documentation that is applicable to Daz can be found in many other projects.
- Qt provides meta-information about Qt based classes (all of Daz's classes) which can be used at runtime (such as getting lists of methods and properties).
- The above allows functionality available to Daz Script to be used in C++, making all Daz Script examples applicable to native plugins as well.
Daz Plugins come in the form of DLL libraries that export a number of functions which tell Daz various things about the plugin and how it should be presented to the user. The plugin created for this toolset is an Action plugin. This plugin does not really implement a useful action but the Action object is created by Daz on start-up and persists for the lifetime of the application. It is also non-intrusive unless it is designed to be making it an ideal superclass.
When the object is created, it creates a named pipe and registers itself to receive Qt events when the pipe is interacted with. It then remains idle until messages are sent from Max.
To import data into Max, a .NET library has been created to be used by Max. Since Max and MaxScript support the use of reflection, Max can interact with it at a number of levels.
A diagram of the MaxBridge hierarchy
All the importer functionality is contained within this one library.
Only one class in this library presents itself as a plugin. The MaxImporterUtility appears as a utility to Daz when the library is loaded. It instantiates and uses the other objects as required on command of the user. This utility does not do much itself but rather drives the MaxPlugin, where most of the functionality is implemented. It does however run the GUI.
MaxPlugin implements all Max specific functionality involved in creating and updating scene items. It is instantiated by the utility but can also be utilised via MaxScript.
The base MaxBridge loads the scene data and performs pre-processing steps such as triangulation. MaxPlugin is a subclass of this. They have the same responsibility - to process and interpret scene data - only MaxPlugin is responsible for the parts that need Max, MaxBridge for those that don't.
The SceneClient is responsible for abstracting away Daz and the connection to it from MaxBridge and above. It presents an API intended to mimic how the plugin would interact with a local data store, but underneath uses named pipes to find Daz and perform IPC with its counterpart plugin.
Next: Getting Started