Atom Posted September 15, 2018 Share Posted September 15, 2018 (edited) I have this FBX import of a tree rig with FK bone setup. Is there some way to make the tree sway in the wind automatically? Or convert this to some kind of spring based rig? Is there a way to convert bones to curves so I could use this in a wire solver perhaps? Edited September 15, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
fencer Posted September 15, 2018 Share Posted September 15, 2018 (edited) Usually this is wire sim but all depends what accuracy you need. You can try fast solution with "ok plusplus" grain trick, I really like it (00:17). Edited September 15, 2018 by fencer Quote Link to comment Share on other sites More sharing options...
Atom Posted September 16, 2018 Author Share Posted September 16, 2018 (edited) I was able to output the tree as curves only. But I only have the points for the curves, not individual primitives yet. If I could construct primitives from the points I might be able to perform some wire operations upon the tree. I have some detection code, based upon neighbor count, but it is not really working right. Does anyone have an idea on how to detect the individual branches from a point cloud? Basically I am trying to create an i@id for each branch so I can use the Add node to make each line. Edited September 16, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
Atom Posted September 16, 2018 Author Share Posted September 16, 2018 By measuring the distance between the current and the next point I have been able to reliably detect most branch end points. Now to figure out starting points... // Get the number of points. int npt = npoints(0); // Loop through the points minus 1. for(int i = 0; i < npt-1; i++) { // Get the distance to the next point. vector p1 = point(0,"P",i); vector p2 = point(0,"P",i+1); float dist = length(p2-p1); if (dist>ch("threshold")) { // This may be an end point. setpointattrib(0, "Cd", i, {1,0,0}, "set"); } else { // In between point. setpointattrib(0, "Cd", i, {1,1,0}, "set"); } // Set the distance to next point. setpointattrib(0, "dist", i, dist, "set"); } Quote Link to comment Share on other sites More sharing options...
Atom Posted September 16, 2018 Author Share Posted September 16, 2018 (edited) Made it past one more step. I have a individual lines for my branches. How would I leverage these lines in a wire solver to simulate wind or gravity effects? ap_detect_tree_branches.hiplc Edited September 16, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
Atom Posted September 16, 2018 Author Share Posted September 16, 2018 Converting to PopGrains I get some force influence, but the wind and noise tear things apart. Quote Link to comment Share on other sites More sharing options...
fencer Posted September 16, 2018 Share Posted September 16, 2018 Wire + wire glue constraint Quote Link to comment Share on other sites More sharing options...
Atom Posted September 16, 2018 Author Share Posted September 16, 2018 Thanks, I am playing around with that. I am trying a point deform on the final mesh using the wire simulation as the animated source. Not exactly natural but it does add some movement. ap_detect_tree_branches.hiplc Quote Link to comment Share on other sites More sharing options...
Atom Posted September 16, 2018 Author Share Posted September 16, 2018 (edited) Coming full circle, now that I have curves, I can use the Bones from Curves shelf tool to create a bone chain along the curve. But the tool only works on the first primitive. Is there a way to make the tool run multiple times for each primitive? Could I python exec() the tool, in a loop, and fake out kwargs? Edited September 16, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
tamagochy Posted September 17, 2018 Share Posted September 17, 2018 (edited) Wire sim with trees works not good for me. Its create mess in places where a lot of branches collide. And its happen in 16, in 15 was everything ok. Edited September 17, 2018 by tamagochy 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.