tebop opened this issue on Oct 30, 2007 · 56 posts
diolma posted Sun, 11 November 2007 at 4:34 PM
Hi electricart
The easiest way to get python scripts to post is to save them as .txt, then attach that. Load your file into notepad, save out again as "YourScriptName.txt" (or "YourScriptName.py.txt").
Yup, it should have been "waistXR.value()". I don't actually need that script 'cos I don't have the G2 characters, but it might be of use to someone else..
Python is a fairly simple language. Try:
http://docs.python.org/tut
to get an idea of the syntax. If you've used VB, you should have no problems with it.
The main difference between python and virtually any other (modern) language I've come across is its line-based syntax and tab-based indentation. But you soon get used to it.
I'm currently toying with the idea of creating a script which will (with some user interaction) correct a lot more of the "errors" that occur in BVH scripts.
My basic idea is to get the user to identify the "Max" and "Min" frames for various (raw) values and give corrected values for them. The script could then interpolate between those for the whole animation. Also options to spread a single value between two or more body parts (like we've been doing) and to correct the overall Y value.
I also want to let the script save those values out so they can be re-loaded for another BVH file from the same source.
More ambitiously, I'd also like to be able to correct for different limb/body-part lengths, so as to minimise the tendency for some of them to either float into the air or bury the feet below ground.
Also to stop limbs burying themselves into the body. But all that will have to wait - mustn't try to hop, skip and jump before I can walk:-)
Cheers,
Diolma