Material Layer

Material Layer

Class

inc/real/layer/r3matlay.h

Description

Material layer manages material objects in a project. Material objects can be bound to geometric objects via special purpose geometric objects, called material mapping objects.

Examples:

To enumerate materials in the material layer:


    int print_material(R3OBJ *obj, void *hook_data)
    {
        char *name;
        R3CLID clid;
        R3GetAttrs(obj, 
                   R3T(R3RA_Name, &name), 
                   R3T(R3RA_ClassID, &clid),
                   R3TAG_END);
        printf("found material name=%s clid=%d\n", name, clid);
    }

    R3DoA(matlayer, R3OLAYM_LOCKSHARED, NULL);
    R3Do(matlayer, R3OLAYM_ENUMOBJECTS,
         R3T(R3RA_Hook, print_material),
         R3T(R3RA_HookData, NULL),
         R3TAG_END);
    R3DoA(matlayer, R3OLAYM_RELEASED, NULL);