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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Getting the proper formatting/display on .RES

    Cinema 4D SDK
    macos python r23 sdk
    3
    8
    1.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.
    • mocolocoM
      mocoloco
      last edited by mocoloco

      Dear community,

      I getting on fight with my .res file and I still don't get the result I want.
      I would like to use 2 columns formatting and get the elements spreads on those columns, but for an unknown reason, the space filled by the columns are not as wide as the dialog itself.

      I really tried many options on the GROUP mGRPAXIS, with SCALE_H; on REALSLIDER elements or on the subgroups without success. Is that a limitation of the .RES / SDK in Python or is there a trick?
      In the meantime, all the elements of GROUP mGRPSCENE are properly formatted.

      Here the code of the .res file and the result I'm getting as a screenshoot. It's a work in progress dialog, but I would really like to understand if there is a way to get this or not? Can the sliders columns be as wide as the dialog?

      CONTAINER TmotionLab {
          
          NAME TmotionLab;
      
          GROUP {
      
              SEPARATOR { }
              STATICTEXT mPLUGIN_DEF                  {  }
              SEPARATOR { }
              
              GROUP mGRPSCENE {
                  DEFAULT 1;
      
                  GROUP {
                      STRING mPROJECT                 { ANIM OFF; SCALE_H; }
                  }
                  GROUP {
                      COLUMNS 2;
      
                      STRING mSCENE                   { ANIM OFF; SCALE_H; }
                      LONG mTAKE                      { MIN 1; MAX 200; STEP 1; ANIM OFF; }
                  }
              }
      
              GROUP mGRPAXIS {
                  DEFAULT 1;
                  SEPARATOR mSEP_GRP_A                { NAME mAXIS_EN; LINE; SCALE_H; FIT_H; }
      
                  GROUP {
                      COLUMNS 2;
                      LAYOUTGROUP;
                      
                      GROUP {
                          STATICTEXT mENPOS           { SCALE_H; }
                          BOOL mEN_TX                 { ANIM OFF; SCALE_H; }
                          BOOL mEN_TY                 { ANIM OFF; SCALE_H; }
                          BOOL mEN_TZ                 { ANIM OFF; SCALE_H; }
                      }
                      GROUP {
                          STATICTEXT mENROT           { SCALE_H; }
                          BOOL mEN_RX                 { ANIM OFF; SCALE_H; }
                          BOOL mEN_RY                 { ANIM OFF; SCALE_H; }
                          BOOL mEN_RZ                 { ANIM OFF; SCALE_H; }
                      }
                  }
              
                  SEPARATOR mSEP_GRP_B                { NAME mAXIS_MOTION; LINE; SCALE_H; FIT_H; }   
      
                  GROUP {
                      COLUMNS 2;
                      LAYOUTGROUP;
      
                      GROUP {
                          STATICTEXT mTRANSLATION     { SCALE_H; }
                          REAL mTX                    { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                          REAL mTY                    { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                          REAL mTZ                    { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                      }
      
                      GROUP {
                          STATICTEXT mROTATION        { SCALE_H; }
                          REAL mRX                    { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
                          REAL mRY                    { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
                          REAL mRZ                    { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
                      }
                  }
      
                  SEPARATOR                           { LINE; SCALE_H; }
                  BUTTON mREMOVE_MOTION               { ANIM OFF; }
              }
          }
      }
      

      Screenshot 2021-07-05 at 23.52.05.png

      Thanks a lot,
      Christophe

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

        Hi would it be possible to share your .str file and also your .h file?

        Moreover just to be sure you are using this Resource file for a BaseList2D description and not a GeDialog, isn'it?

        One thing to remember is that group scale according to their parent, but your first unnamed group is not scaled to SCALEFIT the all content.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • mocolocoM
          mocoloco
          last edited by

          Hi @m_adam,

          Good point, here the content for the both files.
          This .res is for a BaseList2D so SCALEFIT do not apply there.

          I hope it will helps...
          Thanks,

          Christophe

          TmotionLab.res

          STRINGTABLE TmotionLab
          {
          
              TmotionLab                  "Plugin";
              mPLUGIN_DEF                 "";
              
              mGRPSCENE                   "Scene informations";
              mGRPAXIS                    "Axis";
          
              mPROJECT                    "Project";
              mSCENE                      "Scene  ";
              mTAKE                       "Take   ";
          
              mAXIS_EN                    "Enabling";
              mAXIS_MOTION                "Motion";
              
              mENPOS                      "Translation";
              mTRANSLATION                "XYZ Translation";
              mEN_TX                      "tX";
              mEN_TY                      "tY";
              mEN_TZ                      "tZ";
              mROTATION                   "XYZ Rotation    ";
              mENROT                      "Rotation    ";
              mEN_RX                      "rX";
              mEN_RY                      "rY";
              mEN_RZ                      "rZ";
          
              mTX                         "tX";
              mTY                         "tY";
              mTZ                         "tZ";
              mRX                         "rX";
              mRY                         "rY";
              mRZ                         "rZ";
          
              mREMOVE_MOTION              "Remove motion";
          }
          

          And the TmotionLab.h,

          #pragma once
          
          enum
          {
              TmotionLab = 1000,
              mPLUGIN_DEF,
          
              mGRPSCENE = 1100,
              mGRPAXIS,
          
              mPROJECT = 1200,
              mSCENE,
              mTAKE,
          
              mSEP_GRP_A = 1300,
              mSEP_GRP_B,
          
              mTRANSLATION = 1400,
              mENPOS,
              mROTATION = 1450,
              mENROT,
          
              mEN_TX = 1500,
              mEN_TY,
              mEN_TZ,
          
              mEN_RX = 1600,
              mEN_RY,
              mEN_RZ,
          
              mTX = 2000,
              mTY,
              mTZ,
          
              mRX = 2200,
              mRY,
              mRZ,
          
              mREMOVE_MOTION = 5000,
          };
          
          
          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by

            Hello @everyone,

            do not mind me, but I thought this thread might be helpful here.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 1
            • mocolocoM
              mocoloco
              last edited by mocoloco

              Oh! I missed this thread... did thought about searching LAYOUTGROUP, thanks a lot @ferdinand; I going to try this right away and keep you in touch!

              Why all those tricks do not appears in SDK? maybe with a bunch of examples it will shorten the learning curve for a lot of people 😉

              Cheer,
              Christophe

              1 Reply Last reply Reply Quote 0
              • mocolocoM
                mocoloco
                last edited by

                Hi there,

                I finally end up to format all the elements the way I wand thanks to @ferdinand's link. Indeed STATICTEXT { JOINENDSCALE; } is the trick to proper format your elements when you want to use COLUMNS in GROUP.

                Here the result in picture,

                Screenshot 2021-07-08 at 05.17.03.png

                And the code extract from the .str for whom are interested,

                GROUP mGRPAXIS {
                    DEFAULT 1;
                
                    SEPARATOR { SCALE_H; }
                
                    GROUP {
                        DEFAULT 1;
                        COLUMNS 4;
                
                        STATICTEXT mPOSITION    { SCALE_H; }
                        STATICTEXT mENPOS       {  }
                        STATICTEXT mROTATION    { SCALE_H; }
                        STATICTEXT mENROT       {  }
                        STATICTEXT              { JOINENDSCALE; }
                    }
                
                    GROUP {
                        DEFAULT 1;
                        COLUMNS 4;
                
                        REAL mTX                { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                        BOOL mEN_TX             { ANIM OFF;}
                        REAL mRX                { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                        BOOL mEN_RX             { ANIM OFF; }
                        STATICTEXT              { JOINENDSCALE; }
                
                        REAL mTY                { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                        BOOL mEN_TY             { ANIM OFF; }
                        REAL mRY                { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                        BOOL mEN_RY             { ANIM OFF; }
                        STATICTEXT              { JOINENDSCALE; }
                        
                        REAL mTZ                { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                        BOOL mEN_TZ             { ANIM OFF; }
                        REAL mRZ                { MIN -100.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; SCALE_H; }
                        BOOL mEN_RZ             { ANIM OFF; }
                        STATICTEXT              { JOINENDSCALE; }
                    }
                
                    SEPARATOR                   { LINE; SCALE_H; }
                    BUTTON mREMOVE_MOTION       { ANIM OFF; }
                }
                

                Thanks again to the community and plugincafe!
                Cheers,

                Christophe.

                1 Reply Last reply Reply Quote 0
                • mocolocoM
                  mocoloco
                  last edited by mocoloco

                  I noticed by having a look on other .res files that there is a STATICTEXT { JOINEND; } that exists and can be applied on LAYERGROUP as well as STATICTEXT { NEWLINE; } but I didn't got the use of the last one as that does not create the "\r" or "\r\n" it should.

                  Didn't found any informations in the SDK (C++ nor Python) about JOINEND and JOINENDSCALE... those tags looks like to be undocumented.

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

                    Correct, thanks for poitning it I will add a task to improve documentation of Custom GUI 🙂

                    MAXON SDK Specialist

                    Development Blog, MAXON Registered Developer

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