Can someone tell me how can I obtain the MObject from inside a deformer?
The node itself? No, you should under no circumstances ever need to do this*. Its a biig design nono, no good can come out of it.
What is the relation between the paramer block of the deform function and the MObject?
The Mobject is a node, parameter block is the data of a node (Same difference as being in oppsition and being in government). The node itself by design should not, and really can not without risking great harm to maya, be known. The computation is to be done fully without knowing anything about the nodal structures. That is the reason you have attributes in the nodes to get maya to do the work of giving you everything you need.
The node (that is any node) should just do following:
- ask what output (sic) node maya is asking for
- ask for the inputs that output needs (no more, even other outputs can be inputs even for sma e node just ask, maya will then do that block recursively because you do the step1 if you dont then you must clen the output as soona s possible), no other inpuit whatsoever.
- compute that node and any ones you get possibly for free.
- mark slot clean (important)
This ensures that the node evalueation is side effect free, which is a requirement for the lazy evaluation to work well.
There are very few corner cases** where you should consider knowing a connected (or soon to be) other nodes mobjects briefly (self would be meningless since you allready ahve all data, even so the mobject should be just for ceration purposes for example data still trough connections so no querrying), just to discard them. But yous should not veture there untill you know how basic operation should work. Nodes should not , as a general rule, modifying the dg or dag (if they do then it gets really hard to design yoru node be ready to debug 30 times more than in cses where you do not modify things, and degug evey maya release)
The things you should not ever do are:
* manipulate other nodes without connections
* change connections during evaluation (ok maybe in the snapshot nodes case, but then you can use snapshot node to proxy thsi for you)
* ask other nodes data (thats what your datablock is for)
- the only thing you could possibly sanely achieve is changing the name of the node, which is pointless.
**almost none the snapshot node being the only real node that does this, but certain other node might need thiskind of thisngs for some really weird stuff. Also the ik nodes do this because they work outside normal maya evaluation anyway.