Jump to content
bentway23

Transfer UVs in world space to remeshed object?

Recommended Posts

This is a bit fx, a bit modeling, a bit rendering, so I'm throwing it here--

I am running sims on a tree model. The original tree was too hi-res to simulate, so I had to run Clean and Remesh to reduce its poly count a little bit. It still proved too oddly-modeled to run a point deform on the original based on the sim, but the sim'd model is still high-poly enough so we're going to use it as the final.

What I need to do is transfer the UVs, in world space, from the original model to the down-res'd sim'd model. I tried using Maya's Transfer Attributes, which does exactly what I need, but choked on the source model's size. How can I do this in Houdini? (I know there will be some changes, but those should be mostly in the little tiny branches that are okay to lose, and this is not a hero tree.)

I assume it will be something like storing the original models' point positions and then somehow applying those points to the end result of the sim'd/cached model, at which point I could do a straight attribute transfer (and although I get this theory I don't know the steps required), or is there a better way (and if not, how would I do my suggested way)?

 

Thanks so much!

Share this post


Link to post
Share on other sites

Attribute transfer is what you need. But if you have UV seems those won't play nicely. You will need a vertex split node to break out the UV patches on your original model and then loop through each patch transferring attributes that way. That should keep your UV seams from breaking. Check this post for more info: https://www.sidefx.com/forum/topic/18890/

Share this post


Link to post
Share on other sites

I'm not quite following how to apply the vertexsplit. I have the setup on the attached screenshot, which obviously is wrong since it's not working, with the vertexsplit applied in the pipe right before the remeshing, and then using that as the source for the transferattributes. I did confirm with the uvquickshade that up through/including the vertexsplit the UVs are intact and lovely.

Screen Shot 2018-12-04 at 2.40.03 PM.png

Share this post


Link to post
Share on other sites

Okay, I found that "uv" has to be specified, so it's a LOT closer, although a bit (as the thread you referenced said) wobbly. However, right now I'm not using the attribute transfer at all--is there a way to incorporate that to do the final bit of smoothing/restoration/

 

 

splits.png

Screen Shot 2018-12-04 at 3.26.24 PM.png

Share this post


Link to post
Share on other sites

try setting vP = v@uv, and then group your points by unshared edges. use a uvsmooth and input your group as constrained points, maintaining your edges in place. after smoothing, set your Position back to original position.

Share this post


Link to post
Share on other sites

As far as I know, during a remesh or poly reduce small distortion is expect as point positions have changed. This will mostly be evident at UV seams as those have to shift to account for the new mesh. I'm no expert at UVs though so maybe someone else will have a better idea.

Share this post


Link to post
Share on other sites

what about using your low poly mesh as lattice and deform the original high res model?

i would assume you want to render the high poly model, not the downres one.

 

Share this post


Link to post
Share on other sites

So, Jesper--if I understand you correctly it's something like the screenshot (pointwrangle vP=v@uv;), then the grouping and smoothing, all after the Remesh? I'm afraid the "set your Position back to original position" has me lost, though.

 

Using the vertexsplit did so much good work. These aren't hero trees, so the small distortion will probably be usable.

 

And, martinkindl, ideally, yes: the problem is that the hi-res was too high-poly to sim, and the point deform from the reduced model to the high-poly one wasn't working--there were too many errant polygons flying off into space. I think this is because it's a library tree model, so there are lots of spindly branches that are four triangles for a large amount of space--I'm not having this same problem with our made-for-this-shot models. The downres'd one, though, still has enough detail to use as the finished model, so we're rolling with that.

 

Thanks!

 

 

Screen Shot 2018-12-06 at 4.23.42 PM.png

Share this post


Link to post
Share on other sites
2 hours ago, bentway23 said:

So, Jesper--if I understand you correctly it's something like the screenshot (pointwrangle vP=v@uv;), then the grouping and smoothing, all after the Remesh? I'm afraid the "set your Position back to original position" has me lost, though.

yeah thats the idea.

So in the wrangle you would do:

v@initialP = v@P;

v@P=v@uv;

do your operations with group and smooth.

then you can do in a new wrangle after the smooth: v@P = v@initialP;

I am not sure if it will revert the uvs back to the distorted look, but if so you should be able to transfer the smoothed uvs to the mesh with the distorted uvs replacing those.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×