Resource File Issue.. [SOLVED]



  • On 22/11/2016 at 03:57, xxxxxxxx wrote:

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

    ---------
    Hi,

    I'm having some issues with the res description for my ObjectData plugin ( not a Dialog but the actual plugin options/properties ).

    Basically i have two buttons inside a Group which has 2 Columns, so that the Buttons sit side-by-side.  This works great however they use the default scaling so that one button is bigger than the other and the two columns are not equal width..

    I've attempted to use SIZE and also EQUAL_ROWS etc, but i get 'Error reading resource' if i use any of that.  I'm sure this stuff worked in previous versions of C4D - any clues what i'm doing wrong here?

    The following generated from resEdit does not work in R16:

    GROUP IDC_STATIC
      {
        NAME IDS_STATIC1; ALIGN_TOP; SCALE_H; 
        BORDERSTYLE BORDER_NONE; BORDERSIZE 0, 0, 0, 0; 
        COLUMNS 1;
        
        GROUP IDC_STATIC
        {
          NAME IDS_STATIC; ALIGN_TOP; SCALE_H; 
          BORDERSTYLE BORDER_NONE; BORDERSIZE 0, 0, 0, 0; 
          COLUMNS 2;
          EQUAL_COLS; 
          
          BUTTON IDC_BUTTON1 { NAME IDS_BUTTON; ALIGN_TOP; SCALE_H; }
          BUTTON IDC_BUTTON2 { NAME IDS_BUTTON1; ALIGN_TOP; SCALE_H; }
        }
      }
    

    But a greatly cut-down version of it as follows works ok ( although i lose the formatting ) :

    GROUP IDC_STATIC
      {
        NAME IDS_STATIC1; SCALE_H;
        COLUMNS 1;
        
        GROUP IDC_STATIC
        {
          NAME IDS_STATIC; SCALE_H;
          COLUMNS 2;
          
          BUTTON IDC_BUTTON1 { NAME IDS_BUTTON; }
          BUTTON IDC_BUTTON2 { NAME IDS_BUTTON1; }
        }
      }
    

    Is it no longer possible to use that kind of formatting?



  • On 23/11/2016 at 01:18, xxxxxxxx wrote:

    Hello,

    please do not confuse Description Resources and Dialog Resources. Description resources describe the parameters of NodeData based plugins like your ObjectData based plugin. Dialog resources describe the layout of a GeDialog. These two resources are two different things that are different and have nothing to do with each other. ResEdit is only used to edit dialog resources, nothing else.

    "EQUAL_ROWS" only exists in dialog resources and is not valid for description resources.

    best wishes,
    Sebastian



  • On 02/12/2016 at 07:52, xxxxxxxx wrote:

    Hello Eclectrik,

    was your question answered?

    best wishes,
    Sebastian



  • On 02/12/2016 at 16:08, xxxxxxxx wrote:

    Hi Sebastian,

    First of all thanks for your reply and apologies for the delay in responding here.

    In answer - yes and no.  I am aware that the dialog and description resources are different, however would like my button objects to be equally spaced or at least equal width ( at the moment the width of the buttons are determined by the length of the text label ).  Here is a non-dialog example in Cinema4D that shows exactly what i'd like to have - the Bake and Bake Frame buttons and also the Clear Cache and Clear Frame buttons on the Mograph Cache tag are equally spaced and of equal width, like this:

    How then can i achieve the same thing?



  • On 02/12/2016 at 18:53, xxxxxxxx wrote:

    You can actually search for it in the resource/ folder of C4D. From R17

    CONTAINER Tmograph_cache
    {
    	NAME		Tmograph_cache;
      
    	INCLUDE Tbase;
      
    	GROUP		ID_TAGPROPERTIES
    	{
    		BOOL	MGCACHETAG_ACTIVE {}
    		GROUP
    		{
    			COLUMNS 2;
      
    			BUTTON	MGCACHETAG_BAKESEQUENCE {}
    			BUTTON	MGCACHETAG_BAKEFRAME {}
    			BUTTON	MGCACHETAG_CLEARCACHE {}
    			BUTTON	MGCACHETAG_CLEARFRAME {}
    		}
    		BOOL	MGCACHETAG_BAKESEQUENCE_ACTIVE { ANIM OFF; }
    		BASETIME	MGCACHETAG_BAKEFROM {}
    		BASETIME	MGCACHETAG_BAKETO {}
    	
    		SEPARATOR { LINE; }
    	
    		BASETIME MGCACHETAG_OFFSET {}
    		BOOL MGCACHETAG_LOOP {} 
    		REAL MGCACHETAG_LOOP_BLEND { MIN 0.0; MAX 100.0; UNIT PERCENT; }
      
    		SEPARATOR { LINE; }
    		STATICTEXT	MGCACHETAG_MEMORYUSED {}
    	}
    }
    


  • On 04/12/2016 at 05:05, xxxxxxxx wrote:

    Thanks Niklas yeah i've had a look at the resource for that, unfortunately it doesn't really tell me anything as there's no formatting, just two columns and the buttons.  Is it likely that the equal sizing/spacing is being applied dynamically inside C4D?  It's not something i've ever really done tbh but might have a look at that..



  • On 04/12/2016 at 08:36, xxxxxxxx wrote:

    We have groups, columns, and dummy gizmos to lay things out.
    It can take a lot of messing about to find the right combination to layout out the AM gizmos as desired.
    There is also the LAYOUTGROUP option that allows us to lay out groups in columns.
    But in this case I think you can probably do what you want without it.

    This is an example that will layout the AM gizmos similar to the image you posted

    CONTAINER tsimpletag  
    {  
      NAME tsimpletag;  
      INCLUDE Texpression;  
      INCLUDE Obase;      
        
      GROUP ID_TAGPROPERTIES  
      {  
      
        //This first group positions the gizmos in it all the way to the left side      
        GROUP    
        {  
          BOOL MYBOX { }   
          LINK MY_LINK  
          {   
            ACCEPT { Obase; }   
            REFUSE { Osky; Oforeground; }  
          }  
        }    
      
        SEPARATOR { LINE; }        
      
        //This second group lays out 4 buttons, in 2 columns, in the middle of the AM window  
        //Note how the number of columns works hand-in-hand with STATICTEXT{} dummy elements  
        //The STATICTEXT gizmos are invisible. They push the buttons(or add spaces between them if desired) to the right  
        GROUP  
        {  
          COLUMNS 5;  
          STATICTEXT { }   
          STATICTEXT { }          
          BUTTON BUTTON1 {}                
          BUTTON BUTTON2 {}   
          STATICTEXT { }    
          STATICTEXT { }     
          STATICTEXT { }          
          BUTTON BUTTON3 {}  
          BUTTON BUTTON4 {}  
        }  
          
        SEPARATOR { LINE; }  
          
        //This third group positions the gizmos in it all the way to the left side again like the first group  
        GROUP  
        {  
          REAL MYSLIDER { UNIT PERCENT; MIN 0.0; MAX 100.0; MINSLIDER 0.0; MAXSLIDER 10000.0; CUSTOMGUI REALSLIDER; }  
          STRING MYTEXTBOX {ANIM OFF; }  
        }      
      }  
    }
    

    -ScottA



  • On 05/12/2016 at 04:27, xxxxxxxx wrote:

    Cheers Scott, i guess i could try using statictext elements to beat it into submission, possibly even putting empty spaces the button label string to force the size of it.  There's none of that in the example mograph cache tag resource though, so assuming that one is done dynamically after the tag is loaded?

    Also tried using LAYOUTGROUP but it's unclear from the docs what the advantage of that is even.



  • On 05/12/2016 at 04:39, xxxxxxxx wrote:

    The buttons' width is determined automatically by C4D based on the biggest element in the same column (at least in a description resource). There is no post editing required.



  • On 05/12/2016 at 05:55, xxxxxxxx wrote:

    You're right of course Katachi.  The reason they are equally spaced in the example Mograph Cache is because there are two rows of buttons, the 'Cache' button assumes the width of the button below it ('Clear Cache') which makes it appear as if the buttons have all been formatted to specific widths.  My plugin only has a single row with two buttons/columns.  Doh!

    For what it's worth - inserting whitespace around the button name string allows a crude way to make it wider.

    Please mark as Solved, thanks all.


Log in to reply