Esempio n. 1
0
def buildBob(mode='guide'):

    Profiler.getInstance().push("bob_build")

    bobGuideRig = Rig("char_bob")
    bobGuideRig.loadRigDefinition(bob_guide_data)

    if mode == 'guide':
        builder = plugins.getBuilder()
        builder.build(bobGuideRig)

    elif mode == 'rig':
        synchronizer = plugins.getSynchronizer()
        synchronizer.setTarget(bobGuideRig)
        synchronizer.sync()

        bobRigData = bobGuideRig.getGuideData()
        bobRig = Rig()
        bobRig.loadRigDefinition(bobRigData)

        builder = plugins.getBuilder()
        builder.build(bobRig)

    else:
        LogMessage('Invalid mode set')

    Profiler.getInstance().pop()

    if __name__ == "__main__":
        print Profiler.getInstance().generateReport()
    else:
        if mode == 'guide':
            logHierarchy(bobGuideRig)
        elif mode == 'rig':
            logHierarchy(bobRig)
Esempio n. 2
0
def buildArm(mode='guide'):

    Profiler.getInstance().push("arm_build")

    guideContainer = Container('armGuide')

    armGuide = ArmComponentGuide("arm", parent=guideContainer)
    armGuide.loadData({
            "name": "Arm",
            "location": "L",
            "bicepXfo": Xfo(Vec3(2.27, 15.295, -0.753)),
            "forearmXfo": Xfo(Vec3(5.039, 13.56, -0.859)),
            "wristXfo": Xfo(Vec3(7.1886, 12.2819, 0.4906)),
            "handXfo": Xfo(tr=Vec3(7.1886, 12.2819, 0.4906),
                           ori=Quat(Vec3(-0.0865, -0.2301, -0.2623), 0.9331)),
            "bicepFKCtrlSize": 1.75,
            "forearmFKCtrlSize": 1.5
        })

    if mode == 'guide':
        builder = plugins.getBuilder()
        builder.build(guideContainer)

    elif mode == 'rig':
        synchronizer = plugins.getSynchronizer()
        synchronizer.setTarget(guideContainer)
        synchronizer.sync()

        armGuideData = armGuide.getRigBuildData()

        rigContainer = Container('armRig')
        arm = ArmComponent(parent=rigContainer)
        arm.loadData(armGuideData)

        builder = plugins.getBuilder()
        builder.build(rigContainer)
    else:
        LogMessage('Invalid mode set')

    Profiler.getInstance().pop()

    if __name__ == "__main__":
        print Profiler.getInstance().generateReport()
    else:
        if mode == 'guide':
            for each in armGuide.getItems().values():
                # Only log hierarchy for Layer objects as Layers in this test are added to
                # the component since there is no rig object.
                if each.isTypeOf('Layer'):
                    logHierarchy(each)
        elif mode == 'rig':
            for each in arm.getItems().values():
                # Only log hierarchy for Layer objects as Layers in this test are added to
                # the component since there is no rig object.
                if each.isTypeOf('Layer'):
                    logHierarchy(each)
Esempio n. 3
0
def buildArm(mode='guide'):

    Profiler.getInstance().push("arm_build")

    guideContainer = Container('armGuide')

    armGuide = ArmComponentGuide("arm", parent=guideContainer)
    armGuide.loadData({
            "name": "L_Arm",
            "location": "L",
            "bicepXfo": Xfo(Vec3(2.27, 15.295, -0.753)),
            "forearmXfo": Xfo(Vec3(5.039, 13.56, -0.859)),
            "wristXfo": Xfo(Vec3(7.1886, 12.2819, 0.4906)),
            "bicepFKCtrlSize": 1.75,
            "forearmFKCtrlSize": 1.5
        })

    if mode == 'guide':
        builder = plugins.getBuilder()
        builder.build(guideContainer)

    elif mode == 'rig':
        synchronizer = plugins.getSynchronizer()
        synchronizer.setTarget(guideContainer)
        synchronizer.sync()

        armGuideData = armGuide.getGuideData()

        rigContainer = Container('armRig')
        arm = ArmComponent(parent=rigContainer)
        arm.loadData(armGuideData)

        builder = plugins.getBuilder()
        builder.build(rigContainer)
    else:
        LogMessage('Invalid mode set')

    Profiler.getInstance().pop()

    if __name__ == "__main__":
        print Profiler.getInstance().generateReport()
    else:
        if mode == 'guide':
            logHierarchy(armGuide)
        elif mode == 'rig':
            logHierarchy(arm)
