Macha Posted November 19, 2010 Share Posted November 19, 2010 In the attached file, how do I extract the transform values (position and rotation) of the box object? I have problems exporting data to another app, especially when objects are parented and have expressions. I think the Extract Transform node could do it (not in this file, but there is an example file in the docs), but where, oh where does it store the position and rotation data? It obviously calculates them!! Quote Link to comment Share on other sites More sharing options...
Macha Posted November 19, 2010 Author Share Posted November 19, 2010 Sorry forgot the file. Here it is. gettransforms.hip Quote Link to comment Share on other sites More sharing options...
Dennis Posted November 19, 2010 Share Posted November 19, 2010 You could just use the origin function to extract the position and rotation values. I'm using this function all the time when I'm rigging something. I've attached a slightly modified version of your file. Hope this helps. Dennis gettransforms.hip Quote Link to comment Share on other sites More sharing options...
Macha Posted November 19, 2010 Author Share Posted November 19, 2010 I see, thanks Dennis. Could I keyframe this curve; bake it out? I guess a Python script could perhaps do it but I am hoping a simpler solution exists. But thanks, at least I know the data is accessible now! Quote Link to comment Share on other sites More sharing options...
symek Posted November 19, 2010 Share Posted November 19, 2010 (edited) Additionally: chops: http://www.sidefx.co...des/chop/object (easy to save as *.chan) hom: http://www.sidefx.co...#worldTransform (world space 4x4 matrix) Edited November 19, 2010 by SYmek Quote Link to comment Share on other sites More sharing options...
Dennis Posted November 19, 2010 Share Posted November 19, 2010 There's a solution that needs some manual labor and copy and pasting. Go to chops and create a channel node. Channel reference the channels with the origin expressions and you get your sampled animation curves. If you rightclick this node and choose "edit data channels" you should get some keyframes which you can copy and paste into any other channel you would like. It's not really a procedural solution, but it works. Quote Link to comment Share on other sites More sharing options...
Macha Posted November 20, 2010 Author Share Posted November 20, 2010 Thanks Dennis and Symek! In this case the object chop set with the compute parameter set to Position and Rotation works best (it avoids the expression writing). But two more questions: How do I reduce the spacing of keys (it seems to do a key every 5 frames or so, how do I change it?). How do I save out *.chan files? (only right-click and save channel? Doesn't work, perhaps an Apprentice issue. Is there a node that does it?) gettransforms_mytry.hipnc Quote Link to comment Share on other sites More sharing options...
Macha Posted November 22, 2010 Author Share Posted November 22, 2010 (edited) OK, I kind of worked it out. For future reference, here is how to bake position and rotation on an object, with a keyframe every frame: -Create an object CHOP and set to compute position. -Create an object CHOP and set to compute rotation. -Target those CHOP nodes to the object node that you want to grab the data from. -right-click those nodes and save channel as *.chan -On another object, scope the appropriate channels, open channel editor, select channels and import the *.chan files. Two things to watch out for are that a) this does not work with Apprentice version. b ) The object CHOP set to compute "Position and Rotation" gives the wrong result (it is scaled. bug?). It has to be done separately. Edited November 22, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.