| Item | Quantity | Price | |
|---|---|---|---|
| Your cart is empty. Check out our collection of 3d models! | |||
Prices in:
Clear Cart
Home » Forums » Maya Boards » API » MPxTransform::validateAndSetValue->get current attr values Topic 22 of 2432
| Item | Quantity | Price | |
|---|---|---|---|
| Total | 0 | $0.00 (USD) | |
| Your cart is empty. Check out our collection of 3d models! | |||
Prices in:
Clear Cart
| Name | Contributions | Posts |
|---|---|---|
| Will McCullough | 766 | 21224 |
| fileadmin | 424 | 0 |
| axyz-design | 378 | 0 |
| peter_pan03 | 356 | 0 |
| stefano tartarotti | 303 | 0 |
| Mesh Factory | 292 | 0 |
| PerspectX | 283 | 0 |
| Tomasz Rozkosz | 257 | 0 |
| allen pan | 224 | 0 |
| Plutonius | 220 | 0 |
| Name | Downloads |
|---|---|
detachSeparate.mel |
832,874 |
TrueGlass |
823,432 |
The Andy Rig |
585,650 |
Sergio |
458,426 |
LWOImpR4-R5_043 |
430,914 |
Tiny |
326,848 |
Smedge .6 |
208,192 |
Ocean Shader |
181,438 |
silver shader |
172,812 |
At The Sea |
160,845 |
I have been trying to find a solution for this for quite a long time now, but couldn`t succeed, so here is it:
My MPxTransform should be able to display ( AE ) the result of some calculations, when I change a input value.
No downstream node should be involved, so no data pulling happens.
In general, this should be possible.
The input attribute has the "mustCallValidateAndSetValue" activated, so the "validateAndSetValue" method is called, when the attribute value is changed by the user.
But for the calculation I need the current values of other input connections.
As there is no dataBlock provided in the "valiIdateAndSetValue" method, I had to create my own with "MPxNode::forceCache". But, this dataBlock does not have current values, but the ones from the last evaluation ( bug? ).
The problem is the same when using "MPlug::getValue".
Moreover, my memory told me, that, when trying to get a attribute value with "MPlug::getValue", the "compute" method is called ( so that I can use the provided -working- dataBlock in the "compute" method to get the other current input attribute values ). But this does not work here either, "compute" is not called...
So, may have anyone an idea of how i can force Maya to spit out the current values of several attributes in the "MPxTransform::validateAndSetValue"?
If I understand correctly, you are writing your onw transform node and you want to access native attrs in you node and do some calculation with those values as well as with other custom attrs with incoming connections, right? If so, that is kind of what I am trying to do.
How is it going?
If the MPxTransformNode is a derivative of the MPxNode class, couldn't you override the compute function which does have access to the dataBlock? Then I'm assuming you can use the MDataHandles to retrieve values.
At least that is what I am trying to do with my custom locator.
Read my post. I am having a similar problem:
http://www.creativecrash.com/forums/api/topics/custom-locator-with-compute-function---2
You got to read the docs for MPxTransform.
If you want input transform attributes ( or others ), you must set them with the ::mustCallValidateAndSet.
Then, if you change the value directly, the ::validateAndSetValue method is called, not the ::compute.
Point is that you have access to the current value only for the attribute the MDataHandle is provided for.
You CAN use the ::forceCache, but this is only good for output data. Input data are not current, but from the evaluation before ( at least this is what I can see...).