Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    how do i add a material ?

    SDK Help
    0
    4
    386
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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...

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            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 ); )

            1 Reply Last reply Reply Quote 0
            • First post
              Last post