尝试查看Houdini文件的源代码

huangapple go评论88阅读模式
英文:

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.

尝试查看Houdini文件的源代码

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中复制粘贴的):

  1. HouNC^Z1033600baa06089de3b09a7e5953.start^@fplayback -i on -r off -f 1 -e on -h on -t on -a on -k on -s 1
  2. tcur 0
  3. fps 24
  4. tset 0 10
  5. frange 1 240
  6. unitlength 1
  7. unitmass 1
  8. prompt '`strcat(oppwf(), " -> ")`'
  9. HouNC^Z1033600ba606089de3b043eebadb.variables^@set -g ACTIVETAKE = 'Main'
  10. set -g DRIVER = 'mantra_ipr'
  11. set -g DRIVERPATH = '/out/mantra_ipr'
  12. set -g E = '2.7182818284590452354'
  13. set -g EYE = 'stereo'
  14. set -g HIP = '/Users/achern/Documents/MinimalCurrent/supplementary'
  15. set -g HIPFILE = '/Users/achern/Documents/MinimalCurrent/supplementary/mincurr.hipnc'
  16. set -g HIPNAME = 'mincurr'
  17. set -g JOB = '/Users/achern'
  18. set -g PI = '3.1415926535897932384'
  19. set -g POSE = '/Users/achern/Library/Preferences/houdini/16.0/poselib'
  20. set -g _HIP_SAVEPLATFORM = 'macosx10.14-x86_64-clang10.0-targetosx10.12'
  21. set -g _HIP_SAVETIME = 'Wed Apr 28 15:14:19 2021'
  22. set -g _HIP_SAVEVERSION = '18.0.532'
  23. set -g _HIP_SHELFTOOLCOUNT = '14'
  24. set -g status = '0'

以及第26112行和以下内容:

  1. viewroto -S file -F '' -C '' -a on -o 0 0 -s 1 1 -B 1 -e off image Build.panetab1.world.persp1
  2. viewtransform Build.panetab1.world.persp1 version ( 3 ) flag ( Fx ) orthowidth ( 5.22896 ) focal ( 50 ) apertu\
  3. re ( 41.4214 ) window ( 0 1 0 1 ) winroll ( 0 ) clear ( 1 ) nearfar ( 0.135896 6678.76 ) aspect ( 1.33333 ) \
  4. pixelaspect ( 1 ) txyz ( -0.1549 -0.00862012 7.265 ) pxyz ( -0.827671 -1.16344 -0.0768346 ) rotation ( 0.070341\
  5. 9 0.709621 -0.701065 1.32842e-07 0.702805 0.711382 0.997524 -0.0500401 0.0494366 ) homedistance ( 8.02968 ) hom\
  6. eadjboxwidth ( 5.22896 ) homeorthowidth ( 5.22896 ) homeradius ( 6.67073 ) homeaxis ( 0 ) homecustom ( 0.70710\
  7. 7 -0.353553 0.612372 0 0.866025 0.5 -0.707107 -0.353553 0.612372 ) adjustlimits ( 3 )
  8. viewcamera -c '' Build.panetab1.world.persp1
  9. vieworthogrid -d off -o 0 0 0 -s 0.2 0.2 -r 5 5 -R 1 Build.panetab1.world.persp1
  10. viewuvgrid -r on -s 0.1 0.1 -P off -S 64 64 -O 0 0 -C on -t on Build.panetab1.world.persp1
  11. viewagentopts -L on -b 0 -d 1 -l 0 -m 4 -p 1000 -w 1 Build.panetab1.world.persp1
  12. viewonionskin -e on -a 4 -b 4 -i 6 -o 0.5 -A 1 1 1 -B 1 1 1 Build.panetab1.world.persp1
  13. 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\
  14. 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):

  1. HouNC^Z1033600baa06089de3b09a7e5953.start^@fplayback -i on -r off -f 1 -e on -h on -t on -a on -k on -s 1
  2. tcur 0
  3. fps 24
  4. tset 0 10
  5. frange 1 240
  6. unitlength 1
  7. unitmass 1
  8. prompt '`strcat(oppwf(), " -> ")`'
  9. HouNC^Z1033600ba606089de3b043eebadb.variables^@set -g ACTIVETAKE = 'Main'
  10. set -g DRIVER = 'mantra_ipr'
  11. set -g DRIVERPATH = '/out/mantra_ipr'
  12. set -g E = '2.7182818284590452354'
  13. set -g EYE = 'stereo'
  14. set -g HIP = '/Users/achern/Documents/MinimalCurrent/supplementary'
  15. set -g HIPFILE = '/Users/achern/Documents/MinimalCurrent/supplementary/mincurr.hipnc'
  16. set -g HIPNAME = 'mincurr'
  17. set -g JOB = '/Users/achern'
  18. set -g PI = '3.1415926535897932384'
  19. set -g POSE = '/Users/achern/Library/Preferences/houdini/16.0/poselib'
  20. set -g _HIP_SAVEPLATFORM = 'macosx10.14-x86_64-clang10.0-targetosx10.12'
  21. set -g _HIP_SAVETIME = 'Wed Apr 28 15:14:19 2021'
  22. set -g _HIP_SAVEVERSION = '18.0.532'
  23. set -g _HIP_SHELFTOOLCOUNT = '14'
  24. set -g status = '0'

