Houdini Engine and querying which is the host dcc

   5095   10   0
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
Hi,

I am starting to develop Houdini Engine tools that can work in multiple dccs (3dsmax, maya, ...). The houdini engine implementations treat the world transforms differently for different dccs (maya and max are different). There are also some differences with visualization of vertex colors etc.

Ideally there would be a way to find out which host dcc the plugin is running in. I can make a checkbox/dropdown where the user can specify that in the interface for now, but this feels like something I should be able to automate.

Does anyone know of a command or env variable that would allow me to query which host dcc I am running the Houdini engine plugin in?
I've tried looking in the docs for a while, but could not really find anything there.

Thanks!
Peter
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Staff
463 posts
Joined: Aug. 2019
Offline
You should be able to query the HAPI_CLIENT_NAME environment variable from within your HDA.
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
Great! I will try that out.
Thank you!
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
4 posts
Joined: Nov. 2013
Offline
Hi,

is it possible to query the HAPI_CLIENT_NAME in maya? Im trying to reach info from the License server admin for the tool im creating in maya using python.

I would like to know if there is a houdini engine license available, list the users etc

# Warning: Could not load OTL file: C:/0_ART/PRGMayaTools/houdini/hda/VertexHeatmap.hda
Attempting to instantiate asset anyway. # 
# Warning: HAPI Error: No Valid Licenses Found
- HAPI_LICENSE_MODE unset or is set to 'default' meaning Houdini Engine will first try to acquire a Houdini Engine license and if one is not found it will try to acquire an interactive Houdini license (Houdini Core then Houdini FX).
- No Houdini Engine Indie license found.
- No Houdini Engine license found.
- No Houdini license.
- Found a Houdini FX (Houdini Master) license but it is not the required commercial variant.
- No Houdini Indie license. # 
// Error: Could not instantiate asset: Sop/VertexHeatmap
in OTL file: C:/0_ART/PRGMayaTools/houdini/hda/VertexHeatmap.hda
 // 
// Error: HAPI Error: No Valid Licenses Found
- HAPI_LICENSE_MODE unset or is set to 'default' meaning Houdini Engine will first try to acquire a Houdini Engine license and if one is not found it will try to acquire an interactive Houdini license (Houdini Core then Houdini FX).
- No Houdini Engine Indie license found.
- No Houdini Engine license found.
- No Houdini license.
- Found a Houdini FX (Houdini Master) license but it is not the required commercial variant.
- No Houdini Indie license. // 

Could a reach this info before loading the hda with python?
Edited by Jose Casas Pagan - Feb. 3, 2022 05:08:04
User Avatar
Member
6 posts
Joined: Feb. 2020
Offline
I would be interested too. would be really nice to know!
User Avatar
Staff
463 posts
Joined: Aug. 2019
Offline
You can get the HAPI_CLIENT_NAME in your HDA by putting down a Python SOP and entering the following:

import os
print('HAPI_CLIENT_NAME:', os.environ.get('HAPI_CLIENT_NAME'))

For Maya, this will always be "maya".

You can get the list of available Houdini licenses by running the following in Maya:

from maya import mel
licenses = mel.eval('system("$HFS/houdini/sbin/sesictrl print-license")')
print(licenses)

A license is pulled when you instantiate the first HDA in Maya. If you want to check that a license is available before creating it, you must query the license server yourself and stop the creation of the node if one does not exist. The best way to do this would be to create a shelf that would perform the license check and only create the nodes if one is available.
Edited by johnmather - Feb. 3, 2022 12:45:04
User Avatar
Member
4 posts
Joined: Nov. 2013
Offline
Thanks!

I have and hda asset in the scene and my license is available and this is the message. Also cannot find sbin/sesictrl in my system

system("$HFS/houdini/sbin/sesictrl print-license");
// Result: '$HFS' is not recognized as an internal or external command,
operable program or batch file.
 // 
# Result: u"'$HFS' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n" # 
User Avatar
Staff
463 posts
Joined: Aug. 2019
Offline
On Windows, you can run the following:

from maya import mel
licenses = mel.eval('system("sesictrl print-license")')
print(licenses)
Edited by johnmather - Feb. 4, 2022 11:26:21
User Avatar
Member
4 posts
Joined: Nov. 2013
Offline
Thank you very much! this is super nice info to display on my maya tool for my team

Please is there some more docu or useful commands like this?
User Avatar
Staff
463 posts
Joined: Aug. 2019
Offline
Not really. What we're doing here is running a command line application and returning the result to Maya. You would need to look up the documentation of the sesictrl application in this instance.
User Avatar
Member
4 posts
Joined: Nov. 2013
Offline
Found this

https://www.sidefx.com/docs/houdini/ref/utils/sesictrl.html [www.sidefx.com]


Thanks a lot it is a bit tricky to digest the info but works
Edited by Jose Casas Pagan - Feb. 8, 2022 11:16:12

Attachments:
Untitled.png (23.4 KB)

  • Quick Links