Esempio n. 4
0
def buildArm(mode='guide'):

    Profiler.getInstance().push("arm_build")

    guideContainer = Container('armGuide')

    armGuide = ArmComponentGuide("arm", parent=guideContainer)
    armGuide.loadData({
        "name":
        "Arm",
        "location":
        "L",
        "bicepXfo":
        Xfo(Vec3(2.27, 15.295, -0.753)),
        "forearmXfo":
        Xfo(Vec3(5.039, 13.56, -0.859)),
        "wristXfo":
        Xfo(Vec3(7.1886, 12.2819, 0.4906)),
        "handXfo":
        Xfo(tr=Vec3(7.1886, 12.2819, 0.4906),
            ori=Quat(Vec3(-0.0865, -0.2301, -0.2623), 0.9331)),
        "bicepFKCtrlSize":
        1.75,
        "forearmFKCtrlSize":
        1.5
    })

    if mode == 'guide':
        builder = plugins.getBuilder()
        builder.build(guideContainer)

    elif mode == 'rig':
        synchronizer = plugins.getSynchronizer()
        synchronizer.setTarget(guideContainer)
        synchronizer.sync()

        armGuideData = armGuide.getRigBuildData()

        rigContainer = Container('armRig')
        arm = ArmComponent(parent=rigContainer)
        arm.loadData(armGuideData)

        builder = plugins.getBuilder()
        builder.build(rigContainer)
    else:
        LogMessage('Invalid mode set')

    Profiler.getInstance().pop()

    if __name__ == "__main__":
        print Profiler.getInstance().generateReport()
    else:
        if mode == 'guide':
            for each in armGuide.getItems().values():
                # Only log hierarchy for Layer objects as Layers in this test are added to
                # the component since there is no rig object.
                if each.isTypeOf('Layer'):
                    logHierarchy(each)
        elif mode == 'rig':
            for each in arm.getItems().values():
                # Only log hierarchy for Layer objects as Layers in this test are added to
                # the component since there is no rig object.
                if each.isTypeOf('Layer'):
                    logHierarchy(each)
Esempio n. 5
0
from kraken import plugins
from kraken.core.objects.locator import Locator
from kraken.helpers.utility_methods import logHierarchy


myLoc = Locator("myLocator")

builder = plugins.getBuilder()

config = builder.getConfig()
config.setExplicitNaming(True)

builder.build(myLoc)

logHierarchy(myLoc)
Esempio n. 6
0
import json
import os

from kraken import plugins
from kraken.core.objects.rig import Rig
from kraken_examples.bob_guide_data import bob_guide_data
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy


Profiler.getInstance().push("bob_build")

bobGuideRig = Rig("char_bob")
bobGuideRig.loadRigDefinition(bob_guide_data)

bobGuideRig.writeRigDefinitionFile('bob_guide.krg')

bobGuideRig2 = Rig()
bobGuideRig2.loadRigDefinitionFile('bob_guide.krg')

logHierarchy(bobGuideRig2)

os.remove('bob_guide.krg')
Esempio n. 7
0
    {
        "name": "spine",
        "location": "M",
        "cogPosition": Vec3(0.0, 11.1351, -0.1382),
        "spine01Position": Vec3(0.0, 11.1351, -0.1382),
        "spine02Position": Vec3(0.0, 11.8013, -0.1995),
        "spine03Position": Vec3(0.0, 12.4496, -0.3649),
        "spine04Position": Vec3(0.0, 13.1051, -0.4821),
        "numDeformers": 6,
    }
)

# Save the hand guide data for persistence.
saveData = spineGuide.saveData()

