Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Register
    • Login
    1. Maxon Developers Forum
    2. yannickkohn
    Y
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Groups 0

    yannickkohn

    @yannickkohn

    0
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    yannickkohn Unfollow Follow

    Latest posts made by yannickkohn

    • RE: Import multiple Takes

      Herer is a pseudo code

      doc = LoadDocument("file.c4d");
      doc->CreateSceneFromC4D();
      
      takeData = doc->GetTakeData();
      prevTake = takeData ? takeData->GetCurrentTake() : null;
      prevTime = doc->GetTime();
      
      takes = collectAllTakesRecursively(takeData->GetMainTake());
      
      for each take in takes:
          takeData->SetCurrentTake(take);
          isMain = (take == takeData->GetMainTake());
          useEvaluatedValues = !isMain;
      
          for each object in doc:
              overrideKeys = {};
              if (override = take->FindOverride(takeData, object)):
                  // override tracks (animated overrides)
                  for each ctrack in override->GetFirstCTrack():
                      addTrack(ctrack, isOverride=true);
                      overrideKeys.insert(trackKey(ctrack));
                  // override params (constant overrides)
                  for each descId in override->GetNodeData()->GetAllOverrideDescID():
                      overrideKeys.insert(trackKey(descId));
                      markPropertyAsAnimated(descId); // create channel even if no curve
      
              // main tracks (skip those overridden)
              if (!overrideOnly):
                  for each ctrack in object->GetFirstCTrack():
                      if (!overrideKeys.contains(trackKey(ctrack))):
                          addTrack(ctrack, isOverride=false);
      
          // Build one animation for this take
          // For non-main takes, sample evaluated values to capture final override result
          for each animated property (pos/rot/scale, joints too):
              times = keyTimesFromCurves();
              if (useEvaluatedValues) times = [docMinTime..docMaxTime] @ fps;
              for t in times:
                  doc->SetTime(t); doc->Execute();
                  value = object->GetParameter(propertyId);
                  writeKey(t, value);
      
      takeData->SetCurrentTake(prevTake);
      doc->SetTime(prevTime); doc->Execute();
      

      We import each C4D take as a separate animation by iterating TakeData (main + child takes). For each take we call SetCurrentTake(take) and then collect animation data from:

      1. override tracks (BaseOverride::GetFirstCTrack()), and
      2. override parameters (BaseOverrideData::GetAllOverrideDescID()), so constant overrides are not missed.
        We also read the base tracks (BaseObject::GetFirstCTrack()) but skip any channel that is overridden in the current take.
        For non‑main takes we sample evaluated values (doc->SetTime(t); doc->Execute(); GetParameter()) over the document time range, because takes can change the final evaluated state even without explicit tracks.
        This gives one animation per take (e.g., Idle/Walk/Run). Joint objects (Ojoint/Obone) are handled the same way as regular objects, so skinning animation is captured via joint transforms.
      posted in Cineware SDK
      Y
      yannickkohn
    • RE: Import multiple Takes

      Hi Ferdinand,

      thanks for your message. We need to import 3D scene with animation (for example a car with the wheel rotating and moving along a path) and/or skinned animation (for example a skinned animated human with bones). We want to be able to import from the C4D several independant animation (for example Three different path for the car) that we can recall independently. Or for example for a human I want to import the IDLE, Walk and running animation. For this the user will create three takes with each one an animation, one take for the IDLE, one for the walk and one the running. In my software I need to be able to import the 3 different animations IDLE,WALK,RUNNING.

      Best regards

      Yannnick

      posted in Cineware SDK
      Y
      yannickkohn
    • Import multiple Takes

      Hi, we need to import multiple Takes in independant animations. We were working with GLTF but it seems it support only one take, so we have added full support for direct C4D import with Cineware but we are unable to import multiple take. We import the name of all takes but it seems all the take play the same things ! Is it possible to import multiple takes ? At this time the only option for our customer is to use blender that support out of the box multiple animation for real time animation of characters in a real time application.

      Best regards

      posted in Cineware SDK c++
      Y
      yannickkohn