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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Using SetWeightMap() multiple times can lead to inexplicable changes in weight values

    Scheduled Pinned Locked Moved Cinema 4D SDK
    python2026
    3 Posts 3 Posters 33 Views 2 Watching
    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.
    • chuanzhenC Offline
      chuanzhen
      last edited by

      Hi,
      Previously, I had been using the SetWeight() method to set weight values, and it worked very stably. However, after seeing the deprecation notice for SetWeight() in the python api documentation, I switched to using SetWeightMap() instead. However, there were some issues with this function. When I used SetWeightMap() multiple times to set values, its values would gradually change.

      Below is a simple example of my video, using a standard cube (with 8 points), where each point is equally influenced by all bones.

      However, when I repeatedly obtain the weight values using GetWeightMap()without making any changes, and then set the weights using SetWeightMap() again, I can see that the weight values have undergone slight changes, with the sum of weights changing from 1 --> 0.998

      相信我,可以的!

      ThomasBT 1 Reply Last reply Reply Quote 0
      • ThomasBT Offline
        ThomasB @chuanzhen
        last edited by

        @chuanzhen
        Well, could it perhaps stem from rounding errors involving floating-point values?

        Thanks,
        T.B

        1 Reply Last reply Reply Quote 0
        • AnlvA Offline
          Anlv
          last edited by Anlv

          This appears to be a Float32-to-quantized-weight conversion or rounding issue in SetWeightMap(), rather than ordinary floating-point noise.

          Cinema 4D version: 2026.3.4
          Expected: unchanged values after every round-trip.
          Round  0: weight=0.14285496299687189 (14.28549630%), total=0.99998474097810308 (99.99847410%)
          Round  1: weight=0.1428397039749752 (14.28397040%), total=0.99987792782482621 (99.98779278%)
          Round 10: weight=0.14270237277790493 (14.27023728%), total=0.99891660944533434 (99.89166094%)
          Round 19: weight=0.14256504158083466 (14.25650416%), total=0.99795529106584246 (99.79552911%)
          Round 20: weight=0.14256504158083466 (14.25650416%), total=0.99795529106584246 (99.79552911%)
          Round 25: weight=0.14256504158083466 (14.25650416%), total=0.99795529106584246 (99.79552911%)
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post