spineGuideData = spineGuide.getRigBuildData()

spine = SpineComponentRig()
spine.loadData(spineGuideData)

builder = plugins.getBuilder()
builder.build(spine)

Profiler.getInstance().pop()


if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(spine)
Esempio n. 8
0
Profiler.getInstance().push("head_build")

headGuide = HeadComponentGuide("head")
headGuide.loadData({
    "name": "Head",
    "location": "M",
    "headPosition": Vec3(0.0, 17.4756, -0.421),
    "headEndPosition": Vec3(0.0, 19.5, -0.421),
    "eyeLeftPosition": Vec3(0.3497, 18.0878, 0.6088),
    "eyeRightPosition": Vec3(-0.3497, 18.0878, 0.6088),
    "jawPosition": Vec3(0.0, 17.613, -0.2731)
})

# Save the hand guide data for persistence.
saveData = headGuide.saveData()

headGuideData = headGuide.getRigBuildData()

head = HeadComponentRig()
head.loadData(headGuideData)

builder = plugins.getBuilder()
builder.build(head)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(head)
        "forearmXfo": Xfo(Vec3(5.039, 13.56, -0.859)),
        "wristXfo": Xfo(Vec3(7.1886, 12.2819, 0.4906)),
        "handXfo": Xfo(tr=Vec3(7.1886, 12.2819, 0.4906),
                       ori=Quat(Vec3(-0.0865, -0.2301, -0.2623), 0.9331)),
        "bicepFKCtrlSize": 1.75,
        "forearmFKCtrlSize": 1.5
    })

# Save the arm guid data for persistence.
saveData = armGuide.saveData()

armGuide2 = ArmComponentGuide("arm2")
armGuide2.loadData(saveData)

armRigData = armGuide.getRigBuildData()

armLeft = ArmComponentRig()
armLeft.loadData(armRigData)

print "==armLeft=="
logHierarchy(armLeft)

# saver = KrakenSaver()
# jsonData1 = armLeft.jsonEncode(saver)
# jsonText1 = json.dumps(jsonData1, indent=2)

# loader = KrakenLoader()
# armLeft2 = loader.construct(jsonData1)
# print "==armLeft2=="
# logHierarchy(armLeft2)
Esempio n. 10
0
import json

from kraken import plugins
from kraken_examples.bob_guide import BobGuide
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy

Profiler.getInstance().push("bob_guide_build")

bobGuide = BobGuide("char_bob_guide")

builder = plugins.getBuilder()
builder.build(bobGuide)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(bobGuide)
Esempio n. 11
0
    Xfo(tr=Vec3(7.1886, 12.2819, 0.4906),
        ori=Quat(Vec3(-0.0865, -0.2301, -0.2623), 0.9331)),
    "bicepFKCtrlSize":
    1.75,
    "forearmFKCtrlSize":
    1.5
})

# Save the arm guid data for persistence.
saveData = armGuide.saveData()

armGuide2 = ArmComponentGuide("arm2")
armGuide2.loadData(saveData)

armRigData = armGuide.getRigBuildData()

armLeft = ArmComponentRig()
armLeft.loadData(armRigData)

print "==armLeft=="
logHierarchy(armLeft)

# saver = KrakenSaver()
# jsonData1 = armLeft.jsonEncode(saver)
# jsonText1 = json.dumps(jsonData1, indent=2)

# loader = KrakenLoader()
# armLeft2 = loader.construct(jsonData1)
# print "==armLeft2=="
# logHierarchy(armLeft2)
Esempio n. 12
0
            Vec3(6.841, 9, -1.237),
            Vec3(9.841, 8, -1.237),
            Vec3(9.841, 7, -1.237),
            Vec3(9.841, 6, -1.237),
            Vec3(9.841, 5, -1.237),
            Vec3(9.841, 4, -1.237),
            Vec3(9.841, 3, -1.237),
            Vec3(9.841, 2, -1.237),
            Vec3(9.841, 1, -1.237),
        ],
    }
)

# Save the hand guide data for persistence.
saveData = tentacleGuide.saveData()

tentacleGuideData = tentacleGuide.getRigBuildData()

