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

    Select every single material

    Scheduled Pinned Locked Moved SDK Help
    7 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 28/11/2006 at 05:38, xxxxxxxx wrote:

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

      ---------
      Hi,
      i would like to select every single material in the meterialmanager step by step. My code dont work could someone help me.
       
      void matree  (BaseDocument *doc, BaseMaterial *op,Bool *loc1,Bool *loc2,Bool *loc3)
      {
        while(op)
        {
         doc->SetActiveMaterial(op,SELECTION_ADD);//
        //matree(doc,op->GetNext(),loc1,loc2,loc3);
         op = op->GetNext();
        }
        
      }
      void Sort::sortalg(Bool *loc1,Bool *loc2,Bool *loc3)
      {
       BaseDocument *mydoc = BaseDocument::Alloc();
       
       mydoc = GetActiveDocument();
       
          BaseMaterial *op = mydoc->GetFirstMaterial();
       mydoc->SetActiveMaterial(op,SELECTION_NEW);
       matree(mydoc, op,loc1,loc2,loc3);
       BaseDocument::Free(mydoc);
       MessageDialog("TESTSTRING");
       
       
      }

      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 28/11/2006 at 05:44, xxxxxxxx wrote:

        I know that i have a never ending loop too, how can ein check if it is the last material?
         
        Thx

        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 28/11/2006 at 05:58, xxxxxxxx wrote:

          you could try

          BaseDocument* pDocument = GetActiveDocument();
          BaseMaterial* pMat = pDocument->GetFirstMaterial();
          while(pMat)
          {
          ... do something here

          pMat = pMat->GetNext();
          }

          last material is NULL 🙂

          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 28/11/2006 at 06:15, xxxxxxxx wrote:

            Hm, no it does not select anything

            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 28/11/2006 at 06:18, xxxxxxxx wrote:

              Could it be that window maust be refreshed?

              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 28/11/2006 at 06:26, xxxxxxxx wrote:

                Ho no, all mat have been selecte but this will be not shown in cinema if it is not refreshed.
                Thanks

                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 28/11/2006 at 08:10, xxxxxxxx wrote:

                  well, the loop just iterated throughout all the materials 🙂 the "... do something here" part was the code needed to select them

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