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,490 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import re
|
|
4
|
+
import ast
|
|
5
|
+
import tempfile
|
|
6
|
+
import threading
|
|
7
|
+
|
|
8
|
+
from src.utils.qt_compat import QtWidgets, QtGui, QtCore, Signal, Slot
|
|
9
|
+
|
|
10
|
+
QDialog = QtWidgets.QDialog
|
|
11
|
+
QVBoxLayout = QtWidgets.QVBoxLayout
|
|
12
|
+
QHBoxLayout = QtWidgets.QHBoxLayout
|
|
13
|
+
QPlainTextEdit = QtWidgets.QPlainTextEdit
|
|
14
|
+
QPushButton = QtWidgets.QPushButton
|
|
15
|
+
QLabel = QtWidgets.QLabel
|
|
16
|
+
QFileDialog = QtWidgets.QFileDialog
|
|
17
|
+
QMessageBox = QtWidgets.QMessageBox
|
|
18
|
+
QApplication = QtWidgets.QApplication
|
|
19
|
+
QSplitter = QtWidgets.QSplitter
|
|
20
|
+
QWidget = QtWidgets.QWidget
|
|
21
|
+
QToolBar = QtWidgets.QToolBar
|
|
22
|
+
QAction = QtWidgets.QAction
|
|
23
|
+
QStatusBar = QtWidgets.QStatusBar
|
|
24
|
+
QStyle = QtWidgets.QStyle
|
|
25
|
+
|
|
26
|
+
QFont = QtGui.QFont
|
|
27
|
+
QColor = QtGui.QColor
|
|
28
|
+
QTextCursor = QtGui.QTextCursor
|
|
29
|
+
QTextCharFormat = QtGui.QTextCharFormat
|
|
30
|
+
|
|
31
|
+
Qt = QtCore.Qt
|
|
32
|
+
QProcess = QtCore.QProcess
|
|
33
|
+
|
|
34
|
+
from src.core.models import WorkflowModel
|
|
35
|
+
from src.ui.code_editor import CodeEditor
|
|
36
|
+
from src.utils.config_manager import config
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class GeminiFixWorker(threading.Thread):
|
|
40
|
+
"""Background thread that sends code + error to Gemini for AI-powered fixing."""
|
|
41
|
+
|
|
42
|
+
def __init__(self, code, error, callback_fn):
|
|
43
|
+
super().__init__(daemon=True)
|
|
44
|
+
self.code = code
|
|
45
|
+
self.error = error
|
|
46
|
+
self.callback_fn = callback_fn
|
|
47
|
+
|
|
48
|
+
def run(self):
|
|
49
|
+
try:
|
|
50
|
+
import google.generativeai as genai
|
|
51
|
+
|
|
52
|
+
api_key = config.get_gemini_api_key()
|
|
53
|
+
if not api_key:
|
|
54
|
+
self.callback_fn("", "Gemini API key not set. Go to Help -> Link to Gemini.")
|
|
55
|
+
return
|
|
56
|
+
|
|
57
|
+
genai.configure(api_key=api_key)
|
|
58
|
+
model = genai.GenerativeModel('gemini-flash-latest')
|
|
59
|
+
|
|
60
|
+
prompt = (
|
|
61
|
+
"You are a Python debugging assistant. The following Python script has errors.\n"
|
|
62
|
+
"Fix the code and return ONLY the corrected Python code inside a ```python ... ``` block.\n"
|
|
63
|
+
"Do not include explanations outside the code block.\n\n"
|
|
64
|
+
f"--- Script ---\n```python\n{self.code}\n```\n\n"
|
|
65
|
+
f"--- Error Output ---\n```\n{self.error}\n```\n"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
response = model.generate_content(prompt)
|
|
69
|
+
text = response.text
|
|
70
|
+
|
|
71
|
+
match = re.search(r"```python\s*(.*?)\s*```", text, re.DOTALL)
|
|
72
|
+
if match:
|
|
73
|
+
self.callback_fn(match.group(1), "")
|
|
74
|
+
else:
|
|
75
|
+
self.callback_fn("", f"Gemini did not return a code block.\nResponse:\n{text[:500]}")
|
|
76
|
+
|
|
77
|
+
except Exception as e:
|
|
78
|
+
self.callback_fn("", f"Gemini API error: {e}")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class ExportPythonDialog(QDialog):
|
|
82
|
+
"""Professional IDE-like dialog for viewing, editing, running, and AI-fixing exported Python code."""
|
|
83
|
+
|
|
84
|
+
_ai_result_signal = Signal(str, str)
|
|
85
|
+
|
|
86
|
+
def __init__(self, workflow_model: WorkflowModel, parent=None):
|
|
87
|
+
super().__init__(parent)
|
|
88
|
+
self.setWindowTitle("Python Code Editor - Export")
|
|
89
|
+
self.resize(1050, 720)
|
|
90
|
+
self.setMinimumSize(700, 500)
|
|
91
|
+
self.workflow_model = workflow_model
|
|
92
|
+
self._generated_code = ""
|
|
93
|
+
self._process = None
|
|
94
|
+
self._ai_worker = None
|
|
95
|
+
self._last_error_output = ""
|
|
96
|
+
self._temp_file_path = None
|
|
97
|
+
# Detect current app theme
|
|
98
|
+
try:
|
|
99
|
+
from src.utils.config_manager import config as _cfg
|
|
100
|
+
self._is_dark = _cfg.get("ui.theme", "dark") != "light"
|
|
101
|
+
except Exception:
|
|
102
|
+
self._is_dark = True
|
|
103
|
+
self._init_ui()
|
|
104
|
+
self._generate()
|
|
105
|
+
|
|
106
|
+
def _init_ui(self):
|
|
107
|
+
layout = QVBoxLayout(self)
|
|
108
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
109
|
+
layout.setSpacing(0)
|
|
110
|
+
|
|
111
|
+
self._ai_result_signal.connect(self._handle_ai_result)
|
|
112
|
+
|
|
113
|
+
# Theme-aware stylesheet (inherits from app Fusion theme; only override
|
|
114
|
+
# toolbar / splitter / statusbar which need dialog-specific colours)
|
|
115
|
+
if self._is_dark:
|
|
116
|
+
self.setStyleSheet("""
|
|
117
|
+
QDialog { background-color: #21222c; color: #f8f8f2; }
|
|
118
|
+
QToolBar { background-color: #282a36; border-bottom: 1px solid #44475a;
|
|
119
|
+
spacing: 4px; padding: 2px 4px; }
|
|
120
|
+
QToolBar QToolButton {
|
|
121
|
+
background-color: transparent; color: #f8f8f2;
|
|
122
|
+
border: 1px solid transparent; border-radius: 3px; padding: 4px 10px; }
|
|
123
|
+
QToolBar QToolButton:hover { background-color: #44475a; border: 1px solid #6272a4; }
|
|
124
|
+
QToolBar QToolButton:pressed { background-color: #6272a4; }
|
|
125
|
+
QToolBar QToolButton:disabled { color: #6272a4; }
|
|
126
|
+
QToolBar::separator { background-color: #44475a; width: 1px; margin: 4px 6px; }
|
|
127
|
+
QSplitter::handle { background-color: #44475a; }
|
|
128
|
+
QLabel { color: #f8f8f2; }
|
|
129
|
+
QPushButton {
|
|
130
|
+
background-color: #44475a; color: #f8f8f2;
|
|
131
|
+
border: 1px solid #6272a4; border-radius: 3px; padding: 2px 8px; }
|
|
132
|
+
QPushButton:hover { background-color: #6272a4; }
|
|
133
|
+
QStatusBar { background-color: #191a21; color: #6272a4; border-top: 1px solid #44475a; }
|
|
134
|
+
QStatusBar QLabel { color: #6272a4; font-size: 9pt; padding: 0 8px; }
|
|
135
|
+
""")
|
|
136
|
+
|
|
137
|
+
# --- Toolbar ---
|
|
138
|
+
self._init_toolbar(layout)
|
|
139
|
+
|
|
140
|
+
# --- Splitter: editor + output ---
|
|
141
|
+
splitter = QSplitter(Qt.Vertical)
|
|
142
|
+
|
|
143
|
+
self._init_editor()
|
|
144
|
+
splitter.addWidget(self.code_editor)
|
|
145
|
+
|
|
146
|
+
output_container = self._init_output_panel()
|
|
147
|
+
splitter.addWidget(output_container)
|
|
148
|
+
|
|
149
|
+
splitter.setStretchFactor(0, 7)
|
|
150
|
+
splitter.setStretchFactor(1, 3)
|
|
151
|
+
layout.addWidget(splitter, 1)
|
|
152
|
+
|
|
153
|
+
# --- Status bar ---
|
|
154
|
+
self._init_status_bar(layout)
|
|
155
|
+
|
|
156
|
+
def _init_toolbar(self, parent_layout):
|
|
157
|
+
toolbar = QToolBar()
|
|
158
|
+
toolbar.setMovable(False)
|
|
159
|
+
toolbar.setIconSize(toolbar.iconSize())
|
|
160
|
+
style = self.style()
|
|
161
|
+
|
|
162
|
+
self.run_action = QAction(style.standardIcon(QStyle.SP_MediaPlay), "Run", self)
|
|
163
|
+
self.run_action.setShortcut("F5")
|
|
164
|
+
self.run_action.setToolTip("Run script (F5)")
|
|
165
|
+
self.run_action.triggered.connect(self._run_code)
|
|
166
|
+
toolbar.addAction(self.run_action)
|
|
167
|
+
|
|
168
|
+
self.stop_action = QAction(style.standardIcon(QStyle.SP_MediaStop), "Stop", self)
|
|
169
|
+
self.stop_action.setToolTip("Stop running script")
|
|
170
|
+
self.stop_action.setEnabled(False)
|
|
171
|
+
self.stop_action.triggered.connect(self._stop_code)
|
|
172
|
+
toolbar.addAction(self.stop_action)
|
|
173
|
+
|
|
174
|
+
toolbar.addSeparator()
|
|
175
|
+
|
|
176
|
+
self.ai_fix_action = QAction("Fix with AI", self)
|
|
177
|
+
self.ai_fix_action.setToolTip("Send code and errors to Gemini AI for automatic fixing")
|
|
178
|
+
self.ai_fix_action.setEnabled(False)
|
|
179
|
+
self.ai_fix_action.triggered.connect(self._fix_with_ai)
|
|
180
|
+
toolbar.addAction(self.ai_fix_action)
|
|
181
|
+
|
|
182
|
+
toolbar.addSeparator()
|
|
183
|
+
|
|
184
|
+
self.copy_action = QAction("Copy", self)
|
|
185
|
+
self.copy_action.setShortcut("Ctrl+Shift+C")
|
|
186
|
+
self.copy_action.setToolTip("Copy code to clipboard (Ctrl+Shift+C)")
|
|
187
|
+
self.copy_action.triggered.connect(self._copy_to_clipboard)
|
|
188
|
+
toolbar.addAction(self.copy_action)
|
|
189
|
+
|
|
190
|
+
self.save_action = QAction(style.standardIcon(QStyle.SP_DialogSaveButton), "Save As...", self)
|
|
191
|
+
self.save_action.setShortcut("Ctrl+S")
|
|
192
|
+
self.save_action.setToolTip("Save script to file (Ctrl+S)")
|
|
193
|
+
self.save_action.triggered.connect(self._save_file)
|
|
194
|
+
toolbar.addAction(self.save_action)
|
|
195
|
+
|
|
196
|
+
# Spacer to push Close to the right
|
|
197
|
+
spacer = QWidget()
|
|
198
|
+
spacer.setSizePolicy(
|
|
199
|
+
spacer.sizePolicy().horizontalPolicy(),
|
|
200
|
+
spacer.sizePolicy().verticalPolicy()
|
|
201
|
+
)
|
|
202
|
+
QSizePolicy = QtWidgets.QSizePolicy
|
|
203
|
+
spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
|
204
|
+
toolbar.addWidget(spacer)
|
|
205
|
+
|
|
206
|
+
self.close_action = QAction("Close", self)
|
|
207
|
+
self.close_action.setToolTip("Close dialog")
|
|
208
|
+
self.close_action.triggered.connect(self.reject)
|
|
209
|
+
toolbar.addAction(self.close_action)
|
|
210
|
+
|
|
211
|
+
parent_layout.addWidget(toolbar)
|
|
212
|
+
|
|
213
|
+
def _init_editor(self):
|
|
214
|
+
self.code_editor = CodeEditor()
|
|
215
|
+
self.code_editor.cursorPositionChanged.connect(self._update_cursor_pos)
|
|
216
|
+
|
|
217
|
+
# Dracula-themed professional styling
|
|
218
|
+
self.code_editor.setStyleSheet("""
|
|
219
|
+
QPlainTextEdit {
|
|
220
|
+
background-color: #282a36;
|
|
221
|
+
color: #f8f8f2;
|
|
222
|
+
selection-background-color: #44475a;
|
|
223
|
+
selection-color: #f8f8f2;
|
|
224
|
+
border: none;
|
|
225
|
+
border-top: 1px solid #44475a;
|
|
226
|
+
border-bottom: 1px solid #44475a;
|
|
227
|
+
}
|
|
228
|
+
""")
|
|
229
|
+
|
|
230
|
+
def _init_output_panel(self):
|
|
231
|
+
container = QWidget()
|
|
232
|
+
vlayout = QVBoxLayout(container)
|
|
233
|
+
vlayout.setContentsMargins(4, 2, 4, 0)
|
|
234
|
+
vlayout.setSpacing(2)
|
|
235
|
+
|
|
236
|
+
header = QHBoxLayout()
|
|
237
|
+
header.addWidget(QLabel("Output"))
|
|
238
|
+
header.addStretch()
|
|
239
|
+
clear_btn = QPushButton("Clear")
|
|
240
|
+
clear_btn.setFixedWidth(60)
|
|
241
|
+
clear_btn.clicked.connect(lambda: self.output_display.clear())
|
|
242
|
+
header.addWidget(clear_btn)
|
|
243
|
+
vlayout.addLayout(header)
|
|
244
|
+
|
|
245
|
+
self.output_display = QPlainTextEdit()
|
|
246
|
+
self.output_display.setReadOnly(True)
|
|
247
|
+
font = QFont("Consolas", 10)
|
|
248
|
+
font.setStyleHint(QFont.Monospace)
|
|
249
|
+
self.output_display.setFont(font)
|
|
250
|
+
self.output_display.setLineWrapMode(QPlainTextEdit.NoWrap)
|
|
251
|
+
|
|
252
|
+
if self._is_dark:
|
|
253
|
+
self.output_display.setStyleSheet(
|
|
254
|
+
"background-color: #191a21; color: #f8f8f2; border: none; border-top: 1px solid #44475a;"
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
vlayout.addWidget(self.output_display, 1)
|
|
258
|
+
return container
|
|
259
|
+
|
|
260
|
+
def _init_status_bar(self, parent_layout):
|
|
261
|
+
self.status_bar = QStatusBar()
|
|
262
|
+
self.status_bar.setSizeGripEnabled(False)
|
|
263
|
+
|
|
264
|
+
self._cursor_label = QLabel("Ln 1, Col 1")
|
|
265
|
+
self._cursor_label.setMinimumWidth(120)
|
|
266
|
+
self.status_bar.addWidget(self._cursor_label)
|
|
267
|
+
|
|
268
|
+
self._status_message = QLabel("Ready")
|
|
269
|
+
self.status_bar.addPermanentWidget(self._status_message)
|
|
270
|
+
|
|
271
|
+
parent_layout.addWidget(self.status_bar)
|
|
272
|
+
|
|
273
|
+
# ---- Code Generation ----
|
|
274
|
+
|
|
275
|
+
def _generate(self):
|
|
276
|
+
try:
|
|
277
|
+
from src.core.workflow_to_python import convert_workflow_to_python
|
|
278
|
+
code = convert_workflow_to_python(self.workflow_model)
|
|
279
|
+
self.code_editor.setPlainText(code)
|
|
280
|
+
self._generated_code = code
|
|
281
|
+
except Exception as e:
|
|
282
|
+
self.code_editor.setPlainText(f"# Error generating Python:\n# {e}")
|
|
283
|
+
self._generated_code = ""
|
|
284
|
+
|
|
285
|
+
# ---- Code Execution ----
|
|
286
|
+
|
|
287
|
+
def _run_code(self):
|
|
288
|
+
if self._process is not None:
|
|
289
|
+
return
|
|
290
|
+
|
|
291
|
+
code = self.code_editor.toPlainText()
|
|
292
|
+
if not code.strip():
|
|
293
|
+
return
|
|
294
|
+
|
|
295
|
+
# Write to temp file
|
|
296
|
+
try:
|
|
297
|
+
fd, path = tempfile.mkstemp(suffix='.py', prefix='vibrante_run_')
|
|
298
|
+
with os.fdopen(fd, 'w', encoding='utf-8') as f:
|
|
299
|
+
f.write(code)
|
|
300
|
+
self._temp_file_path = path
|
|
301
|
+
except OSError as e:
|
|
302
|
+
self._append_output(f">>> Failed to create temp file: {e}\n", color="#ff5555")
|
|
303
|
+
return
|
|
304
|
+
|
|
305
|
+
self.output_display.clear()
|
|
306
|
+
self._last_error_output = ""
|
|
307
|
+
self._append_output(">>> Running script...\n", color="#8be9fd")
|
|
308
|
+
|
|
309
|
+
self._process = QProcess(self)
|
|
310
|
+
self._process.setProcessChannelMode(QProcess.SeparateChannels)
|
|
311
|
+
self._process.readyReadStandardOutput.connect(self._on_stdout_ready)
|
|
312
|
+
self._process.readyReadStandardError.connect(self._on_stderr_ready)
|
|
313
|
+
self._process.finished.connect(self._on_process_finished)
|
|
314
|
+
self._process.errorOccurred.connect(self._on_process_error)
|
|
315
|
+
self._process.start(sys.executable, [self._temp_file_path])
|
|
316
|
+
|
|
317
|
+
self._update_button_states()
|
|
318
|
+
self._status_message.setText("Running...")
|
|
319
|
+
|
|
320
|
+
def _stop_code(self):
|
|
321
|
+
if self._process is not None and self._process.state() != QProcess.NotRunning:
|
|
322
|
+
self._process.kill()
|
|
323
|
+
self._append_output("\n>>> Process killed by user.\n", color="#ff5555")
|
|
324
|
+
|
|
325
|
+
@Slot()
|
|
326
|
+
def _on_stdout_ready(self):
|
|
327
|
+
if self._process is None:
|
|
328
|
+
return
|
|
329
|
+
data = self._process.readAllStandardOutput().data().decode('utf-8', errors='replace')
|
|
330
|
+
self._append_output(data)
|
|
331
|
+
|
|
332
|
+
@Slot()
|
|
333
|
+
def _on_stderr_ready(self):
|
|
334
|
+
if self._process is None:
|
|
335
|
+
return
|
|
336
|
+
data = self._process.readAllStandardError().data().decode('utf-8', errors='replace')
|
|
337
|
+
self._last_error_output += data
|
|
338
|
+
self._append_output(data, color="#ff5555")
|
|
339
|
+
|
|
340
|
+
@Slot(int, QProcess.ExitStatus)
|
|
341
|
+
def _on_process_finished(self, exit_code, exit_status):
|
|
342
|
+
status_text = "finished successfully" if exit_code == 0 else f"exited with code {exit_code}"
|
|
343
|
+
color = "#50fa7b" if exit_code == 0 else "#ff5555"
|
|
344
|
+
self._append_output(f"\n>>> Process {status_text}.\n", color=color)
|
|
345
|
+
self._status_message.setText(f"Exit code: {exit_code}")
|
|
346
|
+
|
|
347
|
+
self._cleanup_temp()
|
|
348
|
+
self._process = None
|
|
349
|
+
self._update_button_states()
|
|
350
|
+
|
|
351
|
+
@Slot(QProcess.ProcessError)
|
|
352
|
+
def _on_process_error(self, error):
|
|
353
|
+
error_map = {
|
|
354
|
+
QProcess.FailedToStart: "Failed to start Python interpreter",
|
|
355
|
+
QProcess.Crashed: "Python process crashed",
|
|
356
|
+
QProcess.Timedout: "Process timed out",
|
|
357
|
+
}
|
|
358
|
+
msg = error_map.get(error, f"Process error: {error}")
|
|
359
|
+
self._append_output(f"\n>>> ERROR: {msg}\n", color="#ff5555")
|
|
360
|
+
self._status_message.setText("Error")
|
|
361
|
+
self._cleanup_temp()
|
|
362
|
+
self._process = None
|
|
363
|
+
self._update_button_states()
|
|
364
|
+
|
|
365
|
+
def _append_output(self, text, color=None):
|
|
366
|
+
cursor = self.output_display.textCursor()
|
|
367
|
+
cursor.movePosition(QTextCursor.End)
|
|
368
|
+
if color:
|
|
369
|
+
fmt = QTextCharFormat()
|
|
370
|
+
fmt.setForeground(QColor(color))
|
|
371
|
+
cursor.setCharFormat(fmt)
|
|
372
|
+
else:
|
|
373
|
+
fmt = QTextCharFormat()
|
|
374
|
+
cursor.setCharFormat(fmt)
|
|
375
|
+
cursor.insertText(text)
|
|
376
|
+
self.output_display.setTextCursor(cursor)
|
|
377
|
+
self.output_display.ensureCursorVisible()
|
|
378
|
+
|
|
379
|
+
def _cleanup_temp(self):
|
|
380
|
+
if self._temp_file_path and os.path.exists(self._temp_file_path):
|
|
381
|
+
try:
|
|
382
|
+
os.unlink(self._temp_file_path)
|
|
383
|
+
except OSError:
|
|
384
|
+
pass
|
|
385
|
+
self._temp_file_path = None
|
|
386
|
+
|
|
387
|
+
# ---- AI Fix ----
|
|
388
|
+
|
|
389
|
+
def _fix_with_ai(self):
|
|
390
|
+
api_key = config.get_gemini_api_key()
|
|
391
|
+
if not api_key:
|
|
392
|
+
QMessageBox.warning(
|
|
393
|
+
self, "API Key Missing",
|
|
394
|
+
"Please set your Gemini API key in Help -> Link to Gemini."
|
|
395
|
+
)
|
|
396
|
+
return
|
|
397
|
+
|
|
398
|
+
code = self.code_editor.toPlainText()
|
|
399
|
+
error = self._last_error_output
|
|
400
|
+
|
|
401
|
+
if not error.strip():
|
|
402
|
+
if self.code_editor.error_line > 0:
|
|
403
|
+
try:
|
|
404
|
+
ast.parse(code)
|
|
405
|
+
except SyntaxError as e:
|
|
406
|
+
error = f"SyntaxError at line {e.lineno}: {e.msg}"
|
|
407
|
+
|
|
408
|
+
if not error.strip():
|
|
409
|
+
QMessageBox.information(
|
|
410
|
+
self, "No Errors",
|
|
411
|
+
"No errors detected. Run the code first to identify issues."
|
|
412
|
+
)
|
|
413
|
+
return
|
|
414
|
+
|
|
415
|
+
self.ai_fix_action.setEnabled(False)
|
|
416
|
+
self._status_message.setText("AI is analyzing code...")
|
|
417
|
+
self._append_output("\n>>> Sending code to Gemini AI for analysis...\n", color="#bd93f9")
|
|
418
|
+
|
|
419
|
+
self._ai_worker = GeminiFixWorker(code, error, self._on_ai_fix_result)
|
|
420
|
+
self._ai_worker.start()
|
|
421
|
+
|
|
422
|
+
def _on_ai_fix_result(self, fixed_code, error_msg):
|
|
423
|
+
self._ai_result_signal.emit(fixed_code, error_msg)
|
|
424
|
+
|
|
425
|
+
@Slot(str, str)
|
|
426
|
+
def _handle_ai_result(self, fixed_code, error_msg):
|
|
427
|
+
self.ai_fix_action.setEnabled(True)
|
|
428
|
+
self._status_message.setText("Ready")
|
|
429
|
+
|
|
430
|
+
if error_msg:
|
|
431
|
+
self._append_output(f">>> AI Fix Error: {error_msg}\n", color="#ff5555")
|
|
432
|
+
QMessageBox.warning(self, "AI Fix Failed", error_msg)
|
|
433
|
+
return
|
|
434
|
+
|
|
435
|
+
reply = QMessageBox.question(
|
|
436
|
+
self, "Apply AI Fix?",
|
|
437
|
+
"Gemini has suggested a fix. Replace the current code with the AI-corrected version?\n\n"
|
|
438
|
+
"(Use Ctrl+Z in the editor to undo if needed.)",
|
|
439
|
+
QMessageBox.Yes | QMessageBox.No,
|
|
440
|
+
QMessageBox.Yes
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
if reply == QMessageBox.Yes:
|
|
444
|
+
self.code_editor.setPlainText(fixed_code)
|
|
445
|
+
self._append_output(">>> AI fix applied. Run the code again to verify.\n", color="#50fa7b")
|
|
446
|
+
self._status_message.setText("AI fix applied")
|
|
447
|
+
else:
|
|
448
|
+
self._append_output(">>> AI fix rejected by user.\n", color="#ffb86c")
|
|
449
|
+
|
|
450
|
+
# ---- Clipboard & Save ----
|
|
451
|
+
|
|
452
|
+
def _copy_to_clipboard(self):
|
|
453
|
+
QApplication.clipboard().setText(self.code_editor.toPlainText())
|
|
454
|
+
self._status_message.setText("Copied to clipboard")
|
|
455
|
+
|
|
456
|
+
def _save_file(self):
|
|
457
|
+
path, _ = QFileDialog.getSaveFileName(
|
|
458
|
+
self, "Save Python Script", "", "Python Files (*.py)"
|
|
459
|
+
)
|
|
460
|
+
if path:
|
|
461
|
+
if not path.endswith(".py"):
|
|
462
|
+
path += ".py"
|
|
463
|
+
try:
|
|
464
|
+
with open(path, "w", encoding="utf-8") as f:
|
|
465
|
+
f.write(self.code_editor.toPlainText())
|
|
466
|
+
QMessageBox.information(self, "Saved", f"Script saved to:\n{path}")
|
|
467
|
+
except IOError as e:
|
|
468
|
+
QMessageBox.critical(self, "Error", f"Failed to save file:\n{e}")
|
|
469
|
+
|
|
470
|
+
# ---- Status Bar ----
|
|
471
|
+
|
|
472
|
+
def _update_cursor_pos(self, *_):
|
|
473
|
+
line, col = self.code_editor.getCursorPosition()
|
|
474
|
+
self._cursor_label.setText(f"Ln {line + 1}, Col {col + 1}")
|
|
475
|
+
|
|
476
|
+
def _update_button_states(self):
|
|
477
|
+
is_running = self._process is not None and self._process.state() != QProcess.NotRunning
|
|
478
|
+
self.run_action.setEnabled(not is_running)
|
|
479
|
+
self.stop_action.setEnabled(is_running)
|
|
480
|
+
has_errors = bool(self._last_error_output.strip()) or self.code_editor.error_line > 0
|
|
481
|
+
self.ai_fix_action.setEnabled(not is_running and has_errors)
|
|
482
|
+
|
|
483
|
+
# ---- Cleanup ----
|
|
484
|
+
|
|
485
|
+
def closeEvent(self, event):
|
|
486
|
+
if self._process is not None and self._process.state() != QProcess.NotRunning:
|
|
487
|
+
self._process.kill()
|
|
488
|
+
self._process.waitForFinished(3000)
|
|
489
|
+
self._cleanup_temp()
|
|
490
|
+
super().closeEvent(event)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from src.utils.qt_compat import QtWidgets
|
|
2
|
+
from src.utils.config_manager import config
|
|
3
|
+
|
|
4
|
+
QDialog = QtWidgets.QDialog
|
|
5
|
+
QVBoxLayout = QtWidgets.QVBoxLayout
|
|
6
|
+
QLineEdit = QtWidgets.QLineEdit
|
|
7
|
+
QPushButton = QtWidgets.QPushButton
|
|
8
|
+
QLabel = QtWidgets.QLabel
|
|
9
|
+
QHBoxLayout = QtWidgets.QHBoxLayout
|
|
10
|
+
|
|
11
|
+
class GeminiApiDialog(QDialog):
|
|
12
|
+
def __init__(self, parent=None):
|
|
13
|
+
super().__init__(parent)
|
|
14
|
+
self.setWindowTitle("Link to Gemini")
|
|
15
|
+
self.setFixedWidth(400)
|
|
16
|
+
self._init_ui()
|
|
17
|
+
|
|
18
|
+
def _init_ui(self):
|
|
19
|
+
layout = QVBoxLayout(self)
|
|
20
|
+
|
|
21
|
+
layout.addWidget(QLabel("Paste your Gemini API Key here:"))
|
|
22
|
+
|
|
23
|
+
self.api_key_edit = QLineEdit()
|
|
24
|
+
self.api_key_edit.setEchoMode(QLineEdit.Password)
|
|
25
|
+
self.api_key_edit.setText(config.get_gemini_api_key())
|
|
26
|
+
layout.addWidget(self.api_key_edit)
|
|
27
|
+
|
|
28
|
+
button_layout = QHBoxLayout()
|
|
29
|
+
self.save_btn = QPushButton("Save")
|
|
30
|
+
self.save_btn.clicked.connect(self._save_api_key)
|
|
31
|
+
self.cancel_btn = QPushButton("Cancel")
|
|
32
|
+
self.cancel_btn.clicked.connect(self.reject)
|
|
33
|
+
|
|
34
|
+
button_layout.addWidget(self.save_btn)
|
|
35
|
+
button_layout.addWidget(self.cancel_btn)
|
|
36
|
+
layout.addLayout(button_layout)
|
|
37
|
+
|
|
38
|
+
def _save_api_key(self):
|
|
39
|
+
api_key = self.api_key_edit.text().strip()
|
|
40
|
+
config.set_gemini_api_key(api_key)
|
|
41
|
+
self.accept()
|