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

    Resource file for radiogroup

    Scheduled Pinned Locked Moved PYTHON Development
    17 Posts 0 Posters 1.6k 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 24/01/2013 at 02:42, xxxxxxxx wrote:

      The first 'GROUP' needs to be 'RADIOGROUP'. Then it should work.

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

        On 24/01/2013 at 11:45, xxxxxxxx wrote:

        Sorry, that also did not work.

        file: echos.res
        CONTAINER ECHOS
        {
          NAME ECHOS;
          INCLUDE Obase;

        GROUP ECHOSSETTINGS
          {
              RADIOGROUP IDC_MYRADIOGROUP      <== error reading resource
              {
                  GROUP
                  {
                      COLUMNS 1;
                      RADIOGADGET IDC_RADIO1 { NAME IDS_RADIO1; }      
                      RADIOGADGET IDC_RADIO2 { NAME IDS_RADIO2; } 
                  }
              }
          }
        }

        File: echos.h
        enum
        {
            
          ECHOSSETTINGS = 1001,

        IDC_RADIO1  = 1007,
          IDC_RADIO2  = 1008,
         
          IDC_MYRADIOGROUP = 1009,
        };

        File: echos.str
        STRINGTABLE ECHOS
        {
          ECHOS "Echos";

        ECHOSSETTINGS "Echo Settings";

        IDS_RADIO1    "Radio button";
          IDS_RADIO2    "Radio button";
        }

        I did not edit c4d_symbols.h

        What could be wrong?

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

          On 24/01/2013 at 11:52, xxxxxxxx wrote:

          There are some .res files in the Maxon folder hierarchy that might help you with the formatting.
          This is the PREF_DIALOG .res file:

          // C4D-DialogResource  
          DIALOG PREF_DIALOG  
          {  
            NAME DIALOG_TITLE;  
              
            GROUP   
            {  
            ALIGN_TOP; ALIGN_LEFT; SIZE 0, 0;   
            BORDERSIZE 4, 4, 4, 4;   
            COLUMNS 1;  
            SPACE 4, 4;  
              
          //    STATICTEXT  { NAME HELLO_WORLD; CENTER_V; FIT_H; SIZE 0, 0; }  
            RADIOGROUP DEL_GROUP  
            {  
              GROUP  
              {  
                  COLUMNS 1;  
                  RADIOGADGET IDC_RADIO1 { NAME IDS_RADIO1; ALIGN_TOP; ALIGN_LEFT; SIZE 0, 0;  }  
                  RADIOGADGET IDC_RADIO2 { NAME IDS_RADIO2; ALIGN_TOP; ALIGN_LEFT; SIZE 0, 0;  }  
                    
              }  
          }  
            }  
            GROUP LIST_GRP  
            {  
                LISTVIEW IDC_LIST { SCALE_H; SCALE_V; SIZE 150,100; };  
            }  
            DLGGROUP { OK; CANCEL; }  
          }
          

          -ScottA

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

            On 24/01/2013 at 11:56, xxxxxxxx wrote:

            Wait a moment. You're writing a description, aren't you? Because you've got this:

              
            CONTAINER ECHOS   
            {   
                NAME ECHOS;   
                INCLUDE Obase;   
            

            That code is used for descriptions, not dialogs, but the radio buttons can only be used in dialogs. Did you edit the .res file by hand to add CONTAINER, etc.?

            I assumed when you said you used ResEdit that you were building a dialog. Your resource file would work, in that case. But it won't in a description.

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

              On 24/01/2013 at 12:06, xxxxxxxx wrote:

              I do not know the difference between a description and a dialog.

              I'm trying to create a tag.
              That was ok, until I wanted to add radiobuttons.
              In above code I stripped most of the other code to pinpoint the error.

              This is the code I use to register my tag plugin.

              plugins.RegisterTagPlugin(id=PLUGIN_ID, str="Echos.", info=c4d.TAG_VISIBLE|c4d.TAG_EXPRESSION, g=ECHOS, description="echos",  icon=bmp)

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

                On 24/01/2013 at 12:07, xxxxxxxx wrote:

                Also, I'm not using the ResEdit anymore.
                I do it by 'manually' editing the .res, .h and .str files.

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

                  On 24/01/2013 at 12:18, xxxxxxxx wrote:

                  A dialog is the user interface you see in a dialog. Like the C4D preferences, that's a dialog.

                  A description is what you see in the attribute manager, or the material editor. The two things are completely different but have enough similarities to be really confusing. Some elements are found in both, like GROUP. Some elements which look alike occur in both interface types but with different names. Some can only be used in one or other interface, such as RADIOGADGET (dialog only).

                  If you're writing a tag, you need a description, so see 'Description resource' in the SDK. Descriptions tend to follow a set pattern so for most tags you will see something like this (taken from one of my tags) :

                    
                  CONTAINER Txgenattach   
                  {   
                       NAME Txgenattach;   
                       INCLUDE Texpression;   
                    
                       GROUP ID_TAGPROPERTIES   
                       {   
                  

                  The INCLUDE line adds the Priority drop down in the Basic tab. The GROUP named ID_TAGPROPERTIES will create a tab named 'Tag'. And so on.

                  Never use the resource editor for descriptions, it won't work. (Some would say, never use the resource editor!)

                  In your case you can't use radio buttons, try a drop-down instead (look for the LONG element with CYCLE flag).

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

                    On 24/01/2013 at 12:35, xxxxxxxx wrote:

                    If I understand correctly, a description is in fact describing the object and its attributes.
                    A dialog is asking the user to select certain options.
                    What if I use python to build up the dialog instead of a resource file?
                    E.g.
                            self.AddRadioGroup(1000, c4d.BFH_SCALEFIT, 1)
                            self.AddChild(1000, 0, 'Radio A')

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

                      On 24/01/2013 at 12:57, xxxxxxxx wrote:

                      You cannot use a dialog as a description (from Python), therefore this won't have any use for you.
                      Instead of the radio-elements, you could use the QUICKTABRADIO customgui. Example:

                              LONG PR1M_ALIGNMENT_Y {
                                  CUSTOMGUI QUICKTABRADIO;
                                  CYCLE {
                                      PR1M_ALIGNMENT_MINUS;
                                      PR1M_ALIGNMENT_CENTER;
                                      PR1M_ALIGNMENT_PLUS;
                                  }
                              }
                      

                      Looks like this:

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

                        On 24/01/2013 at 13:01, xxxxxxxx wrote:

                        It won't work. AddRadioGroup etc. are members of GeDialog, so you need a dialog to use them. They can't be used in a description.

                        If you want the user to be able to select one option from a range of them use a LONG like so:

                          
                        LONG MY_CHOICES { CYCLE { OPTION_1; OPTION_2; OPTION_3; } }   
                        

                        Then you can find the option the user chose by accssing the BaseContainer for the tag (C++, sorry) :

                          
                        BaseContainer *bc = myTag->GetDataInstance();   
                        if(bc)   
                        {   
                            LONG user_choice = bc->GetLong(MY_CHOICES);   
                            if(user_choice == OPTION_1)   
                                // do something   
                            // etc.   
                        
                        1 Reply Last reply Reply Quote 0
                        • H Offline
                          Helper
                          last edited by

                          On 24/01/2013 at 13:10, xxxxxxxx wrote:

                          Originally posted by xxxxxxxx

                          Instead of the radio-elements, you could use the QUICKTABRADIO customgui.

                          I'd forgotten about that, good reminder, thanks. A bit non-standard but it works.

                          (Probably I'd forgotten because it is not documented in the SDK as with several other description elements.)

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

                            On 24/01/2013 at 13:13, xxxxxxxx wrote:

                            So, why is it then possible, that I can create Radio buttons using User Data.
                            Isn't that also a description?

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

                              On 24/01/2013 at 14:00, xxxxxxxx wrote:

                              it is possible, it is the long customgui RADIOBUTTONS. the c4d description documenation
                              is joke. in the python docs is none at all and the cpp documenation only contains 50% of 
                              the flags.

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

                                On 24/01/2013 at 15:29, xxxxxxxx wrote:

                                Originally posted by xxxxxxxx

                                the c4d description documenation
                                is joke. in the python docs is none at all and the cpp documenation only contains 50% of 
                                the flags.

                                Sad, but true. It really needs a good work up.

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