<?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[Invoke Dialog from Python Tag]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I do have some Python Tags and need to display a dialog to get a yes/no user decision in certain cases.<br />
I actually did this for a long time on macos, but know now why this leads to freezes on Windows.</p>
<p dir="auto">My first idea for a solution was to message from the python tags to a commanddata plugin, which then would display a dialog and take action.</p>
<p dir="auto">Is that possible and how can I do that?<br />
CallCommand() is not allowed from a python tag and something like this doesn't seem to work either:</p>
<pre><code>op = c4d.plugins.FindPlugin(PLUGIN_ID)
bc = c4d.BaseContainer()  
...
op.Message(c4d.MSG_BASECONTAINER, bc)
</code></pre>
<p dir="auto">best, index</p>
]]></description><link>http://developers.maxon.net/forum/topic/12879/invoke-dialog-from-python-tag</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 02:38:58 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/12879.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Sep 2020 21:02:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Invoke Dialog from Python Tag on Thu, 17 Sep 2020 08:17:50 GMT]]></title><description><![CDATA[<p dir="auto">Hi Manuel,</p>
<p dir="auto">I just thought it must be possible to Message something to a CommandData plugin, too.<br />
The idea behind the CommandData was to combine some other functionality,<br />
but I guess i just get a new plugin ID and go the MessageData way...</p>
<p dir="auto">best, Index</p>
<p dir="auto">hm, somehow I cant find how to tag this as solved</p>
]]></description><link>http://developers.maxon.net/forum/post/64373</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64373</guid><dc:creator><![CDATA[indexofrefraction]]></dc:creator><pubDate>Thu, 17 Sep 2020 08:17:50 GMT</pubDate></item><item><title><![CDATA[Reply to Invoke Dialog from Python Tag on Thu, 17 Sep 2020 07:33:48 GMT]]></title><description><![CDATA[<p dir="auto">hi</p>
<p dir="auto">a CommandData can't react to CoreMessage</p>
<p dir="auto">Only GeDialog, MessageData and GeUserArea, and SDKBrowserPreviewDialog  can react to a CoreMessage.</p>
<p dir="auto">The message, <code>MSG_DOCUMENTINFO_TYPE_LOAD</code> is  broadcast to all NodeData. (including SceneHookData but not PreferenceData). It's not a CoreMessage.</p>
<p dir="auto">So to resume, you want your tag to display a dialog and that dialog will call a command with some parameter ?</p>
<p dir="auto">Cheers,<br />
Manuel</p>
]]></description><link>http://developers.maxon.net/forum/post/64372</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64372</guid><dc:creator><![CDATA[Manuel]]></dc:creator><pubDate>Thu, 17 Sep 2020 07:33:48 GMT</pubDate></item><item><title><![CDATA[Reply to Invoke Dialog from Python Tag on Thu, 17 Sep 2020 07:00:16 GMT]]></title><description><![CDATA[<pre><code># IN A MESSAGEDATA PLUGIN
def CoreMessage(self, id, msg):
  if id == PLUGIN_ID:
    print "Hello World!"
  return True

# IN A PYTHON TAG (NOT TAG PLUGIN)
c4d.SpecialEventAdd(PLUGIN_ID)
</code></pre>
<p dir="auto">hm, this seems to work using a MessageData plugin,<br />
but isnt it possible to receive a (Core)Message in a CommandData plugin?</p>
]]></description><link>http://developers.maxon.net/forum/post/64369</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64369</guid><dc:creator><![CDATA[indexofrefraction]]></dc:creator><pubDate>Thu, 17 Sep 2020 07:00:16 GMT</pubDate></item><item><title><![CDATA[Reply to Invoke Dialog from Python Tag on Wed, 16 Sep 2020 17:09:30 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Manuel,</p>
<p dir="auto">I saw this thread before, and I must study it more in depth, but one thing ...<br />
I don't use a Tag Plugin, I use a <strong>Python Tag</strong>.<br />
So the Plugin with the Gedialog is not connected to the Tag.</p>
<p dir="auto">I want to send a Message from a <strong>Python Tag</strong> to a <strong>Commanddata Plugin</strong><br />
The Gedialog there can be Async or Modal, that doesn't matter.</p>
<p dir="auto">Btw, another way to solve my problem would be to catch MSG_DOCUMENTINFO_TYPE_LOAD<br />
from a Commanddate Plugin and check all Python Tags in the Scene from there.<br />
But I read this is not possible using Python... (?)</p>
<p dir="auto">best, Index</p>
]]></description><link>http://developers.maxon.net/forum/post/64364</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64364</guid><dc:creator><![CDATA[indexofrefraction]]></dc:creator><pubDate>Wed, 16 Sep 2020 17:09:30 GMT</pubDate></item><item><title><![CDATA[Reply to Invoke Dialog from Python Tag on Wed, 16 Sep 2020 09:01:53 GMT]]></title><description><![CDATA[<p dir="auto">hi,</p>
<p dir="auto">you can have a look at <a href="https://developers.maxon.net/forum/topic/11968/how-to-open-a-dialog-plugin-from-a-tag-plugin" target="_blank" rel="noopener noreferrer nofollow ugc">this thread</a> there are some important point there.</p>
<p dir="auto">While it's true you can't use CallCommand inside the <code>Execute</code> function of the tag, you can in the <code>message</code> function.<br />
You have to use them in the main thread and if you are now sure, you can use <a href="https://developers.maxon.net/docs/py/2023_2/modules/c4d.threading/index.html?highlight=mainthread#c4d.threading.GeIsMainThread" target="_blank" rel="noopener noreferrer nofollow ugc">GeIsMainThread</a></p>
<p dir="auto">Another important point is, do you want to open a modal or async dialog ?</p>
<p dir="auto">Let me know if you still have issue.</p>
<p dir="auto">Cheers,<br />
Manuel</p>
]]></description><link>http://developers.maxon.net/forum/post/64351</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64351</guid><dc:creator><![CDATA[Manuel]]></dc:creator><pubDate>Wed, 16 Sep 2020 09:01:53 GMT</pubDate></item></channel></rss>