Houdini autofinder
This commit is contained in:
parent
435b27961d
commit
9aabe09269
@ -41,6 +41,7 @@ def rop_redshift():
|
|||||||
rop.parm('PrimaryGIEngine').set('RS_GIENGINE_BRUTE_FORCE')
|
rop.parm('PrimaryGIEngine').set('RS_GIENGINE_BRUTE_FORCE')
|
||||||
rop.parm('SecondaryGIEngine').set('RS_GIENGINE_PHOTON_MAPPING')
|
rop.parm('SecondaryGIEngine').set('RS_GIENGINE_PHOTON_MAPPING')
|
||||||
rop.parm('UnifiedMaxSamples').set('1024')
|
rop.parm('UnifiedMaxSamples').set('1024')
|
||||||
|
rop.parm('UnifiedAdaptiveErrorThreshold').set('0.001')
|
||||||
rop.parm('RS_iprUpdateMeshDeform').set(True)
|
rop.parm('RS_iprUpdateMeshDeform').set(True)
|
||||||
ipr = out.node('Redshift_IPR1')
|
ipr = out.node('Redshift_IPR1')
|
||||||
if not ipr:
|
if not ipr:
|
||||||
|
|||||||
54
houy.py
54
houy.py
@ -1,27 +1,46 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from sys import argv, platform, exit, stderr
|
from sys import argv, platform, exit, stderr
|
||||||
from os import environ, getenv, chdir
|
from os import environ, getenv, chdir
|
||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def enter_hfs():
|
||||||
r = {environ.get('PATH')}
|
if '-hfs' not in argv:
|
||||||
setup_path = getenv('HFS')
|
print('__ HouY __')
|
||||||
if not setup_path:
|
hfs = getenv('HFS')
|
||||||
# Use static paths
|
if not hfs:
|
||||||
setup = {
|
print('Houdini Environment not yet initialized. Boostraping...', file=stderr)
|
||||||
'darwin': '/Applications/Houdini/Houdini17.5.173/Frameworks/Houdini.framework/Versions/Current/Resources',
|
|
||||||
'linux': '/opt/hfs17.5.229',
|
hfsen = {
|
||||||
'win32': r'C:\Program Files\Side Effects Software\Houdini 17.5.173'
|
'darwin': Path('/Applications/Houdini').glob('Houdini*/Frameworks/Houdini.framework/Versions/Current/Resources'),
|
||||||
|
'linux': Path('/opt').glob('hfs*'),
|
||||||
|
'win32': Path(r'C:\Program Files\Side Effects Software').glob('Houdini *'),
|
||||||
}
|
}
|
||||||
if platform not in setup.keys():
|
if platform not in hfsen.keys():
|
||||||
print('Platform `{}` not supported... yet.'.format(platform), file=stderr)
|
print('Platform `{}` not supported... yet.'.format(platform), file=stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
setup_path = setup[platform]
|
if hfsen.get(platform):
|
||||||
chdir(setup_path)
|
h = list(hfsen[platform])
|
||||||
|
print('Found: ', ', '.join(f.name for f in h), '*', sep='')
|
||||||
|
hfs = h[-1]
|
||||||
|
else:
|
||||||
|
print("ERROR - couldn't find HFS")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
if platform == 'win32' and '-hfs' not in argv:
|
||||||
|
argv.append('-hfs')
|
||||||
|
call([str(hfs/"bin/hcmd.exe"), '/c', *argv])
|
||||||
|
exit()
|
||||||
|
|
||||||
|
print('Current HFS:', hfs)
|
||||||
|
chdir(hfs)
|
||||||
|
return hfs
|
||||||
|
|
||||||
|
def welcome_redshift():
|
||||||
if platform == 'win32':
|
if platform == 'win32':
|
||||||
if '-rs3' in argv:
|
if '-rs3' in argv:
|
||||||
redshift_path = 'C:/ProgramData/Redshift3'
|
redshift_path = 'C:/ProgramData/Redshift3'
|
||||||
@ -32,6 +51,13 @@ if __name__ == '__main__':
|
|||||||
redshift_path = '/opt/redshift3'
|
redshift_path = '/opt/redshift3'
|
||||||
else:
|
else:
|
||||||
redshift_path = '/opt/redshift'
|
redshift_path = '/opt/redshift'
|
||||||
|
return redshift_path
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
enter_hfs()
|
||||||
|
redshift_path = welcome_redshift()
|
||||||
|
if redshift_path:
|
||||||
|
print('Redshift:', redshift_path)
|
||||||
|
|
||||||
environ.update({
|
environ.update({
|
||||||
'HOUDINI_NO_SPLASH': '1',
|
'HOUDINI_NO_SPLASH': '1',
|
||||||
@ -43,6 +69,10 @@ if __name__ == '__main__':
|
|||||||
'HOUDINI_OCL_DEVICENUMBER': '0',
|
'HOUDINI_OCL_DEVICENUMBER': '0',
|
||||||
'HOUDINI_PATH': "{}/Plugins/Houdini/17.5.173;&".format(redshift_path),
|
'HOUDINI_PATH': "{}/Plugins/Houdini/17.5.173;&".format(redshift_path),
|
||||||
})
|
})
|
||||||
|
if platform == 'win32':
|
||||||
|
print()
|
||||||
|
print('For OpenGL support remotely run this as an administrator:')
|
||||||
|
print(r'c:\Windows\System32\tscon.exe {} /dest:console'.format(getenv('SessionName')))
|
||||||
|
|
||||||
# Initialize env vars.
|
# Initialize env vars.
|
||||||
if platform != 'win32':
|
if platform != 'win32':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user