Free Script: Content Remover: Help you clean your Content Library.

butaixianranbutaixianran Posts: 161
edited April 2022 in Freebies

Intro
====================
Name: ContentRemover
Version: 0.4
Descr:
Select a product file in Content Library, then this script will Remove the Whole Product From Disk, including all related files and folders in data and runtime folders. So you can clean your Content Library very easily.

 

v0.4: Now it can only remove used texture files, won't remove the whole texture folder. So, it won't remove other product's texture file by mistake.

 

Notice:
* This script will try to avoid any delete operation on Genesis x Base folders and library base folders. But there are some bad and old product files, may link to an official folder I may not know. 
So, even I tested this script again and again, use it at your own risk.


* In a few cases, nothing gonna happen after you running this script. That's because the product you selected has an info.duf file, and its content is not json data, so this script failed to parse it.
Just delete this info.duf file, then run this script again.

 


Tips:
* Run this script from Script IDE Pan will show all the details about which folders are handled.

 


How to use
================
Prepare
-------------
* Copy script to your Daz Lib's script folder
* In Daz Studio, find this script from Content Library, right click it, select: "Create Custom action", click "Accept".
* Now this script can be run from menu->Scripts

* If you don't run this script as Custom Action, after you click this script, your selected file will always be this script.


Use it
---------------
* Select a product file you want to delete from content library.
* Select this script from Menu->Script
* Then this product will be removed with its images, data, uv and morph files.


Download
================

v0.4

---------------

mega:

https://mega.nz/file/875zxAbA#QuNCqY0ex5v-xuUyk8mAiiWU3_-MMFT1x9dB9FAFptA

mediafire:

https://www.mediafire.com/file/7oxt4mipldwv0nl/ContentRemoverV0.4.zip/file

 

 

v0.3
--------------
mega:
https://mega.nz/file/Yn4QnJQZ#p6AiialZglYa57UziNjs2rnzhA5OexHmbC-hDvrlBRw

mediafire:
https://www.mediafire.com/file/qvd7ttx1673jwpp/ContentRemoverV0.3.zip/file

 

Update Log
===============

v0.4

Now it can only remove used texture files, won't remove the whole texture folder. So, it won't remove other product's texture file by mistake.

 

v0.3
Add more morph folders into protected folder list.


v0.2
Added Genesis x Base's detail morph's folder into protected folder list.

 

 

Post edited by butaixianran on

