Home Website Youtube GitHub

Prebuild Duplicate Sym script

Hi im trying to make a prebuild script that will duplicate Sym the arms, legs, etc. this is what I have so far
"
from maya import cmds
from mgear import rigbits
import mgear
import pymel.core as pm

ctls = [‘shoulder_L0_root’, ‘eye_L0_root’, ‘leg_L0_root’]

for ctl in [ctls]:
print(ctls)
cmds.select(ctls)
mgear.rigbits.duplicateSym(clts)
"

but is doesn’t seem to want to duplicate sym all of the controls where it will dup sym the first control
then just dup the rest.

also for some reason when “shoulder_L0_root” is in the front the dup sym doesn’t work properly but if I dup sym it from the shifter then it does

Regards
IDntKnw

There are a few problems with your python code that creates the problem, for the for loop, don’t put ctls in brackets, and check inside the for loop you’re using the “ctl” not “ctls”.

from maya import cmds
from mgear import rigbits
import mgear
import pymel.core as pm

ctls = ["shoulder_L0_root", "eye_L0_root", "leg_L0_root"]

for ctl in ctls:
    print(ctl)
    cmds.select(ctl)
    mgear.rigbits.duplicateSym(ctl)

Like so.
This worked for me at least.

Hi thanks very much it works. except the shoulder is still duplicating funny not to sure why but im sure i can get tot hte bottom of that. Much thanks

so it does the duplicate sym but it now brings up and error when i try and build the rigs “IndexError: list index out of range”.
anythoughts

Would have to need to see your guides I think. If you can attach a file I can take a look.

Unfortunately it’s work related so can’t get files off of server but thanks for all the help if I get a fix I’ll let you know incase others have same issue

1 Like

Please post the exact code you are running, or specify that you are running the code exactly as saka wrote. And post the full error, not just a small snippet or summary. Otherwise we can only guess.

And you can put your code in between triple backticks so it formats properly in the forum.

```
Example
```