Convert DUFs from Mesh Grabber to Geometry Sculptor

svenmsvenm Posts: 8

If you have existing DUF scenes that contain Mesh Grabber v3 transforms, and you want to be able to open these DUF files in DAZ Studio v4 or v6 (aka 2005 Alpha) with Premier features enabled (inlcuding the Geometry Sculptor that is the "v4" successor to Mesh Grabber), I've written a tool to perform file conversions to simply change the transforms into Geometry Sculptor transforms. The conversions are quite simple, consisting of these steps:

  1. Enumerate all .duf files in a folder structure (recursively). Only files with .duf extension are considered.
  2. Open and read each file line by line, decompressing if stored/saved in compressed (GZipped) state
  3. Find instances of string "MF_MeshGrabModifier" and replace with "DzGeometrySculptModifier"
  4. Find instances of string "manfriday_mesh_grab_modifier" and replace with "geometry_sculpt_modifier"
  5. Write resulting lines to a new file in a "clone" folder structure that duplicates the original one, compressing if the source file was compressed

Some notes:

  • This is a console utilty written for .NET, compiled and published for PC (Windows) and Mac (OSX). The binaries are self-contained and should include all dependencies, no need to install .NET Framework.
  • The ".pdb" file included in the shared folders is not necessary for running the tool, but I've included it because it contains basic debug symbols and if the app does fail and show an error mesage, I believe the presence of the .pdb alonsgide the binary will allow the error message to be more complete. I haven't tried this, may be wrong about that, so you decide if you want to downloat the .pdb or not.
  • The command syntax is simple, just two parameters: DUF_MeshGrabber_to_GeometrySculptor <sourceFolder> <targetFolder>
    <sourceFolder> is the folder containing the files to be processed. <targetFolder> is a folder under which the source structure will be duplicated and the processed files will be written.
    Enclose paths with spaces in double quotes.
  • There is no elaborate error checking/handling. If one of the paths is wrong, for example you will see an ugly exception message dump and the tool will just stop. If anything unexpected happens during processing, like a file that can't be accessed (locked, permissions), same thing.
  • I took some pains not to load each entire DUF into memory (reading and writing is performed line by line), or to use a lot of string allocations for all the search-and-replace operations. This prevents memory usage that many other search and replace tools don't handle very well with large text files (I've tried several that ran out of working memory while trying to process a large DUF), and although I didn't optimize for performance (no multithreading, etc.), the tool runs acceptably fast
  • Note that although the tool does not touch the source files, under the target folder it will freely create subfolders and overwrite any files that have the same paths/names.
  • During processing, each relative path and filename is output to the console with information about how many replacements were made in the file. If an entry says "0 replacements," that means the text of the file was unchanged. However, you may see that the output file is smaller than the input file, and that's because the GZipping compression level the tool uses is higher than that used by DAZ Studio. The still opens fine in Studio in my experience, though.
  • I've tested this tool on several hundred DUFs, scenes I created (about half of them having existing Mesh Grabber transforms), and have tested (spot-checked) the result files, and I believe it works correctly and reliably, but of course every software developer is initially convinced they made no mistakes and anticipated all permutations :). I make no guarantees, but will try to address any issues if I can understand and fix the root causes.
  • I posted about working on this tool in DAZ Studio Discussion, where I was told that an autoconvert function is expected to be added to DAZ Studio 2025 Alpha in an upcoming release. If that happens, this tool will become obsolete in the context of the new DAZ Studio version. Until then, though, maybe some will find it useful.

The binaries can be found at this OneDrive shared location:

DUF_MeshGrabber_to_GeometrySculptor

Sign In or Register to comment.