Get the "World Position" in "Deformed Space" of a point of the object.



  • Hi,

    I'm trying to access the world position of a point of the object. The command is GetPoint. it woks but not in the deformed space (i.e. the object is in a skin deformer and is moving).

    As such, I need the World Position in Deformed Space. The documentation does not provide any parameters for GetPoint

    You can check the point operator/node in the expresso for comparison here:
    https://www.dropbox.com/s/09z3zmn57m1x96h/c4d080_world_position_deformed_space.JPG?dl=0

    Is there a way around this?

    Thank you for looking at the problem.



  • Hi,

    in the sense of the word, Cinema 4D has no "deformed space". You have objects with caches (basically the polygon representation of the object) and generator and/or modifier/deformer objects, which then add to the cache hierarchy. So in the end, it is a matter of inspecting the cache hierarchy of an object, looking at the cache you are actually interested in (so in your case the Deform Cache created by the Skin Deformer) and getting the point from there.

    GetCache() and GetDeformCache() are the functions to look at. Please node the images and code snippets provided there to get a better understanding.
    Also the C++ SDK documentation has a manual on BaseObject and its cache.

    Cheers,
    Andreas



  • Thanks for the info @a_block
    Just read the documentation and it quickly went pretty complicated.

    Anyhow, this code works for me so far
    op.GetDeformCache().GetPoint().

    Works also with an additional deformer stacked up (i.e. a skin deformer and a bend deformer).



  • Hi,

    I'm glad you found something working for you. I just want to mention, this way of using the deform cache directly will only work for very specific setups, for arbitrary object configurations you will most likely need to iterate through the cache. So, I think, it's worth to give those manuals another read.
    Also Maxime has posted some snippets in Getting a polygonal version of an animated mesh, which might be useful for you.

    Cheers,
    Andreas


Log in to reply