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

    tagplugin workflow

    PYTHON Development
    0
    4
    415
    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
      Helper
      last edited by

      On 27/09/2014 at 06:10, xxxxxxxx wrote:

      I have a tagplugin with userdata defined in Init(self, node).
      Of course only when if (len(node.GetUserDataContainer()) == 0).

      What I see happening is that for every change in the userdata Init(), Execute() and Message() are triggered.

      So, what is the best place to process user input?
      For example when a slider in Userdata is changed?

      I guess it should be Execute(). But Execute() is called in a thread context. and thus not everything is possible. For example gui.RenameDialog() is not possible "invalid cross-thread call".

      I can not use Message() because I do not know which message should I handle.
      It is not MSG_DESCRIPTION_COMMAND or MSG_DESCRIPTION_EDIT_ENTRY.

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

        On 30/09/2014 at 07:37, xxxxxxxx wrote:

        MSG_DESCRIPTION_COMMAND is triggered when your tag has a button that is pressed - that is the best location where to open GUI commands.

        Never call any blocking operations in TagData.Execute. Imagine you press play and a dialog opens for every frame.

        Cheers, s_rath

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

          On 30/09/2014 at 10:27, xxxxxxxx wrote:

          But how can I detect a slider interaction with MSG_DESCRIPTION_COMMAND?
          There is no data or id.

          What´s about

          if (type == c4d.MSG_DESCRIPTION_USERINTERACTION_END) :
          all ud values must be storerd in a variable and be compared for any userinteraction.

          Is this the best way to handle this?? Or just cumbersome?

          best wishes
          Martin

          edit or if it is a slider that should be updated in realtime
          if (type == c4d.MSG_DESCRIPTION_CHECKUPDATE)

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

            On 30/09/2014 at 23:46, xxxxxxxx wrote:

            So, what is the best place to process user input?
            For example when a slider in Userdata is changed?

            I guess it should be Execute(). But Execute() is called in a thread context. and thus not everything is possible. For example gui.RenameDialog() is not possible "invalid cross-thread call".

            I can not use Message() because I do not know which message should I handl

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