and lines 26112 and following are:

  1. viewroto -S file -F '' -C '' -a on -o 0 0 -s 1 1 -B 1 -e off image Build.panetab1.world.persp1
  2. viewtransform Build.panetab1.world.persp1 version ( 3 ) flag ( Fx ) orthowidth ( 5.22896 ) focal ( 50 ) apertu\
  3. re ( 41.4214 ) window ( 0 1 0 1 ) winroll ( 0 ) clear ( 1 ) nearfar ( 0.135896 6678.76 ) aspect ( 1.33333 ) \
  4. pixelaspect ( 1 ) txyz ( -0.1549 -0.00862012 7.265 ) pxyz ( -0.827671 -1.16344 -0.0768346 ) rotation ( 0.070341\
  5. 9 0.709621 -0.701065 1.32842e-07 0.702805 0.711382 0.997524 -0.0500401 0.0494366 ) homedistance ( 8.02968 ) hom\
  6. eadjboxwidth ( 5.22896 ) homeorthowidth ( 5.22896 ) homeradius ( 6.67073 ) homeaxis ( 0 ) homecustom ( 0.70710\
  7. 7 -0.353553 0.612372 0 0.866025 0.5 -0.707107 -0.353553 0.612372 ) adjustlimits ( 3 )
  8. viewcamera -c '' Build.panetab1.world.persp1
  9. vieworthogrid -d off -o 0 0 0 -s 0.2 0.2 -r 5 5 -R 1 Build.panetab1.world.persp1
  10. viewuvgrid -r on -s 0.1 0.1 -P off -S 64 64 -O 0 0 -C on -t on Build.panetab1.world.persp1
  11. viewagentopts -L on -b 0 -d 1 -l 0 -m 4 -p 1000 -w 1 Build.panetab1.world.persp1
  12. viewonionskin -e on -a 4 -b 4 -i 6 -o 0.5 -A 1 1 1 -B 1 1 1 Build.panetab1.world.persp1
  13. 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\
  14. ld.panetab1.world.persp1

答案2

得分: 2

Houdini 被描述为“计算机图形的集成开发环境”,而不是传统的代码/脚本编辑器。在这个问题的上下文中,.hipnc 文件包含了一个由网络节点组成的工作流,看起来类似于 Network View 中的以下内容:

[尝试查看Houdini文件的源代码][链接]

假设您对mincurr_FFT_solver节点感兴趣,您可以使用内置的Python Shell获取任何给定节点的源代码:

  1. import hou
  2. node = hou.node('/obj/Minimal_Current/mincurr_FFT_solver')
  3. print(node.asCode())

