Jump to content

Archived

This topic is now archived and is closed to further replies.

mala

Script To Remove Keys? & Auto Place Nulls In Joint Skeleton

Recommended Posts

  • Topic Author
  • Hi Nebu,

    I'd be very grateful for any help you can give me on this....i was aware that things had changed between R10 and R11,But knowing nothing about COFFEE i was hoping that someone might have spotted an example somewhere of how to access the animation tracks..

    You say the rest could be done though..could you post a small very basic example showing how to delete a specified object(s) from the OM using a script?

    For example take a Nullobject called "parent" that has 2 child nulls called "child1" and child2" and the script will delete both child nulls.....hopefully i could then apply this to removing the objects i actually want to delete from the BVH skeletons i'm working with.

    As i've said this is all about trying to make some BVH files easier for me to work with,whilst it can be done manually,and removing the objects can be done pretty quick in the OM,deleting Animation tracks takes a little more time........not bad but prone to RSI and mistakes after about the 10th file rolleyes.gif

    Once i've removed these objects+Tracks,i'm converting the BVH to a motion clip and then saving it as motion source,If these 'extra' animation tracks are removed, Cinema then bakes the Motion Clip to a Motion Source much faster(beacuse its dealing with less keys i guess)

    My ultimate dream plugin/script....which for all those Pro plugin/scripters reading this,I would be happy to pay for..and i guess so would others....

    This Dream plugin/script would delete Objects (specified by the user)and Animation Tracks on the remaining objects(again specified by the user).....

    Then the plugin/script would add a motion clip(giving user access to the usual MotionClip options) AND with the option to re-time the motion clip(so you could deal with 'problem' BVH files that were not 30fps)

    Then the plugin/script would convert the MotionClip to a MotionSource and save it out with same name as the BVH file or a user specified name.

    A 'Batch Process' would be very handy as well..

    That is of course is all a dream and i've not got the slightest idea if its even possible..But would make it much faster and easier to use MoCap files in cinema using the method i've found.

    I'm not asking for much then laugh.gif

    Cheers,

    mala

    ps having just had a bacon sarnie...i've decided this dream plugin should be called .. MoSauce!

    Share this post


    Link to post
  • Topic Author
  • OMG! you are a GOD!.....First i must say sorry,been out down the pub with a mate all afternoon so only just seen this

    The script from what i can tell works perfectly!....i'm stunned...you made that in the time it took me to get drunk laugh.gif

    So now you've got my attention wink.gif ,do you think its possible to add the other parts? converting to motion source that is....i know i'm asking a bit much at this stage....but must say i'm very impressed with what you 've done in a few hours....don't worry about it too much... you have already cut down the time it takes me to prep these files...i am stunned woohoo.gif

    I don't think Data is gonna have problem with this at all....my reason for all this is to make working with Free or other MoCap accessible to all...or at least easier

    Many many Thanks and big respect to you Nebu

    cheers

    mala

    Share this post


    Link to post
  • Topic Author
  • laugh.gif + thisrocks.gif Do you have a 128 Core quad for a brain?!!

    I just can't believe this stuff and so quick!

    Ok...the lastversion Deleted objects,deleted Keys and placed nulls(kind of)...but failed on moving the Root Bone of BVH Skeleton to the same position as The Root Joint(Pelvis) of my IKRig...not sure why,maybe the naming or maybe because its buried deep in another hierarchy?

    A few things with theTarget Nulls,

    1-The Target Nulls are created from copies of the IK Controllers...so they have a predetermined PSR that can not be changed,these are then placed into the a tpose skeleton..in other words i've already made these nulls,what i was trying to do was move them in to the BVH skeleton automatically....make any sense? sorry bit drunk wink.gif ....it looks to me like the script is making these nulls at the PSR of the BVH Bone of which they are a child,this is incorrect.....having said that if the script could generate these nulls from the existing IKRig controllers and place them in the BVH skeleton that would be great.

    2- which i haven't quite determined yet if is a problem or not,is the nulls need to not break the chain of the bones...but i think it is..EG. the Body+Hip Controllers would be children of the Hips BVH bone but below the LHipJoint,RHipJoint and Lowerback bones in the hierarchy..and the same for all the other Target nulls placed in the Skeleton...they don't brealk the existing Hierarchy but are children of the relevant joints...included pic of OM to explain

    have also attached a scene file with these null controllers

    will sober up a bit and work out the motion clip process into something that makes sense :)

    Cheers mala

    Share this post


    Link to post
  • Topic Author
  • OK heres a quick run down on the motion bits.

    After running the above script to remove all the unwanted parts,i do the following:

    Select Parent null(skeleton)

    add motion clip(Animation->Add Motion Clip)

    in dialogue that opens click ok

    In the Timeline select the newly created motion clip

    (ONLY for the cgspeed.com BVH that need retiming from 120fps to 30fps)

    ->> in Attributes of the motion clip,you'll see the start and end frame times of the clip,divide the end time by 4 and re-enter the result into the end time window)

    for all other 30fps BVH ...

    Convert MotionClip to MotionSource(In Timeline..Motion System->Convert MotionClip to MotionSource)

    Now on the far left of the timeline window you'll now have a new Motion Source(probably called"Skeleton) select this and right click,choose save motion source as, input the name and file path you want and hit OK.

    thats about it,you'll have to try this on a demo of R11...and seems that the console doesn't display anything whilst i'm doing this so no CallCommands

    Having had a little bit of time to think about the placing of Target nulls...

    The way i've got this whole thing working atm,is to clean up the BVH

    Then make a copy of it,The copy has ALL keys deleted,this copy is arranged to fit approx. my IKRig skeleton,and the target nulls are placed into its Hierarchy this is my "TPose" and will become the target the Motion Source is applied to.

    The Original"cleaned" BVH is converted to a motion source and saved

    So multiple motion sources can be loaded and mixed in the timeline and "applied" to the TPose rig which in turn animates my IKRig

    Sorry,this is all so confusing and not very well thought out yet,i will try to make this a lot clearer and PM you some files with an IKRig later when i've had someting to eat and sobered up roflmao.gif

    Thank you so much for your amazing work on this so far though!

    Cheers

    mala

    Share this post


    Link to post
    Guest

    Just dipping in here - and thinking out loud as usual .. smile.gif

    Maybe it might be better to just have the target nulls in a dummy version of the rig that's in the T pose to match your IK rig, then when you transfer the animation from the mocap file to this T Pose version the IK rig follows along with that.. it could be easier for reusability as apart from adding the nulls you'd still have to go and tie your IK rig to those each time whereas if the IK rig is permanently tied to a dummy rig with no animation you could reuse it more easily.

    You've got me curious about this now (curse you! wink.gif ) so now I'm trying to get something working using Harvester. I'll post some results if I can figure it out.

    Cheers,

    Brian

    Share this post


    Link to post
  • Topic Author
  • @Brian...Thats what i've been stuck between atm....I think that you are correct,to have a the Dummy rig pre-set and tied to the IKRig is the best way and simply apply the saved motions to this rig....

    The problem i've been having which comes from using these files at cgspeed,is that the starting PSR in the TPose is quite messed up for some of these skeletons...So they are not all the same from one batch to the next(if you download the files you'll see the folders are mostly captures of one person or session per folder)

    My hope was that by deleting any position keys except those on the root joint(the only one needed anyway) that any smallish difference in position of the child joints wouldn't matter...because the MotionSource would only be applying the rotations to the child bones....that was fine until i discovered the files with messed up rotations....what i found was that if i made a new tpose dummy rig from the messed up bvh...this would work fine with that folders files...but then how do you mix that with other files?....thats where it all started to go wrong laugh.gif

    @Nebu....hoping you're following this wink.gif

    Hope i haven't wasted any of your time...

    Lets,forget the placing of the nulls and moving the skeleton about.

    So here are the steps again:

    Step1:Delete objects and Keys as per the list----Already done perfectly in your script signthankspin.gif

    Step2:Convert to MotionClip(with re-time option) then save as MotionSource.

    We can then take these MotionSource and apply them to our Pre-made Dummy rig to which the IKRig is tied

    ps i've noticed you have mocca is it mocca3?....The IKRig i'm working with atm is built with CDTools so may take me a while to rebuild it so i can send you a moccaIKrig you can use to test all this with,hopefully early next week

    Cheers,

    mala

    Share this post


    Link to post
    Guest

    Here's a very rough test of using Harvester to transfer animation from one mocap file to a dummy version (well it's funny to look at at least) . The IK controllers were set up very quickly ( I just used one global one for the feet for example) and the offsets definitely need fixing but it seems like it might work..

    I think I see what you mean though about the files, they don't seem very consistent. I installed the learning edition of Endorphin a while back and that came with some mocap files, I might look at those and see if they are cleaner. I notice a lot of juddering with the free mocap files, not sure if that's in them or it's errors introduced when I scaled them in the timeline (just deleted every 2nd frame using the Delete Nth key command and then squashed the whole range, not very precise but not sure if there's an easier way on 10.5.

    BTW If Nebu downloads the CD Plugins he should be able to use your rig in runtime mode, that could save you building a mocca version. Since he's only really working with the IK controllers anyway he should be able to use the rig pretty much unrestricted.

    Cheers,

    Brian

    Share this post


    Link to post
  • Topic Author
  • Hey Nebu...just cranked up my macpro(was on laptop for a while with no Cinema) and tested the latest version

    Guessing you've not read my post above but i think like Brian said,placing the nulls in not necessary...

    You are correct the scaling/positions of the nulls in the file i posted throws it all out when positioning the nulls...and yes the different BVH files all seem to have different sizes.

    You've already got it to add the motion clip though... woohoo.gif this is so cool!

    Great work on this Nebu!

    I'll get up early tomorrow and put a rig together for you to test this with and point you to some files we can use to test

    Cheers again,

    mala

    Share this post


    Link to post
  • Topic Author
  • Thats cool!...nice one Brian and good point about the runtime feature with CDTools forgot about that.....will have to get back to it in the morning,supposed to be on a computer ban today!

    laters,

    mala

    Share this post


    Link to post
  • Topic Author
  • Hi Nebu,i'm just trying to put together a test rig for you...cinema is baking a motionclip to motionsource atm...so can't test the latest version just yet....i'm also having some scale problems with my dummy rig...hopefully have this sorted soon

    cheers,

    mala

    Share this post


    Link to post
    Guest
    This topic is now closed to further replies.

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×
    ×
    • Create New...