MoI UV fix - Houdini

Next
 From:  PaQ
10954.1 
CADuvFIX : This HDA will fix the uv's generated by MoI.

UV's are actually inherited from Nurbs surface when exporting a model, and are uniform along 0-1 UV space, no matter the real surface area. The result are uv's that are stretched in U or V direction for any surface that doesn't perfectly fit in a square.

- The tool will try to detect in what direction the uv's are stretched, and fix the distortion accordingly. It doesn't use any kind of unwarping and only uses the existing uv's.
- It will also fix the texel density along all the surfaces.
- It will fix flipped uv that can happen here and there.

The tool is at an early dev stage, there is no optimizing done and the setup is just focused on the result, no smart vex coding here. (the large engine model take around 15sec to process on an heavy multi-core machine).
It does expect the mesh to be exported from MoI with "weld vertices along edges" disabled as it needs to loop on every connected surface. (N and uv are thus on points, there is no data class check for the moment).









EDITED: 2 Aug 2023 by PAQ


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  PaQ
10954.2 In reply to 10954.1 
(require Houdini 19.5, .hda in attachement)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frank (FRANK_ART)
10954.3 
This is actually super cool, I'm having problems to unwrap and have decent UV on models done in Moi. Unfortunately I dont use Houdini but blender. I kindly ask here to Michael or any other developer: is it possible to have a script or an addon for moi that perform the same concept that PaQ did on Houdini? It will be an awesome feature !!!
Thanks for sharing this process :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10954.4 In reply to 10954.3 
Hi Frank,

re:
> I kindly ask here to Michael or any other developer: is it possible to have a script or an
> addon for moi that perform the same concept that PaQ did on Houdini?

I don't think so - there is not currently a way for a script to access and modify the UV coordinates inside of MoI.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frank (FRANK_ART)
10954.5 In reply to 10954.4 
Hi Michael,
thanks for the quick reply. Oki, so then I wish you may consider it integrate that concept in potential future release of Moi :) (... I have no idea of what I'm wishing in term of time /developing budget). At your knowledge today whats the best way to get decent unwraps on moi models?
Cheers
Frank
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10954.6 In reply to 10954.5 
Hi Frank,

re:
> (... I have no idea of what I'm wishing in term of time /developing budget).

Hard to say, maybe a year of work or something to design an API that would be so comprehensive to be able to get all the way down to modifying UV coordinates that are only being generated as part of the export process.


> At your knowledge today whats the best way to get decent unwraps on moi models?

I think many people throw out the auto generated ones from MoI and use whatever is in their main poly modeling program.

There's a function in Blender, something like "Average UV islands" that could probably process the MoI-generated UV coordinates too.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  2byts
10954.7 
this is awesome! Thanx a lot for the share.

I was doing something similar for UV layout into UDIMs based on materials
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
10954.8 
Hello Paq,

Would you mind sharing one of these models (let's say, something of medium complexity), with and without your fix applied ? I'd be very curious to see what it takes to get to the same result in Blender, and would love to try it out.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  PaQ
10954.9 In reply to 10954.8 
Hi Prior,

Sure, sorry for the delay, I missed the notification.
In the meantime here's an updated version, using a lame brute force approach to reduce the stretching ... it seems to work better than the one made with my bad trigonometry / vector skills.



Does is works better than tagging / unwarp edge using existing MoI uv's boundaries ?

Short reply : NO

Long reply :

1) I'm facing a lot of Hou crash whit the Flatten method ... as I'm only manipulate existing data here, the 'tool' is quite robust.
2) 90% of the uv's coming from MoI are actually good, except they are stretched in u or v direction. They are also perfectly grid aligned : torus shape or tubes output a 'perfect' aligned rectangle, helping the packing process to maximize uv space.

Ultimately I could add a last check that will re-flatten the island that are still too distorted (easy), but I will only do it once I resolve the uv-flatten crash on some of those surfaces.

EDITED: 2 Aug 2023 by PAQ

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  PaQ
10954.10 
Hello, here's an updated version, using the last feature from Moi5 Beta to generate proper surface ID.
That's about the third time I rebuild this tool, the execution time is almost instant, and there is no more iteration to "find" the best value.
Create the layout / udim however can still take a few second / minutes depending of the number of surfaces (using native Hou UVLayout).

https://www.youtube.com/watch?v=XbGfRWSs-uw

Build on Houdini 20.0.547

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10954.11 
Cool!
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Grendel
10954.12 
PaQ, would this work with Houdini Apprentice?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  PaQ
10954.13 In reply to 10954.12 
It should yes, however the geo output options are quite limited (ROP operators are disabled IIRC). You can only export geo by right click on a node and select export geo ... and in the case of apprentice only .obj works, and I'm not 100% sure uv's are preserved. But I haven't used apprentice since a while !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All