├── toolbar ├── shelf_tool_assets.json ├── wf_selection.shelf ├── wf_rigging.shelf ├── wf_network_layout.shelf ├── wf__set.shelf ├── wf_utils.shelf ├── wf_chaneditor.shelf ├── wf_hotkeys_job.shelf ├── wf_job.shelf ├── wf_network_kwargs.shelf ├── wf_render.shelf ├── wf_ui_panetab.shelf ├── wf_network_connection.shelf ├── wf_timeline.shelf ├── wf_network_ui.shelf ├── wf_network_parm.shelf ├── wf_hotkeys.shelf └── wf_sceneview.shelf ├── python3.11libs ├── wf_job_archetype_cam.py ├── wf_hotkeys_del.py ├── wf_os.py ├── wf_hda.py ├── wf_node.py ├── wf_job_archetype_data.py ├── ____variables.py ├── wf_job_backup.py ├── wf_chaneditor.py ├── wf_rigging.py ├── wf_selection.py ├── wf_network_kwargs.py ├── __backup │ └── wf_render.py - v00 abandoned two sceneviews ├── wf_hotkeys.py ├── wf_gltf.py ├── wf_network_connection.py ├── wf_network_layout.py ├── wf_hotkeys_enter.py ├── wf_job_archetype_network.py ├── wf_render.py └── wf_ui_panetab.py ├── .gitignore ├── otls ├── menuexample.hda ├── qs_chop.hdalc ├── qstorage.hdalc ├── yoga_pose.hdalc ├── _tests │ ├── DEL.hdalc │ ├── test name.hdalc │ ├── HandleTest2.hdalc │ ├── test name 1.hdalc │ ├── test two out.hdalc │ ├── test twoway.hdalc │ ├── test multi in.hdalc │ ├── test realtimee.hdalc │ ├── test relative.hdalc │ └── test subnet more.hdalc ├── ikn_qrender.hdalc ├── qenable_lop.hdalc ├── qmusic_note.hdalc ├── qmusic_span.hdalc ├── qmusic_barplan.hdalc ├── fbx_import_merge.hdalc ├── qmusic_generator.hdalc ├── qmusic_read_area.hdalc ├── qmusic_spectrum.hdalc ├── __multiparm_spare.hdalc ├── karma_library_lop.hdalc ├── karma_library_mat.hdalc ├── kw_edge_maze_v0.2.hdalc ├── q_curve_roll_spiral.hdalc ├── qmusic_read_impact.hdalc ├── q_rig_symmetry_mirror.hdalc ├── q_rop_packed_sequence.hdalc ├── qmusic_note_repeater.hdalc ├── wf_archetype_job_cam.hdalc ├── wf_gltf_export_points.hdalc ├── _xt cam transform │ ├── xt_trs.hdalc │ ├── xt_init.hdalc │ ├── xt_rivet.hdalc │ ├── xt_cam_path.hdalc │ ├── xt_dim_basis.hdalc │ ├── xt_cam_path_point.hdalc │ └── xt_xform_dimensions.hdalc ├── qmusic_bargrid_synthetic.hdalc ├── wf_archetype_job_karma.hdalc ├── wf_archetype_job_cam_focus.hdalc ├── wf_archetype_job_geo_data.hdalc ├── _abandoned │ └── karma_dof_preview.hdalc ├── wf_archetype_job_geo_network.hdalc └── _naming.py ├── vex └── include │ ├── snippets.db │ ├── triggers.db │ └── helpcard.txt ├── vex_src ├── _db │ ├── tab_vex_nodenames.db │ ├── tab_vex_snippets.db │ ├── tab_vex_toolnames.db │ ├── tab_vex_sourcefiles.db │ └── tab_vex_sourcelines.db ├── snippets │ ├── color.vfl │ ├── polysplit xyzdist locations.vfl │ ├── padzero.vfl │ ├── extend_polyline.vfl │ └── group.vfl ├── dim_coord_fill │ ├── fill.vfl │ ├── distort.vfl │ ├── matrix.vfl │ ├── fit.vfl │ ├── dimension.vfl │ ├── materials.vfl │ ├── noise.vfl │ ├── range.vfl │ └── time_snap.vfl ├── docs │ ├── docs_strings.vfl │ ├── docs_array.vfl │ ├── docs_volume.vfl │ ├── docs_loops.vfl │ ├── docs_interpolation.vfl │ ├── docs_math.vfl │ ├── docs_intrinsic.vfl │ ├── docs_geometry.vfl │ ├── docs_measure.vfl │ ├── docs_attribute.vfl │ ├── docs_pointclouds.vfl │ ├── docs_table.vfl │ └── docs_transforms.vfl ├── apatheia │ └── xe.vfl ├── tools │ ├── extract axis from orient.vfl │ ├── angle between vectors.vfl │ ├── eps_open.vfl │ ├── retime sequence loop ping.vfl │ ├── vector quantize.vfl │ ├── vector randomize.vfl │ ├── angle between edges, detect corners.vfl │ └── slideframe.vfl ├── karma │ └── karma.vfl └── uber │ └── geo_carve_line.vfl ├── wf_workflow.json ├── scripts ├── 456.py └── _backup │ ├── also no 456.py │ └── no 456.py ├── README.md └── PARMmenu.xml /toolbar/shelf_tool_assets.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /python3.11libs/wf_job_archetype_cam.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | backup/ 3 | backup history/ 4 | temp/__archetype.temp 5 | -------------------------------------------------------------------------------- /otls/menuexample.hda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/menuexample.hda -------------------------------------------------------------------------------- /otls/qs_chop.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qs_chop.hdalc -------------------------------------------------------------------------------- /otls/qstorage.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qstorage.hdalc -------------------------------------------------------------------------------- /otls/yoga_pose.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/yoga_pose.hdalc -------------------------------------------------------------------------------- /otls/_tests/DEL.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/DEL.hdalc -------------------------------------------------------------------------------- /otls/ikn_qrender.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/ikn_qrender.hdalc -------------------------------------------------------------------------------- /otls/qenable_lop.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qenable_lop.hdalc -------------------------------------------------------------------------------- /otls/qmusic_note.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_note.hdalc -------------------------------------------------------------------------------- /otls/qmusic_span.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_span.hdalc -------------------------------------------------------------------------------- /otls/qmusic_barplan.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_barplan.hdalc -------------------------------------------------------------------------------- /vex/include/snippets.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/vex/include/snippets.db -------------------------------------------------------------------------------- /vex/include/triggers.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/vex/include/triggers.db -------------------------------------------------------------------------------- /otls/_tests/test name.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test name.hdalc -------------------------------------------------------------------------------- /otls/fbx_import_merge.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/fbx_import_merge.hdalc -------------------------------------------------------------------------------- /otls/qmusic_generator.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_generator.hdalc -------------------------------------------------------------------------------- /otls/qmusic_read_area.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_read_area.hdalc -------------------------------------------------------------------------------- /otls/qmusic_spectrum.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_spectrum.hdalc -------------------------------------------------------------------------------- /otls/__multiparm_spare.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/__multiparm_spare.hdalc -------------------------------------------------------------------------------- /otls/_tests/HandleTest2.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/HandleTest2.hdalc -------------------------------------------------------------------------------- /otls/_tests/test name 1.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test name 1.hdalc -------------------------------------------------------------------------------- /otls/_tests/test two out.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test two out.hdalc -------------------------------------------------------------------------------- /otls/_tests/test twoway.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test twoway.hdalc -------------------------------------------------------------------------------- /otls/karma_library_lop.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/karma_library_lop.hdalc -------------------------------------------------------------------------------- /otls/karma_library_mat.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/karma_library_mat.hdalc -------------------------------------------------------------------------------- /otls/kw_edge_maze_v0.2.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/kw_edge_maze_v0.2.hdalc -------------------------------------------------------------------------------- /otls/q_curve_roll_spiral.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/q_curve_roll_spiral.hdalc -------------------------------------------------------------------------------- /otls/qmusic_read_impact.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_read_impact.hdalc -------------------------------------------------------------------------------- /otls/_tests/test multi in.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test multi in.hdalc -------------------------------------------------------------------------------- /otls/_tests/test realtimee.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test realtimee.hdalc -------------------------------------------------------------------------------- /otls/_tests/test relative.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test relative.hdalc -------------------------------------------------------------------------------- /otls/q_rig_symmetry_mirror.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/q_rig_symmetry_mirror.hdalc -------------------------------------------------------------------------------- /otls/q_rop_packed_sequence.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/q_rop_packed_sequence.hdalc -------------------------------------------------------------------------------- /otls/qmusic_note_repeater.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_note_repeater.hdalc -------------------------------------------------------------------------------- /otls/wf_archetype_job_cam.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/wf_archetype_job_cam.hdalc -------------------------------------------------------------------------------- /otls/wf_gltf_export_points.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/wf_gltf_export_points.hdalc -------------------------------------------------------------------------------- /vex_src/_db/tab_vex_nodenames.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/vex_src/_db/tab_vex_nodenames.db -------------------------------------------------------------------------------- /vex_src/_db/tab_vex_snippets.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/vex_src/_db/tab_vex_snippets.db -------------------------------------------------------------------------------- /vex_src/_db/tab_vex_toolnames.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/vex_src/_db/tab_vex_toolnames.db -------------------------------------------------------------------------------- /otls/_tests/test subnet more.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_tests/test subnet more.hdalc -------------------------------------------------------------------------------- /otls/_xt cam transform/xt_trs.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_xt cam transform/xt_trs.hdalc -------------------------------------------------------------------------------- /otls/qmusic_bargrid_synthetic.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/qmusic_bargrid_synthetic.hdalc -------------------------------------------------------------------------------- /otls/wf_archetype_job_karma.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/wf_archetype_job_karma.hdalc -------------------------------------------------------------------------------- /vex_src/_db/tab_vex_sourcefiles.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/vex_src/_db/tab_vex_sourcefiles.db -------------------------------------------------------------------------------- /vex_src/_db/tab_vex_sourcelines.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/vex_src/_db/tab_vex_sourcelines.db -------------------------------------------------------------------------------- /otls/_xt cam transform/xt_init.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_xt cam transform/xt_init.hdalc -------------------------------------------------------------------------------- /otls/_xt cam transform/xt_rivet.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_xt cam transform/xt_rivet.hdalc -------------------------------------------------------------------------------- /otls/wf_archetype_job_cam_focus.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/wf_archetype_job_cam_focus.hdalc -------------------------------------------------------------------------------- /otls/wf_archetype_job_geo_data.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/wf_archetype_job_geo_data.hdalc -------------------------------------------------------------------------------- /otls/_abandoned/karma_dof_preview.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_abandoned/karma_dof_preview.hdalc -------------------------------------------------------------------------------- /otls/_xt cam transform/xt_cam_path.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_xt cam transform/xt_cam_path.hdalc -------------------------------------------------------------------------------- /otls/wf_archetype_job_geo_network.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/wf_archetype_job_geo_network.hdalc -------------------------------------------------------------------------------- /otls/_xt cam transform/xt_dim_basis.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_xt cam transform/xt_dim_basis.hdalc -------------------------------------------------------------------------------- /otls/_xt cam transform/xt_cam_path_point.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_xt cam transform/xt_cam_path_point.hdalc -------------------------------------------------------------------------------- /otls/_xt cam transform/xt_xform_dimensions.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lex-ikoon/qq/HEAD/otls/_xt cam transform/xt_xform_dimensions.hdalc -------------------------------------------------------------------------------- /wf_workflow.json: -------------------------------------------------------------------------------- 1 | { 2 | "path": "Q:/path_to/wf_workflow", 3 | "env": [ 4 | {"wf_path": "Q:/path_to/wf_workflow"}, 5 | {"wf_editor": "C:/path_to_editor/Microsoft VS Code/Code.exe"} 6 | ] 7 | } -------------------------------------------------------------------------------- /python3.11libs/wf_hotkeys_del.py: -------------------------------------------------------------------------------- 1 | 2 | Ctrl + Del 3 | light = disable 4 | data = filecache 5 | sop = bypass 6 | 7 | Ctrl + Shift + Del 8 | data = sprites 9 | sop = 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /python3.11libs/wf_os.py: -------------------------------------------------------------------------------- 1 | import os 2 | import hou 3 | 4 | def hip_parent () : 5 | # temp_path = hou.text.expandString('$HIP') 6 | # NOT NEEDED because 7 | # $HIP/../RENDER 8 | pass 9 | 10 | def job_parent () : 11 | pass 12 | -------------------------------------------------------------------------------- /scripts/456.py: -------------------------------------------------------------------------------- 1 | import hou 2 | 3 | if hou.isUIAvailable() == True: 4 | import hdefereval 5 | import wf_ui_panetab 6 | 7 | # executeDeferred, because we have to wait for the UI 8 | hdefereval.executeDeferred(lambda: wf_ui_panetab.panetab_restore(True, False)) -------------------------------------------------------------------------------- /otls/_naming.py: -------------------------------------------------------------------------------- 1 | Name : qmusic::bargrid_synthetic::1.0 2 | Label : qmusic bargrid synthetic 3 | Library : qmusic_bargrid_synthetic.hdalc 4 | 5 | 6 | Name : wf::archetype_job_geo_data::1.0 7 | Label : wf_archetype_job_geo_data 8 | Library : wf_archetype_job_geo_data.hdalc 9 | 10 | 11 | 12 | wf_archetype_job_cam -------------------------------------------------------------------------------- /vex_src/snippets/color.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// color randomize hue hsv 3 | vector hsvtorgb(float hue, float sat, float val) 4 | vector rgbtohsv(float h, float s, float v) 5 | 6 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /scripts/_backup/also no 456.py: -------------------------------------------------------------------------------- 1 | import hdefereval 2 | import wf_network_ui 3 | 4 | # def functionToExecuteOnStartup(): 5 | # wf_network_ui.panetab_restore(True) 6 | # hdefereval.executeDeferred(functionToExecuteOnStartup) 7 | 8 | hdefereval.executeDeferred(lambda: wf_network_ui.panetab_restore(True)) 9 | # hdefereval.executeDeferred(lambda: extract_hda(node) ) 10 | -------------------------------------------------------------------------------- /vex_src/snippets/polysplit xyzdist locations.vfl: -------------------------------------------------------------------------------- 1 | ///----------------------- 2 | /// polysplit xyzdist locations 3 | 4 | // make a string suitable for polysplit from the position of point 0 on input1 5 | // detail wrangle 6 | 7 | int hitprim; 8 | vector hituv; 9 | xyzdist(0, point(1, "P", 0), hitprim, hituv); 10 | s@loc_1 = sprintf("%df:%f,%f", hitprim, hituv.x, hituv.y); 11 | ///----------------------- -------------------------------------------------------------------------------- /toolbar/wf_selection.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/fill.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// fill to coord 3 | 4 | #include "qq.vfl" 5 | 6 | float dimension = @dim; 7 | // float coord = @coord; 8 | float coord = chf("coord"); // 0.5 in 0.0 to 1.0 9 | float spread = chf("spread"); // 0.5 in 0 to 1 10 | 11 | @fill = fill_to_coord(dimension, coord, spread); 12 | @Cd = @fill; -------------------------------------------------------------------------------- /vex_src/docs/docs_strings.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// strings - printf 3 | printf("@out = %f; ", f@out); // float 4 | printf("@out = %s; ", s@out); // string 5 | printf("@out = %d; ", i@out); // integer 6 | 7 | printf("%08.3g", velocity); // precision 8 | 9 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/snippets/padzero.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// padzero 3 | 4 | int padzero_size = chi("padzero_size"); // 5 in 1 to 6 5 | int padzero_value = i@index; 6 | string format = '%0' + itoa(size) + 'd'; 7 | 8 | string eval = sprintf(format, value) ; 9 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/apatheia/xe.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// 3 | // setgroup a_seed 4 | 5 | 6 | 7 | 8 | @force = volsample 9 | @lerp 10 | @ 11 | READ vec 12 | MOVE to pos 13 | DRAG 14 | 15 | @prev_pos = 16 | had_vel = 17 | 18 | 19 | vector force = volumesample(geometry, primnum, pos); 20 | float drag = 21 | float amount 22 | 23 | lerp(value1, value2, amount) 24 | @P = @P += -------------------------------------------------------------------------------- /vex_src/tools/extract axis from orient.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// extract axes from quaternion 3 | 4 | matrix3 m = qconvert(p@orient); 5 | 6 | vector xaxis = set(m.xx, m.xy, m.xz); 7 | vector yaxis = set(m.yx, m.yy, m.yz); 8 | vector zaxis = set(m.zx, m.zy, m.zz); 9 | 10 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/tools/angle between vectors.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// angle between vectors 3 | 4 | vector vecA = normalize(point(0, "P", 1) - point(0, "P", 0)); 5 | vector vecB = normalize(point(1, "P", 1) - point(1, "P", 0)); 6 | 7 | f@angle = degrees(acos(dot(normalize(vecA),normalize(vecB)))); 8 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/tools/eps_open.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// eps import curves 3 | // for each primitive: 4 | // - foreach_begin 5 | // - ends: Unroll with New Points 6 | // - this wrangle over points 7 | // - foreach_end 8 | 9 | 10 | int i = chi("i"); // 7 in 0 to 10 11 | 12 | if ( @ptnum > @numpt - i) 13 | { 14 | removepoint(0, @ptnum); 15 | } 16 | 17 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/karma/karma.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// karma - bind material 3 | // run over Primitives to process the @path attribute 4 | string material_name = chs("material_name"); 5 | s@usdmaterialpath = "/materials/" + material_name; 6 | s@path = "/geo/mat_" + material_name; 7 | 8 | // point attribute to reveal the "image_plane" AOV 9 | // @image_plane_mult = @fill; 10 | 11 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /python3.11libs/wf_hda.py: -------------------------------------------------------------------------------- 1 | # ------------------------- 2 | # contents of the wf_hda.py 3 | 4 | import hou 5 | import hdefereval 6 | 7 | def extract(node) : 8 | def extract_hda(hda_node) : 9 | label = "Extract HDA: " + str(hda_node.type().name()) 10 | with hou.undos.group(label): 11 | hda_node.extractAndDelete() 12 | 13 | hdefereval.executeDeferred(lambda: extract_hda(node) ) 14 | 15 | # ------------------------- 16 | # OnCreated scipt in the Type Properties: 17 | # import wf_hda 18 | # wf_hda.extract( kwargs["node"] ) 19 | 20 | 21 | 22 | 23 | 24 | # reload(wf_hda) -------------------------------------------------------------------------------- /python3.11libs/wf_node.py: -------------------------------------------------------------------------------- 1 | #import hou 2 | 3 | 4 | 5 | def lastDescendant (self) : 6 | 7 | while 8 | try : 9 | last_descendant = node.outputs()[0] 10 | except : 11 | last_descendant = node 12 | 13 | 14 | if last_descendant == node : 15 | return node 16 | else : 17 | return lastDescendant(last_descendant) 18 | 19 | 20 | hou.Node.lastDescendant() = lastDescendant() 21 | 22 | 23 | 24 | def func(my_list, z): 25 | 26 | if z == len(my_list): 27 | return something 28 | else: 29 | # do something else 30 | return func(my_list, z+1) -------------------------------------------------------------------------------- /scripts/_backup/no 456.py: -------------------------------------------------------------------------------- 1 | #import hou 2 | #hou.appendSessionModuleSource('''hou.hscript("autosave on")''') 3 | 4 | desktops_dict = dict((d.name(), d) for d in hou.ui.desktops()) 5 | desktops_dict['IKOON_1_left_bottom'].setAsCurrent() 6 | desktops_dict['IKOON_4_left_top'].setAsCurrent() 7 | desktops_dict['IKOON_5_center'].setAsCurrent() 8 | desktops_dict['IKOON_6_right'].setAsCurrent() 9 | ## and this will be actual: 10 | #desktops_dict['test'].setAsCurrent() 11 | 12 | 13 | #hou.ui.desktop("test").findPaneTab("panetab7").pane().setSplitFraction(0.5) 14 | #hou.ui.desktop("test").findPaneTab("panetab7").pane().setIsSplitMaximized(True) 15 | 16 | #print "ok" -------------------------------------------------------------------------------- /vex_src/docs/docs_array.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// array - append 3 | float array[] = {}; 4 | append(array, value); 5 | 6 | 7 | ///------------------------------------------------------------------------------------------------ 8 | /// array - argsort reorder 9 | int indices[] = argsort(array); 10 | int ordered[] = reorder(array, indices); 11 | 12 | ///------------------------------------------------------------------------------------------------ 13 | /// array - resize 14 | f[]@array; 15 | resize(@array, len); 16 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/docs/docs_volume.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// volume gradient 3 | vector gradient = volumegradient(0, primnum, @P); 4 | vector gradient = volumegradient(0, "name", @P); 5 | 6 | ///------------------------------------------------------------------------------------------------ 7 | /// volume sample 8 | float sample = volumesample(0, primnum, @P); 9 | float sample = volumesample(0, "name", @P); 10 | 11 | ///------------------------------------------------------------------------------------------------ 12 | /// volume samplev 13 | float samplev = volumesamplev(0, primnum, @P); 14 | float samplev = volumesamplev(0, "name", @P); 15 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /toolbar/wf_rigging.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | OBJ 15 | 16 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /vex_src/docs/docs_loops.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// for 3 | int count; 4 | for (int i = 0; i < count; i++) 5 | { 6 | 7 | } 8 | 9 | ///------------------------------------------------------------------------------------------------ 10 | /// for each 11 | int array[] = neighbours(0, @ptnum); 12 | 13 | foreach (int num; array) { 14 | { 15 | printf("%d", num); 16 | } 17 | 18 | ///------------------------------------------------------------------------------------------------ 19 | /// for each enumerated 20 | 21 | string days[] = { "Mon", "Tue", "Wed", "Thu", "Fri" } 22 | foreach (int i; string name; days) { 23 | printf("Day number %d is %s", i, name); 24 | } 25 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/tools/retime sequence loop ping.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// retime sequence loop ping 3 | 4 | float current_frame = @Frame; 5 | float zero_at_frame = 0; 6 | float seq_length = 100; // 1 to get dimension 01 7 | float speed = 1; // -1 to before 8 | 9 | float seq_length_retimed = seq_length * speed; 10 | float relative_range = (current_frame - zero_at_frame) / seq_length_retimed; 11 | 12 | relative_range = clamp(relative_range, 0, 1); // once 13 | relative_range = relative_range % 1; // loop 14 | relative_range = 1 - abs (relative_range % 2 - 1); // ping 15 | 16 | float value = relative_range * seq_length; 17 | 18 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /python3.11libs/wf_job_archetype_data.py: -------------------------------------------------------------------------------- 1 | import hou 2 | 3 | 4 | def job_data_update_range_descriptiveparm (node) : 5 | # callback script: 6 | # import wf_job_archetype_data ; node = kwargs["node"] ; wf_job_archetype_data.job_data_update_range_descriptiveparm(node) 7 | if node.parm("job_range_single_file").eval() == 1: 8 | description = "- " + node.parm( "job_rangex").evalAsString() + " -" 9 | else : 10 | description = node.parm( "job_rangex").evalAsString() + " - " + node.parm("job_rangey").evalAsString() 11 | node.parm("job_range_descriptiveparm").set(description) 12 | 13 | 14 | def job_data_rename(node) : 15 | print ("rename") 16 | # callback script: 17 | # import wf_job_archetype_data ; node = kwargs["node"] ; wf_job_archetype_data.job_data_rename(node) 18 | 19 | # geo_data 20 | # o_merged null 21 | # rs_rop 22 | # gl_rop 23 | pass 24 | -------------------------------------------------------------------------------- /python3.11libs/____variables.py: -------------------------------------------------------------------------------- 1 | wf_network_archetype 2 | temp_path = hou.expandString("$HOUDINI_TEMP_DIR") + "/__archetype.temp" 3 | 4 | 5 | 6 | wf_network_ui 7 | # path_shortcuts = hou.getenv("HOUDINI_UBER_PATH") + "/vex/include/triggers.db" 8 | # path_snippets = hou.getenv("HOUDINI_UBER_PATH") + "/vex/include/snippets.db" 9 | 10 | # path_VEX = hou.getenv("HOUDINI_UBER_PATH") + "/vex/include/" 11 | 12 | 13 | 14 | wf_network_ui_parse_tab 15 | #editor = "C:\Users\info\AppData\Local\Programs\Microsoft VS Code\Code.exe" 16 | #path_VEX_db = hou.getenv("HOUDINI_UBER_PATH") + "/vex/include/tab_db/" 17 | # path_VEX_db = hou.getenv("HOUDINI_UBER_PATH") + "/vex/include/tab_db/" 18 | # path_VEX_db = hou.getenv("HOUDINI_UBER_PATH") + "/vex/include/tab_db/" 19 | # path_VEX_vfl = hou.getenv("HOUDINI_UBER_PATH") + "/vex/include/tab_vfl/" 20 | 21 | 22 | wf_utils 23 | -------------------------------------------------------------------------------- /vex_src/tools/vector quantize.vfl: -------------------------------------------------------------------------------- 1 | /// vector quantize 2 | 3 | vector pos = @P; 4 | vector noise = curlnoise(pos*scale); 5 | vector quant = {0,0,0}; 6 | 7 | float amount = chf("amount"); // 1 in 0 to 1 8 | 9 | 10 | vec = vec_dir_quantize(); 11 | 12 | 13 | vector vec_dir_quantize(vector orig ) 14 | { 15 | 16 | 17 | int reference_geo = 1; 18 | // vec_prim = 0; 19 | // vec_total = primvertexcount(reference_geo, vec_prim); 20 | vector quant = {0,0,0}; 21 | 22 | int count = 3; 23 | 24 | for (int i = 0; i < count; i++) 25 | { 26 | vector quant_dir = normalize( point(reference_geo,"P",i) ) ; 27 | 28 | float quant_add; 29 | quant_add = dot ( normalize(orig) , quant_dir ); 30 | quant_add = rint (quant_add) ; 31 | 32 | quant += quant_add * quant_dir; 33 | } 34 | 35 | quant = length(orig) * normalize( quant ); 36 | return quant; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /vex/include/helpcard.txt: -------------------------------------------------------------------------------- 1 | ---------------- 2 | preview 3 | clamp01 4 | ftoa 5 | padzero 6 | blend 7 | euler_from_quat 8 | quat_from_zy 9 | ---------------- 10 | range_random 11 | ---------------- 12 | distort_bias 13 | distort_bias_mirrored 14 | distort_segment 15 | ---------------- 16 | coord_music 17 | ---------------- 18 | fill_to_coord 19 | ---------------- 20 | geo_line_u 21 | geo_carve_point 22 | geo_carve_line 23 | ---------------- 24 | mat_over 25 | ---------------- 26 | noise_vstat 27 | noise_vanim_curl 28 | noise_vanim 29 | noise_fstat 30 | noise_fanim_uv 31 | noise_vanim_uv 32 | vec_len_fit01 33 | ---------------- 34 | for 35 | if 36 | ---------------- 37 | pt 38 | vert 39 | prim 40 | det 41 | ---------------- 42 | setpt 43 | setvert 44 | setprim 45 | setdet 46 | ---------------- 47 | rempt 48 | remprim 49 | addpt 50 | addprim 51 | ---------------- 52 | rbx 53 | pow 54 | nup 55 | ---------------- 56 | inc 57 | ---------------- 58 | -------------------------------------------------------------------------------- /vex_src/tools/vector randomize.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// vector randomize direction and length 3 | 4 | float amount = chf("amount"); // 1 in 0 to 1 5 | vec = vec_dir_randomize(vec, amount, seed); 6 | 7 | vector vec_dir_randomize(vector vec; float amount, seed) { 8 | 9 | vector vec_rand; 10 | float length_orig = length(vec); 11 | 12 | // getting different random value for each axis, scaling to [-1..1] range 13 | // thanks to Juraj Tomori for this script 14 | vec_rand.x = rand(seed * 684.49848) * 2 - 1; 15 | vec_rand.y = rand(seed * 178.46548) * 2 - 1; 16 | vec_rand.z = rand(seed * 489.49856) * 2 - 1; 17 | 18 | vec_rand = lerp(vec, vec_rand, amount); 19 | vec_rand = normalize(vec_rand) * length_orig; 20 | 21 | return vec_rand; 22 | } 23 | 24 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /toolbar/wf_network_layout.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /vex_src/snippets/extend_polyline.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// extend polyline normal direction 3 | float distance = chf("distance"); // 0.5 in 0.0 to 1.0 4 | int segments = chi("segments"); // 1 in 1 to 100 5 | int reverse_normal = chi("reverse_normal"); // toggle 6 | float normal_mult = 1; 7 | 8 | if ( reverse_normal == 1 ) 9 | normal_mult = -1; 10 | 11 | int vertices [] = primvertices(0, @primnum); 12 | int vertex = vertices[-1]; 13 | int point = vertexpoint(0, vertex); 14 | vector pos = vertex(0, "P", vertex); 15 | vector nor = point(0, "N", point); 16 | 17 | for (int i = 1; i < segments+1; i++) 18 | { 19 | float dist = distance / float(segments); 20 | vector offset = i * dist * normal_mult * nor; 21 | int ptnum = addpoint (0, pos + offset); 22 | int vertnum = addvertex (0, @primnum, ptnum); 23 | } 24 | 25 | 26 | 27 | 28 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/tools/angle between edges, detect corners.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// angle between edges, detect corners 3 | 4 | // primitive wrangle 5 | 6 | int pts[] = primpoints(0, @primnum); 7 | 8 | for (int i=0; i 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /vex_src/snippets/group.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// group if threshold 3 | 4 | float thr = chf("thr"); // 0.5 in 0.0 to 1.0 5 | float value = rand(@ptnum + 0.654); 6 | 7 | if ( value < thr) 8 | { 9 | // @group_selected = 1; 10 | removepoint(0, @ptnum); 11 | } 12 | 13 | ///------------------------------------------------------------------------------------------------ 14 | /// group if modulo range 15 | 16 | int select = chi("select"); // 1 in 0 to 100 17 | int of = chi("of"); // 10 in 0 to 100 18 | int offset = chi("offset"); // 0 in 0 to 100 19 | int index = @ptnum - offset; 20 | 21 | if ( (index % of) < select ) 22 | { 23 | @group_selected = 1; 24 | } 25 | ///------------------------------------------------------------------------------------------------ 26 | /// group first last point in primitive 27 | 28 | // first point of primitive 29 | if ( vertexprimindex(0, @vtxnum) == 0 ) 30 | { 31 | @group_sel = 1; 32 | } 33 | 34 | // last point of primitive 35 | if ( vertexprimindex(0, @vtxnum) == primvertexcount(0,@primnum)-1 ) 36 | { 37 | @group_sel = 1; 38 | } 39 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /toolbar/wf_utils.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /toolbar/wf_chaneditor.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | OBJ 15 | SOP 16 | CHOP 17 | ROP 18 | SHOP 19 | COP2 20 | VOP 21 | VOPNET 22 | DOP 23 | 24 | _workflow 25 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /vex_src/docs/docs_interpolation.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// smooth 3 | float min = chf("min"); // 0 in 0 to 10 4 | float max = chf("max"); // 1 in 0 to 10 5 | float sample; 6 | 7 | // returns 0 if sample is <= min 8 | // returns 1 if sample is >= max 9 | float sample_01 = smooth(min, max, sample); 10 | 11 | 12 | ///------------------------------------------------------------------------------------------------ 13 | /// smooth rolloff 14 | float min = chf("min"); // 0 in 0 to 10 15 | float max = chf("max"); // 0 in 0 to 10 16 | float rolloff = chf("rolloff"); // 0 in 0 to 10 17 | float sample; 18 | 19 | // returns 0 if sample is <= min 20 | // returns 1 if sample is >= max 21 | float sample_01 = smooth(min, max, sample, rolloff); 22 | 23 | 24 | ///------------------------------------------------------------------------------------------------ 25 | /// lerp float 26 | float from; 27 | float to; 28 | float amount = chf("amount"); // 0 in 0 to 1 29 | 30 | float result = lerp(from, to, amount); 31 | 32 | ///------------------------------------------------------------------------------------------------ 33 | /// lerp vector 34 | vector from; 35 | vector to; 36 | float amount = chf("amount"); // 0 in 0 to 1 37 | 38 | vector result = lerp(from, to, amount); 39 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /python3.11libs/wf_job_backup.py: -------------------------------------------------------------------------------- 1 | def copypaste_ptg_folder( which_folder, insert_before_folder, node_src, node_dst ) : 2 | 3 | ptg_dst = node_dst.parmTemplateGroup() 4 | ptg_src = node_src.parmTemplateGroup() 5 | 6 | # remove target folder if already exists 7 | try: 8 | ptg_dst.remove( ptg_dst.findFolder( which_folder ) ) 9 | node_dst.setParmTemplateGroup(ptg_dst) 10 | except: 11 | pass 12 | 13 | # find and insert the folder, set PTG 14 | cargo = ptg_src.findFolder( which_folder ) 15 | location = ptg_dst.findFolder( insert_before_folder ) 16 | # :) debug in 20.5.487 17 | # print ("cargo: ") 18 | # print (cargo) 19 | # print ("location: ") 20 | # print (location) 21 | # ptg_dst.insertBefore( 0 , cargo ) 22 | ptg_dst.insertBefore( location , cargo ) 23 | node_dst.setParmTemplateGroup(ptg_dst) 24 | 25 | 26 | :::::::::::::::::DEBUG:::::::::::: 27 | 28 | 29 | def copypaste_ptg_folder( which_folder, insert_before_folder, node_src, node_dst ) : 30 | 31 | node_src = hou.node('/obj/rivet1') 32 | node_dst = hou.node('/obj/geo1') 33 | 34 | ptg_src = node_src.parmTemplateGroup() 35 | ptg_dst = node_dst.parmTemplateGroup() 36 | 37 | which_folder = "Rivet" 38 | insert_before_folder = "Transform" 39 | 40 | cargo = ptg_src.findFolder( which_folder ) 41 | location = ptg_dst.findFolder( insert_before_folder ) 42 | 43 | print(cargo) 44 | print(location) 45 | 46 | # ptg_dst.insertBefore( location , cargo ) 47 | # node_dst.setParmTemplateGroup(ptg_dst) 48 | 49 | -------------------------------------------------------------------------------- /python3.11libs/wf_chaneditor.py: -------------------------------------------------------------------------------- 1 | import hou 2 | import wf_selection 3 | 4 | def scope_timedependent_container () : 5 | 6 | expr_list = [ 7 | "bezier()", 8 | "constant()", 9 | "cubic()", 10 | "cycle()", 11 | "cyclet()", 12 | "ease()", 13 | "easein()", 14 | "easeinp()", 15 | "easeout()", 16 | "easeoutp()", 17 | "easep()", 18 | "linear()", 19 | "match()", 20 | "matchin()", 21 | "matchout()", 22 | "quintic()", 23 | "repeat()", 24 | "repeatt()", 25 | "spline()", 26 | "vmatch()", 27 | "vmatchin()", 28 | "vmatchout()" 29 | ] 30 | 31 | for node in hou.selectedNodes() : 32 | for child in node.allSubChildren() : 33 | if not child.isInsideLockedHDA() : 34 | parms = child.parms() 35 | for parm in parms: 36 | keys = parm.keyframes() 37 | if keys != (): 38 | key = keys[0] 39 | if key.expression() in expr_list : 40 | parm.setScope(1) 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | # container = wf_selection.container() 50 | # nodes = container.allSubChildren() 51 | # for node in nodes: 52 | # if not node.isInsideLockedHDA(): 53 | # parms = node.parms() 54 | # for parm in parms: 55 | # if parm.isTimeDependent(): 56 | # parm.setScope(1) 57 | 58 | -------------------------------------------------------------------------------- /vex_src/docs/docs_math.vfl: -------------------------------------------------------------------------------- 1 | ///----------------------- 2 | /// sin 3 | float rand = rand(@ptnum); 4 | float speed = chf("speed"); // 0.5 in 0.0 to 10 5 | float amp = chf("amp"); // 1.0 in 0.0 to 10 6 | float offset; 7 | float sin; 8 | 9 | offset = chf("offset"); // 10 in 0.0 to 1000 10 | offset = offset * rand; 11 | 12 | sin = amp * sin( speed * @Time + offset ); 13 | sin = abs(sin); 14 | 15 | @Cd *= sin; 16 | 17 | ///----------------------- 18 | /// sin spikes 19 | float seed = @ptnum; 20 | float time, sin; 21 | 22 | //---- rand speed 23 | 24 | float speed = chf("speed"); // 0.5 in 0.0 to 1 25 | float speed_rand_min = chf("speed_rand_min"); // 0.4 in 0 to 1 26 | float speed_rand_max = chf("speed_rand_max"); // 0.6 in 0 to 1 27 | float speed_rand = rand(seed + 0.123); 28 | 29 | speed_rand = fit01(speed_rand , speed_rand_min, speed_rand_max); 30 | time = speed * speed_rand * (@Time + 123456.789); 31 | 32 | //---- rand amp 33 | float amp = chf("amp"); // 2.0 in 0.0 to 10 34 | float amp_rand_min = chf("amp_rand_min"); // 0.4 in 0 to 1 35 | float amp_rand_max = chf("amp_rand_max"); // 1.0 in 0 to 1 36 | float amp_pow = chf("amp_pow"); // 3.0 in 0.0 to 100 37 | float amp_rand = pow( rand(seed + 0.789) , amp_pow ); 38 | 39 | //---- sin power 40 | float sin_pow = chf("sin_pow"); // 20.0 in 0.0 to 100 41 | sin = 1 - abs( sin(time) ); 42 | sin = pow( sin, sin_pow); 43 | 44 | amp_rand = fit01(amp_rand , amp_rand_min, amp_rand_max); 45 | sin = amp * amp_rand * sin; 46 | 47 | @Cd = sin; 48 | -------------------------------------------------------------------------------- /vex_src/docs/docs_intrinsic.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// intrinsics - set matrix3 3 | 4 | matrix xform = 4@xform; 5 | 6 | matrix3 transform = primintrinsic(0, "transform", @primnum); 7 | transform *= matrix3 (xform); 8 | setprimintrinsic(0,"transform", @primnum, transform); 9 | 10 | 11 | ///------------------------------------------------------------------------------------------------ 12 | /// intrinsics - set packed matrix4 13 | 14 | matrix xform = 4@xform; 15 | 16 | matrix transform = getpackedtransform(0, @primnum); 17 | transform *= xform; 18 | setpackedtransform(0, @primnum, transform); 19 | 20 | 21 | ///------------------------------------------------------------------------------------------------ 22 | /// intrinsics - packed disk sequence 23 | setprimintrinsic(0, "unexpandedfilename", @primnum, s@path); 24 | 25 | setprimintrinsic(0, "index", @primnum, f@seqnum); 26 | setprimintrinsic(0, "wrap", @primnum, "mirror"); // "clamp", "cycle", "mirror" or "strict" 27 | setprimintrinsic(0, "abcframe", @primnum, f@time); 28 | 29 | ///------------------------------------------------------------------------------------------------ 30 | /// intrinsics - bounds 31 | float bounds[] = primintrinsic(0, "bounds", @primnum); 32 | 33 | v@size[0] = bounds[1] - bounds[0]; 34 | v@size[1] = bounds[3] - bounds[2]; 35 | v@size[2] = bounds[5] - bounds[4]; 36 | 37 | f@diameter = length(v@size); 38 | ///------------------------------------------------------------------------------------------------ 39 | 40 | 41 | CEE COUNTRY MANAGERS MEETING 42 | Virtual meeting 43 | July 1st - 2nd, 2020 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /toolbar/wf_hotkeys_job.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /vex_src/tools/slideframe.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// curve - slideframe up 3 | 4 | int vertices[] = primvertices(0, @primnum); 5 | int ptnum_0 = vertexpoint(0, vertices[0]); 6 | int count = len(vertices); 7 | 8 | vector p0 = point(0, "P", ptnum_0); 9 | vector t0 = point(0, "N", ptnum_0); 10 | vector u0 = {0, 1, 0}; 11 | 12 | setpointattrib(0, "up", ptnum_0, u0); 13 | 14 | for(int i = 1; i < count ; i++) 15 | { 16 | int pt = vertexpoint(0, vertices[i]); 17 | vector p1 = point(0, "P", pt); 18 | vector t1 = point(0, "N", pt); 19 | vector u1 = slideframe(p0, t0, u0, p1, t1); 20 | 21 | setpointattrib(0, "up", pt, u1); 22 | 23 | p0 = p1; 24 | t0 = t1; 25 | u0 = u1; 26 | } 27 | 28 | 29 | ///------------------------------------------------------------------------------------------------ 30 | /// curve - slideframe up - rotate 31 | 32 | int vertices[] = primvertices(0, @primnum); 33 | int ptnum_0 = vertexpoint(0, vertices[0]); 34 | int count = len(vertices); 35 | 36 | vector p0 = point(0, "P", ptnum_0); 37 | vector t0 = point(0, "N", ptnum_0); 38 | vector u0 = {0, 1, 0}; 39 | 40 | float angle = radians( chf("angle") ) ; // 0.5 in 0.0 to 30 41 | 42 | setpointattrib(0, "up", ptnum_0, u0); 43 | 44 | for(int i = 1; i < count ; i++) 45 | { 46 | int pt = vertexpoint(0, vertices[i]); 47 | vector p1 = point(0, "P", pt); 48 | vector t1 = point(0, "N", pt); 49 | vector u1 = slideframe(p0, t0, u0, p1, t1); 50 | 51 | matrix3 m = ident(); 52 | rotate(m, angle, t0); 53 | u1 = u1 * m; 54 | 55 | setpointattrib(0, "up", pt, u1); 56 | 57 | p0 = p1; 58 | t0 = t1; 59 | u0 = u1; 60 | } 61 | 62 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /toolbar/wf_job.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | SOP 18 | 19 | 25 | 26 | 27 | 28 | 29 | OBJ 30 | 31 | 35 | 36 | 37 | 38 | 39 | OBJ 40 | 41 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/distort.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// distort bias 3 | #include "qq.vfl" 4 | 5 | float bias = chf("bias"); // 0.5 in 0 to 1 6 | value = distort_bias(value, bias); 7 | 8 | float bias_mirrored = chf("bias_mirrored"); // 0.5 in 0 to 1 9 | value = distort_bias_mirrored(value, bias); 10 | 11 | ///------------------------------------------------------------------------------------------------ 12 | /// distort noise 13 | 14 | float value = @dim; 15 | float noise = f@noise; 16 | float value_clamped = clamp(value, 0, 1); 17 | float where_the_noise = chramp("where_the_noise", value_clamped); //quad 18 | float noise_mult = chf("noise_mult"); // 0.5 in 0.0 to 1.0 19 | 20 | value = value + where_the_noise * noise_mult * noise ; 21 | @dim = value; 22 | 23 | // normalize in next wrangles 24 | 25 | 26 | ///------------------------------------------------------------------------------------------------ 27 | /// distort shrink random 28 | 29 | 30 | float bite_zero = chf("bite_zero"); // 0 in 0 to 1 31 | float bite_one = chf("bite_one"); // 1 in 0 to 1 32 | 33 | bite_zero = fit01( rand(@ptnum + 0.123) , 0 , bite_zero ); 34 | bite_one = fit01( rand(@ptnum + 0.456 ) , bite_one , 1 ); 35 | 36 | value = fit(value, bite_zero, bite_one, 0, 1); 37 | 38 | 39 | ///------------------------------------------------------------------------------------------------ 40 | /// distort segment 41 | 42 | 43 | //---- 44 | string segment_attname = chs("name"); // letters etc. 45 | string segment_maxname = chs("name") + "_max"; 46 | //---- 47 | float offset_0 = chf("offset_0"); // 0 in 0 to 1 48 | float offset_1 = chf("offset_1"); // 1 in 0 to 1 49 | int enable_gaps = chi("enable_gaps"); // toggle 50 | 51 | // get segment_rel 52 | int primitives[] = pointprims(0, @ptnum); 53 | int segment = prim(0, segment_attname, primitives[0]); 54 | int segment_max = detail(0, segment_maxname) ; 55 | 56 | @dim = distort_segment(@dim, segment, segment_max, offset_0, offset_1, enable_gaps); 57 | -------------------------------------------------------------------------------- /vex_src/docs/docs_geometry.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// geo - nearpoints 3 | // array of point numbers 4 | vector from = @P; 5 | float maxdist = chf("maxdist"); // 1 in 0 to 2 6 | int maxpts = chi("maxpts"); // 1 in 1 to 100 7 | 8 | int nearpoints[] = nearpoints(0, from, maxdist, maxpts); 9 | 10 | 11 | foreach (int i; int ptnum; nearpoints) { 12 | 13 | } 14 | 15 | ///------------------------------------------------------------------------------------------------ 16 | /// geo - nearpoint 17 | float maxdist = chf("maxdist"); // 0.5 in 0.0 to 1.0 18 | int nearpoint = nearpoint(0, @P); 19 | int nearpoint = nearpoint(0, @P, maxdist); 20 | @Cd = point(0, "Cd", nearpoint); 21 | 22 | 23 | ///------------------------------------------------------------------------------------------------ 24 | /// geo - intersect 25 | 26 | int geometry; 27 | vector from; 28 | vector dir; 29 | vector prim; // gets overwritten 30 | vector uvw; // gets overwritten 31 | 32 | int primnum = intersect(geometry, from, dir, prim, uvw); 33 | 34 | 35 | ///------------------------------------------------------------------------------------------------ 36 | /// geo - intersect_all 37 | 38 | int geometry; 39 | vector from; 40 | vector dir; 41 | vector pos[]; // overwritten world space positions of each hit 42 | vector prim[]; // overwritten 43 | vector uvw[]; // overwritten 44 | 45 | int number_of_intersections = intersect_all(geometry, from, dir, pos, prim, uvw); 46 | 47 | 48 | ///------------------------------------------------------------------------------------------------ 49 | /// geo - neighbours - connected to point 50 | // array of point numbers 51 | 52 | int point_numbers[] = neighbours(0, @ptnum); 53 | 54 | 55 | ///------------------------------------------------------------------------------------------------ 56 | /// geo - minpos - position on surface 57 | // closest position on surface 58 | 59 | vector from = @P; 60 | vector pos = minpos(1, from); 61 | 62 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/docs/docs_measure.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// planepointdistance 3 | // distance and closest point 4 | 5 | vector plane_pos; 6 | vector plane_normal; 7 | vector point_pos = @P; 8 | 9 | vector intersect_pos; // is written to 10 | 11 | float distance = planepointdistance(plane_pos, plane_normal, point_pos, intersect_pos); 12 | 13 | ///------------------------------------------------------------------------------------------------ 14 | /// surfacedist - along the surface/edge 15 | 16 | string ptgroup = "group1"; // empty strings will match all points 17 | string P_attribute = "P"; // using "P" will give the world distance along the surface 18 | int search_pt = @ptnum; // point to measure the distance for 19 | string distance_metric = "surface"; // or "edge" 20 | int closest_pt; // gets overwritten 21 | 22 | float distance = surfacedist(0, ptgroup, P_attribute, search_pt, closest_pt, distance_metric); 23 | 24 | ///------------------------------------------------------------------------------------------------ 25 | /// uvdist - dart throwing 26 | 27 | int primid; 28 | vector primuv; 29 | vector pos_uvw = rand(@Time) * {1, 1, 0}; 30 | float dist_uv = uvdist(1, "uv", pos_uvw, primid, primuv); 31 | 32 | if( dist_uv < 1e-5 ){ 33 | vector pos_geo = primuv(1, "P", primid, primuv); 34 | float rad_pt = fit01( rand(@Time + 45), 0.02, 0.1 ); 35 | 36 | int pts_close[] = pcfind_radius(0, "P", "pscale", 1, pos_geo, rad_pt, 1); 37 | 38 | if( len(pts_close) == 0){ 39 | int pt_add = addpoint(0, pos_geo); 40 | setpointattrib(0, "pscale", pt_add, rad_pt, "set"); 41 | } 42 | } 43 | 44 | ///------------------------------------------------------------------------------------------------ 45 | /// xyzdist - on surface 46 | 47 | vector origin = point(1,"P",0); 48 | int prim; // gets overwritten 49 | vector uv; // gets overwritten 50 | 51 | float distance = xyzdist(0, origin, prim, uv); 52 | vector position = primuv(0, "P", prim, uv); 53 | 54 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/docs/docs_attribute.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// setattribtypeinfo 3 | setattribtypeinfo(0, "point", "name", "vector"); 4 | // "point" - Apply scales, rotations, and transformations. 5 | // "vector" - Apply scales and rotations, but not transformations. 6 | // "normal" - Apply rotations, apply scales with inverse-transpose. 7 | // "color" - Don’t transform. 8 | 9 | ///------------------------------------------------------------------------------------------------ 10 | /// findattribval 11 | // finds a primitive/point/vertex with value 12 | int which = 1; // which match to return 13 | int index = findattribval(0, "point", "name", value, which); 14 | int index[] = findattribval(0, "point", "name", value); 15 | // value can be integer or string 16 | 17 | ///------------------------------------------------------------------------------------------------ 18 | /// idtopoint idtoprim 19 | ptnum = idtopoint(0, id); 20 | primnum = idtoprim(0, id); 21 | 22 | ///------------------------------------------------------------------------------------------------ 23 | /// nametopoint nametoprim 24 | ptnum = nametopoint(0, "name"); 25 | primnum = nametoprim(0, "name"); 26 | 27 | ///------------------------------------------------------------------------------------------------ 28 | /// uniqueval nuniqueval 29 | int count = nuniqueval(0, "point", "foo"); 30 | for (int i = 0; i < count; i++) { 31 | string val = uniqueval(0, "point", "foo", i); 32 | // ...do something with the value... 33 | } 34 | 35 | ///------------------------------------------------------------------------------------------------ 36 | /// primuv - value at uv intrinsic 37 | // to use UVs stored in UV attribute, use uvsample instead 38 | int sourceprim; 39 | vector sourceprimuv; 40 | @P = primuv(0, "P", sourceprim, sourceprimuv); 41 | 42 | ///------------------------------------------------------------------------------------------------ 43 | /// uvsample - value at uv attribute 44 | 45 | int geometry; 46 | string attr_name; 47 | string uv_attr_name; 48 | vector uvw; 49 | 50 | uvsample(geometry, attr_name, uv_attr_name, uvw); 51 | 52 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /toolbar/wf_network_kwargs.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/matrix.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// matrix - xform - rotate scale translate 3 | #include "qq.vfl" 4 | 5 | // // 6 | 7 | // // amount: 8 | // vector amount = set(0,0,0); // rotation in degrees 9 | // vector amount = set(1,1,1); // scale 10 | 11 | // // pivot: 12 | // vector pivot = @P; // pivot position 13 | // vector4 orient = @orient; // pivot rotation 14 | // vector pivot_rot = euler_from_quat(orient); // maketransform expects rotations in degrees 15 | 16 | // // xform {T} {R} {S} : 17 | // 4@xform = maketransform(0, 0, amount, {0,0,0}, {1,1,1}, pivot, pivot_rot); 18 | // 4@xform = maketransform(0, 0, {0,0,0}, amount, {1,1,1}, pivot, pivot_rot); 19 | // 4@xform = maketransform(0, 0, {0,0,0}, {0,0,0}, amount, pivot, pivot_rot); 20 | 21 | 22 | 23 | ///------------------------------------------------------------------------------------------------ 24 | /// matrix - xform - rotate 25 | #include "qq.vfl" 26 | 27 | // ramp: 28 | float lut = chramp("lut", @fill); //quad 29 | 30 | // amount: 31 | //---- 32 | float rot_x = chf("rot_x"); // 90 in 0 to 360 33 | float rot_y = chf("rot_y"); // 90 in 0 to 360 34 | float rot_z = chf("rot_z"); // 90 in 0 to 360 35 | 36 | vector rot = lut * set(rot_x, rot_y, rot_z); 37 | 38 | // pivot: 39 | vector pivot = @P; // pivot position 40 | vector4 orient = @orient; // pivot rotation 41 | vector pivot_rot = euler_from_quat(orient); // maketransform expects rotations in degrees 42 | 43 | // xform {T} {R} {S} :// xform {T} {R} {S} : 44 | 4@xform = maketransform(0, 0, {0,0,0}, rot, {1,1,1}, pivot, pivot_rot); 45 | 46 | ///------------------------------------------------------------------------------------------------ 47 | /// matrix - xform - scale 48 | #include "qq.vfl" 49 | 50 | // ramp: 51 | float lut = chramp("lut", @fill); //quad 52 | 53 | // amount: 54 | //---- 55 | float scale_x = chf("scale_x"); // 1 in 0 to 10 56 | float scale_y = chf("scale_y"); // 1 in 0 to 10 57 | float scale_z = chf("scale_z"); // 1 in 0 to 10 58 | 59 | vector scale = lut * set(scale_x, scale_y, scale_z); 60 | 61 | // vector amount = set(1,1,1); // scale 62 | 63 | // pivot: 64 | vector pivot = @P; // pivot position 65 | vector4 orient = @orient; // pivot rotation 66 | vector pivot_rot = euler_from_quat(orient); // maketransform expects rotations in degrees 67 | 68 | // xform {T} {R} {S} :// xform {T} {R} {S} : 69 | 4@xform = maketransform(0, 0, {0,0,0}, {0,0,0}, scale, pivot, pivot_rot); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | *This repository is described here: http://lex.ikoon.cz* 2 | 3 | *I hope that some of the Python or VEX functions will help you. Some of them are mine, some of them are collected and I [THANK YOU](http://lex.ikoon.cz/thanks/) very much, all the authors and great community. I could not do this without you. I will record a video description asap.* 4 |   5 |   6 | 7 | # installation 8 | - edit the wf_workflow.json 9 | - copy the wf_workflow.json into your HOUDINI_PATH/packages 10 | - more here: https://www.sidefx.com/docs/houdini/ref/plugins.html 11 | 12 | 13 | 14 | # files and folders 15 | 16 | #### toolbar 17 | - this folder contains: 18 | - one **shelf set** (`wf__set.shelf`) 19 | - twelve shelves (`wf_chaneditor.shelf`, `wf_render.shelf`, etc.) 20 | - each shelve contains tools, and each tool calls a specific function 21 | - some of the tools have their hotkey, other are accessible by the TAB menu 22 |   23 |   24 |   25 | #### python2.7libs 26 | - this folder contains python functions 27 | - here is described what each function does: 28 | - http://lex.ikoon.cz/network_parm 29 | - http://lex.ikoon.cz/network_ui 30 | - etc. 31 | - this folder is **necessary** for the shelf (toolbar) to work 32 |   33 |   34 |   35 | #### vex 36 | - this folder contains: 37 | - `uber.vfl` - a source for "uber parse" as described here: http://lex.ikoon.cz/vex-uber-parse 38 | - `qq.vfl` - library of custom functions, to be #included in a wrangle 39 | - `triggers.db` - library of triggers, more described here: http://lex.ikoon.cz/vex-ui-markup 40 | - `snippets.db` - library of snippets 41 | - `helpcard.txt` - just a helpcard 42 | - this folder is **not** necessary for the shelf to work 43 |   44 |   45 |   46 | #### Houdini.keymap.overrides 47 | - this file is set of my custom hotkeys 48 | - You probably dont want to import the file 1:1 as it is. I recommend you to look inside the file and check it. 49 | - this folder is **not** necessary for the shelf to work 50 |   51 |   52 |   53 | #### PARMmenu.xml 54 | - this file customizes the Parameter context menu (right click on any Parameter) 55 | - this folder is **not** necessary for the shelf to work 56 |   57 |   58 |   59 | # instalation 60 | - copy the files (which you really want) into `$HOUDINI_USER_PREF_DIR` 61 | - on Windows it is typically `C:\Users\your_user_name\Documents\houdini16.5` 62 | - restart Houdini 63 | - if you copied the `toolbar` and `python2.7libs` folder, you can enable the shelf as in this gif
(`Shelf Sets > workflow__set`) 64 | 65 | ![enable-shelf](http://lex.ikoon.cz/images/install/enable-shelf.gif) 66 | -------------------------------------------------------------------------------- /toolbar/wf_render.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | ROP 34 | 35 | _workflow 36 | 40 | 41 | 42 | 43 | 44 | OBJ 45 | 46 | _workflow 47 | 54 | 55 | 56 | 57 | 58 | OBJ 59 | 60 | _workflow 61 | 68 | 69 | 70 | 71 | 72 | OBJ 73 | LOP 74 | 75 | _workflow 76 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /python3.11libs/wf_rigging.py: -------------------------------------------------------------------------------- 1 | import hou 2 | 3 | 4 | def promote_to_HDA () : 5 | selectedNodes = hou.selectedNodes() 6 | hdanode = selectedNodes[0].parent() 7 | hda_definition = hdanode.type().definition() 8 | 9 | 10 | ptg = hda_definition.parmTemplateGroup() 11 | 12 | 13 | # folder name 14 | new_folder_name = () 15 | new_folder_name = hou.ui.readInput( 16 | message = "new_folder_name:", 17 | initial_contents = "l_arm") 18 | 19 | new_folder_name = new_folder_name[1] 20 | new_folder = hou.FolderParmTemplate(new_folder_name, new_folder_name) 21 | 22 | 23 | ################## 24 | ## create parms ## 25 | 26 | for selectedNode in selectedNodes : 27 | parm_list = promote_to_HDA_parm_list(selectedNode) 28 | for parm_name in parm_list : 29 | # new template 30 | new_template = selectedNode.parmTuple(parm_name).parmTemplate() 31 | new_name = selectedNode.name() + "_" + parm_name 32 | 33 | new_template.setName(new_name) 34 | new_template.setLabel(new_name) 35 | new_folder.addParmTemplate(new_template) 36 | 37 | ptg.append(new_folder) 38 | hda_definition.setParmTemplateGroup(ptg) 39 | 40 | ##################### 41 | ## reference parms ## 42 | 43 | for selectedNode in selectedNodes : 44 | parm_list = promote_to_HDA_parm_list(selectedNode) 45 | for parm_name in parm_list : 46 | parm_node = selectedNode.parmTuple(parm_name) 47 | parm_name_hda = selectedNode.name() + "_" + parm_name 48 | parm_hda = selectedNode.parent().parmTuple(parm_name_hda) 49 | parm_hda.set(parm_node.eval()) 50 | parm_node.set(parm_hda) 51 | 52 | # hda_definition.save(hda_definition.libraryFilePath()) 53 | 54 | 55 | 56 | def promote_to_HDA_parm_list (node) : 57 | if node.type().name() == "null" : 58 | parm_list = ["t", "r"] 59 | if node.type().name() == "bone" : 60 | parm_list = ["r", "length"] 61 | 62 | return parm_list 63 | 64 | 65 | def yoga_save_pose() : 66 | # parm_store.deleteAllKeyframes() 67 | node_edit = hou.node("/obj/edit") 68 | node_store = hou.node("/obj/store") 69 | parms = node_edit.parms() 70 | 71 | for parm in parms : 72 | name = parm.name() 73 | parm_store = node_store.parm(name) 74 | 75 | if len(parm_store.keyframes()) > 0 : 76 | value = parm.eval() 77 | key = hou.Keyframe(value) 78 | parm_store.setKeyframe(key) 79 | 80 | 81 | 82 | 83 | 84 | def yoga_load_pose() : 85 | node_edit = hou.node("/obj/edit") 86 | node_store = hou.node("/obj/store") 87 | parms = node_store.parms() 88 | 89 | for parm in parms : 90 | if len(parm.keyframes()) > 0 : 91 | name = parm.name() 92 | value = parm.eval() 93 | parm_edit = node_edit.parm(name) 94 | parm_edit.set(value) -------------------------------------------------------------------------------- /toolbar/wf_ui_panetab.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | 57 | 61 | 62 | 63 | 64 | 68 | 69 | 70 | 71 | 75 | 76 | 77 | 78 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/fit.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// fit01 vector to symmetry 10 3 | vector value = v@noise; 4 | vector new_max = chf("new_max"); // 0.5 in 0 to 10; 5 | value = fit01(value, -new_max, new_max); 6 | 7 | ///------------------------------------------------------------------------------------------------ 8 | /// fit01 float to symmetry 10 9 | float value = v@noise[1]; 10 | // float value = rand(@ptnum); 11 | float new_max = chf("new_max"); // 0.5 in 0 to 10 12 | value = fit01(value, -new_max, new_max); 13 | 14 | 15 | ///------------------------------------------------------------------------------------------------ 16 | /// fit01 float to min max 0-1 17 | float value = v@noise[1]; 18 | // float value = rand(@ptnum); 19 | float nmin = chf("new_min"); // 0.4 in 0 to 1 20 | float nmax = chf("new_max"); // 0.6 in 0 to 1 21 | value = fit01(value, nmin, nmax); 22 | 23 | ///------------------------------------------------------------------------------------------------ 24 | /// fit01 float to min max 10 25 | float value = v@noise[1]; 26 | // float value = rand(@ptnum); 27 | float nmin = chf("new_min"); // -1 in -10 to 0 28 | float nmax = chf("new_max"); // 1 in 0 to 10 29 | value = fit01(value, nmin, nmax); 30 | 31 | ///------------------------------------------------------------------------------------------------ 32 | /// fit01 float to min max 10 33 | float value = v@noise[1]; 34 | // float value = rand(@ptnum); 35 | float nmin = chf("new_min"); // -1 in -10 to 0 36 | float nmax = chf("new_max"); // 1 in 0 to 10 37 | value = fit01(value, nmin, nmax); 38 | 39 | ///------------------------------------------------------------------------------------------------ 40 | /// fit01 vector to separate 360 41 | #include "qq.vfl" 42 | qqxx.value // 0 in 0 to 360 43 | 44 | ///------------------------------------------------------------------------------------------------ 45 | /// fit01 vector to separate 10 46 | #include "qq.vfl" 47 | qqxx.value // 0 in 0 to 10 48 | 49 | ///------------------------------------------------------------------------------------------------ 50 | /// vector value 0 in 0 to 10 51 | qqx.value // 0 in 0 to 10 52 | 53 | ///------------------------------------------------------------------------------------------------ 54 | /// vector value 0 in -1 to 1 55 | qqx.value // 0 in -1 to 1 56 | 57 | 58 | ///------------------------------------------------------------------------------------------------ 59 | /// fit float 60 | float value = v@noise[1]; 61 | float omin = chf("old_min"); // 0 in 0 to 1 62 | float omax = chf("old_max"); // 1 in 0 to 1 63 | float nmin = chf("new_min"); // 0 in 0 to 1 64 | float nmax = chf("new_max"); // 1 in 0 to 1 65 | value = fit(value, omin, omax, nmin, nmax); 66 | 67 | ///------------------------------------------------------------------------------------------------ 68 | /// fit vector 69 | vector value = v@noise; 70 | vector omin = chf("old_min"); // 0 in 0 to 1 71 | vector omax = chf("old_max"); // 1 in 0 to 1 72 | vector nmin = chf("new_min"); // 0 in 0 to 1 73 | vector nmax = chf("new_max"); // 1 in 0 to 1 74 | value = fit(value, omin, omax, nmin, nmax); 75 | -------------------------------------------------------------------------------- /toolbar/wf_network_connection.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | OBJ 19 | SOP 20 | CHOP 21 | ROP 22 | SHOP 23 | COP2 24 | VOP 25 | VOPNET 26 | DOP 27 | TOP 28 | LOP 29 | 30 | _workflow 31 | 35 | 36 | 37 | 38 | 39 | OBJ 40 | SOP 41 | CHOP 42 | ROP 43 | SHOP 44 | COP2 45 | VOP 46 | VOPNET 47 | DOP 48 | 49 | _workflow 50 | 54 | 55 | 56 | 57 | 61 | 62 | 63 | 64 | 68 | 69 | 70 | 71 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /python3.11libs/wf_selection.py: -------------------------------------------------------------------------------- 1 | import hou 2 | 3 | # current_desktop = hou.ui.curDesktop() 4 | # cursor_pane = current_desktop.paneTabUnderCursor() 5 | # cursor_pane.pane().setIsSplitMaximized(False) 6 | # c = hou.ui.curDesktop() 7 | # c.findPane(13).setIsSplitMaximized(False) 8 | # hou.ui.curDesktop().panes()[2].setIsSplitMaximized(False) 9 | # (, , , , , ) 10 | # cursor_pane.pane().currensetSplitFraction(0.5) 11 | # print (cursor_pane.pane()) 12 | # hou.ui.curDesktop().findPane(354) 13 | # print ("ok") 14 | 15 | 16 | 17 | 18 | 19 | def cursor_linkGroup() : 20 | try: 21 | current_desktop = hou.ui.curDesktop() 22 | cursor_pane = current_desktop.paneTabUnderCursor() 23 | cursor_group = cursor_pane.linkGroup() 24 | # if cursor_group == hou.paneLinkType.FollowSelection or cursor_group == hou.paneLinkType.Pinned : 25 | # return hou.paneLinkType.Group1 26 | # else : 27 | # return cursor_group 28 | return cursor_group 29 | 30 | except: 31 | # not a pane 32 | return hou.paneLinkType.Group1 33 | 34 | 35 | def pane_linkGroup( panetype ) : 36 | cursor_group = cursor_linkGroup() 37 | current_desktop = hou.ui.curDesktop() 38 | pane_under_cursor = current_desktop.paneTabUnderCursor() 39 | 40 | # pane_under_cursor.type() 41 | # current_desktop.panes()[0].createTab(hou.paneTabType.ChannelEditor) 42 | # first check under cursor 43 | try: 44 | if pane_under_cursor.type() == panetype : 45 | return pane_under_cursor 46 | except: 47 | # not a pane 48 | pass 49 | 50 | # try it for the right group 51 | for pane in current_desktop.paneTabs() : 52 | if pane.type() == panetype : 53 | if pane.linkGroup() == cursor_group : 54 | return pane 55 | 56 | # if none found, then first 57 | for pane in current_desktop.paneTabs() : 58 | if pane.type() == panetype : 59 | if pane.isCurrentTab() : 60 | return pane 61 | 62 | 63 | # if none found, then Group1 64 | # cursor_group = hou.paneLinkType.Group1 65 | # for pane in current_desktop.paneTabs() : 66 | # if pane.type() == panetype : 67 | # if pane.linkGroup() == cursor_group : 68 | # return pane 69 | 70 | 71 | 72 | #def parm_pane () : 73 | # pass 74 | 75 | 76 | def parmnode () : 77 | panetab_under_cursor = hou.ui.curDesktop().paneTabUnderCursor() 78 | try: 79 | panetab_name = panetab_under_cursor.name() 80 | except: 81 | panetab_name = "probably_stowbar" 82 | 83 | if panetab_name == "pt_network_2" or panetab_name == "pt_parmeditor_2" : 84 | parm_pane = hou.ui.curDesktop().findPaneTab("pt_parmeditor_2") 85 | parmnode = parm_pane.currentNode() 86 | else : 87 | parm_pane = hou.ui.curDesktop().findPaneTab("pt_parmeditor_1") 88 | parmnode = parm_pane.currentNode() 89 | 90 | # print (parmnode) 91 | return parmnode 92 | 93 | 94 | def parmnode_obj () : 95 | parmnode = parmnode () 96 | parent = parmnode.parent() 97 | 98 | try: 99 | for i in range(8): 100 | if parent.type().category() == hou.objNodeTypeCategory() : 101 | return parent 102 | else : 103 | parent = parent.parent() 104 | except: 105 | return parmnode 106 | 107 | 108 | def container () : 109 | container = parmnode().parent() 110 | return container 111 | -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/dimension.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// dim falloff cone 3 | 4 | vector A_center = point(1, "P", 0); 5 | vector B_dir = point(1, "P", 1); 6 | 7 | vector AB_line = normalize(B_dir - A_center); 8 | vector AP_point = normalize(@P - A_center); 9 | float dot_product = dot(AB_line, AP_point); 10 | 11 | float value = acos(dot_product) / $PI; 12 | 13 | 14 | @dim = value; 15 | @Cd = value; 16 | 17 | 18 | 19 | ///------------------------------------------------------------------------------------------------ 20 | /// dim falloff linear 21 | // vector A_from = getbbox_center(1); 22 | 23 | vector A_from = point(1, "P", 0); 24 | vector B_to = point(1, "P", 1); 25 | 26 | vector AB_base = normalize(B_to - A_from); 27 | vector AP_divergence = @P - A_from; 28 | float AB_length = length(B_to - A_from); 29 | float AP_projected_length = dot(AB_base, AP_divergence); 30 | 31 | float value; 32 | value = AP_projected_length / AB_length; 33 | 34 | 35 | addattrib(0, "detail", "value_max", -10000000.0); 36 | addattrib(0, "detail", "value_min", 10000000.0); 37 | 38 | setdetailattrib(0, "value_max", value, "max"); 39 | setdetailattrib(0, "value_min", value, "min"); 40 | 41 | @dim = value; 42 | @Cd = value; 43 | 44 | 45 | ///------------------------------------------------------------------------------------------------ 46 | /// dim falloff radial 47 | 48 | vector A_center = getbbox_center(1); 49 | vector B_to = point(1, "P", 1); 50 | float radius = length(B_to - A_center); 51 | 52 | float value; 53 | value = length(@P - A_center) / radius; 54 | 55 | addattrib(0, "detail", "value_max", -10000000.0); 56 | addattrib(0, "detail", "value_min", 10000000.0); 57 | 58 | setdetailattrib(0, "value_max", value, "max"); 59 | setdetailattrib(0, "value_min", value, "min"); 60 | 61 | @dim = value; 62 | @Cd = value; 63 | 64 | ///------------------------------------------------------------------------------------------------ 65 | /// dim falloff normalize 66 | float value = @dim; 67 | float value_max = detail(0, "value_max", 0); 68 | float value_min = detail(0, "value_min", 0); 69 | float nmin = 0; 70 | float nmax = 1; 71 | value = fit(value, value_min, value_max, nmin, nmax); 72 | 73 | @dim = value; 74 | @Cd = value; 75 | 76 | ///------------------------------------------------------------------------------------------------ 77 | /// dim falloff vdb 78 | 79 | // input1: vdb from polygons, fill interior 80 | float sample = volumesample(1,0,@P); 81 | 82 | 83 | float value; 84 | value = length(@P - center) / radius; 85 | 86 | @dim = value; 87 | @Cd = value; 88 | 89 | 90 | ///------------------------------------------------------------------------------------------------ 91 | /// falloff bounding vector 92 | 93 | // run over detail 94 | 95 | int geometry = 0; 96 | 97 | vector A_from = point(1,"P",0); 98 | vector B_to = point(1,"P",1); 99 | 100 | int npoints = npoints(geometry); 101 | vector AB_base = normalize(B_to - A_from); 102 | float mindist = 1e10; 103 | float maxdist = -1e10; 104 | 105 | for (int pt = 0; pt < npoints; pt++) 106 | { 107 | vector pos = point(geometry,"P",pt); 108 | vector AP_divergence = pos - A_from; 109 | float AP_projected_length = dot(AB_base, AP_divergence); 110 | 111 | maxdist = max(AP_projected_length, maxdist); 112 | mindist = min(AP_projected_length, mindist); 113 | } 114 | 115 | vector AC_divergence = getbbox_center(geometry) - A_from; 116 | float AC_projected_length = dot(AB_base,AC_divergence); 117 | 118 | v@bounding_to = (maxdist - AC_projected_length) * AB_base + getbbox_center(geometry) ; 119 | v@bounding_from = (mindist - AC_projected_length) * AB_base + getbbox_center(geometry) ; 120 | -------------------------------------------------------------------------------- /vex_src/docs/docs_pointclouds.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// pc - pciterate 3 | 4 | string Pchannel = "P"; 5 | vector P = @P; 6 | float radius = chf("radius"); // search within radius 7 | int maxpoints = npoints(1); 8 | 9 | int handle = pcopen(1, Pchannel, P, radius, maxpoints); 10 | 11 | // pcnumfound(handle); 12 | 13 | // input0: few points 14 | // input1: grid 15 | 16 | // function finds points on the grid and creates connections 17 | 18 | while( pciterate(handle) == 1 ) // can compare && connections < 20 19 | { 20 | 21 | float found_dist; 22 | int found_ptnum; 23 | 24 | pcimport(handle, "point.number", found_ptnum); 25 | pcimport(handle, "point.distance", found_dist); 26 | 27 | vector found_pos = point(1, "P", found_ptnum); 28 | vector Cd = 1/found_dist; 29 | 30 | int new_prim = addprim(0,"polyline"); 31 | int new_point = addpoint (0, found_pos ); 32 | int vert_old = addvertex(0, new_prim, @ptnum); 33 | int vert_new = addvertex(0, new_prim, new_point); 34 | 35 | setpointattrib(0, "Cd", new_point, Cd, "set"); 36 | 37 | // if something 38 | // connections++ 39 | 40 | } 41 | pcclose(handle); 42 | 43 | 44 | ///------------------------------------------------------------------------------------------------ 45 | /// pc - pcfilter 46 | 47 | float radius = chf("radius"); // 1 in 0 to 2 48 | int maxpts = chi("maxpts"); // 1 in 1 to 100 49 | int handle = pcopen(0, "P", @P, radius, maxpts); 50 | 51 | @P = pcfilter(handle, "P"); 52 | 53 | 54 | ///------------------------------------------------------------------------------------------------ 55 | /// pc - for loop farthest 56 | 57 | vector sample_pos = point(0,"P",pt); 58 | 59 | int count = npoints(0); 60 | float maxdist = 0; 61 | vector position; 62 | 63 | for (int pt = 0; pt < count; pt++) 64 | { 65 | float distance = length(sample_pos - farthest_point_from); 66 | if (distance > maxdist) 67 | { 68 | maxdist = distance; 69 | position = sample_pos; 70 | } 71 | } 72 | 73 | ///------------------------------------------------------------------------------------------------ 74 | /// pc - pcfarthest point distance 75 | 76 | string Pchannel = "P"; 77 | vector P = @P; 78 | float radius = chf("radius"); // search within radius 79 | int maxpoints = npoints(0); 80 | 81 | pcopen(geometry, Pchannel, P, radius, maxpoints); 82 | int handle = pcopen(0, "P", v@P, 1e5, num); 83 | @distance = pcfarthest(handle); 84 | pcclose(handle); 85 | 86 | 87 | 88 | ///------------------------------------------------------------------------------------------------ 89 | /// pc - pcfind_radius attributetransfer 90 | 91 | 92 | int geometry = 1; 93 | string Pchannel = "P"; 94 | string RadChannel = "pscale"; 95 | float radscale = 1.0; 96 | vector P = @P; 97 | float radius = 0.0; 98 | int maxpoints = int(1e9); 99 | 100 | int pts[] = pcfind_radius(geometry, Pchannel, RadChannel, radscale, P, radius, maxpoints); 101 | 102 | 103 | @transfer = 0; 104 | 105 | foreach(int pt; pts){ 106 | float pt_pscale = point(1, "pscale", pt); 107 | float pt_value = point(1, "Cd", pt); // 108 | vector pt_P = point(1, "P", pt); 109 | float dist = distance(pt_P, v@P); 110 | 111 | float dist_far = pt_pscale; 112 | float dist_close = 0; 113 | float value_far = 0; 114 | float value_close = pt_value; // can be also pt_pscale 115 | float value = fit(dist, dist_far, dist_close, value_far, value_close); 116 | 117 | @transfer = max(f@transfer, value); 118 | } 119 | 120 | @Cd = @transfer; 121 | 122 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/docs/docs_table.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// pointprims - point >> array of primnums 3 | int ptnum = @ptnum; 4 | int primnums[] = pointprims(0, int ptnum); 5 | 6 | ///------------------------------------------------------------------------------------------------ 7 | /// pointvertex - point >> linvert 8 | // more vertices can share a point 9 | // this function return only the firts vertex 10 | int ptnum = @ptnum; 11 | int linvert = pointvertex(0, ptnum); 12 | 13 | ///------------------------------------------------------------------------------------------------ 14 | /// pointvertices - point >> array of linvert 15 | int ptnum = @ptnum; 16 | int linvert[] = pointvertices(0, ptnum); 17 | 18 | ///------------------------------------------------------------------------------------------------ 19 | /// primpoint - primnum + vertex >> point 20 | int primnum = @primnum; 21 | int vertex = 0; // not linvert, but first vertex in a primnum 22 | int ptnum = primpoint(0, primnum, vertex); 23 | 24 | ///------------------------------------------------------------------------------------------------ 25 | /// primpoints - primnum >> array of points 26 | int primnum = @primnum; 27 | int points[] = primpoints(0, primnum); 28 | 29 | ///------------------------------------------------------------------------------------------------ 30 | /// primvertex - primnum + vertex >> linvert 31 | // same as vertexindex 32 | int primnum = @primnum; 33 | int vertex = 0; // not linvert, but first vertex in a primnum 34 | int linvert = primvertex(0, primnum, vertex); 35 | 36 | ///------------------------------------------------------------------------------------------------ 37 | /// primvertexcount - primnum >> vertex count 38 | int primnum = @primnum; 39 | int vertcount = primvertexcount(0, primnum); 40 | 41 | ///------------------------------------------------------------------------------------------------ 42 | /// primvertices - primnum >> array of vertices 43 | int primnum = @primnum; 44 | int vertices[] = primvertices(0, primnum); 45 | 46 | ///------------------------------------------------------------------------------------------------ 47 | /// vertexindex - primnum + vertex >> linvert 48 | // same as primvertex 49 | int primnum = @primnum; 50 | int vertex = 0; // not linvert, but first vertex in a primnum 51 | int linvert = vertexindex(0, primnum, vertex); 52 | 53 | ///------------------------------------------------------------------------------------------------ 54 | /// vertexnext - linvert >> next linvert 55 | // next linvert in the same point 56 | // returns -1 if the vertex has no later shared vertices 57 | int linvert = @vtxnum; 58 | int linvert_next = vertexnext(0, linvert); 59 | 60 | ///------------------------------------------------------------------------------------------------ 61 | /// vertexpoint - linvert >> point 62 | int linvert = @vtxnum; 63 | int ptnum = vertexpoint(0, linvert); 64 | 65 | ///------------------------------------------------------------------------------------------------ 66 | /// vertexprev - linvert >> prev linvert 67 | // prev linvert in the same point 68 | // returns -1 if the vertex has no later shared vertices 69 | int linvert = @vtxnum; 70 | int linvert_prev = vertexprev(0, linvert); 71 | 72 | ///------------------------------------------------------------------------------------------------ 73 | /// vertexprim - linvert >> primnum + index 5:3 74 | // linvert to 5:3 75 | int linvert = @vtxnum; 76 | int primnum = vertexprim(0, linvert); 77 | int vertindex = vertexprimindex(0, linvert); 78 | 79 | ///------------------------------------------------------------------------------------------------ 80 | /// polyneighbours - primnum >> neighbours 81 | int primnum = @primnum; 82 | int primnums[] = polyneighbours(0, primnum); 83 | 84 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /python3.11libs/wf_network_kwargs.py: -------------------------------------------------------------------------------- 1 | import re 2 | import hou 3 | 4 | def node_data_peer (node_app, prefix) : 5 | 6 | node_con = node_app.parent() 7 | path_con = node_con.path() 8 | name_app = node_app.name() 9 | name_app_done = re.findall('.*app\_(.*)',name_app) 10 | 11 | if not name_app_done : 12 | name_app = prefix + "app_" + name_app 13 | node_app.setName(name_app) 14 | 15 | name_dat = name_app.replace("app_", "dat_") 16 | path_dat = path_con + "/" + name_dat 17 | node_dat = hou.node(path_dat) 18 | 19 | if node_dat : 20 | existed = 1 21 | else : 22 | existed = 0 23 | node_dat = node_con.createNode('attribwrangle',name_dat) 24 | posx = node_app.position()[0] + 3 25 | posy = node_app.position()[1] + 0 26 | node_dat.setPosition( [posx,posy] ) 27 | node_dat.parm("class").set("detail") 28 | 29 | return node_dat 30 | 31 | def node_data_parent (node_app, parmname) : 32 | 33 | node_dop = node_app.parent() 34 | node_con = node_dop.parent() 35 | path_con = node_con.path() 36 | name_app = node_app.name() 37 | 38 | name_dat = name_app + "_" + parmname 39 | path_dat = path_con + "/" + name_dat 40 | node_dat = hou.node(path_dat) 41 | 42 | if node_dat : 43 | existed = 1 44 | else : 45 | existed = 0 46 | node_dat = node_con.createNode('attribwrangle',name_dat) 47 | posx = node_dop.position()[0] + 3 48 | posy = node_dop.position()[1] + 0 49 | node_dat.setPosition( [posx,posy] ) 50 | node_dat.parm("class").set("detail") 51 | node_dat.setUserData("nodeshape", "circle") 52 | node_dat.setColor(hou.Color(0.0, 0.0, 0.0)) 53 | node_dat.setComment("`") 54 | 55 | return node_dat 56 | 57 | def snippet_preview (parms) : 58 | snippet = '\n' 59 | snippet += 'qqinc\n' 60 | snippet += '// delete one of those:\n' 61 | snippet += 'qqpreview_int\n' 62 | snippet += 'qqpreview_float \n' 63 | snippet += '\n' 64 | for parm in parms : 65 | snippet += 'fi@' + parm.name() + '\n' 66 | return snippet 67 | 68 | 69 | 70 | def snippet_reference (parms) : 71 | snippet = '\n' 72 | for parm in parms : 73 | snippet += 'qq@f.' + parm.name() + '\n' 74 | return snippet 75 | 76 | 77 | 78 | def parm_ref_appdat (node_app, node_dat, parm_name) : 79 | relpath = str(node_app.relativePathTo(node_dat)) 80 | expression = 'detail("' + relpath + '","' + parm_name + '",0)' 81 | parm = node_app.parm(parm_name) 82 | parm.setExpression(expression) 83 | 84 | 85 | def parmmenu_pre (node_app, parms) : 86 | prefix = 'PRE' 87 | node_dat = node_data_peer(node_app,prefix) 88 | snip_parm = node_dat.parm('snippet') 89 | snippet = snip_parm.unexpandedString() 90 | snippet += snippet_preview (parms) 91 | snip_parm.set(snippet) 92 | 93 | for parm in parms : 94 | parm_ref_appdat (node_app, node_dat, parm.name()) 95 | 96 | 97 | def parmmenu_ref_peer (node_app, parms) : 98 | prefix = 'REF' 99 | node_dat = node_data_peer(node_app,prefix) 100 | snip_parm = node_dat.parm('snippet') 101 | snippet = snip_parm.unexpandedString() 102 | snippet += snippet_reference (parms) 103 | snip_parm.set(snippet) 104 | 105 | for parm in parms : 106 | parm_ref_appdat (node_app, node_dat, parm.name()) 107 | 108 | def parmmenu_ref_parent (node_app, parms) : 109 | 110 | node_dat = node_data_parent(node_app,parms[0].name()) 111 | snip_parm = node_dat.parm('snippet') 112 | snippet = snip_parm.unexpandedString() 113 | snippet += snippet_reference (parms) 114 | snip_parm.set(snippet) 115 | 116 | for parm in parms : 117 | parm_ref_appdat (node_app, node_dat, parm.name()) -------------------------------------------------------------------------------- /vex_src/uber/geo_carve_line.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// geo Cd line u 3 | #include "qq.vfl" 4 | float u = geo_line_u (0, @ptnum); 5 | 6 | @Cd = chramp("Cd",u); //quad 7 | 8 | 9 | ///------------------------------------------------------------------------------------------------ 10 | /// geo Cd rbx 11 | float x = getcomp( relbbox(0,@P) , 0 ); 12 | float y = getcomp( relbbox(0,@P) , 1 ); 13 | float z = getcomp( relbbox(0,@P) , 2 ); 14 | 15 | float rx = chramp("rx",x); //quad 16 | float ry = chramp("ry",y); //quad 17 | float rz = chramp("rz",z); //quad 18 | 19 | @Cd *= rx * ry * rz; 20 | 21 | ///------------------------------------------------------------------------------------------------ 22 | /// geo Cd nage 23 | @nage = @age/@life; 24 | 25 | float value; 26 | float pow = chf("pow"); // 0.5 in 0.0 to 10 27 | 28 | value = chramp("Cd_quad", @nage); //quad 29 | value *= chramp("Cd_spikes",@nage); //dn_l 30 | value = sign(value) * pow( abs(value) , pow ); 31 | 32 | @Cd = value; 33 | 34 | 35 | ///------------------------------------------------------------------------------------------------ 36 | /// geo Cd length intrinsic 37 | float length = primintrinsic(0, "measuredperimeter", @primnum); 38 | 39 | float l_min = chf("length_min"); // 0 in 0 to 1 40 | float l_max = chf("length_max"); // 1 in 0 to 1 41 | float Cd_min = chf("Cd_min"); // 0 in 0 to 1 42 | float Cd_max = chf("Cd_max"); // 1 in 0 to 1 43 | 44 | @Cd *= fit(length, l_min, l_max, Cd_min, Cd_max); 45 | 46 | ///------------------------------------------------------------------------------------------------ 47 | /// geo carve point 48 | #include "qq.vfl" 49 | int geometry = 0; 50 | int primnum = @primnum; 51 | float u = (@Time*0.1*random(@primnum)+random(@primnum)) %1; 52 | 53 | geo_carve_point (geometry, primnum, u); 54 | 55 | ///------------------------------------------------------------------------------------------------ 56 | /// geo carve point scattered 57 | 58 | float time; 59 | float seed = @ptnum; 60 | float direction = 1; 61 | float speed = chf("speed"); // 0.5 in 0.0 to 1 62 | float speed_rand_min = chf("speed_rand_min"); // 0.4 in 0 to 1 63 | float speed_rand_max = chf("speed_rand_max"); // 0.6 in 0 to 1 64 | float speed_rand = rand(seed + 0.123); 65 | float rand_direction = rand(seed + 0.246); 66 | int both_directions = chi("both_directions"); // toggle 67 | 68 | if ( rand_direction > 0.5 && both_directions == 1 ) { 69 | direction = -1; 70 | } 71 | 72 | speed_rand = fit01(speed_rand , speed_rand_min, speed_rand_max); 73 | time = direction * speed * speed_rand * (@Time + 123456.789); 74 | 75 | v@sourceprimuv = set(time%1,0,0); 76 | @P = primuv(1, "P", i@sourceprim, v@sourceprimuv); 77 | 78 | 79 | ///------------------------------------------------------------------------------------------------ 80 | /// geo carve line random 81 | #include "qq.vfl" 82 | int geometry = 0; 83 | int primnum = @primnum; 84 | 85 | float speed = chf("speed"); // 0.5 in 0.0 to 1.0 86 | float length = chf("length"); // 0.5 in 0.0 to 1.0 87 | 88 | speed *= rand (primnum + 0.1); 89 | length *= rand (primnum + 0.12); 90 | 91 | float offset = speed * (@Time + 100*rand(primnum + 0.123)); 92 | float start = (0.0 + offset) %1; 93 | float end = (length + offset) %1; 94 | 95 | 96 | geo_carve_line (geometry, primnum, start, end); 97 | 98 | 99 | ///------------------------------------------------------------------------------------------------ 100 | /// geo carve line 101 | #include "qq.vfl" 102 | int geometry = 0; 103 | int primnum = @primnum; 104 | 105 | float offset = @Time; 106 | float start = (0.0 + offset) %1; 107 | float end = (0.1 + offset) %1; 108 | 109 | 110 | geo_carve_line (geometry, primnum, start, end); 111 | 112 | 113 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/materials.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// material animations 3 | 4 | // convention: 5 | // ............/name_mov/name_mov_index.ext 6 | // $HIP/img/dir/name_000/name_000_00000.png 7 | // $HIP/img/dir/name_001/name_001_00000.png 8 | 9 | string firstfile = chs("firstfile"); // file 10 | int mov = 0; 11 | int index = 0; 12 | 13 | override_value = file_mov_index(firstfile, mov, index); 14 | 15 | string file_mov_index(string firstfile; int mov, index) 16 | { 17 | 18 | string split[] = split(firstfile,"/_."); 19 | int split_len = len(split); 20 | //[ D:, bond, "5 houdini", img, dir, name, 000, name, 000, 00000, png ] 21 | 22 | int file_name_len = len( split[ split_len -4 ] ); 23 | int file_mov_len = len( split[ split_len -3 ] ); 24 | int file_index_len = len( split[ split_len -2 ] ); 25 | int file_ext_len = len( split[ split_len -1 ] ); 26 | 27 | int afterpath_len = file_ext_len + 1 + file_index_len + 1 + 2*file_mov_len + 2 + 1 + 2*file_name_len; 28 | 29 | string file_path = slice(firstfile,0,-afterpath_len); 30 | string file_name = split[split_len - 4]; 31 | string file_type = split[split_len - 1]; 32 | 33 | string file_mov = padzero(file_mov_len, mov); 34 | string file_index = padzero(file_index_len, index); 35 | 36 | string path; 37 | 38 | path = file_path; 39 | path += file_name + "_"; 40 | path += file_mov + "/"; 41 | path += file_name + "_"; 42 | path += file_mov + "_"; 43 | path += file_index+ "."; 44 | path += file_type; 45 | 46 | return path; 47 | } 48 | 49 | 50 | ///------------------------------------------------------------------------------------------------ 51 | /// material photos 52 | // convention: 53 | // ............/name_index.ext 54 | // $HIP/img/dir/name_00000.png 55 | 56 | 57 | string firstfile = chs("firstfile"); // file 58 | int index = 0; 59 | 60 | override_value = file_index(firstfile, index); 61 | 62 | string file_index(string firstfile; int index) 63 | { 64 | 65 | string split[] = split(firstfile,"/_."); 66 | int split_len = len(split); 67 | //[ D:, bond, "5 houdini", img, "seq timecode", timecode, 00001, jpg ] 68 | 69 | 70 | int file_name_len = len( split[ split_len -3 ] ); 71 | int file_index_len = len( split[ split_len -2 ] ); 72 | int file_ext_len = len( split[ split_len -1 ] ); 73 | 74 | int afterpath_len = file_ext_len + 1 + file_index_len + 1 + file_name_len; 75 | 76 | string file_path = slice(firstfile,0,-afterpath_len); 77 | string file_name = split[split_len - 3]; 78 | string file_type = split[split_len - 1]; 79 | 80 | string file_index = padzero(file_index_len, index); 81 | 82 | string path; 83 | 84 | path = file_path; 85 | path += file_name + "_"; 86 | path += file_index+ "."; 87 | path += file_type; 88 | 89 | return path; 90 | } 91 | 92 | 93 | ///------------------------------------------------------------------------------------------------ 94 | /// material override 95 | 96 | void mat_over(string actual, override_name, override_value; int override_is_string) 97 | { 98 | string contents, add, value; 99 | value = override_value; 100 | contents = slice(actual,1,-1); // to remove brackets { } 101 | if (override_is_string) { 102 | value = "'" + value + "'"; 103 | } 104 | add = "'" + override_name + "':" + value; 105 | actual = "{" + contents + add + ",}"; 106 | } 107 | 108 | // ogl_opacitymap RS 109 | // basecolor_texture MANTRA 110 | 111 | string override_name = chs("override_name"); 112 | string override_value = chs("override_value"); 113 | int override_is_string = chi("override_is_string"); //toggle 114 | 115 | mat_over(s@material_override , override_name, override_value , override_is_string); 116 | 117 | -------------------------------------------------------------------------------- /python3.11libs/__backup/wf_render.py - v00 abandoned two sceneviews: -------------------------------------------------------------------------------- 1 | import hou 2 | import nodesearch 3 | 4 | 5 | # create .py script for each selected ROP, to render it 6 | # create .bat file, which renders all the created .py with hython simultaneously 7 | def batch_script_rop () : 8 | 9 | import os 10 | 11 | path_hip = hou.expandString('$HIP') 12 | path_hipfile = hou.expandString('$HIPFILE') 13 | path_hython = hou.expandString('$HB') + '/hython.exe' 14 | path_scripts = path_hip + '/scripts/' 15 | 16 | if not os.path.exists(path_scripts): 17 | os.makedirs(path_scripts) 18 | 19 | script_bat = 'REM This batch file runs multiple .py scripts at once \n' 20 | 21 | for rop in hou.selectedNodes() : 22 | # .py script 23 | script_rop = '# This .py script opens a file and renders single rop\n' 24 | script_rop += 'hou.hipFile.load("' + path_hipfile + '")\n' 25 | script_rop += 'node = hou.node("' + rop.path() + '")\n' 26 | script_rop += 'node.render(verbose=True,output_progress=True)' 27 | 28 | # write .py to disk 29 | path_py = path_scripts + rop.name() + '.py' 30 | file_py = open( path_py, "w") 31 | file_py.write(script_rop) 32 | 33 | # .bat script 34 | script_bat += 'start "Render: ' + rop.name() + '" "' 35 | script_bat += path_hython + '" "' 36 | script_bat += path_py + '"\n' 37 | 38 | 39 | # write .bat to disk 40 | path_bat = path_hip + '/_render_' + rop.name() + '.bat' 41 | file_rop = open( path_bat, "w") 42 | file_rop.write(script_bat) 43 | 44 | 45 | 46 | 47 | def kill () : 48 | sceneview_main = hou.ui.curDesktop().findPaneTab("pt_sceneview_1") 49 | # if sceneview_main.currentState() == "karma" : 50 | try: 51 | sceneview_main.setHydraRenderer("Houdini GL") 52 | sceneview_main.restartRenderer() 53 | except: 54 | pass 55 | 56 | 57 | 58 | 59 | def start () : 60 | 61 | sceneview_main = hou.ui.curDesktop().findPaneTab("pt_sceneview_1") 62 | sceneview_edit = hou.ui.curDesktop().findPaneTab("pt_sceneview_2") 63 | 64 | pe_1 = hou.ui.curDesktop().findPaneTab("pt_parmeditor_1") 65 | nw_1 = hou.ui.curDesktop().findPaneTab("pt_network_1") 66 | 67 | # find active lopnet 68 | #----------------------------------------------- 69 | root = hou.node("/obj") 70 | matcher = nodesearch.NodeType( "lopnet", exact=True ) 71 | lopnets = matcher.nodes( root, recursive=False ) 72 | lopnet_active = lopnets[0] 73 | 74 | for lopnet in lopnets : 75 | if lopnet.userData("lopnet_active") == "on": 76 | lopnet_active = lopnet 77 | 78 | 79 | # lock 80 | #----------------------------------------------- 81 | sceneview_main.setLinkGroup(hou.paneLinkType.Pinned) 82 | sceneview_edit.setLinkGroup(hou.paneLinkType.Pinned) 83 | pe_1.setLinkGroup(hou.paneLinkType.Pinned) 84 | nw_1.setLinkGroup(hou.paneLinkType.Pinned) 85 | 86 | # set pwd 87 | #----------------------------------------------- 88 | sceneview_main.setPwd(lopnet_active) 89 | hou.hscript("viewcamera -c /cam wf_desktop.pt_sceneview_1.solaris.persp1") 90 | 91 | 92 | # unlock edit 93 | #----------------------------------------------- 94 | pe_1.setLinkGroup(hou.paneLinkType.FollowSelection) 95 | # nw_1.setLinkGroup(hou.paneLinkType.FollowSelection) 96 | sceneview_edit.setLinkGroup(hou.paneLinkType.FollowSelection) 97 | 98 | # set camera 99 | #----------------------------------------------- 100 | # this is a bug 101 | # lopnet_camera = lopnet_active.parm("force_cam").evalAsNode() 102 | # sceneview_main.curViewport().setCamera(lopnet_camera) 103 | # wf_desktop.pt_sceneview_1.solaris 104 | 105 | 106 | 107 | # restart Karma render (or set Karma as renderer) 108 | #----------------------------------------------- 109 | try: 110 | if sceneview_main.currentHydraRenderer() == "Karma" : 111 | sceneview_main.restartRenderer() 112 | else : 113 | sceneview_main.setHydraRenderer("Karma") 114 | except: 115 | pass -------------------------------------------------------------------------------- /toolbar/wf_timeline.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 63 | 64 | 65 | 66 | 70 | 71 | 72 | 73 | 77 | 78 | 79 | 80 | 84 | 85 | 86 | 87 | 91 | 92 | 93 | 94 | 98 | 99 | 100 | 101 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /python3.11libs/wf_hotkeys.py: -------------------------------------------------------------------------------- 1 | import hou 2 | import imp 3 | 4 | import wf_selection 5 | #imp.reload(wf_selection) 6 | 7 | import wf_sceneview 8 | #imp.reload(wf_sceneview) 9 | 10 | import wf_music 11 | #imp.reload(wf_music) 12 | 13 | import wf_network_parm 14 | # imp.reload(wf_network_parm) 15 | 16 | import wf_timeline 17 | #imp.reload(wf_timeline) 18 | 19 | import wf_network_connection 20 | #imp.reload(wf_network_connection) 21 | 22 | def cursor_over_music() : 23 | if wf_selection.cursor_linkGroup() == hou.paneLinkType.Group3 : 24 | return True 25 | else: 26 | return False 27 | 28 | ##################### 29 | ##################### 30 | 31 | 32 | 33 | 34 | def hotkey_z () : 35 | if cursor_over_music() : 36 | wf_music.camera_scope_track_active() 37 | else : 38 | wf_sceneview.frame_selected() 39 | 40 | 41 | def hotkey_z_shift () : 42 | if cursor_over_music() : 43 | wf_music.camera_scope_track_all() 44 | else : 45 | wf_sceneview.frame_all() 46 | 47 | 48 | def hotkey_f_alt () : 49 | if cursor_over_music() : 50 | wf_music.timeline_playrange_from_camera() 51 | else : 52 | wf_timeline.playrange_from_job() 53 | 54 | 55 | 56 | def hotkey_j () : 57 | if cursor_over_music() : 58 | wf_music.camera_scope_playrange() 59 | else : 60 | pass 61 | 62 | 63 | ##################### 64 | ##################### 65 | 66 | def hotkey_left_ctrl_shift () : 67 | wf_music.timeline_jump_bar(-1) 68 | 69 | 70 | def hotkey_right_ctrl_shift () : 71 | wf_music.timeline_jump_bar(1) 72 | 73 | 74 | 75 | ##################### 76 | ##################### 77 | 78 | 79 | 80 | def hotkey_pgup() : 81 | if cursor_over_music() : 82 | wf_music.tracks_activate(1) 83 | else : 84 | wf_network_connection.selection_go([0,1],False) 85 | 86 | 87 | 88 | def hotkey_pgdn() : 89 | if cursor_over_music() : 90 | wf_music.tracks_activate(-1) 91 | else : 92 | wf_network_connection.selection_go([0,-1],False) 93 | 94 | 95 | 96 | def hotkey_pgup_shift() : 97 | print("music") 98 | 99 | 100 | def hotkey_pgdp_shift() : 101 | print("music") 102 | 103 | 104 | def hotkey_pgup_ctrl() : 105 | print("music") 106 | # select tracks 107 | 108 | 109 | def hotkey_pgdn_ctrl() : 110 | print("music") 111 | # select track 112 | 113 | 114 | 115 | def hotkey_pgup_ctrl_shift() : 116 | if cursor_over_music() : 117 | print("music") 118 | else : 119 | wf_network_connection.selection_go([0,1],True) 120 | 121 | 122 | 123 | def hotkey_pgdn_ctrl_shift() : 124 | if cursor_over_music() : 125 | print("music") 126 | else : 127 | wf_network_connection.selection_go([0,-1],True) 128 | 129 | 130 | 131 | 132 | 133 | ##################### 134 | ##################### 135 | 136 | # this is abandoned because of JOB hotkey in the network 137 | # def hotkey_enter_alt() : 138 | # if cursor_over_music() : 139 | # wf_music.span_edit() 140 | # else : 141 | # pass 142 | 143 | 144 | # this is abandoned because of JOB hotkey in the network 145 | # def hotkey_enter_ctrl_shift() : 146 | # if cursor_over_music() : 147 | # wf_music.note_create() 148 | # else : 149 | # pass 150 | 151 | 152 | ##################### 153 | ##################### 154 | 155 | 156 | def hotkey_del_ctrl() : 157 | if cursor_over_music() : 158 | wf_music.tracks_visualize_toggle("spectrum") 159 | else : 160 | wf_network_parm.flag_bypass() 161 | 162 | 163 | def hotkey_ins() : 164 | if cursor_over_music() : 165 | wf_music.tracks_visualize_toggle("arrays") 166 | else : 167 | wf_network_parm.flag_display() 168 | 169 | 170 | def hotkey_ins_shift() : 171 | if cursor_over_music() : 172 | wf_music.timeline_click_time() 173 | else : 174 | wf_network_connection.create_by_y() 175 | 176 | 177 | def hotkey_ins_ctrl() : 178 | if cursor_over_music() : 179 | wf_music.tracks_visualize_toggle("clones") 180 | else : 181 | wf_network_parm.flag_bypass() 182 | 183 | 184 | def hotkey_ins_ctrl_shift () : 185 | if cursor_over_music() : 186 | wf_music.tracks_visualize_toggle("bpm") 187 | else : 188 | wf_network_parm.flag_bypass() 189 | 190 | 191 | -------------------------------------------------------------------------------- /python3.11libs/wf_gltf.py: -------------------------------------------------------------------------------- 1 | # import wf_gltf; import imp; imp.reload(wf_gltf); node = kwargs["node"] ; wf_gltf.create_obj_imports(node) 2 | 3 | 4 | # wf::gltf_export_points::1.0 5 | # wf // gltf / export points 6 | # Q:/_gd/houdini_packages/wf_workflow/otls/wf_gltf_export_points.hdalc 7 | 8 | import hou 9 | 10 | # -------------------------------------------------------------------------------------------------------------------------------------------- 11 | 12 | 13 | def create_obj_imports (importer_node): 14 | 15 | node_points = importer_node.node("points") 16 | geo = node_points.geometry() 17 | npoints = geo.attribValue("npoints") 18 | name = importer_node.parm("name").evalAsString() 19 | 20 | 21 | for index in range(npoints): 22 | # posx = 0; 23 | # posy = 3 * index; 24 | # print (import_name) 25 | 26 | import_name = name + "__" + (f'{index:04}') 27 | import_node = hou.node("/obj").createNode('geo',import_name) 28 | import_box = import_node.createNode('box',"box_" + import_name) 29 | import_box.parm("scale").set("0.1") 30 | 31 | expression_path = node_points.path() 32 | expression_x = 'point("' + expression_path + '",opdigits("."),"P",0)' 33 | expression_y = 'point("' + expression_path + '",opdigits("."),"P",1)' 34 | expression_z = 'point("' + expression_path + '",opdigits("."),"P",2)' 35 | 36 | import_node.parm("tx").setExpression(expression_x) 37 | import_node.parm("ty").setExpression(expression_y) 38 | import_node.parm("tz").setExpression(expression_z) 39 | 40 | 41 | 42 | 43 | # ---------------------------------------------- 44 | parm = import_node.parm("tx") 45 | values = [] 46 | for i in range(300): 47 | val = parm.evalAsFloatAtFrame(i) 48 | values.append(val) 49 | parm.deleteAllKeyframes() 50 | for i in range(300): 51 | if i == 1 or i == 150 or i == 299 : 52 | myKey = hou.Keyframe() 53 | myKey.setFrame(i) 54 | myKey.setValue(values[i]) 55 | parm.setKeyframe(myKey) 56 | 57 | 58 | # ---------------------------------------------- 59 | parm = import_node.parm("ty") 60 | values = [] 61 | for i in range(300): 62 | val = parm.evalAsFloatAtFrame(i) 63 | values.append(val) 64 | parm.deleteAllKeyframes() 65 | for i in range(300): 66 | if i == 1 or i == 150 or i == 299 : 67 | myKey = hou.Keyframe() 68 | myKey.setFrame(i) 69 | myKey.setValue(values[i]) 70 | parm.setKeyframe(myKey) 71 | 72 | # ---------------------------------------------- 73 | parm = import_node.parm("tz") 74 | values = [] 75 | for i in range(300): 76 | val = parm.evalAsFloatAtFrame(i) 77 | values.append(val) 78 | parm.deleteAllKeyframes() 79 | for i in range(300): 80 | if i == 1 or i == 150 or i == 299 : 81 | myKey = hou.Keyframe() 82 | myKey.setFrame(i) 83 | myKey.setValue(values[i]) 84 | parm.setKeyframe(myKey) 85 | 86 | 87 | print("done: " + str(index)) 88 | 89 | 90 | # # -------------------- 91 | # # create object merge 92 | 93 | # name_merge = name 94 | # node_merge = importer_node.parent().createNode('object_merge',name_merge) 95 | # node_merge.parm("objpath1").set(objpath) 96 | # node_merge.parm("xformtype").set(1) 97 | # node_merge.moveToGoodPosition() 98 | 99 | # # -------------------- 100 | # # create filecache 101 | # node_filecache = node_merge.createOutputNode("filecache", node_name = "cache_" + name) 102 | # node_filecache.parm("loadfromdisk").set(1) 103 | # node_filecache.parm("timedependent").set(0) 104 | # node_filecache.parm("enableversion").set(0) 105 | # node_filecache.parm("basename").set("$OS") 106 | # node_filecache.parm("basedir").set("$HIP/fbx_merge") 107 | # node_filecache.parm("cachedir").set('`chs("basedir")`') 108 | 109 | # # -------------------- 110 | # # create null 111 | # node_null = node_filecache.createOutputNode("null", node_name = name) 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /toolbar/wf_network_ui.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 33 | 34 | 35 | 36 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 69 | 70 | 71 | 72 | 73 | OBJ 74 | 75 | _workflow 76 | 80 | 81 | 82 | 83 | 84 | OBJ 85 | SOP 86 | CHOP 87 | ROP 88 | SHOP 89 | COP2 90 | VOP 91 | VOPNET 92 | DOP 93 | 94 | _workflow 95 | 99 | 100 | 101 | 102 | 103 | OBJ 104 | SOP 105 | DOP 106 | 107 | 111 | 112 | 113 | 114 | 115 | SOP 116 | DOP 117 | 118 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /vex_src/docs/docs_transforms.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// sample direction cone 3 | 4 | vector center_dir = {0,1,0}; 5 | float maxangle = radians( chf("maxangle") ); // 45 in 0 to 90 6 | vector2 uv = rand(@ptnum); 7 | // vector2 uv = set(u, v); 8 | 9 | v@N = sample_direction_cone( center_dir, maxangle, uv ); 10 | 11 | 12 | 13 | ///------------------------------------------------------------------------------------------------ 14 | /// sample orientation cone 15 | 16 | vector center_dir = {0,1,0}; 17 | float maxangle = radians( chf("maxangle") ); // 45 in 0 to 90 18 | vector uvw = rand(@ptnum); 19 | // vector uvw = set(u, v, w); 20 | 21 | p@orient = sample_orientation_cone( center_dir, maxangle, uvw ); 22 | 23 | 24 | 25 | ///------------------------------------------------------------------------------------------------ 26 | /// dihedral - rotate a >> b - matrix3 27 | matrix3 xform = dihedral(from, to); 28 | 29 | // tip: 30 | // rotate(xform, amount, axis); 31 | 32 | // apply: 33 | // @orient = quaternion(xform); 34 | 35 | ///------------------------------------------------------------------------------------------------ 36 | /// dihedral - rotate a >> b - quaternion 37 | vector4 q = dihedral(from, to); 38 | 39 | // apply: 40 | // @N = qrotate(q,@N); 41 | 42 | ///------------------------------------------------------------------------------------------------ 43 | /// quaternion - matrix3 >> quaternion 44 | matrix3 m = ident(); 45 | @orient = quaternion(m); 46 | 47 | 48 | ///------------------------------------------------------------------------------------------------ 49 | /// NDC - camera space 50 | // x: 0 to 1 51 | // y: 0 to 1 52 | // z: distance from camera (houdini units) 53 | // z: negative is in front of camera 54 | // z: remains perpendicular to cam 55 | 56 | string cam = chs("cam"); // node 57 | 58 | @P = toNDC(cam, @P); 59 | @P.z = chf("depth"); // -1 in -10 to 0 60 | @P = fromNDC(cam, @P); 61 | 62 | ///------------------------------------------------------------------------------------------------ 63 | /// rotate - matrix around axis 64 | float angle = radians( chf("angle") ); // 45 in 0 to 90 65 | vector axis = {0,1,0}; 66 | matrix3 m = ident(); 67 | rotate(m, angle, axis); 68 | 69 | 70 | ///------------------------------------------------------------------------------------------------ 71 | /// lookat 72 | 73 | vector from; 74 | vector to; 75 | vector up; 76 | float roll; 77 | 78 | matrix3 m = lookat(from, to); 79 | matrix3 m = lookat(from, to, roll); 80 | matrix3 m = lookat(from, to, up); 81 | 82 | @P *= -m; 83 | 84 | 85 | ///------------------------------------------------------------------------------------------------ 86 | /// matrix instance 87 | 88 | vector P; 89 | vector N; 90 | vector scale; 91 | vector4 rotate; 92 | vector4 orient; 93 | vector pivot; 94 | 95 | matrix m = instance(P, N); 96 | matrix m = instance(P, N, scale); 97 | matrix m = instance(P, N, scale, pivot); 98 | matrix m = instance(P, N, scale, rotate, up); 99 | matrix m = instance(P, N, scale, rotate, up, pivot); 100 | matrix m = instance(P, N, scale, rotate, orient); 101 | matrix m = instance(P, N, scale, rotate, orient, pivot); 102 | 103 | 104 | ///------------------------------------------------------------------------------------------------ 105 | /// qrotate - rotate vector by quaternion 106 | vector4 quaternion; 107 | vector v; 108 | v = qrotate(quaternion, v); 109 | 110 | 111 | ///------------------------------------------------------------------------------------------------ 112 | /// cracktransform - quaternion >> euler 113 | vector4 quaternion = @orient; 114 | matrix m = matrix( qconvert( quaternion ) ); 115 | vector euler = cracktransform(0, 0, 1, {0,0,0}, m); 116 | 117 | ///------------------------------------------------------------------------------------------------ 118 | /// maketransform - N + up >> quaternion 119 | vector z = @N; 120 | vector y = {0,1,0}; 121 | matrix3 m = maketransform(z, y); 122 | vector4 orient = quaternion(m); 123 | 124 | ///------------------------------------------------------------------------------------------------ 125 | /// makebasis - N + up >> orthonormal 126 | 127 | vector xaxis; // gets overwritten 128 | vector yaxis; // gets overwritten 129 | vector zaxis = point(1,"N",0); // camera Z direction 130 | vector up = {0,-1,0}; 131 | 132 | makebasis(xaxis, yaxis, zaxis, up); 133 | matrix3 xform = maketransform(zaxis, yaxis); 134 | @P *= xform; 135 | 136 | ///------------------------------------------------------------------------------------------------ 137 | /// qmultiply - rotate quaternion by quaternion 138 | 139 | vector4 rotate; 140 | @orient = qmultiply(@orient, rotate); 141 | 142 | ///------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /toolbar/wf_network_parm.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | 57 | 58 | OBJ 59 | SOP 60 | CHOP 61 | ROP 62 | SHOP 63 | COP2 64 | VOP 65 | VOPNET 66 | DOP 67 | 68 | _workflow 69 | 73 | 74 | 75 | 76 | 77 | OBJ 78 | SOP 79 | CHOP 80 | ROP 81 | SHOP 82 | COP2 83 | VOP 84 | VOPNET 85 | DOP 86 | 87 | _workflow 88 | 92 | 93 | 94 | 95 | 96 | OBJ 97 | 98 | _workflow 99 | 103 | 104 | 105 | 106 | 110 | 111 | 112 | 113 | 117 | 118 | 119 | 120 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /python3.11libs/wf_network_connection.py: -------------------------------------------------------------------------------- 1 | import hou 2 | import imp 3 | import wf_selection 4 | imp.reload(wf_selection) 5 | 6 | 7 | def get_last_descendant (node) : 8 | try : 9 | last_descendant = node.outputs()[0] 10 | except : 11 | last_descendant = node 12 | 13 | 14 | if last_descendant == node : 15 | return node 16 | else : 17 | return get_last_descendant(last_descendant) 18 | 19 | 20 | def get_siblings ( current, inputs, outputs ) : 21 | siblings = [] 22 | for input in inputs : 23 | for candidate in input.outputs() : 24 | if candidate != current : siblings.append(candidate) 25 | for output in outputs : 26 | for candidate in output.inputs() : 27 | if candidate != current : siblings.append(candidate) 28 | return siblings 29 | 30 | 31 | def selection_find ( current, direction, candidates ) : 32 | target_list = [] 33 | 34 | for target in candidates : 35 | vec_target = hou.Vector2.normalized( target.position() - current.position() ) 36 | vec_direction = hou.Vector2.normalized( hou.Vector2(direction) ) 37 | len_target = hou.Vector2.length( target.position() - current.position() ) 38 | dot = vec_target.dot(vec_direction) 39 | weight = dot / (len_target+0.01) 40 | # print str(child) + " / " + str(dot) 41 | target_list.append([target,weight]) 42 | 43 | target_list = sorted(target_list, key=lambda x: -x[1]) 44 | closest = target_list[0] 45 | return closest[0] 46 | 47 | 48 | def selection_go( direction, parent ) : 49 | parm_pane = wf_selection.pane_linkGroup( hou.paneTabType.NetworkEditor ) 50 | if parent == True : current = parm_pane.currentNode().parent() 51 | else : current = parm_pane.currentNode() 52 | 53 | target = current 54 | inputs = current.inputs() 55 | outputs = current.outputs() 56 | inputs_count = len(inputs) 57 | outputs_count = len(outputs) 58 | 59 | if direction == [0,1] : 60 | # UP 61 | # we have to test if inputs[0] is wired 62 | if inputs_count > 0 : 63 | if inputs[0] == None : 64 | try: 65 | target = inputs[1] 66 | except : 67 | pass 68 | else: 69 | target = inputs[0] 70 | else : 71 | target = selection_find(current, direction, current.parent().children()) 72 | 73 | 74 | if direction == [0,-1] : 75 | if outputs_count > 0 : target = outputs[0] 76 | else : target = selection_find(current, direction, current.parent().children()) 77 | 78 | if direction == [-1,0] or direction == [1,0] : 79 | siblings = get_siblings ( current, inputs, outputs ) 80 | if len(siblings) == 0 : target = selection_find(current, direction, current.parent().children()) 81 | else : target = selection_find(current, direction, siblings) 82 | 83 | 84 | if parent == True : parm_pane.cd(target.path()) 85 | else : parm_pane.setCurrentNode(target) 86 | 87 | 88 | 89 | def sort_by_x () : 90 | node_merge = wf_selection.parmnode() 91 | # list contains pairs [ [node,position] , [node,position] , ... ] 92 | node_list = [] 93 | for node in node_merge.inputs(): 94 | node_list_pair = [] 95 | node_list_pair.append(node) 96 | node_list_pair.append(node.position()[0]) 97 | node_list.append(node_list_pair) 98 | 99 | # first item is left 100 | node_list = sorted(node_list, key=lambda x: x[1]) 101 | # create connections 102 | for (i,pair) in enumerate(node_list): 103 | node_merge.setInput(i, pair[0]) 104 | 105 | 106 | def create_by_y () : 107 | # list contains pairs [ [node,position] , [node,position] , ... ] 108 | node_list = [] 109 | for node in hou.selectedNodes() : 110 | node_list_pair = [] 111 | node_list_pair.append(node) 112 | node_list_pair.append(node.position()[1]) 113 | node_list.append(node_list_pair) 114 | 115 | # first item is top 116 | node_list = sorted(node_list, key=lambda x: -x[1]) 117 | # create connections 118 | for (i,pair) in enumerate(node_list): 119 | if i>0 : 120 | node_this = pair[0] 121 | node_prev = node_list[i-1][0] 122 | node_this.setInput(0, node_prev) 123 | 124 | def toggle_dependencies () : 125 | network_pane = wf_selection.pane_linkGroup( hou.paneTabType.NetworkEditor ) 126 | view_dependencies = hou.getenv("view_dependencies", "0") 127 | if view_dependencies == "0": view_dependencies = "1" 128 | else: view_dependencies = "0" 129 | hou.putenv("view_dependencies", view_dependencies) 130 | network_pane.setPref('showdep',str(view_dependencies)) 131 | network_pane.setPref('showspareinputdep',str(view_dependencies)) 132 | # print(network_pane.getPrefs()) -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/noise.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// noise vector static 3 | #include "qq.vfl" 4 | //--- 5 | float amp = chf("amplitude"); // 3 in 0 to 5 6 | //--- 7 | float f = chf("frequency"); // 1 in 0 to 10 8 | float fx = chf("frequency_x"); // 1 in 0 to 10 9 | float fy = chf("frequency_y"); // 1 in 0 to 10 10 | float fz = chf("frequency_z"); // 1 in 0 to 10 11 | //--- 12 | int turb = chi("turbulence"); // 1 in 0 to 5 13 | float rough = chf("roughness"); // 0.5 in 0 to 1 14 | float atten = chf("attenuation"); // 1 in 0 to 1 15 | 16 | // noise FUNCTION 17 | 18 | float ox = 1.23; 19 | float oy = 2.34; 20 | float oz = 3.45; 21 | float px = @rest.x; //@uv.x @P.x 22 | float py = @rest.y; //@uv.y @P.y 23 | float pz = @rest.z; //@uv.z @P.z 24 | 25 | v@noise = noise_vstat ( px, py, pz , f, fx, fy, fz, ox, oy, oz, turb, rough, atten, amp ); 26 | 27 | ///------------------------------------------------------------------------------------------------ 28 | /// noise vector animated 29 | #include "qq.vfl" 30 | //--- 31 | float amp = chf("amplitude"); // 3 in 0 to 5 32 | //--- 33 | float f = chf("frequency"); // 1 in 0 to 10 34 | float fx = chf("frequency_x"); // 1 in 0 to 10 35 | float fy = chf("frequency_y"); // 1 in 0 to 10 36 | float fz = chf("frequency_z"); // 1 in 0 to 10 37 | //--- 38 | float s = chf("speed"); // 1 in 0 to 10 39 | float sx = chf("speed_x"); // 1 in 0 to 1 40 | float sy = chf("speed_y"); // 1 in 0 to 1 41 | float sz = chf("speed_z"); // 1 in 0 to 1 42 | //---- 43 | int turb = chi("turbulence"); // 1 in 0 to 5 44 | float rough = chf("roughness"); // 0.5 in 0 to 1 45 | float atten = chf("attenuation"); // 1 in 0 to 1 46 | 47 | 48 | // noise FUNCTION 49 | 50 | float ox = 1.23; 51 | float oy = 2.34; 52 | float oz = 3.45; 53 | float time = @Time; 54 | float px = @rest.x; //@uv.x @P.x 55 | float py = @rest.y; //@uv.y @P.y 56 | float pz = @rest.z; //@uv.z @P.z 57 | 58 | v@noise = noise_vanim ( px, py, pz , f, fx, fy, fz, s, sx, sy, sz, ox, oy, oz, time, turb, rough, atten, amp ); 59 | 60 | ///------------------------------------------------------------------------------------------------ 61 | /// noise vector curl 62 | #include "qq.vfl" 63 | //--- 64 | float amp = chf("amplitude"); // 3 in 0 to 5 65 | //--- 66 | float f = chf("frequency"); // 1 in 0 to 10 67 | float fx = chf("frequency_x"); // 1 in 0 to 10 68 | float fy = chf("frequency_y"); // 1 in 0 to 10 69 | float fz = chf("frequency_z"); // 1 in 0 to 10 70 | //--- 71 | float s = chf("speed"); // 1 in 0 to 10 72 | float sx = chf("speed_x"); // 1 in 0 to 1 73 | float sy = chf("speed_y"); // 1 in 0 to 1 74 | float sz = chf("speed_z"); // 1 in 0 to 1 75 | //--- 76 | float st = chf("speed_time"); // 1 in 0 to 1 77 | 78 | 79 | // noise FUNCTION 80 | 81 | float ox = 1.23; 82 | float oy = 2.34; 83 | float oz = 3.45; 84 | float time = @Time; 85 | float px = @rest.x; //@uv.x @P.x 86 | float py = @rest.y; //@uv.y @P.y 87 | float pz = @rest.z; //@uv.z @P.z 88 | 89 | v@v = noise_vanim_curl ( px, py, pz , f, fx, fy, fz, s, sx, sy, sz, st, ox, oy, oz, time, amp ); 90 | 91 | ///------------------------------------------------------------------------------------------------ 92 | /// noise float static 93 | #include "qq.vfl" 94 | //--- 95 | float amp = chf("amplitude"); // 3 in 0 to 5 96 | float f = chf("frequency"); // 1 in 0 to 10 97 | //--- 98 | int turb = chi("turbulence"); // 1 in 0 to 5 99 | float rough = chf("roughness"); // 0.5 in 0 to 1 100 | float atten = chf("attenuation"); // 1 in 0 to 1 101 | 102 | 103 | // noise FUNCTION 104 | 105 | float offset = 1.23; 106 | float pos = dimension; 107 | 108 | f@noise = noise_fstat ( pos, f, offset, turb, rough, atten, amp ); 109 | 110 | ///------------------------------------------------------------------------------------------------ 111 | /// noise vector from uv 112 | #include "qq.vfl" 113 | 114 | //--- 115 | float amp = chf("amplitude"); // 3 in 0 to 5 116 | float f = chf("frequency"); // 1 in 0 to 10 117 | //--- 118 | float su = chf("speed_along"); // 1 in 0 to 10 119 | float sv = chf("speed_cross"); // 1 in 0 to 10 120 | //---- 121 | int turb = chi("turbulence"); // 1 in 0 to 5 122 | float rough = chf("roughness"); // 0.5 in 0 to 1 123 | float atten = chf("attenuation"); // 1 in 0 to 1 124 | 125 | // noise FUNCTION 126 | 127 | float ou = 1.23; 128 | float ov = 2.34; 129 | float time = @Time; 130 | float u = @uv.x; // 131 | float v = @rest.y; //@uv.y @P.y 132 | 133 | v@noise = noise_fanim_uv ( u, v, f, su, sv, ou, ov, time, turb, rough, atten, amp ); 134 | -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/range.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// range to clip - dim 3 | v@__rest = @P; 4 | 5 | float dim = @dim; 6 | float start = chf("start"); // 0.5 in 0.0 to 1.0 7 | float end = chf("end"); // 0.5 in 0.0 to 1.0 8 | float slope = (end-start) * 0.5; 9 | 10 | @range = fit(dim, start-slope, start+slope, -1, 1); 11 | @range -= fit(dim, end-slope, end+slope, 0, 2); 12 | 13 | @P.y = @range; 14 | 15 | 16 | ///------------------------------------------------------------------------------------------------ 17 | /// range to clip - dim random 18 | // run over points 19 | #include "qq.vfl" 20 | 21 | v@__rest = @P; 22 | float seed = prim(0, "copynum", @primnum); 23 | float time = @Time; 24 | float dim = @dim; 25 | 26 | //---- rand speed 27 | float speed = chf("speed"); // 0.5 in 0.0 to 1 28 | float speed_rand_min = chf("speed_rand_min"); // 0.4 in 0 to 1 29 | float speed_rand_max = chf("speed_rand_max"); // 0.6 in 0 to 1 30 | 31 | //---- rand length 32 | float length = chf("length"); // 0.5 in 0.0 to 1 33 | float length_rand_min = chf("length_rand_min"); // 0.4 in 0 to 1 34 | float length_rand_max = chf("length_rand_max"); // 0.6 in 0 to 1 35 | 36 | //---- rand direction 37 | int both_directions = chi("both_directions"); // toggle 38 | 39 | 40 | 41 | // range FUNCTION 42 | vector2 range = range_random(speed, speed_rand_min, speed_rand_max, length, length_rand_min, length_rand_max, seed, time, both_directions); 43 | float slope = (range[1]-range[0]) * 0.5; 44 | 45 | float range_clip_y; 46 | range_clip_y = fit(@dim, range[0]-slope, range[0]+slope, -1, 1); 47 | range_clip_y -= fit(@dim, range[1]-slope, range[1]+slope, 0, 2); 48 | 49 | @P.y = range_clip_y; 50 | 51 | 52 | ///------------------------------------------------------------------------------------------------ 53 | /// range to clip - nurbs corners 54 | // expects: xe // nurbs carve by range 55 | // run over points 56 | 57 | float radius = chf("radius"); // 0.5 in 0.0 to 1.0 58 | float uv_u, uv_v, dist_u, dist_v, sum, uv_ratio; 59 | 60 | v@__rest = @P; 61 | radius = max(0.0001, radius); 62 | 63 | // read attribs 64 | uv_u = v@uv_norm[0]; 65 | uv_v = v@uv_norm[1]; 66 | uv_ratio = prim(0, "uv_ratio", @primnum); 67 | 68 | // mirror and uv_ratio: 69 | uv_u = min( uv_u , 1 - uv_u) / uv_ratio; 70 | uv_v = min( uv_v , 1 - uv_v); 71 | 72 | // distance (fill into shape) 73 | dist_u = max(radius - uv_u , 0); 74 | dist_v = max(radius - uv_v , 0); 75 | 76 | // a2 + b2 = c2 77 | sum = pow ( dist_u , 2); 78 | sum += pow ( dist_v , 2); 79 | 80 | @P.y = radius - sqrt(sum); 81 | 82 | 83 | ///------------------------------------------------------------------------------------------------ 84 | /// range to carve - nurbs along UV 85 | #include "qq.vfl" 86 | // run over primitives 87 | // outputs attributes for further carving 88 | float seed = prim(0, "copynum", @primnum); 89 | float time = @Time; 90 | 91 | //---- rand speed 92 | float speed = chf("speed"); // 0.5 in 0.0 to 1 93 | float speed_rand_min = chf("speed_rand_min"); // 0.4 in 0 to 1 94 | float speed_rand_max = chf("speed_rand_max"); // 0.6 in 0 to 1 95 | 96 | //---- rand length 97 | float length = chf("length"); // 0.5 in 0.0 to 1 98 | float length_rand_min = chf("length_rand_min"); // 0.4 in 0 to 1 99 | float length_rand_max = chf("length_rand_max"); // 0.6 in 0 to 1 100 | 101 | //---- rand direction 102 | int both_directions = chi("both_directions"); // toggle 103 | //---- 104 | 105 | // range U animated 106 | vector2 range = range_random(speed, speed_rand_min, speed_rand_max, length, length_rand_min, length_rand_max, seed, time, both_directions); 107 | u@uv_carve_u = set(range[0], range[1]); 108 | 109 | 110 | // range V random 111 | 112 | float width = chf("width"); // 0.5 in 0.0 to 1 113 | float width_rand_min = chf("width_rand_min"); // 0.4 in 0 to 1 114 | float width_rand_max = chf("width_rand_max"); // 0.6 in 0 to 1 115 | 116 | width *= fit01( rand(seed + 0.111) , width_rand_min , width_rand_max ); 117 | float center = fit01( rand(seed + 0.222) , width * 0.5 , 1 - width * 0.5 ); 118 | u@uv_carve_v[0] = center - width * 0.5; 119 | u@uv_carve_v[1] = center + width * 0.5; 120 | 121 | 122 | 123 | ///------------------------------------------------------------------------------------------------ 124 | /// xe rest to P 125 | @P = v@__rest; 126 | removepointattrib(0,"__rest"); 127 | 128 | 129 | ///------------------------------------------------------------------------------------------------ 130 | /// dim - sin repeater 131 | // ramp to make it dense somewhere in the middle .../''' 132 | float dim = @dim; 133 | float dim_lut = chramp("dim_lut",dim); //quad 134 | float mult = chf("mult"); // 0.5 in 0.0 to 100 135 | 136 | @dim = sin(dim_lut * mult); 137 | @Cd = @dim; 138 | 139 | // optional clip: 140 | // divide sop, polypath sop 141 | v@__rest = @P; 142 | @P.y = @range; 143 | -------------------------------------------------------------------------------- /vex_src/dim_coord_fill/time_snap.vfl: -------------------------------------------------------------------------------- 1 | ///------------------------------------------------------------------------------------------------ 2 | /// time snap one value 3 | 4 | //----- 5 | float value_at_snap = chf("value_at_snap"); // 0.5 in 0.0 to 1.0 6 | //----- 7 | int frame_snap = chi("frame_snap"); // 100 in 0 to 500 8 | int smooth_frames = chi("smooth_frames"); // 0 in -100 to 100 9 | //# negative smooth_frames means before snap 10 | //----- 11 | float speed_before = chf("speed_before"); // 0 in 0.0 to 0.1 12 | float speed_after = chf("speed_after"); // 0 in 0.0 to 0.1 13 | 14 | int frame_current = int (rint(@Frame)); 15 | 16 | float value = time_snap_one_value(frame_current, frame_snap, smooth_frames, value_at_snap, speed_before, speed_after); 17 | 18 | float time_snap_one_value(int frame_current, frame_snap, smooth_frames; float value_at_snap, speed_before, speed_after) 19 | 20 | { 21 | int frame_0 = min(frame_snap,frame_snap + smooth_frames); 22 | int frame_1 = max(frame_snap,frame_snap + smooth_frames); 23 | 24 | 25 | // distance linear after 26 | int frames_lin_after = max(0, frame_current-frame_1 ); 27 | float distance_lin_after = frames_lin_after * speed_after; 28 | 29 | 30 | // distance linear before 31 | int frames_lin_before = min(0, frame_current-frame_0 ); 32 | float distance_lin_before = frames_lin_before * speed_before; 33 | 34 | 35 | // distance smooth 36 | int range_start = 0; 37 | int range_end = 0; 38 | float sign = 0; 39 | 40 | if (frame_current > frame_snap && smooth_frames > 0) 41 | { 42 | range_start = frame_snap; 43 | range_end = min(frame_current, frame_1); 44 | sign = 1.0; 45 | } 46 | 47 | if (frame_current < frame_snap && smooth_frames < 0) 48 | { 49 | range_start = max(frame_current, frame_0); 50 | range_end = frame_snap; 51 | sign = -1.0; 52 | } 53 | 54 | float distance_smooth = 0; 55 | 56 | for (int f_in = range_start; f_in < range_end ; f_in++) 57 | { 58 | float speed = smooth(frame_0, frame_1, f_in); 59 | speed = fit01(speed,speed_before,speed_after); 60 | distance_smooth += sign * speed; 61 | } 62 | 63 | float distance; 64 | 65 | distance = value_at_snap; 66 | distance += distance_lin_before; 67 | distance += distance_lin_after; 68 | distance += distance_smooth; 69 | 70 | return distance; 71 | } 72 | 73 | 74 | ///------------------------------------------------------------------------------------------------ 75 | /// time snap two values 76 | 77 | 78 | //----- 79 | int snapframe_0 = chi("snapframe_0"); // 100 in 0 to 500 80 | int snapframe_1 = chi("snapframe_1"); // 100 in 0 to 500 81 | //----- 82 | int frames_smooth_0 = chi("frames_smooth_0"); // 10 in 0 to 100 83 | int frames_smooth_1 = chi("frames_smooth_1"); // -10 in -100 to 0 84 | //# frames_smooth_1 has to be negative (before snapframe_1) 85 | 86 | //----- 87 | float value_0 = chf("value_0"); // 0 in 0.0 to 1 88 | float value_1 = chf("value_1"); // 0 in 0.0 to 1 89 | 90 | int frame_current = int (rint(@Frame)); 91 | 92 | float value = time_snap_two_values(frame_current, snapframe_0, snapframe_1, frames_smooth_0, frames_smooth_1, value_0, value_1); 93 | 94 | 95 | float time_snap_two_values(int frame_current, snapframe_0, snapframe_1, frames_smooth_0, frames_smooth_1; float value_0, value_1) 96 | 97 | { 98 | int cur = frame_current; 99 | 100 | // check for overlaps 101 | int snap_0 = min(snapframe_0,snapframe_1); 102 | int snap_1 = max(snapframe_0,snapframe_1); 103 | 104 | int range_total = snap_1 - snap_0; 105 | int range_lin = max (0, range_total - frames_smooth_0 + frames_smooth_1); 106 | int range_0 = max (0, range_total - range_lin + frames_smooth_1); 107 | int range_1 = max (0, range_total - range_lin - range_0); 108 | 109 | // keyframes (range breaks) 110 | int key_0 = snap_0; 111 | int key_1 = snap_0 + range_0; 112 | int key_2 = snap_1 - range_1; 113 | int key_3 = snap_1; 114 | 115 | // speed 116 | float speed_normalized = float(range_0)/2 + float(range_1)/2 + float(range_lin); 117 | float speed_mult = (value_1 - value_0) / speed_normalized; 118 | float speed; 119 | 120 | float value = value_0; 121 | 122 | 123 | // distance in range 0 124 | if(range_0 > 1) 125 | { 126 | for (int f_in = key_0; f_in < min(key_1,cur) ; f_in++) 127 | { 128 | speed = speed_mult * smooth(key_0, key_1 - 1, f_in); 129 | value += speed; 130 | } 131 | } 132 | 133 | // distance in range linear 134 | if(range_lin) 135 | { 136 | for (int f_in = key_1; f_in < min(key_2,cur) ; f_in++) 137 | { 138 | speed = speed_mult; 139 | value += speed; 140 | } 141 | } 142 | 143 | // distance in range 1 144 | if(range_1 > 1) 145 | { 146 | for (int f_in = key_2; f_in < min(key_3,cur) ; f_in++) 147 | { 148 | speed = speed_mult * ( 1 - smooth(key_2, key_3 - 1, f_in) ); 149 | value += speed; 150 | } 151 | } 152 | 153 | return value; 154 | // return float(range_lin); 155 | } 156 | -------------------------------------------------------------------------------- /python3.11libs/wf_network_layout.py: -------------------------------------------------------------------------------- 1 | import hou 2 | import imp 3 | import toolutils 4 | import wf_selection 5 | imp.reload(wf_selection) 6 | 7 | 8 | def pin () : 9 | for node in hou.selectedNodes(): 10 | node.setGenericFlag(hou.nodeFlag.DisplayComment,False) 11 | if node.comment() == "`" : 12 | node.setComment("") 13 | else: 14 | node.setComment("`") 15 | 16 | 17 | 18 | def getConnectedNodes(node,got): 19 | iteration = [] 20 | 21 | inouts = [] 22 | try: 23 | inouts += node.inputs() 24 | except: 25 | pass 26 | 27 | try: 28 | inouts += node.outputs() 29 | except: 30 | pass 31 | 32 | # MOVABLE ITEMS----- 33 | try: 34 | items = node.parent().allItems() 35 | # print (items) 36 | for item in items: 37 | if (item.networkItemType() == hou.networkItemType.NetworkDot or item.networkItemType() == hou.networkItemType.SubnetIndirectInput): 38 | if item.outputs()[0] == node : 39 | temporary = [] 40 | temporary.append(item) 41 | inouts += temporary 42 | except: 43 | pass 44 | # MOVABLE ITEMS----- 45 | for inout in inouts: 46 | if inout not in got and inout != None: 47 | if inout.parent() == node.parent(): # because inputs may lead out of subnet 48 | got.append(inout) 49 | iteration.append(inout) 50 | iteration += getConnectedNodes(inout,got) 51 | 52 | return iteration 53 | 54 | 55 | # BACKUP BEFORE DOTS AND MOVABLEITEMS 56 | # def getConnectedNodes(node,got): 57 | # iteration = [] 58 | 59 | # inout = [] 60 | # try: 61 | # inout += node.inputs() 62 | # except: 63 | # has_no_inputs = 1 64 | 65 | # try: 66 | # inout += node.outputs() 67 | # except: 68 | # has_no_outputs = 1 69 | 70 | # for n in inout: 71 | # if n not in got: 72 | # got.append(n) 73 | # iteration.append(n) 74 | # iteration += getConnectedNodes(n,got) 75 | 76 | # return iteration 77 | 78 | 79 | 80 | def lay () : 81 | 82 | parm_pane = wf_selection.pane_linkGroup( hou.paneTabType.NetworkEditor ) 83 | containernode = parm_pane.currentNode().parent() 84 | containerpath = containernode.path() 85 | 86 | ################################ 87 | ######## the pins ######### 88 | ################################ 89 | 90 | # childrenArr = containernode.children() 91 | childrenArr = containernode.allItems() 92 | pinStatesArr = [] 93 | pinNodesArr = [] 94 | positionsArr = [] 95 | 96 | # store all positions 97 | for child in childrenArr: 98 | pinned = 0 99 | try: 100 | if child.comment() == "`" : 101 | pinned = 1 102 | pinNodesArr.append( child ) 103 | except: 104 | pass 105 | 106 | pinStatesArr.append( pinned ) 107 | positionsArr.append( child.position() ) 108 | 109 | 110 | # store pinned positions 111 | for pinNode in pinNodesArr: 112 | pos = pinNode.position() 113 | comment = str(pos[0]) + "," + str(pos[1]) 114 | pinNode.setComment(comment) 115 | 116 | 117 | # classic layoutChildren() 118 | containernode.layoutChildren() 119 | 120 | # reposition the branches 121 | for pinNode in pinNodesArr: 122 | 123 | pinpos = pinNode.comment() 124 | pinpos = pinpos.split(",") 125 | pinpos = [ float(pinpos[0]) , float(pinpos[1]) ] 126 | 127 | allConnected = [] 128 | allConnected = getConnectedNodes(pinNode,allConnected) 129 | 130 | pos = pinNode.position() 131 | move = [ pinpos[0] - pos[0] , pinpos[1] - pos[1] ] 132 | 133 | for connected in allConnected: 134 | try: 135 | connected.move(move) 136 | except: 137 | pass 138 | 139 | # cleanup 140 | pinNode.setPosition(pinpos) 141 | pinNode.setComment("`") 142 | 143 | 144 | 145 | ################################ 146 | ####### dat to app ######## 147 | ################################ 148 | 149 | # define offset 150 | offsetx = 3 151 | offsety = 0 152 | 153 | prefix = "REF_" 154 | 155 | refs = hou.node(containerpath).glob(prefix+"*") 156 | 157 | # for all 158 | for ref in refs: 159 | xxx,peer = ref.name().split("_") 160 | 161 | # appropriate channel node 162 | path_REF = containerpath + "/" + prefix + peer 163 | path_net = containerpath + "/" + peer 164 | 165 | node_REF = hou.node(path_REF) 166 | node_net = hou.node(path_net) 167 | 168 | 169 | 170 | # get pos 171 | posx = node_net.position()[0] + offsetx 172 | posy = node_net.position()[1] + offsety 173 | 174 | # check collisions 175 | tolerance = 2.0; 176 | for check in containernode.children() : 177 | distance = hou.Vector2.length( check.position()-hou.Vector2([posx,posy]) ) 178 | # print distance 179 | if distance < tolerance and check != node_REF: 180 | posx = posx - 2*offsetx 181 | break 182 | 183 | # set pos 184 | if node_REF.comment() != "`" : 185 | # typical dat node 186 | node_REF.setPosition( [posx,posy] ) 187 | else : 188 | # REF has custom pos, probably because it collided 189 | # so dont move it 190 | pass 191 | 192 | # shape 193 | node_REF.setUserData("nodeshape", "clipped_right") 194 | node_net.setUserData("nodeshape", "clipped_left") -------------------------------------------------------------------------------- /python3.11libs/wf_hotkeys_enter.py: -------------------------------------------------------------------------------- 1 | import hou 2 | import imp 3 | import wf_ui_panetab 4 | import wf_job_archetype_karma 5 | imp.reload(wf_ui_panetab) 6 | imp.reload(wf_job_archetype_karma) 7 | 8 | 9 | 10 | def parm_check(node_selected, parm_name) : 11 | 12 | try: 13 | parm_eval = node_selected.parm(parm_name).evalAsString() 14 | node_target = node_selected.node( parm_eval ) 15 | 16 | while node_target.isInsideLockedHDA() : 17 | node_target = node_target.parent() 18 | 19 | path_checked = node_target.path() 20 | return path_checked 21 | 22 | except: 23 | return "VOID" 24 | 25 | 26 | def find_first_valid_target(node_selected) : 27 | 28 | # ------------------------------------------------ 29 | # --------------- PARAMETERS --------------------- 30 | for parm in node_selected.parms() : 31 | try: 32 | path_checked = parm_check(node_selected, parm.name()) 33 | if path_checked != "VOID" : 34 | return path_checked 35 | except: 36 | pass 37 | 38 | # ------------------------------------------------ 39 | # --------------- DEPENDENTS --------------------- 40 | try: 41 | allSubChildren = node_selected.allSubChildren() 42 | for dependent in node_selected.dependents(False) : 43 | if dependent not in allSubChildren: 44 | while dependent.isInsideLockedHDA() : 45 | dependent = dependent.parent() 46 | path_checked = dependent.path() 47 | return path_checked 48 | except: 49 | pass 50 | 51 | # if no node found then "VOID" 52 | return "VOID" 53 | 54 | 55 | 56 | 57 | def network_set( panetab_name, node_selected, parm_name) : 58 | 59 | if panetab_name == "pt_network_2" : 60 | wf_ui_panetab.panetab_restore(script_456 = False, force_split = True) 61 | 62 | if parm_name == "ENTER_THIS_NODE" : 63 | hou.ui.curDesktop().findPaneTab(panetab_name).cd( node_selected.path() ) 64 | 65 | elif parm_name == "ENTER_FIRST_VALID" : 66 | path_found = find_first_valid_target(node_selected) 67 | hou.ui.curDesktop().findPaneTab(panetab_name).setCurrentNode( hou.node(path_found) ) 68 | 69 | else : 70 | # print (panetab_name, node_selected, parm_name) 71 | path_checked = parm_check(node_selected, parm_name) 72 | if path_checked != "VOID" : 73 | hou.ui.curDesktop().findPaneTab(panetab_name).setCurrentNode( hou.node(path_checked) ) 74 | 75 | 76 | 77 | def enter_execute(node_selected, ctrl, alt, shift ) : 78 | node_type = node_selected.type().name() 79 | archetype = node_selected.userData("archetype") 80 | 81 | 82 | # -------------------------- 83 | # exception: camera 84 | if node_type == "cam" : 85 | if alt : hou.ui.curDesktop().findPaneTab("pt_sceneview_2").curViewport().setCamera(node_selected) 86 | if ctrl : hou.ui.curDesktop().findPaneTab("pt_sceneview_1").curViewport().setCamera(node_selected) 87 | 88 | # -------------------------- 89 | # exception: lights 90 | elif node_type == "light" : 91 | if alt : hou.ui.curDesktop().findPaneTab("pt_sceneview_2").curViewport().setCamera(node_selected) 92 | if ctrl : hou.ui.curDesktop().findPaneTab("pt_sceneview_1").curViewport().setCamera(node_selected) 93 | 94 | # -------------------------- 95 | # exception: music 96 | elif node_type == "qmusic*" : 97 | # set sceneview_2 98 | # set network_2 99 | pass 100 | 101 | # -------------------------- 102 | # exception: networks 103 | elif node_type in {"chopnet", "cop2net", "dopnet", "lopnet", "matnet", "ropnet", "shopnet", "topnet"} : 104 | # if alt : network_set( "pt_network_1" , node_selected, "ENTER_THIS_NODE") 105 | if ctrl : network_set( "pt_network_1" , node_selected, "ENTER_THIS_NODE") 106 | 107 | # -------------------------- 108 | # gotoparm: geo NOT data 109 | elif node_type == "geo" and archetype != "archetype_job_geo_data" : 110 | # if alt : network_set( "pt_network_1" , node_selected, "ENTER_THIS_NODE") 111 | if ctrl : network_set( "pt_network_1" , node_selected, "ENTER_THIS_NODE") 112 | 113 | # -------------------------- 114 | # gotoparm: geo DATA 115 | elif node_type == "geo" and archetype == "archetype_job_geo_data": 116 | if alt and not shift : network_set( "pt_network_1" , node_selected, "shop_materialpath") 117 | # if alt and shift : network_set( "pt_network_1" , node_selected, "material") 118 | if ctrl and not shift : network_set( "pt_network_1" , node_selected, "job_source") 119 | # if ctrl and shift : network_set( "pt_network_1" , node_selected, "shop_materialpath") 120 | 121 | # -------------------------- 122 | # gotoparm: Material SOP 123 | elif node_type == "material": 124 | if alt and not shift : network_set( "pt_network_1" , node_selected, "shop_materialpath1") 125 | # if alt and shift : network_set( "pt_network_1" , node_selected, "material") 126 | # if ctrl and not shift : network_set( "pt_network_1" , node_selected, "job_source") 127 | # if ctrl and shift : network_set( "pt_network_1" , node_selected, "shop_materialpath") 128 | 129 | # -------------------------- 130 | # gotoparm: 131 | elif alt == True: 132 | wf_ui_panetab.panetab_restore(script_456 = False, force_split = True) 133 | 134 | material_path = wf_job_archetype_karma.karma_material_path(node_selected) 135 | panetab_name = "pt_network_2" 136 | 137 | hou.ui.curDesktop().findPaneTab(panetab_name).setCurrentNode( hou.node(material_path) ) 138 | 139 | # ALT-ENTER 140 | # if sop null camera shape (otevrit dole, nebo ve druhym) 141 | # if no sop selected - ok 142 | # if lop sopimport (otevrit to v druhym panelu, nahore?) 143 | 144 | # -------------------------- 145 | else: 146 | if ctrl : network_set( "pt_network_2" , node_selected, "ENTER_FIRST_VALID") 147 | 148 | # CTRL ENTER 149 | # if lop sopimport (otevrit to v druhym panelu) 150 | # if sop null kamera (otevrit to v druhym panelu) -------------------------------------------------------------------------------- /toolbar/wf_hotkeys.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 66 | 67 | 68 | 69 | 73 | 74 | 75 | 76 | 80 | 81 | 82 | 83 | 87 | 88 | 89 | 90 | 94 | 95 | 96 | 97 | 101 | 102 | 103 | 104 | 108 | 109 | 110 | 111 | 115 | 116 | 117 | 118 | 122 | 123 | 124 | 125 | 129 | 130 | 131 | 132 | 136 | 137 | 138 | 139 | 143 | 144 | 145 | 146 | 150 | 151 | 152 | 153 | 157 | 158 | 159 | 160 | 164 | 165 | 166 | 167 | 171 | 172 | 173 | 174 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /python3.11libs/wf_job_archetype_network.py: -------------------------------------------------------------------------------- 1 | import hou 2 | import json 3 | # import math 4 | # import numpy 5 | 6 | 7 | 8 | 9 | # def rotation_matrix(axis, theta): 10 | # """ 11 | # Return the rotation matrix associated with counterclockwise rotation about 12 | # the given axis by theta radians. 13 | # """ 14 | # axis = numpy.asarray(axis) 15 | # axis = axis / math.sqrt(numpy.dot(axis, axis)) 16 | # a = math.cos(theta / 2.0) 17 | 18 | # b, c, d = -axis * math.sin(theta / 2.0) 19 | # aa, bb, cc, dd = a * a, b * b, c * c, d * d 20 | # bc, ad, ac, ab, bd, cd = b * c, a * d, a * c, a * b, b * d, c * d 21 | 22 | # return numpy.array([[aa + bb - cc - dd, 2 * (bc + ad), 2 * (bd - ac)], 23 | # [2 * (bc - ad), aa + cc - bb - dd, 2 * (cd + ab)], 24 | # [2 * (bd + ac), 2 * (cd - ab), aa + dd - bb - cc]]) 25 | 26 | 27 | 28 | def ue_export_settings (node) : 29 | # import imp ; import wf_job_archetype_network ; imp.reload(wf_job_archetype_network) ; node = kwargs["node"] ; wf_job_archetype_network.ue_export_settings(node) 30 | 31 | 32 | # ------------ contents ------------- 33 | # job rangex rangey 34 | # job fps 35 | # camera resx, resy 36 | # camera tx, ty, tz, rx, ry, rz, 37 | # camera focus_distance 38 | # camera focal_length 39 | 40 | 41 | # ------- camera node ---------- 42 | cam_node = node.parm("job_camera").evalAsNode() 43 | 44 | # ------- camera TRS ---------- 45 | 46 | tx = cam_node.parm("tx").eval() 47 | ty = cam_node.parm("ty").eval() 48 | tz = cam_node.parm("tz").eval() 49 | rx = cam_node.parm("rx").eval() 50 | ry = cam_node.parm("ry").eval() 51 | rz = cam_node.parm("rz").eval() 52 | 53 | 54 | #--------- camera UE coordinates ------ 55 | # Houdini uses a Y-up right handed coordinate system 56 | # Unreal uses a Z-up left handed coordinate system. 57 | # Houdini 0 0 5 0 0 0 58 | # Unreal 0 500 0 0 0 -90 59 | 60 | # Houdini 0 0 -5 0 180 0 61 | # Unreal 0 -500 0 0 0 90 62 | 63 | 64 | # Houdini 5 0 0 0 -270 0 65 | # Unreal 500 0 0 0 0 -180 66 | 67 | 68 | # position 69 | ue_tx = 100 * tx 70 | ue_ty = 100 * tz 71 | ue_tz = 100 * ty 72 | 73 | 74 | # rotation 75 | 76 | cam_UP_axis = [0, 1, 0] 77 | cam_matrix = cam_node.worldTransform() 78 | cam_UP_world = hou.Vector3(hou.Vector4(tuple(cam_UP_axis) + (0.0,)) * cam_matrix) 79 | 80 | turn_90_around_UP = hou.hmath.buildRotateAboutAxis(cam_UP_world, 90) 81 | cam_matrix_cam = cam_matrix * turn_90_around_UP 82 | 83 | quat_H = hou.Quaternion(cam_matrix_cam) 84 | # tests: 85 | # quat_H = hou.Quaternion(hou.hmath.buildRotate((45, 0, 0), "yxz")) 86 | 87 | x = quat_H[0] 88 | y = quat_H[1] 89 | z = quat_H[2] 90 | w = quat_H[3] 91 | 92 | quat_UE = hou.Quaternion(x, z, -y, w) 93 | euler_UE = quat_UE.extractEulerRotates() 94 | 95 | ue_rx = euler_UE[0] 96 | ue_ry = euler_UE[1] 97 | ue_rz = euler_UE[2] 98 | 99 | 100 | 101 | # print(euler_UE) 102 | # turn_90_around_X = hou.hmath.buildRotateAboutAxis(hou.Vector3(1, 0, 0), 90) 103 | # scale_Z = hou.hmath.buildScale(1, 1, -1) 104 | # cam_matrix_rotated = cam_matrix_cam * turn_90_around_X 105 | # cam_matrix_scaled = cam_matrix_rotated * scale_Z 106 | # print (hou.Matrix4.extractRotates(cam_matrix_scaled)) 107 | 108 | # --------- focal length -------------- 109 | 110 | ue_resx = cam_node.parm("resx").eval() 111 | ue_resy = cam_node.parm("resy").eval() 112 | focal_length = cam_node.parm("focal").eval() 113 | resx = cam_node.parm("aperture").eval() 114 | ratio = resx / focal_length 115 | ue_focal_length = ue_resx / ratio 116 | 117 | 118 | # --------- focus distance ------------ 119 | 120 | focus_distance = cam_node.parm("focus").eval() 121 | ue_focus_distance = focus_distance * 100 122 | 123 | 124 | # --------- camera json ------------ 125 | 126 | json_content = {} 127 | json_content['level_settings'] = { 128 | 129 | # --------- camera sensor ------------ 130 | 131 | 'focus_distance': ue_focus_distance, 132 | 'focal_length' : ue_focal_length, 133 | 'resx' : ue_resx, 134 | 'resy' : ue_resy, 135 | 136 | # --------- sequencer ------------ 137 | 138 | 'rangex': node.parm("job_rangex").evalAsString(), 139 | 'rangey': node.parm("job_rangey").evalAsString(), 140 | 'fps' : hou.text.expandString("$FPS"), 141 | 142 | # --------- cam coordinates --------- 143 | 144 | 'tx' : ue_tx, 145 | 'ty' : ue_ty, 146 | 'tz' : ue_tz, 147 | 'rx' : ue_rx, 148 | 'ry' : ue_ry, 149 | 'rz' : ue_rz 150 | } 151 | 152 | 153 | # ------------ path ---------------- 154 | 155 | hip_name = hou.text.expandString("$HIPNAME") 156 | hip_name = hip_name.split(" ")[0] 157 | cam_name = node.parm("job_camera").evalAsNode().name() 158 | job_name = node.name() 159 | 160 | # ------------ path ---------------- 161 | 162 | json_path_seq = "Q:/_engine/_json/settings/seq." + hip_name + "." + job_name + ".json" 163 | # json_path_cam = "Q:/_engine/_json/settings/cam." + hip_name + "." + cam_name + ".json" 164 | 165 | # ---------- write files ------------- 166 | 167 | 168 | with open(json_path_seq, "w") as outfile_seq: 169 | json.dump(json_content, outfile_seq, indent=2) 170 | outfile_seq.close() 171 | 172 | # with open(json_path_cam, "w") as outfile_cam: 173 | # json.dump(json_content, outfile_cam, indent=2) 174 | # outfile_cam.close() 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | def ue_filemark_to_create_level (node) : 184 | # import imp ; import wf_job_archetype_network ; imp.reload(wf_job_archetype_network) ; node = kwargs["node"] ; wf_job_archetype_network.ue_filemark_to_create_level(node) 185 | 186 | 187 | # ------------ path ---------------- 188 | 189 | json_content = {} 190 | json_content['level_settings'] = { 191 | 'create': 'yes', 192 | } 193 | 194 | 195 | 196 | # ------------ path ---------------- 197 | 198 | hip_name = hou.text.expandString("$HIPNAME") 199 | hip_name = hip_name.split(" ")[0] 200 | job_name = node.name() 201 | 202 | # ------------ path ---------------- 203 | 204 | json_path_mark = "Q:/_engine/_json/create/create." + hip_name + "." + job_name + ".json" 205 | 206 | # ---------- write files ------------- 207 | 208 | 209 | with open(json_path_mark, "w") as outfile_mark: 210 | json.dump(json_content, outfile_mark, indent=2) 211 | outfile_mark.close() 212 | 213 | # ---------- --- ------------ 214 | -------------------------------------------------------------------------------- /PARMmenu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | len(kwargs["parms"]) > 0 and kwargs["parms"][0].parmTemplate().type().name() == "String" 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | len(kwargs["parms"]) > 0 and kwargs["parms"][0].parmTemplate().type().name() == "String" 56 | 57 | 58 | 59 | 60 | 61 | 62 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | root_menu 94 | 95 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | root_menu 115 | 116 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | root_menu 135 | 136 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | root_menu 155 | 156 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | root_menu 174 | 175 | 186 | 187 | 188 | 189 | 190 | 191 | root_menu 192 | 193 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | root_menu 212 | 213 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | root_menu 231 | 232 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | root_menu 248 | 249 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /python3.11libs/wf_render.py: -------------------------------------------------------------------------------- 1 | import hou 2 | import nodesearch 3 | 4 | 5 | # create .py script for each selected ROP, to render it 6 | # create .bat file, which renders all the created .py with hython simultaneously 7 | def batch_script_rop () : 8 | 9 | import os 10 | 11 | path_hip = hou.expandString('$HIP') 12 | path_hipfile = hou.expandString('$HIPFILE') 13 | path_hython = hou.expandString('$HB') + '/hython.exe' 14 | path_scripts = path_hip + '/scripts/' 15 | 16 | if not os.path.exists(path_scripts): 17 | os.makedirs(path_scripts) 18 | 19 | script_bat = 'REM This batch file runs multiple .py scripts at once \n' 20 | 21 | for rop in hou.selectedNodes() : 22 | # .py script 23 | script_rop = '# This .py script opens a file and renders single rop\n' 24 | script_rop += 'hou.hipFile.load("' + path_hipfile + '")\n' 25 | script_rop += 'node = hou.node("' + rop.path() + '")\n' 26 | script_rop += 'node.render(verbose=True,output_progress=True)' 27 | 28 | # write .py to disk 29 | path_py = path_scripts + rop.name() + '.py' 30 | file_py = open( path_py, "w") 31 | file_py.write(script_rop) 32 | 33 | # .bat script 34 | script_bat += 'start "Render: ' + rop.name() + '" "' 35 | script_bat += path_hython + '" "' 36 | script_bat += path_py + '"\n' 37 | 38 | 39 | # write .bat to disk 40 | path_bat = path_hip + '/_render_' + rop.name() + '.bat' 41 | file_rop = open( path_bat, "w") 42 | file_rop.write(script_bat) 43 | 44 | 45 | 46 | def batch_script_karma () : 47 | 48 | # ---------------------------------------- 49 | # top verbosity: 50 | # https://www.sidefx.com/docs/houdini/tops/pdg/debugging.html 51 | 52 | 53 | # ---------------------------------------- 54 | # create "/scripts" folder 55 | 56 | import os 57 | 58 | path_hip = hou.expandString('$HIP') 59 | path_hipfile = hou.expandString('$HIPFILE') 60 | path_hython = hou.expandString('$HB') + '/hython.exe' 61 | path_scripts = path_hip + '/scripts/' 62 | 63 | if not os.path.exists(path_scripts): 64 | os.makedirs(path_scripts) 65 | 66 | 67 | for node_sel in hou.selectedNodes() : 68 | 69 | # ---------------------------------------- 70 | # find topnet 71 | if node_sel.type().name() == "lopnet" : 72 | node_top = node_sel.node("topnet_DISTRIBUTED") 73 | node_lop = node_top.parent() 74 | 75 | if node_sel.type().name() == "topnet" : 76 | node_top = node_sel 77 | node_lop = node_top.parent() 78 | 79 | # print(node_top.path()) 80 | 81 | # ---------------------------------------- 82 | # .py script 83 | script_rop = '# This .py script opens a file and renders single topnet\n' 84 | script_rop += 'import hou\n' 85 | script_rop += 'import hqueue.houdini as hq \n' 86 | script_rop += 'file = "' + path_hipfile + '"\n' 87 | script_rop += 'node_top = "' + node_top.path() + '"\n' 88 | script_rop += '# -----------------------------------------------------\n' 89 | script_rop += 'hou.hipFile.load(file)\n' 90 | script_rop += 'node_hq = hq.getNode(node_top)\n' 91 | script_rop += 'node_disp = node_hq.displayNode()\n' 92 | script_rop += 'node_disp.executeGraph(False, True, False)\n' 93 | 94 | 95 | # write .py to disk 96 | path_py = path_scripts + node_lop.name() + '.py' 97 | file_py = open( path_py, "w") 98 | file_py.write(script_rop) 99 | 100 | 101 | # ---------------------------------------- 102 | # .bat script 103 | script_bat = 'REM This batch file runs .py script \n' 104 | script_bat += 'start "Render: ' + node_sel.name() + '" "' 105 | script_bat += path_hython + '" "' 106 | script_bat += path_py + '"\n' 107 | 108 | # # write .bat to disk 109 | path_bat = path_hip + '/_render_KARMA___' + node_lop.name() + '.bat' 110 | file_rop = open( path_bat, "w") 111 | file_rop.write(script_bat) 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | def kill () : 120 | sceneview_SOP = hou.ui.curDesktop().findPaneTab("pt_sceneview_1") 121 | sceneview_LOP = hou.ui.curDesktop().findPaneTab("pt_sceneview_3") 122 | 123 | try: 124 | sceneview_LOP.setHydraRenderer("Houdini GL") 125 | sceneview_LOP.restartRenderer() 126 | except: 127 | pass 128 | 129 | 130 | 131 | 132 | def start () : 133 | 134 | sceneview_SOP = hou.ui.curDesktop().findPaneTab("pt_sceneview_1") 135 | sceneview_LOP = hou.ui.curDesktop().findPaneTab("pt_sceneview_3") 136 | pe_1 = hou.ui.curDesktop().findPaneTab("pt_parmeditor_1") 137 | nw_1 = hou.ui.curDesktop().findPaneTab("pt_network_1") 138 | 139 | 140 | # find active lopnet 141 | #----------------------------------------------- 142 | root = hou.node("/obj") 143 | matcher = nodesearch.NodeType( "lopnet", exact=True ) 144 | lopnets = matcher.nodes( root, recursive=False ) 145 | lopnet_active = lopnets[0] 146 | 147 | for lopnet in lopnets : 148 | if lopnet.userData("lopnet_active") == "on": 149 | lopnet_active = lopnet 150 | 151 | 152 | # remember pwd 153 | #----------------------------------------------- 154 | remember_pwd = pe_1.pwd() 155 | remember_pin = pe_1.linkGroup() 156 | 157 | # lock 158 | #----------------------------------------------- 159 | sceneview_LOP.setLinkGroup(hou.paneLinkType.Pinned) 160 | sceneview_SOP.setLinkGroup(hou.paneLinkType.Pinned) 161 | pe_1.setLinkGroup(hou.paneLinkType.Pinned) 162 | nw_1.setLinkGroup(hou.paneLinkType.Pinned) 163 | 164 | 165 | 166 | # set viewer pwd and camera 167 | #----------------------------------------------- 168 | lopnet_camera = lopnet_active.parm("job_camera").evalAsNode() 169 | ######## this is a bug 170 | ######## sceneview_LOP.curViewport().setCamera(lopnet_camera) 171 | ######## wf_desktop.pt_sceneview_1.solaris 172 | sceneview_LOP.setPwd(lopnet_active) 173 | sceneview_LOP.setIsCurrentTab() 174 | # print(lopnet_camera.name()) 175 | cam_command = "viewcamera -c /" + lopnet_camera.name() + " wf_desktop.pt_sceneview_3.solaris.persp1" 176 | hou.hscript(cam_command) 177 | 178 | 179 | # unlock edit 180 | #----------------------------------------------- 181 | pe_1.setLinkGroup(remember_pin) 182 | nw_1.setLinkGroup(remember_pin) 183 | sceneview_SOP.setLinkGroup(hou.paneLinkType.FollowSelection) 184 | 185 | # restore pwd 186 | #----------------------------------------------- 187 | pe_1.setPwd(remember_pwd) 188 | 189 | 190 | # restart Karma render (or set Karma as renderer) 191 | #----------------------------------------------- 192 | try: 193 | if sceneview_LOP.currentHydraRenderer() == "Karma XPU" : 194 | sceneview_LOP.restartRenderer() 195 | else : 196 | sceneview_LOP.setHydraRenderer("Karma XPU") 197 | except: 198 | pass -------------------------------------------------------------------------------- /toolbar/wf_sceneview.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | 54 | 63 | 64 | 65 | 66 | 70 | 71 | 72 | 73 | 77 | 78 | 79 | 80 | 84 | 85 | 86 | 87 | 91 | 92 | 93 | 94 | 98 | 99 | 100 | 101 | 105 | 106 | 107 | 108 | 112 | 113 | 114 | 115 | 119 | 120 | 121 | 122 | 126 | 127 | 128 | 129 | 133 | 134 | 135 | 136 | 140 | 141 | 142 | 143 | 149 | 150 | 151 | 152 | 156 | 157 | 158 | 159 | 163 | 164 | 165 | 166 | 167 | OBJ 168 | SOP 169 | 170 | 174 | 175 | 176 | 177 | 181 | 182 | 183 | 184 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /python3.11libs/wf_ui_panetab.py: -------------------------------------------------------------------------------- 1 | import hou 2 | 3 | 4 | 5 | def panetab_restore(script_456, force_split) : 6 | 7 | if script_456 == True : 8 | panetab_cursor = hou.ui.curDesktop().findPaneTab("pt_network_1") 9 | else : 10 | panetab_cursor = hou.ui.curDesktop().paneTabUnderCursor() 11 | 12 | # for pane in hou.ui.curDesktop().panes() : 13 | # print "pane:" 14 | # for tab in pane.tabs() : 15 | # print tab.name() 16 | 17 | # check if swap is needed 18 | if hou.ui.curDesktop().panes()[0].tabs()[0].type() == hou.paneTabType.ChannelEditor : 19 | hou.ui.curDesktop().panes()[2].splitSwap() 20 | hou.ui.curDesktop().findPaneTab("pt_sgdetails").pane().setIsSplitMaximized( True ) 21 | hou.ui.curDesktop().findPaneTab("pt_sceneview_2").pane().setIsSplitMaximized( False ) 22 | 23 | 24 | # check what is under cursor 25 | if panetab_cursor.type() == hou.paneTabType.SceneViewer: 26 | # do the sceneview 27 | panetab_cursor.enterViewState() 28 | 29 | 30 | # check what is under cursor 31 | if panetab_cursor.type() != hou.paneTabType.SceneViewer and script_456 == False : 32 | 33 | # do the network 34 | pe_1 = hou.ui.curDesktop().findPaneTab("pt_parmeditor_1").pane() 35 | pe_2 = hou.ui.curDesktop().findPaneTab("pt_parmeditor_2").pane() 36 | nw_1 = hou.ui.curDesktop().findPaneTab("pt_network_1").pane() 37 | nw_2 = hou.ui.curDesktop().findPaneTab("pt_network_2").pane() 38 | 39 | # -------------------------------------------------------------------------------------------------------------- 40 | # -------------------------------------------------------------------------------------------------------------- 41 | 42 | split_top = pe_1.getSplitParent() #isSplitMaximized() 43 | split_bot = pe_2.getSplitParent() #isSplitMaximized() 44 | 45 | if split_top.isSplitMaximized() == False and split_bot.isSplitMaximized() == False: 46 | # was SPLIT 47 | if force_split == False : 48 | if panetab_cursor.linkGroup() == hou.paneLinkType.Group2 : 49 | # maximize 2 only when hovering over 2 50 | # print "B" 51 | #### order: MAX 2 52 | split_bot.setIsSplitMaximized( True ) 53 | split_top.setIsSplitMaximized( False ) 54 | 55 | 56 | else : 57 | # maximize 1 in all other cases 58 | # print "A" 59 | #### order: MAX 1 60 | split_top.setIsSplitMaximized( True ) 61 | split_bot.setIsSplitMaximized( False ) 62 | 63 | ### UNLINK 1 64 | hou.ui.curDesktop().findPaneTab("pt_parmeditor_1").setLinkGroup(hou.paneLinkType.FollowSelection) 65 | hou.ui.curDesktop().findPaneTab("pt_network_1").setLinkGroup(hou.paneLinkType.FollowSelection) 66 | 67 | 68 | else : 69 | # was MAXIMIZED 70 | 71 | # remember pwd 72 | remember_1_pwd = hou.ui.curDesktop().findPaneTab("pt_network_1").pwd() 73 | 74 | ### LINK 1 75 | # pin group 76 | hou.ui.curDesktop().findPaneTab("pt_parmeditor_1").setLinkGroup(hou.paneLinkType.Group1) 77 | hou.ui.curDesktop().findPaneTab("pt_network_1").setLinkGroup(hou.paneLinkType.Group1) 78 | 79 | # set remembered 80 | hou.ui.curDesktop().findPaneTab("pt_network_1").setPwd(remember_1_pwd) 81 | 82 | if split_top.isSplitMaximized() == True : 83 | # print "C" 84 | #### order: EVEN from 1 85 | split_top.setIsSplitMaximized( False ) 86 | split_bot.setIsSplitMaximized( True ) ## was true 87 | 88 | if split_bot.isSplitMaximized() == True : 89 | # print "D" 90 | #### order: MAX 1 91 | split_top.setIsSplitMaximized( True ) 92 | split_bot.setIsSplitMaximized( False ) 93 | 94 | #### order: EVEN from 2 95 | split_top.setIsSplitMaximized( False ) 96 | split_bot.setIsSplitMaximized( True ) 97 | 98 | 99 | 100 | # -------------------------------------------------------------------------------------------------------------- 101 | # -------------------------------------------------------------------------------------------------------------- 102 | 103 | 104 | def panetab_ctrl() : 105 | panetab_cursor = hou.ui.curDesktop().paneTabUnderCursor() 106 | 107 | if panetab_cursor.type() == hou.paneTabType.SceneViewer : 108 | # sceneview lock/unlock 109 | if panetab_cursor.linkGroup() == hou.paneLinkType.FollowSelection : 110 | panetab_cursor.setLinkGroup(hou.paneLinkType.Pinned) 111 | else: 112 | panetab_cursor.setLinkGroup(hou.paneLinkType.FollowSelection) 113 | 114 | 115 | # unfortunately ChannelEditor does not pin right 116 | # if panetab_cursor.type() == hou.paneTabType.ChannelEditor : 117 | 118 | 119 | else : 120 | # swap parms and network 121 | # pe_1 = hou.ui.curDesktop().findPaneTab("pt_parmeditor_1") 122 | # pe_2 = hou.ui.curDesktop().findPaneTab("pt_parmeditor_2") 123 | nw_1 = hou.ui.curDesktop().findPaneTab("pt_network_1") 124 | nw_2 = hou.ui.curDesktop().findPaneTab("pt_network_2") 125 | 126 | # remember pwd, node, bounds 127 | remember_1_pwd = nw_1.pwd() 128 | remember_1_node = nw_1.currentNode() 129 | remember_1_bounds = nw_1.visibleBounds() 130 | 131 | remember_2_pwd = nw_2.pwd() 132 | remember_2_node = nw_2.currentNode() 133 | remember_2_bounds = nw_2.visibleBounds() 134 | 135 | # set remembered 136 | nw_2.setPwd(remember_1_pwd) 137 | nw_2.setCurrentNode(remember_1_node) 138 | nw_2.setVisibleBounds(remember_1_bounds) 139 | 140 | nw_1.setPwd(remember_2_pwd) 141 | nw_1.setCurrentNode(remember_2_node) 142 | nw_1.setVisibleBounds(remember_2_bounds) 143 | 144 | 145 | 146 | def panetab_set(number) : 147 | # print number 148 | # hotkey is 1, 2 149 | 150 | 151 | # panetab_net = hou.ui.curDesktop().findPaneTab("pt_network_1") 152 | # panetab_sce = hou.ui.curDesktop().findPaneTab("pt_sceneview_2") 153 | 154 | # node_left_network = panetab_net.currentNode() 155 | # node_left_scene = panetab_sce.currentNode() 156 | # nodes_entered = node.selectedChildren() 157 | # count = len(nodes_entered) 158 | 159 | # panetab_MA = hou.ui.curDesktop().findPaneTab("pt_network_2") 160 | # panetab_GL = hou.ui.curDesktop().findPaneTab("pt_network_1") 161 | 162 | # material_path = node_entered.parm("shop_materialpath").evalAsString() 163 | # material_fullpath = node_entered.node(material_path).parent() 164 | 165 | 166 | # ---------------------------------------------- 167 | # TAB MA (2) 168 | # panetab_MA.setPwd(material_fullpath) 169 | # panetab_MA.cd(material_fullpath.path()) 170 | 171 | # ---------------------------------------------- 172 | # TAB GL (3) 173 | 174 | 175 | # ---------------------------------------------- 176 | # TAB RS (4) 177 | 178 | 179 | pass 180 | 181 | 182 | def panetab_clone(number) : 183 | # hotkey was ctrl+1, ctrl+2 184 | # unused 185 | pass 186 | 187 | --------------------------------------------------------------------------------