University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Generate bvh file and skm file by code or using smartBody GUI | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Generate bvh file and skm file by code or using smartBody GUI
April 14, 2015
2:17 pm
Avatar
Member
Members
Forum Posts: 3
Member Since:
April 14, 2015
sp_UserOfflineSmall Offline

how to Generate bvh file and skm file by code or using smartBody GUI ?

and how to animate character by code?

Thanks

April 14, 2015
4:59 pm
Avatar
Admin
Forum Posts: 980
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

There are functions on the SBMotion object:

saveToSkm()

saveToBvh()

which allow you to save the contents of a motion to an .skm  or .bvh file. 

If you want to produce a motion object (that contains an animation by code) you can construct one using Python with the:

addChannel()

addFrame()

If you want to create animation on-the-fly, then you can write a controller to do so. Here's an example using Python:

 

class MyController (PythonController):
   def init(self, pawn):
      print "Setting up my controller..."
   def evaluate(self):
      # every time step, set a channel value

      self.setChannelPos("base", SrVec(1, 17,3)) # sets a translation channel

      self.setChannelQuat("l_wrist", SrQuat(1, 0, 0,0)) # sets a rotation/quaternion channel

      self.setChannelValue("open", .5) # sets a value for a channel

myc = MyController()
# get the character
character = scene.getCharacter('mycharacter')
# add the controller somewhere in the controller stack. In this case, after the 10th controller
character.addController(10, myc)

 

Is this the information you are looking for?

 

Ari

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 733

Currently Online: mondayneedle1, huberdavidsen3, casey29english, andersen19eaton, kristensen00leblanc, bager59mayo, eric506784, t9rrzpi307
113 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

jwwalker: 80

jyambao: 51

rbaral: 47

adiaz: 30

WargnierP: 29

lucky7456969: 28

mbarros: 28

avida.matt: 26

JonathanW: 24

laguerre: 23

Member Stats:

Guest Posters: 65

Members: 52460

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 427

Posts: 2343