Last active
August 20, 2021 22:43
-
-
Save jamesrobinsonvfx/25d18103a64cfc7873111ac3ea8fe799 to your computer and use it in GitHub Desktop.
Convert RBDs (Fetch Packed Geometry from DOP network style) to instancepoints. Pretty sure this is lifted from one of Henry Foster (Toadstorm)'s odforce/sidefx forum replies.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get packed xform and pivot | |
matrix xform = getpackedtransform(0, i@ptnum); | |
vector pivot = primintrinsic(0, "pivot", i@ptnum); | |
// Orient for instancing | |
p@orient = quaternion(matrix3(xform)); | |
// Crack pscale | |
vector scale = cracktransform(0, 0, 2, 0, xform); | |
f@pscale = avg(scale); | |
// Offset P by pivot difference | |
vector new_pivot = {0, 0, 0}; | |
vector offset = new_pivot - pivot; | |
v@P = offset * xform; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment