tvining opened this issue on Sep 25, 2012 · 14 posts
tvining posted Tue, 25 September 2012 at 6:49 AM
I am using BVH data imported from Optitrack Arena software into Poser that works well, except for the Hand Twist and the Forearm Side to Side. What I basically need (I think) is for the values from the Hand Twist to be added to the values of the Forearm Twist (and then the Hand Twist set to zero), and the values of the Forearm Side-to-Side to be added to the Shoulder Twist (and then Forearm Side-to-Side set to zero).
So, for example, if the Hand Twist was -10 and the Forearm Twist was +15, the script should return a value of +5, etc.
Poser theoritically can do this using the animation layers and copy and pasting animation frames around, but it's a major hassle and the results are erratic.
Does anybody know of a script that can do this? Barring that, how I could go about hiring somebody to make it?
Thanks!
markschum posted Tue, 25 September 2012 at 10:14 AM
It doesnt sound too hard. I may give it an attempt.
You might try Philc site , he had a BVmixer I think, Ockham may have something too.
tvining posted Tue, 25 September 2012 at 10:31 AM
Okay, thanks! It occurred to me that the fix could be made to the raw bvh file if that's simpler than scripting for Poser.
I do already use some very useful scripts by Ockham and Phil C, but this transfer of data from one body part to a different body part in just this way seems not to be out there (unless I misunderstand how some of these can work). Ockham's "Copier" is similar to what I need, in that you can copy a range of frames to another body part, but it seems to work better on like parts (like, Left Hand to Right Hand) and not to different body parts, plus I don't think it blends the frames.
Thanks for considering looking into this!
--Tim
markschum posted Tue, 25 September 2012 at 11:56 AM
It does not duplicate the pose after adding the values so you might have some changes to make to the script.
I have made it as clear to follow as I can. It uses the current figure , gets the values for each bodypart (hand, forearm, shoulder) then adds the values , then sets the bodypart values , then mooves to the next frame.
I have assumed all frames are keyframes.
markschum posted Tue, 25 September 2012 at 11:59 AM
I use short variable names because of the language I first learned, 8 character variable ;-(
rft is right forearm twist
rfs is right forearm side
etc
I used V4 so check th Body part names.
EnglishBob posted Tue, 25 September 2012 at 11:59 AM Online Now!
I've done a few scripts along these lines, to correct awkward posing in animations etc., so may be able to help. I'm not hugely fluent in Python, but I do have a starting point if nothing else. Let me know if I can help.
Edit: I refreshed the thread before posting, and Mark still got in ahead of me! :P I'll hang around anyway to see how this turns out.
tvining posted Tue, 25 September 2012 at 12:00 PM
Okay, thanks! I'll give it a spin. Yes, all keyframes.
Thanks again!--Tim
markschum posted Tue, 25 September 2012 at 2:21 PM
I dont think adding the rotations like that is going to give the same arm position as the original.
Bob, if you could look at the script and yours and see if I have approached it correctly ?
tvining posted Tue, 25 September 2012 at 3:37 PM
It looks like the pose might look quite the same as the original in all cases after processing--I imagine that's probably a Poser thing--but even working like this is huge! Attached is the first frame of the animation with the wonky forearm and hand (left), and the pose after running your script (right), which looks a little different, but the end frame of this animation which is less extreme shows both arm/hand positions looking nearly identical.
Again, thanks so much! I'll let you know how the full test goes tonight.
--Tim
PS: thanks for the offer of help, too, Bob!
EnglishBob posted Tue, 25 September 2012 at 5:47 PM Online Now!
Quote - Bob, if you could look at the script and yours and see if I have approached it correctly ?
Will do - but I've so far failed to find a day with 30 hours in it, so there may be a delay... ;)
tvining posted Wed, 26 September 2012 at 10:05 AM
Hey Markschum, last night I tried out the script on a BVH animation I had previously tried fixing by hand (I went back to the original raw file) and it worked great!!! The only glitch was that the Left Shoulder rotated "backwards" to what it should have been, but--tho I don't know anything about code--I fortunately know Poser well enough that I know that the numbers often run opposite on the left vs. right limbs, and with the help of your clear and annotated script, I thought "what the heck" and tried changing the "+" to a "–" on the Left Shoulder rotation, and that took care of it!
Again, thanks SO MUCH for this--it's going to be enormously useful to me! How can I repay your kindness??
--Tim
EnglishBob posted Wed, 26 September 2012 at 10:39 AM Online Now!
Congratulations Tim, you are now a qualified Python hacker. ;-)
Mark, our approaches seem to be comparable within the variations of individual style. I used Actor.Parameter(...).Value() to read the values instead of ParameterByCode(...), but what the heck, they both work. Hopefully someone will point out the pros and cons of one versus the other.
markschum posted Wed, 26 September 2012 at 3:02 PM
I wasn't sue which to use either, the script is longer than it needs to be but I thought more readable for a new coder to hack. I was a bit worried about using the visible parameter and bodypart names because I wasnt sure what figure was being used.
The original poster seems to be happy so put another + on the board ;-)
@tvining , its really not a complicated script, so dont worry about it. If you are in a position to give someone a bit of help and do so that works for me.
tvining posted Wed, 26 September 2012 at 4:22 PM
Thanks--will do!--Tim