Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Plugin ID Collisions

    Scheduled Pinned Locked Moved SDK Help
    14 Posts 0 Posters 1.1k Views
    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 Offline
      Helper
      last edited by

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

      On 10/10/2012 at 22:15, xxxxxxxx wrote:

      inside your *.xcodeproj folder (yes, it's a folder, osx just hides it from you) there's a project.pbxproj. I always do a string replace of "cinema4dsdk" with my project title when i copy the project files from the sdk. That way i'm sure there is no name conflict.

      I don't really remember which occurrence caused that problem for me, so i replace all to be safe 😉

      You can also just try and replace all occurrences of "cinema4dsdk" in your project tree

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

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

        On 10/10/2012 at 23:28, xxxxxxxx wrote:

        Also search for "Product Name" in your Xcode project settings and change it to something unique. I've had the same problem some years ago where SurfaceSPREAD would collide with other plugins even though it had a unique ID. Changing the product name helped for some weird reason that only Xcode fans understand ^^

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

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

          On 11/10/2012 at 09:58, xxxxxxxx wrote:

          Thanks to both of you, I've got them working now. I would never have looked inside the xcodeproj to try to fix it.  Thanks a ton.

          Also, I saw a couple threads about SetCallBackURL but none of them had answers, does any one know how it interacts with a HTML custom gui?  Can you get feedback back from it with SetCallBackURL?
          Dan

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

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

            On 15/10/2012 at 03:41, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            Also, I saw a couple threads about SetCallBackURL but none of them had answers, does any one know how it interacts with a HTML custom gui?  Can you get feedback back from it with SetCallBackURL?

            Hi Dan,
             
            The URL callback is called whenever a new URL has been selected, either if the user clicked on a link or if the plugin programmer calls HtmlViewerCustomGui::SetUrl(). In the callback you then have access to the string URL of the new page and information on the string encoding.

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

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

              On 15/10/2012 at 08:39, xxxxxxxx wrote:

              Thanks, Yannick.

              What I'm mainly confused about is the syntax for calling the function. Would I do:

                    
              //virtual Bool CreateLayout(void)  
                  
                     viewer = AddCustomGui(DIALOGID, CUSTOMGUI_HTMLVIEWER, "pyBROWSER", BFH_SCALEFIT|BFV_SCALEFIT, 512, 250, bc);  
                      
                      
                    HtmlViewerCustomGuiURLCallback callback;  
                    HtmlViewerCustomGui* view;  
                    view = (HtmlViewerCustomGui* )viewer;  
                    view->SetURLCallback(callback, <#void *user_data#>)  
                      
                    view->SetUrl("https://www.google.com/", URL_ENCODING_UTF16);  
                      
              

              If that's right, what would userdata be in this circumstance?
              And how would I set up the call to that callback?

              Dan

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

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

                On 15/10/2012 at 09:36, xxxxxxxx wrote:

                A callback is a function, so here's how you can define it for the HtmlViewerCustomGui:

                void htmlViewerCallback(void* user_data, const String& url, LONG encoding, void* reserved)
                {
                    GePrint(url);
                }
                  
                virtual Bool CreateLayout(void)
                {
                    ...
                    htmlViewer->SetURLCallback(htmlViewerCallback, NULL);
                    ...
                }
                

                The user data is used to have a custom object accessible in the callback so you can set it to NULL if you don't need it. The user data could be set to htmlViewer if you want to access the HtmlViewerCustomGui from the callback for example.

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

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

                  On 15/10/2012 at 13:10, xxxxxxxx wrote:

                  Thank again Yannick.

                  Should I be able to just cop and paste that?  I've been trying to get it working but I've been getting an error saying that there's "no function call to SetURLCallback(<unresolved overloaded function>,Null)".

                  I've been reading though your last post here, but I haven't had any luck with that either.  
                  Thanks for all the help.

                  Dan

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

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

                    On 15/10/2012 at 17:54, xxxxxxxx wrote:

                    Callback methods can be very confusing unless you see a full working example of them in action.
                    So maybe this example will help.

                    This is the entire .cpp code for a very basic dialog plugin example with no external resources.
                    When the plugin opens. The HtmlViewerCustomGui fetches the Google website and displays it in the plugin.
                    When the button is clicked. It loads the Maxon website. Plus... it also calls to the htmlViewerCallback() method and runs the code inside of it.
                    In this case it just prints url.

                    Example:

                    // Testing ID# Only!!!!   Be sure to use a unique ID obtained from www.plugincafe.com  
                    #define PLUGIN_ID 1000006  
                      
                    #include "c4d.h"  
                    #include "gui.h"  
                    #include "c4d_symbols.h"  
                    #include "customgui_htmlviewer.h"  
                      
                    enum  
                    {  
                      MY_HTML_VIEWER = 5000,  
                      MY_LABEL,  
                      MY_BUTTON,  
                      _dummy  
                    };  
                      
                    class myDialog : public GeDialog  
                    {  
                      private:  
                          HtmlViewerCustomGui *viewer;  
                          C4DGadget *myButton;  
                      
                      public:  
                          myDialog(void);  
                          virtual Bool CreateLayout(void);  
                          virtual Bool InitValues(void);  
                          virtual Bool Command(LONG id,const BaseContainer &msg);  
                    };  
                      
                    //This is a custom callback method that will print the url of the webpage when the button is clicked  
                    void htmlViewerCallback(void* user_data, const String& url, LONG encoding, void* reserved)  
                    {  
                      GePrint(url);  
                    }  
                      
                      
                    //The constructor  
                    myDialog::myDialog(void){}  
                      
                    Bool myDialog::CreateLayout(void)  
                    {  
                      SetTitle("Simple HTML Viewer Example");  
                      
                      GroupBegin(0,BFH_SCALEFIT,2,0,"",0);  
                      {  
                          AddStaticText(0,BFH_LEFT,0,0,"My Viewer",0);  
                          myButton = AddButton( MY_BUTTON, BFH_SCALEFIT, 80,  15, "Load HTML Page");  
                      }  
                      GroupEnd();  
                      
                      //Set up the HtmlViewerCustomGui stuff  
                      BaseContainer htmlc;  
                      viewer = (HtmlViewerCustomGui* )AddCustomGui(MY_HTML_VIEWER, CUSTOMGUI_HTMLVIEWER, "HTML_WINDOW", BFH_SCALEFIT|BFV_SCALEFIT, 512, 250, htmlc);  
                      viewer->SetUrl("https://www.google.com/", URL_ENCODING_UTF16);  
                      
                      return TRUE;  
                    }  
                      
                      
                    Bool myDialog::InitValues(void)  
                    {      
                      return TRUE;  
                    }  
                      
                    Bool myDialog::Command(LONG id,const BaseContainer &msg)  
                    {  
                            
                      switch (id)  
                      {  
                            
                          case MY_BUTTON:  
                              if (MY_BUTTON)  
                              {  
                                  viewer->SetUrl("http://maxon.net", URL_ENCODING_UTF16);  //Load this HTML page  
                                  viewer->SetURLCallback(htmlViewerCallback, NULL);        //Execute whatever code is inside the htmlViewerCallback() method  
                              }  
                              break;  
                      
                      }      
                      
                      return TRUE;  
                    }  
                      
                      
                    ///////// The plugin registration section ///////////////  
                    class myHTMLviewer : public CommandData  
                    {  
                      private:  
                          myDialog dlg;  
                      
                      public:  
                          virtual Bool Execute(BaseDocument *doc);  
                          virtual Bool RestoreLayout(void *secret);          
                    };  
                      
                    Bool myHTMLviewer::Execute(BaseDocument *doc)  
                    {  
                      return dlg.Open(DLG_TYPE_ASYNC,PLUGIN_ID, -1, -1, 300,150);      
                    }  
                      
                    Bool myHTMLviewer::RestoreLayout(void *secret)  
                    {  
                      return dlg.RestoreLayout(PLUGIN_ID,0,secret);  
                    }  
                      
                    Bool RegistermyHTMLviewer(void)  
                    {  
                      return RegisterCommandPlugin(PLUGIN_ID,GeLoadString(IDS_HTML_VIEWER),0,AutoBitmap("icon.tif"),String("HTML Viewer"),gNew myHTMLviewer);      
                    }
                    

                    -ScottA

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

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

                      On 17/10/2012 at 14:17, xxxxxxxx wrote:

                      Thanks so much Scott, it works perfectly.

                      Is there a way to get any other type of information from a website besides a url?  For example could I get an array from a website or something similar?

                      Thanks a bunch!

                      Dan

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

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

                        On 17/10/2012 at 14:54, xxxxxxxx wrote:

                        Look up GetTextArea in the docs.
                        That function might possibly read the text in the loaded HTML page.
                        I never use this URL stuff. So I don't really know what all of the possibilities are.

                        I've have had difficulty with understanding how to use the callbacks in the SDK myself. And Yannick helped me understand how to use them in a previous thread.
                        That's really all I can offer advice about.

                        -ScottA

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

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

                          On 18/10/2012 at 11:11, xxxxxxxx wrote:

                          Thanks Scott.  I've been experimenting with the code you provided.  No luck yet but I'm going to keep trying.

                          Dan

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