no I am not, all I want is the first two attr affecting the floatAttr and I got error messages like:
attributeAffects( MString, floatAttr ) (kInvalidParameter): Object is incompatible with this method attributeAffects( MMatrixAttr, floatAttr ) (kInvalidParameter): Object is incompatible with this method does this mean I can't use a MMatrix attribute to affect a float attribute?? On Feb 1, 2:48 pm, damon shelton <[email protected]> wrote: > are you setting the floatAttr value in your compute function? > > On Mon, Feb 1, 2010 at 10:37 AM, Ling <[email protected]> wrote: > > sorry for change the subject a little: > > > but my problem now is when I defined some attribute affecting > > relationships, > > > I defined a MString attribute, and a MMatrix attribute, > > to affect a float attribue, for example: > > > CHECK_MSTATUS( attributeAffects( MStringAttr, floatAttr ) ); > > CHECK_MSTATUS( attributeAffects( MMatrixAttr, floatAttr ) ); > > > so In my understanding, whenever the MStringAttr, and the MMatrixAttr > > changes, the floatAttr will affected, > > > and as a result, the "compute" function will be executed again. > > > but it when I use the node, even though I changed the string, and the > > Matrix, the floatAttr won't response.. > > > any ideas about this, or am I wrong about how the "compute" function > > works? > > > thanks a lot > > > -ling > > > On Feb 1, 1:04 pm, Judah Baron <[email protected]> wrote: > > > Maya's command port is a special type of interface designed with the sole > > > purpose of executing mel code. It is possible to use a generic python > > socket > > > in Maya for whatever purpose you need. What comes through that socket is > > > just data and Maya doesn't know anything about it. It would be your code > > > that would decide how to handle it: store it, execute it if it's a > > command, > > > etc. > > > > This approach is quite a bit more complex than simply opening the > > standard > > > Maya command port, but it also offers a great deal of flexibility with > > > nearly limitless potential. We use this method to communicate with our > > tool > > > server. The tool server manages a lot of non-Maya specific data that is > > > useful to our Maya tools: project locations, project settings, asset > > library > > > data, etc. We pickle this data and send it from the tool server to Maya. > > > From Maya we can make requests to the tool server as we need. We also > > send > > > python code and execute it directly. > > > > Shaun, I know this is more than you were originally asking, but I wanted > > to > > > make clear that there are a great many possibilities depending on your > > > particular need. If you just need to be able to run python code then you > > may > > > want to look into eclipse as an IDE. There are a lot of options there. > > > > -Judah > > > > On Mon, Feb 1, 2010 at 8:34 AM, AK Eric <[email protected]> wrote: > > > > To my knowledge, Maya intercepts incoming commands as mel, > > > > irregardless of send methodology. You can send any type of data you > > > > want to Maya over the socket... but Maya will expect it to be mel when > > > > it receives it. I've not used MayaPad, but maybe it does something > > > > similar to what I do to work around this issue. Goes more or less > > > > like this: > > > > > Open command port in Maya. > > > > In external app connect to that socket, save python code out as > > > > temp.py file. > > > > Ping Maya through command port to exec on temp.py. > > > > > I do this via the API of my IDE: I can query what is hilighted, save > > > > that out as temp.py, and then have Maya execute it... lets me bypass > > > > the Maya script editor entirely. > > > > As an aside: While you can open a socket with both mel and Python... > > > > I've found that no matter what I do, if I open a socket with Python, > > > > the above solution won't work.. I have to open it with mel. > > > > Frustrating. > > > > > On Feb 1, 6:27 am, Jo Jürgens <[email protected]> wrote: > > > > > MayaPad does just that. Its a wxPython Python editor that can send > > > > commands > > > > > to Maya. Maybe you can copy the way its done there > > > > > >http://code.google.com/p/mayapad/ > > > > > > On Mon, Feb 1, 2010 at 9:05 AM, Shaun Friedberg < > > [email protected] > > > > >wrote: > > > > > > > Right, perhaps I miss-spoke… > > > > > > > I use Python to open a socket and then send Mel code. > > > > > > > My question is does anyone know how to send Python code instead of > > Mel… > > > > > -- > > > >http://groups.google.com/group/python_inside_maya > > > -- > >http://groups.google.com/group/python_inside_maya > > -- http://groups.google.com/group/python_inside_maya
