Editing the RES file, what to include?



  • On 17/05/2013 at 11:36, xxxxxxxx wrote:

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

    ---------
    Hi, I want a link control, and furthermore, I want it to be selective. If I have understood correct, it is the ACCEPT keyword that takes care of that. I want only joints to be accepted. (Can I enter several objects here?)

    CONTAINER Tfoo
    {
    INCLUDE Texpression;
    GROUP ID_TAGPROPERTIES
    {
    LINK LINK_SOURCE_RIG {ACCEPT { Ojoint ; } }
    }
    }

    Now I have a few questions:
    When I use Obase as the criteria, all goes fine. When I use Ojoint, it compiles, but C4D complains later when loading the plugin. I guess I miss an #include somewhere. So, how do I find out about this? I searched the docs for almost one hour.. did get a zillion hits on ojoint, but isn't there a systematic procedure to find out what to link, and where to link it, and how to link it, in such cases?
    Then, what is INCLUDE Texpression; really? Why do I need it, and why is an include positioned in this RES file?

    -Ingvar



  • On 17/05/2013 at 11:40, xxxxxxxx wrote:

    Some of the IDs are not recognized by the resource system. It's a limitation. I hate it as well,
    but you have to use the integer ID instead. Not sure what it is fore Ojoin, but here's an example:

    LINK LINK_SOURCE_RIG { ACCEPT { 5235; Obase; Tbase; 1245125 } }
    

    You should also adjust the naming of your description IDs to prevent collisions. Best practice is to
    put your plugin name as the prefix.

    Best,
    -Nik



  • On 17/05/2013 at 11:59, xxxxxxxx wrote:

    Thanks, I get this. So there is not need for an include in the cpp files then.

    And for the ID for the joint - how do you get that? I observed the Script log windows, and made joints, cloned them and deleted etc. - but no useful message in the window that would tell me the number.

    Edited:
    I think I can use this:
    LONG typeId = op->GetType();
    String typeName = op->GetName();
    GePrint(typeName + ": " + RealToString(typeId));

    But what does INCLUDE Texpression;  mean here? What purpose does it serve?

    -Ingvar



  • On 17/05/2013 at 12:59, xxxxxxxx wrote:

    'INCLUDE Texpression' includes the Texpression.res into your .res.  For instance, if you are making an Object plugin, you would include Obase to have the default attribute groups (Basic, Coord, Object) and their descriptions available.



  • On 17/05/2013 at 13:18, xxxxxxxx wrote:

    .. and also note that the .res files are not passed to the compiler. Cinema parses them once on
    request of the description.



  • On 17/05/2013 at 15:44, xxxxxxxx wrote:

    Ok, thanks, here is one more:
    In the built in project that comes with C4D, there is the Look at camera tag. In the tlookatcameraexp.h file, I find this:

    #ifndef _Tlookatcameraexp_H_
    #define _Tlookatcameraexp_H_
    enum
    {
    LOOKATCAMERAEXP_PITCH = 1000
    };
    #endif

    What purpose does these defines serve? I find the defined constant not used anywhere else.
    Is it perhaps to prevent "double loading"? So that the following would work equally well?
    #ifndef _FooBarAndMoonshine_
    #define _FooBarAndMoonshine_
    bla bla bla
    #endif

    -Ingvar



  • On 17/05/2013 at 16:05, xxxxxxxx wrote:

    Yes, it prevents loading the header more than once. And, yes, as long as the define is unique to the file.


Log in to reply