Houdini to headus UVLayout

   11899   24   8
User Avatar
Member
918 posts
Joined: March 2014
Offline
Hi,

I've hacked together an HDA to bridge Houdini to headus UVLayout.
Attached is the .hda and a video to quickly go over the workflow.



I hope you enjoy this. Feel free to comment on workflow, implementation and improvements.

Thank you
Andy

Edit May 18:
I've set the application path based on the platform defaults for uvlayout. Example:
Windows - C:/Program Files (x86)/headus UVLayout v2 Professional/uvlayout.exe
macOS - /Applications/headus-UVLayout-Pro.app/Contents/MacOS/bin/uvlayout
Linux - /usr/local/uvlayout-pro/bin/uvlayout
This should free Mac users from accidentially selecting the wrong path.
Edited by Andy_23 - May 19, 2017 07:14:42

Attachments:
headus_uvlayout.hda (12.5 KB)

User Avatar
Member
76 posts
Joined: July 2006
Offline
Look very good.
Later I will watch this video with more calm ;-)
User Avatar
Member
1 posts
Joined: Jan. 2015
Offline
O, thanks Andy! You connected my favorite programms))
User Avatar
Member
15 posts
Joined: March 2016
Offline
Brilliant! Can't wait to try this out.
User Avatar
Member
260 posts
Joined: Nov. 2014
Offline
This is super handy. Thank you for it.
One note to the workflow, would it be possible to resend again object that came from UVLayout already?
So instead of having nodes: file->headus_uvlayout1->headus_uvlayout2
you will have just one headus_uvlayout? (having one headus_uvlayout node instead of having two nodes)

Probably best way is to make it: if geo_uvlayout.obj exist, use it instead of geo.obj

thoughts?
Edited by martinkindl83 - May 7, 2017 19:43:43
User Avatar
Member
2 posts
Joined: March 2014
Offline
Thanks, trying right now!!!
User Avatar
Member
918 posts
Joined: March 2014
Offline
martinkindl83
This is super handy. Thank you for it.
One note to the workflow, would it be possible to resend again object that came from UVLayout already?
So instead of having nodes: file->headus_uvlayout1->headus_uvlayout2
you will have just one headus_uvlayout? (having one headus_uvlayout node instead of having two nodes)

Probably best way is to make it: if geo_uvlayout.obj exist, use it instead of geo.obj

thoughts?

That's a very good point Martin. I will try a few things and see how it goes.

Thank you
Andy
User Avatar
Member
918 posts
Joined: March 2014
Offline
Hey Martin,

I've added an option to select whether to use the SOP input or an existing _uvlayout file.
This way one does not have to go to the file system and delete files in order to use the SOP input again.

I've updated the attachment of the HDA in the first post.
Please have a go at it

Thank you
Andy

Attachments:
use_existing_uvs.PNG (23.4 KB)

User Avatar
Member
260 posts
Joined: Nov. 2014
Offline
Thank you Andy.

Really appreciated.
User Avatar
Member
7 posts
Joined: Feb. 2016
Offline
Hi Andy,big thanks!
I'm not a programmer, so I'll describe the problem as much as possible.
One guy in russian community(big thanks too Alexander Alehin) found an error related with deadlock in a subprocess.
UVLayout stay as zombie process under Linux if you rerun Houdini and start hda once again.
The fix is:
In Scripts instead of:

uvl = subprocess.Popen([uvlayout_path, options, path ])

Write:

uvl = subprocess.Popen([uvlayout_path, options, path ], stdout=subprocess.PIPE, shell=True)
uvl.wait()
Edited by Ivan Malishev - May 10, 2017 15:27:22
User Avatar
Member
918 posts
Joined: March 2014
Offline
Ivan Malishev
Hi Andy,big thanks!
One guy in russian community(big thanks too Alexander Alehin) found an error related with deadlock in a subprocess.
UVlayout stay as zombie process under Linux if you rerun Houdini and start hda once again.
The fix is:
In Scripts instead of:

uvl = subprocess.Popen([uvlayout_path, options, path ])

Write:

uvl = subprocess.Popen([uvlayout_path, options, path ], stdout=subprocess.PIPE, shell=True)
uvl.wait()

Hi Ivan,

thank you for reporting this. If I apply these changes, then Houdini locks (at least on Windows) until I quit UVLayout.
Maybe the behavior is different on Linux? Can anybody else using the HDA on Linux chime in on this matter? Until then I'll look into checking based on the OS and branch in the code.

Andy

Edit: Hey Ivan, could you try or pass on the attached HDA and let me know? Thank you.

Edit2: I've removed the attachment, since it causes a lock. See below.
Edited by Andy_23 - May 10, 2017 17:38:12
User Avatar
Member
7 posts
Joined: Feb. 2016
Offline
Andy58
Andy

Edit: Hey Ivan, could you try or pass on the attached HDA and let me know? Thank you.


Thank you for feedback,hastened to write before testing Alexander's fix by myself.
He said it works perfect for him.
But now i am testing and it totally freezes Houdini.
So i can't test your os checking too.(
I don't know what to do,it remains to wait for other users,i think.)
And how you wrote
If I apply these changes, then Houdini locks (at least on Windows) until I quit UVLayout.
get the same error under Linux.
Edited by Ivan Malishev - May 10, 2017 17:11:00
User Avatar
Member
918 posts
Joined: March 2014
Offline
Hi Ivan,

from what I read in the Python subprocess docs, I'd expect a lock of Houdini since the Python code calling the subprocess waits for the child process to finish.

I wonder does the quit button on the HDA quit UVLayout on Linux? If so, I wonder what that zombie process is. Have you checked the running processes with ps from a shell?

To quit UVLayout which is started in plugin mode I have to write a file with the same name of the geometry file but with .CMD as extension and its content is ‘kill’. Once that file is written UVLayout detects it and quits itself.

Andy
User Avatar
Member
7 posts
Joined: Feb. 2016
Offline
I understood the regularity of the error,it's not about the code.
Forgive me for taking away from the truth.)
If i start Houdini from desktop shortcut-a zombie process appears.
If i start Houdini from console - HDA works perfect.
User Avatar
Member
1 posts
Joined: Dec. 2016
Offline
ok i found it sorry
User Avatar
Member
767 posts
Joined: April 2014
Offline
@Andy58 thanks for this HDA. Out of curiosity what version of UVLayout do you have installed ?

If your using the Creators Edition of Windows10 you can view OBJ directly within Windows.
Edited by _Christopher_ - May 14, 2017 14:59:44
【T】【C】【S】
User Avatar
Member
4189 posts
Joined: June 2012
Offline
Thanks Andy! Does this work on MacOS?

Tried ‘/Applications/headus-UVLayout-Pro.app/Contents/MacOS/bin/headus’ but it doesn't launch Headus.
User Avatar
Member
918 posts
Joined: March 2014
Offline
Artye
Thanks Andy! Does this work on MacOS?

Tried ‘/Applications/headus-UVLayout-Pro.app/Contents/MacOS/bin/headus’ but it doesn't launch Headus.

I've looked into this and found the problem. I'll try to fix it in the coming days.

Thank you
Andy
User Avatar
Member
918 posts
Joined: March 2014
Offline
Hello Artye and fellow macOS users,

I think I have fixed the issues with launching UVLayout on the Mac. Please give the attached HDA a try. Once you confirm it's working I'll replace the one in the first post and in the tutorial section.

Thank you all.
Andy

I've deleted the attachment and reuploaded to the first post.
Edited by Andy_23 - May 18, 2017 17:20:07
User Avatar
Member
4189 posts
Joined: June 2012
Offline
No go unfortunately. the terminal just displays
usage: headus [-h]
.

I tested
/Applications/headus-UVLayout-Pro.app/Contents/MacOS/headus-launch
for the UVLayout Path.
  • Quick Links