Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

pymxs pickle

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
pradeep_cher
365 Views, 4 Replies

pymxs pickle

cannot pickle pymxs.MXSWrapperBase

 

Getting error while deepcopy pymxs object

4 REPLIES 4
Message 2 of 5

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.

Message 3 of 5

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

Message 4 of 5


@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

 

Message 5 of 5
pradeep_cher
in reply to: pradeep_cher

Than you @denisT.MaxDoctor , this worked

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report