I ran into a similar issue just recently, turns out that Maya will only
evaluate nodes when necessary (i.e. during a screen refresh), so some
nodes may not evaluate properly if something happens so quick that Maya
didn't even get a chance to respond. I solved the issue by using dgeval
with something like this (adapted to your code):

MString command("dgeval ");
MGlobal::executeCommand(command + floatAttr.name());

You should place the above code somewhere after setting the appropriate
node attribute values and making the appropriate node connections.

Hope the suggestion helps.

Ren Zhi

Ling wrote:
> Hi guys:
>
>   sorry for post this again, but I desparately needing for help.
>
> my problem is I created three attribute in my custom locator node,
> a MString attribute, a MMatrixAttribute,
> and they are affecting a float attribute.
>
> basically like this:
> CHECK_MSTATUS( attributeAffects( MStringAttr,     floatAttr ) );
> CHECK_MSTATUS( attributeAffects( MMatrixAttr,     floatAttr ) );
>
> the node compiles fine, but when changing the Matrix and String
> attribute,
> the float attribute doesnt response, which means the node won't
> re-"compute"..
>
> also i got some error message like:
> attributeAffects( MString,     floatAttr )
> (kInvalidParameter): Object is incompatible with this method
>
> attributeAffects( MMatrixAttr,     floatAttr )
> (kInvalidParameter): Object is incompatible with this method
>
> and if I set only the MString attribute affecting the float attribute,
> the error becomes:
> attributeAffects( MString,     floatAttr )
> (kInvalidParameter): Object is incompatible with this method
>
>
> Really appreciate your helps
>
> -ling
>
>   

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to