Copy geometry other object by UVs

   5605   6   1
User Avatar
Member
41 posts
Joined: July 2014
Offline
Hi,

how could I copy geometry like this checker pattern to another object in this case the good old pighead by UVs? Similar how you would apply a texture. But instead of 2D image you would copy this “checker” 3d geometry to the pighead. And you would get the checker pattern in shape of the pighead, in 3D.
I think in this video by MIXTraining, half of the job is done. Now just to copy the geo not quads but the whole surface based on UVs
https://www.youtube.com/watch?v=Z3ZkGoa3kZE [www.youtube.com]

thank you

Attachments:
geo_toUVs.JPG (149.2 KB)

User Avatar
Member
8531 posts
Joined: July 2007
Online
https://www.sidefx.com/tutorials/game-tools-detail-mesh/ [www.sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
There is a VEX function for transferring attributes such as position from one object to another based on their UVs:
v@P = uvsample(1, 'P', 'uv', @uv);

This method does not consider UV islands yet. However after setting a connectivity SOP to UVs, you can filter out stretched primitives by asking whether they come from different UV islands.
Edited by Konstantin Magnus - Jan. 26, 2019 03:55:26

Attachments:
pattern_to_surface.hiplc (244.9 KB)
pattern_to_surface.png (424.2 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
41 posts
Joined: July 2014
Offline
Thank you Konstantin, uvsample was just the command I was looking for! But I used it a bit differently. First I took some code from GameDev tools and flattened the template geo in world space by UVs. Then by using boolean I cut out the parts of the pattern I didn't needed and transfered UVs from the template. Then by using uvsample I matched the pattern to surface. Its much slower since it needs to boolean the pattern first but gives me more of a result I was hoping for.

Thank you Tamte, tried that detailed mesh tool but it didn't quite work for me.

Attachments:
pattern_to_surface_by_UV.JPG (56.3 KB)
pattern_to_surface_by_UV.hipnc (316.5 KB)

User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Well done! I just simplified it a bit.

Attachments:
pattern_to_surface_cut_seams.jpg (101.1 KB)
pattern_to_surface_cut_seams.hiplc (262.6 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
41 posts
Joined: July 2014
Offline
Great job, love it!
User Avatar
Member
1 posts
Joined: Nov. 2017
Offline
Hello all,

I am trying something similar. Actually, Konstantin, it's from your video here:
https://www.youtube.com/watch?v=6y9LVfM6N70 [www.youtube.com]



I am using the uvlayout node to pack geo that I would then like to place back onto the input geo. However it flattens the meshes.



My attribute wrangle is this:
v@P = uvsample(1, 'P', 'uv', @P);


Thanks in advance!

Attachments:
flattened_geo.png (835.1 KB)

  • Quick Links