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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Reading console output - possible?

    Cinema 4D SDK
    r20 c++ python
    4
    11
    2.1k
    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.
    • J
      jwzegelaar
      last edited by r_gigante

      Hi!

      For our render plugin we like to read in the C4D console at startup. In there is information about plugin version for example that we can cross-reference.

      Is there a way to access these lines? Or export it.

      In R20 there is new feature to export the console, that can be very useful. Only problem is that it only exports new lines.

      Hopefully there is another way to do this?:)

      All tips are welcome!

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by

        See here, https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_loggerinterface.html#page_maxonapi_loggerinterface_types

        Just a guess, but it seems, that you are able to strip down all logged lines and create a parser around that. Would be nice, if someone could confirm that.

        1 Reply Last reply Reply Quote 1
        • a_blockA
          a_block
          last edited by a_block

          Hi,

          @mp5gosu already pointed to the LoggerInterface manual, there the last code snippet is actually what you are looking for.

          Small request from our side: You may want to consider using tags to categorize your threads (as I did here now) to help to keep this forum tidy and searchable.

          Lastly, we have introduced the new Q&A workflow in this forum. I exemplary turned this thread into a question, to demonstrate this new feature. I hope you don't mind.

          Cheers,
          Andreas

          1 Reply Last reply Reply Quote 0
          • J
            jwzegelaar
            last edited by

            Hi mp5gosu & Andreas,

            Thanks for the help! This should do the trick!

            I need to convert this to Python, since I don't know C++, should start learning that soon.

            Any help with this would be awesome of course!

            And thanks for the change to the new workflow, will keep this in mind!:)

            1 Reply Last reply Reply Quote 0
            • P
              pim
              last edited by pim

              Ok, so it is possible in c++.
              Is it also possible in python?
              I could not find anything in the manual.

              -Pim

              1 Reply Last reply Reply Quote 0
              • a_blockA
                a_block
                last edited by

                Hi Pim,

                in Python this is currently not yet possible. While there are first pieces of MAXON API in Python in R20, it is far from complete yet. Expect this to improve during the next versions.

                Oh, one more thing:
                Please don't get me wrong, we are all new here in this forum, so I'd rather mention things multiple times then forgetting about it. Please make use of the forums tagging system. In this case for example, a Python tag could have changed the answers overall.

                Cheers,
                Andreas

                P 1 Reply Last reply Reply Quote 0
                • P
                  pim @a_block
                  last edited by

                  @a_block
                  I'm sorry. I will in future.

                  Question: can you direct me to an example of calling a c++ function from Python.
                  This c++ could then get me the console output in Python.

                  1 Reply Last reply Reply Quote 0
                  • a_blockA
                    a_block
                    last edited by

                    Hello Pim,

                    no need to apologize, we are just trying to guide everybody with this new forum and how we think, we can make most of it. I hope you don't mind.

                    Yannick just recently demonstrated, how to access C++ function from Python. See Add functions to python via C++ SDK [R20].

                    Cheers,
                    Andreas

                    1 Reply Last reply Reply Quote 0
                    • P
                      pim
                      last edited by

                      Ok, I managed to do it in R20.
                      Question is now is this also possible in R19.
                      In the manual I did not find any reference to logger or logging.
                      I could not find LoggerInterface.

                      So, how to do this in R19?
                      There are still a lot of users who uses R19!

                      -Pim

                      1 Reply Last reply Reply Quote 0
                      • a_blockA
                        a_block
                        last edited by

                        Hello Pim,

                        the LoggerInterface is all new in R20, based on technology of the new core. There are no plans to back-port this to R19. In R19 and before there is no similar access to the Console, so it is unfortunately not possible.

                        Bye,
                        Andreas

                        1 Reply Last reply Reply Quote 0
                        • P
                          pim
                          last edited by

                          I already guessed so.
                          Thanks, I think we can close this post.

                          -Pim

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