Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/ubisoft/ubisoft-laforge-ZeroEGGS
22 February 2026, 17:10:39 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • 5d0b0ed
  • /
  • ZEGGS
  • /
  • bvh2fbx
  • /
  • bvh2fbx.py
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:de7d4ff653e97efa42330130467259bc1debf7c6
origin badgedirectory badge
swh:1:dir:64af0d798b3bfe6f0116358414d6da4105b294fe
origin badgerevision badge
swh:1:rev:4992d9ab5e28bc4bb13219a598906562f5786448
origin badgesnapshot badge
swh:1:snp:f5bfff4387b2149e7126bd079071130362ece791

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 4992d9ab5e28bc4bb13219a598906562f5786448 authored by Saeed Ghorbani on 24 April 2023, 19:20:18 UTC
Merge pull request #39 from saeed1262/main
Tip revision: 4992d9a
bvh2fbx.py
import sys, os, logging
import pyfbsdk

# Customs
# MoBu env
sys.path.append("C:/Users/sghorbani/Anaconda3/envs/mobu2/Lib/site-packages/")


import numpy as np

logging.basicConfig(
    filename="compile_results.log",
    filemode="w",
    format="%(asctime)s %(levelname)-8s %(message)s",
    level=logging.DEBUG,
)

console = logging.StreamHandler()
console.setLevel(logging.DEBUG)
console.setFormatter(logging.Formatter("%(asctime)s %(levelname)-8s %(message)s"))
logging.getLogger("").addHandler(console)


def bvh2fbx(animation_file, output_file, template_file, sound_file=None):

    pyfbsdk.FBApplication().FileNew()
    logging.info("Loading %s..." % str(template_file))

    if not pyfbsdk.FBApplication().FileOpen(str(template_file)):
        raise IOError("Could not open file: {}".format(str(template_file)))

    if sound_file is not None:
        # Load Audio
        logging.info("Loading %s..." % str(sound_file))
        audio = pyfbsdk.FBAudioClip(sound_file)
        if audio is None:
            raise IOError("Could not open file: {}".format(str(sound_file)))

        # Rescale Timespan
        pyfbsdk.FBSystem().CurrentTake.LocalTimeSpan = pyfbsdk.FBTimeSpan(
            pyfbsdk.FBTime(0), audio.Duration
        )

    # Set FPS
    pyfbsdk.FBPlayerControl().SetTransportFps(pyfbsdk.FBTimeMode.kFBTimeMode60Frames)
    pyfbsdk.FBPlayerControl().SnapMode = (
        pyfbsdk.FBTransportSnapMode.kFBTransportSnapModeSnapOnFrames
    )

    # Load BVH
    if not pyfbsdk.FBApplication().FileImport(animation_file, True):
        raise IOError("Could not open file: {}".format(str(animation_file)))

    # Save FBX
    pyfbsdk.FBApplication().FileSave(output_file)


if True:
    try:

        logging.info("======")
        logging.info("BVH2FBX")
        logging.info("======")

        results_path = "./Rendered"
        template_file = "./LaForgeFemale.fbx"

        # Characterizing all bvh files
        for animation_file in [f for f in os.listdir(results_path) if f.endswith(".bvh")]:
            sound_file = animation_file.replace(".bvh", ".wav")
            sound_file = results_path + "/" + sound_file
            if not os.path.exists(sound_file):
                sound_file = None
            bvh2fbx(
                results_path + "/" + animation_file,
                results_path + "/" + animation_file.replace(".bvh", ".fbx"),
                template_file,
                sound_file
            )

        pyfbsdk.FBApplication().FileExit()

    except Exception as e:
        logging.exception("FAILED:")
        raise e

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API