[Paraview] avoiding proxy ID collisions
Geoff Draper
draperg at cs.utah.edu
Mon Oct 13 16:52:05 EDT 2008
I've written a program which exports ParaView's undo stack as a series of
vtkUndoSet objects, serialized to XML. (This is done by calling
vtkUndoSet::SaveState(), and then calling PrintXML() on the returned
vtkPVXMLElement object.) The idea is to be able to import the saved undo
stack into a blank scene, and step through the stack, "redo"-ing each
vtkUndoSet.
Although the export works just fine, importing the undo stack is
more problematic. The problem is that each vtkSMProxy object has an ID
number which is guaranteed to be unique during a single ParaView runtime
session, but which is NOT necessarily unique from one session to another.
So when I re-run ParaView and import my saved undo stack, occasionally
the ID numbers for the proxies stored in the XML file will conflict with
ID numbers already in use by existing vktSMProxy objects. So when I
attempt to redo the vtkUndoSets, ParaView pops up an error dialog
and exits. (I'm using vtkSMUndoRedoStateLoader::LoadUndoRedoSet() to
load in the vtkUndoSet objects.)
My question is: Is there a straightforward way to auto-increment the ID
numbers when loading saved proxy objects, in the case of ID-number
conflicts?
Thanks,
Geoff
P.S. The specific error message I'm seeing is:
"""
ERROR: In ..\..\..\Servers\Common\vtkProcessModule.cxx, line 1091
vtkProcessModule (082F8B38): Attempting to assign existing ID 74.
while processsing
Message 0 = Assign
Argument 0 = id_value {74}
Argument 1 = vtk_object_pointer {vtkSMSourceProxy (0A634EB0)}
"""
More information about the ParaView
mailing list