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

    How to GePrint variables..

    SDK Help
    0
    5
    421
    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

      On 12/04/2014 at 08:58, xxxxxxxx wrote:

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

      ---------
      Hi really silly basic question here:

      How do i print variables and objects to the C4D console?

      I know i can use something like:

      GePrint(LongToString(myLong));
      

      But is there an easier way if you have a lot of different variable types and objects?

      Transitioning from Python where i could pretty much just say Print(myObjectOrVariable) and it`d dump it onto the console..

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

        On 12/04/2014 at 09:27, xxxxxxxx wrote:

        Just write some wrapper functions for your own use. Something like:

        inline void Print(const LONG x, String prefix = String())
        {
        GePrint(prefix + " " + LongToString(x));
        }

        If you want this to be done for any object, you would probably write some templates for it (with specializations for certain types).

        There are surely more ways but honestly, it's not worth the trouble. Just define some functions for your own use. Quick n dirty 😉

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

          On 12/04/2014 at 11:22, xxxxxxxx wrote:

          Cheers Katachi.  Quick and dirty is fine.  Transferring my plugin code from Python to C++, debugging is a little more tedious..

          Wonders if C++ 11 converts things to strings automatically *rolls eyes*

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

            On 12/04/2014 at 11:29, xxxxxxxx wrote:

            Won't happen.  The 'strings' that you will be using in the C4D C++ API are C4D Strings (class) and methods like LongToString() et al are what you have to work with.

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

              On 12/04/2014 at 11:46, xxxxxxxx wrote:

              Yeah i figured that might be the case 😕

              Slowly but surely getting accustomed to working in VS and C++..

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