英文:
Trying to view source code for a Houdini file
问题
我想更好地理解一篇卓越的论文:https://cseweb.ucsd.edu/~alchern/projects/MinimalCurrent/
作者提供的源代码是一个专有的二进制代码,只能在Houdini中打开。一个.hipnc
文件。二进制数据可以在其他应用程序中查看,但无法查看源代码。
使用Houdini的免费许可版本打开文件会显示一些图形输出。
然而,在文档中搜索并尝试使用用户界面,我找不到文本编辑器来实际查看研究人员所做工作的源代码。
根据原始论文的描述,我知道源代码包含在Houdini文件中。作者明确如此说明。但我找不到描述如何查看该源代码的文档。
英文:
I want to better understand a remarkable paper:
https://cseweb.ucsd.edu/~alchern/projects/MinimalCurrent/
The authors provide the source code as a proprietary binary code that can only be opened in Houdini. A .hipnc
file. The binary data can be viewed in other applications, but not the source code.
Opening the file with the free licensed version of Houdini shows some graphical output.
However searching around in the documentation and playing with the UI I cannot find a text editor to actually see the source code of what the researchers were doing.
Given the original paper description, I know that the source code is contained in the Houdini file. The authors explicitly say so. But I cannot find documentation describing how to see that source code.
答案1
得分: 2
根据@adabsurdum在meta上的评论,.hipnc
文件可以在纯文本编辑器(如vi或emacs)中打开。它包含一些二进制数据块,我不确定它是否实际上对您理解作者正在做什么有用,但它不难查看。
它类似于在未压缩的PDF或PostScript文件中看到的内容 - 基本上是以(大部分)纯文本表达的图形原语。
例如,前几行是(从emacs中复制粘贴的):
HouNC^Z1033600baa06089de3b09a7e5953.start^@fplayback -i on -r off -f 1 -e on -h on -t on -a on -k on -s 1
tcur 0
fps 24
tset 0 10
frange 1 240
unitlength 1
unitmass 1
prompt '`strcat(oppwf(), " -> ")`'
HouNC^Z1033600ba606089de3b043eebadb.variables^@set -g ACTIVETAKE = 'Main'
set -g DRIVER = 'mantra_ipr'
set -g DRIVERPATH = '/out/mantra_ipr'
set -g E = '2.7182818284590452354'
set -g EYE = 'stereo'
set -g HIP = '/Users/achern/Documents/MinimalCurrent/supplementary'
set -g HIPFILE = '/Users/achern/Documents/MinimalCurrent/supplementary/mincurr.hipnc'
set -g HIPNAME = 'mincurr'
set -g JOB = '/Users/achern'
set -g PI = '3.1415926535897932384'
set -g POSE = '/Users/achern/Library/Preferences/houdini/16.0/poselib'
set -g _HIP_SAVEPLATFORM = 'macosx10.14-x86_64-clang10.0-targetosx10.12'
set -g _HIP_SAVETIME = 'Wed Apr 28 15:14:19 2021'
set -g _HIP_SAVEVERSION = '18.0.532'
set -g _HIP_SHELFTOOLCOUNT = '14'
set -g status = '0'
以及第26112行和以下内容:
viewroto -S file -F '' -C '' -a on -o 0 0 -s 1 1 -B 1 -e off image Build.panetab1.world.persp1
viewtransform Build.panetab1.world.persp1 version ( 3 ) flag ( Fx ) orthowidth ( 5.22896 ) focal ( 50 ) apertu\
re ( 41.4214 ) window ( 0 1 0 1 ) winroll ( 0 ) clear ( 1 ) nearfar ( 0.135896 6678.76 ) aspect ( 1.33333 ) \
pixelaspect ( 1 ) txyz ( -0.1549 -0.00862012 7.265 ) pxyz ( -0.827671 -1.16344 -0.0768346 ) rotation ( 0.070341\
9 0.709621 -0.701065 1.32842e-07 0.702805 0.711382 0.997524 -0.0500401 0.0494366 ) homedistance ( 8.02968 ) hom\
eadjboxwidth ( 5.22896 ) homeorthowidth ( 5.22896 ) homeradius ( 6.67073 ) homeaxis ( 0 ) homecustom ( 0.70710\
7 -0.353553 0.612372 0 0.866025 0.5 -0.707107 -0.353553 0.612372 ) adjustlimits ( 3 )
viewcamera -c '' Build.panetab1.world.persp1
vieworthogrid -d off -o 0 0 0 -s 0.2 0.2 -r 5 5 -R 1 Build.panetab1.world.persp1
viewuvgrid -r on -s 0.1 0.1 -P off -S 64 64 -O 0 0 -C on -t on Build.panetab1.world.persp1
viewagentopts -L on -b 0 -d 1 -l 0 -m 4 -p 1000 -w 1 Build.panetab1.world.persp1
viewonionskin -e on -a 4 -b 4 -i 6 -o 0.5 -A 1 1 1 -B 1 1 1 Build.panetab1.world.persp1
viewposteffects -f off -S on -b 5 -F 1 -c 1 1 1 -d 1e+06 -h 0 -H 100 10 -i 1 -n "" -o 1 -r 0 1000 -s 1 1 -v 0 Bui\
ld.panetab1.world.persp1
英文:
As commented on meta by @adabsurdum, the .hipnc
file can be opened in a plain-text editor such as vi or emacs. It does have some binary blobs in it, and I don't know if it will actually be useful as 'source code' to help you understand what the authors are doing, but it's not hard to examine.
It's similar to what you would see in an uncompressed PDF or PostScript file - basically, graphics primitives expressed in (mostly) plain text.
For example, the first few lines are (copy-pasted from emacs):
HouNC^Z1033600baa06089de3b09a7e5953.start^@fplayback -i on -r off -f 1 -e on -h on -t on -a on -k on -s 1
tcur 0
fps 24
tset 0 10
frange 1 240
unitlength 1
unitmass 1
prompt '`strcat(oppwf(), " -> ")`'
HouNC^Z1033600ba606089de3b043eebadb.variables^@set -g ACTIVETAKE = 'Main'
set -g DRIVER = 'mantra_ipr'
set -g DRIVERPATH = '/out/mantra_ipr'
set -g E = '2.7182818284590452354'
set -g EYE = 'stereo'
set -g HIP = '/Users/achern/Documents/MinimalCurrent/supplementary'
set -g HIPFILE = '/Users/achern/Documents/MinimalCurrent/supplementary/mincurr.hipnc'
set -g HIPNAME = 'mincurr'
set -g JOB = '/Users/achern'
set -g PI = '3.1415926535897932384'
set -g POSE = '/Users/achern/Library/Preferences/houdini/16.0/poselib'
set -g _HIP_SAVEPLATFORM = 'macosx10.14-x86_64-clang10.0-targetosx10.12'
set -g _HIP_SAVETIME = 'Wed Apr 28 15:14:19 2021'
set -g _HIP_SAVEVERSION = '18.0.532'
set -g _HIP_SHELFTOOLCOUNT = '14'
set -g status = '0'
and lines 26112 and following are:
viewroto -S file -F '' -C '' -a on -o 0 0 -s 1 1 -B 1 -e off image Build.panetab1.world.persp1
viewtransform Build.panetab1.world.persp1 version ( 3 ) flag ( Fx ) orthowidth ( 5.22896 ) focal ( 50 ) apertu\
re ( 41.4214 ) window ( 0 1 0 1 ) winroll ( 0 ) clear ( 1 ) nearfar ( 0.135896 6678.76 ) aspect ( 1.33333 ) \
pixelaspect ( 1 ) txyz ( -0.1549 -0.00862012 7.265 ) pxyz ( -0.827671 -1.16344 -0.0768346 ) rotation ( 0.070341\
9 0.709621 -0.701065 1.32842e-07 0.702805 0.711382 0.997524 -0.0500401 0.0494366 ) homedistance ( 8.02968 ) hom\
eadjboxwidth ( 5.22896 ) homeorthowidth ( 5.22896 ) homeradius ( 6.67073 ) homeaxis ( 0 ) homecustom ( 0.70710\
7 -0.353553 0.612372 0 0.866025 0.5 -0.707107 -0.353553 0.612372 ) adjustlimits ( 3 )
viewcamera -c '' Build.panetab1.world.persp1
vieworthogrid -d off -o 0 0 0 -s 0.2 0.2 -r 5 5 -R 1 Build.panetab1.world.persp1
viewuvgrid -r on -s 0.1 0.1 -P off -S 64 64 -O 0 0 -C on -t on Build.panetab1.world.persp1
viewagentopts -L on -b 0 -d 1 -l 0 -m 4 -p 1000 -w 1 Build.panetab1.world.persp1
viewonionskin -e on -a 4 -b 4 -i 6 -o 0.5 -A 1 1 1 -B 1 1 1 Build.panetab1.world.persp1
viewposteffects -f off -S on -b 5 -F 1 -c 1 1 1 -d 1e+06 -h 0 -H 100 10 -i 1 -n "" -o 1 -r 0 1000 -s 1 1 -v 0 Bui\
ld.panetab1.world.persp1
答案2
得分: 2
Houdini 被描述为“计算机图形的集成开发环境”,而不是传统的代码/脚本编辑器。在这个问题的上下文中,.hipnc
文件包含了一个由网络节点组成的工作流,看起来类似于 Network View
中的以下内容:
[][链接]
假设您对mincurr_FFT_solver
节点感兴趣,您可以使用内置的Python Shell
获取任何给定节点的源代码:
import hou
node = hou.node('/obj/Minimal_Current/mincurr_FFT_solver')
print(node.asCode())
写入文件时的结果:
# 初始化父节点变量。
if locals().get("hou_parent") is None:
hou_parent = hou.node("/obj/Minimal_Current")
# 用于 /obj/Minimal_Current/mincurr_FFT_solver 的代码
hou_node = hou_parent.createNode("subnet", "mincurr_FFT_solver", run_init_scripts=False, load_contents=True, exact_type_name=True)
hou_node.move(hou.Vector2(1.25615, -5.79144))
hou_node.bypass(False)
hou_node.setDisplayFlag(False)
hou_node.hide(False)
hou_node.setHighlightFlag(False)
hou_node.setHardLocked(False)
hou_node.setSoftLocked(False)
hou_node.setSelectableTemplateFlag(False)
hou_node.setSelected(True)
hou_node.setRenderFlag(False)
hou_node.setTemplateFlag(False)
hou_node.setUnloadFlag(False)
hou_parm_template_group = hou.ParmTemplateGroup()
# 参数模板的代码
hou_parm_template = hou.StringParmTemplate("label1", "Input #1 Label", 1, default_value=(["Sub-Network Input #1"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template_group.append(hou_parm_template)
# 参数模板的代码
# 以下省略其他参数模板的代码...
# 将参数模板组添加到节点
hou_node.setParmTemplateGroup(hou_parm_template_group)
# 以下省略每个参数的设置代码...
您可以根据需要使用这些代码片段创建和设置节点参数。
英文:
Houdini is described as an "IDE for computer graphics", and not a typical code/script editor. In the context of this question, the .hipnc
file contains a workflow comprising network nodes, which looks something like below in Network View
:
Assuming you are interested in the mincurr_FFT_solver
node, you can use the built-in Python Shell
to get the source code of any given node:
<!-- language-all: lang-py -->
import hou
node = hou.node('/obj/Minimal_Current/mincurr_FFT_solver')
print(node.asCode())
Results when written to file:
# Initialize parent node variable.
if locals().get("hou_parent") is None:
hou_parent = hou.node("/obj/Minimal_Current")
# Code for /obj/Minimal_Current/mincurr_FFT_solver
hou_node = hou_parent.createNode("subnet", "mincurr_FFT_solver", run_init_scripts=False, load_contents=True, exact_type_name=True)
hou_node.move(hou.Vector2(1.25615, -5.79144))
hou_node.bypass(False)
hou_node.setDisplayFlag(False)
hou_node.hide(False)
hou_node.setHighlightFlag(False)
hou_node.setHardLocked(False)
hou_node.setSoftLocked(False)
hou_node.setSelectableTemplateFlag(False)
hou_node.setSelected(True)
hou_node.setRenderFlag(False)
hou_node.setTemplateFlag(False)
hou_node.setUnloadFlag(False)
hou_parm_template_group = hou.ParmTemplateGroup()
# Code for parameter template
hou_parm_template = hou.StringParmTemplate("label1", "Input #1 Label", 1, default_value=(["Sub-Network Input #1"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template_group.append(hou_parm_template)
# Code for parameter template
hou_parm_template = hou.StringParmTemplate("label2", "Input #2 Label", 1, default_value=(["Sub-Network Input #2"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template_group.append(hou_parm_template)
# Code for parameter template
hou_parm_template = hou.StringParmTemplate("label3", "Input #3 Label", 1, default_value=(["Sub-Network Input #3"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template_group.append(hou_parm_template)
# Code for parameter template
hou_parm_template = hou.StringParmTemplate("label4", "Input #4 Label", 1, default_value=(["Sub-Network Input #4"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template_group.append(hou_parm_template)
# Code for parameter template
hou_parm_template = hou.ButtonParmTemplate("resimulate", "Reset Simulation")
hou_parm_template.setTags({"autoscope": "0000000000000000"})
hou_parm_template_group.append(hou_parm_template)
# Code for parameter template
hou_parm_template = hou.FolderParmTemplate("folder0", "Fast ADMM Parameters", folder_type=hou.folderType.Simple, default_value=0, ends_tab_group=False)
hou_parm_template.setTags({"group_type": "simple"})
# Code for parameter template
hou_parm_template2 = hou.FloatParmTemplate("tau", "time step (tau)", 1, default_value=([0.1]), min=0, max=1, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.FloatParmTemplate("c_threshold", "threshold (c_threshold)", 1, default_value=([0.5]), min=0, max=1, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
hou_parm_template_group.append(hou_parm_template)
# Code for parameter template
hou_parm_template = hou.FolderParmTemplate("folder1", "Pointers to Volumes", folder_type=hou.folderType.Simple, default_value=0, ends_tab_group=False)
hou_parm_template.setTags({"group_type": "simple"})
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("rhs", "RHS", 1, default_value=([32]), min=0, max=10, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_eta0", "eta0", 1, default_value=([2]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_eta", "eta", 1, default_value=([5]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_phi", "phi", 1, default_value=([9]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_X", "X", 1, default_value=([10]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_Xhat", "Xhat", 1, default_value=([13]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_Xprev", "Xprev", 1, default_value=([16]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_lambda", "lambda", 1, default_value=([19]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_lambdahat", "lambdahat", 1, default_value=([22]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_lambdaprev", "lambdaprev", 1, default_value=([25]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_Y", "Y", 1, default_value=([28]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.IntParmTemplate("ind_summand", "summand", 1, default_value=([31]), min=0, max=30, min_is_strict=False, max_is_strict=False, look=hou.parmLook.Regular, naming_scheme=hou.parmNamingScheme.Base1, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "script_callback_language": "python"})
hou_parm_template.addParmTemplate(hou_parm_template2)
hou_parm_template_group.append(hou_parm_template)
# Code for parameter template
hou_parm_template = hou.FolderParmTemplate("folder2", "Paths to Cached Matrices", folder_type=hou.folderType.Simple, default_value=0, ends_tab_group=False)
hou_parm_template.setTags({"group_type": "simple"})
# Code for parameter template
hou_parm_template2 = hou.StringParmTemplate("path_laplacian", "DVEC Laplacian", 1, default_value=(["../vdec_laplacian1/"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.NodeReference, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "oprelative": "."})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.StringParmTemplate("path_sharp", "DVEC Sharp Matrix", 1, default_value=(["../vdec_sharp_matrix1/"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.NodeReference, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "oprelative": "."})
hou_parm_template.addParmTemplate(hou_parm_template2)
# Code for parameter template
hou_parm_template2 = hou.StringParmTemplate("path_system_matrix", "MINCURR System Matrix", 1, default_value=(["../mincurr_system_matrix1/"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.NodeReference, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
hou_parm_template2.setTags({"autoscope": "0000000000000000", "oprelative": "."})
hou_parm_template.addParmTemplate(hou_parm_template2)
hou_parm_template_group.append(hou_parm_template)
hou_node.setParmTemplateGroup(hou_parm_template_group)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/label1 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("label1")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("Sub-Network Input #1")
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/label2 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("label2")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("Sub-Network Input #2")
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/label3 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("label3")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("Sub-Network Input #3")
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/label4 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("label4")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("Sub-Network Input #4")
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/resimulate parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("resimulate")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("0")
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/folder0 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("folder0")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(0)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/tau parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("tau")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(0.040000000000000001)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/c_threshold parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("c_threshold")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(0.5)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/folder1 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("folder1")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(0)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/rhs parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("rhs")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(32)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_eta0 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_eta0")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(2)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_eta parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_eta")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(5)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_phi parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_phi")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(9)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_X parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_X")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(10)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_Xhat parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_Xhat")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(13)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_Xprev parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_Xprev")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(16)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_lambda parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_lambda")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(19)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_lambdahat parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_lambdahat")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(22)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_lambdaprev parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_lambdaprev")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(25)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_Y parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_Y")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(28)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_summand parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("ind_summand")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(31)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/folder2 parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("folder2")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set(0)
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/path_laplacian parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("path_laplacian")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("../vdec_laplacian1/")
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/path_sharp parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("path_sharp")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("../vdec_sharp_matrix1/")
hou_parm.setAutoscope(False)
# Code for /obj/Minimal_Current/mincurr_FFT_solver/path_system_matrix parm
if locals().get("hou_node") is None:
hou_node = hou.node("/obj/Minimal_Current/mincurr_FFT_solver")
hou_parm = hou_node.parm("path_system_matrix")
hou_parm.lock(False)
hou_parm.deleteAllKeyframes()
hou_parm.set("../mincurr_system_matrix1/")
hou_parm.setAutoscope(False)
hou_node.setExpressionLanguage(hou.exprLanguage.Hscript)
# Code to establish connections for /obj/Minimal_Current/mincurr_FFT_solver
hou_node = hou_parent.node("mincurr_FFT_solver")
if hou_parent.node("mincurr_FFT_initialize") is not None:
hou_node.setInput(0, hou_parent.node("mincurr_FFT_initialize"), 0)
hou_node.setUserData("___Version___", "19.5.465")
if hasattr(hou_node, "syncNodeVersionIfNeeded"):
hou_node.syncNodeVersionIfNeeded("19.5.465")
To address this question, I had to consult information related to Python SOP (surface operators in Houdini), such as: https://github.com/kiryha/Houdini/wiki/python-for-artists#python-integration-basics
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论