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

    Plugin evaluating before button push

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 316 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 23/03/2017 at 13:16, xxxxxxxx wrote:

      I'm not sure yet if this is a noob question or not but I have a plugin dialogue with an edit text input and every time I type a letter it seems to be evaluating the code in the Command function. Is this normal? Shouldn't it be waiting for a button press to evaluate?

      Thanks

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

        On 24/03/2017 at 06:05, xxxxxxxx wrote:

        Hi,

        I know, we are in Python sub-forum, but in C++ docs, we have a code snippet, that fits your question quite well. Please take a look at the GeDialog manual (the code snippet under GeDialog::KillEvents()). Let me know, if you have problems with the C++ in there.

        On your last two questions, well, it of course depends highly on the use-case. A widget should be as flexible as possible to suit as many use-cases as possible. Think for example about the Commander (Shift-C) in Cinema 4D. It reacts to every key press (refining the search) and then executes when pressing enter. So my answers on your last two questions are yes and no.

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

          On 27/03/2017 at 09:44, xxxxxxxx wrote:

          Thanks Andreas! Rather then messing with the GeDialog I used a less experienced coders workaround and just put one condition at the start of the command function: "if id != 11050:" which is the id of the edit text field. Works like a charm!

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