create poses using script

This forum is aimed at user contributions, in the form of assets, side projects, code patches and similar.

Moderator: joepal

Re: create poses using script

Postby ShatteredEssence » Tue Jun 13, 2017 12:45 pm

Maybe you can clarefy for me how do i script-set T pose? The one stored in assets.
ShatteredEssence
 
Posts: 13
Joined: Mon Jun 12, 2017 12:14 pm

Re: create poses using script

Postby ShatteredEssence » Tue Jun 13, 2017 3:55 pm

Hi again ) Well, there is a way to rotate bones on local axis! Thats a good news. The bad ews are: I am setting a human to Tpose using *.bvh provided with software.
But. When I try To augment bones, t pose gets resetted. And every new translation adds ontop of existing, so adding 45 twice gives 90, but the point was resetting to Tpose. Can any one tell me how do i achive this?

Code: Select all
#Set to Tpose
def setTpose():
    import animation
    import bvh
    human = G.app.selectedHuman

    filepath = 'C:/MakeHuman/Source/MakeHuman/makehuman/data/poses/tpose.bvh'
    bvh_file = bvh.load(filepath, convertFromZUp="auto")
    anim = bvh_file.createAnimationTrack(human.getBaseSkeleton())

    human.addAnimation(anim)
    human.setActiveAnimation(anim.name)
    human.refreshPose()
    return

#Rotate bones
def rotateBone():
    import animation
    import random
    from core import G
    human = G.app.selectedHuman
    skeleton = human.getSkeleton()

    my_bone_name = 'neck01'
    my_bone =skeleton.getBone(my_bone_name)
    my_bone.rotate(45, 0, False)

    anim = animation.Pose("Test", skeleton.getPose())
    human.addAnimation(anim)
    human.setActiveAnimation(anim.name)
    human.setToFrame(0)
    return

ShatteredEssence
 
Posts: 13
Joined: Mon Jun 12, 2017 12:14 pm

Previous

Return to User contributions

Who is online

Users browsing this forum: No registered users and 1 guest