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

    Sound File parameter in sound effector

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 274 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 13/04/2016 at 08:39, xxxxxxxx wrote:

      Hi there,
      I use the soundeffector[MGSOUNDEFFECTOR_FILE]="FileName"
      The pat change in the effector pannel but is not updated in the scene.
      I test with .Message(MSG_UPDATE) but it does not work!🤢

      Any help?⭐

      Tnx!👏

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

        On 14/04/2016 at 08:33, xxxxxxxx wrote:

        Hello Davide,

        welcome to the Plugin Café forums 🙂

        Unfortunately I'm not sure I will make you happy.
        First of all, you will need to set the filename as an user interaction, so the effector at least realizes, it has happened.

        soundeffector.SetParameter(c4d.MGSOUNDEFFECTOR_FILE, filename, c4d.DESCFLAGS_SET_USERINTERACTION)
        

        Note: Using SetParameter() is usually just another notation for "soundeffector[id] = x", but it is needed here in order to use the mentioned flag.

        Unfortunately this is not enough and there are two culprits with this.

        a) A message requester will pop up, asking the user, if he or she wants to copy the soundfile into the project directory. There's currently no way to suppress this, sorry.

        b) Although the effector now recognizes the new file, it still doesn't start to read the new file and update it's GUI or the effected entities. In Python there currently is no nice way to achieve this currently.
        The workaround I came up with, but I need to mention, that this might not be an ideal solution working in every place or context. Plus it is ugly as hell:

        c4d.CallButton(op, c4d.MGSOUNDEFFECTOR_PLAY) // turn playback on
        c4d.CallButton(op, c4d.MGSOUNDEFFECTOR_PLAY) // and off again
        

        Sorry.

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

          On 14/04/2016 at 12:20, xxxxxxxx wrote:

          Thank you Andreas,
          I think your solution will work for what I need to do
          I try soon

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