Workarounds for caching ICE attributes [and sidestepping ICE optimizations]


Because of how ICE is optimized, it won’t bother setting data if you never use that data (see Beware of ICE Optimizations here). For example, suppose I have a point cloud where I set a per-point scalar value, but I never use that scalar data (because I just want to cache that value and use it later).

ICE_Opt_1

That scalar attribute is never used, so it is optimized away (it makes sense: you’re not using it, so why keep it?). You won’t see that attribute in the Cache Manager, and the Cache on File node won’t write it out (even if you add that attribute to the list).

One way to force ICE to evaluate the attribute so you can cache it is to create an Attribute Display property for the attribute, but disable Show Values.
ICE_Opt_AttributeDisplay

Another way is to insert a Log Values node, and disable logging.
ICE_Opt_Log

Yet another way is to use Show Values. Enable Show Values for Tagged Components Only to hide the values (if you’re going to tag components, you could set the Display % to 1).
ICE_Opt_ShowValues

And last but not least, if you have emTools from Mootzoid, you can use the Force Value Evaluation node, which uses a Show Values on a value that is never set.
emToolsForceValueEvaluation

hat tips to Stefano, Mathieu, and Vincent on the SItoA list

Checking what attributes are in a cache


On the Read tab of the Cache Manager there’s a Dump Header button:
CacheManager_DumpHeader

Dump Header dumps the cache header and attribute list to XML and pops up NetView:
DumpHeader_XML

If you want to dump the XML and parse it yourself, you can do it with this scripting command:

Application.DumpCacheHeader("[project path]\\Simulation\\scene_root\\pointcloud\\pointcloud_AnimTake1_[1..100].icecache", False)