Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login
    1. Home
    2. AlexanderS
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    AlexanderS

    @AlexanderS

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

    AlexanderS Unfollow Follow

    Latest posts made by AlexanderS

    • RE: Retrieving take data and overrides.

      Hi Manuel,

      Thank you. I've been expecting this. Hope such support will be added sooner or later 🙂

      Our app: finalmesh.com

      Alex

      posted in Cineware SDK
      A
      AlexanderS
    • Retrieving take data and overrides.

      Hello,
      We are using Cineware SDK, 22.0_355130, C++, to read c4d files into our application.
      Now we started to read take data in hope to read multiple animations assigned to objects.

      File is simple - one object with two takes. Each has it's own set of animations.
      We can get cineware::TakeData and can retrieve tree or BaseTake, with names. Exactly the same as in Cinema4D UI.
      db82bbaa-570e-454b-aa99-bdfe3662a965-image.png

      Now the problems:

      • We can't get anything from BaseTake. All methods for all objects and all takes returns nothing: GetOverrideGroups - returns empty array. take->FindOverride () - returns NULL.
      • TakeData::SetCurrentTake - doesn't work with any take. It returns true, but GetCurrentTake returns old take. I had a hope that I can just set another current take and read right animations.
      • When we read this file with many takes we are getting memory leaks. Even without any data processing on our side.
        Surprisingly, leaks are related to reading of OverrideData 🙂 Part of the stack is below:
      cineware::MemAlloc(__int64 size) Line 24	C++
      cineware::DescID::operator=(const cineware::DescID & src) Line 119	C++
      cineware::DescID::DescID(const cineware::DescID & src) Line 21	C++
      cineware::BaseOverrideData::Read(cineware::HyperFile * hf, int id, int level) Line 145	C++
      cineware::PluginNode::HandleSubChunk(cineware::HyperFile * hf, int id, int level) Line 281	C++
      cineware::PrivateChunk::ReadChunk(cineware::HyperFile * hf, bool keepin, bool noheader) Line 39	C++
      

      This is the code to extract array of takes (it works as expected):

      void C4Import::EnummTakesImp(cineware::BaseTake*take)
      {
      	AnimationData*ad=(AnimationData*)m_mem->AllocZ(sizeof(AnimationData));
      	ad->take=take;
      	m_animations->Insert(ad);
      	const UInt16 *out_ptr;
      	const cineware::String&str=take->GetName();
      	UINT32 len=str.GetDataPtr(&out_ptr);
      	if(len)
      	{
      		ad->name=(wchar_t*)m_mem->AllocZ((len+1)*sizeof(wchar_t));
      		memcpy(ad->name,out_ptr,len*sizeof(wchar_t));
      		ad->name[len]=0;
      	}
      
      	BaseTake*takeDown=take->GetDown();
      	while(takeDown)
      	{
      		EnummTakesImp(takeDown);
      		takeDown=takeDown->GetNext();
      	}
      
      };
      void C4Import::EnummTakes()
      {
      	BaseTake*bt=m_take->GetMainTake();
      	if(bt)
      	{
      		m_animations=Array::Create();
      		EnummTakesImp(bt);
      	}
      };
      

      This is the code to find overrides:

      BaseList2D*base=(BaseList2D*)_node->object_c4d;
      	if(base && m_animations)
      	{
      		for(int i=0;i<m_animations->count;i++)
      		{
      			AnimationData*ad=(AnimationData*)m_animations->At(i);
      			BaseOverride*over= ad->take->FindOverride(m_take, base);
      			if(over)
      			{
      				int idbg=0;
      				idbg++;
      			}
      		}
      	}
      

      Should I do something extra in order to enable reading of overrides? Or may be required functionality is disabled in this SDK?

      Thank you in advance.
      Alex

      posted in Cineware SDK c++ windows sdk
      A
      AlexanderS