Using SetWeightMap() multiple times can lead to inexplicable changes in weight values
-
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
-
@chuanzhen
Well, could it perhaps stem from rounding errors involving floating-point values? -
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%)