<?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[ShaderData: SUPER::GetDDescription() always returns false]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I just noticed, rather by concidence, that in one of my shaders, the following code always returns <code>false</code>:</p>
<pre><code class="language-cpp">Bool MyShader::GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC&amp; flags)
{
    return SUPER::GetDDescription(node, description, flags);
}
</code></pre>
<p dir="auto">Interestingly, everything works as expected. Returning <code>false</code> doesn't seem to throw Cinema off.</p>
<p dir="auto">So, what could be the reason for that? What causes <code>NodeData::GetDDescription()</code> to return <code>false</code>?</p>
<p dir="auto">And yes, this post is a bit short on information. If you need any additional info, please tell me and I'll provide you with it.</p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/topic/14916/shaderdata-super-getddescription-always-returns-false</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 08:28:17 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/14916.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 31 Jul 2023 10:28:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ShaderData: SUPER::GetDDescription() always returns false on Mon, 31 Jul 2023 12:12:50 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/fwilleke80">@<bdi>fwilleke80</bdi></a>,</p>
<p dir="auto">you are right, it does indicate an error, hence my example from above. When I searched in our internal code base for similar code, I found a lot of</p>
<pre><code class="language-cpp">return NodeData::GetDDescription(node, description, flags);
</code></pre>
<p dir="auto">calls. While there are certainly node types which customize their description handling, this seems to be more a precaution for the case when we decide that we want to implement something in <code>NodeData::GetDDescription</code> in the future. Or something has been there in the past and we optimized it away. In any case, one should not take my comment about calling the base implementation being pointless too seriously. It is best to leave the call in, although it currently has no practical effect and probably will never have.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/72123</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72123</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 31 Jul 2023 12:12:50 GMT</pubDate></item><item><title><![CDATA[Reply to ShaderData: SUPER::GetDDescription() always returns false on Mon, 31 Jul 2023 11:49:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi Ferdinand,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/ferdinand">@<bdi>ferdinand</bdi></a> said in <a href="https://developers.maxon.net/forum/post/72121" target="_blank" rel="noopener noreferrer nofollow ugc">ShaderData: SUPER::GetDDescription() always returns false</a>:</p>
<blockquote>
<p dir="auto">edit: Okay, I had a super-brief look, and from what I can see, ShaderData does indeed not seem to implement GetDDescription in any form. Which would then mean that your calls do always end up here</p>
</blockquote>
<p dir="auto">Ah, okay, so it's actually normal for the SUPER call to return <code>false</code>! I just never noticed.</p>
<p dir="auto">Telling from the documentation, which says about the <code>NodeData::GetDDescription()</code> return value:</p>
<blockquote>
<p dir="auto">true if successful, otherwise false. It is recommended to include a call to the parent function as last return.</p>
</blockquote>
<p dir="auto">... I assumed that <code>false</code> would indicate an error. Apparently, it doesn't. So I'll just leave it like this <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">Thanks!</p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/post/72122</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72122</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Mon, 31 Jul 2023 11:49:33 GMT</pubDate></item><item><title><![CDATA[Reply to ShaderData: SUPER::GetDDescription() always returns false on Mon, 31 Jul 2023 12:11:10 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/fwilleke80">@<bdi>fwilleke80</bdi></a>,</p>
<p dir="auto">thank you for reaching out to us. Well, that depends. First, I assume that you actually defined <a href="https://developers.maxon.net/docs/cpp/2023_2/c4d__baselist_8h.html#a77b5ef851a051af355969b57f6bb932d" target="_blank" rel="noopener noreferrer nofollow ugc">INSTANCEOF(MyShaderData, ShaderData)</a> in your <code>MyShader</code> for the <code>SUPER</code> attribute to actually compile/work. Secondly, that call should call <code>GetDDescription()</code> of <code>ShaderData</code> and not <code>NodeData</code>, unless you did declare your <code>MyShader</code> to be an instance of <code>NodeData</code> in the macro (which IMHO should not compile in the first place). Lastly, to why this actually happens. I would have to try myself (once you confirmed that the other cases all do not apply), but there are basically three options:</p>
<p dir="auto">(1) Your qualifier 'always' in the statement <em>'the following code always returns false'</em> is imprecise. It is quite normal that scene elements do not have always access to their description, which is why one should implement <code>GetDDescription</code> always like this (see SDK for examples):</p>
<pre><code class="language-cpp">Bool MyNode::GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC&amp; flags)
{
  if (!description-&gt;LoadDescription(node-&gt;GetType()))
    return false;
  ...
</code></pre>
<p dir="auto">Later on in the life cycle of the node, one will be then able to load that description. Or in other words, it is quite normal that some <code>GetDDescription</code> calls do fail. Can you confirm that this does indeed <strong>always</strong> happen in your case?</p>
<p dir="auto">(2) <code>ShaderData</code> has itself no base description. I.e., there is nothing to load and modify. Seems unlikely to me since there is <code>Xbase</code> which should kick in when an implementing entity somehow manages to screw up its description.</p>
<p dir="auto">(3) There is a bug in <code>ShaderData</code> <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">Cheers,<br />
Ferdinand</p>
<p dir="auto">edit: Okay, I had a super-brief look, and from what I can see, ShaderData does indeed not seem to implement <code>GetDDescription</code> in any form. Which would then mean that your calls do always end up here:</p>
<p dir="auto"><img src="https://developers.maxon.net/forum/assets/uploads/files/1690803735932-1719bcb9-1183-4c13-b1cb-6b43536da9c7-image-resized.png" alt="1719bcb9-1183-4c13-b1cb-6b43536da9c7-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><s>So, calling the base implementation of a shader for <code>GetDDescription</code> seems kind of pointless.</s> (no, bad Ferdinand, bad, very bad <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61b.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--stuck_out_tongue" style="height:23px;width:auto;vertical-align:middle" title=":P" alt="😛" /> )</p>
]]></description><link>http://developers.maxon.net/forum/post/72121</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/72121</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 31 Jul 2023 12:11:10 GMT</pubDate></item></channel></rss>