tentacle = TentacleComponentRig()
tentacle.loadData(tentacleGuideData)

builder = plugins.getBuilder()
builder.build(tentacle)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(tentacle)
Esempio n. 13
0
        'bicepFKCtrlSize': 1.75,
        'forearmFKCtrlSize': 1.5
    })

# Save the arm guid data for persistence.
rightArmGuide = ArmComponentGuide('arm')
rightArmGuide.setLocation('R')

rightArmGuide.pasteData(leftArmGuide.copyData(), setLocation=False)

builder = plugins.getBuilder()
builder.build(leftArmGuide)
builder.build(rightArmGuide)


armLeft = ArmComponentRig()
armLeft.loadData(leftArmGuide.getRigBuildData())

armRight = ArmComponentRig()
armRight.loadData(rightArmGuide.getRigBuildData())

builder.build(armLeft)
builder.build(armRight)

print '==armLeft=='
logHierarchy(armLeft)

print '==armRight=='
logHierarchy(armRight)

Esempio n. 14
0
import json

from kraken import plugins
from kraken_examples.bob_guide import BobGuide
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy


Profiler.getInstance().push("bob_guide_build")

bobGuide = BobGuide("char_bob_guide")

builder = plugins.getBuilder()
builder.build(bobGuide)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(bobGuide)
Esempio n. 15
0
import json

from kraken import plugins
from kraken_examples.spineClav_rig import SpineClavRig
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy


Profiler.getInstance().push("spineClav_build")

spineClavRig = SpineClavRig("char_bob")

builder = plugins.getBuilder()
builder.build(spineClavRig)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
   logHierarchy(spineClavRig)
Esempio n. 16
0
from kraken.core.objects.transform import Transform
from kraken.core.objects.control import Control
from kraken.helpers.utility_methods import logHierarchy

# Build
builder = plugins.getBuilder()
config = builder.getConfig()
config.setExplicitNaming(True)

ctrlParent = Transform("controls")

ctrlShapes = config.getControlShapes()

i = 0
j = 0
for k, v in ctrlShapes.iteritems():
    ctrl = Control(k + '_shape', shape=k, parent=ctrlParent)

    ctrl.xfo.tr.x = i % 5 * 2
    ctrl.xfo.tr.z = j * 2

    if i % 5 == 4:
        j += 1

    i += 1


builder.build(ctrlParent)

logHierarchy(ctrlParent)
Esempio n. 17
0
Profiler.getInstance().push("head_build")

headGuide = HeadComponentGuide("head")
headGuide.loadData({
                    "name": "Head",
                    "location": "M",
                    "headPosition": Vec3(0.0, 17.4756, -0.421),
                    "headEndPosition": Vec3(0.0, 19.5, -0.421),
                    "eyeLeftPosition": Vec3(0.3497, 18.0878, 0.6088),
                    "eyeRightPosition": Vec3(-0.3497, 18.0878, 0.6088),
                    "jawPosition": Vec3(0.0, 17.613, -0.2731)
                   })

# Save the hand guide data for persistence.
saveData = headGuide.saveData()

headGuideData = headGuide.getRigBuildData()

head = HeadComponentRig()
head.loadData(headGuideData)

builder = plugins.getBuilder()
builder.build(head)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(head)
Esempio n. 18
0
import json

from kraken.core.maths import *
from kraken.core.io.kraken_saver import KrakenSaver
from kraken.core.io.kraken_loader import KrakenLoader
from kraken.helpers.utility_methods import logHierarchy

from kraken_examples.bob_rig import BobRig


bob = BobRig("Bob")
print "==bob=="
logHierarchy(bob)

saver = KrakenSaver()
jsonData1 = bob.jsonEncode(saver)

loader = KrakenLoader()
bob2 = loader.construct(jsonData1)

