Set another path for res files?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/02/2009 at 09:24, xxxxxxxx wrote:
This isn't possible either. ToolData is the only plugin type that utilizes a SubDialog for the Attributes Manager. The rest use Descriptions through resources (and dynamic Descriptions added in GetDDescription()).
I would imagine that although the plugins menu items might be in a different menu, the resources are still in their proper respective places: C4D/plugins/Py4D/plugins/myplugin/res/... Nesting shouldn't be a problem here (afaik).
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/02/2009 at 11:47, xxxxxxxx wrote:
Yes, but CINEMA 4D doesn't know the python plugins. All is wrapped by py4d so CINEMA doesn't notice any *.pyp plugins or their paths. Its just searched in the Py4D res folder.
Matthias, is there an undocumentated method which could help me? CINEMA knows the Coffeee plugin paths, even COFFEE is more close to the core than my plugin but it seems there is something that could help me.
Thank you very much indeed!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/02/2009 at 01:28, xxxxxxxx wrote:
I don't understand what is different between COFFEE and regular C++ plugins. Afaik COFFEE handles resource files the same as C++ plugins.
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/02/2009 at 03:30, xxxxxxxx wrote:
Correct me if I am wrong but I assume the concept of the integration of Python plugins is the same like in Coffee.
When I want to execute a Python plugin and I call the register_tagdata(...) function in Python, I parse the syntax and if register_tagdata(...) is reached in the code, I catch the given arguments and redirect them to a C++ function. In this case a function in "Py4D". So Py4D calls the Register*() functions and CINEMA 4D doesn't know anything about the python plugins.
Because Py4D calls the Register*() methods the description files will be searched in the res folder of Py4D.
But here is the difference to Coffee. Coffee plugins can contain their own directory with res files.
plugins/my_coffee_plugin/res/
And because the Coffee plugin does not really ( I guess something else in CINEMA 4D does it) call the original Register*() functions there has to be a possibility to register a new directory for res files like:
ResFolder desc; //* just an example *//
desc.SetAnotherResFolder("/.../res")
RegisterDescription(123, desc);
RegisterTagData(.... , 123, );I hope thats more informative.
Thanks. Bye
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/02/2009 at 04:49, xxxxxxxx wrote:
Ok, that is something I have to ask the developers.
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/02/2009 at 04:56, xxxxxxxx wrote:
Thanks! If you have any questions what I've aready checked out or if you need further information, just ask. Can't wait to get a solution..
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/03/2009 at 03:30, xxxxxxxx wrote:
Hi!
Any news?
Thanks.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/03/2009 at 07:10, xxxxxxxx wrote:
Global Pointer:
GeResource *myres = NULL;In C4D_PL_INIT:
>
Filename fn = GeGetPluginPath()+Filename("custom_res_folder"); \> myres = gNew GeResource; \> LocalResource\* local = NULL; \> \> if(myres && myres->Init(fn)) \> { \> local = myres->Get(); \> //Descriptions \> RegisterDescription(ID,"Tcontainer",local); \> }
and in C4DPL_ENDACTIVITY:
>
if(myres) \> { \> myres->Free(); \> gDelete(myres); \> }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/03/2009 at 07:37, xxxxxxxx wrote:
The problem with that is he is trying to implement Python (Py4D) plugins and not simply C++ plugins. If he is able to transmit the necessary information (plugin folder, id, type name) from one of these plugins to the C++ code and have it associated with the Py4D plugin then this might be possible.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/03/2009 at 08:13, xxxxxxxx wrote:
3DDesigner: I already tried this out but that does not work because Get() always returns "NULL".
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 03:18, xxxxxxxx wrote:
I am using this exact code myself (working flawlessly), so either you are doing something wrong or......I don´t know why it´s not working for you. My custom folder is inside my plugin`s folder.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 07:21, xxxxxxxx wrote:
@3DDesigner:
You wrote you use it in In C4D_PL_INIT:I would like to call in in PluginStart. Maybe thats the reason why it does not work?
it seems I have problems to explain it well enough, but maybe there is a solution
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 07:35, xxxxxxxx wrote:
Maybe PluginStart() is too early for this type of registration to work. Try it in PluginMessage() with C4DPL_INIT. Hopefully that won't make a difference for registering the python plugins.
But, I see a problem. Samir is only registering a single plugin but you'll be registering any number of plugins. So, this idea of storing 'myres' is going to get tricky - you'll need a myres for every plugin description resource being registered this way in order to free them later in C4DPL_ENDACTIVITY.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 07:40, xxxxxxxx wrote:
yep, I think this is the problem. It must be registered in C4DPL_INIT_SYS as that´s also when plugins check if the resources are available, so I assume it´s fundamental to register the resources at that point in the pipeline.
C4DPL_INIT is maybe too late (was a typo that I wrote it´s the one to be used! it´s INIT_SYS). Is there a special reason why you need to do it in PluginStart() (which is actually called by C4DPL_INIT)?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 08:38, xxxxxxxx wrote:
Because of several initialization stuff of python and the parsing of the python files, I have just the possibility to execute the plugins code at PluginStart.
thats very tricky. hm...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 10:43, xxxxxxxx wrote:
Ok. Hmm, but doesn´t plugin start come AFTER resource registering?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 10:52, xxxxxxxx wrote:
I opened RegisterTag() and saw that a description is registered before - for each RegisterTag().
So I just copied the whole content of the original Registration method and changed the RegisterDescription() method with the given examples here in the thread.
The other thing was just to register another res folder for the whole project (your example) but that does not work either.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 11:12, xxxxxxxx wrote:
sorry, could you repeat? I didn´t understand this.
I´ll be writing a message in german now:
Also, mein Punkt ist eigentlich, dass C4DPL_INIT_SYS vor PluginStart() aufgerufen wird. Es sollte doch daher nicht problematisch sein die Resource dateien in C4DPL_INIT_SYS zu registrieren. Oder versteh ich das jetzt falsch? -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 11:25, xxxxxxxx wrote:
Okay, dann antworte ich auch mal auf deutsch
Das Problem ist, das mein Plugin mit mehreren res Ordnern zu tun hat. Zum einen der originale res Ordner von Py4D für die Dialoge wie der Konsole, etc.
Zum anderen muss Py4D aber auch die res Ordner der Python Plugins registrieren. Und da ich erst in PluginStart die Plugins durch den Parser schicken kann und dort erst die Plugins registriere, steht mir auch erst dort die Information zu Verfügung welche Plugins es überhaupt gibt. Und erst dort weiß ich dann überhaupt welche Res Ordner die anderen plugins haben.
Ich habe die RegisterTag() Methode aus den Header Dateien geöffnet und gesehen dass vor jedem RegisterTag eine Description registriert wird. Siehe hier:
>
\> Bool RegisterTagPlugin(LONG id, const String &str;, LONG info, DataAllocator \*npalloc, const String &description;, \> BaseBitmap \*icon, LONG disklevel, void \*emulation) \> { \> if (description.Content() && !RegisterDescription(id,description)) return FALSE; <-------- \> \> TAGPLUGIN np; \> ClearMem(&np;,sizeof(np)); \> FillTagPlugin(&np;,npalloc,info,disklevel,icon,emulation); \> return GeRegisterPlugin(C4DPL_TAG,id,str,&np;,sizeof(np)); \> } \>
Also habe ich zwei Sachen versucht.
1. Ich habe versucht überhaupt einen anderen Res Ordner zu registrieren (mit der Möglichkeit die bei dir ja zu funktionieren scheint).
2. Zum anderen habe ich dann dein Beispiel genommen und RegisterDescription() aus der originalen RegisterTag abgeändert da ich dann dort ja weiß wo sich das Plugin befindet.
Soll ich eventuell mal ein bischen Code posten?
Liebe Grüße,
Shawni
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2009 at 14:03, xxxxxxxx wrote:
Ah ok, jetzt verstehe ich.
Ich habe mir gerade mal die GeResource klasse angesehen. Theoretisch sollte es auch in PluginStart() möglich sein die GeResource zu allozieren und zu initialisieren, da man auch neuinitialisieren kann.
Edit: jup habs grad mal probiert. Konnte in PluginStart die resource initialisieren,die LocalResource mit Get() kriegen und RegisterDescription(id,"Ttest",local) hat TRUE zurückgegeben. Scheint also einwandfrei zu funktionieren. Hmm, das ist natürlich komisch dass das bei dir nicht funktioniert. Etwas Code wäre sicherlich hilfreich.