写入文件时的结果:

  1. # 初始化父节点变量。
  2. if locals().get("hou_parent") is None:
  3. hou_parent = hou.node("/obj/Minimal_Current")
  4. # 用于 /obj/Minimal_Current/mincurr_FFT_solver 的代码
  5. hou_node = hou_parent.createNode("subnet", "mincurr_FFT_solver", run_init_scripts=False, load_contents=True, exact_type_name=True)
  6. hou_node.move(hou.Vector2(1.25615, -5.79144))
  7. hou_node.bypass(False)
  8. hou_node.setDisplayFlag(False)
  9. hou_node.hide(False)
  10. hou_node.setHighlightFlag(False)
  11. hou_node.setHardLocked(False)
  12. hou_node.setSoftLocked(False)
  13. hou_node.setSelectableTemplateFlag(False)
  14. hou_node.setSelected(True)
  15. hou_node.setRenderFlag(False)
  16. hou_node.setTemplateFlag(False)
  17. hou_node.setUnloadFlag(False)
  18. hou_parm_template_group = hou.ParmTemplateGroup()
  19. # 参数模板的代码
  20. 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)
  21. hou_parm_template_group.append(hou_parm_template)
  22. # 参数模板的代码
  23. # 以下省略其他参数模板的代码...
  24. # 将参数模板组添加到节点
  25. hou_node.setParmTemplateGroup(hou_parm_template_group)
  26. # 以下省略每个参数的设置代码...

您可以根据需要使用这些代码片段创建和设置节点参数。

英文:

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:

