AttributeError: Parameter value not accessible
-
On 05/02/2014 at 16:52, xxxxxxxx wrote:
Thanks, Rui, I was able to reproduce the problem. I'll take a deep look into it. I've reconstructed your
problem in this project:https://dl.dropboxusercontent.com/u/99829745/stuff/2014-02-06-getdenabling-parentcall-issue.zip
Best,
-Niklas -
On 05/02/2014 at 17:02, xxxxxxxx wrote:
I started removing sections of the description with each restart of Cinema until I found what caused the
issue. It is the BITMAPBUTTON GUIs that cause the exception in the parent call of GetDEnabling().Unfortunately, even if you remove your bitmap buttons, it sometimes fails with a TypeError:
Traceback (most recent call last) : File "'test.pyp'", line 8, in GetDEnabling TypeError: argument 5
Which is also a known issue of R14 and was fixed in R15. See https://developers.maxon.net/forum/topic/6533/7047_getdenabling-typeerror-on-parentcall
As a workaround for this issue (and the original if you want to keep your BITMAPBUTTONs) , you can
use a try-catch block.def GetDEnabling(self, *args, **kwargs) : # ... try: return c4d.plugins.ObjectData.GetDEnabling(self, *args, **kwargs) except TypeError: return True
Best,
-Niklas -
On 06/02/2014 at 01:52, xxxxxxxx wrote:
Thank you for the information, Niklas.
I tried the following:
def GetDEnabling(self, node, id, t_data, flags, itemdesc) :
try:
return c4d.plugins.NodeData.GetDEnabling(self, node, id, t_data, flags, itemdesc)except AttributeError:
return Trueisoff1=node[AB_ON1]
isoff2=node[AB_ON2]
isoff3=node[AB_ON3]if (id[0].id == AB_NUM_B1) : return isoff1==1
if (id[0].id == AB_DENS_B1) : return isoff1==1
if (id[0].id == AB_START_B1) : return isoff1==1
if (id[0].id == AB_END_B1) : return isoff1==1
if (id[0].id == AB_SEED_B1) : return isoff1==1if (id[0].id == AB_ON2) : return isoff1==1
if (id[0].id == AB_NUM_B2) : return (isoff1*isoff2)==1
if (id[0].id == AB_DENS_B2) : return (isoff1*isoff2)==1
if (id[0].id == AB_START_B2) : return (isoff1*isoff2)==1
if (id[0].id == AB_END_B2) : return (isoff1*isoff2)==1
if (id[0].id == AB_SEED_B2) : return (isoff1*isoff2)==1if (id[0].id == AB_ON3) : return (isoff1*isoff2)==1
if (id[0].id == AB_NUM_B3) : return (isoff1*isoff2*isoff3)==1
if (id[0].id == AB_DENS_B3) : return (isoff1*isoff2*isoff3)==1
if (id[0].id == AB_START_B3) : return (isoff1*isoff2*isoff3)==1
if (id[0].id == AB_END_B3) : return (isoff1*isoff2*isoff3)==1
if (id[0].id == AB_SEED_B3) : return (isoff1*isoff2*isoff3)==1return c4d.plugins.NodeData.GetDEnabling(self, node, id, t_data, flags, itemdesc)
But I still get the same error
-
On 06/02/2014 at 17:51, xxxxxxxx wrote:
I tried it out in R15 and the error also occurs there.
-
On 10/02/2014 at 03:13, xxxxxxxx wrote:
I guess, my only solution is to ditch the bitmaps
-
On 11/02/2014 at 06:51, xxxxxxxx wrote:
What you've tried would exit the GetDEnabling() function immediately.
def GetDEnabling(self, node, id, t_data, flags, itemdesc) : isoff1=node[AB_ON1] isoff2=node[AB_ON2] isoff3=node[AB_ON3] if (id[0].id == AB_NUM_B1) : return isoff1==1 if (id[0].id == AB_DENS_B1) : return isoff1==1 if (id[0].id == AB_START_B1) : return isoff1==1 if (id[0].id == AB_END_B1) : return isoff1==1 if (id[0].id == AB_SEED_B1) : return isoff1==1 if (id[0].id == AB_ON2) : return isoff1==1 if (id[0].id == AB_NUM_B2) : return (isoff1*isoff2)==1 if (id[0].id == AB_DENS_B2) : return (isoff1*isoff2)==1 if (id[0].id == AB_START_B2) : return (isoff1*isoff2)==1 if (id[0].id == AB_END_B2) : return (isoff1*isoff2)==1 if (id[0].id == AB_SEED_B2) : return (isoff1*isoff2)==1 if (id[0].id == AB_ON3) : return (isoff1*isoff2)==1 if (id[0].id == AB_NUM_B3) : return (isoff1*isoff2*isoff3)==1 if (id[0].id == AB_DENS_B3) : return (isoff1*isoff2*isoff3)==1 if (id[0].id == AB_START_B3) : return (isoff1*isoff2*isoff3)==1 if (id[0].id == AB_END_B3) : return (isoff1*isoff2*isoff3)==1 if (id[0].id == AB_SEED_B3) : return (isoff1*isoff2*isoff3)==1 try: return c4d.plugins.NodeData.GetDEnabling(self, node, id, t_data, flags, itemdesc) except (AttributeError, TypeError) : # Bug up to R14, AttributeError seems to be raised randomly for # BitmapButton items and TypeError sometimes for other things. return True
-Niklas
-
On 12/02/2014 at 04:54, xxxxxxxx wrote:
It still returns the same errors
I believe I will really have to ditch the bitmaps.
It is a shame, since I made some nice graphicsRui Bastista
-
On 10/01/2015 at 01:34, xxxxxxxx wrote:
is now a solution for r15 ?
-
On 10/01/2015 at 07:37, xxxxxxxx wrote:
The problem (at least with bitmaps) seems to be fixed in r15 and up.
-
On 10/01/2015 at 17:15, xxxxxxxx wrote:
after update to the latest r15 - it`s fixed - thanks