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

    Material Link

    SDK Help
    0
    4
    447
    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 16/07/2003 at 04:46, xxxxxxxx wrote:

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

      ---------
      Hello,
      I am trying to read the LINK from TextureTag, but I always get a
      NULL - Pointer . The other datas from TextureTag could I read.
      Here is some part of my code:
       
      void explore_tag(BaseObject *base)
      {
       BaseContainer bc;
       BaseMaterial *bmat = NULL;
       BaseList2D  *bl = NULL;
       BaseTag   *tag = base->GetFirstTag();
       BaseDocument *doc = GetActiveDocument();

      for (; tag!=NULL; tag = tag->GetNext())
       {
        GePrint("    TAGS: "+tag->GetName());
        bc = tag->GetData();
        
        //  bl = bc.GetLink(TEXTURETAG_MATERIAL,doc);
        //bmat = bc.GetMaterialLink(TEXTURETAG_MATERIAL,doc); 
       
        bmat = bc.GetMaterialLink(TEXTURETAG_MATERIAL,doc);

      if (bmat) GePrint("BaseMaterial vorhanden");
        Real x = bc.GetReal(TEXTURETAG_LENGTHX);
        Real y = bc.GetReal(TEXTURETAG_LENGTHY);
        GePrint("X: "+RTS(x)+"  Y: "+RTS(y));
        LONG mapping = bc.GetLong(TEXTURETAG_PROJECTION);
        String res = bc.GetString(TEXTURETAG_RESTRICTION);
        GePrint("Restriction:  "+res);
        switch (mapping)
        {
        case (0) : GePrint("Kugel-Mapping");break;
        case (1) : GePrint("Zylinder-Mapping");break;
        case (2) : GePrint("Fläche-Mapping");break;
        case (3) : GePrint("Quader-Mapping");break;
        case (4) : GePrint("Frontal-Mapping");break;
        case (5) : GePrint("Spat-Mapping");break;
        case (6) : GePrint("UVW-Mapping");break;
        case (7) : GePrint("Shrink-Mapping");break;
        }
       }
      }
       
      Where is the problem or error ??

      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 02/03/2007 at 04:21, xxxxxxxx wrote:

        *bump*

        same problem here. didnt want to start a new topic.

        BaseTag *baset = obj->GetTag(Ttexture,0);
        BaseContainer basec = baset->GetData();

        BaseMaterial *bm = basec.GetMaterialLink(TEXTURETAG_MATERIAL, doc);

        always returns a null-pointer. could use some help

        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 02/03/2007 at 11:49, xxxxxxxx wrote:

          Try this instead:

          GeData data;  
          ttag->GetParameter(DescID(TEXTURETAG_MATERIAL), data, NULL);  
          Material* mat = static_cast<Material*>(data.GetLink(doc, Mbase));  
          if (!mat) return FALSE;
          
          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 03/03/2007 at 04:03, xxxxxxxx wrote:

            thank you. works very well.

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