Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to remove unused maps

How to remove unused maps

mekene
Enthusiast Enthusiast
60,143 Views
39 Replies
Message 1 of 40

How to remove unused maps

mekene
Enthusiast
Enthusiast

When I check the Asset Tracking of my scene I see many maps that are no longer used.

This was not a problem until I needed to export an archive of the scene : The ZIP is huge because max includes all those maps.

I looked in materials, environment, background, ... but cannot find where they are used.

What is the workflow to fix such issues. Isn't there a way to determine easily where a given map is used in the scene ? I mean for eg : in the asset tracking, Right-Click a map and give an option to display all objects where this map is being used.

 

Thank you.

0 Likes
Accepted solutions (1)
60,144 Views
39 Replies
Replies (39)
Message 21 of 40

Jixal
Enthusiast
Enthusiast

@TB_RIO  try Forensic by Sini software, it's free to use and usually does a great job of removing missing plugins.

 

https://www.sinisoftware.com/Plugins/Forensic

0 Likes
Message 22 of 40

Jixal
Enthusiast
Enthusiast

Btw guys n girls. Apparently, 3DS automatically removes any materials or textures that are not being used in the scene. This means that if you still have shaders or texture appearing in the Asset Tracker or Scene Materials dialogue (located in Slate Editor) then that texture or material is still in use somewhere. 

 

The Asset Tracker should have a way to auto-select an object that it is using...... it would make life a lot easier. However, it doesn't so you have to resort to external means. The option I'm using is the Project Manager plugin. It shows you all the textures in the scene and allows you to click 'select object' and bam! It takes you to the object it's associated with. It also allows you to view the shader in the material editor. 

 

If you then remove the shader off any objects that it's associated with and the textures are still appearing in Asset Tracker. Try pressing the scene "Hold" button to force a reset of the scene. And also manually refresh the Asset Tracker or Project Manager, you should see the textures disappear. 

0 Likes
Message 23 of 40

TB_RIO
Advocate
Advocate

I've cleared out the SME and reset the standard material editor. I use pixamoon's asset trackers for managing scene assets and the only oddity I can see is a couple of maps/materials associated with the UVW unwrap dialogue as mentioned by @Diffus3d  but I can't see how to remove these, I don't think I've even used the UVW unwrap mod so not sure if it is that.


0 Likes
Message 24 of 40

TB_RIO
Advocate
Advocate

Fwiw the scene converter removed other missing plugins (that I no longer use) but it can't do it with the mrmaterialattribs.gup

0 Likes
Message 25 of 40

Diffus3d
Advisor
Advisor

Depending on your max version, you may not be able to remove the mrmaterialattribs.gup if memory serves.   Does it throw an error when you open the scene?  Should be safe to ignore that one.  

0 Likes
Message 26 of 40

TB_RIO
Advocate
Advocate

You can ignore it sure, but it gets pretty annoying with it popping up at each render start and opening the file each time. I'm actually pretty worries it's going to screw me over if I have to render on a farm.

0 Likes
Message 27 of 40

Diffus3d
Advisor
Advisor

Fair point.  I believe that node is related to when Mental Ray was built into 3dsmax.  I remember some threads about trying to remove it, here is an article by Jon Bell that may help you with this particular bad boy.

 

Best Regards,  

0 Likes
Message 28 of 40

twoods
Explorer
Explorer

Okay after a few tries and crashes here is how you do it. It's pretty simple. I'm using 3dsmax 2020, but I'm sure it works on the majority of 3DS versions.

1. Delete and unneeded 3D assets from the scene you want to clean materials out of, save it then rest 3dsmax.
2. Import/Merge everything from this scene into the new scene.
3. Make sure nothing is hidden and select all from the scene.
4. Open the Slate material editor and Get all Scene materials.
5. Save the file.

This removes any unused material references and should now only show the materials connected to the 3D objects in your scene.

 

Message 29 of 40

BenediZ
Collaborator
Collaborator

Thanks.

This is similar to my approach, just to "export selected" the assets whose materials you want to keep.

and then to "import-merge" only them into a new scene.

0 Likes
Message 30 of 40

