Exemplo n.º 1
0
    def slideSinge(self, Text, sign='DEL'):
        WD = CreateControler(self.Color, (1, 1, -1))
        AR = WD.SK_b09(Text + '_M')
        ARGRP = rig.group(AR, n=AR + '_CON_GRP', r=True)
        rig.setAttr(ARGRP + '.sx', 0.08)
        rig.setAttr(ARGRP + '.sy', 0.08)
        rig.setAttr(ARGRP + '.sz', 0.08)
        rig.move(0, 0, 0.165959, AR + '.scalePivot', AR + '.rotatePivot')
        rig.setAttr(ARGRP + '.tz', -0.166)

        SQ = WD.SK_b13(Text + '_RANGE_SQ')
        SQGRP = rig.group(SQ, n=SQ + '_RANGE_GRP', r=True)
        rig.setAttr(SQGRP + '.sx', 0.08)
        rig.setAttr(SQGRP + '.sy', 0.08)
        rig.setAttr(SQGRP + '.sz', 0.337)
        rig.setAttr(SQGRP + '.tz', 0.674)

        TX = self.text(Text)
        TXGRP = rig.group(TX, n=TX + '_TEXT_GRP', r=True)
        rig.setAttr(TXGRP + '.sx', 0.08)
        rig.setAttr(TXGRP + '.sy', 0.08)
        rig.setAttr(TXGRP + '.sz', 0.08)

        if 'up' == sign:
            rig.setAttr(TXGRP + '.tz', 1.519)
        if 'dn' == sign:
            rig.setAttr(TXGRP + '.ry', 90)
            MinZ = rig.xform(TXGRP, q=True, bb=True, ws=True)[2]
            MaxZ = rig.xform(TXGRP, q=True, bb=True, ws=True)[5]
            TZ = ((MaxZ - MinZ) / -2) - 0.2
            rig.setAttr(TXGRP + '.tz', TZ)
        if 'lf' == sign:
            rig.setAttr(TXGRP + '.ry', 90)
            rig.xform(TXGRP,
                      t=[0.34603909286553236, 0.0, 0.67400000000000027],
                      wd=True)
        if 'rt' == sign:
            rig.setAttr(TXGRP + '.ry', 90)
            rig.xform(TXGRP,
                      t=[-0.33073309305179166, 0.0, 0.67400000000000027],
                      wd=True)

        partConGRP = rig.group(TXGRP, SQGRP, ARGRP, n=Text + '_WIDGE_GRP')
        rig.makeIdentity(partConGRP, apply=True, s=True, t=True, r=True)

        rig.transformLimits(AR, tz=(0, 1), etz=(1, 1))
        rig.setAttr(TXGRP + '.overrideEnabled', 1)
        rig.setAttr(TXGRP + '.overrideDisplayType', 2)
        rig.setAttr(SQGRP + '.template', 1)

        if 'DEL' == sign:
            rig.delete(TXGRP)

        return partConGRP, AR
Exemplo n.º 2
0
    def square(self, Text, sign=False):
        WD = CreateControler(self.Color, (1, 1, -1))
        AR = WD.SK_b13(Text + '_M')
        ARGRP = rig.group(AR, n=AR + '_CON_GRP', r=True)
        rig.makeIdentity(ARGRP, apply=True, t=True, s=True, r=True)
        if sign:
            ARShape = rig.listRelatives(AR, s=True)[0]
            rig.setAttr(ARShape + '.overrideEnabled', 0)
            rig.setAttr(AR + '.overrideEnabled', 1)
            rig.setAttr(AR + '.overrideDisplayType', 2)

        return ARGRP, AR
