Thanks for the reply and the code. I don't fully understand what is happening. It is still doing the odd thing of sometimes working and sometimes not.
In your file you make an object and then build the cache yourself. But what happens if I have a scene already, and am not creating the stuff?
I have this file as a simplified test: https://www.dropbox.com/s/yafk8a0syry52sc/test_0001.c4d?dl=0
And I am running this code(Make sure to select the cube before running it):
from c4d import gui
# Welcome to the world of Python
# Script state in the menu or the command palette
# Return True or c4d.CMD_ENABLED to enable, False or 0 to disable
# Alternatively return c4d.CMD_ENABLED|c4d.CMD_VALUE to enable and check/mark
# return True
# Main function
"""Builds the caches for a node and returns a clone that contains the caches.
op (c4d.BaseObject): The node to build the caches for.
c4d.BaseObject: The clone with the caches.
# Nodes must not be attached to more than one document, so we
# need to clone our node first.
clone = op.GetClone(c4d.COPYFLAGS_NONE)
# Create a temporary document and execute the cache pass with
# our clone attached to the temporary document.
doc = c4d.documents.BaseDocument()
doc.ExecutePasses(bt=None, animation=False, expressions=False,
# Remove the clone and return it.
origPoints=[x.z for x in obj.GetAllPoints()]
deformedPoints=[x.z for x in clone.GetAllPoints()]
deltas=[abs(x-origPoints[id]) for id, x in enumerate(deformedPoints)]
# Execute main()
But it is still not working. It basically prints the same sets of points which results in a zero delta. I'm sorry if I am being dense I just don't fully understand what's happening with the caches and when they happen and when I need to fire new ones etc. Long term, this script would be cycling through 12 or so controllers(ie, move 1 unit, get the deformed cache, reset back to 0, reset the cache, repeat per controller), so I want to just get an understanding of what's happening and how to set things properly.