WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-02-2005, 06:08 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Is this object a class instance that you created? If it is then you need to override the __getstate__ and __setstate__ functions in order to bypass pickling of the webCam object. Here is an example:
Code:
class MyClass:
    def __init__(self):
        self.webCam = 0
        self.variable = 'something'

    def __getstate__(self):
        odict = self.__dict__.copy() # copy the dict since we change it
        del odict['webCam']          # remove webCam variable
        return odict

    def __setstate__(self,dict):
        self.webCam = 0              # initialize webCam object since it won't be in dict
        self.__dict__.update(dict)   # update attributes
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:45 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC