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
    • Recent
    • Tags
    • Users
    • Login

    How can a tag safely modify objects?

    Scheduled Pinned Locked Moved PYTHON Development
    1 Posts 0 Posters 108 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 05/08/2014 at 18:42, xxxxxxxx wrote:

      Quick question:

      I'd like to modify the contents of a spline through a tag (the tag outright clears the spline and sets up all the points and segment stuff when it needs to). According to the Python SDK documentation, TagData.Execute() is called in a thread. The c4d.threading page then has this to say about forbidden functions:

      3.  Change the structure of objects attached to the scene.
      4.  Change parameters of elements attached to the scene (allowed, but not recommended except for tags).

      Does this apply to setting the points of a c4d.SplineObject() then calling Message(c4d.MSG_UPDATE)? If it does, how can I safely work around this? Would implementing locks be good enough, so that only one thread of the tag is ever accessing the SplineObject data at once? Or is there some way I need to message the main thread and perform the SplineObject modification there?

      -CMPX

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