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

    MatAssignData

    SDK Help
    0
    11
    952
    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 01/04/2004 at 01:34, xxxxxxxx wrote:

      MatAssignData* test = (MatAssignData* ) bcMat.GetCustomDataType( ID_MATERIALASSIGNMENTS, CUSTOMDATATYPE_MATASSIGN );

      ......ok....but now I need to call test->BuildInclusionTablem which returns a MatAssignTable...but MatAssignTable* leads to a linker 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 06/04/2004 at 01:59, xxxxxxxx wrote:

        What linker error? Which compiler/linker?

        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 18/11/2004 at 18:41, xxxxxxxx wrote:

          Hi,

          I have the same problem. 😞 When I try to build my plugin the compiler tells me:
          error LNK2001: unresolved external symbol "public: class MatAssignTable * __thiscall MatAssignData::BuildInclusionTable(class BaseDocument *,long)" (?BuildInclusionTable@MatAssignData@@QAEPAVMatAssignTable@@PAVBaseDocument@@J@Z)
          fatal error LNK1120: 1 unresolved externals

          I don´t know why. I have included the customgui_matassign.h and my code is correct too (it compiles without problems)

          Any idea what the problem may be?

          Thanks!

          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 01/12/2004 at 03:14, xxxxxxxx wrote:

            Hmm, no. It seems to work here. What compiler do you use?

            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 01/12/2004 at 07:44, xxxxxxxx wrote:

              MSVC++ 6. It just doesn´t work.

              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/12/2004 at 00:55, xxxxxxxx wrote:

                I never got BuildInclusionTable to run, I use the ObjectFromIndex function to get access to the assign data.

                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 23/05/2007 at 17:29, xxxxxxxx wrote:

                  Hey Guys,
                  I need to access all of the elements found within the Assignment page of a given material. Now, I found the matAssignData class which is exactly what I am looking for. The problem is that when ever I call the GetTheCustomDataType() it ALWAYS returns NULL! Here is the code:

                      
                      
                        
                      if(!replaceMaterial || !withMaterial) return TRUE;
                      
                      
                      
                      
                      
                      
                      
                      BaseContainer *rmBC = replaceMaterial->GetDataInstance();
                      
                      
                      
                      
                      MatAssignData *replaceAssignData = (MatAssignData* )rmBC->GetCustomDataType(ID_MATERIALASSIGNMENTS, CUSTOMDATATYPE_MATASSIGN);
                      
                      
                      
                      
                      if(!replaceAssignData) 
                      
                      
                      
                      
                      {
                      
                      
                      
                      
                      GePrint("MatAssignData is NULL!");
                      
                      
                      
                      
                      return TRUE;
                      
                      
                      
                      
                      }  
                      
                  

                  As always thanks in advance for any help.
                  -Josh-

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

                    Here a little example how to access the MatAssigData.

                      
                    BaseMaterial *mat = doc->GetActiveMaterial();  
                    if(!mat) return TRUE;  
                      
                    GeData d;  
                    if(mat->GetParameter(DescLevel(ID_MATERIALASSIGNMENTS),d,0))  
                    {  
                         MatAssignData *mad = (MatAssignData* )d.GetCustomDataType(CUSTOMDATATYPE_MATASSIGN);  
                         if(mad)     GePrint("found it");  
                         GePrint(LongToString(mad->GetObjectCount())+" objects");  
                    }  
                    

                    hope this helps

                    cheers,
                    Matthias

                    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 24/05/2007 at 02:57, xxxxxxxx wrote:

                      Yes that should work, is also the way we use it.
                      Be careful, every time you make the get on it, the assign list of the material will be updated. We noticed that this takes a longer while if the material is assigned to many objects. Seems to me, that the assign list itself has a non optimal implementation, like if adding an entry to the list takes O(n²), n the number of entries which are already in the list. It does not seem to depend on the size of the object tree, that has to be parsed for filling the assign list, but that seems to be fast, a material used only in several objects but with a very huge object tree is still fast.

                      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 24/05/2007 at 08:29, xxxxxxxx wrote:

                        Thanks Matthias! It worked like a charm;
                        -Josh-

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