Editing a .duf file
ondanfifal
Posts: 3
I'm trying to edit one of the .duf files for the skinchangers cause I want to edit fur and skin tones but I can't figure out how to open it in another program so I can adjust things.
Is there a certain way of doing it. Cause I want to really change it and the choosing a surface and trying to colour isn't accurate enough since I want to make the hand and forearm one colour but the upper arms a different colour.
Comments
Hi Ondanfifal
You can edit .duf files in a text editor such as wordpad. Right click on the file, open with, then choose wordpad (but don't click on use this program to open all the time)
As Bryan Steagall said, you can edit it with a simple text editor. If you save the file as compressed, then you need to uncompress it firts with an unzip program (winzip, winrar, 7unzip, etc.)
Oh, and you do not need to re-zip it when you are done. Leaving it as a simple text file, with the same .duf extention will work just fine.
I'm not sure what you mean - if the Surface pane settings aren't working then editing the .duf file won't work. If you are wanting to make a change to part of a surface only then you can, for a hard-edge, use the Geometry Editor tool to create a new surface and adjust its settings or, if the boundary doesn't match existing edges or if you want a smooth transition, you can edit the textures (which are imaeg files, usually .jpgs, which you can locate through the Surfaces pane) and then create a new material in the Surfaces pane to use those (saving as a new preset).
Good to hear that the file doesn't need to be rezipped to work, but if I do want to, what extension should the text version have? Also .DUF?
Yes, the extension is the same regardless of compression.
Richard Haseltine Is this still applicable? Doesn't work for me.
EDIT: Noticed daz saves compressed DUF files, Hopefully there's a way to change that.
You can uncompress them using an archive tool, such as 7Zip, or the batch Convert pane in DS.
It doesn't seem to apply to saving scenes, but for everything else, look carefully at the file save dialogs — there will be a tickbox at the bottom to select whether or not to compress the file. I'm fairly sure it's persistent; once you tick or untick the box, it stays that way for other file saves until you change it.
SpottedKitty Yeah, there's no tickbox for saving the scenes uncompressed. And no, the tickbox doesn't stay the same for me when I try to save other types (presets or morphs).
Richard Haseltine I see, never knew that. What compression methods does daz uses though? In case I wanted to compress it back up using 7zip, in case I manually wanted to compress it back? The alternative way would be to open the compressed file, removing the file inside and then putting the new file back in it. Other than that, I see no other way around.Also, why not create a checkbox for saving the scenes too?
EDIT: A'right, I got one question though aside from all that above. How can I force the modifier library (I'll refer it to as MDL from here on) to be saved within the duf files? I can remove the properties I don't need through that easily. Which means, I only need daz to force save the MDL. I noticed that it would save it if I deleted some properties tied to those MDLs. For instance, if I removed the Navel Depth property, which 5 other body morphs use, but my scene is only using 2 of them, it would save all of them minus the Navel Depth property from them all, in the MDL.
I don't know why there isn't an option to save scenes as plain text, I would use it if there was since scenes can, very occasionally, end up with a corrupt archive (which is as likely as not an issue with the hardware or OS, but does result in loss of the file beyond a certain point). You can compress with the Batch Convert pane, and I beleive DS uses GZ - see http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/gzfile_dz in the scripting documentation.
I'm not sure what you are asking on the "MDL" (which I would avoid as an initialism - MDL is the Material Definition Language used for Iray). If you are wanting to force the embedding of assets such as morphs and geometry that isn't suported, one of the purposes of .duf files is to provide a safe way to share scenes (and settings) made from assets from a variety of soruces without infringing on the makers' rights, so external assets are saved only as references.
Richard Haseltine I see. Not sure why there isn't an option for it either. Yeah, it definitely is using the gzip format. What compression settings you use for it does not matter as Daz uncompresses the file before loading itself too. As long it's formatted with gzip format Daz will load it up (had to rename the file extension to duf once again)
Regarding the MDL, I did say I was referring to the modifier library inside the duf files. And, I think I did mean the second part only. If that's what the old *.dsf format used to do. I can imagine why it's not supported, but I had this one issue with the dials not being locked. (see here: https://www.daz3d.com/forums/discussion/409491/keeping-locked-dials-intact)
My point was, to fix that up above, I could delete the ERC freezing for the particular dials I want. But that's a little cumbersome. I can do it better and easily if i could access those things from a text editor. Let's say, I could delete that data directly from the morph but that would mean a permanent change, to those morphs unless I keep a backup. Daz may not allow saving it in *.dsf format anymore, but I noticed, once you delete a property (dial) controlled by some other dial (the actual, parent morph), daz wrote all the data present inside the morph to the duf file, while keeping the deleted data/dial out of it. So, I just thought there was a way to enable or force Daz to do that from the start, without having to remove any dials or so. I guess, I can imagine why the devs don't want to, but if they don't give better control within daz itself, I don't see any other options at all. It does kill a lot of expectations of mine at least.
You sahould be able to turn off ERC links by clicking the chain icon on the slider, but it's all or nothing for a given property. I've rarely used it and can't recall if it saves, though I'd expect so. You can also manually set a 0 value for the controlled proeprties, which is OK for stills but not for animations.
One thing to bear in mind, though it may be resolved by now, is that there have been issues with embedded morphs (anythign that isn't saved as an asset) correctly projecting into fitted items after a save and reload, so your approach might not work over all even if you could persuade the morphs to embed.
I wasn't aware of that, but once the scene is cleaned out it can be saved as an asset, or not? That is what I am trying to do.
There wouldn't be any point in saving that as an asset, it's just different settings for an existing asset.
I was wrong to say there isn't a way to save an uncompressed scene, Rob has a sample script to do that here http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/save_duf_scene/start - it will, as written, save uncompressed so you can place the script in one of your content directories, right-click>Create Custom Action, and place that action where you want tool bar and/or menu (using Window>Workspace>Customise) to use for saving scenes instead of using the built-in command.
An Old topic i know but i have a question
I unzipped the file i changed the max time for rendering.
then i rezipped the file and tried to open it:
2021-08-01 20:06:12.470 H:/Directory/file.duf (1,1): Syntax error - expected '{' or '['
2021-08-01 20:06:12.470 Error reading file, see log for more details.
2021-08-01 20:10:57.234 *** Scene Cleared ***
I only changed the number of the render time.
How do i rezip them or do i just add .duf at the unzipped file?
Use the internal Batch Convert tab to compress/uncompress .duf files. No need to worry about which compression format to use.
Or you can use the combination of 7-Zip and Notepad++
First set Notepad++ as the "Editor" in 7-Zip
Open the file in 7-Zip with "Open Archive" and inside 7-Zip choose "Edit"
The file will open in Notepad++ as uncompressed
Do the changes you want and choose "Save", close the file in Notepad++ and close Notepad++ and 7-Zip will ask you, "File 'xxxx' was modified. Do you want to update it in the archive?", choose ok and close 7-Zip.
If 7-Zip gives you an error that it cannot open the file as an archive, the file isn't compressed and you can open it straight to Notepad++
Thanks i will try this method. Its way faster then opening 15 files just to change the render time.
Batch Convert just compresses/uncompresses files or entire folders at a time. You don't have to open the files in Studio to change parameters, just edit the uncompressed .duf files in your text editor of choice, then re-compress back in Studio if you want. That sounds faster to me.