packed_bytes = resources[bv.byteOffset : bv.byteOffset + bv.byteLength]
arr = np.frombuffer(
packed_bytes,
dtype=component_type[accessor.componentType].replace("{}", ""),
).reshape((-1, accessor_type[accessor.type]))
arr.flags.writeable = True # this does not work
It gives:
ValueError: cannot set WRITEABLE flag to True of this array
When trying to set writeable flag to the numpy array. Before adding that line of code, it gave:
ValueError: output array is read-only
When trying to write to the array. Any ideas on how to fix this? I have no idea why this is an issue.
np.arrayand its own 'fresh' databuffer is writeable. There are too many unknowns in your question for (most of) us to help you.packed_bytesneed to be a mutable object itself for this to work