I have written the following python script for this, which is attached to each lane seperately:
It looks for the feature and geometry which I would like to give a different color, and then assigns it with the material.
In general it works well, but I’m running into two problems:
After ± 3 parts have been removed and thus their color has changed, all the parts on all the conveyors get that specific color:
But I would like these parts to retain their ‘neutral’ color.As you can see here, when I click one part and go to the modeling tab it selects all the parts:
Somehow they are linked but I would like to only change the parts colors one by one.
The 2nd problem has to do with the experience viewer. When I ‘record’ the simulation and run it with the experience viewer, there are no changes in color shown while these are present in the actual simulation.
Is there a fix for this?
Unfortunately I’m not able to share the file here, but I can make a simplified model if it could help to solve the problem.
Components in VC can share their feature tree which improves the performance of graphics rendering and component copying a lot as clones of even parametric components can use the same geometry mesh objects and such.
In practice this means that for two vcComponents the RootFeature and all its descendants can be the same object. Changing any of those features will then naturally affect both (all) components that share the feature trees.
Certain actions automatically break this sharing, but you can break the sharing using the makeUnique method in vcComponent. Another option is to use the clone method with the sharing parameter set to False.
I think there are some known issues in the vcax animation recording. E.g. using scripting at simulation runtime to make changes in the feature trees and material assignments might not get recorded correctly as they are kind of “deep” in the object model.
You can report these as bugs to VC support, together with minimal example layouts.