I’m not an advanced coder by any means, so sorry if this is dumb, but is there any way to “listen” for the variable name a node string is assigned to, when it’s created?
The core of this is an attempt to make the act of coding in maya less painful, similar to BigRoy’s awesome Nodex project from a few years ago. I’m working on a couple of wrapper functions around connectAttr, setAttr, etc, but I’m having trouble with createNode and the naming of specific nodes.
So for example, I can type:
radDiv = CN(“mddiv”)
and get a multiplyDivide node set to divide.
Not bad, but it still only has a default name, unless I type:
radDiv = CN(“mddiv”, n=“radDiv”)
That’s like half as much text again. I’m probably getting too hung up on this, but I’m going to type this command thousands of times over my career, and those keystrokes are going to add up. Ideally, I want to type in the python script:
radDiv = CN(“mddiv”)
and have a node generated and automatically renamed to the variable it is known as - “radDiv”.
Is that possible?
Thanks