Get Deformed Cache Matrix / axis
-
On 06/08/2017 at 15:54, xxxxxxxx wrote:
Hello,
I am trying to figure out how to access the axis, global or local matrix of an object, after deformation, for example after it has been affected by an effector set to deformation: Object mode.
Do effectors create a deformed cache when used in this mode? I seem to get a none type object when I try to access it..
import c4d target = op[c4d.ID_USERDATA,1] def main() : print target DC = target.GetDeformCache() DCM = DC.GetMl() op.SetMl(DCM)
I also tried to get the deformed cache using the recursion functions in a previous thread I posted about getting deformed points: thread
But it again returns a none type object, which makes me question what the effector is doing when set to deform mode?
-
On 07/08/2017 at 10:47, xxxxxxxx wrote:
Hi,
I'm having some difficulties understanding the question. Or rather the situation we are in?
What has this user data parameter to do with the question? It's probably a link, but where is it pointing? An effector (like Random effector), a effected object (i.E. a cube) or something like a MoGraph cloner?
Are we talking about MoGraph effector influencing objects directly (like the effector is grouped with a bunch of cubes) or are about a MoGraph effector influencing clones of a for example MoGraph cloner?
In the first case the relevant cache is part of the effected object(s) themselves. In the later case it's part of the cloner. In any case you will need to traverse the cache as discussed in the other thread you already linked to, as the exact cache hierarchy is different depending for example on the input objects (if they are generators themselves, as for example a cube, or simple polygon objects,...).
And in the MoGraph cloner case, you probably wouldn't even check the caches at all, but instead rather check the MoData.Do you have the option to compile the C++ SDK examples (cinema4dsdk)? The Active Object Dialog example contained in there would be really helpful for you to understand different cache situations.