forked from jjburton/cgmTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscratch_segmentRework.py
118 lines (99 loc) · 4.26 KB
/
scratch_segmentRework.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import cgm.core.cgm_Meta as cgmMeta
import cgm.core.rigger.RigFactory as Rig
cgm.core._reload()
import cgm.core.lib.name_utils as NAMES
[NAMES.short(o) for o in mc.ls(sl=True)]
import cgm.core.rig.segment_utils as SEGMENT
reload(SEGMENT)
#BASE SETUP ========================================================================================================
SEGMENT.create_curveSetup(jointList,useCurve,'zyx','y+',baseName,stretchBy,advancedTwistSetup,addMidTwist,extendTwistToEnd,reorient,moduleInstance)
#Options =========================================================================================
jointList = [u'chain_0', u'chain_1', u'chain_2', u'chain_3', u'chain_4']
len(range(0,10))%2
useCurve = 'resultCurve'
baseName = 'test'
stretchBy = 'translate'
stretchBy = 'scale'
stretchBy = None
advancedTwistSetup = True
addMidTwist = False
addMidTwist = True
extendTwistToEnd=False
moduleInstance = None
reorient = False
SEGMENT.create_curveSetup(jointList,useCurve,'zyx','y+',baseName,stretchBy,advancedTwistSetup,addMidTwist,extendTwistToEnd,reorient,moduleInstance)
_d = {'jointList' : [u'tongue_0_jnt',
u'tongue_1_jnt',
u'tongue_2_jnt',
u'tongue_3_jnt',
u'tongue_4_jnt',
u'tongue_5_jnt'],
'useCurve' : None,
'baseName' : 'test',
'stretchBy' : 'scale',
'advancedTwistSetup' : True,
'addMidTwist' : False,
'extendTwistToEnd':False,
'moduleInstance' : None,
'reorient' : False}
#Segment SETUP ========================================================================================================
_d = {'jointList' : [u'chain_0', u'chain_1', u'chain_2', u'chain_3', u'chain_4'],
'influenceJoints' : [u'lwrArm|elbowDirect', u'handDirect'],
'addSquashStretch' : True,
'useCurve' : 'resultCurve',
'addTwist' : True,
'startControl' : 'elbowDirect_crv',
'endControl' : 'hand_crv',
'segmentType' : 'curve',
'rotateGroupAxis' : 'rz',
'secondaryAxis' : None,
'baseName' : None,
'advancedTwistSetup' : False,
'additiveScaleSetup' : True,
'connectAdditiveScale' : True,
'orientation' : 'zyx',
'controlOrientation' : None,
'moduleInstance' : None,
'stretchBy' : 'scale'}
reload(SEGMENT)
SEGMENT.create(**_d)
#Squash and stretch SETUP ========================================================================================================
_d = {'jointList' : [u'chain_0', u'chain_1', u'chain_2', u'chain_3', u'chain_4'],
'orientation' : 'zyx',
'stretchBy' : 'scale'}
reload(SEGMENT)
SEGMENT.addSquashAndStretch_toCurve(**_d)
_d = {'jointList' : [u'chain_0', u'chain_1', u'chain_2', u'chain_3', u'chain_4'],
'orientation' : 'zyx',
'stretchBy' : 'scale'}
reload(SEGMENT)
SEGMENT.addAdditveScale_toCurve(**_d)
#Add mid ========================================================================================================
midReturn = rUtils.addCGMSegmentSubControl(ml_influenceJoints[1].mNode,
segmentCurve = i_curve,
baseParent=ml_influenceJoints[0],
endParent=ml_influenceJoints[-1],
midControls=ml_segmentHandles[1],
baseName=mi_go._partName,
controlTwistAxis = 'r'+mi_go._jointOrientation[0],
orientation=mi_go._jointOrientation)
"""
joints=None,segmentCurve = None, baseParent = None, endParent = None,
midControls = None, orientation = 'zyx',controlOrientation = None,
controlTwistAxis = 'rotateY',
addTwist = True, baseName = None,
rotateGroupAxis = 'rotateZ', blendLength = None,
connectMidScale = True,
moduleInstance = None):
"""
_d = {'joints':'lwrArm|midDirect',
'segmentCurve' : 'resultCurve_splineIKCurve_splineIKCurve',
'baseParent':'null5_attach|elbowDirect',
'endParent':'handDirect',
'midControls':'mid_crv',
#'jointList' : [u'chain_0', u'chain_1', u'chain_2', u'chain_3', u'chain_4'],
'baseName':None,
'controlTwistAxis':'rz',
'orientation' : 'zyx'}
reload(SEGMENT)
SEGMENT.add_subControl_toCurve(**_d)