Comments

  • Does the script also clear out database entries? If not it's going to leave a lot of ghost references.

  • It does not clear database. It only read and parse the product files to locate all data files. Well, it is no good for Smart Content, but still good enough for those who only deal with content library.

  • TogireTogire Posts: 414

    This is a very useful script! I do not use smart content, but DIM was absolutely required to be able to remove assets (otherwise it is such a PITA). And creating DIM compliants files for freebies or rendo items in order to be able to remove them is so time consuming...

    So many thanks for your work.

    But  have some questions

    1/ Some artists share files among different assets (for instance the texture of a wall in two different houses). No much indeed, but some do. It seems to me impossible to detect that a file also belong to another asset, but have you found a way to deal with that with a script?

    2/ You say that you do not touch daz official folders. This means that you do not remove these folders, but you can remove something under these folders (otherwise the script would be useless). But there can still be some problems. Assume that you have for instance a char that uses some morphs from another product (e.g. a morph collection, or "julia for antonella 8", or whatever). These morphs will appear in the .duf file, but they belong to another product and must not be removed. How do you deal with that?

    3/ Some products can have totally different kinds of items (a char and a dress/hair/makeup set, or a prop/env and some poses, etc) and they may be totally uncorrelated and located in different part of file hierarchy (for instance in people>...>poses>MyPoses and environments>..>MyEnv). Can you deal with that or are we supposed to apply the script to every subpart of the product?

    Thanks again for this script.

  • frank0314frank0314 Posts: 14,120

    Does the script also work in conjunction with DIM to put those products you just deleted and moves the pack back to "Ready to Install"

  • butaixianranbutaixianran Posts: 161
    edited December 2021

    alainmerigot said:

    This is a very useful script! I do not use smart content, but DIM was absolutely required to be able to remove assets (otherwise it is such a PITA). And creating DIM compliants files for freebies or rendo items in order to be able to remove them is so time consuming...

    So many thanks for your work.

    But  have some questions

    1/ Some artists share files among different assets (for instance the texture of a wall in two different houses). No much indeed, but some do. It seems to me impossible to detect that a file also belong to another asset, but have you found a way to deal with that with a script?

    2/ You say that you do not touch daz official folders. This means that you do not remove these folders, but you can remove something under these folders (otherwise the script would be useless). But there can still be some problems. Assume that you have for instance a char that uses some morphs from another product (e.g. a morph collection, or "julia for antonella 8", or whatever). These morphs will appear in the .duf file, but they belong to another product and must not be removed. How do you deal with that?

    3/ Some products can have totally different kinds of items (a char and a dress/hair/makeup set, or a prop/env and some poses, etc) and they may be totally uncorrelated and located in different part of file hierarchy (for instance in people>...>poses>MyPoses and environments>..>MyEnv). Can you deal with that or are we supposed to apply the script to every subpart of the product?

    Thanks again for this script.

    Well,

    1.  If your selected product links to another product's data folder, then this refered data folder will be removed too. For now, this script can not figure out if the linked data file is acturally from another product.

     

    2. This script protects some base folders in your Content Library, like "/Runtime", "/Runtime/Textures".  Open this script with text editor, you'll find a long list about which folders are protected.

    But it will remove the product sub-folders under those base folders. 

    If your selected product uses a morph from another product, then this linked data folder will be removed too. But, if this morph is Genesis x Base, then it will be protected. Becasue following folders are in protected folder list:

    "/data/DAZ 3D/Genesis 8/Female", "/data/DAZ 3D/Genesis 3/Female"... and so on.

     

    Still, there is a chance your selected product links to a Genesis Base folder not in that list. In that case, you may need to re-install your Genesis x Starter Package. And you can report that folder here, so we can add that folder into protected folder list.

     

    3. This script can not remove them from different categories at once. It only remove your selected product folder and refered data folders.  So, you have to handle each part by yourself.

    If a product is not from Daz shop, then they are just separated folders. There is no way to tell which folders are under same product.

    But that make sense in some cases. For example, you may wanna remove a charactor but keep the hair or clothes.

     

     

    Post edited by butaixianran on
  • frank0314 said:

    Does the script also work in conjunction with DIM to put those products you just deleted and moves the pack back to "Ready to Install"

     No, it can't.  This script don't touch the database, only data files. You better use DIM if you need that information.

  • Updated to v0.2:

    Added Genesis x Base's detail morph's folder into protected folder list.

    Now the long "protected folder" list is even longer.

  • I am aware of at least one PA who reuses the same morphs and/or morphs with the same name that they make - for, it seems, every female character they make. Actually I wish they wouldn't do that because the newest purchase overwrites the older purchases and I have no idea which fingernail morphs, etc. to try to keep when Windows asks for a decision [and DIM doesn't ask just does]. However by the sounds of it, this script would delete these types of morphs too and be breaking then several products. Not a concern to me 'cause I'm not running any deleting scripts but just mentioning this reuse feature.

  • Catherine3678ab said:

    I am aware of at least one PA who reuses the same morphs and/or morphs with the same name that they make - for, it seems, every female character they make. Actually I wish they wouldn't do that because the newest purchase overwrites the older purchases and I have no idea which fingernail morphs, etc. to try to keep when Windows asks for a decision [and DIM doesn't ask just does]. However by the sounds of it, this script would delete these types of morphs too and be breaking then several products. Not a concern to me 'cause I'm not running any deleting scripts but just mentioning this reuse feature.

     

    Well, that means every product from this PA has a copy of this re-used morph. So, you can remove those product you don't use anymore, then re-install the one you still needed.

    Anyway, if this PA's products are in Daz Shop, you can always use IDM.

  • butaixianran said:

    Catherine3678ab said:

    I am aware of at least one PA who reuses the same morphs and/or morphs with the same name that they make - for, it seems, every female character they make. Actually I wish they wouldn't do that because the newest purchase overwrites the older purchases and I have no idea which fingernail morphs, etc. to try to keep when Windows asks for a decision [and DIM doesn't ask just does]. However by the sounds of it, this script would delete these types of morphs too and be breaking then several products. Not a concern to me 'cause I'm not running any deleting scripts but just mentioning this reuse feature.

     

    Well, that means every product from this PA has a copy of this re-used morph. So, you can remove those product you don't use anymore, then re-install the one you still needed.

    Anyway, if this PA's products are in Daz Shop, you can always use IDM.

    Yes they are in the Daz Shop, I don't use DIM to uninstall anything either ;-) And only rarely to install 1 or 2 items that cannot be had any other way. Then, for one of those items, one has to manually go find it and move it to where it should be to get the product working.

    People could also backup some of these types of folders [send to zip works well] - run your script - then put back the morphs they want to keep.

    It is nice to see scripts being made for D/S :-)

Sign In or Register to comment.