Krion Posted March 13, 2019 Share Posted March 13, 2019 Hi! I wonder if u could help me with something. I want my two Transforms called 'rotate' and 'rotate1' to have as the pivot for rotation the center of the two together. The center of the node called 'Transform_all', for that matter. I tried putting $CE* in the Transform_all node, and paste relative references to the other 'rotate' nodes, but that makes everything disappear. Any ideas? MovePivotToCenterOtherNode.hip Quote Link to comment Share on other sites More sharing options...
MitchFields Posted March 13, 2019 Share Posted March 13, 2019 One idea that comes to mind is merging and then packing those two boxes you have, and adding a single point to it while deleting the geometry. This will give you the center of whatever geometry you have. Then, do whichever of various way you want to blend positions and rotations between the two. Quote Link to comment Share on other sites More sharing options...
bunker Posted March 13, 2019 Share Posted March 13, 2019 try the "centroid" expression instead: centroid("../mynode",D_X),centroid("../mynode",D_Y),centroid("../mynode",D_Z) 1 Quote Link to comment Share on other sites More sharing options...
Krion Posted March 14, 2019 Author Share Posted March 14, 2019 (edited) On 3/13/2019 at 7:30 AM, bunker said: try the "centroid" expression instead: centroid("../mynode",D_X),centroid("../mynode",D_Y),centroid("../mynode",D_Z) Thanks. The centroid function works on sphere1.. But not on my Transform_All? Do you know what is going on? MovePivotToCenterOtherNode2-2.hipnc Edited March 14, 2019 by DévinOdforce Quote Link to comment Share on other sites More sharing options...
markinglevfx Posted March 14, 2019 Share Posted March 14, 2019 (edited) Looks like a dependency loop. In the 'rotate' xform node you're referencing the centroid of 'transformall' - which is downstream. edit: Looking at your original file, $CEX $CEY $CEZ in the pivot translate of 'transformall' seems to work fine for giving you a pivot between the two boxes. They only seem to evaluate to 0 using the old dollar sign variable syntax. Use the following expressions in the pivot translate of 'transformall' to get the equivalent in hscript which evaluates correctly. Then use the 'transformall' rotation controls to rotate the two boxes together. centroid(opinputpath(".", 0), D_X) centroid(opinputpath(".", 0), D_Y) centroid(opinputpath(".", 0), D_Z) Edited March 14, 2019 by markingleukc Quote Link to comment Share on other sites More sharing options...
Krion Posted March 14, 2019 Author Share Posted March 14, 2019 (edited) 2 hours ago, markingleukc said: Looking at your original file, $CEX $CEY $CEZ in the pivot translate of 'transformall' seems to work fine for giving you a pivot between the two boxes. They only seem to evaluate to 0 using the old dollar sign variable syntax. Use the following expressions in the pivot translate of 'transformall' to get the equivalent in hscript which evaluates correctly. Then use the 'transformall' rotation controls to rotate the two boxes together. So you can't use something that is downstream with centroid()? I don't want to rotate them together in the transformall. I want to rotate them independently with the center of transformall as pivot. Edited March 14, 2019 by DévinOdforce Quote Link to comment Share on other sites More sharing options...
markinglevfx Posted March 14, 2019 Share Posted March 14, 2019 Ah okay, then I would use expressions such as below to calculate that point without having to do a merge. Add these to the pivot translate of the 'rotate' xform node. And vice versa for 'rotate1', just edit the path of the second centroid function. (centroid(opinputpath(".", 0), D_X) + centroid("../rotate1/", D_X)) / 2 (centroid(opinputpath(".", 0), D_Y) + centroid("../rotate1/", D_Y)) / 2 (centroid(opinputpath(".", 0), D_Z) + centroid("../rotate1/", D_Z)) / 2 1 1 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.