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

    Duplicate Material?

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 431 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 18/11/2004 at 17:07, xxxxxxxx wrote:

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

      ---------
      Hi,

      what is the best method to check if two materials are the same (I need to write my own "RemoveDuplicateMaterials" function). Which Parameters are used for this?

      Thank you!!

      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 19/11/2004 at 08:03, xxxxxxxx wrote:

        I tried to browse through each container ID and check if they are the same on both materials, but that doesn´t work (either if I check the returned GeData with the compare operator == or if I really check the values of each GeData).

        Anybody any idea?

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

          How do you mean? Why doesn't checking all values work? How would you define "being the same material"?

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

            I don´t know why it doesn´t work, but it doesn´t. It always tells me that it´s different. "Being the same material" is a material with the exact same settings (the name is irrelevant though, it can be different). Just the way Cineam does.
            But from your words, I think I better recheck if I didn´t do anything wrong.

            Thanks, will report if the problem still exists.

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

              Hi Katachi,
              I think I've just encountered the same problem as you, but I think I have a solution.

              I found (as you did), that if you just iterate through all the parameters and compare them, it always says they are different.

              I eventually found out that if you have a 'null' GeData object, then it acts like a NaN, in that if compares false with everything including itself.

              Why is this relevant? Because the parameters seem to include a whole bunch of these null/NaN values!

              A workaround that I found that seems to work if you want to compare materials A and B is to iterate through all the parameters, and for each parameter get a GeData gA and a GeData gB.
              Now, before checked if gA==gB, check whether gA==gA.
              If it doesn't then ignore that parameter and move on to the next one.

              This seems to work!

              Hope this helps.

              Cheers - Steve

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

                Hi Steve,

                thanks, I will try that!! 🙂

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