print "==bob2=="
logHierarchy(bob2)
Esempio n. 19
0
                        {
                         "name": "fkChain",
                         "location": "L",
                         "numJoints": 4,
                         "jointPositions": [
                                            Vec3(0.9811, 9.769, -1.237),
                                            Vec3(5.4488, 8.4418, -1.237),
                                            Vec3(4.0, 3.1516, -1.237),
                                            Vec3(6.841, 1.0, -1.237),
                                            Vec3(9.841, 0.0, -1.237)
                                           ]
                        })

# Save the hand guide data for persistence.
saveData = fkChainGuide.saveData()

fkChainGuideData = fkChainGuide.getRigBuildData()

chain = FKChainComponentRig()
chain.loadData(fkChainGuideData)

builder = plugins.getBuilder()
builder.build(chain)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(chain)
Esempio n. 20
0

Profiler.getInstance().push("clavicle_build")

clavicleGuide = ClavicleComponentGuide("clavicle")
clavicleGuide.loadData({
        "name": "Clavicle",
        "location": "L",
        "clavicleXfo": Xfo(Vec3(0.1322, 15.403, -0.5723)),
        "clavicleUpVXfo": Xfo(Vec3(0.0, 1.0, 0.0)),
        "clavicleEndXfo": Xfo(Vec3(2.27, 15.295, -0.753))
    })

# Save the clavicle guid data for persistence.
saveData = clavicleGuide.saveData()

clavicleGuideData = clavicleGuide.getRigBuildData()

clavicle = ClavicleComponentRig()
clavicle.loadData(clavicleGuideData)

builder = plugins.getBuilder()
builder.build(clavicle)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(clavicle)
Esempio n. 21
0

Profiler.getInstance().push("mainSrt_build")

mainSrtGuide = MainSrtComponentGuide("mainSrt")
mainSrtGuide.loadData({
                      "name": "mainSrt",
                      "location": "M",
                      "mainSrtXfo": Xfo(tr=Vec3(0.0, 0.0, 0.0)),
                      "mainSrtSize": 3.0
                     })

# Save the main srt guide data for persistence.
saveData = mainSrtGuide.saveData()

mainSrtGuideData = mainSrtGuide.getRigBuildData()

mainSrt = MainSrtComponentRig()
mainSrt.loadData(mainSrtGuideData)

builder = plugins.getBuilder()
builder.build(mainSrt)

Profiler.getInstance().pop()


if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(mainSrt)
Esempio n. 22
0
Profiler.getInstance().push("clavicle_build")

clavicleGuide = ClavicleComponentGuide("clavicle")
clavicleGuide.loadData(
    {
        "name": "Clavicle",
        "location": "L",
        "clavicleXfo": Xfo(Vec3(0.1322, 15.403, -0.5723)),
        "clavicleUpVXfo": Xfo(Vec3(0.0, 1.0, 0.0)),
        "clavicleEndXfo": Xfo(Vec3(2.27, 15.295, -0.753)),
    }
)

# Save the clavicle guid data for persistence.
saveData = clavicleGuide.saveData()

clavicleGuideData = clavicleGuide.getRigBuildData()

clavicle = ClavicleComponentRig()
clavicle.loadData(clavicleGuideData)

builder = plugins.getBuilder()
builder.build(clavicle)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(clavicle)
Esempio n. 23
0
from kraken import plugins
from kraken.core.objects.rig import Rig
from kraken_examples.bob_guide_data import bob_guide_data
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy

Profiler.getInstance().push("bob_build")

bobGuideRig = Rig("char_bob")
bobGuideRig.loadRigDefinition(bob_guide_data)

bobRigData = bobGuideRig.getRigBuildData()
bobRig = Rig()
bobRig.loadRigDefinition(bobRigData)

builder = plugins.getBuilder()
builder.build(bobRig)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(bobRig)
Esempio n. 24
0
    "forearmXfo":
    Xfo(Vec3(5.039, 13.56, -0.859)),
    "wristXfo":
    Xfo(Vec3(7.1886, 12.2819, 0.4906)),
    "handXfo":
    Xfo(tr=Vec3(7.1886, 12.2819, 0.4906),
        ori=Quat(Vec3(-0.0865, -0.2301, -0.2623), 0.9331)),
    "bicepFKCtrlSize":
    1.75,
    "forearmFKCtrlSize":
    1.5
})

