Peg Scripting help

I was hoping to create a script that grabs the Peg and changes the peg colour and then locks it. I have a LOT of this to do and doing it by hand would be an insane waste of time. I can’t seem to find the attribute in the peg options that helps me even know what the attributes to change the colour and lock attributes in the Peg layer properties are.


module type=“PEG” name=“Peg-Position-Separate” pos=“0,0,0”
version val=“1”
collapsed val=“false”/
enable3d val=“false”/
separate val=“true”/
x val=“0”/
y val=“0”/
z val=“0”/

so i could write something along the lines of:

for selected pegs, change

function changeColourRGBA()

var n = selection.selectedNode(0);

then same with “lock” attribute

(i know that’s not correct, but it’s the closest I could come on a guess… but i can’t seem to even find what the attribute script name is called in the list of peg attributes available to change via script)

I’ve done a fair bit of successful scripting in Maya and 3Ds Max. But i rely heavily on the listener to get a sense of where to begin.

Any help or direction would be greatly appreciated.


try to see this script
it should help to understand