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

    Subdialog, title

    General Talk
    python
    2
    10
    2.1k
    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.
    • Passion3DP
      Passion3D
      last edited by Passion3D

      Sorry if my question is supid but,in a subdialog, how to change this title?
      I tried with self.SetTitle("title"), with self.GroupBegin(id, flags, cols, rows, title="title")
      but it doesn't change anything!

      Something must be slipping away from me.
      0_1550130419889_Dialog.png

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

        Hi Passion3D,

        I'm wondering why you are speaking of a SubDialog since it seems (from the screenshot) that you are actually in a description? (Correct me if I'm wrong)

        If so you have to modify your .res and especially the NAME parameter. See Resource Manual.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • Passion3DP
          Passion3D
          last edited by Passion3D

          Hi Maxime

          I didn't make an .res, but coded it in python. And I don't see where to change that title. Here my code:

          def CreateLayout(self):
              self.SetTitle("Options")
              self.GroupBegin(id=2000, flags=c4d.BFH_SCALEFIT, cols=1, rows=2, title="Options", c4dBFV_GRIDGROUP_ALLOW_WEIGHTS)
              self.AddStaticText(2100, c4d.BFH_LEFT, 0, 0, 0, txt(IDS_PARAMS_HELP))
          
          1 Reply Last reply Reply Quote 0
          • M
            m_adam
            last edited by m_adam

            Hi Passion3D, I'm sorry I didn't get the time to really dig into your issue. While I do not have a high expectation (because the title is defined in the description which host the passed subdialog, and this is not part of the SubDialog itself, so I'm doubtful about what can be done).

            But with that said, I will investigate more Monday and give you a definitive answer.
            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • Passion3DP
              Passion3D
              last edited by Passion3D

              No problem Maxime 🙂 take your time 😉
              It's just display and it doesn't stop me from developing the plugin

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

                Hi Passion3D, unfortunately, with SubDialog it's not possible to change this title bar, but with res file this is possible.

                in res/strings_en-US/description/toolexampleresource.str

                STRINGTABLE ToolExampleResource
                {
                        ToolExampleResource "ToolExampleResource";
                	TOOL_EXAMPLE_RESOURCE_MENU "This is a custom Text";
                	TOOL_EXAMPLE_RESOURCE_TEXT "Cliquez sur chaque object que vous voulez mettre sur le sol";
                }
                

                in res/description/toolexampleresource.h

                #ifndef TOOLEXAMPLERESOURCE_H__
                #define TOOLEXAMPLERESOURCE_H__
                
                enum
                {
                	TOOL_EXAMPLE_RESOURCE_MENU = 1000,
                	TOOL_EXAMPLE_RESOURCE_TEXT = 1001,
                };
                
                #endif // TOOLEXAMPLERESOURCE_H__
                

                And in res/description/toolexampleresource.res

                CONTAINER ToolExampleResource
                {
                	NAME ToolExampleResource;
                
                	GROUP TOOL_EXAMPLE_RESOURCE_MENU
                	{
                		DEFAULT 1;
                		STATICTEXT TOOL_EXAMPLE_RESOURCE_TEXT { ANIM OFF; }
                	}
                }
                

                I hope this answers more or less to your question.
                Cheers,
                Maxime.

                MAXON SDK Specialist

                Development Blog, MAXON Registered Developer

                1 Reply Last reply Reply Quote 1
                • Passion3DP
                  Passion3D
                  last edited by

                  Thank you Maxime
                  That's what I concluded. Too bad, it was easier for me to code in python 😉

                  1 Reply Last reply Reply Quote 0
                  • Passion3DP
                    Passion3D
                    last edited by

                    A little novice question 🙂
                    How do I load my resource description?
                    While searching in the archives, I understood (I translate with google) that ToolData was different from other plugins, it is not derived from nodedata but uses a subdialog.
                    So, let me know if I'm wrong., I can't use a resource description for the parameters of my tool?

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

                      Hey, Passion3D, this goes way deeper than I initially thought. So to make it short, in C++ Cinema 4D offers DescriptionToolData which inherit from ToolData. Sadly returning a description is only possible in DescriptionToolData and not ToolData and Python does not support DescriptionToolData.

                      But the nice stuff / tricky part to makes it work in Python is to use the SculptBrush which inherit from DescriptionToolData.

                      params = c4d.modules.sculpting.SculptBrushParams()
                      c4.dplugins.RegisterSculptBrushPlugin(id=PLUGIN_ID, str="YourPlugin",
                                                      info=0, icon=None, 
                                                      help="This string is shown in the statusbar",
                                                      sculptparams=params,
                                                      dat=ExampleTool())
                      

                      Then in your ScultBrushToolData derived class override these two methods

                          def GetToolPluginId(self):
                      	    return PLUGIN_ID
                      
                          def GetResourceSymbol(self):
                              return "ToolExampleResource"
                      

                      This allows you more options and powers since ScultBrushToolData is way more flexible than a simple ToolData.

                      If you have any question, please let me know.
                      Cheers,
                      Maxime.

                      MAXON SDK Specialist

                      Development Blog, MAXON Registered Developer

                      1 Reply Last reply Reply Quote 2
                      • Passion3DP
                        Passion3D
                        last edited by

                        Thank you Maxime, I'll test all this 😉

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