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

    Problem: tag->GetMaterial()->GetName();

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 567 Views
    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 Offline
      Helper
      last edited by

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

      On 16/01/2007 at 01:38, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.6 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi, All!
      I the beginner in programming on C.O.F.F.E.E. I have faced a problem.
      I need to choose the first object to which the concrete material is appropriated.

      In COFFEE SDK:
         1. texture tag have a fuction GetMaterial();
         2. material have a function GetName();
         
      Why next code don't work:

        
          main(doc,op)  
          {  
          var tag0=op->GetFirstTag();  
           if (!tag0) {println("No Tags!"); return FALSE;}  
           while (tag0->GetType()!= TAG_TEXTURE)  
            {  
             tag0=tag0->GetNext();  
             if (!tag0) return FALSE;  
            }  
         var MatName=tag0->GetMaterial()->GetName();  
         println(MatName);  
          }     
      

      In result: Member not found

      🙂

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

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

        On 16/01/2007 at 04:00, xxxxxxxx wrote:

        ãûûûû
        ñìàðè
        > >>[Marker] GetMaterial();
        >>>Returns the marker of the current material.r
        òîåñòü òà ôóíêöèÿ âîçâðàùàåò íå ìàòåðèàë, à êàêîéòî ñöóêî ìàðêåð. Äàëåå ââîäèøü â ïîèñêå ïî õåëïó ñëîâî marker, íàõîäèøü òàêóþ ôóíêöèþ
        [BaseMaterial] FindMaterial([Marker ,string] m);
        Íó è ñîîòâåòñòâåííî êîä:
         var tag0=op->GetFirstTag();
             if (!tag0) {println("No Tags!"); return FALSE;}
             while (tag0->GetType()!= TAG_TEXTURE)
              {
               tag0=tag0->GetNext();
               if (!tag0)
             return FALSE;
          }
        var MatMark=tag0->GetMaterial();
        var doc = GetActiveDocument() ;
        var mat=doc->FindMaterial(MatMark);
        var matName = mat->GetName();
        println(matName);

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

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

          On 16/01/2007 at 04:07, xxxxxxxx wrote:

          Excuse me for russian. This guy understand me.
          And I think it is clear without words.

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

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

            On 16/01/2007 at 04:20, xxxxxxxx wrote:

            You get the name of the material like this:

            tag0#TEXTURETAG_MATERIAL->GetName()

            With #TEXTURETAG_MATERIAL you get the material attached to the texture tag.

            cheers,
            Matthias

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

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

              On 16/01/2007 at 13:19, xxxxxxxx wrote:

              Matthias, many thanks! All has turned out!

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