THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/02/2007 at 01:01, xxxxxxxx wrote:
Cinema 4D Version: R8.2-R10
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
I'm converting animation on a bone hierarchy to PLA on the root Polygon object. This works.
But if there is a Polygon object parented to a bone somewhere in the hierarchy, it doesn't get proper PLA conversion so that it stays with the root Polygon object - it just sits in its default location (from the initial frame).
AnimateObject() is being called for each Polygon object, then SendModelingCommand(MDATA_CURRENTSTATETOOBJECT,...). The resulting object is then used to set the points of the PLA key at each frame of the animation.
Unsure how this can be rectified.
On 01/02/2007 at 22:46, xxxxxxxx wrote:
Seems that even passing the hierarchy up to but not including the root polygon object doesn't retain the animation. Seems that if the animation on the parented polygon object is solely a side-effect of the bone hierarchy animating it (top-down as compared to the root being deformed), this doesn't work for PLA conversion.
Here's an example for clarification:
Figure Polygon Object
.......Hair Polygon Object
See, the bones are all animated so that the Hair is moving around in space according to the transformations on the bones. The hair is responding to parent transforms. But Current State to Object is not working in this respect. Works for 'stills' at any keyframe but not PLA on the Hair. No idea why this is the case.
On 02/02/2007 at 01:35, xxxxxxxx wrote:
Thanks for posting the hierachy, I will take a lok at it.
Just keep in mind that there are probably still some things to iron out regarding PLA and the new SDK.
So basically you want to bake all your polygon objects to PLA?
On 02/02/2007 at 01:50, xxxxxxxx wrote:
This is general to the involved SDKs (8.2-9.5 so far). Haven't looked at the similar R10 code yet.
Yes, all of the polygon objects need their animation baked to PLA (if the user settings are for that result).
For 'root' Polygon objects - those that aren't parented to anything else with animation - my current method works perfectly to retain the animation as PLA (mainly bones and morphs). And baking all of the polygon objects to a still at any frame works totally.
You'd think that extending the still-at-any-frame methodology would work the same by stepping through the animation (doc->SetTime(), doc->AnimateDocument(), EventAdd() before SendModelingCommand()). Seems that if the Timeline is set to a particular frame by the user and a baked still created, no problems. But stepping through the animation doesn't return the same results for these indirectly animated polygon objects. After some hours of experimenting, I am still at a loss.
Thank you very much!
On 05/02/2007 at 03:38, xxxxxxxx wrote:
Couldn't you simply use the points of the hair polygons multiplied with the matrix for the PLA? As far as I understand it they don't animate, they just follow the head bone?
On 05/02/2007 at 11:00, xxxxxxxx wrote:
That's the thing. How do I construct the matrix from the regular animated data (on the head bone)? I know that I can get the global matrix with GetMg(), but this is a static matrix representation, correct? Or would it be updated during the animation?
On 05/02/2007 at 12:21, xxxxxxxx wrote:
Ah, need to apply the global matrix - from after each AnimateDocument() per frame - of the source object to the points of the CurrentStateToObject object at each frame. The destination object (receiving the PLA animation) needs its global matrix set to a unit matrix afterwards to counteract the PLA animation.
That works perfectly!
Thank you very much,