MatAssignData



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

    On 31/03/2004 at 08:04, xxxxxxxx wrote:

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

    ---------My MaterialData needs to know to which objects its assigned to. The MatAssignData class is documented in the sdk....but how can I get a pointer to it from my MaterialData???



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



  • 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?



  • 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!



  • 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?



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



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



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



  • 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



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



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


Log in to reply