WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-21-2006, 06:28 PM
Vygreif Vygreif is offline
Member
 
Join Date: Sep 2005
Posts: 21
Pickling Nodes

Hi,
I'm trying to save nodes as pickled objects, and then loading them later. Does Vizard suppord the pickling of those objects fully?

I currently have this problem:
When the user clicks s, I save the object with the following code:
In this example I'm only saving one object.
if key == 's':
male = viz.add('male.cfg')
objects = viz._GlobalNodeList.values()
f = file("test.sv", "w")
temp = objects[0]
pickle.dump(temp,f,1)
f.close()
When he clicks l I load the code
if key == 'l':
f = file("test.sv", "r")
u = pickle.Unpickler(f)
x = u.load()
viz.add(x)
f.close()

However, when I try this I get the following error:
Traceback (most recent call last):
File "fileinputoutput.py", line 38, in mykeyboard
viz.add(x)
File "C:\Program Files\Vizard25\viz.py", line 4877, in add
s = what.split('.')
AttributeError: VizAvatar instance has no attribute 'split'

Thanks,
YG
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 11:28 AM.


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