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

    Message from Object or Tag to CommandData/GeDialog Plugin

    Cinema 4D SDK
    windows 2023 python
    2
    3
    485
    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
      datamilch
      last edited by

      hi there,

      i have a bunch of objects with userdata. then i have a GeDialog plugin with mostly the identical userdata. the dialog plugin is intended to control the objects from one common panel. but there might be cases, where the objects are adjusted direktly, so the dialog needs to be updated. i'm looking for a solution for this case.

      A)
      am i correct, the change of DIRTYFLAGS_DATA can not be tracked from GeDialog directly via the message system? i could only track things, that trigger a global event?
      i suppose it could be done with a timer, that checks the doc/objects every few millyseconds, but that feels very unprecise.

      B)
      with a python tag i can easily track the dirty status of objects, but from what i've read here, i can not send data (list of dirty objects) direkcly to the dialog/command plugin. i can just call my dialog and make it aware to look and find the dirty objects.

      C)
      there also seems to be c4d.GePluginMessage() and PluginMessage(). but i never found a clear statement, which plugin types are supported. i never even got c4d.GePluginMessage() to return True, which made me doubt myself a bit.

      so i would try to go with option B).
      any objections or completly different suggestions?
      cheers sebastian

      1 Reply Last reply Reply Quote 0
      • D
        datamilch
        last edited by

        oh well ... tried option B) as planned.
        a python tag tracks the dirty status of some objects and starts a c4d.SpecialEventAdd(). this is received as a core message in my dialog. but when i go looking for the dirty objects, they are not dirty anymore.
        my workaround for now is, to have a str userdata on the pyhon tag. once the tag detects a dirty object, it writes its name into the str userdata. my dialog can then read the name of the object and find it. feels quite cumbersome but works for now.

        would there be a better/more hidden way to store the data?

        i_mazlovI 1 Reply Last reply Reply Quote 0
        • i_mazlovI
          i_mazlov @datamilch
          last edited by

          Hi @datamilch,

          you can use the EVMSG_CHANGE message as a trigger to check your objects for changes. The timer approach might seem imprecise from the first glance, but can actually be used, I don't think there're any significant reasons against it. Additionally, the recent change was made to make BaseList2D being hashable. This effectively means you can operate with your objects in a dict.

          The python tag approach is the least efficient, although would still work, yes.

          You're saying your GeDialog plugin uses "mostly the ideantical userdata". If it was "identical", you could potentially use c4d.gui.DescriptionCustomGui with the SetObject function to make it point to your object. This way you can avoid hassling around all the data sync, because it is all handled as a built-in functionality of this class. This is how the attribute manager effectively works, or the Active Object Dialog as well.

          For your further postings please follow our guidelines on How to Ask Questions, namely:

          Please consolidate your questions into a singular posting by editing your last posting

          Cheers,
          Ilia

          MAXON SDK Specialist
          developers.maxon.net

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