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

    Dialog without CommandData

    SDK Help
    0
    5
    465
    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 08/11/2016 at 02:13, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R18 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello.

      Is it necessary for a GeDialog to be attached to a CommandData plugin ?
      It seems that I cannot use  the strings defined in my_dialog.str.

      What should I do differently to have dialog that starts by pressing a button in my MaterialData plugin ?
      Can I use res and str files ?
      Is there any limitation ?

      Thank you.

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

        On 08/11/2016 at 04:28, xxxxxxxx wrote:

        There's no such limitation. Only the dialog cannot be restored into the layout when it is not "attached" to
        a CommandData plugin.

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

          On 09/11/2016 at 02:07, xxxxxxxx wrote:

          Hi,

          are we talking about a modal/synchronous or non-modal/asynchronous dialog here?

          The first option would be possible, but is (for obvious reasons) not really recommended in NodeData based plugins.

          For the second option, there's a little more to it than Niklas outlined. You'd need to store the dialog somewhere (i.E. in a member variable). But you'd also need to make sure, the dialog exists only once (something a CommandData guarantees). You'd have to consider all kinds of situations like copies of the material (CopyTo()) in case of rendering or undo. And you would also have to make sure to work with the dialog from main thread only. We'd recommend to not do this (and have all kinds of stability issues in mind) and rather go a slightly different route, like it is done for example in some of C4D's tags.

          Implement a CommandData which is hosting the dialog and then in your MaterialData plugin use CallCommand() in reaction to the button.

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

            On 09/11/2016 at 12:18, xxxxxxxx wrote:

            Hello.

            I use Asynchronous dialogs (non-modals).
            What I try to do is to create a helper/manual dialog like the one you have in Show Help... option after right-clicking an object in the hierarchy. It will show only one html page (which is stored in a customgui Html Viewer parameter).

            Thank you for your time and for your help.

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

              On 09/11/2016 at 12:22, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              You'd need to store the dialog somewhere (i.E. in a member variable).

              Doesn't that go without saying? It's not like the C4D SDK is a mutation that doesn't inherit C++ restrictions. 🙂

              Originally posted by xxxxxxxx

              But you'd also need to make sure, the dialog exists only once (something a CommandData guarantees)

              I am unsure about this one though. In what cases would this be a problem other than that you simply get multiple indepdent instances of your dialog?

              -Niklas

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