尝试查看Houdini文件的源代码

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 -->

  1. import hou
  2. node = hou.node(&#39;/obj/Minimal_Current/mincurr_FFT_solver&#39;)
  3. print(node.asCode())

Results when written to file:

  1. # Initialize parent node variable.
  2. if locals().get(&quot;hou_parent&quot;) is None:
  3. hou_parent = hou.node(&quot;/obj/Minimal_Current&quot;)
  4. # Code for /obj/Minimal_Current/mincurr_FFT_solver
  5. hou_node = hou_parent.createNode(&quot;subnet&quot;, &quot;mincurr_FFT_solver&quot;, run_init_scripts=False, load_contents=True, exact_type_name=True)
  6. hou_node.move(hou.Vector2(1.25615, -5.79144))
  7. hou_node.bypass(False)
  8. hou_node.setDisplayFlag(False)
  9. hou_node.hide(False)
  10. hou_node.setHighlightFlag(False)
  11. hou_node.setHardLocked(False)
  12. hou_node.setSoftLocked(False)
  13. hou_node.setSelectableTemplateFlag(False)
  14. hou_node.setSelected(True)
  15. hou_node.setRenderFlag(False)
  16. hou_node.setTemplateFlag(False)
  17. hou_node.setUnloadFlag(False)
  18. hou_parm_template_group = hou.ParmTemplateGroup()
  19. # Code for parameter template
  20. hou_parm_template = hou.StringParmTemplate(&quot;label1&quot;, &quot;Input #1 Label&quot;, 1, default_value=([&quot;Sub-Network Input #1&quot;]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
  21. hou_parm_template_group.append(hou_parm_template)
  22. # Code for parameter template
  23. hou_parm_template = hou.StringParmTemplate(&quot;label2&quot;, &quot;Input #2 Label&quot;, 1, default_value=([&quot;Sub-Network Input #2&quot;]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
  24. hou_parm_template_group.append(hou_parm_template)
  25. # Code for parameter template
  26. hou_parm_template = hou.StringParmTemplate(&quot;label3&quot;, &quot;Input #3 Label&quot;, 1, default_value=([&quot;Sub-Network Input #3&quot;]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
  27. hou_parm_template_group.append(hou_parm_template)
  28. # Code for parameter template
  29. hou_parm_template = hou.StringParmTemplate(&quot;label4&quot;, &quot;Input #4 Label&quot;, 1, default_value=([&quot;Sub-Network Input #4&quot;]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
  30. hou_parm_template_group.append(hou_parm_template)
  31. # Code for parameter template
  32. hou_parm_template = hou.ButtonParmTemplate(&quot;resimulate&quot;, &quot;Reset Simulation&quot;)
  33. hou_parm_template.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;})
  34. hou_parm_template_group.append(hou_parm_template)
  35. # Code for parameter template
  36. hou_parm_template = hou.FolderParmTemplate(&quot;folder0&quot;, &quot;Fast ADMM Parameters&quot;, folder_type=hou.folderType.Simple, default_value=0, ends_tab_group=False)
  37. hou_parm_template.setTags({&quot;group_type&quot;: &quot;simple&quot;})
  38. # Code for parameter template
  39. hou_parm_template2 = hou.FloatParmTemplate(&quot;tau&quot;, &quot;time step (tau)&quot;, 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)
  40. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  41. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  42. hou_parm_template.addParmTemplate(hou_parm_template2)
  43. # Code for parameter template
  44. hou_parm_template2 = hou.FloatParmTemplate(&quot;c_threshold&quot;, &quot;threshold (c_threshold)&quot;, 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)
  45. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  46. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  47. hou_parm_template.addParmTemplate(hou_parm_template2)
  48. hou_parm_template_group.append(hou_parm_template)
  49. # Code for parameter template
  50. hou_parm_template = hou.FolderParmTemplate(&quot;folder1&quot;, &quot;Pointers to Volumes&quot;, folder_type=hou.folderType.Simple, default_value=0, ends_tab_group=False)
  51. hou_parm_template.setTags({&quot;group_type&quot;: &quot;simple&quot;})
  52. # Code for parameter template
  53. hou_parm_template2 = hou.IntParmTemplate(&quot;rhs&quot;, &quot;RHS&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  54. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  55. hou_parm_template2.setTags({&quot;script_callback_language&quot;: &quot;python&quot;})
  56. hou_parm_template.addParmTemplate(hou_parm_template2)
  57. # Code for parameter template
  58. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_eta0&quot;, &quot;eta0&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  59. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  60. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  61. hou_parm_template.addParmTemplate(hou_parm_template2)
  62. # Code for parameter template
  63. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_eta&quot;, &quot;eta&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  64. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  65. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  66. hou_parm_template.addParmTemplate(hou_parm_template2)
  67. # Code for parameter template
  68. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_phi&quot;, &quot;phi&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  69. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  70. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  71. hou_parm_template.addParmTemplate(hou_parm_template2)
  72. # Code for parameter template
  73. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_X&quot;, &quot;X&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  74. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  75. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  76. hou_parm_template.addParmTemplate(hou_parm_template2)
  77. # Code for parameter template
  78. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_Xhat&quot;, &quot;Xhat&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  79. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  80. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  81. hou_parm_template.addParmTemplate(hou_parm_template2)
  82. # Code for parameter template
  83. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_Xprev&quot;, &quot;Xprev&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  84. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  85. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  86. hou_parm_template.addParmTemplate(hou_parm_template2)
  87. # Code for parameter template
  88. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_lambda&quot;, &quot;lambda&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  89. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  90. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  91. hou_parm_template.addParmTemplate(hou_parm_template2)
  92. # Code for parameter template
  93. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_lambdahat&quot;, &quot;lambdahat&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  94. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  95. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  96. hou_parm_template.addParmTemplate(hou_parm_template2)
  97. # Code for parameter template
  98. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_lambdaprev&quot;, &quot;lambdaprev&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  99. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  100. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  101. hou_parm_template.addParmTemplate(hou_parm_template2)
  102. # Code for parameter template
  103. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_Y&quot;, &quot;Y&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  104. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  105. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  106. hou_parm_template.addParmTemplate(hou_parm_template2)
  107. # Code for parameter template
  108. hou_parm_template2 = hou.IntParmTemplate(&quot;ind_summand&quot;, &quot;summand&quot;, 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=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal, menu_use_token=False)
  109. hou_parm_template2.setScriptCallbackLanguage(hou.scriptLanguage.Python)
  110. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;script_callback_language&quot;: &quot;python&quot;})
  111. hou_parm_template.addParmTemplate(hou_parm_template2)
  112. hou_parm_template_group.append(hou_parm_template)
  113. # Code for parameter template
  114. hou_parm_template = hou.FolderParmTemplate(&quot;folder2&quot;, &quot;Paths to Cached Matrices&quot;, folder_type=hou.folderType.Simple, default_value=0, ends_tab_group=False)
  115. hou_parm_template.setTags({&quot;group_type&quot;: &quot;simple&quot;})
  116. # Code for parameter template
  117. hou_parm_template2 = hou.StringParmTemplate(&quot;path_laplacian&quot;, &quot;DVEC Laplacian&quot;, 1, default_value=([&quot;../vdec_laplacian1/&quot;]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.NodeReference, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
  118. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;oprelative&quot;: &quot;.&quot;})
  119. hou_parm_template.addParmTemplate(hou_parm_template2)
  120. # Code for parameter template
  121. hou_parm_template2 = hou.StringParmTemplate(&quot;path_sharp&quot;, &quot;DVEC Sharp Matrix&quot;, 1, default_value=([&quot;../vdec_sharp_matrix1/&quot;]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.NodeReference, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
  122. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;oprelative&quot;: &quot;.&quot;})
  123. hou_parm_template.addParmTemplate(hou_parm_template2)
  124. # Code for parameter template
  125. hou_parm_template2 = hou.StringParmTemplate(&quot;path_system_matrix&quot;, &quot;MINCURR System Matrix&quot;, 1, default_value=([&quot;../mincurr_system_matrix1/&quot;]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.NodeReference, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script=&quot;&quot;, item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
  126. hou_parm_template2.setTags({&quot;autoscope&quot;: &quot;0000000000000000&quot;, &quot;oprelative&quot;: &quot;.&quot;})
  127. hou_parm_template.addParmTemplate(hou_parm_template2)
  128. hou_parm_template_group.append(hou_parm_template)
  129. hou_node.setParmTemplateGroup(hou_parm_template_group)
  130. # Code for /obj/Minimal_Current/mincurr_FFT_solver/label1 parm
  131. if locals().get(&quot;hou_node&quot;) is None:
  132. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  133. hou_parm = hou_node.parm(&quot;label1&quot;)
  134. hou_parm.lock(False)
  135. hou_parm.deleteAllKeyframes()
  136. hou_parm.set(&quot;Sub-Network Input #1&quot;)
  137. hou_parm.setAutoscope(False)
  138. # Code for /obj/Minimal_Current/mincurr_FFT_solver/label2 parm
  139. if locals().get(&quot;hou_node&quot;) is None:
  140. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  141. hou_parm = hou_node.parm(&quot;label2&quot;)
  142. hou_parm.lock(False)
  143. hou_parm.deleteAllKeyframes()
  144. hou_parm.set(&quot;Sub-Network Input #2&quot;)
  145. hou_parm.setAutoscope(False)
  146. # Code for /obj/Minimal_Current/mincurr_FFT_solver/label3 parm
  147. if locals().get(&quot;hou_node&quot;) is None:
  148. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  149. hou_parm = hou_node.parm(&quot;label3&quot;)
  150. hou_parm.lock(False)
  151. hou_parm.deleteAllKeyframes()
  152. hou_parm.set(&quot;Sub-Network Input #3&quot;)
  153. hou_parm.setAutoscope(False)
  154. # Code for /obj/Minimal_Current/mincurr_FFT_solver/label4 parm
  155. if locals().get(&quot;hou_node&quot;) is None:
  156. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  157. hou_parm = hou_node.parm(&quot;label4&quot;)
  158. hou_parm.lock(False)
  159. hou_parm.deleteAllKeyframes()
  160. hou_parm.set(&quot;Sub-Network Input #4&quot;)
  161. hou_parm.setAutoscope(False)
  162. # Code for /obj/Minimal_Current/mincurr_FFT_solver/resimulate parm
  163. if locals().get(&quot;hou_node&quot;) is None:
  164. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  165. hou_parm = hou_node.parm(&quot;resimulate&quot;)
  166. hou_parm.lock(False)
  167. hou_parm.deleteAllKeyframes()
  168. hou_parm.set(&quot;0&quot;)
  169. hou_parm.setAutoscope(False)
  170. # Code for /obj/Minimal_Current/mincurr_FFT_solver/folder0 parm
  171. if locals().get(&quot;hou_node&quot;) is None:
  172. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  173. hou_parm = hou_node.parm(&quot;folder0&quot;)
  174. hou_parm.lock(False)
  175. hou_parm.deleteAllKeyframes()
  176. hou_parm.set(0)
  177. hou_parm.setAutoscope(False)
  178. # Code for /obj/Minimal_Current/mincurr_FFT_solver/tau parm
  179. if locals().get(&quot;hou_node&quot;) is None:
  180. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  181. hou_parm = hou_node.parm(&quot;tau&quot;)
  182. hou_parm.lock(False)
  183. hou_parm.deleteAllKeyframes()
  184. hou_parm.set(0.040000000000000001)
  185. hou_parm.setAutoscope(False)
  186. # Code for /obj/Minimal_Current/mincurr_FFT_solver/c_threshold parm
  187. if locals().get(&quot;hou_node&quot;) is None:
  188. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  189. hou_parm = hou_node.parm(&quot;c_threshold&quot;)
  190. hou_parm.lock(False)
  191. hou_parm.deleteAllKeyframes()
  192. hou_parm.set(0.5)
  193. hou_parm.setAutoscope(False)
  194. # Code for /obj/Minimal_Current/mincurr_FFT_solver/folder1 parm
  195. if locals().get(&quot;hou_node&quot;) is None:
  196. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  197. hou_parm = hou_node.parm(&quot;folder1&quot;)
  198. hou_parm.lock(False)
  199. hou_parm.deleteAllKeyframes()
  200. hou_parm.set(0)
  201. hou_parm.setAutoscope(False)
  202. # Code for /obj/Minimal_Current/mincurr_FFT_solver/rhs parm
  203. if locals().get(&quot;hou_node&quot;) is None:
  204. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  205. hou_parm = hou_node.parm(&quot;rhs&quot;)
  206. hou_parm.lock(False)
  207. hou_parm.deleteAllKeyframes()
  208. hou_parm.set(32)
  209. hou_parm.setAutoscope(False)
  210. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_eta0 parm
  211. if locals().get(&quot;hou_node&quot;) is None:
  212. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  213. hou_parm = hou_node.parm(&quot;ind_eta0&quot;)
  214. hou_parm.lock(False)
  215. hou_parm.deleteAllKeyframes()
  216. hou_parm.set(2)
  217. hou_parm.setAutoscope(False)
  218. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_eta parm
  219. if locals().get(&quot;hou_node&quot;) is None:
  220. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  221. hou_parm = hou_node.parm(&quot;ind_eta&quot;)
  222. hou_parm.lock(False)
  223. hou_parm.deleteAllKeyframes()
  224. hou_parm.set(5)
  225. hou_parm.setAutoscope(False)
  226. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_phi parm
  227. if locals().get(&quot;hou_node&quot;) is None:
  228. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  229. hou_parm = hou_node.parm(&quot;ind_phi&quot;)
  230. hou_parm.lock(False)
  231. hou_parm.deleteAllKeyframes()
  232. hou_parm.set(9)
  233. hou_parm.setAutoscope(False)
  234. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_X parm
  235. if locals().get(&quot;hou_node&quot;) is None:
  236. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  237. hou_parm = hou_node.parm(&quot;ind_X&quot;)
  238. hou_parm.lock(False)
  239. hou_parm.deleteAllKeyframes()
  240. hou_parm.set(10)
  241. hou_parm.setAutoscope(False)
  242. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_Xhat parm
  243. if locals().get(&quot;hou_node&quot;) is None:
  244. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  245. hou_parm = hou_node.parm(&quot;ind_Xhat&quot;)
  246. hou_parm.lock(False)
  247. hou_parm.deleteAllKeyframes()
  248. hou_parm.set(13)
  249. hou_parm.setAutoscope(False)
  250. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_Xprev parm
  251. if locals().get(&quot;hou_node&quot;) is None:
  252. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  253. hou_parm = hou_node.parm(&quot;ind_Xprev&quot;)
  254. hou_parm.lock(False)
  255. hou_parm.deleteAllKeyframes()
  256. hou_parm.set(16)
  257. hou_parm.setAutoscope(False)
  258. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_lambda parm
  259. if locals().get(&quot;hou_node&quot;) is None:
  260. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  261. hou_parm = hou_node.parm(&quot;ind_lambda&quot;)
  262. hou_parm.lock(False)
  263. hou_parm.deleteAllKeyframes()
  264. hou_parm.set(19)
  265. hou_parm.setAutoscope(False)
  266. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_lambdahat parm
  267. if locals().get(&quot;hou_node&quot;) is None:
  268. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  269. hou_parm = hou_node.parm(&quot;ind_lambdahat&quot;)
  270. hou_parm.lock(False)
  271. hou_parm.deleteAllKeyframes()
  272. hou_parm.set(22)
  273. hou_parm.setAutoscope(False)
  274. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_lambdaprev parm
  275. if locals().get(&quot;hou_node&quot;) is None:
  276. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  277. hou_parm = hou_node.parm(&quot;ind_lambdaprev&quot;)
  278. hou_parm.lock(False)
  279. hou_parm.deleteAllKeyframes()
  280. hou_parm.set(25)
  281. hou_parm.setAutoscope(False)
  282. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_Y parm
  283. if locals().get(&quot;hou_node&quot;) is None:
  284. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  285. hou_parm = hou_node.parm(&quot;ind_Y&quot;)
  286. hou_parm.lock(False)
  287. hou_parm.deleteAllKeyframes()
  288. hou_parm.set(28)
  289. hou_parm.setAutoscope(False)
  290. # Code for /obj/Minimal_Current/mincurr_FFT_solver/ind_summand parm
  291. if locals().get(&quot;hou_node&quot;) is None:
  292. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  293. hou_parm = hou_node.parm(&quot;ind_summand&quot;)
  294. hou_parm.lock(False)
  295. hou_parm.deleteAllKeyframes()
  296. hou_parm.set(31)
  297. hou_parm.setAutoscope(False)
  298. # Code for /obj/Minimal_Current/mincurr_FFT_solver/folder2 parm
  299. if locals().get(&quot;hou_node&quot;) is None:
  300. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  301. hou_parm = hou_node.parm(&quot;folder2&quot;)
  302. hou_parm.lock(False)
  303. hou_parm.deleteAllKeyframes()
  304. hou_parm.set(0)
  305. hou_parm.setAutoscope(False)
  306. # Code for /obj/Minimal_Current/mincurr_FFT_solver/path_laplacian parm
  307. if locals().get(&quot;hou_node&quot;) is None:
  308. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  309. hou_parm = hou_node.parm(&quot;path_laplacian&quot;)
  310. hou_parm.lock(False)
  311. hou_parm.deleteAllKeyframes()
  312. hou_parm.set(&quot;../vdec_laplacian1/&quot;)
  313. hou_parm.setAutoscope(False)
  314. # Code for /obj/Minimal_Current/mincurr_FFT_solver/path_sharp parm
  315. if locals().get(&quot;hou_node&quot;) is None:
  316. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  317. hou_parm = hou_node.parm(&quot;path_sharp&quot;)
  318. hou_parm.lock(False)
  319. hou_parm.deleteAllKeyframes()
  320. hou_parm.set(&quot;../vdec_sharp_matrix1/&quot;)
  321. hou_parm.setAutoscope(False)
  322. # Code for /obj/Minimal_Current/mincurr_FFT_solver/path_system_matrix parm
  323. if locals().get(&quot;hou_node&quot;) is None:
  324. hou_node = hou.node(&quot;/obj/Minimal_Current/mincurr_FFT_solver&quot;)
  325. hou_parm = hou_node.parm(&quot;path_system_matrix&quot;)
  326. hou_parm.lock(False)
  327. hou_parm.deleteAllKeyframes()
  328. hou_parm.set(&quot;../mincurr_system_matrix1/&quot;)
  329. hou_parm.setAutoscope(False)
  330. hou_node.setExpressionLanguage(hou.exprLanguage.Hscript)
  331. # Code to establish connections for /obj/Minimal_Current/mincurr_FFT_solver
  332. hou_node = hou_parent.node(&quot;mincurr_FFT_solver&quot;)
  333. if hou_parent.node(&quot;mincurr_FFT_initialize&quot;) is not None:
  334. hou_node.setInput(0, hou_parent.node(&quot;mincurr_FFT_initialize&quot;), 0)
  335. hou_node.setUserData(&quot;___Version___&quot;, &quot;19.5.465&quot;)
  336. if hasattr(hou_node, &quot;syncNodeVersionIfNeeded&quot;):
  337. hou_node.syncNodeVersionIfNeeded(&quot;19.5.465&quot;)

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

huangapple
  • 本文由 发表于 2023年2月27日 18:46:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75579454.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定