general question



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 26/03/2010 at 14:11, xxxxxxxx wrote:

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

    ---------
    hi there,

    can someone explain me shortly how to add for example the noise types to my res file?
    this doesnt work since the values are not defined:

                LONG noiseType {CYCLE {NOISE_BOX_NOISE;NOISE_BLIST_TURB;NOISE_BUYA;NOISE_CELL_NOISE;NOISE_CRANAL;NOISE_DENTS;NOISE_DISPL_TURB;NOISE_FBM;NOISE_HAMA;NOISE_LUKA;NOISE_MOD_NOISE;NOISE_NAKI;NOISE_NOISE;NOISE_NUTOUS;NOISE_OBER;NOISE_PEZO;NOISE_POXO;NOISE_RANDOM;NOISE_SEMA;NOISE_STUPL;NOISE_TURBULENCE;NOISE_VL_NOISE;NOISE_WAVY_TURB;NOISE_CELL_VORONOI;NOISE_DISPL_VORONOI;NOISE_SPARSE_CONV;NOISE_VORONOI_1;NOISE_VORONOI_2;NOISE_VORONOI_3;NOISE_ZADA;NOISE_FIRE;NOISE_ELECTRIC;NOISE_GASEOUS;}}  
    

    adding this (#include "lib_noise.h") to my h-file doesnt help, too. and coping the according lines from the enum in lib_noise.h results in double definition errormessage, of course..

    so, how can i create such a dropdown to select the noise types?

    thanks in advance,
    ello



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/03/2010 at 05:04, xxxxxxxx wrote:

    AFAIK you have to add the content for a LONG dropdown box yourself from code, if you want the noise types in it. Take a look at the class C4DNoise, there's a member function that returns the container.
    The other option would be to create IDs and strings for all Noise options yourself, put them in the .res file (like you do with other LONG cycles, too), and then translate the value to a valid noise ID in the code.
    Cheers,
    Jack



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/03/2010 at 06:11, xxxxxxxx wrote:

    exactly as jack says.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/03/2010 at 06:24, xxxxxxxx wrote:

    thank you both..

    the second option would be easy to do even for me, but i'd still like to know how the first thing would be done.
    how do i add that thing to the menu of my plugin and how do i access it later on?
    for now i created my menu with the res-file.

    thanks and cheers,
    ello



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 31/03/2010 at 05:40, xxxxxxxx wrote:

    It's really easy to do for descrition based plugins.

    Check the example code, it's a modifed tag plugin from the SDK examples. I added a LONG element displaying the noise types in GetDDescription(). The CYCLE strings are filled with C4DNoise::CreateMenuContainer().

      
    /////////////////////////////////////////////////////////////  
    // CINEMA 4D SDK                                           //  
    /////////////////////////////////////////////////////////////  
    // (c) 1989-2004 MAXON Computer GmbH, all rights reserved  //  
    /////////////////////////////////////////////////////////////  
      
    // "look at editor camera" expression example  
      
    #include "c4d.h"  
    #include "c4d_symbols.h"  
    #include "tlookatcameraexp.h"  
      
    #include "lib_noise.h"  
      
      
    // be sure to use a unique ID obtained from www.plugincafe.com  
    #define ID_LOOKATCAMERATAG    1001165  
      
      
    enum  
    {  
      MY_NOISE = 6000  
    };  
      
      
    class LookAtCamera : public TagData  
    {  
      public:  
          virtual Bool Init(GeListNode *node);  
      
          virtual LONG Execute(PluginTag *tag, BaseDocument *doc, BaseObject *op, BaseThread *bt, LONG priority, LONG flags);  
          virtual Bool GetDDescription(GeListNode *node, Description *description,LONG &flags);  
      
          static NodeData *Alloc(void) { return gNew LookAtCamera; }  
    };  
      
    Bool LookAtCamera::Init(GeListNode *node)  
    {  
      BaseTag                *tag  = (BaseTag* )node;  
      BaseContainer *data = tag->GetDataInstance();  
      
      data->SetLong(MY_NOISE, NOISE_BOX_NOISE);  
      
      return TRUE;  
    }  
      
      
    Bool LookAtCamera::GetDDescription(GeListNode *node, Description *description,LONG &flags)  
    {  
      if (!description->LoadDescription(ID_LOOKATCAMERATAG)) return FALSE;  
      const DescID *singleid = description->GetSingleDescID();  
      
      DescID cid = DescLevel(MY_NOISE,DTYPE_LONG,0);  
      if (!singleid || cid.IsPartOf(*singleid,NULL)) // important to check for speedup c4d!  
      {  
          BaseContainer bc = GetCustomDataTypeDefault(DTYPE_LONG);  
      
          bc.SetContainer(DESC_CYCLE,C4DNoise::CreateMenuContainer(FALSE));  
          bc.SetLong(DESC_ANIMATE,DESC_ANIMATE_ON);  
          bc.SetBool(DESC_REMOVEABLE,FALSE);  
          bc.SetString(DESC_NAME,"Noises");  
          bc.SetString(DESC_SHORT_NAME,"Noises");  
      
          if (!description->SetParameter(cid,bc,DescLevel(ID_TAGPROPERTIES))) return TRUE;  
      }  
      
      flags |= DESCFLAGS_DESC_LOADED;  
      
      return TRUE;  
    }  
      
      
    LONG LookAtCamera::Execute(PluginTag *tag, BaseDocument *doc, BaseObject *op, BaseThread *bt, LONG priority, LONG flags)  
    {  
      return EXECUTION_RESULT_OK;  
    }  
      
      
    Bool RegisterLookAtCamera(void)  
    {  
      // decide by name if the plugin shall be registered - just for user convenience  
      String name=GeLoadString(IDS_LOOKATCAMERA); if (!name.Content()) return TRUE;  
      return RegisterTagPlugin(ID_LOOKATCAMERATAG,name,TAG_VISIBLE,LookAtCamera::Alloc,"Tlookatcameraexp","lookatcamera.tif",0);  
    }  
    

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 31/03/2010 at 12:08, xxxxxxxx wrote:

    Hi, thanks for posting. I tried it out, but no entry is appearing in the plugins parameters. Does it matter that it is a VideoPostPlugin ?
     I put a GePrint in front of the return and the message is shown in the console, just to verify it is called.

    any further ideas?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 31/03/2010 at 13:58, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Does it matter that it is a VideoPostPlugin ?

    Yes.

    Replace ID_TAGPROPERTIES with ID_VIDEOPOSTPROPERTIES in the following line.

    if (!description->SetParameter(cid,bc,DescLevel(ID_TAGPROPERTIES))) return TRUE;
    

    Replace ID_LOOKATCAMERATAG with your own plugin ID.

    if (!description->LoadDescription(ID_LOOKATCAMERATAG)) return FALSE;
    

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 31/03/2010 at 23:08, xxxxxxxx wrote:

    thank you very much! it was the **ID_VIDEOPOSTPROPERTIES

    ** kind regards,
    ello


Log in to reply