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

    R12 Exporter

    Scheduled Pinned Locked Moved SDK Help
    12 Posts 0 Posters 911 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 07/12/2011 at 12:21, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R12 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      hello all!

      http://imageshack.us/photo/my-images/689/39340302.jpg

        
          
          
          Object = Document->GetFirstObject();
          GeOutString(Object->GetName(), GEMB_OK);
      

      There is an error

      How to be run on all objects and will receive their names?

      Forgive for my English, I write through the translator

      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 08/12/2011 at 01:44, xxxxxxxx wrote:

        Here is an example how to iterate through all objects of a document and print their names.

          
        void WriteObjects(BaseObject *op)  
        {  
          while (op)  
          {  
              // do something, for example print name  
              GePrint(op->GetName());  
                
              WriteObjects(op->GetDown());  
              op=op->GetNext();  
          }  
        }  
          
          
        ...  
          
        WriteObjects(doc->GetFirstObject());  
        

        cheers,
        Matthias

        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 08/12/2011 at 04:10, xxxxxxxx wrote:

          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 08/12/2011 at 05:51, xxxxxxxx wrote:

            Please start Cinema from the Visual Sudio debugger to see where in your code Cinema is crashing.

            By the way, it is not necessary to pre-allocate a document (m_Document) for BaseDocument::Polygonize.

            Just write something like this:

              
            BaseDocument *m_Document = NULL;  
            m_Document = Doc->Polygonize();  
            

            cheers,
            Matthias

            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 08/12/2011 at 06:28, xxxxxxxx wrote:

              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 08/12/2011 at 06:37, xxxxxxxx wrote:

                Sorry, I can not debug your code for you. This is beyond the scope of the SDK support.

                Just an idea, have you tried to make your WriteObjects function not a class member?

                cheers,
                Matthias

                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 08/12/2011 at 07:17, xxxxxxxx wrote:

                  In that case I receive

                  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 08/12/2011 at 07:41, xxxxxxxx wrote:

                    Please try in a simple CommandData plugin if you get the same crash.

                    cheers,
                    Matthias

                    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 08/12/2011 at 10:20, xxxxxxxx wrote:

                      The same situation and with CommandData

                        
                      void WriteObjects(BaseObject* ParentObject)  
                      {  
                        while(ParentObject)  
                        {  
                            WriteObjects(ParentObject->GetDown());  
                            ParentObject = ParentObject->GetNext();  
                        }  
                      }  
                        
                      class CExporter : public CommandData  
                      {  
                      public:  
                        Bool Execute(BaseDocument* Document) {  
                            BaseObject* ParentObject = Document->GetFirstObject();  
                            WriteObjects(ParentObject);  
                        
                            return m_Dialog.Open(DLG_TYPE_ASYNC, ID_DIALOG,-1,-1);  
                        }  
                      private:  
                        CDialog m_Dialog;  
                      };  
                        
                      Bool PluginStart()  
                      {  
                        if(!RegisterCommandPlugin(ID_PLUGIN, "MyPlugin", 0, 0L, "Description", gNew CExporter))  
                        {  
                            return FALSE;  
                        }  
                          
                        return TRUE;  
                      }  
                        
                      void PluginEnd()  
                      {  
                      }  
                        
                      Bool PluginMessage(LONG ID, void* Data)  
                      {  
                        return FALSE;  
                      }  
                      
                      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 09/12/2011 at 06:17, xxxxxxxx wrote:

                        I used quite the same code some days ago and your iteration should definitely work.

                        1. What happens if you remove that dialog stuff?
                        2. Why are you using "CDialog"? Please use "GeDialog" or any of the classes derived from GeDialog.

                        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 09/12/2011 at 06:33, xxxxxxxx wrote:

                          c4dJack

                            
                          #ifndef DIALOG_H  
                          #define DIALOG_H  
                            
                          #include "preprocessor.h"  
                            
                          class CDialog : public GeDialog/*GeModalDialog*/  
                          {  
                          public:  
                           CDialog();  
                           virtual ~CDialog();  
                             
                            virtual Bool CreateLayout();  
                            virtual Bool InitValues();  
                            virtual Bool Command(LONG ID, const BaseContainer& Message);  
                          };  
                            
                          #endif   
                          
                            
                          CDialog::CDialog()  
                          {  
                          }  
                            
                          CDialog::~CDialog()  
                          {  
                          }  
                            
                          Bool CDialog::CreateLayout()  
                          {  
                            this->SetTitle("tool");  
                            GroupSpace(50, 50);  
                            
                            AddButton(BTN_SAVEMESH, BFH_LEFT, 0, 0, "Save");  
                             
                            return TRUE;  
                          }  
                            
                          Bool CDialog::InitValues()  
                          {  
                            return TRUE;  
                          }  
                            
                          Bool CDialog::Command(LONG ID, const BaseContainer& Message)  
                          {  
                            switch(ID)  
                            {  
                                case BTN_SAVEMESH:  
                                {  
                                    BaseDocument* Document = GetActiveDocument();  
                                    WriteObjects(ParentObject);  // <----------  
                            
                                    StatusSetText("Mesh saved");  
                                }  
                                break;  
                            }  
                            return TRUE;  
                          }  
                          
                          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 09/12/2011 at 07:15, xxxxxxxx wrote:

                            Ah, ok. You derived your CDialog class from GeDialog. That should be ok.

                            Anyway in your last piece of code there was a little error.

                              
                            Bool CDialog::Command(LONG ID, const BaseContainer& Message)   
                            {   
                                switch(ID)   
                                {   
                                    case BTN_SAVEMESH:   
                                    {   
                                        BaseDocument* Document = GetActiveDocument();   
                                        if (!Document) return FALSE; // <---------- FIX   
                                        WriteObjects(Document->GetFirstObject()); // <---------- FIX   
                              
                                        StatusSetText("Mesh saved");   
                                    }   
                                    break;   
                                }   
                                return TRUE;   
                            }   
                            
                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post