Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Set another path for res files?

    SDK Help
    0
    29
    15.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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 🙂

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            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.. 🙂

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                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); \> }

                😉

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    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".

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

                        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

                        1 Reply Last reply Reply Quote 0
                        • H
                          Helper
                          last edited by

                          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.

                          1 Reply Last reply Reply Quote 0
                          • H
                            Helper
                            last edited by

                            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)?

                            1 Reply Last reply Reply Quote 0
                            • H
                              Helper
                              last edited by

                              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...

                              1 Reply Last reply Reply Quote 0
                              • H
                                Helper
                                last edited by

                                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?

                                1 Reply Last reply Reply Quote 0
                                • H
                                  Helper
                                  last edited by

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    Helper
                                    last edited by

                                    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?

                                    1 Reply Last reply Reply Quote 0
                                    • H
                                      Helper
                                      last edited by

                                      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

                                      1 Reply Last reply Reply Quote 0
                                      • H
                                        Helper
                                        last edited by

                                        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.

                                        1 Reply Last reply Reply Quote 0
                                        • H
                                          Helper
                                          last edited by

                                          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                          On 03/03/2009 at 14:28, xxxxxxxx wrote:

                                          Okay, I will check it with a new project. If this will fail, too, I will post it, maybe I just forgot something.. :

                                          1 Reply Last reply Reply Quote 0
                                          • H
                                            Helper
                                            last edited by

                                            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                            On 03/03/2009 at 17:01, xxxxxxxx wrote:

                                            yeeeehaaa.. it works. oh, thats really cool.3D Designer.. thx.

                                            I know whats the problem. GeResource::Init failed becaue custom_res should contain the res folder.

                                            In my case I renamed the res folder to custom_res. 😞 Oh damn.. but now it works. I already wrapped the TagData and works fine. That will be a cool update.

                                            Thanks again.. 🙂

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post