vibrante-node 2.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- src/core/__init__.py +0 -0
- src/core/engine.py +484 -0
- src/core/events.py +32 -0
- src/core/graph.py +74 -0
- src/core/integrity.py +925 -0
- src/core/loader.py +56 -0
- src/core/manifest.py +910 -0
- src/core/models.py +59 -0
- src/core/persistence.py +27 -0
- src/core/python_to_workflow.py +182 -0
- src/core/registry.py +314 -0
- src/core/workflow_to_python.py +801 -0
- src/main.py +188 -0
- src/models/__init__.py +0 -0
- src/nodes/__init__.py +0 -0
- src/nodes/ai/__init__.py +1 -0
- src/nodes/base.py +174 -0
- src/nodes/builtins/__init__.py +0 -0
- src/nodes/builtins/group_node.py +210 -0
- src/nodes/builtins/nodes.py +452 -0
- src/nodes/print.py +19 -0
- src/nodes/test.py +19 -0
- src/ui/__init__.py +0 -0
- src/ui/canvas/__init__.py +0 -0
- src/ui/canvas/backdrop.py +223 -0
- src/ui/canvas/canvas_search_bar.py +222 -0
- src/ui/canvas/edge.py +98 -0
- src/ui/canvas/mini_map.py +138 -0
- src/ui/canvas/node_search_popup.py +270 -0
- src/ui/canvas/scene.py +1149 -0
- src/ui/canvas/sticky_note.py +123 -0
- src/ui/canvas/view.py +285 -0
- src/ui/code_editor.py +435 -0
- src/ui/export_python_dialog.py +490 -0
- src/ui/gemini_api_dialog.py +41 -0
- src/ui/gemini_chat.py +370 -0
- src/ui/import_python_dialog.py +122 -0
- src/ui/library_panel.py +246 -0
- src/ui/log_panel.py +315 -0
- src/ui/node_builder.py +841 -0
- src/ui/node_widget.py +1009 -0
- src/ui/port_widget.py +116 -0
- src/ui/script_editor.py +53 -0
- src/ui/scripting_console.py +270 -0
- src/ui/settings_window.py +575 -0
- src/ui/window.py +2012 -0
- src/utils/color_manager.py +50 -0
- src/utils/config_manager.py +71 -0
- src/utils/env_manager.py +232 -0
- src/utils/highlighter.py +110 -0
- src/utils/paths.py +30 -0
- src/utils/prism_config.py +300 -0
- src/utils/prism_core.py +80 -0
- src/utils/qt_compat.py +159 -0
- src/utils/runtime.py +80 -0
- vibrante_node/CLA.md +96 -0
- vibrante_node/COMMERCIAL_LICENSE.md +170 -0
- vibrante_node/LICENSE +178 -0
- vibrante_node/LICENSES/AGPL-3.0.txt +661 -0
- vibrante_node/LICENSES/CC-BY-4.0-SCOPE.md +53 -0
- vibrante_node/LICENSES/CC-BY-4.0.txt +396 -0
- vibrante_node/LICENSES/GPL-3.0.txt +674 -0
- vibrante_node/LICENSES/LGPL-3.0.txt +165 -0
- vibrante_node/LICENSES/README.md +65 -0
- vibrante_node/THIRD_PARTY_NOTICES.txt +3277 -0
- vibrante_node/__init__.py +2 -0
- vibrante_node/app.py +60 -0
- vibrante_node/docs/AUTOMATION_API.html +785 -0
- vibrante_node/docs/DEVELOPER.html +891 -0
- vibrante_node/docs/DOCUMENTATION.html +2761 -0
- vibrante_node/docs/LICENSE.txt +35 -0
- vibrante_node/docs/NODE_BUILDER_API.html +1155 -0
- vibrante_node/docs/RELEASE_v1.0.5.html +140 -0
- vibrante_node/docs/RELEASE_v1.1.0.html +163 -0
- vibrante_node/docs/RELEASE_v1.1.5.html +286 -0
- vibrante_node/docs/RELEASE_v1.2.0.html +175 -0
- vibrante_node/docs/RELEASE_v1.3.0.html +168 -0
- vibrante_node/docs/RELEASE_v1.4.0.html +160 -0
- vibrante_node/docs/RELEASE_v1.5.0.html +432 -0
- vibrante_node/docs/RELEASE_v1.6.0.html +293 -0
- vibrante_node/docs/RELEASE_v1.6.1.html +171 -0
- vibrante_node/docs/RELEASE_v1.7.0.html +270 -0
- vibrante_node/docs/RELEASE_v1.8.0.html +201 -0
- vibrante_node/docs/RELEASE_v1.8.1.html +124 -0
- vibrante_node/docs/RELEASE_v1.8.2.html +119 -0
- vibrante_node/docs/RELEASE_v1.8.3.html +125 -0
- vibrante_node/docs/RELEASE_v1.8.4.html +210 -0
- vibrante_node/docs/RELEASE_v1.8.5.html +223 -0
- vibrante_node/docs/RELEASE_v2.0.0.html +284 -0
- vibrante_node/docs/RELEASE_v2.1.0.html +259 -0
- vibrante_node/docs/RELEASE_v2.1.1.html +156 -0
- vibrante_node/docs/RELEASE_v2.2.0.html +369 -0
- vibrante_node/docs/RELEASE_v2.2.1.html +168 -0
- vibrante_node/docs/RELEASE_v2.3.0.html +185 -0
- vibrante_node/docs/RELEASE_v2.4.0.html +446 -0
- vibrante_node/docs/RELEASE_v2.5.0.html +478 -0
- vibrante_node/docs/RELEASE_v2.5.1.html +190 -0
- vibrante_node/docs/USER_GUIDE.html +1407 -0
- vibrante_node/docs/index.html +103 -0
- vibrante_node/docs/portal/01_introduction.html +1177 -0
- vibrante_node/docs/portal/02_getting_started.html +1267 -0
- vibrante_node/docs/portal/03_user_guide.html +1736 -0
- vibrante_node/docs/portal/04_workflow_tutorials.html +1473 -0
- vibrante_node/docs/portal/05_node_development.html +1562 -0
- vibrante_node/docs/portal/06_backend_architecture.html +1373 -0
- vibrante_node/docs/portal/07_frontend_architecture.html +1588 -0
- vibrante_node/docs/portal/08_api_reference.html +2336 -0
- vibrante_node/docs/portal/09_advanced_topics.html +1664 -0
- vibrante_node/docs/portal/10_contribution_guide.html +1263 -0
- vibrante_node/docs/portal/11_troubleshooting.html +1108 -0
- vibrante_node/docs/portal/12_examples_library.html +1498 -0
- vibrante_node/docs/portal/13_general_purpose_automation.html +1472 -0
- vibrante_node/docs/portal/14_custom_nodes_api.html +1960 -0
- vibrante_node/docs/portal/index.html +605 -0
- vibrante_node/docs/portal/integrations_blender.html +605 -0
- vibrante_node/docs/portal/integrations_deadline.html +536 -0
- vibrante_node/docs/portal/integrations_houdini.html +787 -0
- vibrante_node/docs/portal/integrations_maya.html +675 -0
- vibrante_node/docs/portal/integrations_prism.html +628 -0
- vibrante_node/docs/portal/search.json +1 -0
- vibrante_node/docs/validation.json +333 -0
- vibrante_node/examples/arnold_lighting/orchestration_notes.md +45 -0
- vibrante_node/examples/arnold_lighting/prompt.md +47 -0
- vibrante_node/examples/automation/01_linear_chain.py +10 -0
- vibrante_node/examples/automation/02_batch_update_prefix.py +8 -0
- vibrante_node/examples/automation/03_reset_scene.py +5 -0
- vibrante_node/examples/automation/04_batch_execution.py +9 -0
- vibrante_node/examples/automation/05_git_backup.py +6 -0
- vibrante_node/examples/automation/06_reset_math_nodes.py +12 -0
- vibrante_node/examples/automation/07_stress_test_grid.py +8 -0
- vibrante_node/examples/automation/08_scene_summary.py +8 -0
- vibrante_node/examples/automation/09_toggle_bools.py +8 -0
- vibrante_node/examples/automation/10_session_report.py +7 -0
- vibrante_node/examples/automation/11_simple_math_node.py +7 -0
- vibrante_node/examples/cinematic_camera/orchestration_notes.md +56 -0
- vibrante_node/examples/cinematic_camera/prompt.md +50 -0
- vibrante_node/examples/cinematic_explosion/orchestration_notes.md +76 -0
- vibrante_node/examples/cinematic_explosion/prompt.md +47 -0
- vibrante_node/examples/cinematic_explosion/review.md +75 -0
- vibrante_node/examples/dust_wave/orchestration_notes.md +43 -0
- vibrante_node/examples/dust_wave/prompt.md +40 -0
- vibrante_node/examples/nodes/async_delay.py +21 -0
- vibrante_node/examples/nodes/connection_logger.py +25 -0
- vibrante_node/examples/nodes/data_filter.py +19 -0
- vibrante_node/examples/nodes/dict_merge.py +20 -0
- vibrante_node/examples/nodes/dict_summary.py +21 -0
- vibrante_node/examples/nodes/dropdown_selector.py +29 -0
- vibrante_node/examples/nodes/env_reader.py +18 -0
- vibrante_node/examples/nodes/list_item_picker.py +85 -0
- vibrante_node/examples/nodes/list_stats.py +27 -0
- vibrante_node/examples/nodes/logic_threshold.py +23 -0
- vibrante_node/examples/nodes/math_square.py +30 -0
- vibrante_node/examples/nodes/random_list.py +18 -0
- vibrante_node/examples/nodes/reactive_config.py +24 -0
- vibrante_node/examples/nodes/safety_reset.py +31 -0
- vibrante_node/examples/nodes/string_reverse.py +16 -0
- vibrante_node/icons/210429_DeadlineFreeOn10RenderMachines.jpg +0 -0
- vibrante_node/icons/README.md +39 -0
- vibrante_node/icons/blender_icon.png +0 -0
- vibrante_node/icons/braces.png +0 -0
- vibrante_node/icons/braces.svg +1 -0
- vibrante_node/icons/builder.png +0 -0
- vibrante_node/icons/check.png +0 -0
- vibrante_node/icons/check.svg +1 -0
- vibrante_node/icons/chevron-right.svg +3 -0
- vibrante_node/icons/code.png +0 -0
- vibrante_node/icons/code.svg +4 -0
- vibrante_node/icons/computer-window.png +0 -0
- vibrante_node/icons/data.png +0 -0
- vibrante_node/icons/data.svg +5 -0
- vibrante_node/icons/database-search.png +0 -0
- vibrante_node/icons/database-search.svg +5 -0
- vibrante_node/icons/database-zap.png +0 -0
- vibrante_node/icons/database-zap.svg +5 -0
- vibrante_node/icons/database.png +0 -0
- vibrante_node/icons/database.svg +5 -0
- vibrante_node/icons/dice.png +0 -0
- vibrante_node/icons/dice.svg +1 -0
- vibrante_node/icons/divide.svg +5 -0
- vibrante_node/icons/file-input.svg +6 -0
- vibrante_node/icons/file-plus.png +0 -0
- vibrante_node/icons/file-plus.svg +6 -0
- vibrante_node/icons/file-text.png +0 -0
- vibrante_node/icons/file-text.svg +7 -0
- vibrante_node/icons/folder-plus.png +0 -0
- vibrante_node/icons/folder-plus.svg +5 -0
- vibrante_node/icons/folder.png +0 -0
- vibrante_node/icons/folder.svg +3 -0
- vibrante_node/icons/gear.png +0 -0
- vibrante_node/icons/gear.svg +1 -0
- vibrante_node/icons/git-branch.svg +6 -0
- vibrante_node/icons/hash.png +0 -0
- vibrante_node/icons/hash.svg +1 -0
- vibrante_node/icons/houdini.svg +4 -0
- vibrante_node/icons/houdini_icon.png +0 -0
- vibrante_node/icons/http.png +0 -0
- vibrante_node/icons/list-check.png +0 -0
- vibrante_node/icons/list-check.svg +7 -0
- vibrante_node/icons/list-plus.svg +10 -0
- vibrante_node/icons/list.png +0 -0
- vibrante_node/icons/list.svg +8 -0
- vibrante_node/icons/logic.png +0 -0
- vibrante_node/icons/logic.svg +7 -0
- vibrante_node/icons/math.png +0 -0
- vibrante_node/icons/math.svg +4 -0
- vibrante_node/icons/maya_icon.jpg +0 -0
- vibrante_node/icons/message.png +0 -0
- vibrante_node/icons/message.svg +3 -0
- vibrante_node/icons/minus.svg +3 -0
- vibrante_node/icons/multiply.png +0 -0
- vibrante_node/icons/multiply.svg +1 -0
- vibrante_node/icons/online-library.png +0 -0
- vibrante_node/icons/percentage.svg +5 -0
- vibrante_node/icons/plus.png +0 -0
- vibrante_node/icons/plus.svg +1 -0
- vibrante_node/icons/print.png +0 -0
- vibrante_node/icons/print.svg +5 -0
- vibrante_node/icons/prism_icon.png +0 -0
- vibrante_node/icons/refresh.svg +6 -0
- vibrante_node/icons/repeat.svg +6 -0
- vibrante_node/icons/scales.png +0 -0
- vibrante_node/icons/scales.svg +1 -0
- vibrante_node/icons/shuffle.svg +7 -0
- vibrante_node/icons/string.png +0 -0
- vibrante_node/icons/string.svg +5 -0
- vibrante_node/icons/terminal.png +0 -0
- vibrante_node/icons/terminal.svg +1 -0
- vibrante_node/icons/timer.png +0 -0
- vibrante_node/icons/timer.svg +4 -0
- vibrante_node/icons/toggle-switch.svg +5 -0
- vibrante_node/icons/uppercase.png +0 -0
- vibrante_node/icons/uppercase.svg +1 -0
- vibrante_node/icons/variable-get.svg +4 -0
- vibrante_node/icons/variable-set.svg +6 -0
- vibrante_node/icons/variable.png +0 -0
- vibrante_node/icons/variable.svg +5 -0
- vibrante_node/icons/vibrante-node-icon.png +0 -0
- vibrante_node/icons/vibrante-node-logo.png +0 -0
- vibrante_node/icons/vibrante-node-main_logo.png +0 -0
- vibrante_node/icons/vibrante-node-resize_main_logo.png +0 -0
- vibrante_node/logo.png +0 -0
- vibrante_node/mcp_cli.py +36 -0
- vibrante_node/node_examples/Split_String.json +35 -0
- vibrante_node/node_examples/async_delay.json +32 -0
- vibrante_node/node_examples/delay_timer.json +29 -0
- vibrante_node/node_examples/file_reader.json +29 -0
- vibrante_node/node_examples/fruit_selector.json +37 -0
- vibrante_node/node_examples/json_parser.json +29 -0
- vibrante_node/node_examples/line_counter.json +29 -0
- vibrante_node/node_examples/list_append.json +32 -0
- vibrante_node/node_examples/list_images_recursive.json +55 -0
- vibrante_node/node_examples/logic_and.json +34 -0
- vibrante_node/node_examples/logic_compare.json +36 -0
- vibrante_node/node_examples/math_abs.json +29 -0
- vibrante_node/node_examples/math_add.json +32 -0
- vibrante_node/node_examples/reactive_config.json +28 -0
- vibrante_node/node_examples/string_uppercase.json +29 -0
- vibrante_node/nodes/Dropdown_Selector.json +27 -0
- vibrante_node/nodes/add_integers.json +34 -0
- vibrante_node/nodes/blender_action_bake_animation.json +23 -0
- vibrante_node/nodes/blender_action_custom.json +21 -0
- vibrante_node/nodes/blender_action_export_alembic.json +22 -0
- vibrante_node/nodes/blender_action_export_fbx.json +23 -0
- vibrante_node/nodes/blender_action_export_gltf.json +21 -0
- vibrante_node/nodes/blender_action_export_obj.json +19 -0
- vibrante_node/nodes/blender_action_export_usd.json +23 -0
- vibrante_node/nodes/blender_action_import_alembic.json +18 -0
- vibrante_node/nodes/blender_action_import_fbx.json +18 -0
- vibrante_node/nodes/blender_action_import_gltf.json +18 -0
- vibrante_node/nodes/blender_action_import_obj.json +18 -0
- vibrante_node/nodes/blender_action_new_blend.json +18 -0
- vibrante_node/nodes/blender_action_open_blend.json +18 -0
- vibrante_node/nodes/blender_action_render.json +23 -0
- vibrante_node/nodes/blender_action_save_blend.json +18 -0
- vibrante_node/nodes/blender_action_scene_info.json +17 -0
- vibrante_node/nodes/blender_action_set_frame_range.json +20 -0
- vibrante_node/nodes/blender_action_set_render_settings.json +27 -0
- vibrante_node/nodes/blender_get_action_result.json +22 -0
- vibrante_node/nodes/blender_headless.json +86 -0
- vibrante_node/nodes/compare.json +48 -0
- vibrante_node/nodes/console_print.json +29 -0
- vibrante_node/nodes/create_dictionary.json +18 -0
- vibrante_node/nodes/create_folder.json +17 -0
- vibrante_node/nodes/create_list.json +18 -0
- vibrante_node/nodes/deadline_blender_submit.json +38 -0
- vibrante_node/nodes/deadline_houdini_submit.json +38 -0
- vibrante_node/nodes/deadline_job_status.json +28 -0
- vibrante_node/nodes/deadline_maya_submit.json +40 -0
- vibrante_node/nodes/delay_timer.json +26 -0
- vibrante_node/nodes/example_random_float.json +35 -0
- vibrante_node/nodes/file_append.json +18 -0
- vibrante_node/nodes/file_write.json +18 -0
- vibrante_node/nodes/for_loop.json +46 -0
- vibrante_node/nodes/get_dict_value.json +19 -0
- vibrante_node/nodes/get_list_item.json +19 -0
- vibrante_node/nodes/houdini_action_bake_animation.json +20 -0
- vibrante_node/nodes/houdini_action_custom.json +20 -0
- vibrante_node/nodes/houdini_action_export_alembic.json +20 -0
- vibrante_node/nodes/houdini_action_export_camera_alembic.json +20 -0
- vibrante_node/nodes/houdini_action_export_fbx.json +18 -0
- vibrante_node/nodes/houdini_action_import_alembic.json +18 -0
- vibrante_node/nodes/houdini_action_import_camera.json +17 -0
- vibrante_node/nodes/houdini_action_import_fbx.json +18 -0
- vibrante_node/nodes/houdini_action_import_obj.json +18 -0
- vibrante_node/nodes/houdini_action_new_hip.json +16 -0
- vibrante_node/nodes/houdini_action_open_hip.json +17 -0
- vibrante_node/nodes/houdini_action_save_hip.json +17 -0
- vibrante_node/nodes/houdini_action_scene_info.json +16 -0
- vibrante_node/nodes/houdini_action_set_frame_range.json +18 -0
- vibrante_node/nodes/houdini_get_action_result.json +21 -0
- vibrante_node/nodes/houdini_headless.json +85 -0
- vibrante_node/nodes/houdini_scene_snapshot.json +41 -0
- vibrante_node/nodes/http_request.json +76 -0
- vibrante_node/nodes/if_condition.json +45 -0
- vibrante_node/nodes/list_directory.json +17 -0
- vibrante_node/nodes/list_images_recursive.json +41 -0
- vibrante_node/nodes/list_item_picker.json +41 -0
- vibrante_node/nodes/list_length.json +17 -0
- vibrante_node/nodes/logical_gate.json +45 -0
- vibrante_node/nodes/loop_body.json +62 -0
- vibrante_node/nodes/math_add.json +17 -0
- vibrante_node/nodes/math_divide.json +17 -0
- vibrante_node/nodes/math_modulo.json +17 -0
- vibrante_node/nodes/math_multiply.json +36 -0
- vibrante_node/nodes/math_subtract.json +17 -0
- vibrante_node/nodes/maya_action_assign_material.json +18 -0
- vibrante_node/nodes/maya_action_bake_animation.json +21 -0
- vibrante_node/nodes/maya_action_create_render_layer.json +19 -0
- vibrante_node/nodes/maya_action_custom.json +20 -0
- vibrante_node/nodes/maya_action_export_alembic.json +22 -0
- vibrante_node/nodes/maya_action_export_camera_alembic.json +20 -0
- vibrante_node/nodes/maya_action_export_fbx.json +18 -0
- vibrante_node/nodes/maya_action_import_alembic.json +17 -0
- vibrante_node/nodes/maya_action_import_camera.json +17 -0
- vibrante_node/nodes/maya_action_import_fbx.json +17 -0
- vibrante_node/nodes/maya_action_import_obj.json +17 -0
- vibrante_node/nodes/maya_action_list_references.json +16 -0
- vibrante_node/nodes/maya_action_new_scene.json +16 -0
- vibrante_node/nodes/maya_action_open_scene.json +18 -0
- vibrante_node/nodes/maya_action_playblast.json +22 -0
- vibrante_node/nodes/maya_action_reference_alembic.json +18 -0
- vibrante_node/nodes/maya_action_reference_scene.json +18 -0
- vibrante_node/nodes/maya_action_save_scene.json +18 -0
- vibrante_node/nodes/maya_action_scene_info.json +16 -0
- vibrante_node/nodes/maya_action_set_aovs.json +18 -0
- vibrante_node/nodes/maya_action_set_frame_range.json +18 -0
- vibrante_node/nodes/maya_action_set_render_settings.json +23 -0
- vibrante_node/nodes/maya_get_action_result.json +21 -0
- vibrante_node/nodes/maya_headless.json +27 -0
- vibrante_node/nodes/mcp_call_tool.json +19 -0
- vibrante_node/nodes/mcp_list_tools.json +18 -0
- vibrante_node/nodes/mcp_server_init.json +23 -0
- vibrante_node/nodes/message_node.json +32 -0
- vibrante_node/nodes/prism_add_integration.json +49 -0
- vibrante_node/nodes/prism_build_entity.json +45 -0
- vibrante_node/nodes/prism_change_project.json +37 -0
- vibrante_node/nodes/prism_core_info.json +37 -0
- vibrante_node/nodes/prism_core_init.json +46 -0
- vibrante_node/nodes/prism_create_category.json +44 -0
- vibrante_node/nodes/prism_create_entity.json +60 -0
- vibrante_node/nodes/prism_create_playblast.json +56 -0
- vibrante_node/nodes/prism_create_product_version.json +64 -0
- vibrante_node/nodes/prism_create_project.json +50 -0
- vibrante_node/nodes/prism_create_scene_from_preset.json +59 -0
- vibrante_node/nodes/prism_eval.json +42 -0
- vibrante_node/nodes/prism_get_aovs.json +29 -0
- vibrante_node/nodes/prism_get_asset_by_name.json +69 -0
- vibrante_node/nodes/prism_get_asset_type_by_name.json +62 -0
- vibrante_node/nodes/prism_get_asset_types_by_project.json +55 -0
- vibrante_node/nodes/prism_get_assets_by_project.json +41 -0
- vibrante_node/nodes/prism_get_assets_by_type.json +69 -0
- vibrante_node/nodes/prism_get_config.json +48 -0
- vibrante_node/nodes/prism_get_current_scene.json +37 -0
- vibrante_node/nodes/prism_get_departments.json +37 -0
- vibrante_node/nodes/prism_get_entity_info.json +69 -0
- vibrante_node/nodes/prism_get_entity_path.json +69 -0
- vibrante_node/nodes/prism_get_export_path.json +26 -0
- vibrante_node/nodes/prism_get_latest_product_path.json +34 -0
- vibrante_node/nodes/prism_get_media.json +29 -0
- vibrante_node/nodes/prism_get_media_versions.json +33 -0
- vibrante_node/nodes/prism_get_plugin.json +35 -0
- vibrante_node/nodes/prism_get_preset_scenes.json +35 -0
- vibrante_node/nodes/prism_get_product_versions.json +33 -0
- vibrante_node/nodes/prism_get_products.json +29 -0
- vibrante_node/nodes/prism_get_project_by_name.json +55 -0
- vibrante_node/nodes/prism_get_project_config_path.json +26 -0
- vibrante_node/nodes/prism_get_scene_files.json +45 -0
- vibrante_node/nodes/prism_get_scene_path.json +23 -0
- vibrante_node/nodes/prism_get_sequence_by_project.json +48 -0
- vibrante_node/nodes/prism_get_sequences_by_project.json +41 -0
- vibrante_node/nodes/prism_get_shot_by_name.json +62 -0
- vibrante_node/nodes/prism_get_shot_by_sequence.json +55 -0
- vibrante_node/nodes/prism_get_shot_info.json +69 -0
- vibrante_node/nodes/prism_get_shots.json +29 -0
- vibrante_node/nodes/prism_get_shots_by_project_sequence.json +48 -0
- vibrante_node/nodes/prism_get_shots_by_sequence.json +48 -0
- vibrante_node/nodes/prism_get_tasks.json +39 -0
- vibrante_node/nodes/prism_import_product.json +37 -0
- vibrante_node/nodes/prism_list_plugins.json +25 -0
- vibrante_node/nodes/prism_list_projects.json +25 -0
- vibrante_node/nodes/prism_login_token.json +33 -0
- vibrante_node/nodes/prism_monkey_patch.json +46 -0
- vibrante_node/nodes/prism_open_scene.json +33 -0
- vibrante_node/nodes/prism_popup.json +40 -0
- vibrante_node/nodes/prism_register_callback.json +58 -0
- vibrante_node/nodes/prism_save_scene_version.json +90 -0
- vibrante_node/nodes/prism_send_cmd.json +54 -0
- vibrante_node/nodes/prism_set_config.json +55 -0
- vibrante_node/nodes/prism_studio_assign_project.json +43 -0
- vibrante_node/nodes/prism_trigger_callback.json +42 -0
- vibrante_node/nodes/prism_usd_department_layer_path.json +35 -0
- vibrante_node/nodes/prism_usd_entity_path.json +29 -0
- vibrante_node/nodes/prism_usd_sublayer_path.json +41 -0
- vibrante_node/nodes/prism_usd_update_department_layer.json +33 -0
- vibrante_node/nodes/prism_usd_update_sublayer.json +33 -0
- vibrante_node/nodes/python_script.json +17 -0
- vibrante_node/nodes/scene_intent_extractor.json +25 -0
- vibrante_node/nodes/set_dict_value.json +20 -0
- vibrante_node/nodes/string_concat.json +47 -0
- vibrante_node/nodes/string_length.json +16 -0
- vibrante_node/nodes/string_lowercase.json +16 -0
- vibrante_node/nodes/string_replace.json +18 -0
- vibrante_node/nodes/string_split.json +17 -0
- vibrante_node/nodes/string_uppercase.json +16 -0
- vibrante_node/nodes/variable_node.json +42 -0
- vibrante_node/nodes/while_loop.json +18 -0
- vibrante_node/splash.png +0 -0
- vibrante_node/vfx_workflows/01_prism_project_overview.json +492 -0
- vibrante_node/vfx_workflows/02_maya_asset_publish.json +776 -0
- vibrante_node/vfx_workflows/03_multi_shot_alembic_export.json +856 -0
- vibrante_node/vfx_workflows/04_deadline_render_pipeline.json +994 -0
- vibrante_node/vfx_workflows/05_houdini_fx_pipeline.json +1056 -0
- vibrante_node/vfx_workflows/06_blender_multi_format_export.json +1206 -0
- vibrante_node/website_examples/database_query.json +69 -0
- vibrante_node/website_examples/email_notification.json +104 -0
- vibrante_node/website_examples/file_batch_processor.json +62 -0
- vibrante_node/website_examples/folder_monitor.json +55 -0
- vibrante_node/website_examples/hou_sop_chain.json +69 -0
- vibrante_node/website_examples/http_request.json +90 -0
- vibrante_node/website_examples/image_resizer.json +90 -0
- vibrante_node/website_examples/llm_text_generation.json +90 -0
- vibrante_node/website_examples/prism_multi_asset_publisher.json +76 -0
- vibrante_node/website_examples/regex_replace.json +69 -0
- vibrante_node/workflows/If_condition.json +134 -0
- vibrante_node/workflows/Maya_WorkFlow.json +464 -0
- vibrante_node/workflows/asset_intelligence_pipeline.json +259 -0
- vibrante_node/workflows/concat_string_with_loop.json +262 -0
- vibrante_node/workflows/delay_time.json +74 -0
- vibrante_node/workflows/example_workflow_maya_prism_demo.json +503 -0
- vibrante_node/workflows/example_workflow_prism_demo.json +276 -0
- vibrante_node/workflows/example_workflow_prism_demo_02.json +221 -0
- vibrante_node/workflows/extract_FPS_from_maya_scene.json +265 -0
- vibrante_node/workflows/for_each.json +260 -0
- vibrante_node/workflows/get_list_item.json +151 -0
- vibrante_node/workflows/hou_mcp_scene_context_demo.json +67 -0
- vibrante_node/workflows/list_recursive_images.json +103 -0
- vibrante_node/workflows/logic_if_example.json +262 -0
- vibrante_node/workflows/logic_if_with_variables.json +210 -0
- vibrante_node/workflows/loop_break_example.json +197 -0
- vibrante_node/workflows/loop_operation_example.json +382 -0
- vibrante_node/workflows/mcp_list_tools_demo.json +90 -0
- vibrante_node/workflows/prism_assets_workflow.json +131 -0
- vibrante_node/workflows/python_script_node.json +89 -0
- vibrante_node/workflows/run_in_sequence.json +158 -0
- vibrante_node/workflows/scene_intent_pipeline.json +134 -0
- vibrante_node/workflows/scene_planning_pipeline.json +258 -0
- vibrante_node/workflows/semantic_scene_intent.json +96 -0
- vibrante_node/workflows/setup_maya_scene.json +352 -0
- vibrante_node/workflows/tutorial_maya_headless_prism_pipeline.json +593 -0
- vibrante_node/workflows/two_way_switch.json +341 -0
- vibrante_node/workflows/while_loop_class_example.json +192 -0
- vibrante_node/workflows/while_loop_example.json +184 -0
- vibrante_node/workflows/while_loop_retry_example.json +276 -0
- vibrante_node-2.5.1.dist-info/METADATA +715 -0
- vibrante_node-2.5.1.dist-info/RECORD +487 -0
- vibrante_node-2.5.1.dist-info/WHEEL +5 -0
- vibrante_node-2.5.1.dist-info/entry_points.txt +3 -0
- vibrante_node-2.5.1.dist-info/licenses/CLA.md +96 -0
- vibrante_node-2.5.1.dist-info/licenses/COMMERCIAL_LICENSE.md +170 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSE +178 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/AGPL-3.0.txt +661 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/CC-BY-4.0-SCOPE.md +53 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/CC-BY-4.0.txt +396 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/GPL-3.0.txt +674 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/LGPL-3.0.txt +165 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/README.md +65 -0
- vibrante_node-2.5.1.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,1498 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<meta name="description" content="Vibrante-Node v2.5.1 — Examples Library">
|
|
7
|
+
<title>Examples Library — Vibrante-Node Docs</title>
|
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/styles/atom-one-dark.min.css">
|
|
9
|
+
<style>
|
|
10
|
+
/* ── Reset & Variables ─────────────────────────────────────────────────── */
|
|
11
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
12
|
+
:root {
|
|
13
|
+
--bg: #1e1e2e;
|
|
14
|
+
--surface: #181825;
|
|
15
|
+
--surface2: #11111b;
|
|
16
|
+
--border: #313244;
|
|
17
|
+
--text: #cdd6f4;
|
|
18
|
+
--subtext: #a6adc8;
|
|
19
|
+
--muted: #6c7086;
|
|
20
|
+
--lavender: #b4befe;
|
|
21
|
+
--blue: #89b4fa;
|
|
22
|
+
--teal: #94e2d5;
|
|
23
|
+
--green: #a6e3a1;
|
|
24
|
+
--yellow: #f9e2af;
|
|
25
|
+
--peach: #fab387;
|
|
26
|
+
--red: #f38ba8;
|
|
27
|
+
--pink: #f5c2e7;
|
|
28
|
+
--mauve: #cba6f7;
|
|
29
|
+
--sidebar-w: 260px;
|
|
30
|
+
--toc-w: 220px;
|
|
31
|
+
--header-h: 56px;
|
|
32
|
+
--font: 'Segoe UI', system-ui, -apple-system, sans-serif;
|
|
33
|
+
--mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* ── Layout ─────────────────────────────────────────────────────────────── */
|
|
37
|
+
html { scroll-behavior: smooth; }
|
|
38
|
+
body {
|
|
39
|
+
font-family: var(--font);
|
|
40
|
+
background: var(--bg);
|
|
41
|
+
color: var(--text);
|
|
42
|
+
line-height: 1.7;
|
|
43
|
+
min-height: 100vh;
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-rows: var(--header-h) 1fr;
|
|
46
|
+
grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
|
|
47
|
+
grid-template-areas:
|
|
48
|
+
"header header header"
|
|
49
|
+
"sidebar content toc";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* ── Header ─────────────────────────────────────────────────────────────── */
|
|
53
|
+
.header {
|
|
54
|
+
grid-area: header;
|
|
55
|
+
position: sticky; top: 0; z-index: 200;
|
|
56
|
+
background: var(--surface2);
|
|
57
|
+
border-bottom: 1px solid var(--border);
|
|
58
|
+
display: flex; align-items: center; gap: 16px;
|
|
59
|
+
padding: 0 24px;
|
|
60
|
+
}
|
|
61
|
+
.header-logo {
|
|
62
|
+
font-weight: 700; font-size: 1.05em;
|
|
63
|
+
color: var(--mauve);
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
}
|
|
67
|
+
.header-version {
|
|
68
|
+
font-size: .78em;
|
|
69
|
+
background: var(--border);
|
|
70
|
+
color: var(--subtext);
|
|
71
|
+
padding: 2px 8px; border-radius: 12px;
|
|
72
|
+
}
|
|
73
|
+
.header-spacer { flex: 1; }
|
|
74
|
+
.search-wrap { position: relative; }
|
|
75
|
+
#search-input {
|
|
76
|
+
background: var(--surface);
|
|
77
|
+
border: 1px solid var(--border);
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
color: var(--text);
|
|
80
|
+
font-family: var(--font);
|
|
81
|
+
font-size: .9em;
|
|
82
|
+
padding: 6px 14px 6px 36px;
|
|
83
|
+
width: 260px;
|
|
84
|
+
outline: none;
|
|
85
|
+
transition: border-color .15s;
|
|
86
|
+
}
|
|
87
|
+
#search-input:focus { border-color: var(--mauve); }
|
|
88
|
+
.search-icon {
|
|
89
|
+
position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
|
|
90
|
+
color: var(--muted); pointer-events: none; font-size: .9em;
|
|
91
|
+
}
|
|
92
|
+
#search-results {
|
|
93
|
+
position: absolute; top: calc(100% + 8px); right: 0;
|
|
94
|
+
width: 380px; max-height: 420px; overflow-y: auto;
|
|
95
|
+
background: var(--surface);
|
|
96
|
+
border: 1px solid var(--border);
|
|
97
|
+
border-radius: 10px;
|
|
98
|
+
box-shadow: 0 8px 32px rgba(0,0,0,.5);
|
|
99
|
+
display: none; z-index: 300;
|
|
100
|
+
}
|
|
101
|
+
#search-results.visible { display: block; }
|
|
102
|
+
.search-result-item {
|
|
103
|
+
padding: 10px 16px;
|
|
104
|
+
border-bottom: 1px solid var(--border);
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
transition: background .1s;
|
|
107
|
+
}
|
|
108
|
+
.search-result-item:last-child { border-bottom: none; }
|
|
109
|
+
.search-result-item:hover { background: var(--bg); }
|
|
110
|
+
.search-result-title { color: var(--blue); font-weight: 600; font-size: .9em; }
|
|
111
|
+
.search-result-excerpt { color: var(--subtext); font-size: .82em; margin-top: 2px; line-height: 1.4; }
|
|
112
|
+
.search-no-results { padding: 16px; color: var(--muted); text-align: center; font-size: .9em; }
|
|
113
|
+
|
|
114
|
+
/* ── Sidebar ─────────────────────────────────────────────────────────────── */
|
|
115
|
+
.sidebar {
|
|
116
|
+
grid-area: sidebar;
|
|
117
|
+
position: sticky; top: var(--header-h);
|
|
118
|
+
height: calc(100vh - var(--header-h));
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
background: var(--surface);
|
|
121
|
+
border-right: 1px solid var(--border);
|
|
122
|
+
padding: 20px 0;
|
|
123
|
+
scrollbar-width: thin;
|
|
124
|
+
scrollbar-color: var(--border) transparent;
|
|
125
|
+
}
|
|
126
|
+
.sidebar::-webkit-scrollbar { width: 4px; }
|
|
127
|
+
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
|
|
128
|
+
|
|
129
|
+
.sidebar-group { margin-bottom: 4px; }
|
|
130
|
+
.sidebar-group-title {
|
|
131
|
+
font-size: .7em;
|
|
132
|
+
text-transform: uppercase;
|
|
133
|
+
letter-spacing: .1em;
|
|
134
|
+
color: var(--muted);
|
|
135
|
+
padding: 10px 20px 4px;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
}
|
|
138
|
+
.sidebar-link {
|
|
139
|
+
display: flex; align-items: center; gap: 8px;
|
|
140
|
+
padding: 6px 20px;
|
|
141
|
+
color: var(--subtext);
|
|
142
|
+
text-decoration: none;
|
|
143
|
+
font-size: .88em;
|
|
144
|
+
border-left: 3px solid transparent;
|
|
145
|
+
transition: all .12s;
|
|
146
|
+
line-height: 1.3;
|
|
147
|
+
}
|
|
148
|
+
.sidebar-link:hover { color: var(--text); background: var(--bg); }
|
|
149
|
+
.sidebar-link.active {
|
|
150
|
+
color: var(--mauve);
|
|
151
|
+
border-left-color: var(--mauve);
|
|
152
|
+
background: rgba(180,190,254,.06);
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
}
|
|
155
|
+
.sidebar-num {
|
|
156
|
+
font-size: .7em;
|
|
157
|
+
color: var(--muted);
|
|
158
|
+
background: var(--border);
|
|
159
|
+
border-radius: 4px;
|
|
160
|
+
padding: 1px 5px;
|
|
161
|
+
flex-shrink: 0;
|
|
162
|
+
}
|
|
163
|
+
.sidebar-divider {
|
|
164
|
+
border: none;
|
|
165
|
+
border-top: 1px solid var(--border);
|
|
166
|
+
margin: 12px 16px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* ── Content ─────────────────────────────────────────────────────────────── */
|
|
170
|
+
.content {
|
|
171
|
+
grid-area: content;
|
|
172
|
+
min-width: 0;
|
|
173
|
+
padding: 40px 48px 80px;
|
|
174
|
+
max-width: 860px;
|
|
175
|
+
}
|
|
176
|
+
.content-inner { max-width: 820px; }
|
|
177
|
+
|
|
178
|
+
/* Breadcrumb */
|
|
179
|
+
.breadcrumb {
|
|
180
|
+
font-size: .8em;
|
|
181
|
+
color: var(--muted);
|
|
182
|
+
margin-bottom: 28px;
|
|
183
|
+
display: flex; align-items: center; gap: 6px;
|
|
184
|
+
}
|
|
185
|
+
.breadcrumb a { color: var(--blue); text-decoration: none; }
|
|
186
|
+
.breadcrumb a:hover { text-decoration: underline; }
|
|
187
|
+
.breadcrumb-sep { color: var(--border); }
|
|
188
|
+
|
|
189
|
+
/* Typography */
|
|
190
|
+
h1 { font-size: 2em; color: var(--mauve); border-bottom: 2px solid var(--border); padding-bottom: 12px; margin: 20px 0 20px; }
|
|
191
|
+
h2 { font-size: 1.45em; color: var(--blue); margin: 40px 0 14px; padding-top: 8px; }
|
|
192
|
+
h3 { font-size: 1.15em; color: var(--teal); margin: 28px 0 10px; }
|
|
193
|
+
h4 { font-size: 1em; color: var(--pink); margin: 20px 0 8px; }
|
|
194
|
+
h5 { font-size: .95em; color: var(--yellow); margin: 16px 0 6px; }
|
|
195
|
+
p { margin-bottom: 16px; color: var(--text); }
|
|
196
|
+
a { color: var(--blue); }
|
|
197
|
+
a:hover { text-decoration: underline; }
|
|
198
|
+
strong { color: var(--peach); }
|
|
199
|
+
em { color: var(--yellow); font-style: italic; }
|
|
200
|
+
|
|
201
|
+
ul, ol { margin: 10px 0 16px 24px; }
|
|
202
|
+
li { margin-bottom: 6px; }
|
|
203
|
+
li > ul, li > ol { margin-top: 4px; margin-bottom: 4px; }
|
|
204
|
+
|
|
205
|
+
blockquote {
|
|
206
|
+
border-left: 4px solid var(--mauve);
|
|
207
|
+
padding: 10px 20px;
|
|
208
|
+
margin: 16px 0;
|
|
209
|
+
background: rgba(180,190,254,.05);
|
|
210
|
+
border-radius: 0 8px 8px 0;
|
|
211
|
+
color: var(--subtext);
|
|
212
|
+
}
|
|
213
|
+
blockquote strong { color: var(--mauve); }
|
|
214
|
+
|
|
215
|
+
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
|
|
216
|
+
|
|
217
|
+
/* Code */
|
|
218
|
+
code {
|
|
219
|
+
background: var(--surface2);
|
|
220
|
+
color: var(--red);
|
|
221
|
+
padding: 2px 7px; border-radius: 5px;
|
|
222
|
+
font-family: var(--mono); font-size: .87em;
|
|
223
|
+
}
|
|
224
|
+
pre {
|
|
225
|
+
background: var(--surface2) !important;
|
|
226
|
+
border: 1px solid var(--border);
|
|
227
|
+
border-radius: 10px;
|
|
228
|
+
padding: 20px 22px;
|
|
229
|
+
overflow-x: auto;
|
|
230
|
+
margin: 16px 0 22px;
|
|
231
|
+
position: relative;
|
|
232
|
+
}
|
|
233
|
+
pre code {
|
|
234
|
+
background: none !important;
|
|
235
|
+
color: inherit !important;
|
|
236
|
+
padding: 0; font-size: .9em;
|
|
237
|
+
border-radius: 0;
|
|
238
|
+
}
|
|
239
|
+
/* Copy button */
|
|
240
|
+
.copy-btn {
|
|
241
|
+
position: absolute; top: 10px; right: 12px;
|
|
242
|
+
background: var(--border);
|
|
243
|
+
color: var(--subtext);
|
|
244
|
+
border: none; border-radius: 5px;
|
|
245
|
+
padding: 3px 10px; font-size: .75em;
|
|
246
|
+
cursor: pointer; transition: all .12s;
|
|
247
|
+
font-family: var(--font);
|
|
248
|
+
}
|
|
249
|
+
.copy-btn:hover { background: var(--mauve); color: var(--surface2); }
|
|
250
|
+
.copy-btn.copied { background: var(--green); color: var(--surface2); }
|
|
251
|
+
|
|
252
|
+
/* Tables */
|
|
253
|
+
table { border-collapse: collapse; width: 100%; margin: 16px 0 22px; font-size: .9em; }
|
|
254
|
+
th { background: var(--border); color: var(--mauve); padding: 10px 14px; text-align: left; font-weight: 600; }
|
|
255
|
+
td { border-top: 1px solid var(--border); padding: 9px 14px; color: var(--text); }
|
|
256
|
+
tr:nth-child(even) td { background: rgba(17,17,27,.4); }
|
|
257
|
+
td code { font-size: .85em; }
|
|
258
|
+
|
|
259
|
+
/* Callout boxes */
|
|
260
|
+
.callout {
|
|
261
|
+
border-radius: 8px;
|
|
262
|
+
padding: 14px 18px;
|
|
263
|
+
margin: 16px 0 22px;
|
|
264
|
+
border-left: 4px solid;
|
|
265
|
+
}
|
|
266
|
+
.callout-note { background: rgba(137,180,250,.08); border-color: var(--blue); }
|
|
267
|
+
.callout-tip { background: rgba(166,227,161,.08); border-color: var(--green); }
|
|
268
|
+
.callout-warning { background: rgba(249,226,175,.08); border-color: var(--yellow); }
|
|
269
|
+
.callout-danger { background: rgba(243,139,168,.08); border-color: var(--red); }
|
|
270
|
+
.callout-title { font-weight: 700; font-size: .85em; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
|
|
271
|
+
.callout-note .callout-title { color: var(--blue); }
|
|
272
|
+
.callout-tip .callout-title { color: var(--green); }
|
|
273
|
+
.callout-warning .callout-title { color: var(--yellow); }
|
|
274
|
+
.callout-danger .callout-title { color: var(--red); }
|
|
275
|
+
|
|
276
|
+
/* Validation badges */
|
|
277
|
+
.val-badge {
|
|
278
|
+
display: inline-block; font-size: .78em; font-weight: 600;
|
|
279
|
+
padding: 4px 12px; border-radius: 20px; margin-bottom: 18px;
|
|
280
|
+
border: 1px solid transparent; letter-spacing: .02em;
|
|
281
|
+
}
|
|
282
|
+
.val-badge-ok { background: rgba(166,227,161,.12); border-color: var(--green); color: var(--green); }
|
|
283
|
+
.val-badge-warn { background: rgba(249,226,175,.12); border-color: var(--yellow); color: var(--yellow); }
|
|
284
|
+
.val-badge-error { background: rgba(243,139,168,.12); border-color: var(--red); color: var(--red); }
|
|
285
|
+
.val-badge-unknown { background: rgba(108,112,134,.12); border-color: #6c7086; color: #6c7086; }
|
|
286
|
+
|
|
287
|
+
/* Prev/Next navigation */
|
|
288
|
+
.page-nav {
|
|
289
|
+
display: flex; justify-content: space-between;
|
|
290
|
+
margin-top: 60px; padding-top: 24px;
|
|
291
|
+
border-top: 1px solid var(--border);
|
|
292
|
+
gap: 16px;
|
|
293
|
+
}
|
|
294
|
+
.page-nav-link {
|
|
295
|
+
display: flex; flex-direction: column;
|
|
296
|
+
text-decoration: none;
|
|
297
|
+
padding: 14px 20px;
|
|
298
|
+
background: var(--surface);
|
|
299
|
+
border: 1px solid var(--border);
|
|
300
|
+
border-radius: 10px;
|
|
301
|
+
min-width: 200px;
|
|
302
|
+
transition: border-color .15s;
|
|
303
|
+
max-width: 48%;
|
|
304
|
+
}
|
|
305
|
+
.page-nav-link:hover { border-color: var(--mauve); }
|
|
306
|
+
.page-nav-label { font-size: .75em; color: var(--muted); margin-bottom: 4px; }
|
|
307
|
+
.page-nav-title { color: var(--blue); font-weight: 600; font-size: .95em; }
|
|
308
|
+
.page-nav-link.prev .page-nav-label::before { content: '← '; }
|
|
309
|
+
.page-nav-link.next { margin-left: auto; text-align: right; }
|
|
310
|
+
.page-nav-link.next .page-nav-label::after { content: ' →'; }
|
|
311
|
+
|
|
312
|
+
/* ── TOC (right panel) ───────────────────────────────────────────────────── */
|
|
313
|
+
.toc {
|
|
314
|
+
grid-area: toc;
|
|
315
|
+
position: sticky; top: var(--header-h);
|
|
316
|
+
height: calc(100vh - var(--header-h));
|
|
317
|
+
overflow-y: auto;
|
|
318
|
+
padding: 28px 16px 28px 8px;
|
|
319
|
+
scrollbar-width: thin;
|
|
320
|
+
scrollbar-color: var(--border) transparent;
|
|
321
|
+
}
|
|
322
|
+
.toc-title {
|
|
323
|
+
font-size: .72em;
|
|
324
|
+
text-transform: uppercase;
|
|
325
|
+
letter-spacing: .1em;
|
|
326
|
+
color: var(--muted);
|
|
327
|
+
font-weight: 600;
|
|
328
|
+
margin-bottom: 12px;
|
|
329
|
+
padding-left: 8px;
|
|
330
|
+
}
|
|
331
|
+
.toc-link {
|
|
332
|
+
display: block;
|
|
333
|
+
padding: 4px 8px;
|
|
334
|
+
color: var(--subtext);
|
|
335
|
+
text-decoration: none;
|
|
336
|
+
font-size: .82em;
|
|
337
|
+
border-left: 2px solid transparent;
|
|
338
|
+
border-radius: 0 4px 4px 0;
|
|
339
|
+
transition: all .12s;
|
|
340
|
+
line-height: 1.35;
|
|
341
|
+
margin-bottom: 1px;
|
|
342
|
+
}
|
|
343
|
+
.toc-link:hover { color: var(--text); border-left-color: var(--border); }
|
|
344
|
+
.toc-link.active { color: var(--mauve); border-left-color: var(--mauve); background: rgba(180,190,254,.05); }
|
|
345
|
+
.toc-link.toc-h3 { padding-left: 20px; font-size: .79em; }
|
|
346
|
+
.toc-link.toc-h4 { padding-left: 32px; font-size: .76em; color: var(--muted); }
|
|
347
|
+
|
|
348
|
+
/* ── Responsive ──────────────────────────────────────────────────────────── */
|
|
349
|
+
@media (max-width: 1100px) {
|
|
350
|
+
body { grid-template-columns: var(--sidebar-w) 1fr 0; }
|
|
351
|
+
.toc { display: none; }
|
|
352
|
+
}
|
|
353
|
+
@media (max-width: 760px) {
|
|
354
|
+
body { grid-template-columns: 0 1fr 0; grid-template-rows: var(--header-h) 1fr; }
|
|
355
|
+
.sidebar { display: none; }
|
|
356
|
+
.content { padding: 24px 20px 60px; }
|
|
357
|
+
#search-input { width: 180px; }
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* ── Index / landing page ────────────────────────────────────────────────── */
|
|
361
|
+
.hero { text-align: center; padding: 60px 0 48px; }
|
|
362
|
+
.hero h1 { border: none; font-size: 2.8em; }
|
|
363
|
+
.hero .tagline { color: var(--subtext); font-size: 1.15em; margin-top: 10px; }
|
|
364
|
+
.hero .version-badge {
|
|
365
|
+
display: inline-block;
|
|
366
|
+
background: var(--border); color: var(--mauve);
|
|
367
|
+
padding: 4px 14px; border-radius: 20px; font-size: .85em;
|
|
368
|
+
margin-top: 14px;
|
|
369
|
+
}
|
|
370
|
+
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 36px; }
|
|
371
|
+
.doc-card {
|
|
372
|
+
background: var(--surface);
|
|
373
|
+
border: 1px solid var(--border);
|
|
374
|
+
border-radius: 12px;
|
|
375
|
+
padding: 20px 24px;
|
|
376
|
+
text-decoration: none;
|
|
377
|
+
color: var(--text);
|
|
378
|
+
transition: border-color .15s, background .15s;
|
|
379
|
+
display: block;
|
|
380
|
+
}
|
|
381
|
+
.doc-card:hover { border-color: var(--mauve); background: rgba(180,190,254,.04); }
|
|
382
|
+
.doc-card-num { font-size: .72em; color: var(--muted); margin-bottom: 4px; }
|
|
383
|
+
.doc-card-title { color: var(--blue); font-weight: 700; font-size: 1em; margin-bottom: 6px; }
|
|
384
|
+
.doc-card-desc { color: var(--subtext); font-size: .85em; line-height: 1.5; }
|
|
385
|
+
.group-title { color: var(--teal); font-size: 1.1em; font-weight: 600; margin: 32px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
|
|
386
|
+
</style>
|
|
387
|
+
<span id="portal-base" data-base="" style="display:none"></span>
|
|
388
|
+
</head>
|
|
389
|
+
<body>
|
|
390
|
+
|
|
391
|
+
<!-- ── Header ─────────────────────────────────────────────────────────── -->
|
|
392
|
+
<header class="header">
|
|
393
|
+
<a class="header-logo" href="index.html">Vibrante-Node</a>
|
|
394
|
+
<span class="header-version">v2.5.1</span>
|
|
395
|
+
<div class="header-spacer"></div>
|
|
396
|
+
<div class="search-wrap">
|
|
397
|
+
<span class="search-icon">🔍</span>
|
|
398
|
+
<input id="search-input" type="text" placeholder="Search docs… (/)" autocomplete="off" spellcheck="false">
|
|
399
|
+
<div id="search-results"></div>
|
|
400
|
+
</div>
|
|
401
|
+
</header>
|
|
402
|
+
|
|
403
|
+
<!-- ── Sidebar ────────────────────────────────────────────────────────── -->
|
|
404
|
+
<nav class="sidebar">
|
|
405
|
+
<div class="sidebar-group">
|
|
406
|
+
<div class="sidebar-group-title">Overview</div>
|
|
407
|
+
<a class="sidebar-link" href="01_introduction.html"><span class="sidebar-num">01</span>Introduction</a>
|
|
408
|
+
<a class="sidebar-link" href="02_getting_started.html"><span class="sidebar-num">02</span>Getting Started</a>
|
|
409
|
+
</div>
|
|
410
|
+
<div class="sidebar-group">
|
|
411
|
+
<div class="sidebar-group-title">Using the App</div>
|
|
412
|
+
<a class="sidebar-link" href="03_user_guide.html"><span class="sidebar-num">03</span>User Guide</a>
|
|
413
|
+
<a class="sidebar-link" href="04_workflow_tutorials.html"><span class="sidebar-num">04</span>Workflow Tutorials</a>
|
|
414
|
+
</div>
|
|
415
|
+
<div class="sidebar-group">
|
|
416
|
+
<div class="sidebar-group-title">Developing Nodes</div>
|
|
417
|
+
<a class="sidebar-link" href="05_node_development.html"><span class="sidebar-num">05</span>Node Development Guide</a>
|
|
418
|
+
<a class="sidebar-link" href="14_custom_nodes_api.html"><span class="sidebar-num">14</span>Custom Nodes API</a>
|
|
419
|
+
<a class="sidebar-link" href="08_api_reference.html"><span class="sidebar-num">08</span>API Reference</a>
|
|
420
|
+
</div>
|
|
421
|
+
<div class="sidebar-group">
|
|
422
|
+
<div class="sidebar-group-title">Architecture</div>
|
|
423
|
+
<a class="sidebar-link" href="06_backend_architecture.html"><span class="sidebar-num">06</span>Backend Architecture</a>
|
|
424
|
+
<a class="sidebar-link" href="07_frontend_architecture.html"><span class="sidebar-num">07</span>Frontend Architecture</a>
|
|
425
|
+
</div>
|
|
426
|
+
<div class="sidebar-group">
|
|
427
|
+
<div class="sidebar-group-title">Advanced</div>
|
|
428
|
+
<a class="sidebar-link" href="09_advanced_topics.html"><span class="sidebar-num">09</span>Advanced Topics</a>
|
|
429
|
+
<a class="sidebar-link" href="10_contribution_guide.html"><span class="sidebar-num">10</span>Contribution Guide</a>
|
|
430
|
+
</div>
|
|
431
|
+
<div class="sidebar-group">
|
|
432
|
+
<div class="sidebar-group-title">Reference</div>
|
|
433
|
+
<a class="sidebar-link" href="11_troubleshooting.html"><span class="sidebar-num">11</span>Troubleshooting</a>
|
|
434
|
+
<a class="sidebar-link active" href="12_examples_library.html"><span class="sidebar-num">12</span>Examples Library</a>
|
|
435
|
+
<a class="sidebar-link" href="13_general_purpose_automation.html"><span class="sidebar-num">13</span>General Purpose Automation</a>
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
</nav>
|
|
439
|
+
|
|
440
|
+
<!-- ── Main content ───────────────────────────────────────────────────── -->
|
|
441
|
+
<main class="content">
|
|
442
|
+
<div class="content-inner">
|
|
443
|
+
<nav class="breadcrumb"><a href="index.html">Docs</a><span class="breadcrumb-sep">›</span><span>Examples Library</span></nav>
|
|
444
|
+
<div class="val-badge val-badge-ok" title="Verified against source code">✓ Verified</div>
|
|
445
|
+
<p># Examples Library</p>
|
|
446
|
+
<p>This chapter provides ten complete, copy-paste-ready node examples. Each example includes the full JSON node definition, the Python code, and a usage guide. All examples follow the node authoring conventions described in the Contribution Guide.</p>
|
|
447
|
+
<hr />
|
|
448
|
+
<h2 id="example-1-custom-string-processor-node">Example 1: Custom String Processor Node</h2>
|
|
449
|
+
<p><strong>Description:</strong> Takes a string input and a regex pattern, replaces all matches with a replacement string, and outputs the modified result along with the count of substitutions made.</p>
|
|
450
|
+
<h3 id="node-json">Node JSON</h3>
|
|
451
|
+
<pre><code class="language-json">{
|
|
452
|
+
"node_id": "regex_replace",
|
|
453
|
+
"name": "regex_replace",
|
|
454
|
+
"description": "Replace all regex matches in a string with a substitution value.",
|
|
455
|
+
"category": "String",
|
|
456
|
+
"icon_path": null,
|
|
457
|
+
"use_exec": true,
|
|
458
|
+
"inputs": [
|
|
459
|
+
{ "name": "exec_in", "type": "any", "widget_type": null, "options": null, "default": null },
|
|
460
|
+
{ "name": "text", "type": "string", "widget_type": "text", "options": null, "default": "" },
|
|
461
|
+
{ "name": "pattern", "type": "string", "widget_type": "text", "options": null, "default": "" },
|
|
462
|
+
{ "name": "replacement", "type": "string", "widget_type": "text", "options": null, "default": "" },
|
|
463
|
+
{ "name": "ignore_case", "type": "bool", "widget_type": "checkbox", "options": null, "default": false }
|
|
464
|
+
],
|
|
465
|
+
"outputs": [
|
|
466
|
+
{ "name": "result", "type": "string", "widget_type": null, "options": null, "default": null },
|
|
467
|
+
{ "name": "match_count", "type": "int", "widget_type": null, "options": null, "default": null },
|
|
468
|
+
{ "name": "exec_out", "type": "any", "widget_type": null, "options": null, "default": null }
|
|
469
|
+
],
|
|
470
|
+
"python_code": "..."
|
|
471
|
+
}
|
|
472
|
+
</code></pre>
|
|
473
|
+
<h3 id="python-code">Python Code</h3>
|
|
474
|
+
<pre><code class="language-python">import re
|
|
475
|
+
from src.nodes.base import BaseNode
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
class Regex_Replace(BaseNode):
|
|
479
|
+
name = "regex_replace"
|
|
480
|
+
|
|
481
|
+
def __init__(self):
|
|
482
|
+
super().__init__()
|
|
483
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
484
|
+
self.add_input("text", "string", widget_type="text", default="")
|
|
485
|
+
self.add_input("pattern", "string", widget_type="text", default="")
|
|
486
|
+
self.add_input("replacement", "string", widget_type="text", default="")
|
|
487
|
+
self.add_input("ignore_case", "bool", widget_type="checkbox", default=False)
|
|
488
|
+
self.add_output("result", "string")
|
|
489
|
+
self.add_output("match_count", "int")
|
|
490
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
491
|
+
|
|
492
|
+
async def execute(self, inputs: dict) -> dict:
|
|
493
|
+
text = inputs.get("text", "")
|
|
494
|
+
pattern = inputs.get("pattern", "")
|
|
495
|
+
replacement = inputs.get("replacement", "")
|
|
496
|
+
ignore_case = inputs.get("ignore_case", False)
|
|
497
|
+
|
|
498
|
+
if not pattern:
|
|
499
|
+
return {"result": text, "match_count": 0, "exec_out": True}
|
|
500
|
+
|
|
501
|
+
flags = re.IGNORECASE if ignore_case else 0
|
|
502
|
+
|
|
503
|
+
try:
|
|
504
|
+
compiled = re.compile(pattern, flags)
|
|
505
|
+
matches = compiled.findall(text)
|
|
506
|
+
result = compiled.sub(replacement, text)
|
|
507
|
+
return {
|
|
508
|
+
"result": result,
|
|
509
|
+
"match_count": len(matches),
|
|
510
|
+
"exec_out": True,
|
|
511
|
+
}
|
|
512
|
+
except re.error as e:
|
|
513
|
+
self.log_error(f"Invalid regex pattern '{pattern}': {e}")
|
|
514
|
+
return {"result": text, "match_count": 0, "exec_out": True}
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
def register_node():
|
|
518
|
+
return Regex_Replace
|
|
519
|
+
</code></pre>
|
|
520
|
+
<h3 id="usage">Usage</h3>
|
|
521
|
+
<ol>
|
|
522
|
+
<li>Wire a string value into <code>text</code>.</li>
|
|
523
|
+
<li>Set <code>pattern</code> to a Python regex (e.g., <code>\b\d{4}\b</code> to find 4-digit numbers).</li>
|
|
524
|
+
<li>Set <code>replacement</code> to the substitution string (supports back-references: <code>\1</code>).</li>
|
|
525
|
+
<li>Enable <code>ignore_case</code> for case-insensitive matching.</li>
|
|
526
|
+
<li><code>result</code> carries the modified string; <code>match_count</code> carries how many substitutions were made.</li>
|
|
527
|
+
</ol>
|
|
528
|
+
<hr />
|
|
529
|
+
<h2 id="example-2-http-api-request-node">Example 2: HTTP API Request Node</h2>
|
|
530
|
+
<p><strong>Description:</strong> Makes an async HTTP GET or POST request, handles JSON or text responses, and outputs the parsed data. Uses <code>urllib.request</code> in a thread executor (<code>loop.run_in_executor</code>) for non-blocking I/O — compatible with Vibrante-Node's QTimer-stepped asyncio event loop.</p>
|
|
531
|
+
<h3 id="node-json_1">Node JSON</h3>
|
|
532
|
+
<pre><code class="language-json">{
|
|
533
|
+
"node_id": "http_request",
|
|
534
|
+
"name": "http_request",
|
|
535
|
+
"description": "Async HTTP GET or POST request with optional JSON body and headers.",
|
|
536
|
+
"category": "Network",
|
|
537
|
+
"icon_path": null,
|
|
538
|
+
"use_exec": true,
|
|
539
|
+
"inputs": [
|
|
540
|
+
{ "name": "exec_in", "type": "any", "widget_type": null, "options": null, "default": null },
|
|
541
|
+
{ "name": "url", "type": "string", "widget_type": "text", "options": null, "default": "" },
|
|
542
|
+
{ "name": "method", "type": "string", "widget_type": "text", "options": null, "default": "GET" },
|
|
543
|
+
{ "name": "headers", "type": "any", "widget_type": null, "options": null, "default": null },
|
|
544
|
+
{ "name": "body", "type": "any", "widget_type": null, "options": null, "default": null },
|
|
545
|
+
{ "name": "timeout", "type": "int", "widget_type": "int", "options": null, "default": 30 }
|
|
546
|
+
],
|
|
547
|
+
"outputs": [
|
|
548
|
+
{ "name": "response_data", "type": "any", "widget_type": null, "options": null, "default": null },
|
|
549
|
+
{ "name": "status_code", "type": "int", "widget_type": null, "options": null, "default": null },
|
|
550
|
+
{ "name": "response_text", "type": "string", "widget_type": null, "options": null, "default": null },
|
|
551
|
+
{ "name": "success", "type": "bool", "widget_type": null, "options": null, "default": null },
|
|
552
|
+
{ "name": "exec_out", "type": "any", "widget_type": null, "options": null, "default": null }
|
|
553
|
+
],
|
|
554
|
+
"python_code": "..."
|
|
555
|
+
}
|
|
556
|
+
</code></pre>
|
|
557
|
+
<h3 id="python-code_1">Python Code</h3>
|
|
558
|
+
<pre><code class="language-python">import json
|
|
559
|
+
import asyncio
|
|
560
|
+
from src.nodes.base import BaseNode
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
class Http_Request(BaseNode):
|
|
564
|
+
name = "http_request"
|
|
565
|
+
|
|
566
|
+
def __init__(self):
|
|
567
|
+
super().__init__()
|
|
568
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
569
|
+
self.add_input("url", "string", widget_type="text", default="")
|
|
570
|
+
self.add_input("method", "string", widget_type="text", default="GET")
|
|
571
|
+
self.add_input("headers", "any", default=None)
|
|
572
|
+
self.add_input("body", "any", default=None)
|
|
573
|
+
self.add_input("timeout", "int", widget_type="int", default=30)
|
|
574
|
+
self.add_output("response_data", "any")
|
|
575
|
+
self.add_output("status_code", "int")
|
|
576
|
+
self.add_output("response_text", "string")
|
|
577
|
+
self.add_output("success", "bool")
|
|
578
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
579
|
+
|
|
580
|
+
async def execute(self, inputs: dict) -> dict:
|
|
581
|
+
import urllib.request
|
|
582
|
+
import urllib.error
|
|
583
|
+
|
|
584
|
+
url = inputs.get("url", "")
|
|
585
|
+
method = (inputs.get("method") or "GET").upper()
|
|
586
|
+
headers = dict(inputs.get("headers") or {})
|
|
587
|
+
body = inputs.get("body")
|
|
588
|
+
timeout = int(inputs.get("timeout") or 30)
|
|
589
|
+
|
|
590
|
+
if not url:
|
|
591
|
+
self.log_error("No URL provided.")
|
|
592
|
+
return {"response_data": None, "status_code": 0,
|
|
593
|
+
"response_text": "", "success": False, "exec_out": True}
|
|
594
|
+
|
|
595
|
+
body_bytes = None
|
|
596
|
+
if body is not None:
|
|
597
|
+
body_str = json.dumps(body) if isinstance(body, (dict, list)) else str(body)
|
|
598
|
+
body_bytes = body_str.encode("utf-8")
|
|
599
|
+
headers.setdefault("Content-Type", "application/json")
|
|
600
|
+
|
|
601
|
+
req = urllib.request.Request(url, data=body_bytes, headers=headers, method=method)
|
|
602
|
+
|
|
603
|
+
def _sync_do():
|
|
604
|
+
try:
|
|
605
|
+
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
606
|
+
return resp.status, resp.read().decode("utf-8")
|
|
607
|
+
except urllib.error.HTTPError as e:
|
|
608
|
+
return e.code, e.read().decode("utf-8", errors="replace")
|
|
609
|
+
|
|
610
|
+
loop = asyncio.get_running_loop()
|
|
611
|
+
try:
|
|
612
|
+
status, text = await loop.run_in_executor(None, _sync_do)
|
|
613
|
+
try:
|
|
614
|
+
data = json.loads(text)
|
|
615
|
+
except (json.JSONDecodeError, ValueError):
|
|
616
|
+
data = text
|
|
617
|
+
return {
|
|
618
|
+
"response_data": data,
|
|
619
|
+
"status_code": status,
|
|
620
|
+
"response_text": text,
|
|
621
|
+
"success": 200 <= status < 300,
|
|
622
|
+
"exec_out": True,
|
|
623
|
+
}
|
|
624
|
+
except Exception as e:
|
|
625
|
+
self.log_error(f"HTTP request failed: {e}")
|
|
626
|
+
return {"response_data": None, "status_code": 0,
|
|
627
|
+
"response_text": str(e), "success": False, "exec_out": True}
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
def register_node():
|
|
631
|
+
return Http_Request
|
|
632
|
+
</code></pre>
|
|
633
|
+
<h3 id="usage_1">Usage</h3>
|
|
634
|
+
<ul>
|
|
635
|
+
<li>Set <code>url</code> to any REST endpoint.</li>
|
|
636
|
+
<li>Set <code>method</code> to <code>GET</code>, <code>POST</code>, <code>PUT</code>, or <code>DELETE</code>.</li>
|
|
637
|
+
<li>Wire a dict into <code>headers</code> for custom headers (e.g., <code>{"Authorization": "Bearer token"}</code>).</li>
|
|
638
|
+
<li>Wire a dict or list into <code>body</code> for POST requests — it is automatically JSON-encoded.</li>
|
|
639
|
+
<li>Check <code>success</code> with a TwoWaySwitch to branch on HTTP errors.</li>
|
|
640
|
+
</ul>
|
|
641
|
+
<hr />
|
|
642
|
+
<h2 id="example-3-file-batch-processor-node">Example 3: File Batch Processor Node</h2>
|
|
643
|
+
<p><strong>Description:</strong> Scans a folder for files matching a glob pattern and outputs a list of matching absolute paths. Optionally recurses into subdirectories.</p>
|
|
644
|
+
<h3 id="python-code_2">Python Code</h3>
|
|
645
|
+
<pre><code class="language-python">import glob
|
|
646
|
+
import os
|
|
647
|
+
import asyncio
|
|
648
|
+
from src.nodes.base import BaseNode
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
class File_Batch_Processor(BaseNode):
|
|
652
|
+
name = "file_batch_processor"
|
|
653
|
+
|
|
654
|
+
def __init__(self):
|
|
655
|
+
super().__init__()
|
|
656
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
657
|
+
self.add_input("folder_path", "string", widget_type="text", default="")
|
|
658
|
+
self.add_input("pattern", "string", widget_type="text", default="*")
|
|
659
|
+
self.add_input("recursive", "bool", widget_type="checkbox", default=False)
|
|
660
|
+
self.add_output("file_list", "list")
|
|
661
|
+
self.add_output("file_count", "int")
|
|
662
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
663
|
+
|
|
664
|
+
async def execute(self, inputs: dict) -> dict:
|
|
665
|
+
folder = inputs.get("folder_path", "")
|
|
666
|
+
pattern = inputs.get("pattern", "*")
|
|
667
|
+
recursive = inputs.get("recursive", False)
|
|
668
|
+
|
|
669
|
+
if not folder:
|
|
670
|
+
self.log_error("No folder path provided.")
|
|
671
|
+
return {"file_list": [], "file_count": 0, "exec_out": True}
|
|
672
|
+
|
|
673
|
+
folder = os.path.abspath(folder)
|
|
674
|
+
|
|
675
|
+
if not os.path.isdir(folder):
|
|
676
|
+
self.log_error(f"Folder does not exist: {folder}")
|
|
677
|
+
return {"file_list": [], "file_count": 0, "exec_out": True}
|
|
678
|
+
|
|
679
|
+
def _scan():
|
|
680
|
+
if recursive:
|
|
681
|
+
glob_pattern = os.path.join(folder, "**", pattern)
|
|
682
|
+
paths = glob.glob(glob_pattern, recursive=True)
|
|
683
|
+
else:
|
|
684
|
+
glob_pattern = os.path.join(folder, pattern)
|
|
685
|
+
paths = glob.glob(glob_pattern)
|
|
686
|
+
return sorted(p for p in paths if os.path.isfile(p))
|
|
687
|
+
|
|
688
|
+
file_list = await asyncio.to_thread(_scan)
|
|
689
|
+
|
|
690
|
+
self.log_info(f"Found {len(file_list)} file(s) matching '{pattern}' in {folder}")
|
|
691
|
+
return {
|
|
692
|
+
"file_list": file_list,
|
|
693
|
+
"file_count": len(file_list),
|
|
694
|
+
"exec_out": True,
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
def register_node():
|
|
699
|
+
return File_Batch_Processor
|
|
700
|
+
</code></pre>
|
|
701
|
+
<h3 id="usage_2">Usage</h3>
|
|
702
|
+
<ul>
|
|
703
|
+
<li>Set <code>folder_path</code> to an absolute directory path.</li>
|
|
704
|
+
<li>Set <code>pattern</code> to a glob like <code>*.png</code>, <code>*.{jpg,jpeg,png}</code>, or <code>render_*_beauty.exr</code>.</li>
|
|
705
|
+
<li>Enable <code>recursive</code> to search all subdirectories.</li>
|
|
706
|
+
<li>Connect <code>file_list</code> to a ForEach node to process each file individually.</li>
|
|
707
|
+
</ul>
|
|
708
|
+
<hr />
|
|
709
|
+
<h2 id="example-4-email-notification-node">Example 4: Email Notification Node</h2>
|
|
710
|
+
<p><strong>Description:</strong> Sends an email via SMTP. Supports TLS, configurable sender/recipient, subject and body. Ideal as a final step in an automation pipeline to notify on completion or failure.</p>
|
|
711
|
+
<h3 id="python-code_3">Python Code</h3>
|
|
712
|
+
<pre><code class="language-python">import asyncio
|
|
713
|
+
import smtplib
|
|
714
|
+
import ssl
|
|
715
|
+
from email.mime.text import MIMEText
|
|
716
|
+
from email.mime.multipart import MIMEMultipart
|
|
717
|
+
from src.nodes.base import BaseNode
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
class Email_Notification(BaseNode):
|
|
721
|
+
name = "email_notification"
|
|
722
|
+
|
|
723
|
+
def __init__(self):
|
|
724
|
+
super().__init__()
|
|
725
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
726
|
+
self.add_input("smtp_host", "string", widget_type="text", default="smtp.gmail.com")
|
|
727
|
+
self.add_input("smtp_port", "int", widget_type="int", default=587)
|
|
728
|
+
self.add_input("username", "string", widget_type="text", default="")
|
|
729
|
+
self.add_input("password", "string", widget_type="text", default="")
|
|
730
|
+
self.add_input("from_addr", "string", widget_type="text", default="")
|
|
731
|
+
self.add_input("to_addr", "string", widget_type="text", default="")
|
|
732
|
+
self.add_input("subject", "string", widget_type="text", default="")
|
|
733
|
+
self.add_input("body", "string", widget_type="text", default="")
|
|
734
|
+
self.add_input("use_tls", "bool", widget_type="checkbox", default=True)
|
|
735
|
+
self.add_output("sent", "bool")
|
|
736
|
+
self.add_output("error_msg", "string")
|
|
737
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
738
|
+
|
|
739
|
+
async def execute(self, inputs: dict) -> dict:
|
|
740
|
+
host = inputs.get("smtp_host", "")
|
|
741
|
+
port = int(inputs.get("smtp_port") or 587)
|
|
742
|
+
username = inputs.get("username", "")
|
|
743
|
+
password = inputs.get("password", "")
|
|
744
|
+
from_addr = inputs.get("from_addr", "") or username
|
|
745
|
+
to_addr = inputs.get("to_addr", "")
|
|
746
|
+
subject = inputs.get("subject", "(no subject)")
|
|
747
|
+
body = inputs.get("body", "")
|
|
748
|
+
use_tls = inputs.get("use_tls", True)
|
|
749
|
+
|
|
750
|
+
if not host or not to_addr:
|
|
751
|
+
self.log_error("smtp_host and to_addr are required.")
|
|
752
|
+
return {"sent": False, "error_msg": "Missing host or recipient.", "exec_out": True}
|
|
753
|
+
|
|
754
|
+
def _send():
|
|
755
|
+
msg = MIMEMultipart("alternative")
|
|
756
|
+
msg["Subject"] = subject
|
|
757
|
+
msg["From"] = from_addr
|
|
758
|
+
msg["To"] = to_addr
|
|
759
|
+
msg.attach(MIMEText(body, "plain"))
|
|
760
|
+
|
|
761
|
+
context = ssl.create_default_context()
|
|
762
|
+
|
|
763
|
+
if use_tls:
|
|
764
|
+
with smtplib.SMTP(host, port) as server:
|
|
765
|
+
server.ehlo()
|
|
766
|
+
server.starttls(context=context)
|
|
767
|
+
if username:
|
|
768
|
+
server.login(username, password)
|
|
769
|
+
server.sendmail(from_addr, to_addr, msg.as_string())
|
|
770
|
+
else:
|
|
771
|
+
with smtplib.SMTP_SSL(host, port, context=context) as server:
|
|
772
|
+
if username:
|
|
773
|
+
server.login(username, password)
|
|
774
|
+
server.sendmail(from_addr, to_addr, msg.as_string())
|
|
775
|
+
|
|
776
|
+
try:
|
|
777
|
+
await asyncio.to_thread(_send)
|
|
778
|
+
self.log_info(f"Email sent to {to_addr}: {subject}")
|
|
779
|
+
return {"sent": True, "error_msg": "", "exec_out": True}
|
|
780
|
+
except Exception as e:
|
|
781
|
+
self.log_error(f"Email failed: {e}")
|
|
782
|
+
return {"sent": False, "error_msg": str(e), "exec_out": True}
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
def register_node():
|
|
786
|
+
return Email_Notification
|
|
787
|
+
</code></pre>
|
|
788
|
+
<h3 id="usage_3">Usage</h3>
|
|
789
|
+
<ul>
|
|
790
|
+
<li>Configure <code>smtp_host</code>, <code>smtp_port</code>, <code>username</code>, <code>password</code> for your email provider.</li>
|
|
791
|
+
<li>For Gmail: host = <code>smtp.gmail.com</code>, port = <code>587</code>, <code>use_tls</code> = <code>True</code>. Use an App Password, not your main account password.</li>
|
|
792
|
+
<li>Wire <code>sent</code> to a TwoWaySwitch to branch on success/failure.</li>
|
|
793
|
+
<li>Store credentials in <code>SetVariable</code> nodes or read them from environment variables rather than hardcoding.</li>
|
|
794
|
+
</ul>
|
|
795
|
+
<hr />
|
|
796
|
+
<h2 id="example-5-database-query-node">Example 5: Database Query Node</h2>
|
|
797
|
+
<p><strong>Description:</strong> Executes a parameterized SQL query against a SQLite database (or any database via configurable connection string). Returns results as a list of dicts.</p>
|
|
798
|
+
<h3 id="python-code_4">Python Code</h3>
|
|
799
|
+
<pre><code class="language-python">import asyncio
|
|
800
|
+
import sqlite3
|
|
801
|
+
from src.nodes.base import BaseNode
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
class Database_Query(BaseNode):
|
|
805
|
+
name = "database_query"
|
|
806
|
+
|
|
807
|
+
def __init__(self):
|
|
808
|
+
super().__init__()
|
|
809
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
810
|
+
self.add_input("db_path", "string", widget_type="text", default=":memory:")
|
|
811
|
+
self.add_input("query", "string", widget_type="text", default="")
|
|
812
|
+
self.add_input("parameters", "list", default=None)
|
|
813
|
+
self.add_output("rows", "list")
|
|
814
|
+
self.add_output("row_count", "int")
|
|
815
|
+
self.add_output("columns", "list")
|
|
816
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
817
|
+
|
|
818
|
+
async def execute(self, inputs: dict) -> dict:
|
|
819
|
+
db_path = inputs.get("db_path", ":memory:")
|
|
820
|
+
query = inputs.get("query", "")
|
|
821
|
+
parameters = tuple(inputs.get("parameters") or [])
|
|
822
|
+
|
|
823
|
+
if not query:
|
|
824
|
+
self.log_error("No SQL query provided.")
|
|
825
|
+
return {"rows": [], "row_count": 0, "columns": [], "exec_out": True}
|
|
826
|
+
|
|
827
|
+
def _run_query():
|
|
828
|
+
con = sqlite3.connect(db_path)
|
|
829
|
+
con.row_factory = sqlite3.Row
|
|
830
|
+
try:
|
|
831
|
+
cur = con.execute(query, parameters)
|
|
832
|
+
if cur.description:
|
|
833
|
+
columns = [desc[0] for desc in cur.description]
|
|
834
|
+
rows = [dict(row) for row in cur.fetchall()]
|
|
835
|
+
else:
|
|
836
|
+
# INSERT / UPDATE / DELETE
|
|
837
|
+
con.commit()
|
|
838
|
+
columns = []
|
|
839
|
+
rows = []
|
|
840
|
+
return rows, columns
|
|
841
|
+
finally:
|
|
842
|
+
con.close()
|
|
843
|
+
|
|
844
|
+
try:
|
|
845
|
+
rows, columns = await asyncio.to_thread(_run_query)
|
|
846
|
+
self.log_info(f"Query returned {len(rows)} row(s).")
|
|
847
|
+
return {
|
|
848
|
+
"rows": rows,
|
|
849
|
+
"row_count": len(rows),
|
|
850
|
+
"columns": columns,
|
|
851
|
+
"exec_out": True,
|
|
852
|
+
}
|
|
853
|
+
except sqlite3.Error as e:
|
|
854
|
+
self.log_error(f"SQL error: {e}")
|
|
855
|
+
return {"rows": [], "row_count": 0, "columns": [], "exec_out": True}
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
def register_node():
|
|
859
|
+
return Database_Query
|
|
860
|
+
</code></pre>
|
|
861
|
+
<h3 id="usage_4">Usage</h3>
|
|
862
|
+
<ul>
|
|
863
|
+
<li>Set <code>db_path</code> to a <code>.db</code> file path, or <code>":memory:"</code> for a temporary in-memory database.</li>
|
|
864
|
+
<li>Set <code>query</code> to any SQL statement: <code>SELECT</code>, <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, or <code>CREATE TABLE</code>.</li>
|
|
865
|
+
<li>Wire a list into <code>parameters</code> for parameterized queries: <code>SELECT * FROM users WHERE id = ?</code> with <code>parameters = [42]</code>.</li>
|
|
866
|
+
<li><code>rows</code> is a list of dicts where each dict maps column name → value.</li>
|
|
867
|
+
<li>For non-SELECT queries, <code>rows</code> is empty but the statement is committed.</li>
|
|
868
|
+
</ul>
|
|
869
|
+
<hr />
|
|
870
|
+
<h2 id="example-6-image-resizer-node">Example 6: Image Resizer Node</h2>
|
|
871
|
+
<p><strong>Description:</strong> Resizes an image file to specified dimensions using Pillow. Supports multiple resampling algorithms and optional aspect-ratio locking.</p>
|
|
872
|
+
<h3 id="python-code_5">Python Code</h3>
|
|
873
|
+
<pre><code class="language-python">import asyncio
|
|
874
|
+
import os
|
|
875
|
+
from src.nodes.base import BaseNode
|
|
876
|
+
|
|
877
|
+
try:
|
|
878
|
+
from PIL import Image
|
|
879
|
+
_PIL_AVAILABLE = True
|
|
880
|
+
except ImportError:
|
|
881
|
+
_PIL_AVAILABLE = False
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
class Image_Resizer(BaseNode):
|
|
885
|
+
name = "image_resizer"
|
|
886
|
+
|
|
887
|
+
def __init__(self):
|
|
888
|
+
super().__init__()
|
|
889
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
890
|
+
self.add_input("input_path", "string", widget_type="text", default="")
|
|
891
|
+
self.add_input("output_path", "string", widget_type="text", default="")
|
|
892
|
+
self.add_input("width", "int", widget_type="int", default=1920)
|
|
893
|
+
self.add_input("height", "int", widget_type="int", default=1080)
|
|
894
|
+
self.add_input("keep_aspect", "bool", widget_type="checkbox", default=True)
|
|
895
|
+
self.add_input("resample", "string", widget_type="text", default="LANCZOS")
|
|
896
|
+
self.add_output("out_path", "string")
|
|
897
|
+
self.add_output("out_width", "int")
|
|
898
|
+
self.add_output("out_height", "int")
|
|
899
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
900
|
+
|
|
901
|
+
async def execute(self, inputs: dict) -> dict:
|
|
902
|
+
if not _PIL_AVAILABLE:
|
|
903
|
+
self.log_error("Pillow is not installed. Run: pip install Pillow")
|
|
904
|
+
return {"out_path": "", "out_width": 0, "out_height": 0, "exec_out": True}
|
|
905
|
+
|
|
906
|
+
input_path = inputs.get("input_path", "")
|
|
907
|
+
output_path = inputs.get("output_path", "")
|
|
908
|
+
target_w = int(inputs.get("width") or 1920)
|
|
909
|
+
target_h = int(inputs.get("height") or 1080)
|
|
910
|
+
keep_aspect = inputs.get("keep_aspect", True)
|
|
911
|
+
resample_str = (inputs.get("resample") or "LANCZOS").upper()
|
|
912
|
+
|
|
913
|
+
resample_map = {
|
|
914
|
+
"LANCZOS": Image.LANCZOS,
|
|
915
|
+
"BICUBIC": Image.BICUBIC,
|
|
916
|
+
"BILINEAR": Image.BILINEAR,
|
|
917
|
+
"NEAREST": Image.NEAREST,
|
|
918
|
+
}
|
|
919
|
+
resample = resample_map.get(resample_str, Image.LANCZOS)
|
|
920
|
+
|
|
921
|
+
if not input_path or not os.path.isfile(input_path):
|
|
922
|
+
self.log_error(f"Input file not found: {input_path}")
|
|
923
|
+
return {"out_path": "", "out_width": 0, "out_height": 0, "exec_out": True}
|
|
924
|
+
|
|
925
|
+
if not output_path:
|
|
926
|
+
base, ext = os.path.splitext(input_path)
|
|
927
|
+
output_path = f"{base}_resized{ext}"
|
|
928
|
+
|
|
929
|
+
def _resize():
|
|
930
|
+
with Image.open(input_path) as img:
|
|
931
|
+
if keep_aspect:
|
|
932
|
+
img.thumbnail((target_w, target_h), resample)
|
|
933
|
+
out_w, out_h = img.size
|
|
934
|
+
else:
|
|
935
|
+
img = img.resize((target_w, target_h), resample)
|
|
936
|
+
out_w, out_h = img.size
|
|
937
|
+
img.save(output_path)
|
|
938
|
+
return out_w, out_h
|
|
939
|
+
|
|
940
|
+
try:
|
|
941
|
+
out_w, out_h = await asyncio.to_thread(_resize)
|
|
942
|
+
self.log_info(f"Resized {input_path} → {output_path} ({out_w}x{out_h})")
|
|
943
|
+
return {"out_path": output_path, "out_width": out_w, "out_height": out_h, "exec_out": True}
|
|
944
|
+
except Exception as e:
|
|
945
|
+
self.log_error(f"Image resize failed: {e}")
|
|
946
|
+
return {"out_path": "", "out_width": 0, "out_height": 0, "exec_out": True}
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
def register_node():
|
|
950
|
+
return Image_Resizer
|
|
951
|
+
</code></pre>
|
|
952
|
+
<h3 id="usage_5">Usage</h3>
|
|
953
|
+
<ul>
|
|
954
|
+
<li>Wire file paths from a File Batch Processor node into <code>input_path</code>.</li>
|
|
955
|
+
<li>Set <code>output_path</code> explicitly or leave empty to auto-generate <code>{name}_resized.ext</code>.</li>
|
|
956
|
+
<li><code>keep_aspect=True</code> uses thumbnail mode — the image fits within the box without cropping.</li>
|
|
957
|
+
<li><code>keep_aspect=False</code> forces exact dimensions, potentially distorting the image.</li>
|
|
958
|
+
<li><code>resample</code> options: <code>LANCZOS</code> (best quality), <code>BICUBIC</code>, <code>BILINEAR</code>, <code>NEAREST</code> (fastest).</li>
|
|
959
|
+
</ul>
|
|
960
|
+
<hr />
|
|
961
|
+
<h2 id="example-7-aillm-text-generation-node">Example 7: AI/LLM Text Generation Node</h2>
|
|
962
|
+
<p><strong>Description:</strong> Calls the Google Generative AI API to generate text from a prompt. Supports configurable model selection and temperature.</p>
|
|
963
|
+
<h3 id="python-code_6">Python Code</h3>
|
|
964
|
+
<pre><code class="language-python">import asyncio
|
|
965
|
+
from src.nodes.base import BaseNode
|
|
966
|
+
|
|
967
|
+
try:
|
|
968
|
+
import google.generativeai as genai
|
|
969
|
+
_GENAI_AVAILABLE = True
|
|
970
|
+
except ImportError:
|
|
971
|
+
_GENAI_AVAILABLE = False
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
class LLM_Text_Generation(BaseNode):
|
|
975
|
+
name = "llm_text_generation"
|
|
976
|
+
|
|
977
|
+
def __init__(self):
|
|
978
|
+
super().__init__()
|
|
979
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
980
|
+
self.add_input("api_key", "string", widget_type="text", default="")
|
|
981
|
+
self.add_input("model", "string", widget_type="text", default="gemini-1.5-flash")
|
|
982
|
+
self.add_input("prompt", "string", widget_type="text", default="")
|
|
983
|
+
self.add_input("system", "string", widget_type="text", default="")
|
|
984
|
+
self.add_input("temperature","float", widget_type="float", default=0.7)
|
|
985
|
+
self.add_input("max_tokens", "int", widget_type="int", default=1024)
|
|
986
|
+
self.add_output("generated_text", "string")
|
|
987
|
+
self.add_output("token_count", "int")
|
|
988
|
+
self.add_output("success", "bool")
|
|
989
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
990
|
+
|
|
991
|
+
async def execute(self, inputs: dict) -> dict:
|
|
992
|
+
if not _GENAI_AVAILABLE:
|
|
993
|
+
self.log_error("google-generativeai not installed. Run: pip install google-generativeai")
|
|
994
|
+
return {"generated_text": "", "token_count": 0, "success": False, "exec_out": True}
|
|
995
|
+
|
|
996
|
+
api_key = inputs.get("api_key", "")
|
|
997
|
+
model_name = inputs.get("model", "gemini-1.5-flash")
|
|
998
|
+
prompt = inputs.get("prompt", "")
|
|
999
|
+
system = inputs.get("system", "")
|
|
1000
|
+
temperature = float(inputs.get("temperature") or 0.7)
|
|
1001
|
+
max_tokens = int(inputs.get("max_tokens") or 1024)
|
|
1002
|
+
|
|
1003
|
+
if not api_key:
|
|
1004
|
+
import os
|
|
1005
|
+
api_key = os.environ.get("GOOGLE_API_KEY", "")
|
|
1006
|
+
|
|
1007
|
+
if not api_key:
|
|
1008
|
+
self.log_error("No API key provided. Set api_key input or GOOGLE_API_KEY env var.")
|
|
1009
|
+
return {"generated_text": "", "token_count": 0, "success": False, "exec_out": True}
|
|
1010
|
+
|
|
1011
|
+
if not prompt:
|
|
1012
|
+
self.log_error("No prompt provided.")
|
|
1013
|
+
return {"generated_text": "", "token_count": 0, "success": False, "exec_out": True}
|
|
1014
|
+
|
|
1015
|
+
def _generate():
|
|
1016
|
+
genai.configure(api_key=api_key)
|
|
1017
|
+
|
|
1018
|
+
generation_config = genai.GenerationConfig(
|
|
1019
|
+
temperature=temperature,
|
|
1020
|
+
max_output_tokens=max_tokens,
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
model = genai.GenerativeModel(
|
|
1024
|
+
model_name=model_name,
|
|
1025
|
+
generation_config=generation_config,
|
|
1026
|
+
system_instruction=system if system else None,
|
|
1027
|
+
)
|
|
1028
|
+
|
|
1029
|
+
response = model.generate_content(prompt)
|
|
1030
|
+
text = response.text if response.text else ""
|
|
1031
|
+
token_count = 0
|
|
1032
|
+
if hasattr(response, "usage_metadata") and response.usage_metadata:
|
|
1033
|
+
token_count = response.usage_metadata.total_token_count or 0
|
|
1034
|
+
return text, token_count
|
|
1035
|
+
|
|
1036
|
+
try:
|
|
1037
|
+
text, tokens = await asyncio.to_thread(_generate)
|
|
1038
|
+
self.log_info(f"LLM generated {len(text)} chars, ~{tokens} tokens.")
|
|
1039
|
+
return {
|
|
1040
|
+
"generated_text": text,
|
|
1041
|
+
"token_count": tokens,
|
|
1042
|
+
"success": True,
|
|
1043
|
+
"exec_out": True,
|
|
1044
|
+
}
|
|
1045
|
+
except Exception as e:
|
|
1046
|
+
self.log_error(f"LLM generation failed: {e}")
|
|
1047
|
+
return {"generated_text": "", "token_count": 0, "success": False, "exec_out": True}
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
def register_node():
|
|
1051
|
+
return LLM_Text_Generation
|
|
1052
|
+
</code></pre>
|
|
1053
|
+
<h3 id="usage_6">Usage</h3>
|
|
1054
|
+
<ul>
|
|
1055
|
+
<li>Set <code>api_key</code> or set the <code>GOOGLE_API_KEY</code> environment variable.</li>
|
|
1056
|
+
<li>Available models: <code>gemini-1.5-flash</code> (fast), <code>gemini-1.5-pro</code> (more capable), <code>gemini-2.0-flash</code>.</li>
|
|
1057
|
+
<li>Wire the output of a Python Script or File Load node into <code>prompt</code> for dynamic prompts.</li>
|
|
1058
|
+
<li>Chain multiple LLM nodes: first generates a summary, second expands it, third translates.</li>
|
|
1059
|
+
</ul>
|
|
1060
|
+
<hr />
|
|
1061
|
+
<h2 id="example-8-folder-monitor-workflow">Example 8: Folder Monitor Workflow</h2>
|
|
1062
|
+
<p><strong>Description:</strong> A workflow that watches a folder for new files, processes each new file (e.g., converts it), and logs completion. Uses Python's <code>watchdog</code> library in a polling loop.</p>
|
|
1063
|
+
<h3 id="workflow-structure-text-description">Workflow Structure (Text Description)</h3>
|
|
1064
|
+
<pre><code>[Python Script: Start Monitor]
|
|
1065
|
+
→ watches folder using watchdog.observers.Observer
|
|
1066
|
+
→ detects new files matching *.png
|
|
1067
|
+
→ appends new file paths to shared memory list "new_files"
|
|
1068
|
+
→ runs in asyncio.to_thread for 30 seconds
|
|
1069
|
+
↓ exec_out
|
|
1070
|
+
|
|
1071
|
+
[GetVariable: "new_files"]
|
|
1072
|
+
↓ current_list
|
|
1073
|
+
|
|
1074
|
+
[ForEach: iterate new files]
|
|
1075
|
+
↓ loop_exec_out (per file)
|
|
1076
|
+
|
|
1077
|
+
[Image Resizer: 1920x1080]
|
|
1078
|
+
↓ exec_out
|
|
1079
|
+
[Console Print: "Processed: {out_path}"]
|
|
1080
|
+
↓ exec_out (back to ForEach loop_exec_in)
|
|
1081
|
+
|
|
1082
|
+
↓ exec_out (after loop)
|
|
1083
|
+
|
|
1084
|
+
[Console Print: "Monitor run complete."]
|
|
1085
|
+
</code></pre>
|
|
1086
|
+
<h3 id="monitor-python-script-node-code">Monitor Python Script Node Code</h3>
|
|
1087
|
+
<pre><code class="language-python">import asyncio
|
|
1088
|
+
import time
|
|
1089
|
+
from src.nodes.base import BaseNode
|
|
1090
|
+
|
|
1091
|
+
try:
|
|
1092
|
+
from watchdog.observers import Observer
|
|
1093
|
+
from watchdog.events import FileSystemEventHandler, FileCreatedEvent
|
|
1094
|
+
_WATCHDOG_AVAILABLE = True
|
|
1095
|
+
except ImportError:
|
|
1096
|
+
_WATCHDOG_AVAILABLE = False
|
|
1097
|
+
|
|
1098
|
+
|
|
1099
|
+
class Folder_Monitor(BaseNode):
|
|
1100
|
+
name = "folder_monitor"
|
|
1101
|
+
|
|
1102
|
+
def __init__(self):
|
|
1103
|
+
super().__init__()
|
|
1104
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
1105
|
+
self.add_input("folder_path", "string", widget_type="text", default="")
|
|
1106
|
+
self.add_input("pattern", "string", widget_type="text", default="*.png")
|
|
1107
|
+
self.add_input("watch_seconds","int", widget_type="int", default=30)
|
|
1108
|
+
self.add_output("new_files", "list")
|
|
1109
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
1110
|
+
|
|
1111
|
+
async def execute(self, inputs: dict) -> dict:
|
|
1112
|
+
if not _WATCHDOG_AVAILABLE:
|
|
1113
|
+
self.log_error("watchdog not installed. Run: pip install watchdog")
|
|
1114
|
+
return {"new_files": [], "exec_out": True}
|
|
1115
|
+
|
|
1116
|
+
import fnmatch
|
|
1117
|
+
|
|
1118
|
+
folder = inputs.get("folder_path", "")
|
|
1119
|
+
pattern = inputs.get("pattern", "*.png")
|
|
1120
|
+
seconds = int(inputs.get("watch_seconds") or 30)
|
|
1121
|
+
new_files = []
|
|
1122
|
+
|
|
1123
|
+
class Handler(FileSystemEventHandler):
|
|
1124
|
+
def on_created(self, event):
|
|
1125
|
+
if not event.is_directory:
|
|
1126
|
+
if fnmatch.fnmatch(event.src_path, pattern):
|
|
1127
|
+
new_files.append(event.src_path)
|
|
1128
|
+
|
|
1129
|
+
def _watch():
|
|
1130
|
+
observer = Observer()
|
|
1131
|
+
observer.schedule(Handler(), folder, recursive=False)
|
|
1132
|
+
observer.start()
|
|
1133
|
+
time.sleep(seconds)
|
|
1134
|
+
observer.stop()
|
|
1135
|
+
observer.join()
|
|
1136
|
+
|
|
1137
|
+
self.log_info(f"Watching {folder} for {pattern} for {seconds}s...")
|
|
1138
|
+
await asyncio.to_thread(_watch)
|
|
1139
|
+
self.log_info(f"Monitor finished. {len(new_files)} new file(s) detected.")
|
|
1140
|
+
return {"new_files": new_files, "exec_out": True}
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
def register_node():
|
|
1144
|
+
return Folder_Monitor
|
|
1145
|
+
</code></pre>
|
|
1146
|
+
<h3 id="usage_7">Usage</h3>
|
|
1147
|
+
<p>Install watchdog: <code>pip install watchdog</code></p>
|
|
1148
|
+
<p>Set <code>folder_path</code> and <code>pattern</code>. Wire <code>new_files</code> → ForEach → Image Resizer (or any processing node). Set <code>watch_seconds</code> to control how long the monitor runs each execution cycle. To run continuously, wrap the whole workflow in a WhileLoop.</p>
|
|
1149
|
+
<hr />
|
|
1150
|
+
<h2 id="example-9-complete-houdini-sop-chain-workflow">Example 9: Complete Houdini SOP Chain Workflow</h2>
|
|
1151
|
+
<p><strong>Description:</strong> Create a Houdini geometry container, add a Box SOP, add a PolyExtrude SOP, wire and configure them, set display flags, cook the network, and return the final SOP path for downstream use.</p>
|
|
1152
|
+
<h3 id="python-code-single-consolidated-node-for-clarity">Python Code (single consolidated node for clarity)</h3>
|
|
1153
|
+
<pre><code class="language-python">from src.nodes.base import BaseNode
|
|
1154
|
+
from src.utils.hou_bridge import get_bridge
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
class Hou_SOP_Chain(BaseNode):
|
|
1158
|
+
name = "hou_sop_chain"
|
|
1159
|
+
|
|
1160
|
+
def __init__(self):
|
|
1161
|
+
super().__init__()
|
|
1162
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
1163
|
+
self.add_input("geo_name", "string", widget_type="text", default="my_geo")
|
|
1164
|
+
self.add_input("box_size", "float", widget_type="float", default=1.0)
|
|
1165
|
+
self.add_input("extrude_dist", "float", widget_type="float", default=0.3)
|
|
1166
|
+
self.add_input("extrude_divs", "int", widget_type="int", default=1)
|
|
1167
|
+
self.add_output("geo_path", "string")
|
|
1168
|
+
self.add_output("display_sop", "string")
|
|
1169
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
1170
|
+
|
|
1171
|
+
async def execute(self, inputs: dict) -> dict:
|
|
1172
|
+
geo_name = inputs.get("geo_name", "my_geo") or "my_geo"
|
|
1173
|
+
box_size = float(inputs.get("box_size") or 1.0)
|
|
1174
|
+
extrude_dist = float(inputs.get("extrude_dist") or 0.3)
|
|
1175
|
+
extrude_divs = int(inputs.get("extrude_divs") or 1)
|
|
1176
|
+
|
|
1177
|
+
try:
|
|
1178
|
+
bridge = get_bridge()
|
|
1179
|
+
|
|
1180
|
+
# 1. Verify connection
|
|
1181
|
+
ping = bridge.ping()
|
|
1182
|
+
if ping.get("status") != "ok":
|
|
1183
|
+
self.log_error("Cannot reach Houdini.")
|
|
1184
|
+
return {"geo_path": "", "display_sop": "", "exec_out": True}
|
|
1185
|
+
|
|
1186
|
+
# 2. Create /obj-level geo container
|
|
1187
|
+
geo_result = bridge.create_node("/obj", "geo", geo_name)
|
|
1188
|
+
geo_path = geo_result["path"]
|
|
1189
|
+
|
|
1190
|
+
# 3. Clear default children
|
|
1191
|
+
for child in bridge.children(geo_path):
|
|
1192
|
+
bridge.delete_node(child["path"])
|
|
1193
|
+
|
|
1194
|
+
# 4. Box SOP
|
|
1195
|
+
box_result = bridge.create_node(geo_path, "box", "box1")
|
|
1196
|
+
box_path = box_result["path"]
|
|
1197
|
+
bridge.set_parms(box_path, {
|
|
1198
|
+
"sizex": box_size,
|
|
1199
|
+
"sizey": box_size,
|
|
1200
|
+
"sizez": box_size,
|
|
1201
|
+
})
|
|
1202
|
+
|
|
1203
|
+
# 5. PolyExtrude SOP
|
|
1204
|
+
extrude_result = bridge.create_node(geo_path, "polyextrude", "extrude1")
|
|
1205
|
+
extrude_path = extrude_result["path"]
|
|
1206
|
+
bridge.connect_nodes(box_path, extrude_path, output=0, input_idx=0)
|
|
1207
|
+
bridge.set_parms(extrude_path, {
|
|
1208
|
+
"dist": extrude_dist,
|
|
1209
|
+
"divs": extrude_divs,
|
|
1210
|
+
})
|
|
1211
|
+
|
|
1212
|
+
# 6. Display / render flags on the extrude SOP
|
|
1213
|
+
bridge.set_display_flag(extrude_path, True)
|
|
1214
|
+
bridge.set_render_flag(extrude_path, True)
|
|
1215
|
+
|
|
1216
|
+
# 7. Cook
|
|
1217
|
+
bridge.cook_node(extrude_path, force=True)
|
|
1218
|
+
|
|
1219
|
+
# 8. Auto-layout
|
|
1220
|
+
bridge.layout_children(geo_path)
|
|
1221
|
+
|
|
1222
|
+
self.log_info(f"SOP chain built at {geo_path}, display SOP: {extrude_path}")
|
|
1223
|
+
return {
|
|
1224
|
+
"geo_path": geo_path,
|
|
1225
|
+
"display_sop": extrude_path,
|
|
1226
|
+
"exec_out": True,
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
except Exception as e:
|
|
1230
|
+
self.log_error(f"Houdini SOP chain failed: {e}")
|
|
1231
|
+
return {"geo_path": "", "display_sop": "", "exec_out": True}
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
def register_node():
|
|
1235
|
+
return Hou_SOP_Chain
|
|
1236
|
+
</code></pre>
|
|
1237
|
+
<h3 id="usage_8">Usage</h3>
|
|
1238
|
+
<p>Connect the <code>display_sop</code> output to other Houdini nodes that need to reference the SOP context. Use <code>geo_path</code> when working at the Object level (e.g., for transforms or Alembic export from the Object level).</p>
|
|
1239
|
+
<hr />
|
|
1240
|
+
<h2 id="example-10-prism-multi-asset-publisher-workflow">Example 10: Prism Multi-Asset Publisher Workflow</h2>
|
|
1241
|
+
<p><strong>Description:</strong> Iterates over a list of assets, resolves the export path for each, processes the asset (simulated), publishes via PrismCore, and logs the result.</p>
|
|
1242
|
+
<h3 id="python-code_7">Python Code</h3>
|
|
1243
|
+
<pre><code class="language-python">from src.nodes.base import BaseNode
|
|
1244
|
+
from src.utils.prism_core import resolve_prism_core
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
class Prism_Multi_Asset_Publisher(BaseNode):
|
|
1248
|
+
name = "prism_multi_asset_publisher"
|
|
1249
|
+
|
|
1250
|
+
def __init__(self):
|
|
1251
|
+
super().__init__()
|
|
1252
|
+
# [AUTO-GENERATED-PORTS-START]
|
|
1253
|
+
self.add_input("asset_names", "list")
|
|
1254
|
+
self.add_input("entity_type", "string", widget_type="text", default="Asset")
|
|
1255
|
+
self.add_input("task", "string", widget_type="text", default="model")
|
|
1256
|
+
self.add_input("version_comment","string", widget_type="text", default="")
|
|
1257
|
+
self.add_output("published", "list")
|
|
1258
|
+
self.add_output("failed", "list")
|
|
1259
|
+
self.add_output("publish_count", "int")
|
|
1260
|
+
# [AUTO-GENERATED-PORTS-END]
|
|
1261
|
+
|
|
1262
|
+
async def execute(self, inputs: dict) -> dict:
|
|
1263
|
+
core = resolve_prism_core(inputs)
|
|
1264
|
+
if core is None:
|
|
1265
|
+
self.log_error("PrismCore not available. Add prism_core_init node.")
|
|
1266
|
+
return {"published": [], "failed": [], "publish_count": 0, "exec_out": True}
|
|
1267
|
+
|
|
1268
|
+
asset_names = list(inputs.get("asset_names") or [])
|
|
1269
|
+
entity_type = inputs.get("entity_type", "Asset")
|
|
1270
|
+
task = inputs.get("task", "model")
|
|
1271
|
+
comment = inputs.get("version_comment", "")
|
|
1272
|
+
|
|
1273
|
+
published = []
|
|
1274
|
+
failed = []
|
|
1275
|
+
|
|
1276
|
+
for asset_name in asset_names:
|
|
1277
|
+
try:
|
|
1278
|
+
# Get export paths for this asset
|
|
1279
|
+
paths = core.getExportPaths(
|
|
1280
|
+
entity=asset_name,
|
|
1281
|
+
entityType=entity_type,
|
|
1282
|
+
task=task,
|
|
1283
|
+
)
|
|
1284
|
+
|
|
1285
|
+
if not paths:
|
|
1286
|
+
failed.append({"asset": asset_name, "reason": "No export paths found"})
|
|
1287
|
+
self.log_error(f"No export paths for: {asset_name}")
|
|
1288
|
+
continue
|
|
1289
|
+
|
|
1290
|
+
latest_path = paths[-1]
|
|
1291
|
+
|
|
1292
|
+
# Publish via PrismCore
|
|
1293
|
+
result = core.publishProduct(
|
|
1294
|
+
entity=asset_name,
|
|
1295
|
+
entityType=entity_type,
|
|
1296
|
+
task=task,
|
|
1297
|
+
sourceFile=latest_path,
|
|
1298
|
+
comment=comment or f"Published by Vibrante-Node automation",
|
|
1299
|
+
)
|
|
1300
|
+
|
|
1301
|
+
if result and result.get("success"):
|
|
1302
|
+
published.append({
|
|
1303
|
+
"asset": asset_name,
|
|
1304
|
+
"source": latest_path,
|
|
1305
|
+
"publish_path": result.get("path", ""),
|
|
1306
|
+
"version": result.get("version", ""),
|
|
1307
|
+
})
|
|
1308
|
+
self.log_info(f"Published: {asset_name} v{result.get('version', '?')}")
|
|
1309
|
+
else:
|
|
1310
|
+
reason = result.get("error", "Unknown error") if result else "No response"
|
|
1311
|
+
failed.append({"asset": asset_name, "reason": reason})
|
|
1312
|
+
self.log_error(f"Publish failed for {asset_name}: {reason}")
|
|
1313
|
+
|
|
1314
|
+
except Exception as e:
|
|
1315
|
+
failed.append({"asset": asset_name, "reason": str(e)})
|
|
1316
|
+
self.log_error(f"Exception publishing {asset_name}: {e}")
|
|
1317
|
+
|
|
1318
|
+
self.log_info(
|
|
1319
|
+
f"Multi-asset publish complete: {len(published)} succeeded, {len(failed)} failed."
|
|
1320
|
+
)
|
|
1321
|
+
return {
|
|
1322
|
+
"published": published,
|
|
1323
|
+
"failed": failed,
|
|
1324
|
+
"publish_count": len(published),
|
|
1325
|
+
"exec_out": True,
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
def register_node():
|
|
1330
|
+
return Prism_Multi_Asset_Publisher
|
|
1331
|
+
</code></pre>
|
|
1332
|
+
<h3 id="usage_9">Usage</h3>
|
|
1333
|
+
<ol>
|
|
1334
|
+
<li>Place a <code>prism_core_init</code> node on the canvas (no wiring needed).</li>
|
|
1335
|
+
<li>Wire a list of asset name strings into <code>asset_names</code>.</li>
|
|
1336
|
+
<li>Set <code>entity_type</code> (<code>"Asset"</code> or <code>"Shot"</code>), <code>task</code> (e.g., <code>"model"</code>, <code>"rig"</code>, <code>"anim"</code>).</li>
|
|
1337
|
+
<li>Connect <code>publish_count</code> to a Console Print for a summary.</li>
|
|
1338
|
+
<li>Wire <code>failed</code> to a Python Script that formats and logs any failures.</li>
|
|
1339
|
+
<li>Connect <code>published</code> to downstream processing (e.g., cache invalidation, email notification).</li>
|
|
1340
|
+
</ol>
|
|
1341
|
+
<nav class="page-nav">
|
|
1342
|
+
<a class="page-nav-link prev" href="11_troubleshooting.html"><span class="page-nav-label">Previous</span><span class="page-nav-title">Troubleshooting</span></a>
|
|
1343
|
+
<a class="page-nav-link next" href="13_general_purpose_automation.html"><span class="page-nav-label">Next</span><span class="page-nav-title">General Purpose Automation</span></a>
|
|
1344
|
+
</nav>
|
|
1345
|
+
<section class="licence-attribution" style="margin-top:40px;padding-top:14px;border-top:1px solid #313244;font-size:.82em;color:#a6adc8">
|
|
1346
|
+
<p>Documentation &copy; 2024&ndash;2026 Mahmoud Kamal (KamalTD), licensed under
|
|
1347
|
+
<a href="https://creativecommons.org/licenses/by/4.0/" rel="license">CC BY 4.0</a>.
|
|
1348
|
+
<a href="../LICENSE.txt">Full licence notice</a>.</p>
|
|
1349
|
+
<p>Search and syntax highlighting load <a href="https://lunrjs.com/">lunr.js</a> 2.3.9 (MIT)
|
|
1350
|
+
and <a href="https://highlightjs.org/">highlight.js</a> 11.9.0 (BSD-3-Clause) from
|
|
1351
|
+
cdn.jsdelivr.net at view time; neither library is redistributed with these files.</p>
|
|
1352
|
+
</section>
|
|
1353
|
+
</div>
|
|
1354
|
+
</main>
|
|
1355
|
+
|
|
1356
|
+
<!-- ── TOC ────────────────────────────────────────────────────────────── -->
|
|
1357
|
+
<aside class="toc">
|
|
1358
|
+
<div class="toc-title">On this page</div>
|
|
1359
|
+
<a class="toc-link toc-h2" href="#example-1-custom-string-processor-node">Example 1: Custom String Processor Node</a>
|
|
1360
|
+
<a class="toc-link toc-h3" href="#node-json">Node JSON</a>
|
|
1361
|
+
<a class="toc-link toc-h3" href="#python-code">Python Code</a>
|
|
1362
|
+
<a class="toc-link toc-h3" href="#usage">Usage</a>
|
|
1363
|
+
<a class="toc-link toc-h2" href="#example-2-http-api-request-node">Example 2: HTTP API Request Node</a>
|
|
1364
|
+
<a class="toc-link toc-h3" href="#node-json_1">Node JSON</a>
|
|
1365
|
+
<a class="toc-link toc-h3" href="#python-code_1">Python Code</a>
|
|
1366
|
+
<a class="toc-link toc-h3" href="#usage_1">Usage</a>
|
|
1367
|
+
<a class="toc-link toc-h2" href="#example-3-file-batch-processor-node">Example 3: File Batch Processor Node</a>
|
|
1368
|
+
<a class="toc-link toc-h3" href="#python-code_2">Python Code</a>
|
|
1369
|
+
<a class="toc-link toc-h3" href="#usage_2">Usage</a>
|
|
1370
|
+
<a class="toc-link toc-h2" href="#example-4-email-notification-node">Example 4: Email Notification Node</a>
|
|
1371
|
+
<a class="toc-link toc-h3" href="#python-code_3">Python Code</a>
|
|
1372
|
+
<a class="toc-link toc-h3" href="#usage_3">Usage</a>
|
|
1373
|
+
<a class="toc-link toc-h2" href="#example-5-database-query-node">Example 5: Database Query Node</a>
|
|
1374
|
+
<a class="toc-link toc-h3" href="#python-code_4">Python Code</a>
|
|
1375
|
+
<a class="toc-link toc-h3" href="#usage_4">Usage</a>
|
|
1376
|
+
<a class="toc-link toc-h2" href="#example-6-image-resizer-node">Example 6: Image Resizer Node</a>
|
|
1377
|
+
<a class="toc-link toc-h3" href="#python-code_5">Python Code</a>
|
|
1378
|
+
<a class="toc-link toc-h3" href="#usage_5">Usage</a>
|
|
1379
|
+
<a class="toc-link toc-h2" href="#example-7-aillm-text-generation-node">Example 7: AI/LLM Text Generation Node</a>
|
|
1380
|
+
<a class="toc-link toc-h3" href="#python-code_6">Python Code</a>
|
|
1381
|
+
<a class="toc-link toc-h3" href="#usage_6">Usage</a>
|
|
1382
|
+
<a class="toc-link toc-h2" href="#example-8-folder-monitor-workflow">Example 8: Folder Monitor Workflow</a>
|
|
1383
|
+
<a class="toc-link toc-h3" href="#workflow-structure-text-description">Workflow Structure (Text Description)</a>
|
|
1384
|
+
<a class="toc-link toc-h3" href="#monitor-python-script-node-code">Monitor Python Script Node Code</a>
|
|
1385
|
+
<a class="toc-link toc-h3" href="#usage_7">Usage</a>
|
|
1386
|
+
<a class="toc-link toc-h2" href="#example-9-complete-houdini-sop-chain-workflow">Example 9: Complete Houdini SOP Chain Workflow</a>
|
|
1387
|
+
<a class="toc-link toc-h3" href="#python-code-single-consolidated-node-for-clarity">Python Code (single consolidated node for clarity)</a>
|
|
1388
|
+
<a class="toc-link toc-h3" href="#usage_8">Usage</a>
|
|
1389
|
+
<a class="toc-link toc-h2" href="#example-10-prism-multi-asset-publisher-workflow">Example 10: Prism Multi-Asset Publisher Workflow</a>
|
|
1390
|
+
<a class="toc-link toc-h3" href="#python-code_7">Python Code</a>
|
|
1391
|
+
<a class="toc-link toc-h3" href="#usage_9">Usage</a>
|
|
1392
|
+
</aside>
|
|
1393
|
+
|
|
1394
|
+
<script src="https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/highlight.min.js"></script>
|
|
1395
|
+
<script src="https://cdn.jsdelivr.net/npm/lunr@2.3.9/lunr.min.js"></script>
|
|
1396
|
+
<script>
|
|
1397
|
+
// ── Search ──────────────────────────────────────────────────────────────
|
|
1398
|
+
let _idx = null, _docs = [];
|
|
1399
|
+
|
|
1400
|
+
async function initSearch() {
|
|
1401
|
+
try {
|
|
1402
|
+
const base = document.getElementById('portal-base').dataset.base;
|
|
1403
|
+
const resp = await fetch(base + 'search.json');
|
|
1404
|
+
_docs = await resp.json();
|
|
1405
|
+
_idx = lunr(function() {
|
|
1406
|
+
this.ref('id');
|
|
1407
|
+
this.field('title', { boost: 10 });
|
|
1408
|
+
this.field('body');
|
|
1409
|
+
_docs.forEach((d, i) => {
|
|
1410
|
+
this.add({ id: i, title: d.title, body: d.body });
|
|
1411
|
+
});
|
|
1412
|
+
});
|
|
1413
|
+
} catch(e) { console.warn('Search index not available', e); }
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
function doSearch(q) {
|
|
1417
|
+
const box = document.getElementById('search-results');
|
|
1418
|
+
if (!q || q.length < 2) { box.classList.remove('visible'); return; }
|
|
1419
|
+
if (!_idx) { box.innerHTML = '<div class="search-no-results">Search index loading…</div>'; box.classList.add('visible'); return; }
|
|
1420
|
+
const results = _idx.search(q + '~1');
|
|
1421
|
+
if (!results.length) {
|
|
1422
|
+
box.innerHTML = '<div class="search-no-results">No results for "' + q + '"</div>';
|
|
1423
|
+
box.classList.add('visible'); return;
|
|
1424
|
+
}
|
|
1425
|
+
box.innerHTML = results.slice(0, 8).map(r => {
|
|
1426
|
+
const d = _docs[r.ref];
|
|
1427
|
+
const excerpt = d.body.substring(0, 140).replace(/[#*`]/g, '').trim() + '…';
|
|
1428
|
+
return `<a class="search-result-item" href="${d.url}">
|
|
1429
|
+
<div class="search-result-title">${d.title}</div>
|
|
1430
|
+
<div class="search-result-excerpt">${excerpt}</div>
|
|
1431
|
+
</a>`;
|
|
1432
|
+
}).join('');
|
|
1433
|
+
box.classList.add('visible');
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
1437
|
+
initSearch();
|
|
1438
|
+
const inp = document.getElementById('search-input');
|
|
1439
|
+
if (inp) {
|
|
1440
|
+
inp.addEventListener('input', e => doSearch(e.target.value));
|
|
1441
|
+
inp.addEventListener('keydown', e => { if (e.key === 'Escape') { e.target.value=''; document.getElementById('search-results').classList.remove('visible'); }});
|
|
1442
|
+
}
|
|
1443
|
+
document.addEventListener('click', e => {
|
|
1444
|
+
if (!e.target.closest('.search-wrap')) document.getElementById('search-results')?.classList.remove('visible');
|
|
1445
|
+
});
|
|
1446
|
+
// Keyboard shortcut: / to focus search
|
|
1447
|
+
document.addEventListener('keydown', e => {
|
|
1448
|
+
if (e.key === '/' && !['INPUT','TEXTAREA'].includes(document.activeElement.tagName)) {
|
|
1449
|
+
e.preventDefault(); document.getElementById('search-input')?.focus();
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
|
|
1453
|
+
// ── TOC active section ──────────────────────────────────────────────
|
|
1454
|
+
const tocLinks = document.querySelectorAll('.toc-link');
|
|
1455
|
+
const headings = document.querySelectorAll('h2[id],h3[id],h4[id]');
|
|
1456
|
+
if (tocLinks.length && headings.length) {
|
|
1457
|
+
const obs = new IntersectionObserver(entries => {
|
|
1458
|
+
entries.forEach(entry => {
|
|
1459
|
+
if (entry.isIntersecting) {
|
|
1460
|
+
tocLinks.forEach(l => l.classList.remove('active'));
|
|
1461
|
+
const link = document.querySelector(`.toc-link[href="#${entry.target.id}"]`);
|
|
1462
|
+
if (link) link.classList.add('active');
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
}, { rootMargin: '-20% 0px -70% 0px' });
|
|
1466
|
+
headings.forEach(h => obs.observe(h));
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
// ── Copy buttons ────────────────────────────────────────────────────
|
|
1470
|
+
document.querySelectorAll('pre').forEach(pre => {
|
|
1471
|
+
const btn = document.createElement('button');
|
|
1472
|
+
btn.className = 'copy-btn'; btn.textContent = 'Copy';
|
|
1473
|
+
btn.addEventListener('click', () => {
|
|
1474
|
+
const code = pre.querySelector('code');
|
|
1475
|
+
navigator.clipboard.writeText(code ? code.innerText : pre.innerText).then(() => {
|
|
1476
|
+
btn.textContent = 'Copied!'; btn.classList.add('copied');
|
|
1477
|
+
setTimeout(() => { btn.textContent = 'Copy'; btn.classList.remove('copied'); }, 2000);
|
|
1478
|
+
});
|
|
1479
|
+
});
|
|
1480
|
+
pre.style.position = 'relative';
|
|
1481
|
+
pre.appendChild(btn);
|
|
1482
|
+
});
|
|
1483
|
+
|
|
1484
|
+
// ── Sidebar active ──────────────────────────────────────────────────
|
|
1485
|
+
const cur = window.location.pathname.split('/').pop();
|
|
1486
|
+
document.querySelectorAll('.sidebar-link').forEach(l => {
|
|
1487
|
+
if (l.getAttribute('href') === cur || l.getAttribute('href').endsWith(cur)) l.classList.add('active');
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
// ── highlight.js ────────────────────────────────────────────────────
|
|
1491
|
+
if (window.hljs) {
|
|
1492
|
+
hljs.configure({ ignoreUnescapedHTML: true });
|
|
1493
|
+
hljs.highlightAll();
|
|
1494
|
+
}
|
|
1495
|
+
});
|
|
1496
|
+
</script>
|
|
1497
|
+
</body>
|
|
1498
|
+
</html>
|