a script to batch find missing files and create a directory

a batch script to find missing files and create a directory 

using a duf scene, prop, etc file be it one you created then moved stuff or one another has.

we need this badly

D3D or Draagonstorm could have eventually created it I am positive but sadly it is up to someone new as DAZ studio cannot even find a file in the first folder it opens for you to look for it.

one can put the missing file name in the search box too and find it often but one has to manually do this every missing file every scene you open.

it this could be automated by some utility loading all the duf's in question then it runs some sort of daemon thingy searching all your drives for matches before finally listing the results to affirm or discard to place in a matching folder directory  it would help tremendously.

Comments

  • WendyLuvsCatzWendyLuvsCatz Posts: 37,814

    and or edit the duf scenes to lhave the correct paths

  • If you load your content, find the missing files, and save then unless there's an issue with the way your system is set up that should be it. Nested content directories (one inside another) can cause issues.

  • WendyLuvsCatzWendyLuvsCatz Posts: 37,814

    If you load your content, find the missing files, and save then unless there's an issue with the way your system is set up that should be it. Nested content directories (one inside another) can cause issues.

    yes know this but it is more an issue of very many scenes saved using textures all over the place on a drive no longer used and all the referenced textures now belatedly placed in a bespoke created folder in runtime textures

  • Well, you certainly could write a script - use DzGZFile to open the scene and read it in as a single string, then JSON.parse( string ) to make it into a data object, then (the tricky bit) find the texture references and correct them, then JSON.stringify( object ) to convert the corrected object back into a string, and write that to a new file (so you have a back up of the original).

  • WendyLuvsCatzWendyLuvsCatz Posts: 37,814

    Well, you certainly could write a script - use DzGZFile to open the scene and read it in as a single string, then JSON.parse( string ) to make it into a data object, then (the tricky bit) find the texture references and correct them, then JSON.stringify( object ) to convert the corrected object back into a string, and write that to a new file (so you have a back up of the original).

    me? nah, why I put it in product suggestions blush

  • Syrus_DanteSyrus_Dante Posts: 983
    edited June 2018

    If it is just for some old scene file you now load and you want the textures back I have an idea to fix this.

    It it's not already you could save the scene file uncompressed (you can also uncompress a duf file outside of DS - just add the .zip extention at the end of the filename and unpack the duf inside). Then open the duf in a text editor with a search and replace function to fix the texture path refereces manualy. At least thats what I once did with a figure/props duf files but I guess you can also find texture references in scene files.

    With the text editor and knowing where the textures went to you could identify the wrong paths and replace them with the new ones. But I think its easier to have the textures saved somewhere in a propperly mapped Content Directory in DazStudio. You could copy the texutes in use to [SomeLibrary]/Runtime/Textures/... and repalce the paths in the scene file with the new location to have the references corrected.

     

    If I get the missing texture message I press the Locate button and the file open dialouge pops up with the file name to search for already filled in at the bottom text box. What I do is I copy the filename, then I select one of my main Library paths /Runtime/Textures/ where I think the texture is stored in and I paste the filemane in the top right search box to let the explorer find my texture. You can double click the serch result to have the texture loaded.

    The script suggestion still is a good idea but searching everywhere at all hard drives could take ages in some cases with a few terabyte. It would be great to have some options to narrow down the places to search for texture files maybe to Content Directories known by DS or custom paths that you tell the script before it starts to search.

    Post edited by Syrus_Dante on
  • WendyLuvsCatzWendyLuvsCatz Posts: 37,814

    well yes I can do that and I use Everything to find my files, was just thinking this could be an issue many have changing drives, moving stuff etc, certainly see enough forum posts on it, so an easier way to batch create new links to a known chosen texture folder for missing files or at least tell DS to always check that folder first would be extremely useful

  • jestmartjestmart Posts: 4,449

    It is not a issue if you make sure your images are in a mapped folder for Studio and you are consistant with the folder structure, i.e. Runtime/Textures/[My Projects]/[Specific Project Name]/[images].

  • WendyLuvsCatzWendyLuvsCatz Posts: 37,814
    jestmart said:

    It is not a issue if you make sure your images are in a mapped folder for Studio and you are consistant with the folder structure, i.e. Runtime/Textures/[My Projects]/[Specific Project Name]/[images].

    it was

    originally on the old drive

  • Syrus_DanteSyrus_Dante Posts: 983

    The most anoing thing in DS with missing textures is, it ask you about the same texture file over and over agian for every surface it is used on. At least thats what happened to me once - I dont know if the most recent version still behaves the same.

    Would be nice if DS is more intelligent by loading texture files and remembers the once choosen corrected texture path and look if the other missing texture files are in the same location.

    But it looks like DS dosn't search anything, it just pops up a ignore or locate option dialouge everytime a texture file could not been located in the reference given in the scene file for every surface.

    The only advantage is you don't have to wait all day long to have DS search for missing texture while loading the scene file, that could in worst case lead to the result of no missing textures found. Because its also possible the textures got deleted or the filenames got renamed, in this case a file search while loading the scene is useless and only takes more time.

  • Griffin AvidGriffin Avid Posts: 3,757

    Would be nice if DS is more intelligent by loading texture files and remembers the once choosen corrected texture path and look if the other missing texture files are in the same location.

    iTunes does that and most Adobe products. It'd be nice if it could search on its own and maybe you pick a drive letter or major folder and it does its own search function.

    I'd like it to ask "Would you like Daz Studio to find this file on its own? (warning: this process may take a while depending on number of directories and locations indexed. Your machine may not respond as expected during intense search oeprations.)"

Sign In or Register to comment.