how do i add a material ?

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

On 10/06/2004 at 05:29, xxxxxxxx wrote:

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

---------
Hi,
now I am trying to add a material to my scene.
BaseMaterial * mat  = BaseMaterial::Alloc(type);
My problem is that the sdk does not give an explanation of "type" constants for the Material alloc method. Can anyone tell me what I have to fill in there? When I insert a 0 Cinema crashes afterwards when adding Information such as using setname etc.
thank you

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

On 10/06/2004 at 06:11, xxxxxxxx wrote:

The constants are just the material IDs. There are a few defined in ge_prepass:

    
    
    // materials  
    #define Mbase              5702  
    #define Mmaterial            5703  
    #define Mplugin             5705  
    #define Mfog              8803  
    #define Mterrain            8808  
    #define Mdanel                          1011117  
    #define Mbanji                          1011118  
    #define Mbanzi                          1011119  
    #define Mcheen                          1011120  
    #define Mmabel                          1011121  
    #define Mnukei                          1011122

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

On 10/06/2004 at 08:20, xxxxxxxx wrote:

Hi,
okay that worked but now for the next problem:
TextureTag * tag = static_cast<TextureTag*>-(object->MakeTag(Ttexture, NULL));
tag->SetMaterial(mat);
tag->SetName("Set by GroImp");
EventAdd(EVENT_FORCEREDRAW);
assuming everything with the object and material went ok. So why does my Object that I assigned the tag to get invisible? Furthermore I cannot see the Tag in the Object browser...
Any idea?
Thank you...

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

On 14/06/2004 at 23:45, xxxxxxxx wrote:

Hi,
I think, you must at first insert the material into the active document.
(e.g. GetActiveDocument()->InsertMaterial( mat ); )