PD_Gear_ViewProviderPythonFeature is not JSON serializable
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: ViewProviderPythonFeature is not JSON serializable
I did the icon. Its basically a placeholder. I'm particularly bad with icons
Stop whining - start coding!
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: PD_Gear_ViewProviderPythonFeature is not JSON serializab
I have a similar problem
when I save the file I get
second reopen
At the moment I use the workaround after reload
But the question is
Is it an error of me
or
is it caused by the non serializebility of group object
and can be fixed ??
thanks in advance
Code: Select all
def createManager(name='My_Manager'):
obj = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroupPython",name)
obj.addProperty("App::PropertyInteger","intervall","params",
"intervall")
obj.addProperty("App::PropertyPythonObject","run","zzz", "run")
obj.addProperty("App::PropertyLinkList","targets","zzz", "targets")
obj.addProperty("App::PropertyString","text","params", "text")
_Manager(obj)
_ViewProviderManager(obj.ViewObject)
return obj
after reopenraceback (most recent call last):
File "/usr/lib/python2.7/json/__init__.py", line 243, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
<type 'exceptions.TypeError'>: <group object> is not JSON serializable
second file save without errorsTraceback (most recent call last):
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
<type 'exceptions.ValueError'>: No JSON object could be decoded
<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'instancemethod'
second reopen
The connection of the proxis to my group objects are lost<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'instancemethod'
At the moment I use the workaround after reload
Code: Select all
for ob in FreeCAD.ActiveDocument.Objects:
if hasattr(ob,'Proxy'):
ob.Proxy.__init__(ob)
print("init " +ob.Name)
But the question is
Is it an error of me
or
is it caused by the non serializebility of group object
and can be fixed ??
thanks in advance
Re: PD_Gear_ViewProviderPythonFeature is not JSON serializab
arcol wrote:A completely unrelated problem:
The gear generator icon is grey on grey (the ubuntu menu's background is grey), so completely unnoticable, until you hover the mouse on the menuitem.
Who designed the icon? Can he/she add a white around the gear icon, so it would be noticable?
wmayer wrote:Don't know but we are aware of this issue. Jim recently offered some alternatives but AFAIR there was still no decision which one to use. @Jim, is there a preferred icon we should use?
I think the icon has since been updated; for me it looks like this (only not 64 x 64 pixels), and has for a while now:jriegel wrote:I did the icon. Its basically a placeholder. I'm particularly bad with icons
OS: Ubuntu 12.04.5 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.15.4129 (Git)
Branch: master
Hash: 4259a9391bf9574cae9402dbba71acf9d74bcf41
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
OCC version: 6.7.1