<?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[Could not initialize global resource]]></title><description><![CDATA[<p dir="auto"><em>On 18/06/2018 at 08:35, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">Hi folks,<br />
Recently, I tried to create my first Python plug-in, and I was troubled by a problem for a long time.</p>
<p dir="auto">Console:  RuntimeError: Could not initialize global resource for the plugin.</p>
<p dir="auto">I search a lot in the SDK document and forum, but I still don't know how to solve it. I hope can get your help. Here's my test code:</p>
<p dir="auto">(test.pyp)<br />
_____<br />
import c4d<br />
import sys<br />
import os<br />
from c4d import plugins,bitmaps<br />
PLUGIN_ID = 1000001<br />
OBJECTGROUP = 1001<br />
OBJECT = 1002<br />
MAP = 1003<br />
class test(plugins.ObjectData) :<br />
def __init__(self) :<br />
self.SetOptimizeCache(True)<br />
def ModifyObject(self, mod, doc, op, op_mg, mod_mg, lod, flags, thread) :<br />
op.SetPoint(0,c4d.Vector())<br />
op.Message(c4d.MSG_UPDATE)<br />
return True<br />
if __name__ == "__main__":<br />
bmp = bitmaps.BaseBitmap()<br />
   	dir, file = os.path.split(__file__) <br />
bitmapfile = os.path.join(dir, "res", "Icon.tif")<br />
result = bmp.InitWith(bitmapfile)<br />
plugins.RegisterObjectPlugin(id=PLUGIN_ID, str="test",g=test,description="test",icon=bmp,info=c4d.OBJECT_MODIFIER)<br />
___<br />
(test.h)<br />
__<br />
#ifndef _Oatom_H_<br />
#define _Oatom_H_<br />
enum<br />
{<br />
    OBJECTGROUP = 1001,<br />
    OBJECT = 1002,<br />
    MAP = 1003,<br />
};<br />
#endif<br />
__<br />
(test.res)<br />
__<br />
CONTAINER test<br />
{<br />
NAME test;<br />
INCLUDE Obase;<br />
GROUP OBJECTGROUP<br />
{<br />
    LINK OBJECT {}<br />
    LINK MAP {}<br />
}<br />
}<br />
__<br />
(test.str)<br />
__<br />
STRINGTABLE test<br />
{<br />
OBJECTGROUP "List";<br />
OBJECT "obj"<br />
MAP "map";<br />
}</p>
]]></description><link>http://developers.maxon.net/forum/topic/10824/14272_could-not-initialize-global-resource</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 18:53:26 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/10824.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Sep 2018 10:37:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Could not initialize global resource on Sat, 01 Sep 2018 10:37:13 GMT]]></title><description><![CDATA[<p dir="auto"><em>On 21/06/2018 at 07:40, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">Yeah, I get it! Thank you for your patient answer, Yannick Puech!</p>
]]></description><link>http://developers.maxon.net/forum/post/55090</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/55090</guid><dc:creator><![CDATA[Helper]]></dc:creator><pubDate>Sat, 01 Sep 2018 10:37:13 GMT</pubDate></item><item><title><![CDATA[Reply to Could not initialize global resource on Sat, 01 Sep 2018 10:37:10 GMT]]></title><description><![CDATA[<p dir="auto"><em>On 21/06/2018 at 01:21, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">The <em>c4d_symbols.h</em> has to be there even if it's empty. It's mandatory for plugins that use description resources.</p>
]]></description><link>http://developers.maxon.net/forum/post/55089</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/55089</guid><dc:creator><![CDATA[Helper]]></dc:creator><pubDate>Sat, 01 Sep 2018 10:37:10 GMT</pubDate></item><item><title><![CDATA[Reply to Could not initialize global resource on Sat, 01 Sep 2018 10:37:07 GMT]]></title><description><![CDATA[<p dir="auto"><em>On 20/06/2018 at 08:05, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">Thank you for your help, Yannick Puech!</p>
<p dir="auto">My first test plugin  run  successfully!</p>
<p dir="auto">I made a stupid mistake a lot, such as forgetting to add a semicolon ";" and I forgot to add "s" folder of strings. It is these wrong to let me crazy for a long time. Next time I encounter a problem, I will check these low-level mistakes first.</p>
<p dir="auto">I also want to ask a question again, why is the c4d_symbols.h file necessary? There seems to be nothing in it. What role does he have? I don't seem to find his introduction in the document. This also confuses me.</p>
]]></description><link>http://developers.maxon.net/forum/post/55088</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/55088</guid><dc:creator><![CDATA[Helper]]></dc:creator><pubDate>Sat, 01 Sep 2018 10:37:07 GMT</pubDate></item><item><title><![CDATA[Reply to Could not initialize global resource on Sat, 01 Sep 2018 10:37:04 GMT]]></title><description><![CDATA[<p dir="auto"><em>On 19/06/2018 at 02:21, <strong>xxxxxxxx</strong> wrote:</em></p>
<p dir="auto">Hi,</p>
<p dir="auto">The resource for the plugin can't be initialized because there's an error in <em>test.str</em> : a semicolon ';' is missing at the end of the line <em>OBJECT "obj"</em>.</p>
<p dir="auto">It looks like you've copied the resource for C++ SDK <em>Oatom</em> example.<br />
It's better to copy the resource for a Python SDK example, for instance object plugin <em>Py-RoundedTube</em>.<br />
Use this as a base to define resources: macro #def in .h, naming for parameters, resource tree structure etc.</p>
<p dir="auto">Note Python plugins resource need <em>c4d_symbols.h</em> present in <em>res</em> folder.</p>
]]></description><link>http://developers.maxon.net/forum/post/55087</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/55087</guid><dc:creator><![CDATA[Helper]]></dc:creator><pubDate>Sat, 01 Sep 2018 10:37:04 GMT</pubDate></item></channel></rss>