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

    Control Cinema through external programm

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 459 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 02/06/2012 at 07:27, xxxxxxxx wrote:

      Hey guys,

      i'm quite new to the topic of c4d-programming and i'm trying to figure out if it is possible to write a plugin/ script that lets me control cinema form a different python and and let these communicate through sockets. So when Cinema starts it should ask the other process why to do. I already saw that its possible to launch code on startup using the startupscript, but cinema doesn't completely start until the script is finished. So I think my code has to be executed as a plugin. Am I right? Is it possible to start a plugin on c4d-startup?? As i said I'm quite new to the topic and this thing is quite trivial. I appreciate your help.

      regards
      Hanso

      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 02/06/2012 at 07:54, xxxxxxxx wrote:

        just to clarify. i think what i want to ask is:
        Is it possible to start a plugin on on c4d-startup and let it do stuff in the background??

        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 02/06/2012 at 08:31, xxxxxxxx wrote:

          Ok just got it to work using c4d.threading.C4DThread. Is this the way to go here??

          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 02/06/2012 at 11:14, xxxxxxxx wrote:

            Hi JohnnyJumper,

            you can either use c4d.threading.C4DThread or use the built-in threading module. Actually, I don't know if there are advantages on using the C4DThread.

            Here's what you could do for example:

            import socket  
            import threading  
              
            class MyThread(threading.Thread) :  
              
              def run(self) :  
                  client = socket.socket()  
                  client.connect(('localhost', 8080))  
              
                  # make stuff with the connection  
                  pass  
              
            def main() :  
              thread = MyThread()  
              thread.start()  
              
            if __name__ == "__main__":  
              main()
            

            Note that you can not make GUI operations in Cinema 4D from another thread.

            Cheers,
            Nik

            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 04/06/2012 at 01:11, xxxxxxxx wrote:

              Thank you Nik,

              threading is better than C4DThread because it works with R12 too. Thanks for the note on Gui operations.
              _
              _
              regards
              Hanso

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