Dashboard_avatar
May 19, 2008
Post id: 276039 Report Item

I'm writing a node plugin that connects to dynamic field in maya
using two attributes :

(node) fieldData -> inputData (field)
(node) inputForce <- outputForce (field)

my node will then output a series of translate/rotate
to move a locator in the 3d world

I did set dependencies on the outputs to the inputForce attribute
so that when the node is being pulled for the output , it should pull
on the inputForce to the field node and the field node should in return
pull on the fieldData of my node to get the points position ...

problem is ... I do never get a compute() call on the fieldData plug ...
Has anyone encountered something like that or did write a node
that was connecting to a field ??

Thanks!!

Dashboard_avatar
May 19, 2008
Post id: 276040 Report Item

Edit:
Is your "dynamic field" a subclass of MPxFieldNode? Your inputData and outputForce attributes suggest that it is.

QUOTE(Majestik @ 05/19/08, 07:56 AM) [snapback]285785[/snapback]
I did set dependencies on the outputs to the inputForce attribute
so that when the node is being pulled for the output , it should pull
on the inputForce to the field node and the field node should in return
pull on the fieldData of my node to get the points position ...


I find this a bit confusing. I hope you realize that an attribute can only affect another attribute in the same node. For all else you require connections.

Perhaps you should post a bit of your code.

Dashboard_avatar
May 19, 2008
Post id: 276041 Report Item

sorry i badly explained myself (don't have the code with me right now sad.gif )

I'm actually not writing a field but an MPxNode that can be connected to a field
so on my node I have the attributes :
output attr : fieldData (containing pos,vel,mass and deltatime)
input attr : inputForce (vectorArray)

these two attributes are connected to the inputData and outputForce attribute of the field.

my node also has a position output that I connect to locators.
My problem is, i have set a
attributeAffects(inputForce,outputPositions);
and when I get pulled on the compute() method for the outputPositions,
I query the value of the inputForce attribute, and I suppose that for the field
to send me the correct data it needs to pull on its inputData (so my fieldData) attribute.
But that does not happen ...
and I did check the clean status of the inputForce plug and it is always dirty, my guess is
the field doesn't get a clean on its inputData attribute so it cannot set the outputForce to clean,
but since I'm not called for the fieldData, I cannot set it to clean ...

sorry i know it's a bit confusing, I'll try and post some code tonight if I need to make it clearer.

Thanx !!

Dashboard_avatar
May 19, 2008
Post id: 276042 Report Item

Your output attibute contains three elements. Is it a compound attribute?

Your latest reply raises as many questions as your original post. For example I'm still not sure if you by "field" you mean an subclass of MPxFieldNode. And now you mention a locator. Are we now talking about three nodes or just two? Perhaps you should post class declarations, initialize and compute methods of both nodes.

Dashboard_avatar
May 19, 2008
Post id: 276043 Report Item

yes it's a compound attribute

ok to clarify things a bit here it's how my connections are made,
the plugin am writing is "myNode" :

CODE
                     _________                                    ____________
                     |        |-- fieldData -------> inputData -- |          |
locator ---- (outPos)| myNode |                                   |  field   |
                     |        |-- inputForce <------ outputForce--|          |
                     ---------                                    -----------


so as you can see , for myNode to generate my outPos, I pull on inputForce
which *should* pull on my fieldData but i don't see that coming ...

is it more understandable that way ?

Dashboard_avatar
May 20, 2008
Post id: 276044 Report Item

Unfortunately I can't. Perhaps someone else can.

Dashboard_avatar
May 23, 2012
Post id: 310103 Report Item

Hi !

How did you do that finally?
I have the same problem

zap  ( 4years after...)