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
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Fields and Adding an Effector

    Cinema 4D SDK
    c++ python r20 sdk
    2
    3
    721
    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.
    • D
      d_schmidt
      last edited by

      Hello! I have a situation where I'm adding a Random Effector to scene on a button press. That's working correctly, but when I save the scene and reopen it the Field interface and it seems to have reverted to the pre-R20 interface. I'm working in C++ but I managed to recreate the issue in Python for simplicity.

      Before I save and load the Falloff tab looks like this.
      alt text

      After I save and load it looks like this.
      alt text

      The code I'm using is here:

      import c4d
      from c4d import gui
      def main():
          randomEffector = c4d.BaseObject(1018643)#Random Effector ID
          doc.InsertObject(randomEffector)
          c4d.EventAdd()
      
      if __name__=='__main__':
          main()
      

      Is there a flag or something I'm missing?

      Thanks for any help,
      Dan

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi

        you have to send the following message to the object so it will switch internally from regular falloff to fields.

            randomEffector.Message(c4d.MSG_MENUPREPARE, doc)
        

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        D 1 Reply Last reply Reply Quote 1
        • D
          d_schmidt @Manuel
          last edited by

          @m_magalhaes

          Thank you! Works perfectly.

          Dan

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