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

    DIALOG CONTAINS DESC DATA

    Cinema 4D SDK
    3
    9
    915
    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.
    • K
      kng_ito
      last edited by m_adam

      Hi,

      I found that some of dialogs contain desc datas unlike others, for example Soft Selection Manager and Weight Manager. Also, those dialog's .res files are located in description folder, not dialogs folder.
      スクリーンショット 2019-09-28 13.41.43.png
      And I tried to make a command plugin that open a dialog including desc datas via .res file in description folder, but I'm not sure how it works.

      Does anyone know the way to build a dialog with those resources (especially Spline GUI) ?
      I hope I'm not asking stupid question.
      Thank you!

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by ferdinand

        Hi,

        I have not looked at the files, but given that both examples are tools: Are you sure that you actually looked at dialog definitions? My guess would be that the managers are just aGeDialog with a DescriptionCustomGui in it. This is then being set to the DescriptionToolData node of the tool.

        Which is also the answer for getting that description look in your dialog: Implement some kind of node and display it with a DescriptionCustomGui. But theSPLINE element works both in dialog (with some kinks here and there) and description definitions anyways.

        Cheers
        zipit

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 1
        • M
          m_adam
          last edited by

          Hi @kng_ito first of all welcome in the plugincafe community.

          on't worry I've setup your topic correctly, but please for the next ones apply:

          • Q&A New Functionality.
          • How to Post Questions especially the tagging part.

          Regarding your question it can be achieved with GeDialog::LoadDialogResource for more information see Dialog Layout and Dialog Resource.

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by ferdinand

            @m_adam said in DIALOG CONTAINS DESC DATA:

            Regarding your question it can be achieved with GeDialog::LoadDialogResource for more information see Dialog Layout and Dialog Resource.

            Hi,

            unless I misread the question of @kng_ito: I think this is a misunderstanding, i.e. this answer is not correct. @kng_ito was not asking how to load a dialog resource file system into a dialog, but if there is a possibility to load a description resource into a dialog.

            You cannot just load a description resource into a dialog with GeDialog::LoadDialogResource(); the method is restricted to loading dialog resources. Or am I wrong about this? I am slightly confused 🧐.

            Cheers
            zipit

            MAXON SDK Specialist
            developers.maxon.net

            M 1 Reply Last reply Reply Quote 0
            • M
              m_adam @ferdinand
              last edited by m_adam

              @zipit said in DIALOG CONTAINS DESC DATA:

              @m_adam said in DIALOG CONTAINS DESC DATA:

              Regarding your question it can be achieved with GeDialog::LoadDialogResource for more information see Dialog Layout and Dialog Resource.

              Hi,

              unless I misread the question of @kng_ito: I think this is a misunderstanding, i.e. this answer is not correct. @kng_ito was not asking how to load a dialog resource file system into a dialog, but if there is a possibility to load a description resource into a dialog.

              You cannot just load a description resource into a dialog with GeDialog::LoadDialogResource(); the method is restricted to loading dialog resources. Or am I wrong about this? I am slightly confused 🧐.

              Cheers
              zipit

              You are right sorry. I thought he only wanted to load from .res file which then need to be added to the res/dialog/ folder.

              Then if it's a description he has to use as you already mentioned the DescriptionCustomGui.
              You cna find usage example in activeobject.cpp and gedialog_gadgets.cpp.

              Cheers,
              Maxime.

              Cheers,
              Maxime.

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • K
                kng_ito
                last edited by

                @zipit @m_adam
                Sorry, I forgot to mention that I'm developing in Python.
                Thanks to your help, I seem to be able to display DescriptionCustomGui in my dialog only if I set an object to display via SetObject(), but this time I'm not seeking to display description of existing objects.
                I'm still confused how to load .res file in description folder and display gadgets in my dialog.
                Or is that impossible with .pyp ?

                1 Reply Last reply Reply Quote 0
                • M
                  m_adam
                  last edited by

                  Hi, @kng_ito If you take an example the weight manager.

                  There is 2 plugins registered.
                  A ToolData that will have like all tool a description.
                  And a CommandData that will display the description of this ToolData using c4d.plugins.FindPlugin to retrieve the BasePlugin of the ToolData and then SetObject with this BasePlugin.

                  The real question, is what do you try to do? Why does using a res file is important for you? Why you don't want to load a res file located in the dialog folder?

                  Cheers,
                  Maxime.

                  MAXON SDK Specialist

                  Development Blog, MAXON Registered Developer

                  ferdinandF 1 Reply Last reply Reply Quote 0
                  • ferdinandF
                    ferdinand @m_adam
                    last edited by ferdinand

                    @m_adam said in DIALOG CONTAINS DESC DATA:

                    There is 2 plugins registered. A ToolData that will have like all tool a description. And a CommandData that will display the description of this ToolData using c4d.plugins.FindPlugin to retrieve the BasePlugin of the ToolData and then SetObject with this BasePlugin.

                    Hi,

                    I am not trying to be an asshole, but I think this is also wrong (and might confuse @kng_ito). ToolData plugins have a GeDialog based GUI and while their connected BasePlugin does have a description, it will not contain the GUI of the tool. So displaying the BasePlugin base of a ToolData plugin in a DescriptionCustomGui shouldn't do much. Or am I wrong ?

                    The approach described by @m_adam only works with DescriptionToolData. This type however is only available in C++. In Python you have to implement any of the other NodeData types (e.g. ObjectData, ShaderData, etc.) and display them in your dialog. On a side note: I am not sure if you can display floating nodes (nodex that are not part of the current scene graph) in a DescriptionCustomGui. You might have to add that node as a hidden node to your current document (which would make things even more messy).

                    Cheers
                    zipit

                    MAXON SDK Specialist
                    developers.maxon.net

                    1 Reply Last reply Reply Quote 0
                    • M
                      m_adam
                      last edited by m_adam

                      You are right @zipit is not a ToolData but a DescriptionToolData.

                      Note that in Python you can register a SculptBrushToolData which derive from DescriptionToolData.

                      But for me, my previous questions are still relevant, what's your final need, and why do you strickly need your dialog to be constructed this way?

                      Cheers,
                      Maxime.

                      MAXON SDK Specialist

                      Development Blog, MAXON Registered Developer

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