<?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[Take override for user data]]></title><description><![CDATA[<p dir="auto"><em>On 21/05/2018 at 19:00, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">Hi folks, I'm having problems successfully creating a take override for user data on a list of objects. Code below.</p>
<p dir="auto">When the code is run...</p>
<p dir="auto">* It completes without error<br />
* Overrides for the selected models are indeed created for the the selected take<br />
* But they don't seem to work: their values in the Take Manager are empty<br />
* And even stranger, clicking the Take in the Take Manager exhibits very odd behavior. E.g. The Take effects do seem to activate (e.g. the correct layers are solo'd), but the icon does not highlight, and the solo'd layers cannot be un-solo'd. See follow up post below for details and screen cap.</p>
<p dir="auto">I suspect that FindOrAddOverrideParam doesn't like the DescID I'm providing, as it returns None. Conversely I'm creating overrides elsewhere in this script (to solo layers, for example) without problems. This is the only place I'm trying to 1) get DescID for user data, and 2) get DescID for two DescLevels deep, so I suspect that's where I'm going wrong.</p>
<pre><code>def SetModelModeOverrides(take, models) :
  
    doc = c4d.documents.GetActiveDocument()
    takeData = doc.GetTakeData()
  
    ID = c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(11, c4d.DTYPE_LONG, 0))
    newValue = 0
  
    for model in models:
  
        overrideNode = take.FindOrAddOverrideParam(takeData, model, ID, newValue)
        
	print model # Prints &lt;c4d.BaseObject object called ... &gt;
        print ID # Prints ((700, 0, 0), (11, 15, 0))
        print overrideNode # Prints None
  
        if overrideNode is not None:
            overrideNode.UpdateSceneNode(takeData, ID)
            c4d.EventAdd()
</code></pre>
<p dir="auto">Additional details:</p>
<p dir="auto">* User data data type is integer, with Quicktab Radio interface, and ID 11<br />
* I can successfully modify said user data via <code>model[c4d.ID_USERDATA,11] = 3</code><br />
* User data lives on nulls brought in as non-encapsulated Xrefs<br />
* I'm on R19, macOS 10.13.3<br />
* There are no problems with rest of the script, which automates the setup of layers, takes, comp tags, and render settings.</p>
<p dir="auto">Any suggestions would be hugely appreciated! This is my first time working with Python in C4D and this forum has been a god-send so far <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>
]]></description><link>http://developers.maxon.net/forum/topic/10795/14240_take-override-for-user-data</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 08:38:39 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/10795.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Sep 2018 10:32:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Take override for user data on Sat, 01 Sep 2018 10:32:25 GMT]]></title><description><![CDATA[<p dir="auto"><em>On 22/05/2018 at 11:56, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">Outstanding; that works! I'm glad it was something trivial like that <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="🙂" /> Thanks so much!</p>
]]></description><link>http://developers.maxon.net/forum/post/54982</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/54982</guid><dc:creator><![CDATA[Helper]]></dc:creator><pubDate>Sat, 01 Sep 2018 10:32:25 GMT</pubDate></item><item><title><![CDATA[Reply to Take override for user data on Sat, 01 Sep 2018 10:32:22 GMT]]></title><description><![CDATA[<p dir="auto"><em>On 22/05/2018 at 09:27, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">First of all welcome at PluginCafe JoshCarpenter.</p>
<p dir="auto">After few tests it's looks like to to write the full desclevel make it working, so<br />
from</p>
<pre><code>c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(11, c4d.DTYPE_LONG, 0))
</code></pre>
<p dir="auto">To</p>
<pre><code>c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA, c4d.DTYPE_SUBCONTAINER, 0), c4d.DescLevel(11, c4d.DTYPE_LONG, 0))
</code></pre>
<p dir="auto">works well here even when parameters are not allowed to be modified in the Xref.</p>
<p dir="auto">If you have any questions do not hesitate.</p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/54981</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/54981</guid><dc:creator><![CDATA[Helper]]></dc:creator><pubDate>Sat, 01 Sep 2018 10:32:22 GMT</pubDate></item><item><title><![CDATA[Reply to Take override for user data on Sat, 01 Sep 2018 10:32:20 GMT]]></title><description><![CDATA[<p dir="auto"><em>On 21/05/2018 at 19:48, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">The part that I find most strange is that take.FindOrAddOverrideParam seems to return None, and so you'd think it would have no effect, but the overrides are indeed created in the Take, and for the correct objects / properties no less. It's just that their values are empty, and that the Take can't be selected. Or—even more odd—I can click on it, and it has _some_ effect (the right layers are solo'd), but the icon does not highlight, and subsequently clicking on other takes does not un-solo the layers. Screencap tells the tale, here: <a href="https://www.dropbox.com/s/gaqydgh9qouoreh/python-problems.gif?dl=0%20" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.dropbox.com/s/gaqydgh9qouoreh/python-problems.gif?dl=0 </a></p>
<p dir="auto">In aggregate this is making me wonder if I'm hitting C4D bugs.</p>
]]></description><link>http://developers.maxon.net/forum/post/54980</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/54980</guid><dc:creator><![CDATA[Helper]]></dc:creator><pubDate>Sat, 01 Sep 2018 10:32:20 GMT</pubDate></item></channel></rss>