<?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[The cloner is calculated before the Python tag]]></title><description><![CDATA[<p dir="auto">Good afternoon, friends. I have a spline formula in my scene, which is used as an object with clones on its vertices. This spline is modified by a formula which is regulated by an expression in a python tag.</p>
<pre><code>from typing import Optional
import c4d
import math
def main() -&gt; None:
    doc: c4d.documents.BaseDocument = op.GetDocument()
    wave_obj = doc.SearchObject('Wave 1')

    wave_obj[c4d.PRIM_FORMULA_TMAX] = 33
    velocity_factor = doc.GetTime().Get() * 100
    wave_obj[c4d.PRIM_FORMULA_Y] = f"{str(20)}*Sin((t-{str(math.radians(velocity_factor))})*{str(0.8)})"
    # Update the scene
    c4d.EventAdd()
</code></pre>
<p dir="auto">The problem is that the cloner executes before the expression, and for this reason, the clones are placed not on the current vertices of the spline, but on the positions of vertices from the previous frame. If you stop the animation, then at the next update of the scene clones become on the right places, but during the animation they still lag a frame. I've tried changing this by decreasing or increasing the tag priority, but it has no effect. How can I solve this problem?</p>
]]></description><link>http://developers.maxon.net/forum/topic/15300/the-cloner-is-calculated-before-the-python-tag</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 02:59:02 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/15300.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Dec 2023 15:28:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to The cloner is calculated before the Python tag on Thu, 04 Jan 2024 11:43:59 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/ll2pakll">@<bdi>ll2pakll</bdi></a> ,</p>
<p dir="auto">Please excuse the delay, your topic somehow slipped from my list.</p>
<p dir="auto">I can only speculate here, as you haven't attached a sample scene that highlights your issue.</p>
<p dir="auto">The way you describe the problem it looks like a priority issue of the python tag. Please have a look at how the priority works in our documentation: <a href="https://help.maxon.net/c4d/2023/en-us/Default.htm#html/TPYTHON-OBASELIST.html#EXPRESSION_PRIORITY" target="_blank" rel="noopener noreferrer nofollow ugc">https://help.maxon.net/c4d/2023/en-us/Default.htm#html/TPYTHON-OBASELIST.html#EXPRESSION_PRIORITY</a></p>
<p dir="auto">Also note that it's forbidden to call <a href="https://developers.maxon.net/docs/py/2024_0_0a/modules/c4d/index.html?highlight=eventadd#c4d.EventAdd" target="_blank" rel="noopener noreferrer nofollow ugc">c4d.EventAdd()</a> (or in reality is just skipped) from the python tag due to multithreading restrictions (c4d.EventAdd() is executed on main thread whilst python tag is executed in a parallel thread):<br />
<img src="https://developers.maxon.net/forum/assets/uploads/files/1704368550401-9ddbfeab-53dd-49e1-8ded-0a6c3dddba94-image.png" alt="9ddbfeab-53dd-49e1-8ded-0a6c3dddba94-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Cheers,<br />
Ilia</p>
]]></description><link>http://developers.maxon.net/forum/post/73475</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73475</guid><dc:creator><![CDATA[i_mazlov]]></dc:creator><pubDate>Thu, 04 Jan 2024 11:43:59 GMT</pubDate></item></channel></rss>