cannot pickle pymxs.MXSWrapperBase
Getting error while deepcopy pymxs object
Solved! Go to Solution.
Solved by denisT.MaxDoctor. Go to Solution.
which object do you want to copy and how? please give a code example... otherwise the question is too abstract and does not make general sense.
import pymxs
mxs = pymxs.runtime
cameraName = "VRayPhysical_configurator_animated_lhd"
node = mxs.getnodebyname( cameraName )
dict1 = {}
import copy
dict1["cam"] = copy.deepcopy(node)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\3dsmax2023x64\3ds Max 2023\Python\lib\copy.py", line 161, in deepcopy
rv = reductor(4)
TypeError: cannot pickle 'pymxs.MXSWrapperBase' object
This will work for Max2019 and throwing error with Max2023
@pradeep_cher wrote:
import copy
dict1["cam"] = copy.deepcopy(node)
you can't use Python copy method to copy MAX objects or values. You must use MXS copy or deepcopy for this:
mxs = pymxs.runtime
mxs.copy (node)
## or mxs.deepcopy for array values, for example
Can't find what you're looking for? Ask the community or share your knowledge.