Exemplo n.º 3
0
    def fourSlide(self, Text, sign='DEL'):
        WD = CreateControler(self.Color, (1, 1, -1))
        AR = WD.SK_b06(Text + '_M')
        ARGRP = rig.group(AR, n=AR + '_CON_GRP', r=True)
        rig.setAttr(ARGRP + '.sx', 0.1)
        rig.setAttr(ARGRP + '.sy', 0.1)
        rig.setAttr(ARGRP + '.sz', 0.1)

        SQ = WD.SK_b13(Text + '_RANGE_SQ')
        SQGRP = rig.group(SQ, n=SQ + '_RANGE_GRP', r=True)
        rig.setAttr(SQGRP + '.sx', 0.6)
        rig.setAttr(SQGRP + '.sy', 0.6)
        rig.setAttr(SQGRP + '.sz', 0.6)

        TX = self.text(Text)
        TXGRP = rig.group(TX, n=TX + '_TEXT_GRP', r=True)
        rig.setAttr(TXGRP + '.sx', 0.14)
        rig.setAttr(TXGRP + '.sy', 0.14)
        rig.setAttr(TXGRP + '.sz', 0.14)

        if 'up' == sign:
            rig.setAttr(TXGRP + '.tz', 1.6)
        if 'dn' == sign:
            rig.setAttr(TXGRP + '.tz', -1.6)
        if 'lf' == sign:
            rig.setAttr(TXGRP + '.tx', 1.6)
        if 'rt' == sign:
            rig.setAttr(TXGRP + '.tx', -1.6)

        partConGRP = rig.group(TXGRP, SQGRP, ARGRP, n=Text + '_WIDGE_GRP')
        rig.makeIdentity(partConGRP, apply=True, s=True, t=True, r=True)

        rig.transformLimits(AR, tz=(-1, 1), etz=(1, 1))
        rig.transformLimits(AR, tx=(-1, 1), etx=(1, 1))
        rig.setAttr(TXGRP + '.overrideEnabled', 1)
        rig.setAttr(TXGRP + '.overrideDisplayType', 2)
        rig.setAttr(SQGRP + '.template', 1)

        if 'DEL' == sign:
            rig.delete(TXGRP)


#        setRangeNode
        rig.addAttr(AR, at='float', ln=AR + '_up', k=True)
        rig.addAttr(AR, at='float', ln=AR + '_dn', k=True)
        rig.addAttr(AR, at='float', ln=AR + '_lf', k=True)
        rig.addAttr(AR, at='float', ln=AR + '_rt', k=True)
        RNDX = rig.createNode('setRange', n=AR + '_SR', ss=True)
        rig.connectAttr(AR + '.tx', RNDX + '.valueX')
        rig.connectAttr(AR + '.tx', RNDX + '.valueY')
        rig.setAttr(RNDX + '.minX', 0)
        rig.setAttr(RNDX + '.minY', 1)
        rig.setAttr(RNDX + '.maxX', 1)
        rig.setAttr(RNDX + '.maxY', 0)
        rig.setAttr(RNDX + '.oldMinX', 0)
        rig.setAttr(RNDX + '.oldMinY', -1)
        rig.setAttr(RNDX + '.oldMaxX', 1)
        rig.setAttr(RNDX + '.oldMaxY', 0)
        rig.connectAttr(RNDX + '.outValueX', AR + '.' + AR + '_lf')
        rig.connectAttr(RNDX + '.outValueY', AR + '.' + AR + '_rt')

        RNDY = rig.createNode('setRange', n=AR + '_SR', ss=True)
        rig.connectAttr(AR + '.tz', RNDY + '.valueX')
        rig.connectAttr(AR + '.tz', RNDY + '.valueY')
        rig.setAttr(RNDY + '.minX', 0)
        rig.setAttr(RNDY + '.minY', 1)
        rig.setAttr(RNDY + '.maxX', 1)
        rig.setAttr(RNDY + '.maxY', 0)
        rig.setAttr(RNDY + '.oldMinX', 0)
        rig.setAttr(RNDY + '.oldMinY', -1)
        rig.setAttr(RNDY + '.oldMaxX', 1)
        rig.setAttr(RNDY + '.oldMaxY', 0)
        rig.connectAttr(RNDY + '.outValueX', AR + '.' + AR + '_up')
        rig.connectAttr(RNDY + '.outValueY', AR + '.' + AR + '_dn')
        # end

        return partConGRP, AR