Anonymous
Not applicable
Thank you! I had removed every single material in my scene and was STILL getting the error. It was driving crazy!
Message 31 of 40

arqrenderz
Enthusiast
Enthusiast

So there is no way to keep working on a project and to clean the unused textures¿? I dont really want to import and merge a big project every time i need to clean a file to send it. please Autodesk give us a solution

0 Likes
Message 32 of 40

michael_grosberg
Advocate
Advocate

you have to copy it from 2020 and it has to have a very specific folder structure. it took me a while to get all the details right but eventually it worked.

0 Likes
Message 33 of 40

michael_grosberg
Advocate
Advocate

There are four places I know of where unused maps might reside:

1. Unused materials in sample slots

2. unused materials in ALL slate editor views/tabs  - some processes create new views without the user's notice

3. maps listed inside UnwrapUVWmodifiers. yes, those count too.

4. background files listed in specific viewports

It should be possible to create a script to clear all of those from a scene in one click. I could do it if I had the time... perhaps I will. 

Message 34 of 40

mekene
Enthusiast
Enthusiast

You are right there is to this day no solution for this, only workarounds.
Some 3D and CAD packages (autocad, sketchup,...) have a built-in Purge function to deal with such issues. 3ds max does not have it. Simple as that.

As long as 3ds max does not have such a function built-in you'll have to live with convoluted workarounds and scripts that only get you halfway there. 

Message 35 of 40

darawork
Advisor
Advisor

It would be helpful if everyone in this thread pressed 'vote' on these Idea items that were marked for 'future consideration' back in 2017: 

https://forums.autodesk.com/t5/3ds-max-ideas/3d-max-heavy-files-purge/idi-p/7049422


https://forums.autodesk.com/t5/3ds-max-ideas/deleting-individual-or-all-unused-materials-no-longer-w...

 

I myself would love to see a purge feature in 3DSMax, inclusive of the ability to purge all missing plug-ins etc.
Gambling scene files with 3rd party scripts from external websites is not a valid option for professional use.

Regards,

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

0 Likes
Message 36 of 40

Anonymous
Not applicable

Keith, How did you remove the un used materials that was gripping onto the unwrap modifiers?

0 Likes
Message 37 of 40

blpjoel
Contributor
Contributor
Same. The only way i have found, it to replace each material with a new one, setting all parameters back to the old one. Really awful to do that. Probably can be coded.... but that does work. Missing MR attributes, it's like they didn't ask a single real world user to troubleshoot the beta before releasing.
0 Likes
Message 38 of 40

obaida_ds
Contributor
Contributor

IF ONLY , there is something global for (SuperClass TextureMap) in the scene Called "SceneMaps" similar to "SceneMaterials"

Contains All Used Maps in the Scene (Objects, Modifiers, Environment, Renderer, ... etc)

Everything in the scene has SuperClass TextureMap should be within this Array ! .

 

0 Likes
Message 39 of 40

luizlaval
Observer
Observer

I've found this code in this post about the same problem.
http://forums.cgsociety.org/t/how-do-you-remove-all-unused-materials-from-the-scene-in-max-2015-by-s...

 

(
with undo off
(
	for j = 1 to 24 do meditmaterials[j] = standard()
	
	for j = scenematerials.count to 1 by -1 do deleteitem scenematerials j
	
	for j = 1 to (sme.getnumviews()) do
	(
		view = sme.getview j
		view.selectall()
		view.deleteselection()
	)
	savenodes #() ""
)
)
It helped me a lot

 

 

0 Likes
Message 40 of 40

laomusic_arts
Advocate
Advocate

Hi!

 

All the "solutions" here point to  3rd party scripts/software, an NONE OF  THEM really works flawless.

 

But don´t worry, the software engineers at Autodesk has it all under controll!
Here is their/mine simple solution:

- open the scene in question, with extras maps/textures

- under the menu File/Archive and point to the folder "archives" under your Project folder

- a Command Line will collect, compress and save all files used in the scene.

- go to your Project folder/sceneassets/images and delete all maps

- unpack all maps back to this location, from the archived file

 

There you have it! Keep it simple.

0 Likes