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

    Sending OSC messages in C4D

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 1.2k 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

      On 25/05/2018 at 09:55, xxxxxxxx wrote:

      Hey all, 
      I'm trying to send servo angel values from cinema4D to a python script via OSC messages. But I'm having trouble running a simple OSC example code. I copied the osc-master folder in plugin and saved the examples in the script folder. when I execute the code, it gives me this error "no module named pythonosc". Does anyone know how to send OSC messages from C4D? PLEASE HELP!

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

        On 28/05/2018 at 05:24, xxxxxxxx wrote:

        Hi Parvin, first of all, welcome at PluginCafe.

        First of all, if you need to add a new module you should add it to the site-package of the python installation.
        For c4d you cna find this folder in your tempdir(CTRL + E => Open Preferences Folder) Then \library\python\packages\win64 (osx) according your OS.
        With that said, Cinema4D R19 use python 2.7.9 and it's compiled with MSCv17 (visual studio 2012) so if your module uses a DLL, you need to have the same version.

        Another thing, since you send OSC message, you may want to listen for an incoming message(aka create a server), in this case, a script is not the best solution since it's only executed once.
        You can consider doing a MessageData plugin in order to start an "infinite" thread which will listen for any new connection.
        You can also create a CommandData which will host a GeDialog, then in this GeDialog you will be able to catch some messages with CoreMessage(for example changes in a document, or simply a change in the document).

        In final it really depends on the purpose of your tool.

        Finally, I would like to remind you (or not since you are new at plugincafe) we can only offer support for C4D stuff, not for 3rd party issue. But since for the moment issue are from C4D side it's totally fine. And please, avoid cross-forum post.
        Some people may take time to answers on a given forum, while your first question is already solved on another one.

        If you need any help, or information do not hesitate!
        Cheers,
        Maxime

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