Sorry to revive this but where do you parent your tertial, secondary and primary chains?
Hello Hakan,
I uploaded my current repo to github so you can grab my bird template.
This is my postScript:
import maya.cmds as cmds
# L Wing tertial master constraint
lTirMstr = 'wing_L0_div6_loc|tertialMaster_L0_root'
if cmds.objExists(lTirMstr):
lTirBlnd = cmds.createNode('transform', n='tertialMasterBlend_L0_drv', p='wing_L0_div6_loc', ss=True)
cmds.parentConstraint('wing_L0_5_jnt', 'wing_L0_7_jnt', lTirBlnd, st=["x","y","z"])
cmds.parentConstraint('wing_L0_6_jnt', lTirBlnd, sr=["x","y","z"])
cmds.parentConstraint(lTirBlnd, lTirMstr, st=["x","z"], mo=True)
# R Wing tertial master constraint
rTirMstr = 'wing_R0_div6_loc|tertialMaster_R0_root'
if cmds.objExists(rTirMstr):
rTirBlnd = cmds.createNode('transform', n='tertialMasterBlend_R0_drv', p='wing_R0_div6_loc', ss=True)
cmds.parentConstraint('wing_R0_5_jnt', 'wing_R0_7_jnt', rTirBlnd, st=["x","y","z"])
cmds.parentConstraint('wing_R0_6_jnt', rTirBlnd, sr=["x","y","z"])
cmds.parentConstraint(rTirBlnd, rTirMstr, st=["x","z"], mo=True)
Here is a function to create a nurbs surface for the wings and tail. I use the nurbs surface to deform the feathers.
def buildMembraine():
if not cmds.objExists('wingFeatherBuilder'):
cmds.createNode('transform', n='wingFeatherBuilder', ss=True)
memDictL = {'scapulaMaster_L0_0_jnt': '.cv[0][0]',
'scapulaMaster_L0_1_jnt': '.cv[0][1]',
'scapulaMaster_L0_2_jnt': '.cv[0][2]',
'scapulaMaster_L0_3_jnt': '.cv[0][3]',
'tertialMaster_L0_0_jnt': '.cv[1][0]',
'tertialMaster_L0_1_jnt': '.cv[1][1]',
'tertialMaster_L0_2_jnt': '.cv[1][2]',
'tertialMaster_L0_3_jnt': '.cv[1][3]',
'secondaryMaster_L0_0_jnt': '.cv[2][0]',
'secondaryMaster_L0_1_jnt': '.cv[2][1]',
'secondaryMaster_L0_2_jnt': '.cv[2][2]',
'secondaryMaster_L0_3_jnt': '.cv[2][3]',
'primaryMid_L0_0_jnt': '.cv[3][0]',
'primaryMid_L0_1_jnt': '.cv[3][1]',
'primaryMid_L0_2_jnt': '.cv[3][2]',
'primaryMid_L0_3_jnt': '.cv[3][3]',
'primaryMaster_L0_0_jnt': '.cv[4][0]',
'primaryMaster_L0_1_jnt': '.cv[4][1]',
'primaryMaster_L0_2_jnt': '.cv[4][2]',
'primaryMaster_L0_3_jnt': '.cv[4][3]',
}
memDictR = {'scapulaMaster_R0_0_jnt': '.cv[0][0]',
'scapulaMaster_R0_1_jnt': '.cv[0][1]',
'scapulaMaster_R0_2_jnt': '.cv[0][2]',
'scapulaMaster_R0_3_jnt': '.cv[0][3]',
'tertialMaster_R0_0_jnt': '.cv[1][0]',
'tertialMaster_R0_1_jnt': '.cv[1][1]',
'tertialMaster_R0_2_jnt': '.cv[1][2]',
'tertialMaster_R0_3_jnt': '.cv[1][3]',
'secondaryMaster_R0_0_jnt': '.cv[2][0]',
'secondaryMaster_R0_1_jnt': '.cv[2][1]',
'secondaryMaster_R0_2_jnt': '.cv[2][2]',
'secondaryMaster_R0_3_jnt': '.cv[2][3]',
'primaryMid_R0_0_jnt': '.cv[3][0]',
'primaryMid_R0_1_jnt': '.cv[3][1]',
'primaryMid_R0_2_jnt': '.cv[3][2]',
'primaryMid_R0_3_jnt': '.cv[3][3]',
'primaryMaster_R0_0_jnt': '.cv[4][0]',
'primaryMaster_R0_1_jnt': '.cv[4][1]',
'primaryMaster_R0_2_jnt': '.cv[4][2]',
'primaryMaster_R0_3_jnt': '.cv[4][3]',
}
memDictC = {'tail_R0_0_jnt': '.cv[0][0]',
'tail_R0_1_jnt': '.cv[0][1]',
'tail_R0_2_jnt': '.cv[0][2]',
'tail_R0_3_jnt': '.cv[0][3]',
'tail_C0_0_jnt': '.cv[1][0]',
'tail_C0_1_jnt': '.cv[1][1]',
'tail_C0_2_jnt': '.cv[1][2]',
'tail_C0_3_jnt': '.cv[1][3]',
'tail_L0_0_jnt': '.cv[2][0]',
'tail_L0_1_jnt': '.cv[2][1]',
'tail_L0_2_jnt': '.cv[2][2]',
'tail_L0_3_jnt': '.cv[2][3]',
}
for dic, side in zip([memDictL, memDictR, memDictC], ['L', 'R', 'C']):
if cmds.objExists(list(dic.keys())[0]): #If rig (joint) is present
#Create Nurbs
if dic == memDictC: #tail
n1 =cmds.nurbsPlane(ch=1, d=1, v=3, p=(0, 0, 0), u=2, w=0.1, ax=(0, 1, 0), lr=1)[0]
else:
n1 = cmds.nurbsPlane(ch=0, d=1, v=3, p=(0, 0, 0), u=4, w=0.1, ax=(0, 1, 0), lr=1)[0]
#Move cv's to match joint pos
for k,v in dic.items():
pos = cmds.xform(k, q=True, t=True, ws=True)
cmds.xform(n1+v, t=pos, ws=True)
#Set skinweights to 100% per jnt
cmds.skinCluster(list(dic.keys()), n1, mi=2, bm=0, sm=0, dr=4, wd=0, tsb=1, n='wing_'+side+'0_membraineN1_skn')
for k,v in dic.items():
cmds.skinPercent('wing_'+side+'0_membraineN1_skn', n1+v, transformValue=[(k, 1.0)])
#Convert to smooth nurbs
n2 = cmds.rebuildSurface(n1, rt=0, kc=0, fr=0, ch=1, end=1, sv=0, su=0, kr=0, dir=2, kcp=1, tol=0.01, dv=2, du=2, rpo=0)[0]
cmds.delete(n2, ch=True)
cmds.skinCluster(list(dic.keys()), n2, mi=2, bm=0, sm=0, dr=4, wd=0, tsb=1, n='wing_'+side+'0_membraineN2_skn')
for k,v in dic.items():
cmds.skinPercent('wing_'+side+'0_membraineN1_skn', n1+v, transformValue=[(k, 1.0)])
cmds.select(None)
#Clean up
cmds.parent(n1, n2, 'wingFeatherBuilder')
cmds.setAttr(n1+'.v', 0)
cmds.rename(n1, 'wing_'+side+'0_membraineN1_drv')
cmds.rename(n2, 'wing_'+side+'0_membraineN2_drv')
else:
cmds.warning('Rig is not present? Cannot build a membraine')
cmds.select(None)
I just tried importing your guides to the scene but I am getting an error
= GEAR RIG SYSTEM ======component base directory not found for ui_host_01
# Error: RuntimeError: file C:\Program Files\Autodesk\Maya2022\Python27\lib\site-packages\pymel\internal\pmcmds.py line 130: Maya command error #
Ah yes. I created a UI Host component. You can either grab it from my repo. Or change the UI host components back to a control_01.
You mean rename them? I can’t import the .sgt files, I get that error immediately.
I tried adding your mgear_4_0_7-main directory to Maya.env like this but mGear menu didn’t show up
MAYA_MODULE_PATH=C:\Users\hakan.aytac\Desktop\mgear_4_0_7-main
I’ve managed to make it work after editing the .sgt file raw, seems like you have bunch of custom components. Renaming them to default mGear ones worked, I got it built now. Thank you very much. I was just wondering how did you manage to make the chain_net on the elbow stay in the middle between elbow and shoulder, do you use constraint? If so, which control should I constraint on the chain_net? Because seems like control itself is being driven by the logic of chains and if I constraint, it’ll destroy the automation, right?
Aha, looks like I will need an arm component with a support elbow joint, I was using arm_2jnt_01 and even though I my chain to the elbow guide, it would still be parented under arm root joint. Tried using an arm component with a support joint, it worked. But we don’t use support joints in our engine Would be nice if there is a way to make it behave the same so it stays oriented in the middle when I bend the arm…
I have a question. I want to use an “arm_2jnt_01” component (because it’s the component that I adjusted to the studio), then parent a chain to the elbow guide. When I build, it parents the chain under arm root instead of elbow support joint, this isn’t the case for other arm components, if you parent anything under elbow guide, they get parented under elbow support joint so they always stay in the middle.
It would be nice to know which part of the code I should edit in order to get the thing parented under elbow guide to be actually parented under support elbow joint when I build.
Thank you bunch!!
Would you happen to have the updated .sgt with said changes? i’m running into the same issue but i’m not savey enough to be able to edit the file correctly
i tired editing the raw file after i removed all the custom references with basic mGear ones. i still get this error at the end that i have no clue what to do with :
#Error: ValueError: file C:\Program Files\Autodesk\Maya2020\bin\python27.zip\json\decoder.py line 367: Extra data: line 50160 column 2 - line 100319 column 2 (char 1735242 - 3470484) #
@Hobbz
I took a moment to remove custom components in the bird template. I uploaded a new template called ‘encore_bird_defaultComponents’. Let me know if I missed a custom component.
taiUI_C0 (control_01)
spine_C0 (spine_S_shape_01)
neck_C0 (neck_ik_01)
faceUI_C0 (control_01)
eye_L0 (eye_01)
jaw_C0 (chain_FK)
eye_R0 (eye_01)
spineUI_C0 (control_01)
shoulder_L0 (shoulder_01)
wingUI_L0 (control_01)
wing_L0 (arm_ms_2jnt_01)
wingKnuckle_L0 (chain_01)
primaryMaster_L0 (chain_net_01)
primaryMid_L0 (chain_net_01)
secondaryMaster_L0 (chain_net_01)
tertialMaster_L0 (chain_net_01)
scapulaPar_L0 (hydraulic_01)
scapulaMaster_L0 (chain_net_01)
shoulder_R0 (shoulder_01)
wingUI_R0 (control_01)
wing_R0 (arm_ms_2jnt_01)
wingKnuckle_R0 (chain_01)
primaryMaster_R0 (chain_net_01)
primaryMid_R0 (chain_net_01)
secondaryMaster_R0 (chain_net_01)
tertialMaster_R0 (chain_net_01)
scapulaPar_R0 (hydraulic_01)
scapulaMaster_R0 (chain_net_01)
tail_L0 (chain_FK_spline_01)
tail_C0 (chain_FK_spline_01)
tail_R0 (chain_FK_spline_01)
leg_L0 (leg_3jnt_01)
foot_L0 (foot_bk_01)
toe_L0 (chain_01)
meta_L0 (meta_01)
toe_L3 (chain_01)
toe_L2 (chain_01)
toe_L1 (chain_01)
legUI_L0 (control_01)
leg_R0 (leg_3jnt_01)
foot_R0 (foot_bk_01)
toe_R0 (chain_01)
meta_R0 (meta_01)
toe_R3 (chain_01)
toe_R2 (chain_01)
toe_R1 (chain_01)
legUI_R0 (control_01)
first off, TY so much for taking the time to answer!
sadly i’m still getting an error :
= GEAR RIG SYSTEM ======component base directory not found for chain_FK
Error: RuntimeError: file C:\Program Files\Autodesk\Maya2020\Python\lib\site-packages\pymel\internal\pmcmds.py line 130: Maya command error #
Warning: Custom component name: init.pyc, already in default components. Names should be unique. This component is not loaded #
(i’m on version 4.0.9 i don’t know if that makes a difference)
Also when i click download on the templates page it doesn’t actually downlaod anything for me it opens a new web page tab with what i assume is the raw version of the .sgt
So i just copy and paste that into an existing .sgt file. but i’m not sure if thats the way to go about things
Try downloading again. I removed chain_FK from the guide.
Oh you are a LEGEND!!! thank you so much!!! it works now
Hey Lethendris, can you walk me through how you renamed the components? I was gonna try it on the quadruped (Thanks Izze!!) but im not sure which lines in the sgt file need the edit and how to change them back to default.
Hey Izze! I love the bird rig! I was wondering if you could instruct me how to edit the sgt for the quadraped and the vehicle especially. I am dying to see how you set these up, but I cant figure out how to rename the .sgt files. I think each would be different to, so Im confused on how to get the names back to their default ones. Any help 1000% appreciated!