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,300 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Dynamic Prism project configuration reader.
|
|
3
|
+
|
|
4
|
+
Reads department definitions, folder structure, and task presets directly
|
|
5
|
+
from the project's pipeline.json — no hardcoded abbreviations.
|
|
6
|
+
|
|
7
|
+
Config discovery order:
|
|
8
|
+
1. Explicit cfg_path argument
|
|
9
|
+
2. Walk up from entity['path'] to find 00_Pipeline/pipeline.json
|
|
10
|
+
3. project['configPath']
|
|
11
|
+
4. core's currently loaded project
|
|
12
|
+
5. User config at %USERPROFILE%/Documents/Prism2 (Windows) or ~/Documents/Prism2
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# ---------------------------------------------------------------------------
|
|
20
|
+
# Config file discovery
|
|
21
|
+
# ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
def get_prism_user_dir():
|
|
24
|
+
launcher = os.environ.get("PRISM_LAUNCHER_CONFIG", "")
|
|
25
|
+
if launcher and os.path.exists(launcher):
|
|
26
|
+
return os.path.dirname(launcher)
|
|
27
|
+
return os.path.join(os.path.expanduser("~"), "Documents", "Prism2")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def find_pipeline_cfg(start_path):
|
|
31
|
+
"""Walk up from start_path until 00_Pipeline/pipeline.json is found."""
|
|
32
|
+
if not start_path:
|
|
33
|
+
return None
|
|
34
|
+
current = os.path.abspath(start_path)
|
|
35
|
+
for _ in range(12):
|
|
36
|
+
cfg = os.path.join(current, "00_Pipeline", "pipeline.json")
|
|
37
|
+
if os.path.exists(cfg):
|
|
38
|
+
return cfg
|
|
39
|
+
parent = os.path.dirname(current)
|
|
40
|
+
if parent == current:
|
|
41
|
+
break
|
|
42
|
+
current = parent
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def cfg_from_entity(entity):
|
|
47
|
+
return find_pipeline_cfg(entity.get("path", "")) if isinstance(entity, dict) else None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def cfg_from_project(project):
|
|
51
|
+
return project.get("configPath", "") if isinstance(project, dict) else ""
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def cfg_from_core(core):
|
|
55
|
+
"""Try to get the current project's pipeline.json from a live PrismCore."""
|
|
56
|
+
try:
|
|
57
|
+
path = core.projects.getRecentPrjPath() or ""
|
|
58
|
+
if path:
|
|
59
|
+
cfg = find_pipeline_cfg(path)
|
|
60
|
+
if cfg:
|
|
61
|
+
return cfg
|
|
62
|
+
except Exception:
|
|
63
|
+
pass
|
|
64
|
+
try:
|
|
65
|
+
cfg = core.getConfig("globals", "config_path") or ""
|
|
66
|
+
if cfg and os.path.exists(cfg):
|
|
67
|
+
return cfg
|
|
68
|
+
except Exception:
|
|
69
|
+
pass
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def resolve_cfg(core=None, entity=None, project=None, cfg_path=None):
|
|
74
|
+
"""Return the best available pipeline.json path, or None."""
|
|
75
|
+
if cfg_path and os.path.exists(cfg_path):
|
|
76
|
+
return cfg_path
|
|
77
|
+
if entity:
|
|
78
|
+
p = cfg_from_entity(entity)
|
|
79
|
+
if p:
|
|
80
|
+
return p
|
|
81
|
+
if project:
|
|
82
|
+
p = cfg_from_project(project)
|
|
83
|
+
if p and os.path.exists(p):
|
|
84
|
+
return p
|
|
85
|
+
if core:
|
|
86
|
+
p = cfg_from_core(core)
|
|
87
|
+
if p:
|
|
88
|
+
return p
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# ---------------------------------------------------------------------------
|
|
93
|
+
# pipeline.json reader
|
|
94
|
+
# ---------------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
def read_pipeline_json(cfg_path):
|
|
97
|
+
try:
|
|
98
|
+
with open(cfg_path, "r", encoding="utf-8") as f:
|
|
99
|
+
return json.load(f)
|
|
100
|
+
except Exception:
|
|
101
|
+
return {}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def _getconfig(core, category, key, cfg_path):
|
|
105
|
+
"""Thin wrapper around core.getConfig that swallows all errors."""
|
|
106
|
+
try:
|
|
107
|
+
return core.getConfig(category, key, configPath=cfg_path)
|
|
108
|
+
except Exception:
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# ---------------------------------------------------------------------------
|
|
113
|
+
# Department API
|
|
114
|
+
# ---------------------------------------------------------------------------
|
|
115
|
+
|
|
116
|
+
def get_departments(core, cfg_path, entity_type="shot"):
|
|
117
|
+
"""
|
|
118
|
+
Return list of dicts: [{name, abbreviation, defaultTasks}, ...]
|
|
119
|
+
entity_type: 'shot' | 'asset'
|
|
120
|
+
"""
|
|
121
|
+
key = f"departments_{entity_type}"
|
|
122
|
+
|
|
123
|
+
# 1. Direct JSON read (fastest, most reliable)
|
|
124
|
+
if cfg_path and os.path.exists(cfg_path):
|
|
125
|
+
data = read_pipeline_json(cfg_path)
|
|
126
|
+
depts = data.get("globals", {}).get(key)
|
|
127
|
+
if depts and isinstance(depts, list):
|
|
128
|
+
return _normalise_dept_list(depts)
|
|
129
|
+
|
|
130
|
+
# 2. core.getConfig
|
|
131
|
+
if core and cfg_path:
|
|
132
|
+
depts = _getconfig(core, "globals", key, cfg_path)
|
|
133
|
+
if depts and isinstance(depts, list):
|
|
134
|
+
return _normalise_dept_list(depts)
|
|
135
|
+
|
|
136
|
+
return []
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def _normalise_dept_list(raw):
|
|
140
|
+
"""Ensure each entry has name, abbreviation, defaultTasks."""
|
|
141
|
+
result = []
|
|
142
|
+
for item in raw:
|
|
143
|
+
if isinstance(item, dict):
|
|
144
|
+
result.append({
|
|
145
|
+
"name": item.get("name", item.get("abbreviation", "")),
|
|
146
|
+
"abbreviation": item.get("abbreviation", item.get("name", "")).lower(),
|
|
147
|
+
"defaultTasks": item.get("defaultTasks", []),
|
|
148
|
+
})
|
|
149
|
+
elif isinstance(item, str):
|
|
150
|
+
result.append({"name": item, "abbreviation": item.lower(), "defaultTasks": []})
|
|
151
|
+
return result
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def build_abbrev_map(depts):
|
|
155
|
+
"""
|
|
156
|
+
Build {abbreviation_or_name_lower -> dept_dict} lookup from get_departments() output.
|
|
157
|
+
Both the abbreviation and the full name resolve to the same dict.
|
|
158
|
+
"""
|
|
159
|
+
mapping = {}
|
|
160
|
+
for d in depts:
|
|
161
|
+
mapping[d["abbreviation"]] = d
|
|
162
|
+
mapping[d["name"].lower()] = d
|
|
163
|
+
return mapping
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def resolve_dept_folder(dept_input, depts):
|
|
167
|
+
"""
|
|
168
|
+
Given user input (e.g. 'Animation' or 'anm') and a depts list,
|
|
169
|
+
return the abbreviation (folder name) or None.
|
|
170
|
+
"""
|
|
171
|
+
abbrev_map = build_abbrev_map(depts)
|
|
172
|
+
entry = abbrev_map.get(dept_input.lower())
|
|
173
|
+
return entry["abbreviation"] if entry else None
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def resolve_dept_name(folder_name, depts):
|
|
177
|
+
"""Given a folder abbreviation (e.g. 'anm'), return the full name ('Animation')."""
|
|
178
|
+
abbrev_map = build_abbrev_map(depts)
|
|
179
|
+
entry = abbrev_map.get(folder_name.lower())
|
|
180
|
+
return entry["name"] if entry else folder_name.title()
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# ---------------------------------------------------------------------------
|
|
184
|
+
# Folder structure API
|
|
185
|
+
# ---------------------------------------------------------------------------
|
|
186
|
+
|
|
187
|
+
_SCENEFILES_KEYS = ("scenesFolder", "scenefilesFolder", "sceneFolder", "pipeline_folder")
|
|
188
|
+
_ASSETS_KEYS = ("assetFolder", "assetsFolder", "asset_folder", "assetsPath", "assetPath")
|
|
189
|
+
_ASSETS_DEFAULTS = ("04_Assets", "03_Assets", "Assets", "assets")
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def get_scenefiles_folder_name(core, cfg_path):
|
|
193
|
+
"""Returns the Scenefiles folder name configured for this project."""
|
|
194
|
+
if cfg_path and os.path.exists(cfg_path):
|
|
195
|
+
data = read_pipeline_json(cfg_path)
|
|
196
|
+
g = data.get("globals", {})
|
|
197
|
+
for key in _SCENEFILES_KEYS:
|
|
198
|
+
val = g.get(key)
|
|
199
|
+
if val:
|
|
200
|
+
return val
|
|
201
|
+
if core:
|
|
202
|
+
for key in _SCENEFILES_KEYS:
|
|
203
|
+
val = _getconfig(core, "globals", key, cfg_path)
|
|
204
|
+
if val:
|
|
205
|
+
return val
|
|
206
|
+
return "Scenefiles"
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def get_entity_scenefiles_root(entity, core=None, cfg_path=None):
|
|
210
|
+
"""
|
|
211
|
+
Returns the Scenefiles folder path for a given entity, or None.
|
|
212
|
+
Combines entity['path'] + configured folder name.
|
|
213
|
+
"""
|
|
214
|
+
entity_path = entity.get("path", "") if isinstance(entity, dict) else ""
|
|
215
|
+
if not entity_path:
|
|
216
|
+
return None
|
|
217
|
+
if cfg_path is None:
|
|
218
|
+
cfg_path = cfg_from_entity(entity)
|
|
219
|
+
folder_name = get_scenefiles_folder_name(core, cfg_path)
|
|
220
|
+
# Try exact name first, then case-insensitive scan
|
|
221
|
+
exact = os.path.join(entity_path, folder_name)
|
|
222
|
+
if os.path.isdir(exact):
|
|
223
|
+
return exact
|
|
224
|
+
try:
|
|
225
|
+
for entry in os.scandir(entity_path):
|
|
226
|
+
if entry.is_dir() and entry.name.lower() == folder_name.lower():
|
|
227
|
+
return entry.path
|
|
228
|
+
except OSError:
|
|
229
|
+
pass
|
|
230
|
+
return None
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def get_asset_folder_path(project_path, core=None, cfg_path=None):
|
|
234
|
+
"""
|
|
235
|
+
Return the ABSOLUTE path of the assets folder for this project.
|
|
236
|
+
Resolution order:
|
|
237
|
+
1. core.assetPath attribute
|
|
238
|
+
2. pipeline.json asset folder keys (absolute or relative)
|
|
239
|
+
3. Common single-level names under project root
|
|
240
|
+
4. Two-level scan: project_root/<any>/<Assets|assets>
|
|
241
|
+
"""
|
|
242
|
+
# 1. core attribute
|
|
243
|
+
if core:
|
|
244
|
+
try:
|
|
245
|
+
p = getattr(core, "assetPath", None)
|
|
246
|
+
if p and isinstance(p, str) and os.path.isdir(p):
|
|
247
|
+
return p
|
|
248
|
+
except Exception:
|
|
249
|
+
pass
|
|
250
|
+
|
|
251
|
+
# 2. pipeline.json
|
|
252
|
+
if cfg_path is None:
|
|
253
|
+
cfg_path = find_pipeline_cfg(project_path)
|
|
254
|
+
if cfg_path and os.path.exists(cfg_path):
|
|
255
|
+
data = read_pipeline_json(cfg_path)
|
|
256
|
+
g = data.get("globals", {})
|
|
257
|
+
for key in _ASSETS_KEYS:
|
|
258
|
+
val = g.get(key, "")
|
|
259
|
+
if not val and core:
|
|
260
|
+
val = _getconfig(core, "globals", key, cfg_path) or ""
|
|
261
|
+
if val:
|
|
262
|
+
candidate = val if os.path.isabs(val) else os.path.join(project_path, val)
|
|
263
|
+
if os.path.isdir(candidate):
|
|
264
|
+
return candidate
|
|
265
|
+
|
|
266
|
+
# 3. Single-level common names
|
|
267
|
+
for name in _ASSETS_DEFAULTS:
|
|
268
|
+
full = os.path.join(project_path, name)
|
|
269
|
+
if os.path.isdir(full):
|
|
270
|
+
return full
|
|
271
|
+
|
|
272
|
+
# 4. Two-level scan: project_root/<subdir>/<assets-name>
|
|
273
|
+
try:
|
|
274
|
+
for entry in os.scandir(project_path):
|
|
275
|
+
if not entry.is_dir():
|
|
276
|
+
continue
|
|
277
|
+
for name in ("Assets", "assets", "ASSETS", "Asset"):
|
|
278
|
+
candidate = os.path.join(entry.path, name)
|
|
279
|
+
if os.path.isdir(candidate):
|
|
280
|
+
return candidate
|
|
281
|
+
except OSError:
|
|
282
|
+
pass
|
|
283
|
+
|
|
284
|
+
return ""
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def get_asset_entity_path(asset, project_path, core=None, cfg_path=None):
|
|
288
|
+
"""
|
|
289
|
+
Construct the absolute filesystem path for an asset entity dict.
|
|
290
|
+
Returns a constructed path even when the directory doesn't exist yet.
|
|
291
|
+
"""
|
|
292
|
+
asset_rel = asset.get("asset_path", asset.get("name", "")) if isinstance(asset, dict) else ""
|
|
293
|
+
if not asset_rel or not project_path:
|
|
294
|
+
return ""
|
|
295
|
+
|
|
296
|
+
assets_root = get_asset_folder_path(project_path, core=core, cfg_path=cfg_path)
|
|
297
|
+
if assets_root:
|
|
298
|
+
return os.path.join(assets_root, asset_rel)
|
|
299
|
+
|
|
300
|
+
return os.path.join(project_path, _ASSETS_DEFAULTS[0], asset_rel)
|
src/utils/prism_core.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
from src.nodes.base import BaseNode
|
|
4
|
+
from src.utils.qt_compat import ensure_qcolor_from_string, ensure_shiboken_stub
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
PRISM_CORE_MEMORY_KEY = "_prism_core"
|
|
8
|
+
_CACHED_PRISM_CORE = None
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def store_prism_core(core):
|
|
12
|
+
"""Persist the active PrismCore for the current workflow run."""
|
|
13
|
+
global _CACHED_PRISM_CORE
|
|
14
|
+
if core is not None:
|
|
15
|
+
_CACHED_PRISM_CORE = core
|
|
16
|
+
BaseNode.memory[PRISM_CORE_MEMORY_KEY] = core
|
|
17
|
+
return core
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def resolve_prism_core(inputs=None):
|
|
21
|
+
"""
|
|
22
|
+
Resolve PrismCore from:
|
|
23
|
+
1. Explicit node input
|
|
24
|
+
2. Shared workflow memory
|
|
25
|
+
3. A live DCC session (__main__.pcore)
|
|
26
|
+
"""
|
|
27
|
+
if isinstance(inputs, dict):
|
|
28
|
+
core = inputs.get("core")
|
|
29
|
+
if core is not None:
|
|
30
|
+
return store_prism_core(core)
|
|
31
|
+
|
|
32
|
+
core = BaseNode.memory.get(PRISM_CORE_MEMORY_KEY)
|
|
33
|
+
if core is not None:
|
|
34
|
+
return core
|
|
35
|
+
|
|
36
|
+
global _CACHED_PRISM_CORE
|
|
37
|
+
if _CACHED_PRISM_CORE is not None:
|
|
38
|
+
BaseNode.memory[PRISM_CORE_MEMORY_KEY] = _CACHED_PRISM_CORE
|
|
39
|
+
return _CACHED_PRISM_CORE
|
|
40
|
+
|
|
41
|
+
try:
|
|
42
|
+
import __main__
|
|
43
|
+
|
|
44
|
+
core = getattr(__main__, "pcore", None)
|
|
45
|
+
if core is not None:
|
|
46
|
+
return store_prism_core(core)
|
|
47
|
+
except Exception:
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def bootstrap_prism_core(prism_scripts_path="C:/Program Files/Prism2/Scripts", load_project=True, show_ui=False):
|
|
54
|
+
"""
|
|
55
|
+
Synchronously initialize PrismCore on the current thread and cache it.
|
|
56
|
+
Use this only from the Qt main thread.
|
|
57
|
+
"""
|
|
58
|
+
core = resolve_prism_core()
|
|
59
|
+
if core is not None:
|
|
60
|
+
return core
|
|
61
|
+
|
|
62
|
+
if prism_scripts_path and os.path.isdir(prism_scripts_path) and prism_scripts_path not in sys.path:
|
|
63
|
+
sys.path.append(prism_scripts_path)
|
|
64
|
+
|
|
65
|
+
ensure_qcolor_from_string()
|
|
66
|
+
ensure_shiboken_stub()
|
|
67
|
+
import PrismCore
|
|
68
|
+
|
|
69
|
+
args = []
|
|
70
|
+
if not show_ui:
|
|
71
|
+
args.append("noUI")
|
|
72
|
+
if load_project:
|
|
73
|
+
args.append("loadProject")
|
|
74
|
+
|
|
75
|
+
if show_ui:
|
|
76
|
+
core = PrismCore.show(prismArgs=args)
|
|
77
|
+
else:
|
|
78
|
+
core = PrismCore.create(prismArgs=args)
|
|
79
|
+
|
|
80
|
+
return store_prism_core(core)
|
src/utils/qt_compat.py
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Qt Compatibility Layer
|
|
3
|
+
======================
|
|
4
|
+
Provides a unified import surface for PyQt5 and PySide2/PySide6.
|
|
5
|
+
|
|
6
|
+
When running inside Houdini, PySide2 (or PySide6) is available.
|
|
7
|
+
When running standalone, PyQt5 is used.
|
|
8
|
+
|
|
9
|
+
Usage in other modules:
|
|
10
|
+
from src.utils.qt_compat import QtWidgets, QtCore, QtGui, Signal, Slot
|
|
11
|
+
|
|
12
|
+
All modules should import Qt classes through this module instead of
|
|
13
|
+
importing directly from PyQt5 or PySide2.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import os
|
|
17
|
+
import sys
|
|
18
|
+
import types
|
|
19
|
+
|
|
20
|
+
# Detect which Qt binding is available.
|
|
21
|
+
# Priority: PySide2 (Houdini in-process only) -> PyQt5 (standalone/subprocess)
|
|
22
|
+
QT_BINDING = None
|
|
23
|
+
|
|
24
|
+
# Only use PySide2 when truly running inside Houdini's own Python process.
|
|
25
|
+
# The subprocess mode (launched from Houdini) should use PyQt5 because
|
|
26
|
+
# PySide2 is not available and PySide6 has incompatible API changes.
|
|
27
|
+
_in_houdini_process = (
|
|
28
|
+
os.environ.get("VIBRANTE_HOUDINI_MODE") == "direct"
|
|
29
|
+
or (
|
|
30
|
+
"HIP" in os.environ
|
|
31
|
+
and os.environ.get("VIBRANTE_HOUDINI_MODE") != "subprocess"
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
if _in_houdini_process:
|
|
36
|
+
try:
|
|
37
|
+
from PySide2 import QtWidgets, QtCore, QtGui
|
|
38
|
+
from PySide2.QtCore import Signal, Slot
|
|
39
|
+
try:
|
|
40
|
+
from PySide2 import QtSvg
|
|
41
|
+
except ImportError:
|
|
42
|
+
QtSvg = None
|
|
43
|
+
QT_BINDING = "PySide2"
|
|
44
|
+
except ImportError:
|
|
45
|
+
pass # PySide2 not available — fall through to PyQt5
|
|
46
|
+
|
|
47
|
+
if QT_BINDING is None:
|
|
48
|
+
try:
|
|
49
|
+
from PyQt5 import QtWidgets, QtCore, QtGui
|
|
50
|
+
from PyQt5.QtCore import pyqtSignal as Signal, pyqtSlot as Slot
|
|
51
|
+
try:
|
|
52
|
+
from PyQt5 import QtSvg
|
|
53
|
+
except ImportError:
|
|
54
|
+
QtSvg = None
|
|
55
|
+
QT_BINDING = "PyQt5"
|
|
56
|
+
except ImportError:
|
|
57
|
+
raise ImportError(
|
|
58
|
+
"No Qt binding found. Install PyQt5 (`pip install PyQt5`) "
|
|
59
|
+
"or run inside Houdini (PySide2)."
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def ensure_qcolor_from_string():
|
|
64
|
+
"""
|
|
65
|
+
Backfill QColor.fromString for Qt5 bindings that don't expose it.
|
|
66
|
+
|
|
67
|
+
Prism imports expect a Qt6-style QColor API in some environments.
|
|
68
|
+
"""
|
|
69
|
+
QColor = QtGui.QColor
|
|
70
|
+
if hasattr(QColor, "fromString"):
|
|
71
|
+
return
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def _from_string(cls, value):
|
|
75
|
+
color = cls()
|
|
76
|
+
try:
|
|
77
|
+
color.setNamedColor(str(value))
|
|
78
|
+
except Exception:
|
|
79
|
+
color = cls(str(value))
|
|
80
|
+
return color
|
|
81
|
+
|
|
82
|
+
QColor.fromString = _from_string
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
ensure_qcolor_from_string()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def ensure_shiboken_stub():
|
|
89
|
+
"""
|
|
90
|
+
When running under PyQt, Prism may still attempt to import shiboken2/6
|
|
91
|
+
opportunistically. In this app that can resolve to binary wheels which are
|
|
92
|
+
incompatible with the current NumPy runtime, even though Prism doesn't need
|
|
93
|
+
them for PyQt-based execution.
|
|
94
|
+
"""
|
|
95
|
+
if QT_BINDING not in ("PyQt5", "PyQt6"):
|
|
96
|
+
return
|
|
97
|
+
|
|
98
|
+
for mod_name in ("shiboken2", "shiboken6"):
|
|
99
|
+
if mod_name in sys.modules:
|
|
100
|
+
continue
|
|
101
|
+
stub = types.ModuleType(mod_name)
|
|
102
|
+
stub.isValid = lambda obj: True
|
|
103
|
+
sys.modules[mod_name] = stub
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# ---------------------------------------------------------------------------
|
|
107
|
+
# Compatibility helpers
|
|
108
|
+
# ---------------------------------------------------------------------------
|
|
109
|
+
|
|
110
|
+
def exec_app(app):
|
|
111
|
+
"""Cross-binding QApplication.exec() / .exec_()."""
|
|
112
|
+
if hasattr(app, "exec"):
|
|
113
|
+
return app.exec()
|
|
114
|
+
return app.exec_()
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def exec_dialog(dialog, *args):
|
|
118
|
+
"""Cross-binding QDialog.exec() / .exec_().
|
|
119
|
+
|
|
120
|
+
Also works for QMenu.exec(pos) / .exec_(pos).
|
|
121
|
+
Pass optional positional args (e.g. a QPoint for menu position).
|
|
122
|
+
"""
|
|
123
|
+
if hasattr(dialog, "exec"):
|
|
124
|
+
return dialog.exec(*args)
|
|
125
|
+
return dialog.exec_(*args)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def get_qregexp():
|
|
129
|
+
"""Return a regular-expression class compatible with the active binding.
|
|
130
|
+
|
|
131
|
+
PyQt5/PySide2 (Qt5) -> QRegExp
|
|
132
|
+
PySide6/PyQt6 (Qt6) -> QRegularExpression from QtCore
|
|
133
|
+
"""
|
|
134
|
+
if QT_BINDING in ("PyQt5", "PySide2"):
|
|
135
|
+
return QtCore.QRegExp
|
|
136
|
+
# Qt6 removed QRegExp; use QRegularExpression
|
|
137
|
+
return QtCore.QRegularExpression
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def invoke_method(obj, method_name, connection_type, *args):
|
|
141
|
+
"""Cross-binding QMetaObject.invokeMethod with Q_ARG support.
|
|
142
|
+
|
|
143
|
+
In PyQt5, Q_ARG is used. In PySide2/6, invoke via a queued call.
|
|
144
|
+
"""
|
|
145
|
+
if QT_BINDING == "PyQt5":
|
|
146
|
+
from PyQt5.QtCore import QMetaObject, Q_ARG, Qt
|
|
147
|
+
q_args = []
|
|
148
|
+
for val in args:
|
|
149
|
+
if isinstance(val, str):
|
|
150
|
+
q_args.append(Q_ARG(str, val))
|
|
151
|
+
elif isinstance(val, bool):
|
|
152
|
+
q_args.append(Q_ARG(bool, val))
|
|
153
|
+
elif isinstance(val, int):
|
|
154
|
+
q_args.append(Q_ARG(int, val))
|
|
155
|
+
QMetaObject.invokeMethod(obj, method_name, connection_type, *q_args)
|
|
156
|
+
else:
|
|
157
|
+
# PySide2/6: use timer with 0ms to queue the call on the main thread
|
|
158
|
+
method = getattr(obj, method_name)
|
|
159
|
+
QtCore.QTimer.singleShot(0, lambda: method(*args))
|
src/utils/runtime.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import traceback
|
|
2
|
+
import asyncio
|
|
3
|
+
import threading
|
|
4
|
+
import sys
|
|
5
|
+
import time
|
|
6
|
+
from typing import Dict, Any, Callable, Optional, Tuple
|
|
7
|
+
|
|
8
|
+
class SafeRuntime:
|
|
9
|
+
@staticmethod
|
|
10
|
+
async def run_node_safe(node_execute_fn: Callable, inputs: Dict[str, Any]) -> Tuple[bool, Optional[Dict[str, Any]], Optional[str]]:
|
|
11
|
+
"""
|
|
12
|
+
Executes a node's execute function safely, catching any exceptions.
|
|
13
|
+
:return: (success: bool, result: dict, error_message: str)
|
|
14
|
+
"""
|
|
15
|
+
try:
|
|
16
|
+
result = await node_execute_fn(inputs)
|
|
17
|
+
return True, result, None
|
|
18
|
+
except Exception as e:
|
|
19
|
+
error_msg = f"Node execution failed: {str(e)}\n{traceback.format_exc()}"
|
|
20
|
+
return False, None, error_msg
|
|
21
|
+
|
|
22
|
+
class AsyncRuntime:
|
|
23
|
+
"""Helper to run async coroutines from a synchronous context (like UI thread)."""
|
|
24
|
+
_loop: Optional[asyncio.AbstractEventLoop] = None
|
|
25
|
+
_thread: Optional[threading.Thread] = None
|
|
26
|
+
_lock = threading.Lock()
|
|
27
|
+
_ready = threading.Event()
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def _start_loop(cls):
|
|
31
|
+
try:
|
|
32
|
+
if sys.platform == 'win32':
|
|
33
|
+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
34
|
+
|
|
35
|
+
cls._loop = asyncio.new_event_loop()
|
|
36
|
+
asyncio.set_event_loop(cls._loop)
|
|
37
|
+
print("Background Async Loop Started.")
|
|
38
|
+
cls._ready.set()
|
|
39
|
+
cls._loop.run_forever()
|
|
40
|
+
except Exception as e:
|
|
41
|
+
print(f"CRITICAL: Failed to start background async loop: {e}")
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def run_coroutine(cls, coro):
|
|
45
|
+
# 1. Start thread if not exists
|
|
46
|
+
if cls._thread is None or not cls._thread.is_alive():
|
|
47
|
+
with cls._lock:
|
|
48
|
+
if cls._thread is None or not cls._thread.is_alive():
|
|
49
|
+
cls._ready.clear()
|
|
50
|
+
cls._thread = threading.Thread(target=cls._start_loop, daemon=True)
|
|
51
|
+
cls._thread.start()
|
|
52
|
+
|
|
53
|
+
# 2. Try to schedule
|
|
54
|
+
def schedule():
|
|
55
|
+
# Wait a tiny bit for loop if it was JUST started, but don't block UI indefinitely
|
|
56
|
+
if not cls._ready.wait(timeout=0.5):
|
|
57
|
+
print("Warning: Async loop not ready in time, dropping coroutine.")
|
|
58
|
+
return
|
|
59
|
+
|
|
60
|
+
if cls._loop and cls._loop.is_running():
|
|
61
|
+
asyncio.run_coroutine_threadsafe(cls._wrap_coro(coro), cls._loop)
|
|
62
|
+
else:
|
|
63
|
+
print("Warning: Async loop not running, dropping coroutine.")
|
|
64
|
+
|
|
65
|
+
# If we are in the main thread (UI), we shouldn't block even for 0.5s if possible,
|
|
66
|
+
# but for node events like plug/unplug, a small delay is usually okay or we can thread it.
|
|
67
|
+
# Let's run the scheduler in a separate fire-and-forget thread to be 100% safe for UI.
|
|
68
|
+
threading.Thread(target=schedule, daemon=True).start()
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
async def _wrap_coro(cls, coro):
|
|
72
|
+
try:
|
|
73
|
+
if asyncio.iscoroutine(coro):
|
|
74
|
+
await coro
|
|
75
|
+
else:
|
|
76
|
+
# If it's not a coroutine (maybe it was a sync call mistakenly passed), just return
|
|
77
|
+
pass
|
|
78
|
+
except Exception as e:
|
|
79
|
+
print(f"Error in background coroutine: {e}")
|
|
80
|
+
traceback.print_exc()
|