AttributeError: Parameter value not accessible
-
On 05/02/2014 at 02:05, xxxxxxxx wrote:
Maybe CINEMA sometimes gives an empty id variable.
Have you tried to print its value at the beginning of GetDEnabling()? -
On 05/02/2014 at 03:03, xxxxxxxx wrote:
I had tried performing a check, with:
if id is None: return
But the error still appears.
-
On 05/02/2014 at 07:58, xxxxxxxx wrote:
This is probably a long shot. But since you're stuck maybe it's worth trying.
Take a look at this example code and how the [] brackets are used for the returns.
And return the super class instead of returning True.#This is an example how to hide or grey out a userdata entry in a plugin's GetDEnabling() method def GetDEnabling(self, node, id, t_data, flags, itemdesc) : if (id[0].id == MY_SPLINE_ID) : return node[MY_CHECKBOX_ID] == 1 else: return c4d.plugins.NodeData.GetDEnabling(self, node, id, t_data, flags, itemdesc)
Maybe it's picky about these things?
-ScottA
-
On 05/02/2014 at 08:14, xxxxxxxx wrote:
The error message indicates something different. This exception is also raised if you try to access
a CustomDataType from a BaseContainer which can not be represented in Python. What sorts
of Parameters are in the description of your plugin? What is the exact line the error is raised at? -
On 05/02/2014 at 09:00, xxxxxxxx wrote:
I tried it and it still returns that error.
I also tried the following:def GetDEnabling(self, node, id, t_data, flags, itemdesc) :
return c4d.plugins.NodeData.GetDEnabling(self, node, id, t_data, flags, itemdesc)
So, it returns right after entering the method. And the error still happens.
And I also tried:
def GetDEnabling(self, node, id, t_data, flags, itemdesc) :
return True
And the error still happens.
-
On 05/02/2014 at 09:14, xxxxxxxx wrote:
I don't know what is line where the error is raised. It does not show up in the Console. Only the sentence:
AttributeError: Parameter value not accessible
AttributeError: Parameter value not accessible
AttributeError: Parameter value not accessibleYes, three times, each time the object is created or the document is refreshed.
What do you mean by parameters in the description? The parameters in the plugins.RegisterPlugin command? -
On 05/02/2014 at 09:33, xxxxxxxx wrote:
Could you post your description resource file? The .res file in res/description/
-
On 05/02/2014 at 09:41, xxxxxxxx wrote:
CONTAINER arbor
{
NAME arbor;
INCLUDE Obase;GROUP ID_OBJECTPROPERTIES
{
GROUP
{
BITMAPBUTTON AB_PIC_HEADER1 { ICONID1 1029369; ALIGN_LEFT; }
}
SEPARATOR { LINE; }LINK AB_TRUNK { ACCEPT {Obase;} }
GROUP
{
LONG AB_SEGMENTS { MIN 1; MAX 20; }SEPARATOR { LINE; }
LONG AB_SPLINE_TYPE
{
CYCLE
{
AB_TP_LINEAR;
AB_TP_CUBIC;
AB_TP_AKIMA;
AB_TP_BSPLINE;
}
}LONG AB_SUBDIVISIONS { MIN 0; MAX 20; }
}SEPARATOR { LINE; }
LONG AB_SEED1 { MIN 1; MAX 999999; }
}
GROUP AB_B1
{
GROUP
{
BITMAPBUTTON AB_PIC_HEADER2 { ICONID1 1029369; ALIGN_LEFT; }
}SEPARATOR { LINE; }
BOOL AB_ON1 {}
SEPARATOR { LINE; }
LONG AB_NUM_B1 { MIN 1; MAX 20;}
REAL AB_START_B1 { MIN 0.0; MAX 99.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
REAL AB_END_B1 { MIN 1.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
REAL AB_DENS_B1 { MIN 10.0; MAX 200.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }SEPARATOR { LINE; }
LONG AB_SEED_B1 { MIN 1; MAX 999999; }
}GROUP AB_B2
{
GROUP
{
BITMAPBUTTON AB_PIC_HEADER3 { ICONID1 1029369; ALIGN_LEFT; }
}SEPARATOR { LINE; }
BOOL AB_ON2 {}
SEPARATOR { LINE; }
LONG AB_NUM_B2 { MIN 0; MAX 20;}
REAL AB_START_B2 { MIN 0.0; MAX 99.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
REAL AB_END_B2 { MIN 1.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
REAL AB_DENS_B2 { MIN 10.0; MAX 200.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }SEPARATOR { LINE; }
LONG AB_SEED_B2 { MIN 1; MAX 999999; }
}GROUP AB_B3
{
GROUP
{
BITMAPBUTTON AB_PIC_HEADER4 { ICONID1 1029369; ALIGN_LEFT; }
}SEPARATOR { LINE; }
BOOL AB_ON3 {}
SEPARATOR { LINE; }
LONG AB_NUM_B3 { MIN 0; MAX 20;}
REAL AB_START_B3 { MIN 0.0; MAX 99.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
REAL AB_END_B3 { MIN 1.0; MAX 100.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }
REAL AB_DENS_B3 { MIN 10.0; MAX 200.0; UNIT PERCENT; CUSTOMGUI REALSLIDER; }SEPARATOR { LINE; }
LONG AB_SEED_B3 { MIN 1; MAX 999999; }
}GROUP ABOUT
{
GROUP
{
BITMAPBUTTON AB_PIC_HEADER5 { ICONID1 1029369; ALIGN_LEFT; }
}SEPARATOR { LINE; }
STATICTEXT ABOUT_ME1 { ANIM OFF; }
SEPARATOR {LINE;}
STATICTEXT ABOUT_ME2 { ANIM OFF; }
}
} -
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