Mon, Jan 27, 8:20 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2025 Jan 26 2:05 pm)



Subject: Poser/Python script for deleting zeroed morph keyframes?


tvining ( ) posted Mon, 12 October 2009 at 5:24 PM · edited Mon, 05 August 2024 at 5:46 AM

I'm looking for a script that will delete keyframes for morphs that are set at zero--and that have a full set of keyframes at zero--throughout the life of an animation. I don't want to delete the morphs themselves, just the keyframes. Does anybody know of such a script?

Thanks--Tim


markschum ( ) posted Tue, 13 October 2009 at 12:55 AM

Theres some scripts to delete the morphs but I dont know of one to kill the keyframes.

Can I ask why you want to do that, it should not be a problem, does add slightly to saved pose files and pz3 scene files.


wolf359 ( ) posted Tue, 13 October 2009 at 7:32 AM

Quote - I'm looking for a script that will delete keyframes for morphs that are set at zero--and that have a full set of keyframes at zero--throughout the life of an animation. I don't want to delete the morphs themselves, just the keyframes. Does anybody know of such a script?

Thanks--Tim

Hi Tim Why not just Marqee Select the frames in the Dope sheet
and hit the minus(Delete) button??

or am I misunderstanding your question.

Cheers



My website

YouTube Channel



tvining ( ) posted Tue, 13 October 2009 at 10:59 AM

Sorry, I should know to explain my reasons since I'm talking to a knowledgeable audience!

The problem I'm having comes from the way I am processing motion capture data via a Daz Studio plugin, baked in AniMate, exported as BVH: the baking keyframes seem to add keyframes to all the Base V4 morphs, even if they sit at zero for the entire animation. This becomes a problem mostly when I then add a Mimic pose to the figure, since it often overwrites the beginning of the animation, leaving a few of the morphs at zero at the end, so I might want an expression (like MouthFrown or EyesClosed) to persist to the end of the animation, but it will go back to zero unless I go in and clean those frames out by hand, which I'm doing now. It's not a huge problem, but it would be simpler for me if I had a script that would clear out the zero keyframes before I apply the Mimic pose so I don't have to worry about this. I know there are scripts that can recognize a morph set at zero, but they will usually delete the entire morph, not just the keyframes.

Thanks!--Tim


markschum ( ) posted Tue, 13 October 2009 at 11:14 AM · edited Tue, 13 October 2009 at 11:20 AM

file_441192.txt

k, heres a script for you to try,

it sets all keyframes  for the current figure to 0 if ALL keyframes are 0 , it leaves frame 0 unchanged

save your scene and give it a try , see if it does what you want.

It lists the actor and parameter as it runs so you can see if it working.

rename the file from .txt to .py and put it in your python folder. Run from the file menu.

ps:  its not that we think you want something odd , cause I have given up on that    :)
 but it helps to know what to suggest, like drag and delete in the keyframe editor.

There were a few scripts for helping with BVH files , try checking for ockham or philc in the freestuff>poser>utilities section.


tvining ( ) posted Tue, 13 October 2009 at 11:27 AM

Great--thanks, Markschum! I'll give this a spin tonight and let you know how it goes!

Thanks again--Tim


wolf359 ( ) posted Tue, 13 October 2009 at 4:13 PM · edited Tue, 13 October 2009 at 4:15 PM

file_441210.jpg

> Quote - > The problem I'm having comes from the way I am processing motion capture data via a Daz Studio plugin, baked in AniMate, exported as BVH: the baking keyframes seem to add keyframes to ***all the Base V4 morphs, even if they sit at zero for the entire animation. This becomes a problem***

Hi Tim I too am using Daz aniMate  to make nonlinear combinations of motions
and exporting to poser so I must ask:
Any particular reason you are exporting to the archaic BVH and not using the FREE "poser format exporter" from DAZ to export your baked aniMate motions as animated pose files (PZ2)???

BVH will always Create a keyframe for every channel for every frame wether it has animation or not

here is a screen shot of the dope sheet from a V4 animation I did this afternoon

as you can see since there was no facial  animation in my shot the PFE left all those channel void of key frames (grey)

the PFE and PZ2 is Far superior to BVH  IMHO.

Cheers



My website

YouTube Channel



markschum ( ) posted Tue, 13 October 2009 at 4:57 PM

Hehehe, this is why we ask , what are ya doing , rather than just write the script. :)  

Its a useful script anyway


tvining ( ) posted Tue, 13 October 2009 at 5:12 PM

Hey Wolf,

I may be doing something wrong, but when I export using PFE it seems to do something funny to the Hip Y translation--it seems to flatten out the curve so that it "steps" rather than flows--I don't know why this is. I don't love BVH either, but from what I've been able to work out, it seems to create a smoother curve for the Hip Y Translation. It does mess up other things, like the hands/fingers, but where the Hip is so critical, I'd rather fix the hands than mess with the Hip. Do you see this, or is it just me? I'm also going from PC to Mac in the middle of all this--not sure if that matters.

--Tim


tvining ( ) posted Tue, 13 October 2009 at 9:27 PM

Hey Markschum,

I gave the script a whirl, and unfortunately it worked a little too well ;-)  it deleted all the keyframes, including non-zero ones. Oh well, I can still do it manually if need be.

Thanks again--Tim


markschum ( ) posted Tue, 13 October 2009 at 10:11 PM

k, I will go back and test it again , sometimes takes a test or two


markschum ( ) posted Tue, 13 October 2009 at 10:51 PM

file_441218.txt

k, try this one . There were some logic errors.

This one checks if all keyframed values for the parameter are the same as frame 0, if they all the same delete them. This will kill keyframes for scale = 1 . Frame 0 is never touched.


tvining ( ) posted Wed, 14 October 2009 at 10:09 AM

Hey Markschum,

That seems to have done it--thanks!!! I think this script will actually help me with another problem I hadn't considered, and that's that having a leaner/smaller file should (theoretically) allow me to have multiple characters in the same Poser scene with less strain on the system. I was running into that problem this morning at home, so I'm looking forward to testing it out tonight.

Thanks again!!!--Tim


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.