<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Retrieving take data and overrides.]]></title><description><![CDATA[<p dir="auto">Hello,<br />
We are using Cineware SDK, 22.0_355130, C++, to read c4d files into our application.<br />
Now we started to read take data in hope to read multiple animations assigned to objects.</p>
<p dir="auto">File is simple - one object with two takes. Each has it's own set of animations.<br />
We can get cineware::TakeData and can retrieve tree or BaseTake, with names. Exactly the same as in Cinema4D UI.<br />
<img src="https://developers.maxon.net/forum/assets/uploads/files/1668272553913-db82bbaa-570e-454b-aa99-bdfe3662a965-image.png" alt="db82bbaa-570e-454b-aa99-bdfe3662a965-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Now the problems:</p>
<ul>
<li>We can't get anything from BaseTake. All methods for all objects and all takes returns nothing: GetOverrideGroups - returns empty array. take-&gt;FindOverride () - returns NULL.</li>
<li>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.</li>
<li>When we read this file with many takes we are getting memory leaks. Even without any data processing on our side.<br />
Surprisingly, leaks are related to reading of OverrideData <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /> Part of the stack is below:</li>
</ul>
<pre><code>cineware::MemAlloc(__int64 size) Line 24	C++
cineware::DescID::operator=(const cineware::DescID &amp; src) Line 119	C++
cineware::DescID::DescID(const cineware::DescID &amp; 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++
</code></pre>
<p dir="auto">This is the code to extract array of takes (it works as expected):</p>
<pre><code>void C4Import::EnummTakesImp(cineware::BaseTake*take)
{
	AnimationData*ad=(AnimationData*)m_mem-&gt;AllocZ(sizeof(AnimationData));
	ad-&gt;take=take;
	m_animations-&gt;Insert(ad);
	const UInt16 *out_ptr;
	const cineware::String&amp;str=take-&gt;GetName();
	UINT32 len=str.GetDataPtr(&amp;out_ptr);
	if(len)
	{
		ad-&gt;name=(wchar_t*)m_mem-&gt;AllocZ((len+1)*sizeof(wchar_t));
		memcpy(ad-&gt;name,out_ptr,len*sizeof(wchar_t));
		ad-&gt;name[len]=0;
	}

	BaseTake*takeDown=take-&gt;GetDown();
	while(takeDown)
	{
		EnummTakesImp(takeDown);
		takeDown=takeDown-&gt;GetNext();
	}

};
void C4Import::EnummTakes()
{
	BaseTake*bt=m_take-&gt;GetMainTake();
	if(bt)
	{
		m_animations=Array::Create();
		EnummTakesImp(bt);
	}
};
</code></pre>
<p dir="auto">This is the code to find overrides:</p>
<pre><code>BaseList2D*base=(BaseList2D*)_node-&gt;object_c4d;
	if(base &amp;&amp; m_animations)
	{
		for(int i=0;i&lt;m_animations-&gt;count;i++)
		{
			AnimationData*ad=(AnimationData*)m_animations-&gt;At(i);
			BaseOverride*over= ad-&gt;take-&gt;FindOverride(m_take, base);
			if(over)
			{
				int idbg=0;
				idbg++;
			}
		}
	}
</code></pre>
<p dir="auto">Should I do something extra in order to enable reading of overrides? Or may be required functionality is disabled in this SDK?</p>
<p dir="auto">Thank you in advance.<br />
Alex</p>
]]></description><link>http://developers.maxon.net/forum/topic/14258/retrieving-take-data-and-overrides</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Nov 2026 12:57:19 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/14258.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 12 Nov 2022 17:25:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Retrieving take data and overrides. on Sat, 19 Nov 2022 11:59:04 GMT]]></title><description><![CDATA[<p dir="auto">Hi Manuel,</p>
<p dir="auto">Thank you. I've been expecting this. Hope such support will be added sooner or later <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Our app: <a href="http://finalmesh.com" target="_blank" rel="noopener noreferrer nofollow ugc">finalmesh.com</a></p>
<p dir="auto">Alex</p>
]]></description><link>http://developers.maxon.net/forum/post/70219</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70219</guid><dc:creator><![CDATA[AlexanderS]]></dc:creator><pubDate>Sat, 19 Nov 2022 11:59:04 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieving take data and overrides. on Mon, 14 Nov 2022 16:13:08 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Takes are not supported with Cineware version 22.0_355130. May I ask you what kind of software are you developing?</p>
<p dir="auto">Cheers,<br />
Manuel</p>
]]></description><link>http://developers.maxon.net/forum/post/70153</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70153</guid><dc:creator><![CDATA[Manuel]]></dc:creator><pubDate>Mon, 14 Nov 2022 16:13:08 GMT</pubDate></item></channel></rss>