"Purge Unused" command purge problem

Hi,

the “purge unused” command, purges the materials that compose the Override material applied to objects.

Is it a bug?

Sketchup PRO 21.0.339 + VRay for Sketchup 5.00.03

Hi DCHA34,

This is unfortunately the expected behavior.
SketchUp’s purge knows nothing about V-Ray and the way your V-Ray shaders are set up.
When it finds a material not applied to a scene object it deletes it right away, ignoring the fact that this material might be referenced by another one.

That is why I’d recommend you use the V-Ray Purge instead.
It’ll respect all the V-Ray material connections and should give you the result you’re after:

Hope that helps,
Konstantin

Hi,

thank you for this explanation.

It is still very regrettable and dangerous. We can lose hours of work with this mechanism.
This means that from the moment I use an Override material, I can no longer use the “purge unused” command to purge my Sketchup model.

A solution should be found!

Hi,
I dig up this topic to point out that the “purge unused” command also deletes the materials assigned to .vrmesh

I just lost the morning to redo my scene because I lost all the material assignments on all my .vrmesh

I hope this is a bug and not the expected behavior as explained before.
If this is the expected behavior, I don’t see the point of using the wonderful features of V-Ray if they are going to be wiped out by a Sketchup command.

I think a warning should be put in place when executing the “purge unused” command. See with Trimble.
​

I’ll give you a solution, when you’re done with your scene, hit get material samples, then clean up without losing unused materials.xxx.rb into the plugin folder, restart SU.
get materials.rar (799 Bytes)

Hi @DCHA34 ​,

I dig up this topic to point out that the “purge unused” command also deletes the materials assigned to .vrmesh
This should not be happening if you assign the proxy mesh materials using the built-in material slots instead of a Multi Material.

I hope this is a bug and not the expected behavior as explained before.
If this is the expected behavior, I don’t see the point of using the wonderful features of V-Ray if they are going to be wiped out by a Sketchup command.​
As I mentioned before, SketchUp doesn’t give us any way to ‘protect’ sub-materials and avoid their purging.
The only workaround that I suspect is used by @wzfwzfwzf ​ and his script is to assign each sub-material to a peace of geometry or an edge.
This is something that we can also start doing as a workaround but is not ‘fool-proof’. One can always locate the auto-generated edges that are used to store the materials and delete them…

Konstantin

Hi Konstantin,

This should not be happening if you assign the proxy mesh materials using the built-in material slots instead of a Multi Material.

Here is an illustrated example of the problem I was talking about.

Before purge :

After purge :