Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8377245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:37:14+00:00 2026-06-09T15:37:14+00:00

Using the attributeAffects function two attributes of a Maya node can be linked. For

  • 0

Using the attributeAffects function two attributes of a Maya node can be linked. For example an input attribute, x can be linked to an output attribute, y. This means that when x is changed, Maya will run a compute() callback function on the given node, to calculate y.

However, as far as I can tell, only attributes on the node itself can connected like this, from inside a plugin.

In my plugin I extend an MPxLocator, and make the output attribute, out. I want to do the following:

# replace <...> with transform node name.
attributeAffects(CustomNode.out, <custom node's tranform node>.translateX)
attributeAffects(CustomNode.out, <custom node's tranform node>.translateZ)

I can’t find any docs on how to do this at all! Has anyone done it / know how? There is a way to hack this by doing the following in the script editor (python):

import maya.cmds as cmds

# Creates CustomNode1, which is linked to transform1 in the DG.
cmds.createNode("CustomNode") 
cmds.connectAttr("transform1.translateX", "CustomNode.out")
cmds.connectAttr("transform1.translateZ", "CustomNode.out")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:37:16+00:00Added an answer on June 9, 2026 at 3:37 pm

    A node by design should not know of other nodes. That is if the node has some data it needs then that data needs to be internal, or connected in when created or by the user. This is that causes Maya to be efficient. Its not that Maya actually enforces this but neglecting this design idea will make you very unhappy, because you fight Maya all the time (plus its more, extremely error prone, code to maintain).

    So this leaves you with 2 options:

    • creating 2 input attributes and read those (make 3 while your at it, then you can just connect all of the translate). The bonus of this approach is that now any Maya user can do something you didn’t expect with your node. This is how all other Maya nodes work. Most factory nodes supply a command for making the node so they can hook up the expected connections to rest of the nodes. Users wishing to do something else can always use createNode. So no it’s not really a hack to do this, if you don’t connect to the out attribute.
    • it so happens that the locator node already knows the transformation of its parent, in the form of the DAG node inherited attribute parentMatrix , now this is not the local coordinates of the parent but its in world space coordinates. Now this is also a connection that Maya makes but its a hidden connection type.*

    Those are your only sane options. But if you really must you can also do what you ask but then you will be making your own event monitoring on top of the free performance optimizing one Maya supplies. Its a bit of extra code and much more debugging on your part, and it will be in all ways inferior.

    PS: the reason why your hack works is that Maya evaluates the connections the opposite way they are made, so if you make the output dirty and Maya is asked to evaluate the output then Maya will fire compute

    *Just like time, if you make a attribute named time of time type then Maya will connect it for you without asking and showing, unless you connect it to something else. Shading is mostly based on these connections.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this pipeline I can play two of the same videos using the videomixer,
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
using this code I can send one texture to the shader: devcon->PSSetShaderResources(0, 1, &pTexture);
Using CI for the first time and i'm smashing my head with this seemingly
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using jQuery, one can easily find out whether a particular element is visible using
Using the HTML5 File API I can get the Binary String representation of a
Using NSDateComponents I know how to get the day component, but this gives me
Using Android TelephonyManager an application can obtain the state of data activity over the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.