Save Animation for Melange



  • On 29/06/2015 at 11:03, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R15 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Why am I getting keyframes for static objects when I use the "Save Animation for Melange" option?
    Is there a "correct" way of ignoring them somehow? Currently I'm ignoring these keyframes by comparing them all with each other, and if they are all the same, I ignore them.



  • On 29/06/2015 at 20:09, xxxxxxxx wrote:

    Well... my option of comparing all keyframes to see if they share transformation values is not an option anymore, as sometimes, the rotation isn't exactly the same, having keyframe values like -3.14159274 and -9.42477798, which at the end, result in the same final transform, but interpolating them, the model rotates a full 360 degrees...



  • On 30/06/2015 at 08:38, xxxxxxxx wrote:

    Hello,

    could you please provide some more information? What exactly do you mean with "static objects"? Objects that are not animated in Cinema 4D? How do you get keyframes? What version of Melange do you use?

    Best wishes,
    Sebastian



  • On 30/06/2015 at 08:44, xxxxxxxx wrote:

    I'm using version @98733.
    Yes, I consider static objects as objects with no keyframes in Cinema.

    To get the keyframes I call GetFirstCTrack(), then GetCurve(), and loop through all the keys and their PSEUDO_VALUEs.

    EDIT:
    I just updated my code to the latest melange lib (huge change), but same is happening.
    I have a few models that I'm using as test cases, and I just found a few inconsistencies. I mean inconsistencies because I can't see a pattern in how scenes are being saved when using the "Save Animation for Melange" option.

    Just think about this simple case I'm dealing with:
    why am I getting different global and local matrices when I have the "Save animation to melange" option enable and when I don't?

    This behavior got me thinking... probably, if I apply the transformations I'm getting from the keyframes I end up with the correct final transform. And I was right, except that I wasn't. Sometimes it works sometimes it doesn't.

    At this point, my only option seems to be to ask the user to disable the option in Cinema4D when he doesn't want an animated object, and enable it when he want's anything animated.

    I can send you a few example files if you want.



  • On 01/07/2015 at 06:28, xxxxxxxx wrote:

    Hello,

    using Melage 15 I cannot reproduce the described behavior. Please post some code (your AlienPrimitiveObjectData class) to show what exactly you are doing. You can send a simple scene to sdk_support@maxon.net

    best wishes,
    Sebastian



  • On 01/07/2015 at 07:21, xxxxxxxx wrote:

    Hello,

    There's no need to post any code, you can just use the command line example included in the SDK.
    Here's the output of the same model with the option on and with the option off:

    ON:

     - AlienPolygonObjectData (5100) : Sphere_head
       - UniqueID (16 Byte) : 6e71d954494c0f0751ee820af1450000 [AppID: 200000219]
       - PointCount: 4418 PolygonCount: 4416
       - Matrix:     -0.088561      0.000000      0.976994
               :      0.000000      0.981000      0.000000
               :     -0.976994      0.000000     -0.088561
               :   -335.668694    -37.435260      8.477328
         P 0: -3.1 / -142.0 / -0.2
         P 1: -2.8 / 109.3 / -0.3
         P 2: 28.9 / -133.7 / -0.4
         P 3: 28.0 / -132.3 / 6.4
       - Phong Tag "" - Phong Angle = 79.999998
       - UVW Tag "UVW"
         Poly 0: 0.00 0.83 0.00 / 0.01 0.83 0.00 / 0.01 0.85 0.00 / 0.00 0.85 0.00
         Poly 1: 0.01 0.83 0.00 / 0.02 0.83 0.00 / 0.02 0.85 0.00 / 0.01 0.85 0.00
         Poly 2: 0.00 0.85 0.00 / 0.01 0.85 0.00 / 0.01 0.87 0.00 / 0.00 0.88 0.00
         Poly 3: 0.01 0.85 0.00 / 0.02 0.85 0.00 / 0.02 0.87 0.00 / 0.01 0.87 0.00
      
       - Polygon Tag (hidden) ""
       - Point Tag (hidden) ""
       - Texture Tag "Texture" - material: "Mat.18" (0/83/255) - no shader
      
       # Animation Info #
       1. CTrack "Position . X"!
       DescID->DescLevel->ID: 903
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - -0.191085
        2. Key : 0 - -0.191085
        3. Key : 1 - -0.191085
        4. Key : 2 - -0.191085
      
       2. CTrack "Position . Y"!
       DescID->DescLevel->ID: 903
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 20.877254
        2. Key : 0 - 20.877254
        3. Key : 1 - 20.877254
        4. Key : 2 - 20.877254
      
       3. CTrack "Position . Z"!
       DescID->DescLevel->ID: 903
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 26.434568
        2. Key : 0 - 26.434568
        3. Key : 1 - 26.434568
        4. Key : 2 - 26.434568
      
       4. CTrack "Scale . X"!
       DescID->DescLevel->ID: 905
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 1.000000
        2. Key : 0 - 1.000000
        3. Key : 1 - 1.000000
        4. Key : 2 - 1.000000
      
       5. CTrack "Scale . Y"!
       DescID->DescLevel->ID: 905
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 1.000000
        2. Key : 0 - 1.000000
        3. Key : 1 - 1.000000
        4. Key : 2 - 1.000000
      
       6. CTrack "Scale . Z"!
       DescID->DescLevel->ID: 905
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 1.000000
        2. Key : 0 - 1.000000
        3. Key : 1 - 1.000000
        4. Key : 2 - 1.000000
      
       7. CTrack "Rotation . H"!
       DescID->DescLevel->ID: 904
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 0.000000
        2. Key : 0 - 0.000000
        3. Key : 1 - 0.000000
        4. Key : 2 - 0.000000
      
       8. CTrack "Rotation . P"!
       DescID->DescLevel->ID: 904
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 0.000000
        2. Key : 0 - 0.000000
        3. Key : 1 - 0.000000
        4. Key : 2 - 0.000000
      
       9. CTrack "Rotation . B"!
       DescID->DescLevel->ID: 904
       VALUE - Track found!
       Has CCurve with 4 Keys
        1. Key : 0 - 0.000000
        2. Key : 0 - 0.000000
        3. Key : 1 - 0.000000
        4. Key : 2 - 0.000000
    

    OFF:

     - AlienPolygonObjectData (5100) : Sphere_head
       - UniqueID (16 Byte) : 6e71d954494c0f07f302680ae42a0000 [AppID: 200000219]
       - PointCount: 4418 PolygonCount: 4416
       - Matrix:     -0.046583      0.000000      0.513893
               :      0.000000      0.516000      0.000000
               :     -0.513893      0.000000     -0.046583
               :   -316.465045    203.838294     10.499159
         P 0: -3.1 / -142.0 / -0.2
         P 1: -2.8 / 109.3 / -0.3
         P 2: 28.9 / -133.7 / -0.4
         P 3: 28.0 / -132.3 / 6.4
       - Unknown Type "sds_tag_data"
       - Phong Tag "" - Phong Angle = 79.999998
       - UVW Tag "UVW"
         Poly 0: 0.00 0.83 0.00 / 0.01 0.83 0.00 / 0.01 0.85 0.00 / 0.00 0.85 0.00
         Poly 1: 0.01 0.83 0.00 / 0.02 0.83 0.00 / 0.02 0.85 0.00 / 0.01 0.85 0.00
         Poly 2: 0.00 0.85 0.00 / 0.01 0.85 0.00 / 0.01 0.87 0.00 / 0.00 0.88 0.00
         Poly 3: 0.01 0.85 0.00 / 0.02 0.85 0.00 / 0.02 0.87 0.00 / 0.01 0.87 0.00
      
       - Polygon Tag (hidden) ""
       - Point Tag (hidden) ""
       - Texture Tag "Texture" - material: "Mat.18" (0/83/255) - no shader
    

    As you can see, the matrix is different. I admit, as I said, that applying the transformations from the keyframes we could end up with the same final transform, but it seems that's not always the case. Also, I think if there are no keyframes in my scene when I save it to a C4D file, they shouldn't be any keyframes there when I load the scene using Melange SDK.

    here are the files I used in this example:
    https://www.dropbox.com/s/ssmtpws8s6moh5o/Melange_test_case.zip?dl=0



  • On 02/07/2015 at 06:00, xxxxxxxx wrote:

    Hello,

    thanks for the scene, I can now reproduce the issue. There seem to be some bugs in this area and I will have to wait for more feedback from the developers on this (see also your other thread).

    Best wishes,
    Sebastian



  • On 02/07/2015 at 07:16, xxxxxxxx wrote:

    Ok, I'll wait, Thanks



  • On 08/07/2015 at 07:47, xxxxxxxx wrote:

    Hello,

    I got news from the developers and indeed this is a bug.

    Best wishes,
    Sebastian



  • On 08/07/2015 at 07:50, xxxxxxxx wrote:

    Ok!

    Is this a Cinema4D issue, or Melange SDK?

    Regards



  • On 09/07/2015 at 10:06, xxxxxxxx wrote:

    Hello,

    this seems to be a problem in Cinema, but I can't say anything specific.

    Best wishes,
    Sebastian


Log in to reply