Hello again, it's me from that Autodesk forum thread. :)

Indeed I was also unable to tackle this challenge, which is ultimately an 
issue of cyclic dependency.

1. User manipulates transform
2. Transform feeds into custom noise node
3. Noise node feeds into transform

The pairBlend does a good job at providing users with what is effectively a 
translate/rotate gizmo for your noise node. But, this was the issue I also 
ran into and spent all of my strength to try and resolve. (For context, 
here's where I gave up and found a better 
method: https://learn.ragdolldynamics.com/releases/2021.09.27/#demo-1-basics)

It seems like such a simple thing too; so close to working! But alas, the 
issue was consistent across platforms and versions of Maya, so I have 
little faith that this will ever be addressed. Odds are the behaviour is 
necessary for normal evaluation of some other feature/node/plug.

Instead, I would suggest you do what I ultimately did; which is to 
implement your own gizmo. Then the user can select your noise node and gain 
access to the same translate/rotate gizmo to animate it. It won't be as 
transparent, as they would have to select a different node (although there 
are workarounds for this too!) and even implementing a manipulator is 
*hard*. The API is (in my opinion) not very well thought out, which I 
expect explains why we don't see many custom manipulators in Maya developer 
land.

Luckily, in your case, the gizmos are the normal translate/rotate gizmos 
and which have default implementations and are mostly available for 
copy/paste amongst the devkit samples.

- 
https://github.com/sonictk/Maya-devkit/blob/master/win/devkit/plug-ins/moveManip/moveManip.cpp
- 
https://github.com/sonictk/Maya-devkit/blob/master/win/devkit/plug-ins/rotateManip/rotateManip.cpp

As for the workaround; Maya has another quick which can work to your 
advantage here; when you activate the manipulator (T key, by default) Maya 
will query the currently selected node for its custom manipulator, like the 
ones above. If none is found, it will then query the *first shape of the 
currently selected transform*.

And that's key right there; if you make your noise a shape node and let it 
be the first *and only* shape of a transform, then your users will be able 
to select the node (which you can also draw yourself) and press T to start 
manipulating it. Now, the quirk is that it cannot be a sibling to another 
shape, no matter the type, or Maya will refuse to show the manipulator, So 
if you use it on an animation control which already has a NURBS shape, then 
you are out of luck.. But, maybe this is enough!

Hope it helps.

Best,
Marcus
On Saturday, 25 November 2023 at 11:54:51 UTC matiinfa...@gmail.com wrote:

> Hi everyone,
>
> I'm currently facing some challenges while writing a custom Noise node in 
> Maya. Here's what I'm aiming to achieve:
>
> I want to create a custom noise node that sits between an animCurve 
> connection and a transform attribute (e.g., tx). This node should take the 
> animCurve output, perform some noise algorithms, and then output it back to 
> the transform attribute (e.g., tx). I've managed to write the node to a 
> certain extent, and everything seems to work as expected. [image: 
> noiseWorkflow.PNG] 
>
> However, I'm encountering an issue. I want animators to still be able to 
> set/move/rotate values on the attribute and see attribute keyframes in 
> their timeline. I've tried using om.MPxNode.isPassiveOutput, and it seems 
> to "unlock" my attribute successfully. Now, I can move/rotate my object 
> around while the noise is connected. However, the values don't pass through 
> to my animCurve node. If I move the timeline or perform any action, the 
> values reset.
>
> I'm unsure if my approach is correct, or if I'm missing something. Could 
> you please share your thoughts and ideas on this matter?
>
> -I've managed to achieve something similar with the pairBlend node, but I 
> ran into this issue 
> <https://forums.autodesk.com/t5/maya-animation-and-rigging/bug-with-pairblend-and-auto-key/m-p/12399633#M29917>
>  
> and I'm exploring alternative ways to achieve it without pairBlend. I've 
> attached a picture of my pairBlend workaround for reference: [image: 
> noiseWorkflowPairBlend.PNG] 
>
> Regards, Matin F
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/3e271bd5-d856-4210-8a88-f3803b7f7f32n%40googlegroups.com.

Reply via email to