Atom Posted February 5, 2017 Share Posted February 5, 2017 (edited) Hi All, I have an animated palm tree that loops every 360 frames. Currently I am deploying many copies of this using the Copy/Stamp approach with a random frame number being stamped into the Frame field of a Time Shift node. This works, but is slow. I would like to leverage instancing so I can increase my count and performance but I can't figure out how to implement the time offset using instancing. As far as I can tell you can only specify a single object for instancing. One solution would be to create 360 objects, each with a File node inside, pointing to the various frames of my animated palm tree. This seems a bit ridiculous to me and I wonder is there some other way to cause instancing to reference alternate frames in a geo sequence? Here is my VEX code for instancing so far which does deploy 5 different static trees. i@instId = int(rand(@ptnum)*5)+1; // Instance index required for Houdini instancing. s@instance = sprintf("/obj/geo_palm-%d", i@instId); // Used by Houdini and Redshift. // randomize scale v@scale = fit01(rand(@ptnum+801),1.8,2.8); // Randomize rotation. vector axis = {0,1,0}; // Axis to rotate. float rand = 0; vector4 quat = {0,0,0,1}; vector4 product = {0,0,0,1}; rand = fit01(rand(@ptnum+311),0,360); quat = quaternion(radians(rand), axis); product = qmultiply({0,0,0,1}, quat); @orient=product; Edited February 6, 2017 by Atom Quote Link to comment Share on other sites More sharing options...
anim Posted February 5, 2017 Share Posted February 5, 2017 Quote Link to comment Share on other sites More sharing options...
Atom Posted February 6, 2017 Author Share Posted February 6, 2017 I think I can use one of those techniques in your posted example file. Thanks Tom! 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.