# Save the arm guid data for persistence.
saveData = armGuide.saveData()

armGuideData = armGuide.getRigBuildData()

arm = ArmComponentRig()
arm.loadData(armGuideData)

builder = plugins.getBuilder()
builder.build(arm)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(arm)
Esempio n. 25
0
Profiler.getInstance().push("leg_build")

legGuide = LegComponentGuide("leg")
legGuide.loadData({
    "name": "Leg",
    "location": "L",
    "femurXfo": Xfo(Vec3(0.9811, 9.769, -0.4572)),
    "kneeXfo": Xfo(Vec3(1.4488, 5.4418, -0.5348)),
    "ankleXfo": Xfo(Vec3(1.85, 1.1516, -1.237)),
    "toeXfo": Xfo(Vec3(1.85, 0.4, 0.25)),
    "toeTipXfo": Xfo(Vec3(1.85, 0.4, 1.5))
})

# Save the arm guid data for persistence.
saveData = legGuide.saveData()

legGuideData = legGuide.getRigBuildData()

leg = LegComponentRig()
leg.loadData(legGuideData)

builder = plugins.getBuilder()
builder.build(leg)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(leg)
Esempio n. 26
0
# Save the arm guid data for persistence.
saveData = armGuide.saveData()

armGuide2 = ArmComponentGuide("arm2")
armGuide2.loadData(saveData)

armRigData = armGuide.getRigBuildData()

armLeft = ArmComponentRig()
armLeft.loadData(armRigData)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    for each in armLeft.getItems().values():
        # Only log hierarchy for Layer objects as Layers in this test are added to
        # the component since there is no rig object.
        if each.isTypeOf('Layer'):
            logHierarchy(each)

# saver = KrakenSaver()
# jsonData1 = armLeft.jsonEncode(saver)
# jsonText1 = json.dumps(jsonData1, indent=2)

# loader = KrakenLoader()
# armLeft2 = loader.construct(jsonData1)
# print "==armLeft2=="
# logHierarchy(armLeft2)
Esempio n. 27
0
spineGuide = SpineComponentGuide("spine")
spineGuide.loadData({
    "name": "spine",
    "location": "M",
    "cogPosition": Vec3(0.0, 11.1351, -0.1382),
    "spine01Position": Vec3(0.0, 11.1351, -0.1382),
    "spine02Position": Vec3(0.0, 11.8013, -0.1995),
    "spine03Position": Vec3(0.0, 12.4496, -0.3649),
    "spine04Position": Vec3(0.0, 13.1051, -0.4821),
    "numDeformers": 6
})

# Save the hand guide data for persistence.
saveData = spineGuide.saveData()

spineGuideData = spineGuide.getRigBuildData()

spine = SpineComponentRig()
spine.loadData(spineGuideData)

builder = plugins.getBuilder()
builder.build(spine)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(spine)
import json

from kraken import plugins
from kraken.core.objects.rig import Rig
from kraken_examples.bob_guide_data import bob_guide_data
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy


Profiler.getInstance().push("bob_build")

bobGuideRig = Rig("char_bob")
bobGuideRig.loadRigDefinition(bob_guide_data)

bobRigData = bobGuideRig.getRigBuildData()
bobRig = Rig()
bobRig.loadRigDefinition(bobRigData)

builder = plugins.getBuilder()
builder.build(bobRig)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(bobRig)
Esempio n. 29
0
armGuide = ArmComponentGuide("arm")
armGuide.loadData({
        "name": "Arm",
        "location": "L",
        "bicepXfo": Xfo(Vec3(2.27, 15.295, -0.753)),
        "forearmXfo": Xfo(Vec3(5.039, 13.56, -0.859)),
        "wristXfo": Xfo(Vec3(7.1886, 12.2819, 0.4906)),
        "handXfo": Xfo(tr=Vec3(7.1886, 12.2819, 0.4906),
                       ori=Quat(Vec3(-0.0865, -0.2301, -0.2623), 0.9331)),
        "bicepFKCtrlSize": 1.75,
        "forearmFKCtrlSize": 1.5
    })

# Save the arm guid data for persistence.
saveData = armGuide.saveData()

armGuideData = armGuide.getRigBuildData()

arm = ArmComponentRig()
arm.loadData(armGuideData)

builder = plugins.getBuilder()
builder.build(arm)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(arm)
Esempio n. 30
0
Profiler.getInstance().push("neck_build")

neckGuide = NeckComponentGuide("neck")
neckGuide.loadData({
                    "name": "Neck",
                    "location": "L",
                    "neckPosition": Vec3(0.0, 16.5572, -0.6915),
                    "neckUpVOffset": Vec3(0.0, 0.0, -1.0),
                    "neckEndPosition": Vec3(0.0, 17.4756, -0.421)
                   })


# Save the hand guide data for persistence.
saveData = neckGuide.saveData()

neckGuideData = neckGuide.getRigBuildData()

neck = NeckComponentRig()
neck.loadData(neckGuideData)

builder = plugins.getBuilder()
builder.build(neck)

Profiler.getInstance().pop()


if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(neck)
Esempio n. 31
0
Profiler.getInstance().push("leg_build")

legGuide = LegComponentGuide("leg")
legGuide.loadData({
                   "name": "Leg",
                   "location": "L",
                   "femurXfo": Xfo(Vec3(0.9811, 9.769, -0.4572)),
                   "kneeXfo": Xfo(Vec3(1.4488, 5.4418, -0.5348)),
                   "ankleXfo": Xfo(Vec3(1.85, 1.1516, -1.237)),
                   "toeXfo": Xfo(Vec3(1.85, 0.4, 0.25)),
                   "toeTipXfo": Xfo(Vec3(1.85, 0.4, 1.5))
                  })

# Save the arm guid data for persistence.
saveData = legGuide.saveData()

legGuideData = legGuide.getRigBuildData()

leg = LegComponentRig()
leg.loadData(legGuideData)

builder = plugins.getBuilder()
builder.build(leg)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(leg)
Esempio n. 32
0
headGuide = HeadComponentGuide("head")

headGuide.loadData({
    "headXfo": Xfo(Vec3(0.0, 17.5, -0.5)),
    "eyeLeftXfo": Xfo(tr=Vec3(0.375, 18.5, 0.5), ori=Quat(Vec3(-0.0, -0.707106769085, -0.0), 0.707106769085)),
    "eyeRightXfo": Xfo(tr=Vec3(-0.375, 18.5, 0.5), ori=Quat(Vec3(-0.0, -0.707106769085, -0.0), 0.707106769085)),
    "jawXfo": Xfo(Vec3(0.0, 17.875, -0.275))
})

# Save the hand guide data for persistence.
saveData = headGuide.saveData()

headGuideData = headGuide.getRigBuildData()

head = HeadComponentRig()
head.loadData(headGuideData)

builder = plugins.getBuilder()
builder.build(head)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    for each in head.getItems().values():
        # Only log hierarchy for Layer objects as Layers in this test are added to
        # the component since there is no rig object.
        if each.isTypeOf('Layer'):
            logHierarchy(each)
Esempio n. 33
0
        Vec3(4.0, 10, -1.237),
        Vec3(6.841, 9, -1.237),
        Vec3(9.841, 8, -1.237),
        Vec3(9.841, 7, -1.237),
        Vec3(9.841, 6, -1.237),
        Vec3(9.841, 5, -1.237),
        Vec3(9.841, 4, -1.237),
        Vec3(9.841, 3, -1.237),
        Vec3(9.841, 2, -1.237),
        Vec3(9.841, 1, -1.237)
    ]
})

# Save the hand guide data for persistence.
saveData = tentacleGuide.saveData()

tentacleGuideData = tentacleGuide.getRigBuildData()

tentacle = TentacleComponentRig()
tentacle.loadData(tentacleGuideData)

builder = plugins.getBuilder()
builder.build(tentacle)

Profiler.getInstance().pop()

if __name__ == "__main__":
    print Profiler.getInstance().generateReport()
else:
    logHierarchy(tentacle)