@ferdinand
I have been playing with your script to walk the cache of different hierarchy scenarios I have built.
I now have a better understanding of what to expect from the GetCache and GetDeformCache.
However, I am still missing one bit of information.
For purpose of explanation, let's assume the main idea is to draw a line from the first point of an object to the first point of the "modified" object.
Where modification is done via a deformer or subdivision surface, or combination of both.
To draw that line I thus need the coordinates of the "original" object, and the coordinates of the modified one.
Scenario1:
+ Sphere (active)
+ Twist
Assume I have a polygon object "Sphere", and a Twist deformer as child.
I can get the deformcache from Sphere, perform a DoRecursion to obtain the deformed polygon object, and access its points.
Scenario2:
+ Subdivision Surface
+ Cube (active)
Here I get the cache of the subdivision surface and perform a DoRecursion to get obtain the "deformed" polygon object. Using the term "deformed object" might be a bit misleading, so let's use "generated object" instead.
In both scenarios I could then draw the line from the original coordinate to the modified coordinate.
Now, let's assume I have an option (checkbox):
- when checkbox on, I want to only draw the line when the object is active (=selected in OM)
- when checkbox off, the line is always drawn, independent of the active state of the object
In both scenarios the BIT_ACTIVE flag is only set on the original object. In both cache as in deformcache the flag is always false.
However, in case of scenario 1, I can perform a GetCacheParent on the obtained modified object, which will give me the original object, from which I can check the BIT_ACTIVE.
In case of scenario 2, performing a GetCacheParent will get me the Subdivision Surface.
How to have a common solution to find out if the original object of a cached object (from GetCache or from GetDeformCache) is active?