<?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[Python field error]]></title><description><![CDATA[<p dir="auto">When add the default python field and increase the number of subdivs I'm getting this error. What gives?</p>
<pre><code>Traceback (most recent call last):
  File "&lt;Python Field_0&gt;", line 22, in Sample
BaseException: The input list is not long enough (need 400)
</code></pre>
<p dir="auto">Just to reiterate this happens with the default unedited python field.</p>
]]></description><link>http://developers.maxon.net/forum/topic/15373/python-field-error</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 21:19:29 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/15373.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Feb 2024 13:47:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Python field error on Thu, 15 Feb 2024 19:54:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/m_adam">@<bdi>m_adam</bdi></a> said in <a href="/forum/post/73763">Python field error</a>:</p>
<blockquote>
<p dir="auto">A fix is coming in one of the next version of Cinema 4D, so that OutputBlockSize == InputBlockSize and therefor you will not need to add this "useless" values at the end to fullfill the outValues.</p>
</blockquote>
<p dir="auto">That's great news. I'll hold off till then.</p>
]]></description><link>http://developers.maxon.net/forum/post/73770</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73770</guid><dc:creator><![CDATA[SweepingMotion]]></dc:creator><pubDate>Thu, 15 Feb 2024 19:54:31 GMT</pubDate></item><item><title><![CDATA[Reply to Python field error on Tue, 13 Feb 2024 15:44:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi thanks for this topic, as you may or not know Field sampling is multi-threaded and for a given list of inputs defined in the FieldInput there is an equivalent FieldOutput with the same data count.<br />
In order to Multi-thread fields, FieldInput that you receive in the Sample function, is just a "Block" aka a part of the initial list of inputs, and the output is an FieldOutputBlock which also represent just a part of the final list.<br />
The default size for blocks are 400 entries and when there is leftover the input size adapt while the output size does not for the moment (due to a bug) and still is 400.</p>
<p dir="auto">As an example, if you have 405 inputs in total. The sample function will be called 2 times with:</p>
<ul>
<li>400 inputs and 400 outputs to feed.</li>
<li>5 inputs and for the moment 400 outputs to feed.</li>
</ul>
<p dir="auto">So in order to fix the issue the best workaround I see right now is to compensate to also provide a list of 400 entries, even if theses values will be unused.</p>
<pre><code>    outputs._value = [
        c4d.utils.RangeMap((~mgEffector * mgInput * p).GetLength(), 100., 0., 0., 1., True)
        for p in inputs._position
    ] + ([0.0] * (outputs.GetCount() - inputs.GetCount()))
</code></pre>
<p dir="auto">A fix is coming in one of the next version of Cinema 4D, so that OutputBlockSize == InputBlockSize and therefor you will not need to add this "useless" values at the end to fullfill the outValues.</p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/73763</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73763</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Tue, 13 Feb 2024 15:44:35 GMT</pubDate></item><item><title><![CDATA[Reply to Python field error on Mon, 12 Feb 2024 15:40:54 GMT]]></title><description><![CDATA[<p dir="auto">Yep that seems to do it.</p>
]]></description><link>http://developers.maxon.net/forum/post/73743</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73743</guid><dc:creator><![CDATA[SweepingMotion]]></dc:creator><pubDate>Mon, 12 Feb 2024 15:40:54 GMT</pubDate></item><item><title><![CDATA[Reply to Python field error on Mon, 12 Feb 2024 14:32:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/sweepingmotion">@<bdi>SweepingMotion</bdi></a> nice finding<br />
Yes, there are quite a few issues in the sample codes everywhere.<br />
To fix the Python Field, I think it's required to change</p>
<pre><code>    outputs._value = [
        c4d.utils.RangeMap((~mgEffector * mgInput * p).GetLength(), 100., 0., 0., 1., True)
        for p in inputs._position
    ]
</code></pre>
<p dir="auto">to</p>
<pre><code>    outValues = outputs._value

    for index, p in enumerate(inputs._position):
        outValues[index] = c4d.utils.RangeMap((~mgEffector * mgInput * p).GetLength(), 100., 0., 0., 1., True)

    outputs._value = outValues
</code></pre>
]]></description><link>http://developers.maxon.net/forum/post/73742</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73742</guid><dc:creator><![CDATA[baca]]></dc:creator><pubDate>Mon, 12 Feb 2024 14:32:18 GMT</pubDate></item><item><title><![CDATA[Reply to Python field error on Mon, 12 Feb 2024 11:35:14 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/sweepingmotion">@<bdi>SweepingMotion</bdi></a>,</p>
<p dir="auto">Thank you for reaching out to us. We have seen your question, understood it, and will answer here soon. Please also make sure to consolidate your observations and explanations for a question into a singular posting in the future. It does not help a thread when the question alone is split over multiple postings.</p>
<p dir="auto">PS: It will not be me answering this.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/73740</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73740</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 12 Feb 2024 11:35:14 GMT</pubDate></item><item><title><![CDATA[Reply to Python field error on Mon, 12 Feb 2024 11:24:05 GMT]]></title><description><![CDATA[<p dir="auto"><video class="embed-video-local" controls src="/forum/assets/uploads/files/1707737007514-20240212-0753-40.5920766.mp4">
<p dir="auto">Here's what's happening.<br />
I think I understand now - the input data is given in blocks of 400 points. And I need to traverse those blocks to get all the points.</p>
</video></p>]]></description><link>http://developers.maxon.net/forum/post/73739</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73739</guid><dc:creator><![CDATA[SweepingMotion]]></dc:creator><pubDate>Mon, 12 Feb 2024 11:24:05 GMT</pubDate></item><item><title><![CDATA[Reply to Python field error on Mon, 12 Feb 2024 11:12:26 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/sweepingmotion">@<bdi>SweepingMotion</bdi></a> ,<br />
Would be helpful if you'll provide sample project, or at least code for the python field.</p>
]]></description><link>http://developers.maxon.net/forum/post/73738</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73738</guid><dc:creator><![CDATA[baca]]></dc:creator><pubDate>Mon, 12 Feb 2024 11:12:26 GMT</pubDate></item><item><title><![CDATA[Reply to Python field error on Mon, 12 Feb 2024 08:06:07 GMT]]></title><description><![CDATA[<p dir="auto">I must've been half asleep when writing this yesterday. I now realize I didn't explain myself too well.<br />
Just to explain the problem a bit better:<br />
The setup - plane primitive with a vertex map applied, python field added.<br />
Now everything is great until the number of points on the plane exceeds 400 - this is where the error crops up. Seems like the number of points in input list is capped at 400... but not the output list.</p>
]]></description><link>http://developers.maxon.net/forum/post/73737</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73737</guid><dc:creator><![CDATA[SweepingMotion]]></dc:creator><pubDate>Mon, 12 Feb 2024 08:06:07 GMT</pubDate></item></channel></rss>