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

    i3DMouse - Turn your iPhone into a 3D mouse!

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 562 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 25/08/2011 at 21:06, xxxxxxxx wrote:

      Today my first iPhone app is released in Apple's AppStore. It's a 3D Mouse. The communication with C4D was created with a Python script. This script makes the connection via an UPD socket and REST.

      So, Python and C4D are fine! It's fast enough to handle real time inputs via an UDP socket.😄

      You will find more information and a demonstration video at http://www.dongleware.com/i3dmouse.php

      Regards, Meinolf

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

        I'm really really curious about how you've done the communication between Python and the iPhone. But I don't think your gonna show source code, do you ?

        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 26/08/2011 at 02:48, xxxxxxxx wrote:

          The part of the script which implements a threaded UDP communication is very simple and based on chapter 20.17.4.3 of this documentation: http://docs.python.org/library/socketserver.html

          To use an UDP connection instead of a TCP connection you have just change

          server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)  
            
          to  
            
          server=UDPServer(("0.0.0.0",UDPPort),UDPHandler)  
            
          and e.g.  
            
          class UDPHandler(SocketServer.BaseRequestHandler) :  
            def handle(self) :  
              data=self.request[0].strip()  
              print "%s wrote:" % self.client_address[0]  
              print data  
              cmd=json.loads(data)  
              if cmd['action']=="camMove":  
                ....  
            
            
          So the plugin gets the asynchronous packages in methode **UDPHandler::handle** from where you can handle the json string.  
            
          Very simple.  
            
          Meinolf  
          
          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/09/2011 at 02:07, xxxxxxxx wrote:

            Never done sth. with networking. Interesting, thank you ! 😉

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