On Thu, Jan 29, 2009 at 06:15, nick puckett <[email protected]> wrote:
> I should probably be more specific:
>
> I'm back to my mocap project that I haven't looked at in a while, but have
> decided to come back to. Some good advice on this board several months back
> pointed me in the direction of  MTimerMessage
>
> his advice was to create a callback that would dirty the input plug of the
> compute, which I tried, but couldn't quite get to work.  The other was to
> set the value directly to the output plug, but I've struggled with that as
> well....(see the pattern?)
>
> Anyway, it's a bit frustrating because I receive the values from my device
> no prob, but I can't simply pipe these values to an attribute on my node.
>
> does that help or just confuse things?

Okay, so you're in your callback func and you want to set the value of
MYATTR on a node of type testNode?

Assuming that 'node' contains the MObject of the node and the testNode
class definition is visible to the callback func, you'd do it this
way:

  plug = om.MPlug(node, testNode.MYATTR)
  plug.setFloat(5.3)

If the testNode class definition is not visible to the callback func
then you'd do it this way:

  nodeFn = om.MFnDependencyNode(node)
  plug = nodeFn.findPlug("myAttr")
  plug.setFloat(5.3)

-- 
-deane

--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---

Reply via email to