[Maya/Python] - Deleting remapValue Node entries?!

Researched a bit yesterday and was not able to find a solution to this seemingly simple action.

How do I delete (or list) all entries of a remap Value Node? I need to make sure the entries are cleaned out before pumping my own in there. Thanks for any help! I work in Python but can decipher mel well enough (so either or).

I found out about the “removeMultiInstance” command and can remove any point in the remapValue Node. The trouble is that I’m having a hard time finding a way to list all current entries. The remap Value node can only take 50 points. That being said, those points (entries) can be labeled outside of 0-50 (so one entry might be 1054 for example).

Again, thank you.

-9k

edit: ALSO… Is there any gosh darn way to place nodes at specific coordinates on the hypershade? If I want to script out the creation of a generic node tree I’d like it looking neat, not all the piss around the hypergraph editor. Many thanks.

Here are some steps you can use to get all the data from a multiattribute

  1. use getAttr to get a list of indices cmds.getAttr(node + ‘.’ + multiattr, multiIndices=True)
  2. use attributeQuery to get a list of child attributes cmds.attributeQuery(multiattr, node=node, listChildren=True)
  3. use this data to build a dictionary of multiattr, child value pairs
  4. store this data and use it later

Similarly to clear a multiattribute you can use getAttr to get the list of indices then removeMultiInstance to remove them

Dyaum DanBradham. Thank you for the help.

The piece of the puzzle was the ‘multiIndices=True’. I tried ‘cmds.getAttr(remapValueNode.value)’ but it always error’d out because it was returning a multiIndex value.

Cheers! Thank you.

Also I’d like to share the script that this was involved in. It translates an optimized curve out of the graph editor and into any selected remapValue nodes!

https://drive.google.com/open?id=0B9uMOakcTA0adXV4RVMtaE5Gd2c

Description-
This script takes a nice curve from the graph editor and transfersan optimized version of it to any selected remapValue Nodes.
For instructions please click on the title header button.

Installation-
Step 1: Script Editor>File>Load Script. Load the AnimCurve.py
Step 2: Middle click drag to your shelf

Instructions-
Step 1: Click “Create/Select AnimCurve” button (creates a AnimCurve node)
Step 2: With your graph editor open, make sure the AnimCurve node that was generated is selected (for easy selection just reclick “create/Select AnimCurve button”)
Step 3: In the graph editor, move the curve around to get the desired curve you want to translate to the remapValue node.
Step 4: Select one or many remapValue nodes and click “Transfer”. This will map the graph editor curve to the selected remapValue nodes.
Step 5: Give yourself a pat on the back. You now have bezier curve capabilities with any remapValue Node (sorta-kinda). :smiley: