Catalyst Script Generation and Use: type object 'PNG' has no attribute 'MetaData'
pvbatch and catalyst complain type object 'PNG' has no attribute 'MetaData' if you add any metadata to the PNG writer in the extract properties. To recreate:
- load a data set and show surface
- create a PNG extract
- in properties panel, in image options, add a second line: user, me
- save catalyst state - pick a script name
- run the saved script with pvbatch
Below shows two scripts, the first one I saved without making a change to the image properties, it works. The second one I created by changing the user prorperties, it fails with MetaData error.
`pn1933613:~ patchett$ diff pvhead_catalyststate3.py pvhead_catalyststate4.py
96a97,99
> # init the 'PNG' selected for 'Format'
> pNG1.Writer.Format.MetaData = ['Application', 'ParaView', 'user', 'patchett']
>
pn1933613:~ patchett$
pn1933613:~ patchett$ /Applications/ParaView-5.9.0-858-gca61cc8736.app/Contents/bin/pvbatch pvhead_catalyststate3.py
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
pn1933613:~ patchett$ /Applications/ParaView-5.9.0-858-gca61cc8736.app/Contents/bin/pvbatch pvhead_catalyststate4.py
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "/Applications/ParaView-5.9.0-858-gca61cc8736.app/Contents/Python/paraview/servermanager.py", line 479, in __setattr__
setter = getattr(self.__class__, name)
AttributeError: type object 'PNG' has no attribute 'MetaData'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/ParaView-5.9.0-858-gca61cc8736.app/Contents/Python/paraview/servermanager.py", line 485, in __setattr__
_bc.setattr(self, name, value)
File "/Applications/ParaView-5.9.0-858-gca61cc8736.app/Contents/Python/paraview/_backwardscompatibilityhelper.py", line 363, in setattr
raise AttributeError()
AttributeError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "pvhead_catalyststate4.py", line 98, in <module>
pNG1.Writer.Format.MetaData = ['Application', 'ParaView', 'user', 'patchett']
File "/Applications/ParaView-5.9.0-858-gca61cc8736.app/Contents/Python/paraview/servermanager.py", line 492, in __setattr__
raise AttributeError("Attribute %s does not exist. " % name +
AttributeError: Attribute MetaData does not exist. This class does not allow addition of new attributes to avoid mistakes due to typos. Use add_attribute() if you really want to add this attribute.