From 2909b7453e2117282d7181a84fb850824bf86b5f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 23 Jul 2020 11:03:44 +0200 Subject: [PATCH 001/507] initial commit --- .../kuba_each_case/global/creator.json | 8 + .../kuba_each_case/global/intents.json | 3 + .../project_presets/ftrack/ftrack_config.json | 11 + .../project_presets/global/creator.json | 8 + .../global/slates/example_HD.json | 212 +++ .../config/project_presets/maya/capture.json | 108 ++ .../project_presets/plugins/config.json | 1 + .../plugins/ftrack/publish.json | 6 + .../plugins/global/create.json | 1 + .../plugins/global/filter.json | 1 + .../project_presets/plugins/global/load.json | 1 + .../plugins/global/publish.json | 73 + .../project_presets/plugins/maya/create.json | 1 + .../project_presets/plugins/maya/filter.json | 9 + .../project_presets/plugins/maya/load.json | 18 + .../project_presets/plugins/maya/publish.json | 17 + .../plugins/maya/workfile_build.json | 54 + .../project_presets/plugins/nuke/create.json | 8 + .../project_presets/plugins/nuke/load.json | 1 + .../project_presets/plugins/nuke/publish.json | 48 + .../plugins/nuke/workfile_build.json | 11 + .../plugins/nukestudio/filter.json | 10 + .../plugins/nukestudio/publish.json | 8 + .../plugins/standalonepublisher/publish.json | 17 + .../project_presets/plugins/test/create.json | 8 + .../project_presets/plugins/test/publish.json | 10 + .../premiere/asset_default.json | 5 + .../project_presets/premiere/rules_tasks.json | 21 + .../project_presets/unreal/project_setup.json | 4 + .../studio_presets/ftrack/server_plugins.json | 1 + .../studio_presets/ftrack/user_plugins.json | 5 + .../studio_presets/global/applications.json | 39 + .../global/es/applications.json | 39 + .../config/studio_presets/global/intents.json | 9 + .../studio_presets/global/tray_items.json | 25 + .../muster/templates_mapping.json | 19 + .../applications_gui_schema.json | 153 ++ .../ftrack_projects_gui_schema.json | 30 + .../config_gui_schema/project_gui_schema.json | 13 + .../config_gui_schema/studio_gui_schema.json | 23 + .../config_gui_schema/tools_gui_schema.json | 29 + pype/tools/config_setting/interface.py | 49 + pype/tools/config_setting/style/__init__.py | 12 + pype/tools/config_setting/style/pype_icon.png | Bin 0 -> 3793 bytes pype/tools/config_setting/style/style.css | 90 ++ pype/tools/config_setting/widgets/__init__.py | 6 + pype/tools/config_setting/widgets/base.py | 282 ++++ pype/tools/config_setting/widgets/config.py | 236 +++ pype/tools/config_setting/widgets/inputs.py | 1346 +++++++++++++++++ pype/tools/config_setting/widgets/lib.py | 44 + pype/tools/config_setting/widgets/main.py | 26 + pype/tools/config_setting/widgets/tests.py | 127 ++ 52 files changed, 3286 insertions(+) create mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json create mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json create mode 100644 pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json create mode 100644 pype/tools/config_setting/config/project_presets/global/creator.json create mode 100644 pype/tools/config_setting/config/project_presets/global/slates/example_HD.json create mode 100644 pype/tools/config_setting/config/project_presets/maya/capture.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/config.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/create.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/filter.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/load.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/publish.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/create.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/filter.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/load.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/publish.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/create.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/load.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/test/create.json create mode 100644 pype/tools/config_setting/config/project_presets/plugins/test/publish.json create mode 100644 pype/tools/config_setting/config/project_presets/premiere/asset_default.json create mode 100644 pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json create mode 100644 pype/tools/config_setting/config/project_presets/unreal/project_setup.json create mode 100644 pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json create mode 100644 pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json create mode 100644 pype/tools/config_setting/config/studio_presets/global/applications.json create mode 100644 pype/tools/config_setting/config/studio_presets/global/es/applications.json create mode 100644 pype/tools/config_setting/config/studio_presets/global/intents.json create mode 100644 pype/tools/config_setting/config/studio_presets/global/tray_items.json create mode 100644 pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json create mode 100644 pype/tools/config_setting/config_gui_schema/applications_gui_schema.json create mode 100644 pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json create mode 100644 pype/tools/config_setting/config_gui_schema/project_gui_schema.json create mode 100644 pype/tools/config_setting/config_gui_schema/studio_gui_schema.json create mode 100644 pype/tools/config_setting/config_gui_schema/tools_gui_schema.json create mode 100644 pype/tools/config_setting/interface.py create mode 100644 pype/tools/config_setting/style/__init__.py create mode 100644 pype/tools/config_setting/style/pype_icon.png create mode 100644 pype/tools/config_setting/style/style.css create mode 100644 pype/tools/config_setting/widgets/__init__.py create mode 100644 pype/tools/config_setting/widgets/base.py create mode 100644 pype/tools/config_setting/widgets/config.py create mode 100644 pype/tools/config_setting/widgets/inputs.py create mode 100644 pype/tools/config_setting/widgets/lib.py create mode 100644 pype/tools/config_setting/widgets/main.py create mode 100644 pype/tools/config_setting/widgets/tests.py diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json new file mode 100644 index 0000000000..d14e779f01 --- /dev/null +++ b/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json @@ -0,0 +1,8 @@ +{ + "Model": ["model"], + "Render Globals": ["light", "render"], + "Layout": ["layout"], + "Set Dress": ["setdress"], + "Look": ["look"], + "Rig": ["rigging"] +} diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json new file mode 100644 index 0000000000..bf147c7a19 --- /dev/null +++ b/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json @@ -0,0 +1,3 @@ +{ + "default": "test" +} diff --git a/pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json b/pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json new file mode 100644 index 0000000000..c9dbde4596 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json @@ -0,0 +1,11 @@ +{ + "status_update": { + "_ignore_": ["in progress", "ommited", "on hold"], + "Ready": ["not ready"], + "In Progress" : ["_any_"] + }, + "status_version_to_task": { + "in progress": "in progress", + "approved": "approved" + } +} diff --git a/pype/tools/config_setting/config/project_presets/global/creator.json b/pype/tools/config_setting/config/project_presets/global/creator.json new file mode 100644 index 0000000000..d14e779f01 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/global/creator.json @@ -0,0 +1,8 @@ +{ + "Model": ["model"], + "Render Globals": ["light", "render"], + "Layout": ["layout"], + "Set Dress": ["setdress"], + "Look": ["look"], + "Rig": ["rigging"] +} diff --git a/pype/tools/config_setting/config/project_presets/global/slates/example_HD.json b/pype/tools/config_setting/config/project_presets/global/slates/example_HD.json new file mode 100644 index 0000000000..b06391fb63 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/global/slates/example_HD.json @@ -0,0 +1,212 @@ +{ + "width": 1920, + "height": 1080, + "destination_path": "{destination_path}", + "style": { + "*": { + "font-family": "arial", + "font-color": "#ffffff", + "font-bold": false, + "font-italic": false, + "bg-color": "#0077ff", + "alignment-horizontal": "left", + "alignment-vertical": "top" + }, + "layer": { + "padding": 0, + "margin": 0 + }, + "rectangle": { + "padding": 0, + "margin": 0, + "bg-color": "#E9324B", + "fill": true + }, + "main_frame": { + "padding": 0, + "margin": 0, + "bg-color": "#252525" + }, + "table": { + "padding": 0, + "margin": 0, + "bg-color": "transparent" + }, + "table-item": { + "padding": 5, + "padding-bottom": 10, + "margin": 0, + "bg-color": "#212121", + "bg-alter-color": "#272727", + "font-color": "#dcdcdc", + "font-bold": false, + "font-italic": false, + "alignment-horizontal": "left", + "alignment-vertical": "top", + "word-wrap": false, + "ellide": true, + "max-lines": 1 + }, + "table-item-col[0]": { + "font-size": 20, + "font-color": "#898989", + "font-bold": true, + "ellide": false, + "word-wrap": true, + "max-lines": null + }, + "table-item-col[1]": { + "font-size": 40, + "padding-left": 10 + }, + "#colorbar": { + "bg-color": "#9932CC" + } + }, + "items": [{ + "type": "layer", + "direction": 1, + "name": "MainLayer", + "style": { + "#MainLayer": { + "width": 1094, + "height": 1000, + "margin": 25, + "padding": 0 + }, + "#LeftSide": { + "margin-right": 25 + } + }, + "items": [{ + "type": "layer", + "name": "LeftSide", + "items": [{ + "type": "layer", + "direction": 1, + "style": { + "table-item": { + "bg-color": "transparent", + "padding-bottom": 20 + }, + "table-item-col[0]": { + "font-size": 20, + "font-color": "#898989", + "alignment-horizontal": "right" + }, + "table-item-col[1]": { + "alignment-horizontal": "left", + "font-bold": true, + "font-size": 40 + } + }, + "items": [{ + "type": "table", + "values": [ + ["Show:", "{project[name]}"] + ], + "style": { + "table-item-field[0:0]": { + "width": 150 + }, + "table-item-field[0:1]": { + "width": 580 + } + } + }, { + "type": "table", + "values": [ + ["Submitting For:", "{intent}"] + ], + "style": { + "table-item-field[0:0]": { + "width": 160 + }, + "table-item-field[0:1]": { + "width": 218, + "alignment-horizontal": "right" + } + } + }] + }, { + "type": "rectangle", + "style": { + "bg-color": "#bc1015", + "width": 1108, + "height": 5, + "fill": true + } + }, { + "type": "table", + "use_alternate_color": true, + "values": [ + ["Version name:", "{version_name}"], + ["Date:", "{date}"], + ["Shot Types:", "{shot_type}"], + ["Submission Note:", "{submission_note}"] + ], + "style": { + "table-item": { + "padding-bottom": 20 + }, + "table-item-field[0:1]": { + "font-bold": true + }, + "table-item-field[3:0]": { + "word-wrap": true, + "ellide": true, + "max-lines": 4 + }, + "table-item-col[0]": { + "alignment-horizontal": "right", + "width": 150 + }, + "table-item-col[1]": { + "alignment-horizontal": "left", + "width": 958 + } + } + }] + }, { + "type": "layer", + "name": "RightSide", + "items": [{ + "type": "placeholder", + "name": "thumbnail", + "path": "{thumbnail_path}", + "style": { + "width": 730, + "height": 412 + } + }, { + "type": "placeholder", + "name": "colorbar", + "path": "{color_bar_path}", + "return_data": true, + "style": { + "width": 730, + "height": 55 + } + }, { + "type": "table", + "use_alternate_color": true, + "values": [ + ["Vendor:", "{vendor}"], + ["Shot Name:", "{shot_name}"], + ["Frames:", "{frame_start} - {frame_end} ({duration})"] + ], + "style": { + "table-item-col[0]": { + "alignment-horizontal": "left", + "width": 200 + }, + "table-item-col[1]": { + "alignment-horizontal": "right", + "width": 530, + "font-size": 30 + } + } + }] + }] + }] +} diff --git a/pype/tools/config_setting/config/project_presets/maya/capture.json b/pype/tools/config_setting/config/project_presets/maya/capture.json new file mode 100644 index 0000000000..b6c4893034 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/maya/capture.json @@ -0,0 +1,108 @@ +{ + "Codec": { + "compression": "jpg", + "format": "image", + "quality": 95 + }, + "Display Options": { + "background": [ + 0.7137254901960784, + 0.7137254901960784, + 0.7137254901960784 + ], + "backgroundBottom": [ + 0.7137254901960784, + 0.7137254901960784, + 0.7137254901960784 + ], + "backgroundTop": [ + 0.7137254901960784, + 0.7137254901960784, + 0.7137254901960784 + ], + "override_display": true + }, + "Generic": { + "isolate_view": true, + "off_screen": true + }, + "IO": { + "name": "", + "open_finished": false, + "raw_frame_numbers": false, + "recent_playblasts": [], + "save_file": false + }, + "PanZoom": { + "pan_zoom": true + }, + "Renderer": { + "rendererName": "vp2Renderer" + }, + "Resolution": { + "height": 1080, + "mode": "Custom", + "percent": 1.0, + "width": 1920 + }, + "Time Range": { + "end_frame": 25, + "frame": "", + "start_frame": 0, + "time": "Time Slider" + }, + "Viewport Options": { + "cameras": false, + "clipGhosts": false, + "controlVertices": false, + "deformers": false, + "dimensions": false, + "displayLights": 0, + "dynamicConstraints": false, + "dynamics": false, + "fluids": false, + "follicles": false, + "gpuCacheDisplayFilter": false, + "greasePencils": false, + "grid": false, + "hairSystems": false, + "handles": false, + "high_quality": true, + "hud": false, + "hulls": false, + "ikHandles": false, + "imagePlane": false, + "joints": false, + "lights": false, + "locators": false, + "manipulators": false, + "motionTrails": false, + "nCloths": false, + "nParticles": false, + "nRigids": false, + "nurbsCurves": false, + "nurbsSurfaces": false, + "override_viewport_options": true, + "particleInstancers": false, + "pivots": false, + "planes": false, + "pluginShapes": false, + "polymeshes": true, + "shadows": false, + "strokes": false, + "subdivSurfaces": false, + "textures": false, + "twoSidedLighting": true + }, + "Camera Options": { + "displayGateMask": false, + "displayResolution": false, + "displayFilmGate": false, + "displayFieldChart": false, + "displaySafeAction": false, + "displaySafeTitle": false, + "displayFilmPivot": false, + "displayFilmOrigin": false, + "overscan": 1.0 + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/config.json b/pype/tools/config_setting/config/project_presets/plugins/config.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/config.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json b/pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json new file mode 100644 index 0000000000..d0469ae4f7 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json @@ -0,0 +1,6 @@ +{ + "IntegrateFtrackNote": { + "note_with_intent_template": "{intent}: {comment}", + "note_labels": [] + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/create.json b/pype/tools/config_setting/config/project_presets/plugins/global/create.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/global/create.json @@ -0,0 +1 @@ +{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/filter.json b/pype/tools/config_setting/config/project_presets/plugins/global/filter.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/global/filter.json @@ -0,0 +1 @@ +{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/load.json b/pype/tools/config_setting/config/project_presets/plugins/global/load.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/global/load.json @@ -0,0 +1 @@ +{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/publish.json b/pype/tools/config_setting/config/project_presets/plugins/global/publish.json new file mode 100644 index 0000000000..6e51e00497 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/global/publish.json @@ -0,0 +1,73 @@ +{ + "IntegrateMasterVersion": { + "enabled": false + }, + "ExtractReview": { + "__documentation__": "http://pype.club/docs/admin_presets_plugins", + "profiles": [ + { + "families": [], + "hosts": [], + "outputs": { + "h264": { + "filter": { + "families": ["render", "review", "ftrack"] + }, + "ext": "mp4", + "ffmpeg_args": { + "input": [ + "-gamma 2.2" + ], + "video_filters": [], + "audio_filters": [], + "output": [ + "-pix_fmt yuv420p", + "-crf 18", + "-intra" + ] + }, + "tags": ["burnin", "ftrackreview"] + } + } + } + ] + }, + "ExtractBurnin": { + "options": { + "opacity": 1, + "x_offset": 5, + "y_offset": 5, + "bg_padding": 5, + "bg_opacity": 0.5, + "font_size": 42 + }, + "fields": { + + }, + "profiles": [ + { + "burnins": { + "burnin": { + "TOP_LEFT": "{yy}-{mm}-{dd}", + "TOP_RIGHT": "{anatomy[version]}", + "TOP_CENTERED": "", + "BOTTOM_RIGHT": "{frame_start}-{current_frame}-{frame_end}", + "BOTTOM_CENTERED": "{asset}", + "BOTTOM_LEFT": "{username}" + } + } + } + ] + }, + "IntegrateAssetNew": { + "template_name_profiles": { + "publish": { + "families": [], + "tasks": [] + }, + "render": { + "families": ["review", "render", "prerender"] + } + } + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/create.json b/pype/tools/config_setting/config/project_presets/plugins/maya/create.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/maya/create.json @@ -0,0 +1 @@ +{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/filter.json b/pype/tools/config_setting/config/project_presets/plugins/maya/filter.json new file mode 100644 index 0000000000..83d6f05f31 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/maya/filter.json @@ -0,0 +1,9 @@ +{ + "Preset n1": { + "ValidateNoAnimation": false, + "ValidateShapeDefaultNames": false + }, + "Preset n2": { + "ValidateNoAnimation": false + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/load.json b/pype/tools/config_setting/config/project_presets/plugins/maya/load.json new file mode 100644 index 0000000000..260fbb35ee --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/maya/load.json @@ -0,0 +1,18 @@ +{ + "colors": { + "model": [0.821, 0.518, 0.117], + "rig": [0.144, 0.443, 0.463], + "pointcache": [0.368, 0.821, 0.117], + "animation": [0.368, 0.821, 0.117], + "ass": [1.0, 0.332, 0.312], + "camera": [0.447, 0.312, 1.0], + "fbx": [1.0, 0.931, 0.312], + "mayaAscii": [0.312, 1.0, 0.747], + "setdress": [0.312, 1.0, 0.747], + "layout": [0.312, 1.0, 0.747], + "vdbcache": [0.312, 1.0, 0.428], + "vrayproxy": [0.258, 0.95, 0.541], + "yeticache": [0.2, 0.8, 0.3], + "yetiRig": [0, 0.8, 0.5] + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/publish.json b/pype/tools/config_setting/config/project_presets/plugins/maya/publish.json new file mode 100644 index 0000000000..2e2b3164f3 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/maya/publish.json @@ -0,0 +1,17 @@ +{ + "ValidateModelName": { + "enabled": false, + "material_file": "/path/to/shader_name_definition.txt", + "regex": "(.*)_(\\d)*_(?P.*)_(GEO)" + }, + "ValidateAssemblyName": { + "enabled": false + }, + "ValidateShaderName": { + "enabled": false, + "regex": "(?P.*)_(.*)_SHD" + }, + "ValidateMeshHasOverlappingUVs": { + "enabled": false + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json b/pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json new file mode 100644 index 0000000000..2872b783cb --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json @@ -0,0 +1,54 @@ +[{ + "tasks": ["lighting"], + + "current_context": [{ + "subset_name_filters": [".+[Mm]ain"], + "families": ["model"], + "repre_names": ["abc", "ma"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["animation", "pointcache"], + "repre_names": ["abc"], + "loaders": ["ReferenceLoader"] + },{ + "families": ["rendersetup"], + "repre_names": ["json"], + "loaders": ["RenderSetupLoader"] + }, { + "families": ["camera"], + "repre_names": ["abc"], + "loaders": ["ReferenceLoader"] + }], + + "linked_assets": [{ + "families": ["setdress"], + "repre_names": ["ma"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["ass"], + "repre_names": ["ass"], + "loaders":["assLoader"] + }] +}, { + "tasks": ["animation"], + + "current_context": [{ + "families": ["camera"], + "repre_names": ["abc", "ma"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["audio"], + "repre_names": ["wav"], + "loaders": ["RenderSetupLoader"] + }], + + "linked_assets": [{ + "families": ["setdress"], + "repre_names": ["proxy"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["rig"], + "repre_names": ["ass"], + "loaders": ["rigLoader"] + }] +}] diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/create.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/create.json new file mode 100644 index 0000000000..4deb0b4ad5 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/nuke/create.json @@ -0,0 +1,8 @@ +{ + "CreateWriteRender": { + "fpath_template": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" + }, + "CreateWritePrerender": { + "fpath_template": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/load.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/load.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/nuke/load.json @@ -0,0 +1 @@ +{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json new file mode 100644 index 0000000000..ab0d0e76a5 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json @@ -0,0 +1,48 @@ +{ + "ExtractThumbnail": { + "nodes": { + "Reformat": [ + ["type", "to format"], + ["format", "HD_1080"], + ["filter", "Lanczos6"], + ["black_outside", true], + ["pbb", false] + ] + } + }, + "ValidateNukeWriteKnobs": { + "enabled": false, + "knobs": { + "render": { + "review": true + } + } + }, + "ExtractReviewDataLut": { + "__documentation__": { + "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", + "enabled": "keep in on `false` if you want Nuke baking colorspace workflow applied else FFmpeg will convert imgsequence with baked LUT" + }, + "enabled": false + }, + "ExtractReviewDataMov": { + "__documentation__": { + "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", + "enabled": "keep in on `true` if you want Nuke baking colorspace workflow applied" + }, + "enabled": true, + "viewer_lut_raw": false + }, + "ExtractSlateFrame": { + "__documentation__": { + "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`" + }, + "viewer_lut_raw": false + }, + "NukeSubmitDeadline": { + "deadline_priority": 50, + "deadline_pool": "", + "deadline_pool_secondary": "", + "deadline_chunk_size": 1 + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json new file mode 100644 index 0000000000..d3613c929e --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json @@ -0,0 +1,11 @@ +[{ + "tasks": ["compositing"], + + "current_context": [{ + "families": ["render", "plate"], + "repre_names": ["exr" ,"dpx"], + "loaders": ["LoadSequence"] + }], + + "linked_assets": [] +}] diff --git a/pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json b/pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json new file mode 100644 index 0000000000..bd6a0dc1bd --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json @@ -0,0 +1,10 @@ +{ + "strict": { + "ValidateVersion": true, + "VersionUpWorkfile": true + }, + "benevolent": { + "ValidateVersion": false, + "VersionUpWorkfile": false + } +} \ No newline at end of file diff --git a/pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json b/pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json new file mode 100644 index 0000000000..8c4ad133f1 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json @@ -0,0 +1,8 @@ +{ + "CollectInstanceVersion": { + "enabled": false + }, + "ExtractReviewCutUpVideo": { + "tags_addition": [] + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json b/pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json new file mode 100644 index 0000000000..ecfff12db9 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json @@ -0,0 +1,17 @@ +{ + "ExtractReviewSP": { + "outputs": { + "h264": { + "input": [ + "-gamma 2.2" + ], + "output": [ + "-pix_fmt yuv420p", + "-crf 18" + ], + "tags": ["preview"], + "ext": "mov" + } + } + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/test/create.json b/pype/tools/config_setting/config/project_presets/plugins/test/create.json new file mode 100644 index 0000000000..fa0b2fc05f --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/test/create.json @@ -0,0 +1,8 @@ +{ + "MyTestCreator": { + "my_test_property": "B", + "active": false, + "new_property": "new", + "family": "new_family" + } +} diff --git a/pype/tools/config_setting/config/project_presets/plugins/test/publish.json b/pype/tools/config_setting/config/project_presets/plugins/test/publish.json new file mode 100644 index 0000000000..3180dd5d8a --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/plugins/test/publish.json @@ -0,0 +1,10 @@ +{ + "MyTestPlugin": { + "label": "loaded from preset", + "optional": true, + "families": ["changed", "by", "preset"] + }, + "MyTestRemovedPlugin": { + "enabled": false + } +} diff --git a/pype/tools/config_setting/config/project_presets/premiere/asset_default.json b/pype/tools/config_setting/config/project_presets/premiere/asset_default.json new file mode 100644 index 0000000000..84d2bde3d8 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/premiere/asset_default.json @@ -0,0 +1,5 @@ +{ + "frameStart": 1001, + "handleStart": 0, + "handleEnd": 0 +} diff --git a/pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json b/pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json new file mode 100644 index 0000000000..333c9cd70b --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json @@ -0,0 +1,21 @@ +{ + "defaultTasks": ["Layout", "Animation"], + "taskToSubsets": { + "Layout": ["reference", "audio"], + "Animation": ["audio"] + }, + "subsetToRepresentations": { + "reference": { + "preset": "h264", + "representation": "mp4" + }, + "thumbnail": { + "preset": "jpeg_thumb", + "representation": "jpg" + }, + "audio": { + "preset": "48khz", + "representation": "wav" + } + } +} diff --git a/pype/tools/config_setting/config/project_presets/unreal/project_setup.json b/pype/tools/config_setting/config/project_presets/unreal/project_setup.json new file mode 100644 index 0000000000..8a4dffc526 --- /dev/null +++ b/pype/tools/config_setting/config/project_presets/unreal/project_setup.json @@ -0,0 +1,4 @@ +{ + "dev_mode": false, + "install_unreal_python_engine": false +} diff --git a/pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json b/pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json @@ -0,0 +1 @@ +{} diff --git a/pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json b/pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json new file mode 100644 index 0000000000..1ba8e9b511 --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json @@ -0,0 +1,5 @@ +{ + "TestAction": { + "ignore_me": true + } +} diff --git a/pype/tools/config_setting/config/studio_presets/global/applications.json b/pype/tools/config_setting/config/studio_presets/global/applications.json new file mode 100644 index 0000000000..35e399444c --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/global/applications.json @@ -0,0 +1,39 @@ +{ + "blender_2.80": true, + "blender_2.81": true, + "blender_2.82": true, + "blender_2.83": true, + "harmony_17": true, + "houdini_16": true, + "houdini_17": true, + "houdini_18": true, + "maya_2016": true, + "maya_2017": true, + "maya_2018": true, + "maya_2019": true, + "maya_2020": true, + "nuke_10.0": true, + "nuke_11.0": true, + "nuke_11.2": true, + "nuke_11.3": true, + "nuke_12.0": true, + "nukex_10.0": true, + "nukex_11.0": true, + "nukex_11.2": true, + "nukex_11.3": true, + "nukex_12.0": true, + "nukestudio_10.0": true, + "nukestudio_11.0": true, + "nukestudio_11.2": true, + "nukestudio_11.3": true, + "nukestudio_12.0": true, + "photoshop_2020": true, + "premiere_2019": true, + "premiere_2020": true, + "python_2": true, + "python_3": true, + "resolve_16": true, + "shell": true, + "storyboardpro_7": true, + "unreal_4.21": true +} diff --git a/pype/tools/config_setting/config/studio_presets/global/es/applications.json b/pype/tools/config_setting/config/studio_presets/global/es/applications.json new file mode 100644 index 0000000000..35e399444c --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/global/es/applications.json @@ -0,0 +1,39 @@ +{ + "blender_2.80": true, + "blender_2.81": true, + "blender_2.82": true, + "blender_2.83": true, + "harmony_17": true, + "houdini_16": true, + "houdini_17": true, + "houdini_18": true, + "maya_2016": true, + "maya_2017": true, + "maya_2018": true, + "maya_2019": true, + "maya_2020": true, + "nuke_10.0": true, + "nuke_11.0": true, + "nuke_11.2": true, + "nuke_11.3": true, + "nuke_12.0": true, + "nukex_10.0": true, + "nukex_11.0": true, + "nukex_11.2": true, + "nukex_11.3": true, + "nukex_12.0": true, + "nukestudio_10.0": true, + "nukestudio_11.0": true, + "nukestudio_11.2": true, + "nukestudio_11.3": true, + "nukestudio_12.0": true, + "photoshop_2020": true, + "premiere_2019": true, + "premiere_2020": true, + "python_2": true, + "python_3": true, + "resolve_16": true, + "shell": true, + "storyboardpro_7": true, + "unreal_4.21": true +} diff --git a/pype/tools/config_setting/config/studio_presets/global/intents.json b/pype/tools/config_setting/config/studio_presets/global/intents.json new file mode 100644 index 0000000000..c853e27b7f --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/global/intents.json @@ -0,0 +1,9 @@ +{ + "default": "wip", + "items": { + "": "", + "wip": "WIP", + "test": "TEST", + "final": "FINAL" + } +} diff --git a/pype/tools/config_setting/config/studio_presets/global/tray_items.json b/pype/tools/config_setting/config/studio_presets/global/tray_items.json new file mode 100644 index 0000000000..a42bf67c38 --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/global/tray_items.json @@ -0,0 +1,25 @@ +{ + "usage": { + "User settings": false, + "Ftrack": false, + "Muster": false, + "Avalon": true, + "Clockify": false, + "Standalone Publish": true, + "Logging": true, + "Idle Manager": true, + "Timers Manager": true, + "Rest Api": true, + "Premiere Communicator": true + }, + "attributes": { + "Rest Api": { + "default_port": 8021, + "exclude_ports": [] + }, + "Timers Manager": { + "full_time": 15, + "message_time": 0.5 + } + } +} diff --git a/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json b/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json new file mode 100644 index 0000000000..4edab9077d --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json @@ -0,0 +1,19 @@ +{ + "3delight": 41, + "arnold": 46, + "arnold_sf": 57, + "gelato": 30, + "harware": 3, + "krakatoa": 51, + "file_layers": 7, + "mentalray": 2, + "mentalray_sf": 6, + "redshift": 55, + "renderman": 29, + "software": 1, + "software_sf": 5, + "turtle": 10, + "vector": 4, + "vray": 37, + "ffmpeg": 48 +} diff --git a/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json b/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json new file mode 100644 index 0000000000..096964b5b8 --- /dev/null +++ b/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json @@ -0,0 +1,153 @@ +{ + "key": "applications", + "type": "dict-expanding", + "label": "Applications", + "children": [ + { + "type": "dict-form", + "children": [ + { + "key": "blender_2.80", + "type": "boolean", + "label": "Blender 2.80" + }, { + "key": "blender_2.81", + "type": "boolean", + "label": "Blender 2.81" + }, { + "key": "blender_2.82", + "type": "boolean", + "label": "Blender 2.82" + }, { + "key": "blender_2.83", + "type": "boolean", + "label": "Blender 2.83" + }, { + "key": "celaction_local", + "type": "boolean", + "label": "Celaction Local" + }, { + "key": "celaction_remote", + "type": "boolean", + "label": "Celaction Remote" + }, { + "key": "harmony_17", + "type": "boolean", + "label": "Harmony 17" + }, { + "key": "houdini_16", + "type": "boolean", + "label": "Houdini 16" + }, { + "key": "houdini_17", + "type": "boolean", + "label": "Houdini 17" + }, { + "key": "houdini_18", + "type": "boolean", + "label": "Houdini 18" + }, { + "key": "maya_2017", + "type": "boolean", + "label": "Autodest Maya 2017" + }, { + "key": "maya_2018", + "type": "boolean", + "label": "Autodest Maya 2018" + }, { + "key": "maya_2019", + "type": "boolean", + "label": "Autodest Maya 2019" + }, { + "key": "maya_2020", + "type": "boolean", + "label": "Autodest Maya 2020" + }, { + "key": "nuke_10.0", + "type": "boolean", + "label": "Nuke 10.0" + }, { + "key": "nuke_11.2", + "type": "boolean", + "label": "Nuke 11.2" + }, { + "key": "nuke_11.3", + "type": "boolean", + "label": "Nuke 11.3" + }, { + "key": "nuke_12.0", + "type": "boolean", + "label": "Nuke 12.0" + }, { + "key": "nukex_10.0", + "type": "boolean", + "label": "NukeX 10.0" + }, { + "key": "nukex_11.2", + "type": "boolean", + "label": "NukeX 11.2" + }, { + "key": "nukex_11.3", + "type": "boolean", + "label": "NukeX 11.3" + }, { + "key": "nukex_12.0", + "type": "boolean", + "label": "NukeX 12.0" + }, { + "key": "nukestudio_10.0", + "type": "boolean", + "label": "NukeStudio 10.0" + }, { + "key": "nukestudio_11.2", + "type": "boolean", + "label": "NukeStudio 11.2" + }, { + "key": "nukestudio_11.3", + "type": "boolean", + "label": "NukeStudio 11.3" + }, { + "key": "nukestudio_12.0", + "type": "boolean", + "label": "NukeStudio 12.0" + }, { + "key": "houdini_16.5", + "type": "boolean", + "label": "Houdini 16.5" + }, { + "key": "houdini_17", + "type": "boolean", + "label": "Houdini 17" + }, { + "key": "houdini_18", + "type": "boolean", + "label": "Houdini 18" + }, { + "key": "premiere_2019", + "type": "boolean", + "label": "Premiere 2019" + }, { + "key": "premiere_2020", + "type": "boolean", + "label": "Premiere 2020" + }, { + "key": "premiere_2020", + "type": "boolean", + "label": "Premiere 2020" + }, { + "key": "resolve_16", + "type": "boolean", + "label": "BM DaVinci Resolve 16" + }, { + "key": "storyboardpro_7", + "type": "boolean", + "label": "Storyboard Pro 7" + }, { + "key": "unreal_4.24", + "type": "boolean", + "label": "Unreal Editor 4.24" + } + ] + } + ] +} diff --git a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json new file mode 100644 index 0000000000..febf84eb4a --- /dev/null +++ b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json @@ -0,0 +1,30 @@ +{ + "key": "ftrack", + "type": "dict-expanding", + "label": "Ftrack", + "children": [ + { + "key": "status_update", + "type": "dict-expanding", + "label": "Status updates", + "children": [ + { + "key": "Ready", + "type": "text-singleline", + "label": "Ready" + } + ] + }, { + "key": "status_version_to_task", + "type": "dict-expanding", + "label": "Version status to Task status", + "children": [ + { + "key": "in progress", + "type": "text-singleline", + "label": "In Progress" + } + ] + } + ] +} diff --git a/pype/tools/config_setting/config_gui_schema/project_gui_schema.json b/pype/tools/config_setting/config_gui_schema/project_gui_schema.json new file mode 100644 index 0000000000..38c07ec33d --- /dev/null +++ b/pype/tools/config_setting/config_gui_schema/project_gui_schema.json @@ -0,0 +1,13 @@ +{ + "key": "studio", + "type": "dict-invisible", + "label": "Studio", + "children": [ + { + "type": "schema", + "children": [ + "ftrack_projects_gui_schema" + ] + } + ] +} diff --git a/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json new file mode 100644 index 0000000000..7d902bb8db --- /dev/null +++ b/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json @@ -0,0 +1,23 @@ +{ + "key": "studio", + "type": "dict-invisible", + "label": "Studio", + "children": [ + { + "type": "schema", + "children": [ + "applications_gui_schema", + "tools_gui_schema" + ] + }, { + "key": "muster", + "type": "dict-invisible", + "children": [{ + "key": "templates_mapping", + "label": "Muster", + "type": "dict-modifiable", + "object_type": "int" + }] + } + ] +} diff --git a/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json b/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json new file mode 100644 index 0000000000..2f46ef0ec5 --- /dev/null +++ b/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json @@ -0,0 +1,29 @@ +{ + "key": "tools", + "type": "dict-expanding", + "label": "Tools", + "children": [ + { + "type": "dict-form", + "children": [ + { + "key": "mtoa_3.0.1", + "type": "boolean", + "label": "Arnold Maya 3.0.1" + }, { + "key": "mtoa_3.1.1", + "type": "boolean", + "label": "Arnold Maya 3.1.1" + }, { + "key": "mtoa_3.2.0", + "type": "boolean", + "label": "Arnold Maya 3.2.0" + }, { + "key": "yeti_2.1.2", + "type": "boolean", + "label": "Yeti 2.1.2" + } + ] + } + ] +} diff --git a/pype/tools/config_setting/interface.py b/pype/tools/config_setting/interface.py new file mode 100644 index 0000000000..e95f3f5fe3 --- /dev/null +++ b/pype/tools/config_setting/interface.py @@ -0,0 +1,49 @@ +import os +import sys +os.environ["PYPE_CONFIG"] = ( + "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pype-config" +) +os.environ["AVALON_MONGO"] = "mongodb://localhost:2707" +sys_paths = ( + "C:/Users/Public/pype_env2/Lib/site-packages", + "C:/Users/jakub.trllo/Desktop/pype/pype-setup", + "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pype", + "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/avalon-core", + "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pyblish-base", + "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pyblish-lite", + "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pype-config" +) +for path in sys_paths: + sys.path.append(path) + +from widgets import main +import style +from Qt import QtWidgets, QtGui + + +class MyApp(QtWidgets.QApplication): + def __init__(self, *args, **kwargs): + super(MyApp, self).__init__(*args, **kwargs) + stylesheet = style.load_stylesheet() + self.setStyleSheet(stylesheet) + self.setWindowIcon(QtGui.QIcon(style.app_icon_path())) + + +if __name__ == "__main__": + app = MyApp(sys.argv) + + # main_widget = QtWidgets.QWidget() + # main_widget.setWindowIcon(QtGui.QIcon(style.app_icon_path())) + # + # layout = QtWidgets.QVBoxLayout(main_widget) + # + # widget = main.MainWidget(main_widget) + + # layout.addWidget(widget) + # main_widget.setLayout(layout) + # main_widget.show() + + widget = main.MainWidget() + widget.show() + + sys.exit(app.exec_()) diff --git a/pype/tools/config_setting/style/__init__.py b/pype/tools/config_setting/style/__init__.py new file mode 100644 index 0000000000..a8f202d97b --- /dev/null +++ b/pype/tools/config_setting/style/__init__.py @@ -0,0 +1,12 @@ +import os + + +def load_stylesheet(): + style_path = os.path.join(os.path.dirname(__file__), "style.css") + with open(style_path, "r") as style_file: + stylesheet = style_file.read() + return stylesheet + + +def app_icon_path(): + return os.path.join(os.path.dirname(__file__), "pype_icon.png") diff --git a/pype/tools/config_setting/style/pype_icon.png b/pype/tools/config_setting/style/pype_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..bfacf6eeedc753db0d77e661843a78b0eb13ce38 GIT binary patch literal 3793 zcmai1XH=6*x6Ye{CK8MY2ok{)4xlKAASI|oK|&G1NG}mf1QaAla)1M9Vx@*AARG=| zP(e_zUxodrEz3*Bxd-m+vduBh+o{4ukPEgpO zz5xbD!#x!nHCEY!;)_rS{8J6d7GObJpmL-tP0Zl4m(l^NyV<{AlB#8n@>Oo3}NptV#uE zJ|o&Vn3{fQzV*eT>weC;f2IfKUk*oieHjXWt$u9R&iap152)_*D{Q9Z=F!{JIe)SO z%hR$_iz|#7@mk8$pHYcwq2D{bGrQIE=_ z%HJG!GSG{;`1R9ojdwK+=dxS9yRD=@oIg!qCpD2PwV&R3%+AYq-B-Rk#EpqRn42$e zH>EOb!%a~%M3rp~*r<3t>D^S3rWvB9_(;Q~?$xZM(Ovs0MtPn)j$hk-{6skM;4UMb zKV5Cp+5JBoWB+s3dgcu6mFk83jh`Q>2K%`5nIv^tH|c2{{two-)KQXy*m^}ZwzhO} z%KAMn&oAq#2$dI#=U!LuIbuc3tlO`0ov#$=N&j&1zR#|usfdEl(Xv&o9)7Q9wlB0w z%Em%{ivvE5@OL~0hayL@^9qN-46y4z6nW3;4;XCYqP@*w*T}r-!K)%N&5!#{x9*){ zhzXWASaS!qGo?GY?l$su#|0v%Q0;A5E;A>?*mVC%wJDSL=4$tivf}O;AJ@fXsLA== zEOKfsx|h|o`;*Y?jJ=BV+1DNTEg$G>Jk1H*o>$A!jmun%;blqQN=!%I)jzUkms>fp zv0Vq3qr0T+)3yK0Cug|}C!j?6ZI{>BHdqu8$!bfOwI$r&7OTOiU<}94bfcG`6vVJv zxW95=t({(PROyoy zmEu2x|DjmG9bO;u*B6;_lEHeI0b@M^LB{T+rwkh{HhHXD-M&0Q%aJluxD^0*=x^lZ zVPe>A3EYyi#IYPY@i|(&iE@>cojpdA3M=0G+f)}(&^0+{ILA7mgDX?ifc8`jm%MZrr3+I7ne?oFo!pC3p>e4AQQ5%$dRX0Q zDvz@Blmiu6I)2b38^H%lO$qNl8<(~FIZO1vNXqU?M0q(f=?llI@4fV|+krdx$Q<62 zwoi~4<(Iz|Q=_5*1+h;uw#~B+?7)>?WYVA3IC0A7SQ-m{FELP1jafHaF6c2(qJ_3j z&N-K0StGJ`?9SV4d}r^ z4_ldzCUok@j0sxQ32JjCkonCfpzda3wVq8Tu?^;habD(d;>s0$oWBZ_-rL|f&suE| z#sygbVLpOwfji?3#K|vgWsbF@Q(0l|r0f72!ZBczHJ>G<2Z6~E263pnx3F5YiF;rV zH)Ect6YyU@7~05Gz6DxivUZL$t89amWaiyw(5JyEm#EF!z-WCz3hM4TKPr8ENm;lJZOUK(TQ+b6EU1GWUTb_^}rU5-W?M%i0#!NwN<)U4-ZBIhkHHZDu zyl@@67el~bUu@(-@uDwu>B&+d-6m3}@bzV6S*;lGtAU`i zJ$cHm=J3u&RwC<;#gRU6lZnG?|zw#X3(val5R>Nk@EOgPg9i1=CLe{XNtf z1j&QkVpeSZ5s+-fin_=c1Rsz3at*8Hw6v*HjRO$q2X-@a&8%}j{V;n=-DUz_efD%N zRA>2%VX39loVUG~luQA8{aL1nnDFrWMxnm*_EN=YEjDLxEFV^i13^C=sojV0C6bTM zS{<&FKZNP7S<%g%_~~c?6Xejd_B`C?uoCzaF;({R_HYr`qoOi$@4jHbxL;WEVqa?WX%sA)p^LJ7yVkG78CtK> zrC*~p7}VI8Z3&$`v_nCok=`B)0^a*FILT3PIIZ9m)5DRazfS;K{Rf?zl?O_~|F7T^ z|BMO{wjt7jvi&jSdG#G6>fXWK?!S$)>=H^Imkr!GN|Wr?k{Lq!BJ=irs&2g8Q84%y ze@sPC%L%b&sU=_w4{uxR{rS7VLC`DJ(3=8X-HU6;<&T{geBY6WiFCqW&*YC;a2k6C zaw5|p^MRcl8fS@Z&=vA+^42o4vyS0G38778fA+jBw z&f&JAlMDspaO52}+u)SVyxK-xn-?%H!pGLxF|A8c&8G~mSXQ`oxS#3b^9SyudzAYp+{&24XX|s-CR!gj&4W0 zJiL-Nu7Hn?Kv53=DqQKt-&?=u3z=%{@~!{`lTM`Sh!TWxYI&&OB&H`wlP!K*Fnezg znOedfcz+cm#=HMLPr%!Q>%u*b8V?g5d6blGn8;iw?h7Og<}p3I81Xg?c_&wUxXQAp z{SN~E!Iv>akVAcN1Q3!ArIz*npD=A1=b45r>@AI{n2r5K_zs=cJV;(heg&ilG=MqM zbFi?J;nm#Z53;9$d-MKO4t(iX<G)L3gY|#He!w|;Fp?XY~aoINns|b10Kzw&Kh|%eN&b ziL-@qNbT4S>P2k{D-1=L=DW!`nZQGQ%GwTYVo+7abkR#q!7>xD$ik;F!hd;6fVT#2 b;3u>qRjE!lxug$XMKJrL$8D;P_+R@UX<7IA literal 0 HcmV?d00001 diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/style/style.css new file mode 100644 index 0000000000..f559a4c3b3 --- /dev/null +++ b/pype/tools/config_setting/style/style.css @@ -0,0 +1,90 @@ +QWidget { + color: #bfccd6; + background-color: #293742; + font-size: 12px; +} + +QCheckBox::indicator { +} +QCheckBox::indicator:focus { + color: #ff0000; +} + +QLineEdit, QSpinBox, QDoubleSpinBox, QPlainTextEdit { + border: 1px solid #aaaaaa; + border-radius: 3px; +} + +QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QPlainTextEdit:focus { + border: 1px solid #ffffff; +} + +QLabel[state="original"] {} + +QLabel[state="modified"] { + color: #137cbd; +} + +QLabel[state="overriden-modified"] { + color: #00b386; +} + +QLabel[state="overriden"] { + color: #ff8c1a; +} + +QWidget[input-state="original"] {} +QWidget[input-state="modified"] { + border-color: #137cbd; +} + +QWidget[input-state="overriden-modified"] { + border-color: #00b386; +} + +QWidget[input-state="overriden"] { + border-color: #ff8c1a; +} + +QPushButton[btn-type="text-list"] { + border: 1px solid #bfccd6; + border-radius: 10px; +} + +QPushButton[btn-type="text-list"]:hover { + border-color: #137cbd; + color: #137cbd; +} + +QPushButton[btn-type="expand-toggle"] { + background: transparent; +} + +#DictKey[state="original"] {} + +#DictKey[state="modified"] { + border-color: #137cbd; +} + +#DictKey[state="overriden"] { + border-color: #00f; +} +#DictKey[state="overriden-modified"] { + border-color: #0f0; +} + +#ExpandLabel { + background: transparent; +} + +#DictExpandWidget, #ModifiableDict, #ExpandingWidget { + border: 1px solid #455c6e; + border-radius: 3px; + background: #1d272f; +} + +#TextListSubWidget { + border: 1px solid #455c6e; + border-radius: 3px; + background: #1d272f; +} diff --git a/pype/tools/config_setting/widgets/__init__.py b/pype/tools/config_setting/widgets/__init__.py new file mode 100644 index 0000000000..b295759a36 --- /dev/null +++ b/pype/tools/config_setting/widgets/__init__.py @@ -0,0 +1,6 @@ +from .lib import CustomNone, NOT_SET + + +from .base import * +from .main import * +from .inputs import * diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py new file mode 100644 index 0000000000..0cc64a66de --- /dev/null +++ b/pype/tools/config_setting/widgets/base.py @@ -0,0 +1,282 @@ +import os +import json +from Qt import QtWidgets, QtCore, QtGui +from . import config +from .lib import NOT_SET +from avalon import io + + +class TypeToKlass: + types = {} + + +class ClickableWidget(QtWidgets.QLabel): + clicked = QtCore.Signal() + + def __init__(self, *args, **kwargs): + super(ClickableWidget, self).__init__(*args, **kwargs) + self.setObjectName("ExpandLabel") + + def mouseReleaseEvent(self, event): + if event.button() == QtCore.Qt.LeftButton: + self.clicked.emit() + super(ClickableWidget, self).mouseReleaseEvent(event) + + +class PypeConfigurationWidget: + is_category = False + is_overriden = False + is_modified = False + + def config_value(self): + raise NotImplementedError( + "Method `config_value` is not implemented for `{}`.".format( + self.__class__.__name__ + ) + ) + + def value_from_values(self, values, keys=None): + if not values: + return NOT_SET + + if keys is None: + keys = self.keys + + value = values + for key in keys: + if not isinstance(value, dict): + raise TypeError( + "Expected dictionary got {}.".format(str(type(value))) + ) + + if key not in value: + return NOT_SET + value = value[key] + return value + + def add_children_gui(self, child_configuration, values): + raise NotImplementedError(( + "Method `add_children_gui` is not implemented for `{}`." + ).format(self.__class__.__name__)) + + +class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): + config_dir = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + "config_gui_schema" + ) + is_overidable = False + + def __init__(self, parent=None): + super(StudioWidget, self).__init__(parent) + + self.input_fields = [] + + scroll_widget = QtWidgets.QScrollArea(self) + content_widget = QtWidgets.QWidget(scroll_widget) + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(0, 0, 0, 0) + content_layout.setSpacing(0) + content_layout.setAlignment(QtCore.Qt.AlignTop) + content_widget.setLayout(content_layout) + + # scroll_widget.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + # scroll_widget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) + scroll_widget.setWidgetResizable(True) + scroll_widget.setWidget(content_widget) + + self.scroll_widget = scroll_widget + self.content_layout = content_layout + self.content_widget = content_widget + + values = {"studio": config.studio_presets()} + schema = config.gui_schema("studio_gui_schema") + self.keys = schema.get("keys", []) + self.add_children_gui(schema, values) + + footer_widget = QtWidgets.QWidget() + footer_layout = QtWidgets.QHBoxLayout(footer_widget) + + btn = QtWidgets.QPushButton("Finish") + spacer_widget = QtWidgets.QWidget() + footer_layout.addWidget(spacer_widget, 1) + footer_layout.addWidget(btn, 0) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + self.setLayout(layout) + + layout.addWidget(scroll_widget, 1) + layout.addWidget(footer_widget, 0) + + btn.clicked.connect(self.___finish) + + def ___finish(self): + output = {} + for item in self.input_fields: + output.update(item.config_value()) + + for key in reversed(self.keys): + _output = {key: output} + output = _output + + print(json.dumps(output, indent=4)) + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + klass = TypeToKlass.types.get(item_type) + item = klass( + child_configuration, values, self.keys, self + ) + self.input_fields.append(item) + self.content_layout.addWidget(item) + + +class ProjectListWidget(QtWidgets.QWidget): + default = "< Default >" + + def __init__(self, parent=None): + super(ProjectListWidget, self).__init__(parent) + + label = QtWidgets.QLabel("Project") + project_list = QtWidgets.QListView(self) + project_list.setModel(QtGui.QStandardItemModel()) + + layout = QtWidgets.QVBoxLayout(self) + # content_margin = 5 + # layout.setContentsMargins( + # content_margin, + # content_margin, + # content_margin, + # content_margin + # ) + # layout.setSpacing(3) + layout.addWidget(label, 0) + layout.addWidget(project_list, 1) + + self.project_list = project_list + + self.refresh() + + def project_name(self): + current_selection = self.project_list.currentText() + if current_selection == self.default: + return None + return current_selection + + def refresh(self): + selected_project = None + for index in self.project_list.selectedIndexes(): + selected_project = index.data(QtCore.Qt.DisplayRole) + break + + model = self.project_list.model() + model.clear() + items = [self.default] + io.install() + for project_doc in tuple(io.projects()): + print(project_doc["name"]) + items.append(project_doc["name"]) + + for item in items: + model.appendRow(QtGui.QStandardItem(item)) + + if not selected_project: + selected_project = self.default + + found_items = model.findItems(selected_project) + if found_items: + index = model.indexFromItem(found_items[0]) + c = QtCore.QItemSelectionModel.SelectionFlag.SelectCurrent + self.project_list.selectionModel().select( + index, c + ) + # self.project_list.selectionModel().setCurrentIndex( + # index, c + # ) + + + +class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): + config_dir = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + "config_gui_schema" + ) + is_overidable = True + + def __init__(self, parent=None): + super(ProjectWidget, self).__init__(parent) + + self.input_fields = [] + + scroll_widget = QtWidgets.QScrollArea(self) + content_widget = QtWidgets.QWidget(scroll_widget) + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(0, 0, 0, 0) + content_layout.setSpacing(0) + content_layout.setAlignment(QtCore.Qt.AlignTop) + content_widget.setLayout(content_layout) + + scroll_widget.setWidgetResizable(True) + scroll_widget.setWidget(content_widget) + + project_list_widget = ProjectListWidget() + content_layout.addWidget(project_list_widget) + + self.project_list_widget = project_list_widget + self.scroll_widget = scroll_widget + self.content_layout = content_layout + self.content_widget = content_widget + + values = config.project_presets() + schema = config.gui_schema("project_gui_schema") + self.keys = schema.get("keys", []) + self.add_children_gui(schema, values) + + footer_widget = QtWidgets.QWidget() + footer_layout = QtWidgets.QHBoxLayout(footer_widget) + + btn = QtWidgets.QPushButton("Finish") + spacer_widget = QtWidgets.QWidget() + footer_layout.addWidget(spacer_widget, 1) + footer_layout.addWidget(btn, 0) + + presets_widget = QtWidgets.QWidget() + presets_layout = QtWidgets.QVBoxLayout(presets_widget) + presets_layout.setContentsMargins(0, 0, 0, 0) + presets_layout.setSpacing(0) + + presets_layout.addWidget(scroll_widget, 1) + presets_layout.addWidget(footer_widget, 0) + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + self.setLayout(layout) + + layout.addWidget(project_list_widget, 0) + layout.addWidget(presets_widget, 1) + + btn.clicked.connect(self.___finish) + + def ___finish(self): + output = {} + for item in self.input_fields: + output.update(item.config_value()) + + for key in reversed(self.keys): + _output = {key: output} + output = _output + + print(json.dumps(output, indent=4)) + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + klass = TypeToKlass.types.get(item_type) + + item = klass( + child_configuration, values, self.keys, self + ) + self.input_fields.append(item) + self.content_layout.addWidget(item) diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py new file mode 100644 index 0000000000..335299cb2f --- /dev/null +++ b/pype/tools/config_setting/widgets/config.py @@ -0,0 +1,236 @@ +import os +import json +import logging +import copy + +# DEBUG SETUP +os.environ["AVALON_PROJECT"] = "kuba_each_case" +os.environ["PYPE_PROJECT_CONFIGS"] = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + "config", + "project_overrides" +) +# + +log = logging.getLogger(__name__) + +config_path = os.path.dirname(os.path.dirname(__file__)) +studio_presets_path = os.path.normpath( + os.path.join(config_path, "config", "studio_presets") +) +project_presets_path = os.path.normpath( + os.path.join(config_path, "config", "project_presets") +) +first_run = False + +OVERRIDE_KEY = "__overriden__" +POP_KEY = "__popkey__" + + +def load_json(fpath): + # Load json data + with open(fpath, "r") as opened_file: + lines = opened_file.read().splitlines() + + # prepare json string + standard_json = "" + for line in lines: + # Remove all whitespace on both sides + line = line.strip() + + # Skip blank lines + if len(line) == 0: + continue + + standard_json += line + + # Check if has extra commas + extra_comma = False + if ",]" in standard_json or ",}" in standard_json: + extra_comma = True + standard_json = standard_json.replace(",]", "]") + standard_json = standard_json.replace(",}", "}") + + global first_run + if extra_comma and first_run: + log.error("Extra comma in json file: \"{}\"".format(fpath)) + + # return empty dict if file is empty + if standard_json == "": + if first_run: + log.error("Empty json file: \"{}\"".format(fpath)) + return {} + + # Try to parse string + try: + return json.loads(standard_json) + + except json.decoder.JSONDecodeError: + # Return empty dict if it is first time that decode error happened + if not first_run: + return {} + + # Repreduce the exact same exception but traceback contains better + # information about position of error in the loaded json + try: + with open(fpath, "r") as opened_file: + json.load(opened_file) + + except json.decoder.JSONDecodeError: + log.warning( + "File has invalid json format \"{}\"".format(fpath), + exc_info=True + ) + + return {} + + +def subkey_merge(_dict, value, keys, with_metadata=False): + key = keys.pop(0) + if not keys: + if with_metadata: + _dict[key] = {"type": "file", "value": value} + else: + _dict[key] = value + return _dict + + if key not in _dict: + if with_metadata: + _dict[key] = {"type": "folder", "value": {}} + else: + _dict[key] = {} + + if with_metadata: + sub_dict = _dict[key]["value"] + else: + sub_dict = _dict[key] + + _value = subkey_merge(sub_dict, value, keys, with_metadata) + if with_metadata: + _dict[key]["value"] = _value + else: + _dict[key] = _value + return _dict + + +def load_jsons_from_dir(path, *args, **kwargs): + output = {} + + path = os.path.normpath(path) + if not os.path.exists(path): + # TODO warning + return output + + with_metadata = kwargs.get("with_metadata") + sub_keys = list(kwargs.pop("subkeys", args)) + for sub_key in tuple(sub_keys): + _path = os.path.join(path, sub_key) + if not os.path.exists(_path): + break + + path = _path + sub_keys.pop(0) + + base_len = len(path) + 1 + ext_len = len(".json") + + for base, _directories, filenames in os.walk(path): + for filename in filenames: + basename, ext = os.path.splitext(filename) + if ext == ".json": + full_path = os.path.join(base, filename) + value = load_json(full_path) + + # dict_path = os.path.join(base[base_len:], basename) + # dict_keys = dict_path.split(os.path.sep) + dict_keys = base[base_len:].split(os.path.sep) + [basename] + output = subkey_merge(output, value, dict_keys, with_metadata) + + for sub_key in sub_keys: + output = output[sub_key] + return output + + +def studio_presets(*args, **kwargs): + return load_jsons_from_dir(studio_presets_path, *args, **kwargs) + + +def global_project_presets(**kwargs): + return load_jsons_from_dir(project_presets_path, **kwargs) + + +def studio_presets_with_metadata(*args, **kwargs): + return load_jsons_from_dir(studio_presets_path, *args, **kwargs) + + +def global_project_presets_with_metadata(**kwargs): + return load_jsons_from_dir(project_presets_path, **kwargs) + + +def project_preset_overrides(project_name, **kwargs): + project_configs_path = os.environ.get("PYPE_PROJECT_CONFIGS") + if project_name and project_configs_path: + return load_jsons_from_dir( + os.path.join(project_configs_path, project_name), + **kwargs + ) + return {} + + +def merge_overrides(global_dict, override_dict): + if OVERRIDE_KEY in override_dict: + _override = override_dict.pop(OVERRIDE_KEY) + if _override: + return override_dict + + for key, value in override_dict.items(): + if value == POP_KEY: + global_dict.pop(key) + + elif key == OVERRIDE_KEY: + continue + + elif key not in global_dict: + global_dict[key] = value + + elif isinstance(value, dict) and isinstance(global_dict[key], dict): + global_dict[key] = merge_overrides(global_dict[key], value) + + else: + global_dict[key] = value + return global_dict + + +def apply_overrides(global_presets, project_overrides): + global_presets = copy.deepcopy(global_presets) + if not project_overrides: + return global_presets + return merge_overrides(global_presets, project_overrides) + + +def project_presets(project_name=None, **kwargs): + global_presets = global_project_presets(**kwargs) + + if not project_name: + project_name = os.environ.get("AVALON_PROJECT") + project_overrides = project_preset_overrides(project_name, **kwargs) + + return apply_overrides(global_presets, project_overrides) + + +def gui_schema(schema_name): + filename = schema_name + ".json" + schema_folder = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + "config_gui_schema", + filename + ) + with open(schema_folder, "r") as json_stream: + schema = json.load(json_stream) + return schema + + +p1 = studio_presets(with_metadata=True) +p2 = studio_presets(with_metadata=False) +print(json.dumps(p1, indent=4)) +print(json.dumps(p2, indent=4)) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py new file mode 100644 index 0000000000..1ddc27278d --- /dev/null +++ b/pype/tools/config_setting/widgets/inputs.py @@ -0,0 +1,1346 @@ +from Qt import QtWidgets, QtCore, QtGui +from . import config +from .base import PypeConfigurationWidget, TypeToKlass, ClickableWidget +from .lib import NOT_SET, AS_WIDGET + +import json + + +class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._as_widget = values is AS_WIDGET + self._parent = parent + + super(BooleanWidget, self).__init__(parent) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + self.checkbox = QtWidgets.QCheckBox() + self.checkbox.setAttribute(QtCore.Qt.WA_StyledBackground) + if not self._as_widget and not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + label_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + layout.addWidget(label_widget) + + layout.addWidget(self.checkbox) + + if not self._as_widget: + self.label_widget = label_widget + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + self.checkbox.setChecked(value) + + self.origin_value = self.item_value() + + self.checkbox.stateChanged.connect(self._on_value_change) + + def set_value(self, value, origin_value=False): + self.checkbox.setChecked(value) + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.origin_value) + + def clear_value(self): + self.reset_value() + + @property + def is_overidable(self): + return self._parent.is_overidable + + def _on_value_change(self, value=None): + self.is_modified = self.item_value() != self.origin_value + self.is_overriden = True + + self._update_style() + + self.value_changed.emit() + + def _update_style(self): + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + if not self._as_widget: + property_name = "input-state" + else: + property_name = "state" + + self.label_widget.setProperty(property_name, state) + self.label_widget.style().polish(self.label_widget) + + def item_value(self): + return self.checkbox.isChecked() + + def config_value(self): + return {self.key: self.item_value()} + + +class ModifiedIntSpinBox(QtWidgets.QSpinBox): + def __init__(self, *args, **kwargs): + super(ModifiedIntSpinBox, self).__init__(*args, **kwargs) + self.setFocusPolicy(QtCore.Qt.StrongFocus) + + def wheelEvent(self, event): + if self.hasFocus(): + super(ModifiedIntSpinBox, self).wheelEvent(event) + else: + event.ignore() + + +class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): + def __init__(self, *args, **kwargs): + super(ModifiedFloatSpinBox, self).__init__(*args, **kwargs) + self.setFocusPolicy(QtCore.Qt.StrongFocus) + + def wheelEvent(self, event): + if self.hasFocus(): + super(ModifiedFloatSpinBox, self).wheelEvent(event) + else: + event.ignore() + + +class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + self._as_widget = values is AS_WIDGET + + super(IntegerWidget, self).__init__(parent) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + self.int_input = ModifiedIntSpinBox() + + if not self._as_widget and not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget) + layout.addWidget(self.int_input) + + if not self._as_widget: + self.label_widget = label_widget + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + self.int_input.setValue(value) + + self.origin_value = self.item_value() + + self.int_input.valueChanged.connect(self._on_value_change) + + @property + def is_overidable(self): + return self._parent.is_overidable + + def set_value(self, value, origin_value=False): + self.int_input.setValue(value) + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def clear_value(self): + self.set_value(0) + + def reset_value(self): + self.set_value(self.origin_value) + + def _on_value_change(self, value=None): + self.is_modified = self.item_value() != self.origin_value + self.is_overriden = True + + self._update_style() + + self.value_changed.emit() + + def _update_style(self): + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + if self._as_widget: + property_name = "input-state" + widget = self.int_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) + + def item_value(self): + return self.int_input.value() + + def config_value(self): + return {self.key: self.item_value()} + + +class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + self._as_widget = values is AS_WIDGET + + super(FloatWidget, self).__init__(parent) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + self.float_input = ModifiedFloatSpinBox() + + decimals = input_data.get("decimals", 5) + maximum = input_data.get("maximum") + minimum = input_data.get("minimum") + + self.float_input.setDecimals(decimals) + if maximum is not None: + self.float_input.setMaximum(float(maximum)) + if minimum is not None: + self.float_input.setMinimum(float(minimum)) + + if not self._as_widget and not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget) + layout.addWidget(self.float_input) + + if not self._as_widget: + self.label_widget = label_widget + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + self.float_input.setValue(value) + + self.origin_value = self.item_value() + + self.float_input.valueChanged.connect(self._on_value_change) + + @property + def is_overidable(self): + return self._parent.is_overidable + + def set_value(self, value, origin_value=False): + self.float_input.setValue(value) + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.origin_value) + + def clear_value(self): + self.set_value(0) + + def _on_value_change(self, value=None): + self.is_modified = self.item_value() != self.origin_value + self.is_overriden = True + + self._update_style() + + self.value_changed.emit() + + def _update_style(self): + if not self._as_widget: + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + def item_value(self): + return self.float_input.value() + + def config_value(self): + return {self.key: self.item_value()} + + +class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + self._as_widget = values is AS_WIDGET + + super(TextSingleLineWidget, self).__init__(parent) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + self.text_input = QtWidgets.QLineEdit() + + if not self._as_widget and not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget) + layout.addWidget(self.text_input) + + if not self._as_widget: + self.label_widget = label_widget + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + self.text_input.setText(value) + + self.origin_value = self.item_value() + + self.text_input.textChanged.connect(self._on_value_change) + + @property + def is_overidable(self): + return self._parent.is_overidable + + def set_value(self, value, origin_value=False): + self.text_input.setText(value) + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.origin_value) + + def clear_value(self): + self.set_value("") + + def _on_value_change(self, value=None): + self.is_modified = self.item_value() != self.origin_value + self.is_overriden = True + + self._update_style() + + self.value_changed.emit() + + def _update_style(self): + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + def item_value(self): + return self.text_input.text() + + def config_value(self): + return {self.key: self.item_value()} + + +class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + + super(TextMultiLineWidget, self).__init__(parent) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + self.text_input = QtWidgets.QPlainTextEdit() + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget) + layout.addWidget(self.text_input) + + self.label_widget = label_widget + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + self.text_input.setPlainText(value) + + self.origin_value = self.item_value() + + self.text_input.textChanged.connect(self._on_value_change) + + @property + def is_overidable(self): + return self._parent.is_overidable + + def set_value(self, value, origin_value=False): + self.text_input.setPlainText(value) + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.origin_value) + + def clear_value(self): + self.set_value("") + + def _on_value_change(self, value=None): + self.is_modified = self.item_value() != self.origin_value + self.is_overriden = True + + self._update_style() + + self.value_changed.emit() + + def _update_style(self): + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + def item_value(self): + return self.text_input.toPlainText() + + def config_value(self): + return {self.key: self.item_value()} + + +class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): + _btn_size = 20 + value_changed = QtCore.Signal() + + def __init__(self, parent): + super(TextListItem, self).__init__(parent) + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(3) + + self.text_input = QtWidgets.QLineEdit() + self.add_btn = QtWidgets.QPushButton("+") + self.remove_btn = QtWidgets.QPushButton("-") + + self.add_btn.setProperty("btn-type", "text-list") + self.remove_btn.setProperty("btn-type", "text-list") + + layout.addWidget(self.text_input, 1) + layout.addWidget(self.add_btn, 0) + layout.addWidget(self.remove_btn, 0) + + self.add_btn.setFixedSize(self._btn_size, self._btn_size) + self.remove_btn.setFixedSize(self._btn_size, self._btn_size) + self.add_btn.clicked.connect(self.on_add_clicked) + self.remove_btn.clicked.connect(self.on_remove_clicked) + + self.text_input.textChanged.connect(self._on_value_change) + + self.is_single = False + + def _on_value_change(self): + self.value_changed.emit() + + def row(self): + return self.parent().input_fields.index(self) + + def on_add_clicked(self): + self.parent().add_row(row=self.row() + 1) + + def on_remove_clicked(self): + if self.is_single: + self.text_input.setText("") + else: + self.parent().remove_row(self) + + def config_value(self): + return self.text_input.text() + + +class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + + def __init__(self, input_data, values, parent_keys, parent): + super(TextListSubWidget, self).__init__(parent) + self.setObjectName("TextListSubWidget") + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(5, 5, 5, 5) + layout.setSpacing(5) + self.setLayout(layout) + + self.input_fields = [] + self.add_row() + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + self.set_value(value) + + self.origin_value = self.item_value() + + def set_value(self, value, origin_value=False): + for input_field in self.input_fields: + self.remove_row(input_field) + + for item_text in value: + self.add_row(text=item_text) + + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.origin_value) + + def clear_value(self): + self.set_value([]) + + def _on_value_change(self): + self.value_changed.emit() + + def count(self): + return len(self.input_fields) + + def add_row(self, row=None, text=None): + # Create new item + item_widget = TextListItem(self) + + # Set/unset if new item is single item + current_count = self.count() + if current_count == 0: + item_widget.is_single = True + elif current_count == 1: + for _input_field in self.input_fields: + _input_field.is_single = False + + item_widget.value_changed.connect(self._on_value_change) + + if row is None: + self.layout().addWidget(item_widget) + self.input_fields.append(item_widget) + else: + self.layout().insertWidget(row, item_widget) + self.input_fields.insert(row, item_widget) + + # Set text if entered text is not None + # else (when add button clicked) trigger `_on_value_change` + if text is not None: + item_widget.text_input.setText(text) + else: + self._on_value_change() + self.parent().updateGeometry() + + def remove_row(self, item_widget): + item_widget.value_changed.disconnect() + + self.layout().removeWidget(item_widget) + self.input_fields.remove(item_widget) + item_widget.setParent(None) + item_widget.deleteLater() + + current_count = self.count() + if current_count == 0: + self.add_row() + elif current_count == 1: + for _input_field in self.input_fields: + _input_field.is_single = True + + self._on_value_change() + self.parent().updateGeometry() + + def item_value(self): + output = [] + for item in self.input_fields: + text = item.config_value() + if text: + output.append(text) + + return output + + def config_value(self): + return {self.key: self.item_value()} + + +class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + super(TextListWidget, self).__init__(parent) + self.setObjectName("TextListWidget") + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget) + + self.label_widget = label_widget + # keys = list(parent_keys) + # keys.append(input_data["key"]) + # self.keys = keys + + self.value_widget = TextListSubWidget( + input_data, values, parent_keys, self + ) + self.value_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + self.value_widget.value_changed.connect(self._on_value_change) + + # self.value_widget.se + self.key = input_data["key"] + layout.addWidget(self.value_widget) + self.setLayout(layout) + + self.origin_value = self.item_value() + + @property + def is_overidable(self): + return self._parent.is_overidable + + def _on_value_change(self, value=None): + self.is_modified = self.item_value() != self.origin_value + self.is_overriden = True + + self._update_style() + + def set_value(self, value, origin_value=False): + self.value_widget.set_value(value) + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.origin_value) + + def clear_value(self): + self.set_value([]) + + def _update_style(self): + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + def item_value(self): + return self.value_widget.config_value() + + def config_value(self): + return {self.key: self.item_value()} + + +class ExpandingWidget(QtWidgets.QWidget): + def __init__(self, label, parent): + super(ExpandingWidget, self).__init__(parent) + self.setObjectName("ExpandingWidget") + + top_part = ClickableWidget(parent=self) + + button_size = QtCore.QSize(5, 5) + button_toggle = QtWidgets.QToolButton(parent=top_part) + button_toggle.setProperty("btn-type", "expand-toggle") + button_toggle.setIconSize(button_size) + button_toggle.setArrowType(QtCore.Qt.RightArrow) + button_toggle.setCheckable(True) + button_toggle.setChecked(False) + + label_widget = QtWidgets.QLabel(label, parent=top_part) + label_widget.setObjectName("ExpandLabel") + + layout = QtWidgets.QHBoxLayout(top_part) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + layout.addWidget(button_toggle) + layout.addWidget(label_widget) + top_part.setLayout(layout) + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + self.top_part = top_part + self.button_toggle = button_toggle + self.label_widget = label_widget + + self.top_part.clicked.connect(self._top_part_clicked) + self.button_toggle.clicked.connect(self.toggle_content) + + def set_content_widget(self, content_widget): + main_layout = QtWidgets.QVBoxLayout(self) + main_layout.setContentsMargins(9, 9, 9, 9) + + content_widget.setVisible(False) + + main_layout.addWidget(self.top_part) + main_layout.addWidget(content_widget) + self.setLayout(main_layout) + + self.content_widget = content_widget + + def _top_part_clicked(self): + self.toggle_content(not self.button_toggle.isChecked()) + + def toggle_content(self, *args): + if len(args) > 0: + checked = args[0] + else: + checked = self.button_toggle.isChecked() + arrow_type = QtCore.Qt.RightArrow + if checked: + arrow_type = QtCore.Qt.DownArrow + self.button_toggle.setChecked(checked) + self.button_toggle.setArrowType(arrow_type) + self.content_widget.setVisible(checked) + self.parent().updateGeometry() + + def resizeEvent(self, event): + super(ExpandingWidget, self).resizeEvent(event) + self.content_widget.updateGeometry() + + +class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + if values is AS_WIDGET: + raise TypeError("Can't use \"{}\" as widget item.".format( + self.__class__.__name__ + )) + self._parent = parent + + super(DictExpandWidget, self).__init__(parent) + self.setObjectName("DictExpandWidget") + top_part = ClickableWidget(parent=self) + + button_size = QtCore.QSize(5, 5) + button_toggle = QtWidgets.QToolButton(parent=top_part) + button_toggle.setProperty("btn-type", "expand-toggle") + button_toggle.setIconSize(button_size) + button_toggle.setArrowType(QtCore.Qt.RightArrow) + button_toggle.setCheckable(True) + button_toggle.setChecked(False) + + label = input_data["label"] + button_toggle_text = QtWidgets.QLabel(label, parent=top_part) + button_toggle_text.setObjectName("ExpandLabel") + + layout = QtWidgets.QHBoxLayout(top_part) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + layout.addWidget(button_toggle) + layout.addWidget(button_toggle_text) + top_part.setLayout(layout) + + main_layout = QtWidgets.QVBoxLayout(self) + main_layout.setContentsMargins(9, 9, 9, 9) + + content_widget = QtWidgets.QWidget(self) + content_widget.setVisible(False) + + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(3, 3, 3, 3) + + main_layout.addWidget(top_part) + main_layout.addWidget(content_widget) + self.setLayout(main_layout) + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + self.top_part = top_part + self.button_toggle = button_toggle + self.button_toggle_text = button_toggle_text + + self.content_widget = content_widget + self.content_layout = content_layout + + self.top_part.clicked.connect(self._top_part_clicked) + self.button_toggle.clicked.connect(self.toggle_content) + + self._is_category = False + self._is_overriden = False + self.input_fields = [] + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + + def _top_part_clicked(self): + self.toggle_content(not self.button_toggle.isChecked()) + + def toggle_content(self, *args): + if len(args) > 0: + checked = args[0] + else: + checked = self.button_toggle.isChecked() + arrow_type = QtCore.Qt.RightArrow + if checked: + arrow_type = QtCore.Qt.DownArrow + self.button_toggle.setChecked(checked) + self.button_toggle.setArrowType(arrow_type) + self.content_widget.setVisible(checked) + self.parent().updateGeometry() + + def resizeEvent(self, event): + super(DictExpandWidget, self).resizeEvent(event) + self.content_widget.updateGeometry() + + @property + def is_category(self): + return self._is_category + + @property + def is_overriden(self): + return self._is_overriden + + @property + def is_modified(self): + _is_modified = False + for input_field in self.input_fields: + if input_field.is_modified: + _is_modified = True + break + return _is_modified + + def item_value(self): + output = {} + for input_field in self.input_fields: + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + def config_value(self): + return {self.key: self.item_value()} + + @property + def is_overidable(self): + return self._parent.is_overidable + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + klass = TypeToKlass.types.get(item_type) + + item = klass( + child_configuration, values, self.keys, self + ) + self.content_layout.addWidget(item) + + self.input_fields.append(item) + return item + + +class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + + super(DictInvisible, self).__init__(parent) + self.setObjectName("DictInvisible") + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + + self._is_category = False + self._is_overriden = False + self.input_fields = [] + + if "key" not in input_data: + print(json.dumps(input_data, indent=4)) + + self.key = input_data["key"] + self.keys = list(parent_keys) + self.keys.append(self.key) + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + + @property + def is_overidable(self): + return self._parent.is_overidable + + @property + def is_category(self): + return self._is_category + + @property + def is_overriden(self): + return self._is_overriden + + @property + def is_modified(self): + _is_modified = False + for input_field in self.input_fields: + if input_field.is_modified: + _is_modified = True + break + return _is_modified + + def item_value(self): + output = {} + for input_field in self.input_fields: + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + def config_value(self): + return {self.key: self.item_value()} + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + if item_type == "schema": + for _schema in child_configuration["children"]: + children = config.gui_schema(_schema) + self.add_children_gui(children, values) + return + + klass = TypeToKlass.types.get(item_type) + item = klass( + child_configuration, values, self.keys, self + ) + self.layout().addWidget(item) + + self.input_fields.append(item) + return item + + +class DictFormWidget(QtWidgets.QWidget): + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + super(DictFormWidget, self).__init__(parent) + + self.input_fields = {} + self.content_layout = QtWidgets.QFormLayout(self) + + self.keys = list(parent_keys) + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + + def item_value(self): + output = {} + for input_field in self.input_fields.values(): + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + @property + def is_overidable(self): + return self._parent.is_overidable + + def config_value(self): + return self.item_value() + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + key = child_configuration["key"] + # Pop label to not be set in child + label = child_configuration["label"] + + klass = TypeToKlass.types.get(item_type) + + label_widget = QtWidgets.QLabel(label) + item = klass( + child_configuration, values, self.keys, self, label_widget + ) + self.content_layout.addRow(label_widget, item) + self.input_fields[key] = item + return item + + +class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): + _btn_size = 20 + value_changed = QtCore.Signal() + + def __init__(self, parent): + super(TextListItem, self).__init__(parent) + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(3) + + self.text_input = QtWidgets.QLineEdit() + self.add_btn = QtWidgets.QPushButton("+") + self.remove_btn = QtWidgets.QPushButton("-") + + self.add_btn.setProperty("btn-type", "text-list") + self.remove_btn.setProperty("btn-type", "text-list") + + layout.addWidget(self.text_input, 1) + layout.addWidget(self.add_btn, 0) + layout.addWidget(self.remove_btn, 0) + + self.add_btn.setFixedSize(self._btn_size, self._btn_size) + self.remove_btn.setFixedSize(self._btn_size, self._btn_size) + self.add_btn.clicked.connect(self.on_add_clicked) + self.remove_btn.clicked.connect(self.on_remove_clicked) + + self.text_input.textChanged.connect(self._on_value_change) + + self.is_single = False + + def _on_value_change(self): + self.value_changed.emit() + + def row(self): + return self.parent().input_fields.index(self) + + def on_add_clicked(self): + self.parent().add_row(row=self.row() + 1) + + def on_remove_clicked(self): + if self.is_single: + self.text_input.setText("") + else: + self.parent().remove_row(self) + + def config_value(self): + return self.text_input.text() + + +class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): + _btn_size = 20 + value_changed = QtCore.Signal() + + def __init__(self, object_type, parent): + self._parent = parent + + super(ModifiableDictItem, self).__init__(parent) + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(3) + + ItemKlass = TypeToKlass.types[object_type] + + self.key_input = QtWidgets.QLineEdit() + self.key_input.setObjectName("DictKey") + + self.value_input = ItemKlass( + {}, + AS_WIDGET, + [], + self, + None + ) + self.add_btn = QtWidgets.QPushButton("+") + self.remove_btn = QtWidgets.QPushButton("-") + + self.add_btn.setProperty("btn-type", "text-list") + self.remove_btn.setProperty("btn-type", "text-list") + + layout.addWidget(self.key_input, 0) + layout.addWidget(self.value_input, 1) + layout.addWidget(self.add_btn, 0) + layout.addWidget(self.remove_btn, 0) + + self.add_btn.setFixedSize(self._btn_size, self._btn_size) + self.remove_btn.setFixedSize(self._btn_size, self._btn_size) + self.add_btn.clicked.connect(self.on_add_clicked) + self.remove_btn.clicked.connect(self.on_remove_clicked) + + self.key_input.textChanged.connect(self._on_value_change) + self.value_input.value_changed.connect(self._on_value_change) + + self.origin_key = self._key() + self.origin_value = self.value_input.item_value() + + self.is_single = False + + def _key(self): + return self.key_input.text() + + def _on_value_change(self): + self._update_style() + self.value_changed.emit() + + @property + def is_overidable(self): + return self._parent.is_overidable + + def _update_style(self): + is_modified = self._key() != self.origin_key + # if self._is_overidable and self.is_overriden: + # if is_modified: + # state = "overriden-modified" + # else: + # state = "overriden" + if is_modified: + state = "modified" + else: + state = "original" + + self.key_input.setProperty("state", state) + self.key_input.style().polish(self.key_input) + + def row(self): + return self.parent().input_fields.index(self) + + def on_add_clicked(self): + self.parent().add_row(row=self.row() + 1) + + def on_remove_clicked(self): + if self.is_single: + self.value_input.clear_value() + self.key_input.setText("") + else: + self.parent().remove_row(self) + + def config_value(self): + key = self.key_input.text() + value = self.value_input.item_value() + if not key: + return {} + return {key: value} + + +class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + + def __init__(self, input_data, values, parent_keys, parent): + self._parent = parent + + super(ModifiableDictSubWidget, self).__init__(parent) + self.setObjectName("ModifiableDictSubWidget") + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(5, 5, 5, 5) + layout.setSpacing(5) + self.setLayout(layout) + + self.input_fields = [] + self.object_type = input_data["object_type"] + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + for item_key, item_value in value.items(): + self.add_row(key=item_key, value=item_value) + + if self.count() == 0: + self.add_row() + + self.origin_value = self.config_value() + + @property + def is_overidable(self): + return self._parent.is_overidable + + def _on_value_change(self): + self.value_changed.emit() + + def count(self): + return len(self.input_fields) + + def add_row(self, row=None, key=None, value=None): + # Create new item + item_widget = ModifiableDictItem(self.object_type, self) + + # Set/unset if new item is single item + current_count = self.count() + if current_count == 0: + item_widget.is_single = True + elif current_count == 1: + for _input_field in self.input_fields: + _input_field.is_single = False + + item_widget.value_changed.connect(self._on_value_change) + + if row is None: + self.layout().addWidget(item_widget) + self.input_fields.append(item_widget) + else: + self.layout().insertWidget(row, item_widget) + self.input_fields.insert(row, item_widget) + + # Set value if entered value is not None + # else (when add button clicked) trigger `_on_value_change` + if value is not None and key is not None: + item_widget.origin_key = key + item_widget.key_input.setText(key) + item_widget.value_input.set_value(value, origin_value=True) + else: + self._on_value_change() + self.parent().updateGeometry() + + def remove_row(self, item_widget): + item_widget.value_changed.disconnect() + + self.layout().removeWidget(item_widget) + self.input_fields.remove(item_widget) + item_widget.setParent(None) + item_widget.deleteLater() + + current_count = self.count() + if current_count == 0: + self.add_row() + elif current_count == 1: + for _input_field in self.input_fields: + _input_field.is_single = True + + self._on_value_change() + self.parent().updateGeometry() + + def config_value(self): + output = {} + for item in self.input_fields: + item_value = item.config_value() + if item_value: + output.update(item_value) + return output + + +class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): + def __init__( + self, input_data, values, parent_keys, parent, + label_widget=None + ): + self._parent = parent + + super(ModifiableDict, self).__init__(input_data["label"], parent) + self.setObjectName("ModifiableDict") + + self.value_widget = ModifiableDictSubWidget( + input_data, values, parent_keys, self + ) + self.value_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + self.value_widget.value_changed.connect(self._on_value_change) + + self.set_content_widget(self.value_widget) + + self.key = input_data["key"] + + self.origin_value = self.item_value() + + def _on_value_change(self, value=None): + self.is_modified = self.item_value() != self.origin_value + self.is_overriden = True + + self._update_style() + + @property + def is_overidable(self): + return self._parent.is_overidable + + def _update_style(self): + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + def item_value(self): + return self.value_widget.config_value() + + def config_value(self): + return {self.key: self.item_value()} + + +TypeToKlass.types["boolean"] = BooleanWidget +TypeToKlass.types["text-singleline"] = TextSingleLineWidget +TypeToKlass.types["text-multiline"] = TextMultiLineWidget +TypeToKlass.types["int"] = IntegerWidget +TypeToKlass.types["float"] = FloatWidget +TypeToKlass.types["dict-expanding"] = DictExpandWidget +TypeToKlass.types["dict-form"] = DictFormWidget +TypeToKlass.types["dict-invisible"] = DictInvisible +TypeToKlass.types["dict-modifiable"] = ModifiableDict +TypeToKlass.types["list-text"] = TextListWidget diff --git a/pype/tools/config_setting/widgets/lib.py b/pype/tools/config_setting/widgets/lib.py new file mode 100644 index 0000000000..ac0a353d53 --- /dev/null +++ b/pype/tools/config_setting/widgets/lib.py @@ -0,0 +1,44 @@ +import uuid + + +class CustomNone: + """Created object can be used as custom None (not equal to None). + + WARNING: Multiple created objects are not equal either. + Exmple: + >>> a = CustomNone() + >>> a == None + False + >>> b = CustomNone() + >>> a == b + False + >>> a == a + True + """ + + def __init__(self): + """Create uuid as identifier for custom None.""" + self.identifier = str(uuid.uuid4()) + + def __bool__(self): + """Return False (like default None).""" + return False + + def __eq__(self, other): + """Equality is compared by identifier value.""" + if type(other) == type(self): + if other.identifier == self.identifier: + return True + return False + + def __str__(self): + """Return value of identifier when converted to string.""" + return "".format(str(self.identifier)) + + def __repr__(self): + """Representation of custom None.""" + return "".format(str(self.identifier)) + + +NOT_SET = CustomNone() +AS_WIDGET = CustomNone() diff --git a/pype/tools/config_setting/widgets/main.py b/pype/tools/config_setting/widgets/main.py new file mode 100644 index 0000000000..af23e68f77 --- /dev/null +++ b/pype/tools/config_setting/widgets/main.py @@ -0,0 +1,26 @@ +from Qt import QtWidgets +from .base import StudioWidget, ProjectWidget + + +class MainWidget(QtWidgets.QWidget): + widget_width = 1000 + widget_height = 600 + + def __init__(self, parent=None): + super(MainWidget, self).__init__(parent) + + self.resize(self.widget_width, self.widget_height) + + header_tab_widget = QtWidgets.QTabWidget(parent=self) + + studio_widget = StudioWidget() + project_widget = ProjectWidget() + header_tab_widget.addTab(studio_widget, "Studio") + header_tab_widget.addTab(project_widget, "Project") + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + layout.addWidget(header_tab_widget) + + self.setLayout(layout) diff --git a/pype/tools/config_setting/widgets/tests.py b/pype/tools/config_setting/widgets/tests.py new file mode 100644 index 0000000000..53b67de3a1 --- /dev/null +++ b/pype/tools/config_setting/widgets/tests.py @@ -0,0 +1,127 @@ +from Qt import QtWidgets, QtCore + + +class SelectableMenu(QtWidgets.QMenu): + + selection_changed = QtCore.Signal() + + def mouseReleaseEvent(self, event): + action = self.activeAction() + if action and action.isEnabled(): + action.trigger() + self.selection_changed.emit() + else: + super(SelectableMenu, self).mouseReleaseEvent(event) + + def event(self, event): + result = super(SelectableMenu, self).event(event) + if event.type() == QtCore.QEvent.Show: + parent = self.parent() + + move_point = parent.mapToGlobal(QtCore.QPoint(0, parent.height())) + check_point = ( + move_point + + QtCore.QPoint(self.width(), self.height()) + ) + visibility_check = ( + QtWidgets.QApplication.desktop().rect().contains(check_point) + ) + if not visibility_check: + move_point -= QtCore.QPoint(0, parent.height() + self.height()) + self.move(move_point) + + self.updateGeometry() + self.repaint() + + return result + + +class AddibleComboBox(QtWidgets.QComboBox): + """Searchable ComboBox with empty placeholder value as first value""" + + def __init__(self, placeholder="", parent=None): + super(AddibleComboBox, self).__init__(parent) + + self.setEditable(True) + # self.setInsertPolicy(self.NoInsert) + + self.lineEdit().setPlaceholderText(placeholder) + # self.lineEdit().returnPressed.connect(self.on_return_pressed) + + # Apply completer settings + completer = self.completer() + completer.setCompletionMode(completer.PopupCompletion) + completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) + + # def on_return_pressed(self): + # text = self.lineEdit().text().strip() + # if not text: + # return + # + # index = self.findText(text) + # if index < 0: + # self.addItems([text]) + # index = self.findText(text) + + + + def populate(self, items): + self.clear() + # self.addItems([""]) # ensure first item is placeholder + self.addItems(items) + + def get_valid_value(self): + """Return the current text if it's a valid value else None + + Note: The empty placeholder value is valid and returns as "" + + """ + + text = self.currentText() + lookup = set(self.itemText(i) for i in range(self.count())) + if text not in lookup: + return None + + return text or None + + +class MultiselectEnum(QtWidgets.QWidget): + + selection_changed = QtCore.Signal() + + def __init__(self, title, parent=None): + super(MultiselectEnum, self).__init__(parent) + toolbutton = QtWidgets.QToolButton(self) + toolbutton.setText(title) + + toolmenu = SelectableMenu(toolbutton) + + toolbutton.setMenu(toolmenu) + toolbutton.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup) + + layout = QtWidgets.QHBoxLayout() + layout.setContentsMargins(0, 0, 0, 0) + layout.addWidget(toolbutton) + + self.setLayout(layout) + + toolmenu.selection_changed.connect(self.selection_changed) + + self.toolbutton = toolbutton + self.toolmenu = toolmenu + self.main_layout = layout + + def populate(self, items): + self.toolmenu.clear() + self.addItems(items) + + def addItems(self, items): + for item in items: + action = self.toolmenu.addAction(item) + action.setCheckable(True) + action.setChecked(True) + self.toolmenu.addAction(action) + + def items(self): + for action in self.toolmenu.actions(): + yield action From 899b654acec03e32eaac8e48df169f24a4232d24 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 23 Jul 2020 11:48:27 +0200 Subject: [PATCH 002/507] added attribute is_group to be able recognize if key will be overriden on one subvalue change --- pype/tools/config_setting/widgets/inputs.py | 24 +++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 1ddc27278d..02dd86c946 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1,10 +1,9 @@ +import json from Qt import QtWidgets, QtCore, QtGui from . import config from .base import PypeConfigurationWidget, TypeToKlass, ClickableWidget from .lib import NOT_SET, AS_WIDGET -import json - class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal() @@ -15,6 +14,8 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._as_widget = values is AS_WIDGET self._parent = parent + self.is_group = False + super(BooleanWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -129,6 +130,8 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + self.is_group = False + super(IntegerWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -220,6 +223,8 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + self.is_group = False + super(FloatWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -315,6 +320,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + self.is_group = False + super(TextSingleLineWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -398,6 +405,8 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + self.is_group = False + super(TextMultiLineWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -635,6 +644,9 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self, input_data, values, parent_keys, parent, label_widget=None ): self._parent = parent + + self.is_group = False + super(TextListWidget, self).__init__(parent) self.setObjectName("TextListWidget") @@ -785,6 +797,8 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): )) self._parent = parent + self.is_group = input_data.get("is_group", False) + super(DictExpandWidget, self).__init__(parent) self.setObjectName("DictExpandWidget") top_part = ClickableWidget(parent=self) @@ -916,6 +930,8 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + self.is_group = input_data.get("is_group", False) + super(DictInvisible, self).__init__(parent) self.setObjectName("DictInvisible") @@ -993,6 +1009,8 @@ class DictFormWidget(QtWidgets.QWidget): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + self.is_group = input_data.get("is_group", False) + super(DictFormWidget, self).__init__(parent) self.input_fields = {} @@ -1288,6 +1306,8 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): ): self._parent = parent + self.is_group = input_data.get("is_group", False) + super(ModifiableDict, self).__init__(input_data["label"], parent) self.setObjectName("ModifiableDict") From 908cccca120d9b372fb6f946148ed9496d1a6740 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 23 Jul 2020 11:57:16 +0200 Subject: [PATCH 003/507] moved widgets out of the box to widgets.py --- pype/tools/config_setting/widgets/base.py | 14 --- pype/tools/config_setting/widgets/inputs.py | 99 ++--------------- pype/tools/config_setting/widgets/widgets.py | 105 +++++++++++++++++++ 3 files changed, 112 insertions(+), 106 deletions(-) create mode 100644 pype/tools/config_setting/widgets/widgets.py diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 0cc64a66de..3a495c6ae1 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -10,19 +10,6 @@ class TypeToKlass: types = {} -class ClickableWidget(QtWidgets.QLabel): - clicked = QtCore.Signal() - - def __init__(self, *args, **kwargs): - super(ClickableWidget, self).__init__(*args, **kwargs) - self.setObjectName("ExpandLabel") - - def mouseReleaseEvent(self, event): - if event.button() == QtCore.Qt.LeftButton: - self.clicked.emit() - super(ClickableWidget, self).mouseReleaseEvent(event) - - class PypeConfigurationWidget: is_category = False is_overriden = False @@ -197,7 +184,6 @@ class ProjectListWidget(QtWidgets.QWidget): # ) - class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): config_dir = os.path.join( os.path.dirname(os.path.dirname(__file__)), diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 02dd86c946..7ef154ac9e 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1,7 +1,13 @@ import json from Qt import QtWidgets, QtCore, QtGui from . import config -from .base import PypeConfigurationWidget, TypeToKlass, ClickableWidget +from .base import PypeConfigurationWidget, TypeToKlass +from .widgets import ( + ClickableWidget, + ExpandingWidget, + ModifiedIntSpinBox, + ModifiedFloatSpinBox +) from .lib import NOT_SET, AS_WIDGET @@ -97,30 +103,6 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: self.item_value()} -class ModifiedIntSpinBox(QtWidgets.QSpinBox): - def __init__(self, *args, **kwargs): - super(ModifiedIntSpinBox, self).__init__(*args, **kwargs) - self.setFocusPolicy(QtCore.Qt.StrongFocus) - - def wheelEvent(self, event): - if self.hasFocus(): - super(ModifiedIntSpinBox, self).wheelEvent(event) - else: - event.ignore() - - -class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): - def __init__(self, *args, **kwargs): - super(ModifiedFloatSpinBox, self).__init__(*args, **kwargs) - self.setFocusPolicy(QtCore.Qt.StrongFocus) - - def wheelEvent(self, event): - if self.hasFocus(): - super(ModifiedFloatSpinBox, self).wheelEvent(event) - else: - event.ignore() - - class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal() @@ -720,73 +702,6 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: self.item_value()} -class ExpandingWidget(QtWidgets.QWidget): - def __init__(self, label, parent): - super(ExpandingWidget, self).__init__(parent) - self.setObjectName("ExpandingWidget") - - top_part = ClickableWidget(parent=self) - - button_size = QtCore.QSize(5, 5) - button_toggle = QtWidgets.QToolButton(parent=top_part) - button_toggle.setProperty("btn-type", "expand-toggle") - button_toggle.setIconSize(button_size) - button_toggle.setArrowType(QtCore.Qt.RightArrow) - button_toggle.setCheckable(True) - button_toggle.setChecked(False) - - label_widget = QtWidgets.QLabel(label, parent=top_part) - label_widget.setObjectName("ExpandLabel") - - layout = QtWidgets.QHBoxLayout(top_part) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - layout.addWidget(button_toggle) - layout.addWidget(label_widget) - top_part.setLayout(layout) - - self.setAttribute(QtCore.Qt.WA_StyledBackground) - - self.top_part = top_part - self.button_toggle = button_toggle - self.label_widget = label_widget - - self.top_part.clicked.connect(self._top_part_clicked) - self.button_toggle.clicked.connect(self.toggle_content) - - def set_content_widget(self, content_widget): - main_layout = QtWidgets.QVBoxLayout(self) - main_layout.setContentsMargins(9, 9, 9, 9) - - content_widget.setVisible(False) - - main_layout.addWidget(self.top_part) - main_layout.addWidget(content_widget) - self.setLayout(main_layout) - - self.content_widget = content_widget - - def _top_part_clicked(self): - self.toggle_content(not self.button_toggle.isChecked()) - - def toggle_content(self, *args): - if len(args) > 0: - checked = args[0] - else: - checked = self.button_toggle.isChecked() - arrow_type = QtCore.Qt.RightArrow - if checked: - arrow_type = QtCore.Qt.DownArrow - self.button_toggle.setChecked(checked) - self.button_toggle.setArrowType(arrow_type) - self.content_widget.setVisible(checked) - self.parent().updateGeometry() - - def resizeEvent(self, event): - super(ExpandingWidget, self).resizeEvent(event) - self.content_widget.updateGeometry() - - class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): def __init__( self, input_data, values, parent_keys, parent, label_widget=None diff --git a/pype/tools/config_setting/widgets/widgets.py b/pype/tools/config_setting/widgets/widgets.py new file mode 100644 index 0000000000..34fdfde1a5 --- /dev/null +++ b/pype/tools/config_setting/widgets/widgets.py @@ -0,0 +1,105 @@ +from Qt import QtWidgets, QtCore + + +class ModifiedIntSpinBox(QtWidgets.QSpinBox): + def __init__(self, *args, **kwargs): + super(ModifiedIntSpinBox, self).__init__(*args, **kwargs) + self.setFocusPolicy(QtCore.Qt.StrongFocus) + + def wheelEvent(self, event): + if self.hasFocus(): + super(ModifiedIntSpinBox, self).wheelEvent(event) + else: + event.ignore() + + +class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): + def __init__(self, *args, **kwargs): + super(ModifiedFloatSpinBox, self).__init__(*args, **kwargs) + self.setFocusPolicy(QtCore.Qt.StrongFocus) + + def wheelEvent(self, event): + if self.hasFocus(): + super(ModifiedFloatSpinBox, self).wheelEvent(event) + else: + event.ignore() + + +class ClickableWidget(QtWidgets.QLabel): + clicked = QtCore.Signal() + + def __init__(self, *args, **kwargs): + super(ClickableWidget, self).__init__(*args, **kwargs) + self.setObjectName("ExpandLabel") + + def mouseReleaseEvent(self, event): + if event.button() == QtCore.Qt.LeftButton: + self.clicked.emit() + super(ClickableWidget, self).mouseReleaseEvent(event) + + +class ExpandingWidget(QtWidgets.QWidget): + def __init__(self, label, parent): + super(ExpandingWidget, self).__init__(parent) + self.setObjectName("ExpandingWidget") + + top_part = ClickableWidget(parent=self) + + button_size = QtCore.QSize(5, 5) + button_toggle = QtWidgets.QToolButton(parent=top_part) + button_toggle.setProperty("btn-type", "expand-toggle") + button_toggle.setIconSize(button_size) + button_toggle.setArrowType(QtCore.Qt.RightArrow) + button_toggle.setCheckable(True) + button_toggle.setChecked(False) + + label_widget = QtWidgets.QLabel(label, parent=top_part) + label_widget.setObjectName("ExpandLabel") + + layout = QtWidgets.QHBoxLayout(top_part) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + layout.addWidget(button_toggle) + layout.addWidget(label_widget) + top_part.setLayout(layout) + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + self.top_part = top_part + self.button_toggle = button_toggle + self.label_widget = label_widget + + self.top_part.clicked.connect(self._top_part_clicked) + self.button_toggle.clicked.connect(self.toggle_content) + + def set_content_widget(self, content_widget): + main_layout = QtWidgets.QVBoxLayout(self) + main_layout.setContentsMargins(9, 9, 9, 9) + + content_widget.setVisible(False) + + main_layout.addWidget(self.top_part) + main_layout.addWidget(content_widget) + self.setLayout(main_layout) + + self.content_widget = content_widget + + def _top_part_clicked(self): + self.toggle_content(not self.button_toggle.isChecked()) + + def toggle_content(self, *args): + if len(args) > 0: + checked = args[0] + else: + checked = self.button_toggle.isChecked() + arrow_type = QtCore.Qt.RightArrow + if checked: + arrow_type = QtCore.Qt.DownArrow + self.button_toggle.setChecked(checked) + self.button_toggle.setArrowType(arrow_type) + self.content_widget.setVisible(checked) + self.parent().updateGeometry() + + def resizeEvent(self, event): + super(ExpandingWidget, self).resizeEvent(event) + self.content_widget.updateGeometry() From 63c13c655e2b41694055ef8940ba7824b95fd352 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 23 Jul 2020 11:59:11 +0200 Subject: [PATCH 004/507] removed category attribute (as was replaced with group attribute) --- pype/tools/config_setting/widgets/base.py | 2 +- pype/tools/config_setting/widgets/inputs.py | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 3a495c6ae1..0fb4cd94cb 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -11,7 +11,7 @@ class TypeToKlass: class PypeConfigurationWidget: - is_category = False + is_group = False is_overriden = False is_modified = False diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 7ef154ac9e..64deb4d909 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -762,7 +762,6 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.top_part.clicked.connect(self._top_part_clicked) self.button_toggle.clicked.connect(self.toggle_content) - self._is_category = False self._is_overriden = False self.input_fields = [] @@ -794,10 +793,6 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): super(DictExpandWidget, self).resizeEvent(event) self.content_widget.updateGeometry() - @property - def is_category(self): - return self._is_category - @property def is_overriden(self): return self._is_overriden @@ -856,7 +851,6 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self._is_category = False self._is_overriden = False self.input_fields = [] @@ -874,10 +868,6 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): def is_overidable(self): return self._parent.is_overidable - @property - def is_category(self): - return self._is_category - @property def is_overriden(self): return self._is_overriden From f184f71a0fbbe19b798ed7fa83e4dd77f208dd91 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 23 Jul 2020 17:12:45 +0200 Subject: [PATCH 005/507] handle project view selection --- pype/tools/config_setting/widgets/base.py | 92 ++++++++++++++++------- 1 file changed, 63 insertions(+), 29 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 0fb4cd94cb..bd19873b5f 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -120,37 +120,80 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.content_layout.addWidget(item) +class ProjectListView(QtWidgets.QListView): + left_mouse_released_at = QtCore.Signal(QtCore.QModelIndex) + + def mouseReleaseEvent(self, event): + if event.button() == QtCore.Qt.LeftButton: + index = self.indexAt(event.pos()) + self.left_mouse_released_at.emit(index) + super(ProjectListView, self).mouseReleaseEvent(event) + + class ProjectListWidget(QtWidgets.QWidget): default = "< Default >" - def __init__(self, parent=None): + def __init__(self, parent): + self._parent = parent + + self.current_project = None + super(ProjectListWidget, self).__init__(parent) - label = QtWidgets.QLabel("Project") - project_list = QtWidgets.QListView(self) + label_widget = QtWidgets.QLabel("Projects") + project_list = ProjectListView(self) project_list.setModel(QtGui.QStandardItemModel()) + # Do not allow editing + project_list.setEditTriggers( + QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers + ) + # Do not automatically handle selection + project_list.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection) + layout = QtWidgets.QVBoxLayout(self) - # content_margin = 5 - # layout.setContentsMargins( - # content_margin, - # content_margin, - # content_margin, - # content_margin - # ) - # layout.setSpacing(3) - layout.addWidget(label, 0) + layout.setSpacing(3) + layout.addWidget(label_widget, 0) layout.addWidget(project_list, 1) + project_list.left_mouse_released_at.connect(self.on_item_clicked) + self.project_list = project_list self.refresh() + def on_item_clicked(self, new_index): + new_project_name = new_index.data(QtCore.Qt.DisplayRole) + if new_project_name is None: + return + + if self.current_project == new_project_name: + return + + if self.validate_context_change(): + self.select_project(new_project_name) + self.current_project = new_project_name + + def validate_context_change(self): + # TODO add check if project can be changed (is modified) + return True + def project_name(self): - current_selection = self.project_list.currentText() - if current_selection == self.default: + if self.current_project == self.default: return None - return current_selection + return self.current_project + + def select_project(self, project_name): + model = self.project_list.model() + found_items = model.findItems(project_name) + if not found_items: + found_items = model.findItems(self.default) + + index = model.indexFromItem(found_items[0]) + self.project_list.selectionModel().clear() + self.project_list.selectionModel().setCurrentIndex( + index, QtCore.QItemSelectionModel.SelectionFlag.SelectCurrent + ) def refresh(self): selected_project = None @@ -163,25 +206,16 @@ class ProjectListWidget(QtWidgets.QWidget): items = [self.default] io.install() for project_doc in tuple(io.projects()): - print(project_doc["name"]) items.append(project_doc["name"]) for item in items: model.appendRow(QtGui.QStandardItem(item)) - if not selected_project: - selected_project = self.default + self.select_project(selected_project) - found_items = model.findItems(selected_project) - if found_items: - index = model.indexFromItem(found_items[0]) - c = QtCore.QItemSelectionModel.SelectionFlag.SelectCurrent - self.project_list.selectionModel().select( - index, c - ) - # self.project_list.selectionModel().setCurrentIndex( - # index, c - # ) + self.current_project = self.project_list.currentIndex().data( + QtCore.Qt.DisplayRole + ) class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): @@ -207,7 +241,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): scroll_widget.setWidgetResizable(True) scroll_widget.setWidget(content_widget) - project_list_widget = ProjectListWidget() + project_list_widget = ProjectListWidget(self) content_layout.addWidget(project_list_widget) self.project_list_widget = project_list_widget From 355d60c3b4b8224a680af956d693fd3be47c977d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 23 Jul 2020 18:03:10 +0200 Subject: [PATCH 006/507] make sure inputs has is_modified and is_overriden not with metaclass --- pype/tools/config_setting/widgets/base.py | 4 ---- pype/tools/config_setting/widgets/inputs.py | 22 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index bd19873b5f..ebe15a370c 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -11,10 +11,6 @@ class TypeToKlass: class PypeConfigurationWidget: - is_group = False - is_overriden = False - is_modified = False - def config_value(self): raise NotImplementedError( "Method `config_value` is not implemented for `{}`.".format( diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 64deb4d909..1ba062ec82 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -20,7 +20,9 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._as_widget = values is AS_WIDGET self._parent = parent + self.is_modified = False self.is_group = False + self.is_overriden = False super(BooleanWidget, self).__init__(parent) @@ -112,7 +114,9 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + self.is_modified = False self.is_group = False + self.is_overriden = False super(IntegerWidget, self).__init__(parent) @@ -205,7 +209,9 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + self.is_modified = False self.is_group = False + self.is_overriden = False super(FloatWidget, self).__init__(parent) @@ -302,7 +308,9 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + self.is_modified = False self.is_group = False + self.is_overriden = False super(TextSingleLineWidget, self).__init__(parent) @@ -387,7 +395,9 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + self.is_modified = False self.is_group = False + self.is_overriden = False super(TextMultiLineWidget, self).__init__(parent) @@ -627,7 +637,9 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + self.is_modified = False self.is_group = False + self.is_overriden = False super(TextListWidget, self).__init__(parent) self.setObjectName("TextListWidget") @@ -712,6 +724,8 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): )) self._parent = parent + self.is_modified = False + self.is_overriden = False self.is_group = input_data.get("is_group", False) super(DictExpandWidget, self).__init__(parent) @@ -840,6 +854,8 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + self.is_modified = False + self.is_overriden = False self.is_group = input_data.get("is_group", False) super(DictInvisible, self).__init__(parent) @@ -914,7 +930,9 @@ class DictFormWidget(QtWidgets.QWidget): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): - self.is_group = input_data.get("is_group", False) + self.is_modified = False + self.is_overriden = False + self.is_group = False super(DictFormWidget, self).__init__(parent) @@ -1211,6 +1229,8 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): ): self._parent = parent + self.is_modified = False + self.is_overriden = False self.is_group = input_data.get("is_group", False) super(ModifiableDict, self).__init__(input_data["label"], parent) From 6b42c7bdc17763b84244fe1f4c7c06bc09e92b77 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 24 Jul 2020 15:22:23 +0200 Subject: [PATCH 007/507] child modified attribute added --- pype/tools/config_setting/style/style.css | 5 ++ pype/tools/config_setting/widgets/inputs.py | 87 +++++++++++++++------ 2 files changed, 68 insertions(+), 24 deletions(-) diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/style/style.css index f559a4c3b3..db46cc4c24 100644 --- a/pype/tools/config_setting/style/style.css +++ b/pype/tools/config_setting/style/style.css @@ -34,6 +34,7 @@ QLabel[state="overriden"] { } QWidget[input-state="original"] {} + QWidget[input-state="modified"] { border-color: #137cbd; } @@ -83,6 +84,10 @@ QPushButton[btn-type="expand-toggle"] { background: #1d272f; } +#ModifiableDict[state="child-modified"] { + border-color: #137cbd; +} + #TextListSubWidget { border: 1px solid #455c6e; border-radius: 3px; diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 1ba062ec82..9b24227a1d 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1,5 +1,5 @@ import json -from Qt import QtWidgets, QtCore, QtGui +from Qt import QtWidgets, QtCore from . import config from .base import PypeConfigurationWidget, TypeToKlass from .widgets import ( @@ -67,6 +67,10 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.reset_value() + @property + def child_modified(self): + return self.is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -148,6 +152,10 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.int_input.valueChanged.connect(self._on_value_change) + @property + def child_modified(self): + return self.is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -253,6 +261,10 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.float_input.valueChanged.connect(self._on_value_change) + @property + def child_modified(self): + return self.is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -342,6 +354,10 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.text_input.textChanged.connect(self._on_value_change) + @property + def child_modified(self): + return self.is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -427,6 +443,10 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.text_input.textChanged.connect(self._on_value_change) + @property + def child_modified(self): + return self.is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -671,6 +691,10 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.origin_value = self.item_value() + @property + def child_modified(self): + return self.is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -808,17 +832,11 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.content_widget.updateGeometry() @property - def is_overriden(self): - return self._is_overriden - - @property - def is_modified(self): - _is_modified = False + def child_modified(self): for input_field in self.input_fields: - if input_field.is_modified: - _is_modified = True - break - return _is_modified + if input_field.child_modified: + return True + return False def item_value(self): output = {} @@ -885,17 +903,11 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overidable @property - def is_overriden(self): - return self._is_overriden - - @property - def is_modified(self): - _is_modified = False + def child_modified(self): for input_field in self.input_fields: - if input_field.is_modified: - _is_modified = True - break - return _is_modified + if input_field.child_modified: + return True + return False def item_value(self): output = {} @@ -930,6 +942,8 @@ class DictFormWidget(QtWidgets.QWidget): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + self._parent = parent + self.is_modified = False self.is_overriden = False self.is_group = False @@ -952,6 +966,13 @@ class DictFormWidget(QtWidgets.QWidget): output.update(input_field.config_value()) return output + @property + def child_modified(self): + for input_field in self.input_fields: + if input_field.child_modified: + return True + return False + @property def is_overidable(self): return self._parent.is_overidable @@ -1086,14 +1107,23 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): def is_overidable(self): return self._parent.is_overidable + def is_key_modified(self): + return self._key() != self.origin_key + + def is_value_modified(self): + return self.value_input.is_modified + + @property + def is_modified(self): + return self.is_value_modified() or self.is_key_modified() + def _update_style(self): - is_modified = self._key() != self.origin_key # if self._is_overidable and self.is_overriden: # if is_modified: # state = "overriden-modified" # else: # state = "overriden" - if is_modified: + if self.is_key_modified(): state = "modified" else: state = "original" @@ -1230,6 +1260,7 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self._parent = parent self.is_modified = False + self.child_modified = False self.is_overriden = False self.is_group = input_data.get("is_group", False) @@ -1249,7 +1280,7 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.origin_value = self.item_value() def _on_value_change(self, value=None): - self.is_modified = self.item_value() != self.origin_value + self.child_modified = self.item_value() != self.origin_value self.is_overriden = True self._update_style() @@ -1259,6 +1290,14 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): return self._parent.is_overidable def _update_style(self): + if self.child_modified: + widget_state = "child-modified" + else: + widget_state = "" + + self.setProperty("state", widget_state) + self.style().polish(self) + if self.is_overidable and self.is_overriden: if self.is_modified: state = "overriden-modified" From 7058dc7d10312fb8c11dc4e45a0225634100dad0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 24 Jul 2020 16:49:20 +0200 Subject: [PATCH 008/507] style fixes --- pype/tools/config_setting/style/style.css | 2 +- pype/tools/config_setting/widgets/base.py | 4 +- pype/tools/config_setting/widgets/inputs.py | 98 +++++++++++++++++---- 3 files changed, 83 insertions(+), 21 deletions(-) diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/style/style.css index db46cc4c24..db2d746a23 100644 --- a/pype/tools/config_setting/style/style.css +++ b/pype/tools/config_setting/style/style.css @@ -84,7 +84,7 @@ QPushButton[btn-type="expand-toggle"] { background: #1d272f; } -#ModifiableDict[state="child-modified"] { +#DictExpandWidget[state="child-modified"], #ModifiableDict[state="child-modified"] { border-color: #137cbd; } diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index ebe15a370c..d2ccdddfc1 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -58,7 +58,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): scroll_widget = QtWidgets.QScrollArea(self) content_widget = QtWidgets.QWidget(scroll_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(0, 0, 0, 0) + content_layout.setContentsMargins(3, 3, 3, 3) content_layout.setSpacing(0) content_layout.setAlignment(QtCore.Qt.AlignTop) content_widget.setLayout(content_layout) @@ -229,7 +229,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): scroll_widget = QtWidgets.QScrollArea(self) content_widget = QtWidgets.QWidget(scroll_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(0, 0, 0, 0) + content_layout.setContentsMargins(3, 3, 3, 3) content_layout.setSpacing(0) content_layout.setAlignment(QtCore.Qt.AlignTop) content_widget.setLayout(content_layout) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 9b24227a1d..c2a6eff0cc 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -19,7 +19,8 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._as_widget = values is AS_WIDGET self._parent = parent - + print(10*"*", parent) + print(values) self.is_modified = False self.is_group = False self.is_overriden = False @@ -94,7 +95,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: state = "original" - if not self._as_widget: + if self._as_widget: property_name = "input-state" else: property_name = "state" @@ -290,19 +291,25 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit() def _update_style(self): - if not self._as_widget: - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" - elif self.is_modified: - state = "modified" + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" else: - state = "original" + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" - self.label_widget.setProperty("state", state) - self.label_widget.style().polish(self.label_widget) + if self._as_widget: + property_name = "input-state" + widget = self.float_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) def item_value(self): return self.float_input.value() @@ -393,8 +400,15 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: state = "original" - self.label_widget.setProperty("state", state) - self.label_widget.style().polish(self.label_widget) + if self._as_widget: + property_name = "input-state" + widget = self.text_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) def item_value(self): return self.text_input.text() @@ -482,8 +496,15 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: state = "original" - self.label_widget.setProperty("state", state) - self.label_widget.style().polish(self.label_widget) + if self._as_widget: + property_name = "input-state" + widget = self.text_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) def item_value(self): return self.text_input.toPlainText() @@ -652,6 +673,8 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): @@ -705,6 +728,8 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._update_style() + self.value_changed.emit() + def set_value(self, value, origin_value=False): self.value_widget.set_value(value) if origin_value: @@ -739,6 +764,8 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal() + def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): @@ -831,6 +858,33 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): super(DictExpandWidget, self).resizeEvent(event) self.content_widget.updateGeometry() + def _on_value_change(self, value=None): + self.is_overriden = True + + self._update_style() + + def _update_style(self): + if self.child_modified: + widget_state = "child-modified" + else: + widget_state = "" + + self.setProperty("state", widget_state) + self.style().polish(self) + + if self.is_overidable and self.is_overriden: + if self.is_modified: + state = "overriden-modified" + else: + state = "overriden" + elif self.is_modified: + state = "modified" + else: + state = "original" + + self.button_toggle_text.setProperty("state", state) + self.button_toggle_text.style().polish(self.button_toggle_text) + @property def child_modified(self): for input_field in self.input_fields: @@ -860,6 +914,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): item = klass( child_configuration, values, self.keys, self ) + item.value_changed.connect(self._on_value_change) self.content_layout.addWidget(item) self.input_fields.append(item) @@ -939,6 +994,8 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): class DictFormWidget(QtWidgets.QWidget): + value_changed = QtCore.Signal() + def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): @@ -958,6 +1015,9 @@ class DictFormWidget(QtWidgets.QWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + def _on_value_change(self): + self.value_changed.emit() + def item_value(self): output = {} for input_field in self.input_fields.values(): @@ -968,7 +1028,7 @@ class DictFormWidget(QtWidgets.QWidget): @property def child_modified(self): - for input_field in self.input_fields: + for input_field in self.input_fields.values(): if input_field.child_modified: return True return False @@ -989,9 +1049,11 @@ class DictFormWidget(QtWidgets.QWidget): klass = TypeToKlass.types.get(item_type) label_widget = QtWidgets.QLabel(label) + item = klass( child_configuration, values, self.keys, self, label_widget ) + item.value_changed.connect(self._on_value_change) self.content_layout.addRow(label_widget, item) self.input_fields[key] = item return item From e083e9585912bf920475244a0096e6e8eb1a3c57 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 24 Jul 2020 17:53:20 +0200 Subject: [PATCH 009/507] made it a little bit globally usable --- pype/tools/config_setting/interface.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/interface.py b/pype/tools/config_setting/interface.py index e95f3f5fe3..e227443c95 100644 --- a/pype/tools/config_setting/interface.py +++ b/pype/tools/config_setting/interface.py @@ -1,17 +1,26 @@ import os import sys -os.environ["PYPE_CONFIG"] = ( - "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pype-config" + + +def folder_up(path, times=1): + if times <= 0: + return path + return folder_up(os.path.dirname(path), times - 1) + + +PYPE_SETUP_PATH = folder_up(__file__, 6) + +os.environ["PYPE_CONFIG"] = os.path.join( + PYPE_SETUP_PATH, "repos", "pype-config" ) os.environ["AVALON_MONGO"] = "mongodb://localhost:2707" sys_paths = ( "C:/Users/Public/pype_env2/Lib/site-packages", - "C:/Users/jakub.trllo/Desktop/pype/pype-setup", - "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pype", - "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/avalon-core", - "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pyblish-base", - "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pyblish-lite", - "C:/Users/jakub.trllo/Desktop/pype/pype-setup/repos/pype-config" + PYPE_SETUP_PATH, + os.path.join(PYPE_SETUP_PATH, "repos", "pype"), + os.path.join(PYPE_SETUP_PATH, "repos", "avalon-core"), + os.path.join(PYPE_SETUP_PATH, "repos", "pyblish-base"), + os.path.join(PYPE_SETUP_PATH, "repos", "pype-config"), ) for path in sys_paths: sys.path.append(path) From 8d92a455e6b2083df3f8476a838f7908b00d9f77 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 24 Jul 2020 18:07:45 +0200 Subject: [PATCH 010/507] minor tweaks in temp config files --- .../global/es/applications.json | 39 ------------------- .../config_gui_schema/studio_gui_schema.json | 15 ++++--- 2 files changed, 10 insertions(+), 44 deletions(-) delete mode 100644 pype/tools/config_setting/config/studio_presets/global/es/applications.json diff --git a/pype/tools/config_setting/config/studio_presets/global/es/applications.json b/pype/tools/config_setting/config/studio_presets/global/es/applications.json deleted file mode 100644 index 35e399444c..0000000000 --- a/pype/tools/config_setting/config/studio_presets/global/es/applications.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "blender_2.80": true, - "blender_2.81": true, - "blender_2.82": true, - "blender_2.83": true, - "harmony_17": true, - "houdini_16": true, - "houdini_17": true, - "houdini_18": true, - "maya_2016": true, - "maya_2017": true, - "maya_2018": true, - "maya_2019": true, - "maya_2020": true, - "nuke_10.0": true, - "nuke_11.0": true, - "nuke_11.2": true, - "nuke_11.3": true, - "nuke_12.0": true, - "nukex_10.0": true, - "nukex_11.0": true, - "nukex_11.2": true, - "nukex_11.3": true, - "nukex_12.0": true, - "nukestudio_10.0": true, - "nukestudio_11.0": true, - "nukestudio_11.2": true, - "nukestudio_11.3": true, - "nukestudio_12.0": true, - "photoshop_2020": true, - "premiere_2019": true, - "premiere_2020": true, - "python_2": true, - "python_3": true, - "resolve_16": true, - "shell": true, - "storyboardpro_7": true, - "unreal_4.21": true -} diff --git a/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json index 7d902bb8db..1a49735b8a 100644 --- a/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json @@ -4,11 +4,16 @@ "label": "Studio", "children": [ { - "type": "schema", - "children": [ - "applications_gui_schema", - "tools_gui_schema" - ] + "key": "global", + "type": "dict-invisible", + "label": "Global", + "children": [{ + "type": "schema", + "children": [ + "applications_gui_schema", + "tools_gui_schema" + ] + }] }, { "key": "muster", "type": "dict-invisible", From cbb77c05b10affef9a66a2bfb2284635adbaa71f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 24 Jul 2020 18:07:57 +0200 Subject: [PATCH 011/507] preparation for studio save --- pype/tools/config_setting/widgets/base.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index d2ccdddfc1..337beb040e 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -80,10 +80,10 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): footer_widget = QtWidgets.QWidget() footer_layout = QtWidgets.QHBoxLayout(footer_widget) - btn = QtWidgets.QPushButton("Finish") + save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() footer_layout.addWidget(spacer_widget, 1) - footer_layout.addWidget(btn, 0) + footer_layout.addWidget(save_btn, 0) layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -93,9 +93,9 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): layout.addWidget(scroll_widget, 1) layout.addWidget(footer_widget, 0) - btn.clicked.connect(self.___finish) + save_btn.clicked.connect(self._save) - def ___finish(self): + def _save(self): output = {} for item in self.input_fields: output.update(item.config_value()) @@ -104,6 +104,9 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): _output = {key: output} output = _output + config_with_metadata = config.studio_presets_with_metadata() + + print(json.dumps(config_with_metadata, indent=4)) print(json.dumps(output, indent=4)) def add_children_gui(self, child_configuration, values): From 5ba9eb2eed39d05647d360621353d9a3a4ba3cb1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 24 Jul 2020 18:08:35 +0200 Subject: [PATCH 012/507] paths are correct and metadata presets are with metadata --- pype/tools/config_setting/interface.py | 6 ++---- pype/tools/config_setting/widgets/config.py | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/interface.py b/pype/tools/config_setting/interface.py index e227443c95..a8c05f5af3 100644 --- a/pype/tools/config_setting/interface.py +++ b/pype/tools/config_setting/interface.py @@ -8,8 +8,7 @@ def folder_up(path, times=1): return folder_up(os.path.dirname(path), times - 1) -PYPE_SETUP_PATH = folder_up(__file__, 6) - +PYPE_SETUP_PATH = folder_up(os.path.realpath(__file__), 6) os.environ["PYPE_CONFIG"] = os.path.join( PYPE_SETUP_PATH, "repos", "pype-config" ) @@ -19,8 +18,7 @@ sys_paths = ( PYPE_SETUP_PATH, os.path.join(PYPE_SETUP_PATH, "repos", "pype"), os.path.join(PYPE_SETUP_PATH, "repos", "avalon-core"), - os.path.join(PYPE_SETUP_PATH, "repos", "pyblish-base"), - os.path.join(PYPE_SETUP_PATH, "repos", "pype-config"), + os.path.join(PYPE_SETUP_PATH, "repos", "pyblish-base") ) for path in sys_paths: sys.path.append(path) diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 335299cb2f..58b1e03a25 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -160,10 +160,12 @@ def global_project_presets(**kwargs): def studio_presets_with_metadata(*args, **kwargs): + kwargs["with_metadata"] = True return load_jsons_from_dir(studio_presets_path, *args, **kwargs) def global_project_presets_with_metadata(**kwargs): + kwargs["with_metadata"] = True return load_jsons_from_dir(project_presets_path, **kwargs) From 5ba7a45235ca82486fe3db36774d4892aa3fedd4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 24 Jul 2020 18:35:44 +0200 Subject: [PATCH 013/507] more close to saving studio presets --- pype/tools/config_setting/widgets/base.py | 42 ++++++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 337beb040e..a5f912d7cb 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -4,6 +4,7 @@ from Qt import QtWidgets, QtCore, QtGui from . import config from .lib import NOT_SET from avalon import io +from queue import Queue class TypeToKlass: @@ -96,18 +97,49 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): save_btn.clicked.connect(self._save) def _save(self): - output = {} + all_values = {} for item in self.input_fields: - output.update(item.config_value()) + all_values.update(item.config_value()) for key in reversed(self.keys): - _output = {key: output} - output = _output + _all_values = {key: all_values} + all_values = _all_values + # Skip first key + all_values = all_values["studio"] + + # Load studio data with metadata config_with_metadata = config.studio_presets_with_metadata() print(json.dumps(config_with_metadata, indent=4)) - print(json.dumps(output, indent=4)) + print(json.dumps(all_values, indent=4)) + + per_file_values = {} + process_queue = Queue() + for _key, _values in all_values.items(): + process_queue.put(( + config.studio_presets_path, _key, config_with_metadata, _values + )) + + while not process_queue.empty(): + path, key, metadata, values = process_queue.get() + new_path = os.path.join(path, key) + # TODO this should not be + if key in metadata: + key_metadata = metadata[key] + + if key_metadata["type"] == "file": + new_path += ".json" + per_file_values[new_path] = values + continue + + for new_key, new_values in values.items(): + process_queue.put( + (new_path, new_key, key_metadata["value"], new_values) + ) + + for path in per_file_values: + print(path) def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] From 22adf6f9e3ffb3dfe2891f0bc23198a112babbe6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 10:51:17 +0200 Subject: [PATCH 014/507] fix dictinary value changed --- pype/tools/config_setting/widgets/inputs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index c2a6eff0cc..01a22bd702 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -861,6 +861,8 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.is_overriden = True + self.value_changed.emit() + self._update_style() def _update_style(self): From 4d52556f2b4cbbbe7b4c9c28944d4c88d877bab3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 11:14:56 +0200 Subject: [PATCH 015/507] fix values keys --- pype/tools/config_setting/widgets/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index a5f912d7cb..b4ad206076 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -130,7 +130,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): if key_metadata["type"] == "file": new_path += ".json" - per_file_values[new_path] = values + per_file_values[new_path] = {key: values} continue for new_key, new_values in values.items(): From ce9f4315086b039ca0eb7b3b2ae44a09df2d32b7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 12:04:48 +0200 Subject: [PATCH 016/507] saving studio files --- pype/tools/config_setting/widgets/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index b4ad206076..b68ec4126a 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -130,7 +130,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): if key_metadata["type"] == "file": new_path += ".json" - per_file_values[new_path] = {key: values} + per_file_values[new_path] = values continue for new_key, new_values in values.items(): @@ -138,8 +138,9 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): (new_path, new_key, key_metadata["value"], new_values) ) - for path in per_file_values: - print(path) + for file_path, file_values in per_file_values.items(): + with open(file_path, "w") as file_stream: + json.dump(file_values, file_stream, indent=4) def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] From 8ebbf14097557f22dd87f59a040bc1f353cd221d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 17:36:04 +0200 Subject: [PATCH 017/507] added child overriden attribute --- pype/tools/config_setting/style/style.css | 8 +++ pype/tools/config_setting/widgets/inputs.py | 70 +++++++++++++++++++-- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/style/style.css index db2d746a23..1371056c1a 100644 --- a/pype/tools/config_setting/style/style.css +++ b/pype/tools/config_setting/style/style.css @@ -88,6 +88,14 @@ QPushButton[btn-type="expand-toggle"] { border-color: #137cbd; } +#DictExpandWidget[state="child-overriden"], #ModifiableDict[state="child-overriden"] { + border-color: #ff8c1a; +} + +#DictExpandWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"] { + border-color: #00b386; +} + #TextListSubWidget { border: 1px solid #455c6e; border-radius: 3px; diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 01a22bd702..9bed1207a8 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -19,8 +19,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._as_widget = values is AS_WIDGET self._parent = parent - print(10*"*", parent) - print(values) + self.is_modified = False self.is_group = False self.is_overriden = False @@ -72,6 +71,10 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_modified(self): return self.is_modified + @property + def child_overriden(self): + return self.is_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -157,6 +160,10 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_modified(self): return self.is_modified + @property + def child_overriden(self): + return self.is_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -266,6 +273,10 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_modified(self): return self.is_modified + @property + def child_overriden(self): + return self.is_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -365,6 +376,10 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_modified(self): return self.is_modified + @property + def child_overriden(self): + return self.is_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -461,6 +476,10 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_modified(self): return self.is_modified + @property + def child_overriden(self): + return self.is_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -718,6 +737,10 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_modified(self): return self.is_modified + @property + def child_overriden(self): + return self.is_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -866,8 +889,15 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._update_style() def _update_style(self): - if self.child_modified: + child_modified = self.child_modified + child_overriden = self.child_overriden + + if child_modified and child_overriden: + widget_state = "child-overriden-modified" + elif child_modified: widget_state = "child-modified" + elif child_overriden: + widget_state = "child-overriden" else: widget_state = "" @@ -894,6 +924,13 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): return True return False + @property + def child_overriden(self): + for input_field in self.input_fields: + if input_field.child_overriden: + return True + return False + def item_value(self): output = {} for input_field in self.input_fields: @@ -966,6 +1003,13 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): return True return False + @property + def child_overriden(self): + for input_field in self.input_fields: + if input_field.child_overriden: + return True + return False + def item_value(self): output = {} for input_field in self.input_fields: @@ -1035,6 +1079,13 @@ class DictFormWidget(QtWidgets.QWidget): return True return False + @property + def child_overriden(self): + for input_field in self.input_fields: + if input_field.child_overriden: + return True + return False + @property def is_overidable(self): return self._parent.is_overidable @@ -1349,13 +1400,24 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self._update_style() + @property + def child_overriden(self): + return self.is_overriden + @property def is_overidable(self): return self._parent.is_overidable def _update_style(self): - if self.child_modified: + child_modified = self.child_modified + child_overriden = self.child_overriden + + if child_modified and child_overriden: + widget_state = "child-overriden-modified" + elif child_modified: widget_state = "child-modified" + elif child_overriden: + widget_state = "child-overriden" else: widget_state = "" From 669631d71edc96c8adeb5ff32954389a4f5edfb7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 18:55:36 +0200 Subject: [PATCH 018/507] removed duplicated class --- pype/tools/config_setting/widgets/inputs.py | 50 --------------------- 1 file changed, 50 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 9bed1207a8..01c69c1c0b 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1112,56 +1112,6 @@ class DictFormWidget(QtWidgets.QWidget): return item -class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): - _btn_size = 20 - value_changed = QtCore.Signal() - - def __init__(self, parent): - super(TextListItem, self).__init__(parent) - - layout = QtWidgets.QHBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(3) - - self.text_input = QtWidgets.QLineEdit() - self.add_btn = QtWidgets.QPushButton("+") - self.remove_btn = QtWidgets.QPushButton("-") - - self.add_btn.setProperty("btn-type", "text-list") - self.remove_btn.setProperty("btn-type", "text-list") - - layout.addWidget(self.text_input, 1) - layout.addWidget(self.add_btn, 0) - layout.addWidget(self.remove_btn, 0) - - self.add_btn.setFixedSize(self._btn_size, self._btn_size) - self.remove_btn.setFixedSize(self._btn_size, self._btn_size) - self.add_btn.clicked.connect(self.on_add_clicked) - self.remove_btn.clicked.connect(self.on_remove_clicked) - - self.text_input.textChanged.connect(self._on_value_change) - - self.is_single = False - - def _on_value_change(self): - self.value_changed.emit() - - def row(self): - return self.parent().input_fields.index(self) - - def on_add_clicked(self): - self.parent().add_row(row=self.row() + 1) - - def on_remove_clicked(self): - if self.is_single: - self.text_input.setText("") - else: - self.parent().remove_row(self) - - def config_value(self): - return self.text_input.text() - - class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 value_changed = QtCore.Signal() From a8fb14a1bca842e45c81eb2d60b16f1a68f1505b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 18:55:53 +0200 Subject: [PATCH 019/507] added is_group feature --- pype/tools/config_setting/widgets/inputs.py | 160 ++++++++++++++++++-- 1 file changed, 145 insertions(+), 15 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 01c69c1c0b..485eda6d35 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -11,6 +11,14 @@ from .widgets import ( from .lib import NOT_SET, AS_WIDGET +class SchemeGroupHierarchyBug(Exception): + def __init__(self, msg=None): + if not msg: + # TODO better message + msg = "SCHEME BUG: Attribute `is_group` is mixed in the hierarchy" + super(SchemeGroupHierarchyBug, self).__init(msg) + + class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal() @@ -20,8 +28,19 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._as_widget = values is AS_WIDGET self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(BooleanWidget, self).__init__(parent) @@ -122,8 +141,19 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(IntegerWidget, self).__init__(parent) @@ -225,8 +255,19 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(FloatWidget, self).__init__(parent) @@ -338,8 +379,19 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(TextSingleLineWidget, self).__init__(parent) @@ -440,8 +492,19 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(TextMultiLineWidget, self).__init__(parent) @@ -699,8 +762,16 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + self.is_modified = False - self.is_group = False + self.is_group = is_group self.is_overriden = False super(TextListWidget, self).__init__(parent) @@ -747,7 +818,8 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_group and self.is_overidable: + self.is_overriden = True self._update_style() @@ -798,9 +870,19 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): )) self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False - self.is_overriden = False - self.is_group = input_data.get("is_group", False) + self._is_overriden = False + self.is_group = is_group super(DictExpandWidget, self).__init__(parent) self.setObjectName("DictExpandWidget") @@ -850,7 +932,6 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.top_part.clicked.connect(self._top_part_clicked) self.button_toggle.clicked.connect(self.toggle_content) - self._is_overriden = False self.input_fields = [] self.key = input_data["key"] @@ -881,8 +962,15 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): super(DictExpandWidget, self).resizeEvent(event) self.content_widget.updateGeometry() + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + + def _on_value_change(self, value=None): - self.is_overriden = True + if self.is_group: + self._is_overriden = True self.value_changed.emit() @@ -966,9 +1054,19 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False self.is_overriden = False - self.is_group = input_data.get("is_group", False) + self.is_group = is_group super(DictInvisible, self).__init__(parent) self.setObjectName("DictInvisible") @@ -979,7 +1077,6 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self._is_overriden = False self.input_fields = [] if "key" not in input_data: @@ -1047,6 +1144,12 @@ class DictFormWidget(QtWidgets.QWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False self.is_overriden = False self.is_group = False @@ -1168,6 +1271,14 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): self._update_style() self.value_changed.emit() + @property + def is_group(self): + return self._parent.is_group + + @property + def any_parent_is_group(self): + return self._parent.any_parent_is_group + @property def is_overidable(self): return self._parent.is_overidable @@ -1253,6 +1364,14 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): def is_overidable(self): return self._parent.is_overidable + @property + def is_group(self): + return self._parent.is_group + + @property + def any_parent_is_group(self): + return self._parent.any_parent_is_group + def _on_value_change(self): self.value_changed.emit() @@ -1324,10 +1443,20 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False self.child_modified = False self.is_overriden = False - self.is_group = input_data.get("is_group", False) + self.is_group = is_group super(ModifiableDict, self).__init__(input_data["label"], parent) self.setObjectName("ModifiableDict") @@ -1346,7 +1475,8 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.child_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_group: + self.is_overriden = True self._update_style() From e7e3526c72b5ca06f716bb195e2dfc99b3be0ee0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 18:56:04 +0200 Subject: [PATCH 020/507] added is_group feature --- pype/tools/config_setting/widgets/base.py | 6 +- pype/tools/config_setting/widgets/inputs.py | 160 ++++++++++++++++++-- 2 files changed, 150 insertions(+), 16 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index b68ec4126a..222cf2ba41 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -50,6 +50,8 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): "config_gui_schema" ) is_overidable = False + is_group = False + any_parent_is_group = False def __init__(self, parent=None): super(StudioWidget, self).__init__(parent) @@ -124,7 +126,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): while not process_queue.empty(): path, key, metadata, values = process_queue.get() new_path = os.path.join(path, key) - # TODO this should not be + # TODO this should not be if key in metadata: key_metadata = metadata[key] @@ -256,6 +258,8 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): "config_gui_schema" ) is_overidable = True + is_group = False + any_parent_is_group = False def __init__(self, parent=None): super(ProjectWidget, self).__init__(parent) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 01c69c1c0b..485eda6d35 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -11,6 +11,14 @@ from .widgets import ( from .lib import NOT_SET, AS_WIDGET +class SchemeGroupHierarchyBug(Exception): + def __init__(self, msg=None): + if not msg: + # TODO better message + msg = "SCHEME BUG: Attribute `is_group` is mixed in the hierarchy" + super(SchemeGroupHierarchyBug, self).__init(msg) + + class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal() @@ -20,8 +28,19 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._as_widget = values is AS_WIDGET self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(BooleanWidget, self).__init__(parent) @@ -122,8 +141,19 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(IntegerWidget, self).__init__(parent) @@ -225,8 +255,19 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(FloatWidget, self).__init__(parent) @@ -338,8 +379,19 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._parent = parent self._as_widget = values is AS_WIDGET + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(TextSingleLineWidget, self).__init__(parent) @@ -440,8 +492,19 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group self.is_modified = False - self.is_group = False self.is_overriden = False super(TextMultiLineWidget, self).__init__(parent) @@ -699,8 +762,16 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + self.is_modified = False - self.is_group = False + self.is_group = is_group self.is_overriden = False super(TextListWidget, self).__init__(parent) @@ -747,7 +818,8 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_group and self.is_overidable: + self.is_overriden = True self._update_style() @@ -798,9 +870,19 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): )) self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False - self.is_overriden = False - self.is_group = input_data.get("is_group", False) + self._is_overriden = False + self.is_group = is_group super(DictExpandWidget, self).__init__(parent) self.setObjectName("DictExpandWidget") @@ -850,7 +932,6 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.top_part.clicked.connect(self._top_part_clicked) self.button_toggle.clicked.connect(self.toggle_content) - self._is_overriden = False self.input_fields = [] self.key = input_data["key"] @@ -881,8 +962,15 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): super(DictExpandWidget, self).resizeEvent(event) self.content_widget.updateGeometry() + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + + def _on_value_change(self, value=None): - self.is_overriden = True + if self.is_group: + self._is_overriden = True self.value_changed.emit() @@ -966,9 +1054,19 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False self.is_overriden = False - self.is_group = input_data.get("is_group", False) + self.is_group = is_group super(DictInvisible, self).__init__(parent) self.setObjectName("DictInvisible") @@ -979,7 +1077,6 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self._is_overriden = False self.input_fields = [] if "key" not in input_data: @@ -1047,6 +1144,12 @@ class DictFormWidget(QtWidgets.QWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False self.is_overriden = False self.is_group = False @@ -1168,6 +1271,14 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): self._update_style() self.value_changed.emit() + @property + def is_group(self): + return self._parent.is_group + + @property + def any_parent_is_group(self): + return self._parent.any_parent_is_group + @property def is_overidable(self): return self._parent.is_overidable @@ -1253,6 +1364,14 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): def is_overidable(self): return self._parent.is_overidable + @property + def is_group(self): + return self._parent.is_group + + @property + def any_parent_is_group(self): + return self._parent.any_parent_is_group + def _on_value_change(self): self.value_changed.emit() @@ -1324,10 +1443,20 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): ): self._parent = parent + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + self.is_modified = False self.child_modified = False self.is_overriden = False - self.is_group = input_data.get("is_group", False) + self.is_group = is_group super(ModifiableDict, self).__init__(input_data["label"], parent) self.setObjectName("ModifiableDict") @@ -1346,7 +1475,8 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.child_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_group: + self.is_overriden = True self._update_style() From 9ef5bad10ea76dfe8beccd0925403715658c779b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 27 Jul 2020 18:57:49 +0200 Subject: [PATCH 021/507] added first testing groups --- .../config_gui_schema/ftrack_projects_gui_schema.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json index febf84eb4a..2e930acca5 100644 --- a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json @@ -7,6 +7,7 @@ "key": "status_update", "type": "dict-expanding", "label": "Status updates", + "is_group": true, "children": [ { "key": "Ready", @@ -18,6 +19,7 @@ "key": "status_version_to_task", "type": "dict-expanding", "label": "Version status to Task status", + "is_group": true, "children": [ { "key": "in progress", From 9ec21131f3e258aea80cb762fc03a56eab0e627b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 28 Jul 2020 10:44:15 +0200 Subject: [PATCH 022/507] just fast commit --- pype/tools/config_setting/widgets/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 485eda6d35..c094dcd9db 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -966,7 +966,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): def is_overriden(self): if self._is_overriden: return self._is_overriden - + return self._parent.is_overriden def _on_value_change(self, value=None): if self.is_group: From d234181f93d17de70706b2cd26b1c5fe0ec4a8e8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 28 Jul 2020 17:08:56 +0200 Subject: [PATCH 023/507] added second item for testing --- .../config_gui_schema/ftrack_projects_gui_schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json index 2e930acca5..4a35fc9b61 100644 --- a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json @@ -13,6 +13,10 @@ "key": "Ready", "type": "text-singleline", "label": "Ready" + }, { + "key": "Ready2", + "type": "text-singleline", + "label": "Ready2" } ] }, { From 57a040fadbfbba1e672c3abb7ab044ac0be908aa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 28 Jul 2020 17:28:14 +0200 Subject: [PATCH 024/507] better overridable control --- pype/tools/config_setting/widgets/base.py | 4 +- pype/tools/config_setting/widgets/inputs.py | 195 +++++++++++++------- 2 files changed, 128 insertions(+), 71 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 222cf2ba41..ddeae365d8 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -50,6 +50,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): "config_gui_schema" ) is_overidable = False + is_overriden = False is_group = False any_parent_is_group = False @@ -257,13 +258,14 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): os.path.dirname(os.path.dirname(__file__)), "config_gui_schema" ) - is_overidable = True + is_overriden = False is_group = False any_parent_is_group = False def __init__(self, parent=None): super(ProjectWidget, self).__init__(parent) + self.is_overidable = True self.input_fields = [] scroll_widget = QtWidgets.QScrollArea(self) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index c094dcd9db..2b1b5b3af6 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -41,7 +41,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self.is_modified = False - self.is_overriden = False + self._is_overriden = False super(BooleanWidget, self).__init__(parent) @@ -92,26 +92,33 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def child_overriden(self): - return self.is_overriden + return self._is_overriden @property def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_overidable: + self._is_overriden = True self._update_style() self.value_changed.emit() def _update_style(self): - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" + is_overriden = self.is_overriden + if is_overriden and self.is_modified: + state = "overriden-modified" + elif is_overriden: + state = "overriden" elif self.is_modified: state = "modified" else: @@ -154,7 +161,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self.is_modified = False - self.is_overriden = False + self._is_overriden = False super(IntegerWidget, self).__init__(parent) @@ -192,12 +199,18 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def child_overriden(self): - return self.is_overriden + return self._is_overriden @property def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + def set_value(self, value, origin_value=False): self.int_input.setValue(value) if origin_value: @@ -212,18 +225,19 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_overidable: + self._is_overriden = True self._update_style() self.value_changed.emit() def _update_style(self): - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" + is_overriden = self.is_overriden + if is_overriden and self.is_modified: + state = "overriden-modified" + elif is_overriden: + state = "overriden" elif self.is_modified: state = "modified" else: @@ -268,7 +282,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self.is_modified = False - self.is_overriden = False + self._is_overriden = False super(FloatWidget, self).__init__(parent) @@ -316,12 +330,18 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def child_overriden(self): - return self.is_overriden + return self._is_overriden @property def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + def set_value(self, value, origin_value=False): self.float_input.setValue(value) if origin_value: @@ -336,18 +356,19 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_overidable: + self._is_overriden = True self._update_style() self.value_changed.emit() def _update_style(self): - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" + is_overriden = self.is_overriden + if is_overriden and self.is_modified: + state = "overriden-modified" + elif is_overriden: + state = "overriden" elif self.is_modified: state = "modified" else: @@ -392,7 +413,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self.is_modified = False - self.is_overriden = False + self._is_overriden = False super(TextSingleLineWidget, self).__init__(parent) @@ -430,12 +451,18 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def child_overriden(self): - return self.is_overriden + return self._is_overriden @property def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + def set_value(self, value, origin_value=False): self.text_input.setText(value) if origin_value: @@ -450,18 +477,19 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_overidable: + self._is_overriden = True self._update_style() self.value_changed.emit() def _update_style(self): - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" + is_overriden = self.is_overriden + if is_overriden and self.is_modified: + state = "overriden-modified" + elif is_overriden: + state = "overriden" elif self.is_modified: state = "modified" else: @@ -505,7 +533,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self.is_modified = False - self.is_overriden = False + self._is_overriden = False super(TextMultiLineWidget, self).__init__(parent) @@ -541,12 +569,18 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def child_overriden(self): - return self.is_overriden + return self._is_overriden @property def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + def set_value(self, value, origin_value=False): self.text_input.setPlainText(value) if origin_value: @@ -561,18 +595,19 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - self.is_overriden = True + if self.is_overidable: + self._is_overriden = True self._update_style() self.value_changed.emit() def _update_style(self): - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" + is_overriden = self.is_overriden + if is_overriden and self.is_modified: + state = "overriden-modified" + elif is_overriden: + state = "overriden" elif self.is_modified: state = "modified" else: @@ -770,9 +805,12 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): if is_group and any_parent_is_group: raise SchemeGroupHierarchyBug() + if not any_parent_is_group and not is_group: + is_group = True + self.is_modified = False self.is_group = is_group - self.is_overriden = False + self._is_overriden = False super(TextListWidget, self).__init__(parent) self.setObjectName("TextListWidget") @@ -810,16 +848,22 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def child_overriden(self): - return self.is_overriden + return self._is_overriden @property def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + def _on_value_change(self, value=None): self.is_modified = self.item_value() != self.origin_value - if self.is_group and self.is_overidable: - self.is_overriden = True + if self.is_overidable: + self._is_overriden = True self._update_style() @@ -838,11 +882,11 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value([]) def _update_style(self): - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" + is_overriden = self.is_overriden + if is_overriden and self.is_modified: + state = "overriden-modified" + elif is_overriden: + state = "overriden" elif self.is_modified: state = "modified" else: @@ -969,7 +1013,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def _on_value_change(self, value=None): - if self.is_group: + if self.is_group and self.is_overidable: self._is_overriden = True self.value_changed.emit() @@ -992,13 +1036,10 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.setProperty("state", widget_state) self.style().polish(self) - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" - elif self.is_modified: - state = "modified" + if child_modified and self.is_overriden: + state = "overriden-modified" + elif self.is_overriden: + state = "overriden" else: state = "original" @@ -1065,7 +1106,6 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): self.any_parent_is_group = any_parent_is_group self.is_modified = False - self.is_overriden = False self.is_group = is_group super(DictInvisible, self).__init__(parent) @@ -1089,6 +1129,10 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + @property + def is_overriden(self): + return self._parent.is_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -1184,7 +1228,7 @@ class DictFormWidget(QtWidgets.QWidget): @property def child_overriden(self): - for input_field in self.input_fields: + for input_field in self.input_fields.values(): if input_field.child_overriden: return True return False @@ -1283,6 +1327,10 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + return self._parent.is_overriden + def is_key_modified(self): return self._key() != self.origin_key @@ -1364,6 +1412,10 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + return self._parent.is_overriden + @property def is_group(self): return self._parent.is_group @@ -1455,7 +1507,7 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.is_modified = False self.child_modified = False - self.is_overriden = False + self._is_overriden = False self.is_group = is_group super(ModifiableDict, self).__init__(input_data["label"], parent) @@ -1475,19 +1527,25 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def _on_value_change(self, value=None): self.child_modified = self.item_value() != self.origin_value - if self.is_group: - self.is_overriden = True + if self.is_group and self.is_overidable: + self._is_overriden = True self._update_style() @property def child_overriden(self): - return self.is_overriden + return self._is_overriden @property def is_overidable(self): return self._parent.is_overidable + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + def _update_style(self): child_modified = self.child_modified child_overriden = self.child_overriden @@ -1504,13 +1562,10 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.setProperty("state", widget_state) self.style().polish(self) - if self.is_overidable and self.is_overriden: - if self.is_modified: - state = "overriden-modified" - else: - state = "overriden" - elif self.is_modified: - state = "modified" + if child_modified and self.is_overriden: + state = "overriden-modified" + elif self.is_overriden: + state = "overriden" else: state = "original" From f7323144e0073b2201aadaf02627390b28354db2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 28 Jul 2020 18:54:22 +0200 Subject: [PATCH 025/507] working overriden workflow --- pype/tools/config_setting/style/style.css | 6 - pype/tools/config_setting/widgets/base.py | 10 + pype/tools/config_setting/widgets/inputs.py | 313 ++++++++++---------- 3 files changed, 171 insertions(+), 158 deletions(-) diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/style/style.css index 1371056c1a..aabffc3f84 100644 --- a/pype/tools/config_setting/style/style.css +++ b/pype/tools/config_setting/style/style.css @@ -19,8 +19,6 @@ QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QPlainTextEdit:focus { border: 1px solid #ffffff; } -QLabel[state="original"] {} - QLabel[state="modified"] { color: #137cbd; } @@ -33,8 +31,6 @@ QLabel[state="overriden"] { color: #ff8c1a; } -QWidget[input-state="original"] {} - QWidget[input-state="modified"] { border-color: #137cbd; } @@ -61,8 +57,6 @@ QPushButton[btn-type="expand-toggle"] { background: transparent; } -#DictKey[state="original"] {} - #DictKey[state="modified"] { border-color: #137cbd; } diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index ddeae365d8..e01f14aa70 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -12,6 +12,8 @@ class TypeToKlass: class PypeConfigurationWidget: + default_state = "" + def config_value(self): raise NotImplementedError( "Method `config_value` is not implemented for `{}`.".format( @@ -38,6 +40,14 @@ class PypeConfigurationWidget: value = value[key] return value + def style_state(self, is_overriden, is_modified): + items = [] + if is_overriden: + items.append("overriden") + if is_modified: + items.append("modified") + return "-".join(items) or self.default_state + def add_children_gui(self, child_configuration, values): raise NotImplementedError(( "Method `add_children_gui` is not implemented for `{}`." diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 2b1b5b3af6..e5b929b7ca 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -20,7 +20,7 @@ class SchemeGroupHierarchyBug(Exception): class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -43,6 +43,8 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_modified = False self._is_overriden = False + self._state = None + super(BooleanWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -104,25 +106,23 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def _on_value_change(self, value=None): + def _on_value_change(self, item=None): self.is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True - self._update_style() + self.update_style() - self.value_changed.emit() + self.value_changed.emit(self) - def _update_style(self): - is_overriden = self.is_overriden - if is_overriden and self.is_modified: - state = "overriden-modified" - elif is_overriden: - state = "overriden" - elif self.is_modified: - state = "modified" - else: - state = "original" + def update_style(self, is_overriden=None): + if is_overriden is None: + is_overriden = self.is_overriden + is_modified = self.is_modified + + state = self.style_state(is_overriden, is_modified) + if self._state == state: + return if self._as_widget: property_name = "input-state" @@ -131,6 +131,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.label_widget.setProperty(property_name, state) self.label_widget.style().polish(self.label_widget) + self._state = state def item_value(self): return self.checkbox.isChecked() @@ -140,7 +141,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -163,6 +164,8 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_modified = False self._is_overriden = False + self._state = None + super(IntegerWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -223,25 +226,23 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def reset_value(self): self.set_value(self.origin_value) - def _on_value_change(self, value=None): + def _on_value_change(self, item=None): self.is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True - self._update_style() + self.update_style() - self.value_changed.emit() + self.value_changed.emit(self) - def _update_style(self): - is_overriden = self.is_overriden - if is_overriden and self.is_modified: - state = "overriden-modified" - elif is_overriden: - state = "overriden" - elif self.is_modified: - state = "modified" - else: - state = "original" + def update_style(self, is_overriden=None): + if is_overriden is None: + is_overriden = self.is_overriden + is_modified = self.is_modified + + state = self.style_state(is_overriden, is_modified) + if self._state == state: + return if self._as_widget: property_name = "input-state" @@ -261,7 +262,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -284,6 +285,8 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_modified = False self._is_overriden = False + self._state = None + super(FloatWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -354,25 +357,23 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.set_value(0) - def _on_value_change(self, value=None): + def _on_value_change(self, item=None): self.is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True - self._update_style() + self.update_style() - self.value_changed.emit() + self.value_changed.emit(self) - def _update_style(self): - is_overriden = self.is_overriden - if is_overriden and self.is_modified: - state = "overriden-modified" - elif is_overriden: - state = "overriden" - elif self.is_modified: - state = "modified" - else: - state = "original" + def update_style(self, is_overriden=None): + if is_overriden is None: + is_overriden = self.is_overriden + is_modified = self.is_modified + + state = self.style_state(is_overriden, is_modified) + if self._state == state: + return if self._as_widget: property_name = "input-state" @@ -392,7 +393,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -415,6 +416,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_modified = False self._is_overriden = False + self._state = None + super(TextSingleLineWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -475,25 +478,23 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.set_value("") - def _on_value_change(self, value=None): + def _on_value_change(self, item=None): self.is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True - self._update_style() + self.update_style() - self.value_changed.emit() + self.value_changed.emit(self) - def _update_style(self): - is_overriden = self.is_overriden - if is_overriden and self.is_modified: - state = "overriden-modified" - elif is_overriden: - state = "overriden" - elif self.is_modified: - state = "modified" - else: - state = "original" + def update_style(self, is_overriden=None): + if is_overriden is None: + is_overriden = self.is_overriden + is_modified = self.is_modified + + state = self.style_state(is_overriden, is_modified) + if self._state == state: + return if self._as_widget: property_name = "input-state" @@ -513,7 +514,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -535,6 +536,8 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_modified = False self._is_overriden = False + self._state = None + super(TextMultiLineWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -593,25 +596,23 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.set_value("") - def _on_value_change(self, value=None): + def _on_value_change(self, item=None): self.is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True - self._update_style() + self.update_style() - self.value_changed.emit() + self.value_changed.emit(self) - def _update_style(self): - is_overriden = self.is_overriden - if is_overriden and self.is_modified: - state = "overriden-modified" - elif is_overriden: - state = "overriden" - elif self.is_modified: - state = "modified" - else: - state = "original" + def update_style(self, is_overriden=None): + if is_overriden is None: + is_overriden = self.is_overriden + is_modified = self.is_modified + + state = self.style_state(is_overriden, is_modified) + if self._state == state: + return if self._as_widget: property_name = "input-state" @@ -632,7 +633,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__(self, parent): super(TextListItem, self).__init__(parent) @@ -661,8 +662,8 @@ class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): self.is_single = False - def _on_value_change(self): - self.value_changed.emit() + def _on_value_change(self, item=None): + self.value_changed.emit(self) def row(self): return self.parent().input_fields.index(self) @@ -681,7 +682,7 @@ class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__(self, input_data, values, parent_keys, parent): super(TextListSubWidget, self).__init__(parent) @@ -723,8 +724,8 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.set_value([]) - def _on_value_change(self): - self.value_changed.emit() + def _on_value_change(self, item=None): + self.value_changed.emit(self) def count(self): return len(self.input_fields) @@ -790,7 +791,7 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -812,6 +813,8 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self._is_overriden = False + self._state = None + super(TextListWidget, self).__init__(parent) self.setObjectName("TextListWidget") @@ -860,14 +863,14 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def _on_value_change(self, value=None): + def _on_value_change(self, item=None): self.is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True - self._update_style() + self.update_style() - self.value_changed.emit() + self.value_changed.emit(self) def set_value(self, value, origin_value=False): self.value_widget.set_value(value) @@ -881,16 +884,14 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.set_value([]) - def _update_style(self): - is_overriden = self.is_overriden - if is_overriden and self.is_modified: - state = "overriden-modified" - elif is_overriden: - state = "overriden" - elif self.is_modified: - state = "modified" - else: - state = "original" + def update_style(self, is_overriden=None): + if is_overriden is None: + is_overriden = self.is_overriden + is_modified = self.is_modified + + state = self.style_state(is_overriden, is_modified) + if self._state == state: + return self.label_widget.setProperty("state", state) self.label_widget.style().polish(self.label_widget) @@ -903,7 +904,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -928,6 +929,9 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._is_overriden = False self.is_group = is_group + self._state = None + self._child_state = None + super(DictExpandWidget, self).__init__(parent) self.setObjectName("DictExpandWidget") top_part = ClickableWidget(parent=self) @@ -1012,40 +1016,50 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def _on_value_change(self, value=None): - if self.is_group and self.is_overidable: - self._is_overriden = True + def _on_value_change(self, item=None): + if self.is_group: + if self.is_overidable: + self._is_overriden = True + # TODO update items + if item is not None: + is_overriden = self.is_overriden + for _item in self.input_fields: + if _item is not item: + _item.update_style(is_overriden) - self.value_changed.emit() + self.value_changed.emit(self) - self._update_style() + self.update_style() - def _update_style(self): + def update_style(self, is_overriden=None): child_modified = self.child_modified - child_overriden = self.child_overriden + if is_overriden is None: + child_overriden = self.child_overriden + child_state = self.style_state(child_overriden, child_modified) + if child_state: + child_state = "child-{}".format(child_state) - if child_modified and child_overriden: - widget_state = "child-overriden-modified" - elif child_modified: - widget_state = "child-modified" - elif child_overriden: - widget_state = "child-overriden" + if child_state != self._child_state: + self.setProperty("state", child_state) + self.style().polish(self) + self._child_state = child_state + + if is_overriden is None: + is_overriden = self.is_overriden + + if child_modified and not is_overriden: + state = self.default_state else: - widget_state = "" + state = self.style_state(is_overriden, child_modified) - self.setProperty("state", widget_state) - self.style().polish(self) - - if child_modified and self.is_overriden: - state = "overriden-modified" - elif self.is_overriden: - state = "overriden" - else: - state = "original" + if self._state == state: + return self.button_toggle_text.setProperty("state", state) self.button_toggle_text.style().polish(self.button_toggle_text) + self._state = state + @property def child_modified(self): for input_field in self.input_fields: @@ -1181,7 +1195,7 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): class DictFormWidget(QtWidgets.QWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -1208,8 +1222,8 @@ class DictFormWidget(QtWidgets.QWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) - def _on_value_change(self): - self.value_changed.emit() + def _on_value_change(self, item=None): + self.value_changed.emit(self) def item_value(self): output = {} @@ -1261,7 +1275,7 @@ class DictFormWidget(QtWidgets.QWidget): class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__(self, object_type, parent): self._parent = parent @@ -1311,9 +1325,9 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): def _key(self): return self.key_input.text() - def _on_value_change(self): - self._update_style() - self.value_changed.emit() + def _on_value_change(self, item=None): + self.update_style() + self.value_changed.emit(self) @property def is_group(self): @@ -1341,16 +1355,11 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): def is_modified(self): return self.is_value_modified() or self.is_key_modified() - def _update_style(self): - # if self._is_overidable and self.is_overriden: - # if is_modified: - # state = "overriden-modified" - # else: - # state = "overriden" + def update_style(self, is_overriden=None): if self.is_key_modified(): state = "modified" else: - state = "original" + state = "" self.key_input.setProperty("state", state) self.key_input.style().polish(self.key_input) @@ -1377,7 +1386,7 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__(self, input_data, values, parent_keys, parent): self._parent = parent @@ -1424,8 +1433,8 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): def any_parent_is_group(self): return self._parent.any_parent_is_group - def _on_value_change(self): - self.value_changed.emit() + def _on_value_change(self, item=None): + self.value_changed.emit(self) def count(self): return len(self.input_fields) @@ -1503,6 +1512,9 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): if is_group and any_parent_is_group: raise SchemeGroupHierarchyBug() + if not any_parent_is_group and not is_group: + is_group = True + self.any_parent_is_group = any_parent_is_group self.is_modified = False @@ -1525,12 +1537,12 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.origin_value = self.item_value() - def _on_value_change(self, value=None): + def _on_value_change(self, item=None): self.child_modified = self.item_value() != self.origin_value if self.is_group and self.is_overidable: self._is_overriden = True - self._update_style() + self.update_style() @property def child_overriden(self): @@ -1546,32 +1558,29 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def _update_style(self): + def update_style(self, is_overriden=None): child_modified = self.child_modified - child_overriden = self.child_overriden + if is_overriden is None: + child_overriden = self.child_overriden + child_state = self.style_state(child_overriden, child_modified) + if child_state != self._child_state: + self.setProperty("state", child_state) + self.style().polish(self) + self._child_state = child_state - if child_modified and child_overriden: - widget_state = "child-overriden-modified" - elif child_modified: - widget_state = "child-modified" - elif child_overriden: - widget_state = "child-overriden" + if is_overriden is None: + is_overriden = self.is_overriden + + if child_modified and not is_overriden: + state = self.default_state else: - widget_state = "" - - self.setProperty("state", widget_state) - self.style().polish(self) - - if child_modified and self.is_overriden: - state = "overriden-modified" - elif self.is_overriden: - state = "overriden" - else: - state = "original" + state = self.style_state(self.is_overriden, child_modified) self.label_widget.setProperty("state", state) self.label_widget.style().polish(self.label_widget) + self._state = state + def item_value(self): return self.value_widget.config_value() From ec7bbcf19e4fe59437f8daee3ba3c591e25ab6d0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 29 Jul 2020 15:55:22 +0200 Subject: [PATCH 026/507] small bugfixes and added rawjson widget --- .../config_gui_schema/plugins_gui_schema.json | 24 +++ .../config_gui_schema/project_gui_schema.json | 3 +- pype/tools/config_setting/widgets/base.py | 57 ++++--- pype/tools/config_setting/widgets/inputs.py | 139 +++++++++++++++++- 4 files changed, 198 insertions(+), 25 deletions(-) create mode 100644 pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json b/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json new file mode 100644 index 0000000000..79c1f85b85 --- /dev/null +++ b/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json @@ -0,0 +1,24 @@ +{ + "key": "plugins", + "type": "dict-expanding", + "label": "Plugins", + "children": [ + { + "key": "maya", + "type": "dict-expanding", + "label": "Maya", + "is_group": true, + "children": [ + { + "key": "test1", + "type": "raw-json", + "label": "Test1" + }, { + "key": "test2", + "type": "raw-json", + "label": "Test2" + } + ] + } + ] +} diff --git a/pype/tools/config_setting/config_gui_schema/project_gui_schema.json b/pype/tools/config_setting/config_gui_schema/project_gui_schema.json index 38c07ec33d..d2a6221f99 100644 --- a/pype/tools/config_setting/config_gui_schema/project_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/project_gui_schema.json @@ -6,7 +6,8 @@ { "type": "schema", "children": [ - "ftrack_projects_gui_schema" + "ftrack_projects_gui_schema", + "plugins_gui_schema" ] } ] diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index e01f14aa70..52184b4c8a 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -177,6 +177,7 @@ class ProjectListView(QtWidgets.QListView): class ProjectListWidget(QtWidgets.QWidget): default = "< Default >" + project_changed = QtCore.Signal() def __init__(self, parent): self._parent = parent @@ -218,6 +219,10 @@ class ProjectListWidget(QtWidgets.QWidget): if self.validate_context_change(): self.select_project(new_project_name) self.current_project = new_project_name + self.project_changed.emit() + return + + self.select_project(self.current_project) def validate_context_change(self): # TODO add check if project can be changed (is modified) @@ -275,7 +280,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): def __init__(self, parent=None): super(ProjectWidget, self).__init__(parent) - self.is_overidable = True + self.is_overidable = False self.input_fields = [] scroll_widget = QtWidgets.QScrollArea(self) @@ -292,23 +297,13 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): project_list_widget = ProjectListWidget(self) content_layout.addWidget(project_list_widget) - self.project_list_widget = project_list_widget - self.scroll_widget = scroll_widget - self.content_layout = content_layout - self.content_widget = content_widget - - values = config.project_presets() - schema = config.gui_schema("project_gui_schema") - self.keys = schema.get("keys", []) - self.add_children_gui(schema, values) - footer_widget = QtWidgets.QWidget() footer_layout = QtWidgets.QHBoxLayout(footer_widget) - btn = QtWidgets.QPushButton("Finish") + save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() footer_layout.addWidget(spacer_widget, 1) - footer_layout.addWidget(btn, 0) + footer_layout.addWidget(save_btn, 0) presets_widget = QtWidgets.QWidget() presets_layout = QtWidgets.QVBoxLayout(presets_widget) @@ -326,18 +321,18 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): layout.addWidget(project_list_widget, 0) layout.addWidget(presets_widget, 1) - btn.clicked.connect(self.___finish) + save_btn.clicked.connect(self._save) + project_list_widget.project_changed.connect(self._on_project_change) - def ___finish(self): - output = {} - for item in self.input_fields: - output.update(item.config_value()) + self.project_list_widget = project_list_widget + self.scroll_widget = scroll_widget + self.content_layout = content_layout + self.content_widget = content_widget - for key in reversed(self.keys): - _output = {key: output} - output = _output - - print(json.dumps(output, indent=4)) + values = config.global_project_presets() + schema = config.gui_schema("project_gui_schema") + self.keys = schema.get("keys", []) + self.add_children_gui(schema, values) def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] @@ -348,3 +343,19 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): ) self.input_fields.append(item) self.content_layout.addWidget(item) + + def _on_project_change(self): + self.is_overidable = ( + self.project_list_widget.project_name() is not None + ) + + def _save(self): + output = {} + for item in self.input_fields: + output.update(item.config_value()) + + for key in reversed(self.keys): + _output = {key: output} + output = _output + + print(json.dumps(output, indent=4)) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index e5b929b7ca..58898aeccb 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1,5 +1,5 @@ import json -from Qt import QtWidgets, QtCore +from Qt import QtWidgets, QtCore, QtGui from . import config from .base import PypeConfigurationWidget, TypeToKlass from .widgets import ( @@ -520,6 +520,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self, input_data, values, parent_keys, parent, label_widget=None ): self._parent = parent + self._as_widget = values is AS_WIDGET any_parent_is_group = parent.is_group if not any_parent_is_group: @@ -631,6 +632,141 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: self.item_value()} +class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + self._as_widget = values is AS_WIDGET + + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + if not any_parent_is_group and not is_group: + is_group = True + + self.is_group = is_group + self.is_modified = False + self._is_overriden = False + + self._state = None + + super(RawJsonWidget, self).__init__(parent) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + self.text_input = QtWidgets.QPlainTextEdit() + self.text_input.setTabStopDistance( + QtGui.QFontMetricsF( + self.text_input.font() + ).horizontalAdvance(" ") * 4 + ) + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget) + layout.addWidget(self.text_input) + + self.label_widget = label_widget + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + value = self.value_from_values(values) + if value is not NOT_SET: + self.text_input.setPlainText(value) + + self.origin_value = self.item_value() + + self.text_input.textChanged.connect(self._on_value_change) + + @property + def child_modified(self): + return self.is_modified + + @property + def child_overriden(self): + return self._is_overriden + + @property + def is_overidable(self): + return self._parent.is_overidable + + @property + def is_overriden(self): + if self._is_overriden: + return self._is_overriden + return self._parent.is_overriden + + def validate_value(self, value): + try: + json.dumps(value) + return True + except Exception: + return False + + def set_value(self, value, origin_value=False): + is_valid = self.validate_value(value) + if is_valid: + value = json.dumps(value, indent=4) + self.text_input.setPlainText(value) + + if origin_value: + self.origin_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.origin_value) + + def clear_value(self): + self.set_value("{{}}") + + def _on_value_change(self, item=None): + self.is_modified = self.item_value() != self.origin_value + if self.is_overidable: + self._is_overriden = True + + self.update_style() + + self.value_changed.emit(self) + + def update_style(self, is_overriden=None): + if is_overriden is None: + is_overriden = self.is_overriden + is_modified = self.is_modified + + state = self.style_state(is_overriden, is_modified) + if self._state == state: + return + + if self._as_widget: + property_name = "input-state" + widget = self.text_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) + + def item_value(self): + return self.text_input.toPlainText() + + def config_value(self): + return {self.key: self.item_value()} + + class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 value_changed = QtCore.Signal(object) @@ -1591,6 +1727,7 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): TypeToKlass.types["boolean"] = BooleanWidget TypeToKlass.types["text-singleline"] = TextSingleLineWidget TypeToKlass.types["text-multiline"] = TextMultiLineWidget +TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["int"] = IntegerWidget TypeToKlass.types["float"] = FloatWidget TypeToKlass.types["dict-expanding"] = DictExpandWidget From 0ab6161193abfc2066edc230d143bb4064a055e6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 29 Jul 2020 16:07:45 +0200 Subject: [PATCH 027/507] minor changes in raw json --- pype/tools/config_setting/style/style.css | 4 ++++ pype/tools/config_setting/widgets/inputs.py | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/style/style.css index aabffc3f84..adf8344f89 100644 --- a/pype/tools/config_setting/style/style.css +++ b/pype/tools/config_setting/style/style.css @@ -57,6 +57,10 @@ QPushButton[btn-type="expand-toggle"] { background: transparent; } +#RawJson[state="invalid"] { + border-color: #ff5511; +} + #DictKey[state="modified"] { border-color: #137cbd; } diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 58898aeccb..50bd3d58f4 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -658,6 +658,8 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._state = None + self.is_valid = None + super(RawJsonWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) @@ -665,6 +667,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): layout.setSpacing(0) self.text_input = QtWidgets.QPlainTextEdit() + self.text_input.setObjectName("RawJson") self.text_input.setTabStopDistance( QtGui.QFontMetricsF( self.text_input.font() @@ -710,6 +713,8 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def validate_value(self, value): + if not value: + return True try: json.dumps(value) return True @@ -720,6 +725,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_valid = self.validate_value(value) if is_valid: value = json.dumps(value, indent=4) + self.text_input.setPlainText(value) if origin_value: @@ -730,13 +736,23 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.origin_value) def clear_value(self): - self.set_value("{{}}") + self.set_value("") def _on_value_change(self, item=None): - self.is_modified = self.item_value() != self.origin_value + value = self.item_value() + self.is_modified = value != self.origin_value if self.is_overidable: self._is_overriden = True + is_valid = self.validate_value(value) + if is_valid != self.is_valid: + self.is_valid = is_valid + if is_valid: + state = "" + else: + state = "invalid" + self.text_input.setProperty("state", state) + self.text_input.style().polish(self.text_input) self.update_style() self.value_changed.emit(self) From 7f156a957e9eabce4d214a573cdb55bf0303796e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 10:47:09 +0200 Subject: [PATCH 028/507] input have is_modified property methods and was_overriden attribute --- pype/tools/config_setting/widgets/inputs.py | 65 ++++++++++++++++----- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 50bd3d58f4..5fadf2ee60 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -40,7 +40,8 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_group = True self.is_group = is_group - self.is_modified = False + self._is_modified = False + self.was_overriden = False self._is_overriden = False self._state = None @@ -96,6 +97,10 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_overriden(self): return self._is_overriden + @property + def is_modified(self): + return self._is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -107,7 +112,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def _on_value_change(self, item=None): - self.is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True @@ -161,7 +166,8 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_group = True self.is_group = is_group - self.is_modified = False + self._is_modified = False + self.was_overriden = False self._is_overriden = False self._state = None @@ -204,6 +210,10 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_overriden(self): return self._is_overriden + @property + def is_modified(self): + return self._is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -227,7 +237,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.origin_value) def _on_value_change(self, item=None): - self.is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True @@ -282,7 +292,8 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_group = True self.is_group = is_group - self.is_modified = False + self._is_modified = False + self.was_overriden = False self._is_overriden = False self._state = None @@ -335,6 +346,10 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_overriden(self): return self._is_overriden + @property + def is_modified(self): + return self._is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -358,7 +373,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(0) def _on_value_change(self, item=None): - self.is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True @@ -413,7 +428,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_group = True self.is_group = is_group - self.is_modified = False + self._is_modified = False + self.was_overriden = False self._is_overriden = False self._state = None @@ -456,6 +472,10 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_overriden(self): return self._is_overriden + @property + def is_modified(self): + return self._is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -479,7 +499,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value("") def _on_value_change(self, item=None): - self.is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True @@ -535,6 +555,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self.is_modified = False + self.was_overriden = False self._is_overriden = False self._state = None @@ -575,6 +596,10 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_overriden(self): return self._is_overriden + @property + def is_modified(self): + return self._is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -598,7 +623,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value("") def _on_value_change(self, item=None): - self.is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True @@ -653,7 +678,8 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_group = True self.is_group = is_group - self.is_modified = False + self._is_modified = False + self.was_overriden = False self._is_overriden = False self._state = None @@ -702,6 +728,10 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_overriden(self): return self._is_overriden + @property + def is_modified(self): + return self._is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -740,7 +770,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_value_change(self, item=None): value = self.item_value() - self.is_modified = value != self.origin_value + self._is_modified = value != self.origin_value if self.is_overidable: self._is_overriden = True @@ -961,7 +991,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): if not any_parent_is_group and not is_group: is_group = True - self.is_modified = False + self._is_modified = False self.is_group = is_group self._is_overriden = False @@ -1005,6 +1035,10 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def child_overriden(self): return self._is_overriden + @property + def is_modified(self): + return self._is_modified + @property def is_overidable(self): return self._parent.is_overidable @@ -1016,7 +1050,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def _on_value_change(self, item=None): - self.is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.origin_value if self.is_overidable: self._is_overriden = True @@ -1713,6 +1747,8 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def update_style(self, is_overriden=None): child_modified = self.child_modified if is_overriden is None: + is_overriden = self.is_overriden + child_overriden = self.child_overriden child_state = self.style_state(child_overriden, child_modified) if child_state != self._child_state: @@ -1720,9 +1756,6 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.style().polish(self) self._child_state = child_state - if is_overriden is None: - is_overriden = self.is_overriden - if child_modified and not is_overriden: state = self.default_state else: From fde11ec034de0d9f414119c878dcb007f7603b9c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 11:15:05 +0200 Subject: [PATCH 029/507] is_modified also looks if overridatio nhas changed --- pype/tools/config_setting/widgets/inputs.py | 27 +++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 5fadf2ee60..052520d8d5 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -41,7 +41,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self._is_modified = False - self.was_overriden = False + self._was_overriden = False self._is_overriden = False self._state = None @@ -99,7 +99,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): @@ -167,7 +167,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self._is_modified = False - self.was_overriden = False + self._was_overriden = False self._is_overriden = False self._state = None @@ -212,7 +212,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): @@ -293,7 +293,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self._is_modified = False - self.was_overriden = False + self._was_overriden = False self._is_overriden = False self._state = None @@ -348,7 +348,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): @@ -429,7 +429,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self._is_modified = False - self.was_overriden = False + self._was_overriden = False self._is_overriden = False self._state = None @@ -474,7 +474,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): @@ -555,7 +555,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self.is_modified = False - self.was_overriden = False + self._was_overriden = False self._is_overriden = False self._state = None @@ -598,7 +598,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): @@ -679,7 +679,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_group = is_group self._is_modified = False - self.was_overriden = False + self._was_overriden = False self._is_overriden = False self._state = None @@ -730,7 +730,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): @@ -993,6 +993,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._is_modified = False self.is_group = is_group + self._was_overriden = False self._is_overriden = False self._state = None @@ -1037,7 +1038,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): From 2a4a81bde19fe47a01d03c79af9878a6d170c86d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 14:45:27 +0200 Subject: [PATCH 030/507] raw json input has special input widget --- pype/tools/config_setting/style/style.css | 2 +- pype/tools/config_setting/widgets/inputs.py | 90 ++++++++++++++------- 2 files changed, 60 insertions(+), 32 deletions(-) diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/style/style.css index adf8344f89..a0c5db86a1 100644 --- a/pype/tools/config_setting/style/style.css +++ b/pype/tools/config_setting/style/style.css @@ -57,7 +57,7 @@ QPushButton[btn-type="expand-toggle"] { background: transparent; } -#RawJson[state="invalid"] { +#RawJsonInput[state="invalid"] { border-color: #ff5511; } diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 052520d8d5..bd7d4b501f 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -657,6 +657,63 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: self.item_value()} +class RawJsonInput(QtWidgets.QPlainTextEdit): + tab_length = 4 + + def __init__(self, *args, **kwargs): + super(RawJsonInput, self).__init__(*args, **kwargs) + self.setObjectName("RawJsonInput") + self.setTabStopDistance( + QtGui.QFontMetricsF( + self.font() + ).horizontalAdvance(" ") * self.tab_length + ) + + self.is_valid = None + + def set_value(self, value): + self.setPlainText(value) + + def setPlainText(self, *args, **kwargs): + super(RawJsonInput, self).setPlainText(*args, **kwargs) + self.validate() + + def focusOutEvent(self, event): + super(RawJsonInput, self).focusOutEvent(event) + self.validate() + + def validate_value(self, value): + if isinstance(value, str) and not value: + return True + + try: + json.loads(value) + return True + except Exception: + return False + + def update_style(self, is_valid=None): + if is_valid is None: + return self.validate() + + if is_valid != self.is_valid: + self.is_valid = is_valid + if is_valid: + state = "" + else: + state = "invalid" + self.setProperty("state", state) + self.style().polish(self) + + def value(self): + return self.toPlainText() + + def validate(self): + value = self.value() + is_valid = self.validate_value(value) + self.update_style(is_valid) + + class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal(object) @@ -684,21 +741,14 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._state = None - self.is_valid = None - super(RawJsonWidget, self).__init__(parent) layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) - self.text_input = QtWidgets.QPlainTextEdit() - self.text_input.setObjectName("RawJson") - self.text_input.setTabStopDistance( - QtGui.QFontMetricsF( - self.text_input.font() - ).horizontalAdvance(" ") * 4 - ) + self.text_input = RawJsonInput() + if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) @@ -742,20 +792,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def validate_value(self, value): - if not value: - return True - try: - json.dumps(value) - return True - except Exception: - return False - def set_value(self, value, origin_value=False): - is_valid = self.validate_value(value) - if is_valid: - value = json.dumps(value, indent=4) - self.text_input.setPlainText(value) if origin_value: @@ -774,15 +811,6 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): if self.is_overidable: self._is_overriden = True - is_valid = self.validate_value(value) - if is_valid != self.is_valid: - self.is_valid = is_valid - if is_valid: - state = "" - else: - state = "invalid" - self.text_input.setProperty("state", state) - self.text_input.style().polish(self.text_input) self.update_style() self.value_changed.emit(self) From fb2681f98618b41a54e6dabc78364acf7b6a391c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 15:53:55 +0200 Subject: [PATCH 031/507] renamed origin_value to default_value --- pype/tools/config_setting/widgets/inputs.py | 106 ++++++++++---------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index bd7d4b501f..e3e60612cc 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -73,22 +73,24 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: self.checkbox.setChecked(value) - self.origin_value = self.item_value() + self.default_value = self.item_value() self.checkbox.stateChanged.connect(self._on_value_change) - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): self.checkbox.setChecked(value) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def clear_value(self): self.reset_value() + def apply_overrides(self, overrides): + @property def child_modified(self): return self.is_modified @@ -112,7 +114,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -198,7 +200,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: self.int_input.setValue(value) - self.origin_value = self.item_value() + self.default_value = self.item_value() self.int_input.valueChanged.connect(self._on_value_change) @@ -224,20 +226,20 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): self.int_input.setValue(value) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def clear_value(self): self.set_value(0) def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -334,7 +336,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: self.float_input.setValue(value) - self.origin_value = self.item_value() + self.default_value = self.item_value() self.float_input.valueChanged.connect(self._on_value_change) @@ -360,20 +362,20 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): self.float_input.setValue(value) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def clear_value(self): self.set_value(0) def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -460,7 +462,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: self.text_input.setText(value) - self.origin_value = self.item_value() + self.default_value = self.item_value() self.text_input.textChanged.connect(self._on_value_change) @@ -486,20 +488,20 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): self.text_input.setText(value) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def clear_value(self): self.set_value("") def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -584,7 +586,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: self.text_input.setPlainText(value) - self.origin_value = self.item_value() + self.default_value = self.item_value() self.text_input.textChanged.connect(self._on_value_change) @@ -610,20 +612,20 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): self.text_input.setPlainText(value) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def clear_value(self): self.set_value("") def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -766,7 +768,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: self.text_input.setPlainText(value) - self.origin_value = self.item_value() + self.default_value = self.item_value() self.text_input.textChanged.connect(self._on_value_change) @@ -792,22 +794,22 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): self.text_input.setPlainText(value) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def clear_value(self): self.set_value("") def _on_value_change(self, item=None): value = self.item_value() - self._is_modified = value != self.origin_value + self._is_modified = value != self.default_value if self.is_overidable: self._is_overriden = True @@ -915,21 +917,21 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: self.set_value(value) - self.origin_value = self.item_value() + self.default_value = self.item_value() - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): for input_field in self.input_fields: self.remove_row(input_field) for item_text in value: self.add_row(text=item_text) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def clear_value(self): self.set_value([]) @@ -1054,7 +1056,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): layout.addWidget(self.value_widget) self.setLayout(layout) - self.origin_value = self.item_value() + self.default_value = self.item_value() @property def child_modified(self): @@ -1079,7 +1081,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.origin_value + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -1087,14 +1089,14 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def set_value(self, value, origin_value=False): + def set_value(self, value, default_value=False): self.value_widget.set_value(value) - if origin_value: - self.origin_value = self.item_value() + if default_value: + self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.origin_value) + self.set_value(self.default_value) def clear_value(self): self.set_value([]) @@ -1533,7 +1535,7 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): self.value_input.value_changed.connect(self._on_value_change) self.origin_key = self._key() - self.origin_value = self.value_input.item_value() + self.default_value = self.value_input.item_value() self.is_single = False @@ -1630,7 +1632,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): if self.count() == 0: self.add_row() - self.origin_value = self.config_value() + self.default_value = self.config_value() @property def is_overidable(self): @@ -1680,7 +1682,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not None and key is not None: item_widget.origin_key = key item_widget.key_input.setText(key) - item_widget.value_input.set_value(value, origin_value=True) + item_widget.value_input.set_value(value, default_value=True) else: self._on_value_change() self.parent().updateGeometry() @@ -1750,10 +1752,10 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.key = input_data["key"] - self.origin_value = self.item_value() + self.default_value = self.item_value() def _on_value_change(self, item=None): - self.child_modified = self.item_value() != self.origin_value + self.child_modified = self.item_value() != self.default_value if self.is_group and self.is_overidable: self._is_overriden = True From a59aa34a8ab27b202c377c2134db3a9b17bbfda0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 16:04:39 +0200 Subject: [PATCH 032/507] just added override_value attribute --- pype/tools/config_setting/widgets/inputs.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index e3e60612cc..5f0411b72b 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -74,6 +74,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.checkbox.setChecked(value) self.default_value = self.item_value() + self.override_value = None self.checkbox.stateChanged.connect(self._on_value_change) @@ -201,6 +202,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.int_input.setValue(value) self.default_value = self.item_value() + self.override_value = None self.int_input.valueChanged.connect(self._on_value_change) @@ -337,6 +339,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.float_input.setValue(value) self.default_value = self.item_value() + self.override_value = None self.float_input.valueChanged.connect(self._on_value_change) @@ -463,6 +466,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.text_input.setText(value) self.default_value = self.item_value() + self.override_value = None self.text_input.textChanged.connect(self._on_value_change) @@ -587,6 +591,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.text_input.setPlainText(value) self.default_value = self.item_value() + self.override_value = None self.text_input.textChanged.connect(self._on_value_change) @@ -769,6 +774,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.text_input.setPlainText(value) self.default_value = self.item_value() + self.override_value = None self.text_input.textChanged.connect(self._on_value_change) @@ -918,6 +924,7 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(value) self.default_value = self.item_value() + self.override_value = None def set_value(self, value, default_value=False): for input_field in self.input_fields: @@ -1057,6 +1064,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.setLayout(layout) self.default_value = self.item_value() + self.override_value = None @property def child_modified(self): @@ -1534,9 +1542,12 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): self.key_input.textChanged.connect(self._on_value_change) self.value_input.value_changed.connect(self._on_value_change) - self.origin_key = self._key() + self.default_key = self._key() self.default_value = self.value_input.item_value() + self.override_key = None + self.override_value = None + self.is_single = False def _key(self): @@ -1563,7 +1574,7 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def is_key_modified(self): - return self._key() != self.origin_key + return self._key() != self.default_key def is_value_modified(self): return self.value_input.is_modified @@ -1633,6 +1644,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.add_row() self.default_value = self.config_value() + self.override_value = None @property def is_overidable(self): @@ -1680,7 +1692,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): # Set value if entered value is not None # else (when add button clicked) trigger `_on_value_change` if value is not None and key is not None: - item_widget.origin_key = key + item_widget.default_key = key item_widget.key_input.setText(key) item_widget.value_input.set_value(value, default_value=True) else: @@ -1753,6 +1765,7 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.key = input_data["key"] self.default_value = self.item_value() + self.override_value = None def _on_value_change(self, item=None): self.child_modified = self.item_value() != self.default_value From 407fbbe77babb1fddf7fec433152d7c2b3cf8831 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 16:57:09 +0200 Subject: [PATCH 033/507] call aplpy_overrides on project change --- pype/tools/config_setting/widgets/base.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 52184b4c8a..a90eefd400 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -345,9 +345,17 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.content_layout.addWidget(item) def _on_project_change(self): - self.is_overidable = ( - self.project_list_widget.project_name() is not None - ) + project_name = self.project_list_widget.project_name() + + if project_name is None: + overrides = None + self.is_overidable = False + else: + overrides = config.project_preset_overrides(project_name) + self.is_overidable = True + + for item in self.input_fields: + item.apply_overrides(overrides) def _save(self): output = {} From 2e7980104f1cee00828455148e48250a8fc7c04b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 16:57:54 +0200 Subject: [PATCH 034/507] addde apply_overrides to inputs --- pype/tools/config_setting/widgets/inputs.py | 76 +++++++++++++++++---- 1 file changed, 63 insertions(+), 13 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 5f0411b72b..ea6a9e3483 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -78,19 +78,30 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.checkbox.stateChanged.connect(self._on_value_change) - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): self.checkbox.setChecked(value) if default_value: self.default_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.default_value) + if self.is_overidable: + self.set_value(self.override_value) + else: + self.set_value(self.default_value) def clear_value(self): self.reset_value() - def apply_overrides(self, overrides): + def apply_overrides(self, override_value): + self.override_value = override_value + if override_value is None: + self._is_overriden = False + value = self.default_value + else: + self._is_overriden = True + value = override_value + self.checkbox.setChecked(value) @property def child_modified(self): @@ -115,9 +126,17 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.default_value + _value = self.item_value() + is_modified = None if self.is_overidable: self._is_overriden = True + if self.override_value is not None: + is_modified = _value != self.override_value + + if is_modified is None: + is_modified = _value != self.default_value + + self._is_modified = is_modified self.update_style() @@ -228,7 +247,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): self.int_input.setValue(value) if default_value: self.default_value = self.item_value() @@ -240,6 +259,16 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def reset_value(self): self.set_value(self.default_value) + def apply_overrides(self, override_value): + self.override_value = override_value + if override_value is None: + self._is_overriden = False + value = self.default_value + else: + self._is_overriden = True + value = override_value + self.int_input.setValue(value) + def _on_value_change(self, item=None): self._is_modified = self.item_value() != self.default_value if self.is_overidable: @@ -365,7 +394,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): self.float_input.setValue(value) if default_value: self.default_value = self.item_value() @@ -374,6 +403,16 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def reset_value(self): self.set_value(self.default_value) + def apply_overrides(self, override_value): + self.override_value = override_value + if override_value is None: + self._is_overriden = False + value = self.default_value + else: + self._is_overriden = True + value = override_value + self.float_input.setChecked(value) + def clear_value(self): self.set_value(0) @@ -492,7 +531,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): self.text_input.setText(value) if default_value: self.default_value = self.item_value() @@ -501,6 +540,9 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def reset_value(self): self.set_value(self.default_value) + def apply_overrides(self, override_value): + self.set_value(override_value, override_value=True) + def clear_value(self): self.set_value("") @@ -617,7 +659,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) if default_value: self.default_value = self.item_value() @@ -626,6 +668,9 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def reset_value(self): self.set_value(self.default_value) + def apply_overrides(self, override_value): + self.set_value(override_value, override_value=True) + def clear_value(self): self.set_value("") @@ -678,7 +723,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.is_valid = None - def set_value(self, value): + def set_value(self, value, *, default_value=False): self.setPlainText(value) def setPlainText(self, *args, **kwargs): @@ -800,9 +845,8 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) - if default_value: self.default_value = self.item_value() self._on_value_change() @@ -813,6 +857,9 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.set_value("") + def apply_overrides(self, override_value): + self.set_value(override_value, override_value=True) + def _on_value_change(self, item=None): value = self.item_value() self._is_modified = value != self.default_value @@ -926,7 +973,7 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.default_value = self.item_value() self.override_value = None - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): for input_field in self.input_fields: self.remove_row(input_field) @@ -1097,7 +1144,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def set_value(self, value, default_value=False): + def set_value(self, value, *, default_value=False): self.value_widget.set_value(value) if default_value: self.default_value = self.item_value() @@ -1109,6 +1156,9 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def clear_value(self): self.set_value([]) + def apply_overrides(self, override_value): + self.set_value(override_value, override_value=True) + def update_style(self, is_overriden=None): if is_overriden is None: is_overriden = self.is_overriden From 04f650b9b59637adc74e3b6e9a67eff2f142a5e8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 18:12:01 +0200 Subject: [PATCH 035/507] project overrides are appliable for boolean --- pype/tools/config_setting/widgets/inputs.py | 98 ++++++++++++++++++--- 1 file changed, 88 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index ea6a9e3483..53bb2d729d 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -95,13 +95,16 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self.override_value = override_value + self._is_modified = False if override_value is None: self._is_overriden = False + self._was_overriden = False value = self.default_value else: self._is_overriden = True + self._was_overriden = True value = override_value - self.checkbox.setChecked(value) + self.set_value(value) @property def child_modified(self): @@ -113,7 +116,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self._was_overriden != self._is_overriden) @property def is_overidable(self): @@ -267,7 +270,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: self._is_overriden = True value = override_value - self.int_input.setValue(value) + self.set_value(value) def _on_value_change(self, item=None): self._is_modified = self.item_value() != self.default_value @@ -411,7 +414,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: self._is_overriden = True value = override_value - self.float_input.setChecked(value) + self.set_value(value) def clear_value(self): self.set_value(0) @@ -541,7 +544,14 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.default_value) def apply_overrides(self, override_value): - self.set_value(override_value, override_value=True) + self.override_value = override_value + if override_value is None: + self._is_overriden = False + value = self.default_value + else: + self._is_overriden = True + value = override_value + self.set_value(value) def clear_value(self): self.set_value("") @@ -669,7 +679,14 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.default_value) def apply_overrides(self, override_value): - self.set_value(override_value, override_value=True) + self.override_value = override_value + if override_value is None: + self._is_overriden = False + value = self.default_value + else: + self._is_overriden = True + value = override_value + self.set_value(value) def clear_value(self): self.set_value("") @@ -858,7 +875,14 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value("") def apply_overrides(self, override_value): - self.set_value(override_value, override_value=True) + self.override_value = override_value + if override_value is None: + self._is_overriden = False + value = self.default_value + else: + self._is_overriden = True + value = override_value + self.set_value(value) def _on_value_change(self, item=None): value = self.item_value() @@ -1157,7 +1181,14 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value([]) def apply_overrides(self, override_value): - self.set_value(override_value, override_value=True) + self.override_value = override_value + if override_value is None: + self._is_overriden = False + value = self.default_value + else: + self._is_overriden = True + value = override_value + self.set_value(value) def update_style(self, is_overriden=None): if is_overriden is None: @@ -1291,6 +1322,14 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden + def apply_overrides(self, override_value): + for item in self.input_fields: + if override_value is None: + child_value = None + else: + child_value = override_value.get(item.key) + item.apply_overrides(child_value) + def _on_value_change(self, item=None): if self.is_group: if self.is_overidable: @@ -1379,6 +1418,8 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal(object) + def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): @@ -1418,6 +1459,9 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + def update_style(self, *args, **kwargs): + return + @property def is_overriden(self): return self._parent.is_overriden @@ -1465,9 +1509,32 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): ) self.layout().addWidget(item) + item.value_changed.connect(self._on_value_change) + self.input_fields.append(item) return item + def _on_value_change(self, item=None): + if self.is_group: + if self.is_overidable: + self._is_overriden = True + # TODO update items + if item is not None: + is_overriden = self.is_overriden + for _item in self.input_fields: + if _item is not item: + _item.update_style(is_overriden) + + self.value_changed.emit(self) + + def apply_overrides(self, override_value): + for item in self.input_fields: + if override_value is None: + child_value = None + else: + child_value = override_value.get(item.key) + item.apply_overrides(child_value) + class DictFormWidget(QtWidgets.QWidget): value_changed = QtCore.Signal(object) @@ -1777,6 +1844,10 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): + # Should be used only for dictionary with one datatype as value + # TODO this is actually input field (do not care if is group or not) + value_changed = QtCore.Signal(object) + def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -1819,8 +1890,12 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def _on_value_change(self, item=None): self.child_modified = self.item_value() != self.default_value - if self.is_group and self.is_overidable: - self._is_overriden = True + + if self.is_group: + if self.is_overidable: + self._is_overriden = True + + self.value_changed.emit(self) self.update_style() @@ -1838,6 +1913,9 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden + def apply_overrides(self, override_value): + print(self, override_value) + def update_style(self, is_overriden=None): child_modified = self.child_modified if is_overriden is None: From 369e1cc08a2b8c8d637b1b17839a7e3fa7f91883 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 18:12:17 +0200 Subject: [PATCH 036/507] added testing data --- .../kuba_each_case/plugins/maya/publish.json | 8 ++++ .../config/studio_presets/global/tools.json | 6 +++ .../config_gui_schema/plugins_gui_schema.json | 37 +++++++++++++++---- 3 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json create mode 100644 pype/tools/config_setting/config/studio_presets/global/tools.json diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json new file mode 100644 index 0000000000..46fc343b6c --- /dev/null +++ b/pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json @@ -0,0 +1,8 @@ +{ + "ValidateModelName": { + "enabled": true + }, + "ValidateAssemblyName": { + "enabled": false + } +} diff --git a/pype/tools/config_setting/config/studio_presets/global/tools.json b/pype/tools/config_setting/config/studio_presets/global/tools.json new file mode 100644 index 0000000000..53aab7b2ca --- /dev/null +++ b/pype/tools/config_setting/config/studio_presets/global/tools.json @@ -0,0 +1,6 @@ +{ + "mtoa_3.0.1": false, + "mtoa_3.1.1": false, + "mtoa_3.2.0": false, + "yeti_2.1.2": false +} \ No newline at end of file diff --git a/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json b/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json index 79c1f85b85..6c83fee172 100644 --- a/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json @@ -7,16 +7,37 @@ "key": "maya", "type": "dict-expanding", "label": "Maya", - "is_group": true, "children": [ { - "key": "test1", - "type": "raw-json", - "label": "Test1" - }, { - "key": "test2", - "type": "raw-json", - "label": "Test2" + "key": "publish", + "type": "dict-expanding", + "label": "Publish plugins", + "is_group": true, + "children": [ + { + "key": "ValidateModelName", + "type": "dict-invisible", + "label": "Validate Model Name", + "children": [ + { + "key": "enabled", + "type": "boolean", + "label": "Enabled" + } + ] + }, { + "key": "ValidateAssemblyName", + "type": "dict-invisible", + "label": "Validate Assembly Name", + "children": [ + { + "key": "enabled", + "type": "boolean", + "label": "Enabled" + } + ] + } + ] } ] } From d6a998d953cc68e0b9f8fce6588728bf7fc464d6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 6 Aug 2020 19:01:13 +0200 Subject: [PATCH 037/507] project change won't affect state attributes --- pype/tools/config_setting/widgets/inputs.py | 68 +++++++++++++++------ 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 53bb2d729d..a192a370b0 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -76,16 +76,29 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.default_value = self.item_value() self.override_value = None + self._ignore_value_change = False + self.checkbox.stateChanged.connect(self._on_value_change) - def set_value(self, value, *, default_value=False): + def set_value( + self, value, *, + ignore_attr_changes=True, + default_value=False + ): + # Ignore value change because if `self.isChecked()` has same + # value as `value` the `_on_value_change` is not triggered + self._ignore_value_change = True + self.checkbox.setChecked(value) + if default_value: + ignore_attr_changes = True self.default_value = self.item_value() - self._on_value_change() + + self._on_value_change(ignore_attr_changes=ignore_attr_changes) def reset_value(self): - if self.is_overidable: + if self.is_overidable and self.override_value is not None: self.set_value(self.override_value) else: self.set_value(self.default_value) @@ -95,7 +108,6 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self.override_value = override_value - self._is_modified = False if override_value is None: self._is_overriden = False self._was_overriden = False @@ -104,7 +116,12 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._is_overriden = True self._was_overriden = True value = override_value - self.set_value(value) + + self._is_modified = False + + self.set_value(value, ignore_attr_changes=True) + + print("apply_overrides", self.keys, override_value) @property def child_modified(self): @@ -128,18 +145,23 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def _on_value_change(self, item=None): - _value = self.item_value() - is_modified = None - if self.is_overidable: - self._is_overriden = True - if self.override_value is not None: - is_modified = _value != self.override_value + def _on_value_change(self, item=None, ignore_attr_changes=False): + if self._ignore_value_change: + self._ignore_value_change = False + return - if is_modified is None: - is_modified = _value != self.default_value + if not ignore_attr_changes: + _value = self.item_value() + is_modified = None + if self.is_overidable: + self._is_overriden = True + if self.override_value is not None: + is_modified = _value != self.override_value - self._is_modified = is_modified + if is_modified is None: + is_modified = _value != self.default_value + + self._is_modified = is_modified self.update_style() @@ -1293,6 +1315,8 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): keys.append(self.key) self.keys = keys + self._ignore_value_change = False + for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) @@ -1323,6 +1347,9 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._parent.is_overriden def apply_overrides(self, override_value): + self._ignore_value_change = True + + self._is_overriden = False for item in self.input_fields: if override_value is None: child_value = None @@ -1330,8 +1357,15 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): child_value = override_value.get(item.key) item.apply_overrides(child_value) - def _on_value_change(self, item=None): - if self.is_group: + self._ignore_value_change = False + + self._on_value_change(ignore_attr_changes=True) + + def _on_value_change(self, item=None, ignore_attr_changes=False): + if self._ignore_value_change: + return + + if not ignore_attr_changes and self.is_group: if self.is_overidable: self._is_overriden = True # TODO update items From ca948504997739e334e661b680ad5bbc72d04d01 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 7 Aug 2020 11:59:11 +0200 Subject: [PATCH 038/507] added testing schema --- .../config_gui_schema/project_gui_schema.json | 1 + .../test_project_schema.json | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 pype/tools/config_setting/config_gui_schema/test_project_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/project_gui_schema.json b/pype/tools/config_setting/config_gui_schema/project_gui_schema.json index d2a6221f99..366400e5ff 100644 --- a/pype/tools/config_setting/config_gui_schema/project_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/project_gui_schema.json @@ -6,6 +6,7 @@ { "type": "schema", "children": [ + "test_project_schema", "ftrack_projects_gui_schema", "plugins_gui_schema" ] diff --git a/pype/tools/config_setting/config_gui_schema/test_project_schema.json b/pype/tools/config_setting/config_gui_schema/test_project_schema.json new file mode 100644 index 0000000000..e789b422a3 --- /dev/null +++ b/pype/tools/config_setting/config_gui_schema/test_project_schema.json @@ -0,0 +1,33 @@ +{ + "key": "test_inputs", + "type": "dict-expanding", + "label": "Test inputs", + "is_group": true, + "children": [ + { + "key": "boolean", + "type": "boolean", + "label": "Boolean" + }, { + "key": "test_singleline", + "type": "text-singleline", + "label": "Text singleline" + }, { + "key": "test_multiline", + "type": "text-multiline", + "label": "Text multiline" + }, { + "key": "raw_json", + "type": "raw-json", + "label": "Raw json" + }, { + "key": "int", + "type": "int", + "label": "Int" + }, { + "key": "float", + "type": "float", + "label": "Float" + } + ] +} From 3d24d4db53fbff285ffa67658f27486bf7d37497 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 7 Aug 2020 11:59:29 +0200 Subject: [PATCH 039/507] added ignore to integer --- pype/tools/config_setting/widgets/inputs.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index a192a370b0..7e91d11a21 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -121,8 +121,6 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(value, ignore_attr_changes=True) - print("apply_overrides", self.keys, override_value) - @property def child_modified(self): return self.is_modified @@ -248,6 +246,8 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.default_value = self.item_value() self.override_value = None + self._ignore_value_change = False + self.int_input.valueChanged.connect(self._on_value_change) @property @@ -294,10 +294,15 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): value = override_value self.set_value(value) - def _on_value_change(self, item=None): - self._is_modified = self.item_value() != self.default_value - if self.is_overidable: - self._is_overriden = True + def _on_value_change(self, item=None, ignore_attr_changes=False): + if self._ignore_value_change: + self._ignore_value_change = False + return + + if not ignore_attr_changes: + self._is_modified = self.item_value() != self.default_value + if self.is_overidable: + self._is_overriden = True self.update_style() @@ -634,7 +639,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_group = True self.is_group = is_group - self.is_modified = False + self._is_modified = False self._was_overriden = False self._is_overriden = False From 1c5b923888cbb2ca2246e2f7150fd0e816be7186 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 7 Aug 2020 17:18:36 +0200 Subject: [PATCH 040/507] overrides are apllies in right way --- pype/tools/config_setting/widgets/base.py | 5 + pype/tools/config_setting/widgets/inputs.py | 220 ++++++++++++++------ 2 files changed, 156 insertions(+), 69 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index a90eefd400..9413b07733 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -63,6 +63,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_overriden = False is_group = False any_parent_is_group = False + ignore_value_changes = False def __init__(self, parent=None): super(StudioWidget, self).__init__(parent) @@ -281,6 +282,8 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): super(ProjectWidget, self).__init__(parent) self.is_overidable = False + self.ignore_value_changes = False + self.input_fields = [] scroll_widget = QtWidgets.QScrollArea(self) @@ -354,8 +357,10 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): overrides = config.project_preset_overrides(project_name) self.is_overidable = True + self.ignore_value_changes = True for item in self.input_fields: item.apply_overrides(overrides) + self.ignore_value_changes = False def _save(self): output = {} diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 7e91d11a21..a0226d7b73 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -76,26 +76,17 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.default_value = self.item_value() self.override_value = None - self._ignore_value_change = False - self.checkbox.stateChanged.connect(self._on_value_change) - def set_value( - self, value, *, - ignore_attr_changes=True, - default_value=False - ): + def set_value(self, value, *, default_value=False): # Ignore value change because if `self.isChecked()` has same # value as `value` the `_on_value_change` is not triggered - self._ignore_value_change = True - self.checkbox.setChecked(value) if default_value: - ignore_attr_changes = True self.default_value = self.item_value() - self._on_value_change(ignore_attr_changes=ignore_attr_changes) + self._on_value_change() def reset_value(self): if self.is_overidable and self.override_value is not None: @@ -119,7 +110,8 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._is_modified = False - self.set_value(value, ignore_attr_changes=True) + self.set_value(value) + self.update_style() @property def child_modified(self): @@ -143,23 +135,25 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden - def _on_value_change(self, item=None, ignore_attr_changes=False): - if self._ignore_value_change: - self._ignore_value_change = False + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + + def _on_value_change(self, item=None): + if self.ignore_value_changes: return - if not ignore_attr_changes: - _value = self.item_value() - is_modified = None - if self.is_overidable: - self._is_overriden = True - if self.override_value is not None: - is_modified = _value != self.override_value + _value = self.item_value() + is_modified = None + if self.is_overidable: + self._is_overriden = True + if self.override_value is not None: + is_modified = _value != self.override_value - if is_modified is None: - is_modified = _value != self.default_value + if is_modified is None: + is_modified = _value != self.default_value - self._is_modified = is_modified + self._is_modified = is_modified self.update_style() @@ -246,8 +240,6 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.default_value = self.item_value() self.override_value = None - self._ignore_value_change = False - self.int_input.valueChanged.connect(self._on_value_change) @property @@ -272,6 +264,10 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): return self._is_overriden return self._parent.is_overriden + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + def set_value(self, value, *, default_value=False): self.int_input.setValue(value) if default_value: @@ -288,21 +284,25 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.override_value = override_value if override_value is None: self._is_overriden = False + self._was_overriden = False value = self.default_value else: self._is_overriden = True + self._was_overriden = True value = override_value - self.set_value(value) - def _on_value_change(self, item=None, ignore_attr_changes=False): - if self._ignore_value_change: - self._ignore_value_change = False + self._is_modified = False + + self.set_value(value) + self.update_style() + + def _on_value_change(self, item=None): + if self.ignore_value_changes: return - if not ignore_attr_changes: - self._is_modified = self.item_value() != self.default_value - if self.is_overidable: - self._is_overriden = True + self._is_modified = self.item_value() != self.default_value + if self.is_overidable: + self._is_overriden = True self.update_style() @@ -420,9 +420,11 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes def set_value(self, value, *, default_value=False): self.float_input.setValue(value) @@ -441,12 +443,17 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: self._is_overriden = True value = override_value + self.set_value(value) + self.update_style() def clear_value(self): self.set_value(0) def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -557,9 +564,11 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes def set_value(self, value, *, default_value=False): self.text_input.setText(value) @@ -571,19 +580,27 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.default_value) def apply_overrides(self, override_value): + self._is_modified = False self.override_value = override_value if override_value is None: self._is_overriden = False + self._was_overriden = False value = self.default_value else: self._is_overriden = True + self._was_overriden = True value = override_value + self.set_value(value) + self.update_style() def clear_value(self): self.set_value("") def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -692,9 +709,11 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) @@ -713,12 +732,17 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: self._is_overriden = True value = override_value + self.set_value(value) + self.update_style() def clear_value(self): self.set_value("") def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -885,9 +909,11 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) @@ -909,11 +935,15 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: self._is_overriden = True value = override_value + self.set_value(value) + self.update_style() def _on_value_change(self, item=None): - value = self.item_value() - self._is_modified = value != self.default_value + if self.ignore_value_changes: + return + + self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -1182,11 +1212,15 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes def _on_value_change(self, item=None): + if self.ignore_value_changes: + return self._is_modified = self.item_value() != self.default_value if self.is_overidable: self._is_overriden = True @@ -1215,7 +1249,9 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): else: self._is_overriden = True value = override_value + self.set_value(value) + self.update_style() def update_style(self, is_overriden=None): if is_overriden is None: @@ -1320,8 +1356,6 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): keys.append(self.key) self.keys = keys - self._ignore_value_change = False - for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) @@ -1347,30 +1381,39 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes def apply_overrides(self, override_value): - self._ignore_value_change = True - + # Make sure this is set to False self._is_overriden = False + for item in self.input_fields: if override_value is None: child_value = None else: child_value = override_value.get(item.key) + item.apply_overrides(child_value) - self._ignore_value_change = False + self._is_overriden = ( + self.is_group + and self.is_overidable + and ( + override_value is not None + or self.child_overriden + ) + ) + self.update_style() - self._on_value_change(ignore_attr_changes=True) - - def _on_value_change(self, item=None, ignore_attr_changes=False): - if self._ignore_value_change: + def _on_value_change(self, item=None): + if self.ignore_value_changes: return - if not ignore_attr_changes and self.is_group: + if self.is_group: if self.is_overidable: self._is_overriden = True # TODO update items @@ -1457,6 +1500,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): + # TODO is not overridable by itself value_changed = QtCore.Signal(object) def __init__( @@ -1474,6 +1518,7 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): self.any_parent_is_group = any_parent_is_group + self._is_overriden = False self.is_modified = False self.is_group = is_group @@ -1503,7 +1548,7 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden @property def is_overidable(self): @@ -1523,6 +1568,10 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): return True return False + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + def item_value(self): output = {} for input_field in self.input_fields: @@ -1554,6 +1603,9 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): return item def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + if self.is_group: if self.is_overidable: self._is_overriden = True @@ -1567,6 +1619,7 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) def apply_overrides(self, override_value): + self._is_overriden = False for item in self.input_fields: if override_value is None: child_value = None @@ -1574,6 +1627,16 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): child_value = override_value.get(item.key) item.apply_overrides(child_value) + self._is_overriden = ( + self.is_group + and self.is_overidable + and ( + override_value is not None + or self.child_overriden + ) + ) + self.update_style() + class DictFormWidget(QtWidgets.QWidget): value_changed = QtCore.Signal(object) @@ -1604,6 +1667,8 @@ class DictFormWidget(QtWidgets.QWidget): self.add_children_gui(child_data, values) def _on_value_change(self, item=None): + if self.ignore_value_changes: + return self.value_changed.emit(self) def item_value(self): @@ -1632,6 +1697,10 @@ class DictFormWidget(QtWidgets.QWidget): def is_overidable(self): return self._parent.is_overidable + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + def config_value(self): return self.item_value() @@ -1729,6 +1798,10 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): def is_overriden(self): return self._parent.is_overriden + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + def is_key_modified(self): return self._key() != self.default_key @@ -1814,6 +1887,10 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): def is_group(self): return self._parent.is_group + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + @property def any_parent_is_group(self): return self._parent.any_parent_is_group @@ -1928,6 +2005,9 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.override_value = None def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + self.child_modified = self.item_value() != self.default_value if self.is_group: @@ -1948,9 +2028,11 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes def apply_overrides(self, override_value): print(self, override_value) From b6f948826dd1c471e7299d959c456b04e9771646 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 7 Aug 2020 17:31:11 +0200 Subject: [PATCH 041/507] fix is modified appliance --- pype/tools/config_setting/widgets/inputs.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index a0226d7b73..8464eb8459 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -98,6 +98,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.reset_value() def apply_overrides(self, override_value): + self._is_modified = False self.override_value = override_value if override_value is None: self._is_overriden = False @@ -108,8 +109,6 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._was_overriden = True value = override_value - self._is_modified = False - self.set_value(value) self.update_style() @@ -260,9 +259,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden @property def ignore_value_changes(self): @@ -281,6 +278,8 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.default_value) def apply_overrides(self, override_value): + self._is_modified = False + self.override_value = override_value if override_value is None: self._is_overriden = False @@ -291,8 +290,6 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._was_overriden = True value = override_value - self._is_modified = False - self.set_value(value) self.update_style() @@ -436,6 +433,8 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.default_value) def apply_overrides(self, override_value): + self._is_modified = False + self.override_value = override_value if override_value is None: self._is_overriden = False @@ -581,6 +580,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False + self.override_value = override_value if override_value is None: self._is_overriden = False @@ -725,6 +725,8 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(self.default_value) def apply_overrides(self, override_value): + self._is_modified = False + self.override_value = override_value if override_value is None: self._is_overriden = False @@ -928,6 +930,8 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value("") def apply_overrides(self, override_value): + self._is_modified = False + self.override_value = override_value if override_value is None: self._is_overriden = False @@ -1242,6 +1246,8 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value([]) def apply_overrides(self, override_value): + self._is_modified = False + self.override_value = override_value if override_value is None: self._is_overriden = False From 02051472d6813abc335cae002088e8b615ebd36b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 7 Aug 2020 18:12:22 +0200 Subject: [PATCH 042/507] attribute cleanup on apply overrides --- pype/tools/config_setting/widgets/inputs.py | 100 +++++++------------- 1 file changed, 34 insertions(+), 66 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 8464eb8459..e0a18afe1d 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -99,6 +99,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False + self._state = None self.override_value = override_value if override_value is None: self._is_overriden = False @@ -122,7 +123,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self._is_overriden) + return self._is_modified or (self._was_overriden != self.is_overriden) @property def is_overidable(self): @@ -130,9 +131,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): @property def is_overriden(self): - if self._is_overriden: - return self._is_overriden - return self._parent.is_overriden + return self._is_overriden or self._parent.is_overriden @property def ignore_value_changes(self): @@ -158,12 +157,8 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def update_style(self, is_overriden=None): - if is_overriden is None: - is_overriden = self.is_overriden - is_modified = self.is_modified - - state = self.style_state(is_overriden, is_modified) + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -279,7 +274,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False - + self._state = None self.override_value = override_value if override_value is None: self._is_overriden = False @@ -305,12 +300,8 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def update_style(self, is_overriden=None): - if is_overriden is None: - is_overriden = self.is_overriden - is_modified = self.is_modified - - state = self.style_state(is_overriden, is_modified) + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -434,7 +425,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False - + self._state = None self.override_value = override_value if override_value is None: self._is_overriden = False @@ -461,12 +452,8 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def update_style(self, is_overriden=None): - if is_overriden is None: - is_overriden = self.is_overriden - is_modified = self.is_modified - - state = self.style_state(is_overriden, is_modified) + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -580,7 +567,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False - + self._state = None self.override_value = override_value if override_value is None: self._is_overriden = False @@ -609,12 +596,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def update_style(self, is_overriden=None): - if is_overriden is None: - is_overriden = self.is_overriden - is_modified = self.is_modified - - state = self.style_state(is_overriden, is_modified) + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -726,7 +709,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False - + self._state = None self.override_value = override_value if override_value is None: self._is_overriden = False @@ -753,12 +736,8 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def update_style(self, is_overriden=None): - if is_overriden is None: - is_overriden = self.is_overriden - is_modified = self.is_modified - - state = self.style_state(is_overriden, is_modified) + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -931,7 +910,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False - + self._state = None self.override_value = override_value if override_value is None: self._is_overriden = False @@ -955,12 +934,8 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.value_changed.emit(self) - def update_style(self, is_overriden=None): - if is_overriden is None: - is_overriden = self.is_overriden - is_modified = self.is_modified - - state = self.style_state(is_overriden, is_modified) + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -1247,7 +1222,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): self._is_modified = False - + self._state = None self.override_value = override_value if override_value is None: self._is_overriden = False @@ -1259,12 +1234,8 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.set_value(value) self.update_style() - def update_style(self, is_overriden=None): - if is_overriden is None: - is_overriden = self.is_overriden - is_modified = self.is_modified - - state = self.style_state(is_overriden, is_modified) + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -1396,7 +1367,8 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False - + self._state = None + self._child_state = None for item in self.input_fields: if override_value is None: child_value = None @@ -1427,7 +1399,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): is_overriden = self.is_overriden for _item in self.input_fields: if _item is not item: - _item.update_style(is_overriden) + _item.update_style() self.value_changed.emit(self) @@ -1435,20 +1407,16 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): def update_style(self, is_overriden=None): child_modified = self.child_modified - if is_overriden is None: - child_overriden = self.child_overriden - child_state = self.style_state(child_overriden, child_modified) - if child_state: - child_state = "child-{}".format(child_state) + child_state = self.style_state(self.child_overriden, child_modified) + if child_state: + child_state = "child-{}".format(child_state) - if child_state != self._child_state: - self.setProperty("state", child_state) - self.style().polish(self) - self._child_state = child_state - - if is_overriden is None: - is_overriden = self.is_overriden + if child_state != self._child_state: + self.setProperty("state", child_state) + self.style().polish(self) + self._child_state = child_state + is_overriden = self.is_overriden if child_modified and not is_overriden: state = self.default_state else: From aee77e630c36f5f1ccd064948b8acda0c9c109f7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 7 Aug 2020 18:50:42 +0200 Subject: [PATCH 043/507] modifiabledict is working better now --- pype/tools/config_setting/widgets/inputs.py | 74 ++++++++++++++------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index e0a18afe1d..839fe1e8a2 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1786,7 +1786,7 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): def is_modified(self): return self.is_value_modified() or self.is_key_modified() - def update_style(self, is_overriden=None): + def update_style(self): if self.is_key_modified(): state = "modified" else: @@ -1957,10 +1957,11 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): self.any_parent_is_group = any_parent_is_group - self.is_modified = False - self.child_modified = False - self._is_overriden = False self.is_group = is_group + self._is_modified = False + self._is_overriden = False + self._was_overriden = False + self._state = None super(ModifiableDict, self).__init__(input_data["label"], parent) self.setObjectName("ModifiableDict") @@ -1982,16 +1983,26 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): if self.ignore_value_changes: return - self.child_modified = self.item_value() != self.default_value + if self.is_overidable: + self._is_overriden = True - if self.is_group: - if self.is_overidable: - self._is_overriden = True + if self.is_overriden: + self._is_modified = self.item_value() != self.override_value + else: + self._is_modified = self.item_value() != self.default_value self.value_changed.emit(self) self.update_style() + @property + def child_modified(self): + return self.is_modified + + @property + def is_modified(self): + return self._is_modified + @property def child_overriden(self): return self._is_overriden @@ -2004,29 +2015,42 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def is_overriden(self): return self._is_overriden or self._parent.is_overriden + @property + def is_modified(self): + return self._is_modified + @property def ignore_value_changes(self): return self._parent.ignore_value_changes def apply_overrides(self, override_value): - print(self, override_value) - - def update_style(self, is_overriden=None): - child_modified = self.child_modified - if is_overriden is None: - is_overriden = self.is_overriden - - child_overriden = self.child_overriden - child_state = self.style_state(child_overriden, child_modified) - if child_state != self._child_state: - self.setProperty("state", child_state) - self.style().polish(self) - self._child_state = child_state - - if child_modified and not is_overriden: - state = self.default_state + self._state = None + self._is_modified = False + self.override_value = override_value + if override_value is None: + self._is_overriden = False + self._was_overriden = False + value = self.default_value else: - state = self.style_state(self.is_overriden, child_modified) + self._is_overriden = True + self._was_overriden = True + value = override_value + + self.set_value(value) + self.update_style() + + def update_style(self): + state = self.style_state(self.is_overriden, self.is_modified) + if self._state == state: + return + + if state: + child_state = "child-{}".format(state) + else: + child_state = "" + + self.setProperty("state", child_state) + self.style().polish(self) self.label_widget.setProperty("state", state) self.label_widget.style().polish(self.label_widget) From 0badfc0a5ace0cebc8252122f1e14b4a521a15c2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 11:22:07 +0200 Subject: [PATCH 044/507] adde unsaved changes dialog with 3 possible results --- pype/tools/config_setting/widgets/widgets.py | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/pype/tools/config_setting/widgets/widgets.py b/pype/tools/config_setting/widgets/widgets.py index 34fdfde1a5..1d30a67e28 100644 --- a/pype/tools/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/widgets/widgets.py @@ -103,3 +103,40 @@ class ExpandingWidget(QtWidgets.QWidget): def resizeEvent(self, event): super(ExpandingWidget, self).resizeEvent(event) self.content_widget.updateGeometry() + + +class UnsavedChangesDialog(QtWidgets.QDialog): + message = "My message" + + def __init__(self, parent=None): + super().__init__(parent) + message_label = QtWidgets.QLabel(self.message) + + btns_widget = QtWidgets.QWidget(self) + btns_layout = QtWidgets.QHBoxLayout(btns_widget) + + btn_ok = QtWidgets.QPushButton("OK") + btn_ok.clicked.connect(self.on_ok_pressed) + btn_discard = QtWidgets.QPushButton("Discard changes") + btn_discard.clicked.connect(self.on_discard_pressed) + btn_cancel = QtWidgets.QPushButton("Cancel") + btn_cancel.clicked.connect(self.on_cancel_pressed) + + btns_layout.addWidget(btn_ok) + btns_layout.addWidget(btn_discard) + btns_layout.addWidget(btn_cancel) + + layout = QtWidgets.QVBoxLayout(self) + layout.addWidget(message_label) + layout.addWidget(btns_widget) + + self.state = None + + def on_cancel_pressed(self): + self.done(0) + + def on_ok_pressed(self): + self.done(1) + + def on_discard_pressed(self): + self.done(2) From 242c55716174fdc9482733098144aae14681db34 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 11:24:30 +0200 Subject: [PATCH 045/507] modified dialog --- pype/tools/config_setting/widgets/widgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/widgets/widgets.py b/pype/tools/config_setting/widgets/widgets.py index 1d30a67e28..3d5528e17a 100644 --- a/pype/tools/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/widgets/widgets.py @@ -106,7 +106,7 @@ class ExpandingWidget(QtWidgets.QWidget): class UnsavedChangesDialog(QtWidgets.QDialog): - message = "My message" + message = "You have unsaved changes. What do you want to do with them?" def __init__(self, parent=None): super().__init__(parent) @@ -115,9 +115,9 @@ class UnsavedChangesDialog(QtWidgets.QDialog): btns_widget = QtWidgets.QWidget(self) btns_layout = QtWidgets.QHBoxLayout(btns_widget) - btn_ok = QtWidgets.QPushButton("OK") + btn_ok = QtWidgets.QPushButton("Save") btn_ok.clicked.connect(self.on_ok_pressed) - btn_discard = QtWidgets.QPushButton("Discard changes") + btn_discard = QtWidgets.QPushButton("Discard") btn_discard.clicked.connect(self.on_discard_pressed) btn_cancel = QtWidgets.QPushButton("Cancel") btn_cancel.clicked.connect(self.on_cancel_pressed) From 1eb5b1ed2b3cb4aff3cf6d6eb89382fabbafa76e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 11:24:47 +0200 Subject: [PATCH 046/507] on project change is corrrect validation with dialog --- pype/tools/config_setting/widgets/base.py | 28 ++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 9413b07733..76fbad06c6 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -2,6 +2,7 @@ import os import json from Qt import QtWidgets, QtCore, QtGui from . import config +from .widgets import UnsavedChangesDialog from .lib import NOT_SET from avalon import io from queue import Queue @@ -217,16 +218,37 @@ class ProjectListWidget(QtWidgets.QWidget): if self.current_project == new_project_name: return + save_changes = False + change_project = False if self.validate_context_change(): + change_project = True + + else: + dialog = UnsavedChangesDialog(self) + result = dialog.exec_() + if result == 1: + save_changes = True + change_project = True + + elif result == 2: + change_project = True + + if save_changes: + self._parent._save() + + if change_project: self.select_project(new_project_name) self.current_project = new_project_name self.project_changed.emit() - return - - self.select_project(self.current_project) + else: + self.select_project(self.current_project) def validate_context_change(self): # TODO add check if project can be changed (is modified) + for item in self._parent.input_fields: + is_modified = item.child_modified + if is_modified: + return False return True def project_name(self): From 2b07663fee86e91ebf6d21ad4635eea0077f04ec Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 11:41:56 +0200 Subject: [PATCH 047/507] added "is_file" key to schemas --- .../config_gui_schema/applications_gui_schema.json | 1 + .../config_gui_schema/ftrack_projects_gui_schema.json | 2 ++ .../config_setting/config_gui_schema/plugins_gui_schema.json | 1 + .../config_setting/config_gui_schema/test_project_schema.json | 1 + .../config_setting/config_gui_schema/tools_gui_schema.json | 1 + 5 files changed, 6 insertions(+) diff --git a/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json b/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json index 096964b5b8..5c20e630fa 100644 --- a/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json @@ -2,6 +2,7 @@ "key": "applications", "type": "dict-expanding", "label": "Applications", + "is_file": true, "children": [ { "type": "dict-form", diff --git a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json index 4a35fc9b61..ac696d18d0 100644 --- a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json @@ -8,6 +8,7 @@ "type": "dict-expanding", "label": "Status updates", "is_group": true, + "is_file": true, "children": [ { "key": "Ready", @@ -24,6 +25,7 @@ "type": "dict-expanding", "label": "Version status to Task status", "is_group": true, + "is_file": true, "children": [ { "key": "in progress", diff --git a/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json b/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json index 6c83fee172..1eaecbb8e5 100644 --- a/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json @@ -13,6 +13,7 @@ "type": "dict-expanding", "label": "Publish plugins", "is_group": true, + "is_file": true, "children": [ { "key": "ValidateModelName", diff --git a/pype/tools/config_setting/config_gui_schema/test_project_schema.json b/pype/tools/config_setting/config_gui_schema/test_project_schema.json index e789b422a3..43c9a647f4 100644 --- a/pype/tools/config_setting/config_gui_schema/test_project_schema.json +++ b/pype/tools/config_setting/config_gui_schema/test_project_schema.json @@ -3,6 +3,7 @@ "type": "dict-expanding", "label": "Test inputs", "is_group": true, + "is_file": true, "children": [ { "key": "boolean", diff --git a/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json b/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json index 2f46ef0ec5..3507d14a36 100644 --- a/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json @@ -2,6 +2,7 @@ "key": "tools", "type": "dict-expanding", "label": "Tools", + "is_file": true, "children": [ { "type": "dict-form", From 745e1cff968b70cf52dfd131c1def152b9136112 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 12:09:29 +0200 Subject: [PATCH 048/507] moved gui creation to reset method --- pype/tools/config_setting/widgets/base.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 76fbad06c6..f36e21483e 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -88,11 +88,6 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.content_layout = content_layout self.content_widget = content_widget - values = {"studio": config.studio_presets()} - schema = config.gui_schema("studio_gui_schema") - self.keys = schema.get("keys", []) - self.add_children_gui(schema, values) - footer_widget = QtWidgets.QWidget() footer_layout = QtWidgets.QHBoxLayout(footer_widget) @@ -111,6 +106,20 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): save_btn.clicked.connect(self._save) + self.reset() + + def reset(self): + if self.content_layout.count() != 0: + for widget in self.input_fields: + self.content_layout.removeWidget(widget) + widget.deleteLater() + self.input_fields.clear() + + values = {"studio": config.studio_presets()} + schema = config.gui_schema("studio_gui_schema") + self.keys = schema.get("keys", []) + self.add_children_gui(schema, values) + def _save(self): all_values = {} for item in self.input_fields: @@ -354,6 +363,9 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.content_layout = content_layout self.content_widget = content_widget + self.reset() + + def reset(self): values = config.global_project_presets() schema = config.gui_schema("project_gui_schema") self.keys = schema.get("keys", []) From 20c6ef6a6c5648e70780d16345ad7abf276da18a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 12:37:47 +0200 Subject: [PATCH 049/507] separate gui schemas byt studio and project --- .../{ => projects_schema}/ftrack_projects_gui_schema.json | 0 .../{ => projects_schema}/plugins_gui_schema.json | 0 .../{ => projects_schema}/project_gui_schema.json | 0 .../{ => projects_schema}/test_project_schema.json | 0 .../{ => studio_schema}/applications_gui_schema.json | 0 .../config_gui_schema/{ => studio_schema}/studio_gui_schema.json | 0 .../config_gui_schema/{ => studio_schema}/tools_gui_schema.json | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename pype/tools/config_setting/config_gui_schema/{ => projects_schema}/ftrack_projects_gui_schema.json (100%) rename pype/tools/config_setting/config_gui_schema/{ => projects_schema}/plugins_gui_schema.json (100%) rename pype/tools/config_setting/config_gui_schema/{ => projects_schema}/project_gui_schema.json (100%) rename pype/tools/config_setting/config_gui_schema/{ => projects_schema}/test_project_schema.json (100%) rename pype/tools/config_setting/config_gui_schema/{ => studio_schema}/applications_gui_schema.json (100%) rename pype/tools/config_setting/config_gui_schema/{ => studio_schema}/studio_gui_schema.json (100%) rename pype/tools/config_setting/config_gui_schema/{ => studio_schema}/tools_gui_schema.json (100%) diff --git a/pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/ftrack_projects_gui_schema.json rename to pype/tools/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json b/pype/tools/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/plugins_gui_schema.json rename to pype/tools/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/project_gui_schema.json b/pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/project_gui_schema.json rename to pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/test_project_schema.json b/pype/tools/config_setting/config_gui_schema/projects_schema/test_project_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/test_project_schema.json rename to pype/tools/config_setting/config_gui_schema/projects_schema/test_project_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/applications_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/applications_gui_schema.json rename to pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/studio_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/studio_gui_schema.json rename to pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/tools_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/tools_gui_schema.json rename to pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json From 17c1587631a9052c3a350b88b990d42a6e4312a7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 12:38:25 +0200 Subject: [PATCH 050/507] gui_schema function also resolves inner schemas so inputs don't have to acrea about them --- pype/tools/config_setting/widgets/config.py | 56 +++++++++++++++++---- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 58b1e03a25..5aaa0e20ee 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -220,19 +220,53 @@ def project_presets(project_name=None, **kwargs): return apply_overrides(global_presets, project_overrides) -def gui_schema(schema_name): - filename = schema_name + ".json" - schema_folder = os.path.join( +def replace_inner_schemas(schema_data, schema_collection): + if schema_data["type"] == "schema": + raise ValueError("First item in schema data can't be schema.") + + children = schema_data.get("children") + if not children: + return schema_data + + new_children = [] + for child in children: + if child["type"] != "schema": + new_child = replace_inner_schemas(child, schema_collection) + new_children.append(new_child) + continue + + for schema_name in child["children"]: + new_child = replace_inner_schemas( + schema_collection[schema_name], + schema_collection + ) + new_children.append(new_child) + + schema_data["children"] = new_children + return schema_data + + +def gui_schema(subfolder, main_schema_name): + subfolder, main_schema_name + dirpath = os.path.join( os.path.dirname(os.path.dirname(__file__)), "config_gui_schema", - filename + subfolder ) - with open(schema_folder, "r") as json_stream: - schema = json.load(json_stream) - return schema + loaded_schemas = {} + for filename in os.listdir(dirpath): + basename, ext = os.path.splitext(filename) + if ext != ".json": + continue -p1 = studio_presets(with_metadata=True) -p2 = studio_presets(with_metadata=False) -print(json.dumps(p1, indent=4)) -print(json.dumps(p2, indent=4)) + filepath = os.path.join(dirpath, filename) + with open(filepath, "r") as json_stream: + schema_data = json.load(json_stream) + loaded_schemas[basename] = schema_data + + main_schema = replace_inner_schemas( + loaded_schemas[main_schema_name], + loaded_schemas + ) + return main_schema From c5730f915aa014f826e159fed9cb80dd8d8ecc32 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 12:38:42 +0200 Subject: [PATCH 051/507] project and studio widgets use new gui_schema function --- pype/tools/config_setting/widgets/base.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index f36e21483e..134735974c 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -56,10 +56,6 @@ class PypeConfigurationWidget: class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): - config_dir = os.path.join( - os.path.dirname(os.path.dirname(__file__)), - "config_gui_schema" - ) is_overidable = False is_overriden = False is_group = False @@ -116,7 +112,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.input_fields.clear() values = {"studio": config.studio_presets()} - schema = config.gui_schema("studio_gui_schema") + schema = config.gui_schema("studio_schema", "studio_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) @@ -301,10 +297,6 @@ class ProjectListWidget(QtWidgets.QWidget): class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): - config_dir = os.path.join( - os.path.dirname(os.path.dirname(__file__)), - "config_gui_schema" - ) is_overriden = False is_group = False any_parent_is_group = False @@ -367,7 +359,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): def reset(self): values = config.global_project_presets() - schema = config.gui_schema("project_gui_schema") + schema = config.gui_schema("projects_schema", "project_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) From ea433367ce44f9fdf4f03245ca1347aa37852482 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 12:42:59 +0200 Subject: [PATCH 052/507] minor changes --- .../config_gui_schema/studio_schema/applications_gui_schema.json | 1 + .../config_gui_schema/studio_schema/studio_gui_schema.json | 1 + .../config_gui_schema/studio_schema/tools_gui_schema.json | 1 + 3 files changed, 3 insertions(+) diff --git a/pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json index 5c20e630fa..12fbb3cc26 100644 --- a/pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json @@ -3,6 +3,7 @@ "type": "dict-expanding", "label": "Applications", "is_file": true, + "is_group": true, "children": [ { "type": "dict-form", diff --git a/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json index 1a49735b8a..ba017760f3 100644 --- a/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json @@ -17,6 +17,7 @@ }, { "key": "muster", "type": "dict-invisible", + "is_group": true, "children": [{ "key": "templates_mapping", "label": "Muster", diff --git a/pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json index 3507d14a36..4c905a3826 100644 --- a/pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json @@ -2,6 +2,7 @@ "key": "tools", "type": "dict-expanding", "label": "Tools", + "is_group": true, "is_file": true, "children": [ { From 7f39070df4f468ff6568d4b6f16aa86c807f1431 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 13:12:34 +0200 Subject: [PATCH 053/507] enhance expanding dict states --- pype/tools/config_setting/widgets/inputs.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 839fe1e8a2..2c231e087a 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1271,7 +1271,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.any_parent_is_group = any_parent_is_group - self.is_modified = False + self._is_modified = False self._is_overriden = False self.is_group = is_group @@ -1394,9 +1394,9 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): if self.is_group: if self.is_overidable: self._is_overriden = True + # TODO update items if item is not None: - is_overriden = self.is_overriden for _item in self.input_fields: if _item is not item: _item.update_style() @@ -1416,12 +1416,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.style().polish(self) self._child_state = child_state - is_overriden = self.is_overriden - if child_modified and not is_overriden: - state = self.default_state - else: - state = self.style_state(is_overriden, child_modified) - + state = self.style_state(self.is_overriden, self.is_modified) if self._state == state: return @@ -1430,6 +1425,12 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._state = state + @property + def is_modified(self): + if self.is_group: + return self.child_modified + return False + @property def child_modified(self): for input_field in self.input_fields: From de62bc42d2680fdc5151cc5857dc3214d9a612b3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 15:15:15 +0200 Subject: [PATCH 054/507] added schema validations --- .../studio_schema/studio_gui_schema.json | 1 + pype/tools/config_setting/widgets/config.py | 52 ++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json b/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json index ba017760f3..088c407804 100644 --- a/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json @@ -21,6 +21,7 @@ "children": [{ "key": "templates_mapping", "label": "Muster", + "is_file": true, "type": "dict-modifiable", "object_type": "int" }] diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 5aaa0e20ee..3604316131 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -132,8 +132,6 @@ def load_jsons_from_dir(path, *args, **kwargs): sub_keys.pop(0) base_len = len(path) + 1 - ext_len = len(".json") - for base, _directories, filenames in os.walk(path): for filename in filenames: basename, ext = os.path.splitext(filename) @@ -246,6 +244,55 @@ def replace_inner_schemas(schema_data, schema_collection): return schema_data +class ShemaMissingFileInfo(Exception): + def __init__(self, invalid): + full_path_keys = [] + for item in invalid: + full_path_keys.append("\"{}\"".format("/".join(item))) + + msg = ( + "Schema has missing definition of output file (\"is_file\" key)" + " for keys. [{}]" + ).format(", ".join(full_path_keys)) + super(ShemaMissingFileInfo, self).__init__(msg) + + +def validate_all_has_ending_file(schema_data, is_top=True): + if schema_data.get("is_file"): + return None + + children = schema_data.get("children") + if not children: + return [[schema_data["key"]]] + + invalid = [] + keyless = "key" not in schema_data + for child in children: + result = validate_all_has_ending_file(child, False) + if result is None: + continue + + if keyless: + invalid.extend(result) + else: + for item in result: + new_invalid = [schema_data["key"]] + new_invalid.extend(item) + invalid.append(new_invalid) + + if not invalid: + return None + + if not is_top: + return invalid + + raise ShemaMissingFileInfo(invalid) + + +def validate_schema(schema_data): + validate_all_has_ending_file(schema_data) + + def gui_schema(subfolder, main_schema_name): subfolder, main_schema_name dirpath = os.path.join( @@ -269,4 +316,5 @@ def gui_schema(subfolder, main_schema_name): loaded_schemas[main_schema_name], loaded_schemas ) + validate_schema(main_schema) return main_schema From e2fdb92a97296c10fb796113c6bcff4f7de93afa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 15:52:05 +0200 Subject: [PATCH 055/507] changed way of storing data --- pype/tools/config_setting/widgets/base.py | 59 ++++++++++++----------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 134735974c..830902f6bb 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -115,6 +115,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): schema = config.gui_schema("studio_schema", "studio_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) + self.schema = schema def _save(self): all_values = {} @@ -129,38 +130,38 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): all_values = all_values["studio"] # Load studio data with metadata - config_with_metadata = config.studio_presets_with_metadata() + current_presets = config.studio_presets() - print(json.dumps(config_with_metadata, indent=4)) + print(json.dumps(current_presets, indent=4)) print(json.dumps(all_values, indent=4)) - per_file_values = {} - process_queue = Queue() - for _key, _values in all_values.items(): - process_queue.put(( - config.studio_presets_path, _key, config_with_metadata, _values - )) - - while not process_queue.empty(): - path, key, metadata, values = process_queue.get() - new_path = os.path.join(path, key) - # TODO this should not be - if key in metadata: - key_metadata = metadata[key] - - if key_metadata["type"] == "file": - new_path += ".json" - per_file_values[new_path] = values - continue - - for new_key, new_values in values.items(): - process_queue.put( - (new_path, new_key, key_metadata["value"], new_values) - ) - - for file_path, file_values in per_file_values.items(): - with open(file_path, "w") as file_stream: - json.dump(file_values, file_stream, indent=4) + # per_file_values = {} + # process_queue = Queue() + # for _key, _values in all_values.items(): + # process_queue.put(( + # config.studio_presets_path, _key, config_with_metadata, _values + # )) + # + # while not process_queue.empty(): + # path, key, metadata, values = process_queue.get() + # new_path = os.path.join(path, key) + # # TODO this should not be + # if key in metadata: + # key_metadata = metadata[key] + # + # if key_metadata["type"] == "file": + # new_path += ".json" + # per_file_values[new_path] = values + # continue + # + # for new_key, new_values in values.items(): + # process_queue.put( + # (new_path, new_key, key_metadata["value"], new_values) + # ) + # + # for file_path, file_values in per_file_values.items(): + # with open(file_path, "w") as file_stream: + # json.dump(file_values, file_stream, indent=4) def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] From cf971151b2fc7270a2e851bddb2f01fdc900b82d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 18:00:51 +0200 Subject: [PATCH 056/507] studio can again safe changes --- pype/tools/config_setting/widgets/base.py | 55 ++++++++++----------- pype/tools/config_setting/widgets/config.py | 24 +++++++++ pype/tools/config_setting/widgets/inputs.py | 2 +- 3 files changed, 51 insertions(+), 30 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 830902f6bb..3ca3b910b0 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -1,5 +1,6 @@ import os import json +import copy from Qt import QtWidgets, QtCore, QtGui from . import config from .widgets import UnsavedChangesDialog @@ -132,36 +133,32 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): # Load studio data with metadata current_presets = config.studio_presets() - print(json.dumps(current_presets, indent=4)) - print(json.dumps(all_values, indent=4)) + output = {} + keys_to_file = config.file_keys_from_schema(self.schema) + for key_sequence in keys_to_file: + key_sequence = key_sequence[1:] + subpath = "/".join(key_sequence) + ".json" + origin_values = current_presets + for key in key_sequence: + if key not in origin_values: + origin_values = {} + break + origin_values = origin_values[key] - # per_file_values = {} - # process_queue = Queue() - # for _key, _values in all_values.items(): - # process_queue.put(( - # config.studio_presets_path, _key, config_with_metadata, _values - # )) - # - # while not process_queue.empty(): - # path, key, metadata, values = process_queue.get() - # new_path = os.path.join(path, key) - # # TODO this should not be - # if key in metadata: - # key_metadata = metadata[key] - # - # if key_metadata["type"] == "file": - # new_path += ".json" - # per_file_values[new_path] = values - # continue - # - # for new_key, new_values in values.items(): - # process_queue.put( - # (new_path, new_key, key_metadata["value"], new_values) - # ) - # - # for file_path, file_values in per_file_values.items(): - # with open(file_path, "w") as file_stream: - # json.dump(file_values, file_stream, indent=4) + new_values = all_values + for key in key_sequence: + new_values = new_values[key] + origin_values.update(new_values) + + output_path = os.path.join( + config.studio_presets_path, subpath + ) + dirpath = os.path.dirname(output_path) + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + with open(output_path, "w") as file_stream: + json.dump(origin_values, file_stream, indent=4) def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 3604316131..8319c3d51d 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -257,6 +257,27 @@ class ShemaMissingFileInfo(Exception): super(ShemaMissingFileInfo, self).__init__(msg) +def file_keys_from_schema(schema_data): + output = [] + keys = [] + key = schema_data.get("key") + if key: + keys.append(key) + + for child in schema_data["children"]: + if child.get("is_file"): + _keys = copy.deepcopy(keys) + _keys.append(child["key"]) + output.append(_keys) + continue + + for result in file_keys_from_schema(child): + _keys = copy.deepcopy(keys) + _keys.extend(result) + output.append(_keys) + return output + + def validate_all_has_ending_file(schema_data, is_top=True): if schema_data.get("is_file"): return None @@ -290,6 +311,9 @@ def validate_all_has_ending_file(schema_data, is_top=True): def validate_schema(schema_data): + # TODO validator for key uniquenes + # TODO validator that is_group key is not before is_file child + # TODO validator that is_group or is_file is not on child without key validate_all_has_ending_file(schema_data) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 2c231e087a..c4ec7a4347 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -16,7 +16,7 @@ class SchemeGroupHierarchyBug(Exception): if not msg: # TODO better message msg = "SCHEME BUG: Attribute `is_group` is mixed in the hierarchy" - super(SchemeGroupHierarchyBug, self).__init(msg) + super(SchemeGroupHierarchyBug, self).__init__(msg) class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): From 8b7d565208bf5ea76db9330c7a43b6e6f5669930 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 18:13:10 +0200 Subject: [PATCH 057/507] smaller changes --- .../config/studio_presets/global/applications.json | 8 ++++++-- .../config/studio_presets/muster/templates_mapping.json | 2 +- pype/tools/config_setting/widgets/base.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config/studio_presets/global/applications.json b/pype/tools/config_setting/config/studio_presets/global/applications.json index 35e399444c..21693e5fee 100644 --- a/pype/tools/config_setting/config/studio_presets/global/applications.json +++ b/pype/tools/config_setting/config/studio_presets/global/applications.json @@ -35,5 +35,9 @@ "resolve_16": true, "shell": true, "storyboardpro_7": true, - "unreal_4.21": true -} + "unreal_4.21": true, + "celaction_local": true, + "celaction_remote": true, + "houdini_16.5": false, + "unreal_4.24": true +} \ No newline at end of file diff --git a/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json b/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json index 4edab9077d..0c09113515 100644 --- a/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json +++ b/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json @@ -16,4 +16,4 @@ "vector": 4, "vray": 37, "ffmpeg": 48 -} +} \ No newline at end of file diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 3ca3b910b0..14ff56aa2a 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -133,9 +133,9 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): # Load studio data with metadata current_presets = config.studio_presets() - output = {} keys_to_file = config.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: + # Skip first key key_sequence = key_sequence[1:] subpath = "/".join(key_sequence) + ".json" origin_values = current_presets From 7e65e5c830a63cf05aff5438cbcd1f18bfd57ec2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 19 Aug 2020 12:06:59 +0200 Subject: [PATCH 058/507] basic overrides values getting implemented --- pype/tools/config_setting/widgets/base.py | 61 +++++++++++- pype/tools/config_setting/widgets/inputs.py | 101 +++++++++++++++++--- 2 files changed, 150 insertions(+), 12 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 14ff56aa2a..c131966f6c 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -304,6 +304,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.is_overidable = False self.ignore_value_changes = False + self.project_name = None self.input_fields = [] @@ -373,7 +374,6 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): def _on_project_change(self): project_name = self.project_list_widget.project_name() - if project_name is None: overrides = None self.is_overidable = False @@ -381,12 +381,28 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): overrides = config.project_preset_overrides(project_name) self.is_overidable = True + self.project_name = project_name self.ignore_value_changes = True for item in self.input_fields: item.apply_overrides(overrides) self.ignore_value_changes = False def _save(self): + if self.project_name is None: + self._save_defaults() + else: + self._save_overrides() + + def _save_overrides(self): + output = {} + for item in self.input_fields: + value = item.overrides() + if value is not NOT_SET: + output.update(value) + + print(json.dumps(output, indent=4)) + + def _save_defaults(self): output = {} for item in self.input_fields: output.update(item.config_value()) @@ -396,3 +412,46 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): output = _output print(json.dumps(output, indent=4)) + return + + # TODO check implementation copied from studio + all_values = {} + for item in self.input_fields: + all_values.update(item.config_value()) + + for key in reversed(self.keys): + _all_values = {key: all_values} + all_values = _all_values + + # Skip first key + all_values = all_values["studio"] + + # Load studio data with metadata + current_presets = config.studio_presets() + + keys_to_file = config.file_keys_from_schema(self.schema) + for key_sequence in keys_to_file: + # Skip first key + key_sequence = key_sequence[1:] + subpath = "/".join(key_sequence) + ".json" + origin_values = current_presets + for key in key_sequence: + if key not in origin_values: + origin_values = {} + break + origin_values = origin_values[key] + + new_values = all_values + for key in key_sequence: + new_values = new_values[key] + origin_values.update(new_values) + + output_path = os.path.join( + config.studio_presets_path, subpath + ) + dirpath = os.path.dirname(output_path) + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + with open(output_path, "w") as file_stream: + json.dump(origin_values, file_stream, indent=4) diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index c4ec7a4347..6c6c31408e 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -177,6 +177,11 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overriden: + return NOT_SET + return self.config_value() + class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal(object) @@ -321,6 +326,11 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overriden: + return NOT_SET + return self.config_value() + class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal(object) @@ -473,6 +483,11 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overriden: + return NOT_SET + return self.config_value() + class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal(object) @@ -617,6 +632,11 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overriden: + return NOT_SET + return self.config_value() + class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal(object) @@ -757,6 +777,11 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overriden: + return NOT_SET + return self.config_value() + class RawJsonInput(QtWidgets.QPlainTextEdit): tab_length = 4 @@ -955,6 +980,11 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overriden: + return NOT_SET + return self.config_value() + class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 @@ -1248,6 +1278,11 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overriden: + return NOT_SET + return self.config_value() + class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): value_changed = QtCore.Signal(object) @@ -1473,6 +1508,18 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.input_fields.append(item) return item + def overrides(self): + if not self.is_overriden and not self.child_overriden: + return NOT_SET + + values = {} + for input_field in self.input_fields: + value = input_field.overrides() + if value is NOT_SET: + continue + values.update(value) + return {self.key: values} + class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): # TODO is not overridable by itself @@ -1612,6 +1659,18 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): ) self.update_style() + def overrides(self): + if not self.is_overriden and not self.child_overriden: + return NOT_SET + + values = {} + for input_field in self.input_fields: + value = input_field.overrides() + if value is NOT_SET: + continue + values.update(value) + return {self.key: values} + class DictFormWidget(QtWidgets.QWidget): value_changed = QtCore.Signal(object) @@ -1628,7 +1687,7 @@ class DictFormWidget(QtWidgets.QWidget): self.any_parent_is_group = any_parent_is_group self.is_modified = False - self.is_overriden = False + self._is_overriden = False self.is_group = False super(DictFormWidget, self).__init__(parent) @@ -1646,13 +1705,9 @@ class DictFormWidget(QtWidgets.QWidget): return self.value_changed.emit(self) - def item_value(self): - output = {} - for input_field in self.input_fields.values(): - # TODO maybe merge instead of update should be used - # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) - return output + @property + def is_overriden(self): + return self._parent.is_overriden @property def child_modified(self): @@ -1676,9 +1731,6 @@ class DictFormWidget(QtWidgets.QWidget): def ignore_value_changes(self): return self._parent.ignore_value_changes - def config_value(self): - return self.item_value() - def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] key = child_configuration["key"] @@ -1697,6 +1749,28 @@ class DictFormWidget(QtWidgets.QWidget): self.input_fields[key] = item return item + def item_value(self): + output = {} + for input_field in self.input_fields.values(): + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + def config_value(self): + return self.item_value() + + def overrides(self): + if not self.is_overiden and not self.child_overriden: + return NOT_SET + + values = {} + for input_field in self.input_fields: + value = input_field.overrides() + if value is not NOT_SET: + values.update(value) + return values + class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 @@ -2064,6 +2138,11 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + def overrides(self): + if not self.is_overiden: + return NOT_SET + return self.config_value() + TypeToKlass.types["boolean"] = BooleanWidget TypeToKlass.types["text-singleline"] = TextSingleLineWidget From 76992b0629c6e99a0fb68e2084516c933bcd6dbe Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 19 Aug 2020 15:13:41 +0200 Subject: [PATCH 059/507] overrides are collected with metadata info --- pype/tools/config_setting/widgets/__init__.py | 2 +- pype/tools/config_setting/widgets/base.py | 17 +- pype/tools/config_setting/widgets/inputs.py | 1050 ++++++++--------- pype/tools/config_setting/widgets/lib.py | 11 +- 4 files changed, 537 insertions(+), 543 deletions(-) diff --git a/pype/tools/config_setting/widgets/__init__.py b/pype/tools/config_setting/widgets/__init__.py index b295759a36..9fbce6e1cf 100644 --- a/pype/tools/config_setting/widgets/__init__.py +++ b/pype/tools/config_setting/widgets/__init__.py @@ -1,4 +1,4 @@ -from .lib import CustomNone, NOT_SET +from .lib import NOT_SET, AS_WIDGET, METADATA_KEY from .base import * diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index c131966f6c..156f1f80e4 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -1,12 +1,10 @@ import os import json -import copy from Qt import QtWidgets, QtCore, QtGui from . import config from .widgets import UnsavedChangesDialog -from .lib import NOT_SET +from .lib import NOT_SET, METADATA_KEY from avalon import io -from queue import Queue class TypeToKlass: @@ -394,12 +392,19 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._save_overrides() def _save_overrides(self): - output = {} + data = {} + groups = [] for item in self.input_fields: - value = item.overrides() + value, is_group = item.overrides() if value is not NOT_SET: - output.update(value) + data.update(value) + if is_group: + groups.extend(value.keys()) + + if groups: + data[METADATA_KEY] = {"groups": groups} + output = convert_to_override(data) print(json.dumps(output, indent=4)) def _save_defaults(self): diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index 6c6c31408e..bb2d76fc71 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -8,7 +8,7 @@ from .widgets import ( ModifiedIntSpinBox, ModifiedFloatSpinBox ) -from .lib import NOT_SET, AS_WIDGET +from .lib import NOT_SET, AS_WIDGET, METADATA_KEY class SchemeGroupHierarchyBug(Exception): @@ -19,7 +19,14 @@ class SchemeGroupHierarchyBug(Exception): super(SchemeGroupHierarchyBug, self).__init__(msg) -class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class InputWidget: + def overrides(self): + if not self.is_overriden: + return NOT_SET, False + return self.config_value(), self.is_group + + +class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -177,13 +184,8 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - def overrides(self): - if not self.is_overriden: - return NOT_SET - return self.config_value() - -class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -326,13 +328,8 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - def overrides(self): - if not self.is_overriden: - return NOT_SET - return self.config_value() - -class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -483,13 +480,8 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - def overrides(self): - if not self.is_overriden: - return NOT_SET - return self.config_value() - -class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -632,13 +624,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - def overrides(self): - if not self.is_overriden: - return NOT_SET - return self.config_value() - -class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -777,11 +764,6 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - def overrides(self): - if not self.is_overriden: - return NOT_SET - return self.config_value() - class RawJsonInput(QtWidgets.QPlainTextEdit): tab_length = 4 @@ -840,7 +822,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.update_style(is_valid) -class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -980,11 +962,6 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - def overrides(self): - if not self.is_overriden: - return NOT_SET - return self.config_value() - class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 @@ -1146,7 +1123,7 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: self.item_value()} -class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -1278,499 +1255,6 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - def overrides(self): - if not self.is_overriden: - return NOT_SET - return self.config_value() - - -class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, values, parent_keys, parent, label_widget=None - ): - if values is AS_WIDGET: - raise TypeError("Can't use \"{}\" as widget item.".format( - self.__class__.__name__ - )) - self._parent = parent - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - self.any_parent_is_group = any_parent_is_group - - self._is_modified = False - self._is_overriden = False - self.is_group = is_group - - self._state = None - self._child_state = None - - super(DictExpandWidget, self).__init__(parent) - self.setObjectName("DictExpandWidget") - top_part = ClickableWidget(parent=self) - - button_size = QtCore.QSize(5, 5) - button_toggle = QtWidgets.QToolButton(parent=top_part) - button_toggle.setProperty("btn-type", "expand-toggle") - button_toggle.setIconSize(button_size) - button_toggle.setArrowType(QtCore.Qt.RightArrow) - button_toggle.setCheckable(True) - button_toggle.setChecked(False) - - label = input_data["label"] - button_toggle_text = QtWidgets.QLabel(label, parent=top_part) - button_toggle_text.setObjectName("ExpandLabel") - - layout = QtWidgets.QHBoxLayout(top_part) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - layout.addWidget(button_toggle) - layout.addWidget(button_toggle_text) - top_part.setLayout(layout) - - main_layout = QtWidgets.QVBoxLayout(self) - main_layout.setContentsMargins(9, 9, 9, 9) - - content_widget = QtWidgets.QWidget(self) - content_widget.setVisible(False) - - content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(3, 3, 3, 3) - - main_layout.addWidget(top_part) - main_layout.addWidget(content_widget) - self.setLayout(main_layout) - - self.setAttribute(QtCore.Qt.WA_StyledBackground) - - self.top_part = top_part - self.button_toggle = button_toggle - self.button_toggle_text = button_toggle_text - - self.content_widget = content_widget - self.content_layout = content_layout - - self.top_part.clicked.connect(self._top_part_clicked) - self.button_toggle.clicked.connect(self.toggle_content) - - self.input_fields = [] - - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - for child_data in input_data.get("children", []): - self.add_children_gui(child_data, values) - - def _top_part_clicked(self): - self.toggle_content(not self.button_toggle.isChecked()) - - def toggle_content(self, *args): - if len(args) > 0: - checked = args[0] - else: - checked = self.button_toggle.isChecked() - arrow_type = QtCore.Qt.RightArrow - if checked: - arrow_type = QtCore.Qt.DownArrow - self.button_toggle.setChecked(checked) - self.button_toggle.setArrowType(arrow_type) - self.content_widget.setVisible(checked) - self.parent().updateGeometry() - - def resizeEvent(self, event): - super(DictExpandWidget, self).resizeEvent(event) - self.content_widget.updateGeometry() - - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - - def apply_overrides(self, override_value): - # Make sure this is set to False - self._is_overriden = False - self._state = None - self._child_state = None - for item in self.input_fields: - if override_value is None: - child_value = None - else: - child_value = override_value.get(item.key) - - item.apply_overrides(child_value) - - self._is_overriden = ( - self.is_group - and self.is_overidable - and ( - override_value is not None - or self.child_overriden - ) - ) - self.update_style() - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_group: - if self.is_overidable: - self._is_overriden = True - - # TODO update items - if item is not None: - for _item in self.input_fields: - if _item is not item: - _item.update_style() - - self.value_changed.emit(self) - - self.update_style() - - def update_style(self, is_overriden=None): - child_modified = self.child_modified - child_state = self.style_state(self.child_overriden, child_modified) - if child_state: - child_state = "child-{}".format(child_state) - - if child_state != self._child_state: - self.setProperty("state", child_state) - self.style().polish(self) - self._child_state = child_state - - state = self.style_state(self.is_overriden, self.is_modified) - if self._state == state: - return - - self.button_toggle_text.setProperty("state", state) - self.button_toggle_text.style().polish(self.button_toggle_text) - - self._state = state - - @property - def is_modified(self): - if self.is_group: - return self.child_modified - return False - - @property - def child_modified(self): - for input_field in self.input_fields: - if input_field.child_modified: - return True - return False - - @property - def child_overriden(self): - for input_field in self.input_fields: - if input_field.child_overriden: - return True - return False - - def item_value(self): - output = {} - for input_field in self.input_fields: - # TODO maybe merge instead of update should be used - # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) - return output - - def config_value(self): - return {self.key: self.item_value()} - - @property - def is_overidable(self): - return self._parent.is_overidable - - def add_children_gui(self, child_configuration, values): - item_type = child_configuration["type"] - klass = TypeToKlass.types.get(item_type) - - item = klass( - child_configuration, values, self.keys, self - ) - item.value_changed.connect(self._on_value_change) - self.content_layout.addWidget(item) - - self.input_fields.append(item) - return item - - def overrides(self): - if not self.is_overriden and not self.child_overriden: - return NOT_SET - - values = {} - for input_field in self.input_fields: - value = input_field.overrides() - if value is NOT_SET: - continue - values.update(value) - return {self.key: values} - - -class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): - # TODO is not overridable by itself - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, values, parent_keys, parent, label_widget=None - ): - self._parent = parent - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - self.any_parent_is_group = any_parent_is_group - - self._is_overriden = False - self.is_modified = False - self.is_group = is_group - - super(DictInvisible, self).__init__(parent) - self.setObjectName("DictInvisible") - - self.setAttribute(QtCore.Qt.WA_StyledBackground) - - layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - - self.input_fields = [] - - if "key" not in input_data: - print(json.dumps(input_data, indent=4)) - - self.key = input_data["key"] - self.keys = list(parent_keys) - self.keys.append(self.key) - - for child_data in input_data.get("children", []): - self.add_children_gui(child_data, values) - - def update_style(self, *args, **kwargs): - return - - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - - @property - def is_overidable(self): - return self._parent.is_overidable - - @property - def child_modified(self): - for input_field in self.input_fields: - if input_field.child_modified: - return True - return False - - @property - def child_overriden(self): - for input_field in self.input_fields: - if input_field.child_overriden: - return True - return False - - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - - def item_value(self): - output = {} - for input_field in self.input_fields: - # TODO maybe merge instead of update should be used - # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) - return output - - def config_value(self): - return {self.key: self.item_value()} - - def add_children_gui(self, child_configuration, values): - item_type = child_configuration["type"] - if item_type == "schema": - for _schema in child_configuration["children"]: - children = config.gui_schema(_schema) - self.add_children_gui(children, values) - return - - klass = TypeToKlass.types.get(item_type) - item = klass( - child_configuration, values, self.keys, self - ) - self.layout().addWidget(item) - - item.value_changed.connect(self._on_value_change) - - self.input_fields.append(item) - return item - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_group: - if self.is_overidable: - self._is_overriden = True - # TODO update items - if item is not None: - is_overriden = self.is_overriden - for _item in self.input_fields: - if _item is not item: - _item.update_style(is_overriden) - - self.value_changed.emit(self) - - def apply_overrides(self, override_value): - self._is_overriden = False - for item in self.input_fields: - if override_value is None: - child_value = None - else: - child_value = override_value.get(item.key) - item.apply_overrides(child_value) - - self._is_overriden = ( - self.is_group - and self.is_overidable - and ( - override_value is not None - or self.child_overriden - ) - ) - self.update_style() - - def overrides(self): - if not self.is_overriden and not self.child_overriden: - return NOT_SET - - values = {} - for input_field in self.input_fields: - value = input_field.overrides() - if value is NOT_SET: - continue - values.update(value) - return {self.key: values} - - -class DictFormWidget(QtWidgets.QWidget): - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, values, parent_keys, parent, label_widget=None - ): - self._parent = parent - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - self.any_parent_is_group = any_parent_is_group - - self.is_modified = False - self._is_overriden = False - self.is_group = False - - super(DictFormWidget, self).__init__(parent) - - self.input_fields = {} - self.content_layout = QtWidgets.QFormLayout(self) - - self.keys = list(parent_keys) - - for child_data in input_data.get("children", []): - self.add_children_gui(child_data, values) - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - self.value_changed.emit(self) - - @property - def is_overriden(self): - return self._parent.is_overriden - - @property - def child_modified(self): - for input_field in self.input_fields.values(): - if input_field.child_modified: - return True - return False - - @property - def child_overriden(self): - for input_field in self.input_fields.values(): - if input_field.child_overriden: - return True - return False - - @property - def is_overidable(self): - return self._parent.is_overidable - - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - - def add_children_gui(self, child_configuration, values): - item_type = child_configuration["type"] - key = child_configuration["key"] - # Pop label to not be set in child - label = child_configuration["label"] - - klass = TypeToKlass.types.get(item_type) - - label_widget = QtWidgets.QLabel(label) - - item = klass( - child_configuration, values, self.keys, self, label_widget - ) - item.value_changed.connect(self._on_value_change) - self.content_layout.addRow(label_widget, item) - self.input_fields[key] = item - return item - - def item_value(self): - output = {} - for input_field in self.input_fields.values(): - # TODO maybe merge instead of update should be used - # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) - return output - - def config_value(self): - return self.item_value() - - def overrides(self): - if not self.is_overiden and not self.child_overriden: - return NOT_SET - - values = {} - for input_field in self.input_fields: - value = input_field.overrides() - if value is not NOT_SET: - values.update(value) - return values - class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): _btn_size = 20 @@ -2008,7 +1492,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): return output -class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): +class ModifiableDict(ExpandingWidget, PypeConfigurationWidget, InputWidget): # Should be used only for dictionary with one datatype as value # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) @@ -2138,10 +1622,506 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} + +class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + if values is AS_WIDGET: + raise TypeError("Can't use \"{}\" as widget item.".format( + self.__class__.__name__ + )) + self._parent = parent + + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + + self._is_modified = False + self._is_overriden = False + self.is_group = is_group + + self._state = None + self._child_state = None + + super(DictExpandWidget, self).__init__(parent) + self.setObjectName("DictExpandWidget") + top_part = ClickableWidget(parent=self) + + button_size = QtCore.QSize(5, 5) + button_toggle = QtWidgets.QToolButton(parent=top_part) + button_toggle.setProperty("btn-type", "expand-toggle") + button_toggle.setIconSize(button_size) + button_toggle.setArrowType(QtCore.Qt.RightArrow) + button_toggle.setCheckable(True) + button_toggle.setChecked(False) + + label = input_data["label"] + button_toggle_text = QtWidgets.QLabel(label, parent=top_part) + button_toggle_text.setObjectName("ExpandLabel") + + layout = QtWidgets.QHBoxLayout(top_part) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + layout.addWidget(button_toggle) + layout.addWidget(button_toggle_text) + top_part.setLayout(layout) + + main_layout = QtWidgets.QVBoxLayout(self) + main_layout.setContentsMargins(9, 9, 9, 9) + + content_widget = QtWidgets.QWidget(self) + content_widget.setVisible(False) + + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(3, 3, 3, 3) + + main_layout.addWidget(top_part) + main_layout.addWidget(content_widget) + self.setLayout(main_layout) + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + self.top_part = top_part + self.button_toggle = button_toggle + self.button_toggle_text = button_toggle_text + + self.content_widget = content_widget + self.content_layout = content_layout + + self.top_part.clicked.connect(self._top_part_clicked) + self.button_toggle.clicked.connect(self.toggle_content) + + self.input_fields = [] + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + + def _top_part_clicked(self): + self.toggle_content(not self.button_toggle.isChecked()) + + def toggle_content(self, *args): + if len(args) > 0: + checked = args[0] + else: + checked = self.button_toggle.isChecked() + arrow_type = QtCore.Qt.RightArrow + if checked: + arrow_type = QtCore.Qt.DownArrow + self.button_toggle.setChecked(checked) + self.button_toggle.setArrowType(arrow_type) + self.content_widget.setVisible(checked) + self.parent().updateGeometry() + + def resizeEvent(self, event): + super(DictExpandWidget, self).resizeEvent(event) + self.content_widget.updateGeometry() + + @property + def is_overriden(self): + return self._is_overriden or self._parent.is_overriden + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + + def apply_overrides(self, override_value): + # Make sure this is set to False + self._is_overriden = False + self._state = None + self._child_state = None + for item in self.input_fields: + if override_value is None: + child_value = None + else: + child_value = override_value.get(item.key) + + item.apply_overrides(child_value) + + self._is_overriden = ( + self.is_group + and self.is_overidable + and ( + override_value is not None + or self.child_overriden + ) + ) + self.update_style() + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + if self.is_group: + if self.is_overidable: + self._is_overriden = True + + # TODO update items + if item is not None: + for _item in self.input_fields: + if _item is not item: + _item.update_style() + + self.value_changed.emit(self) + + self.update_style() + + def update_style(self, is_overriden=None): + child_modified = self.child_modified + child_state = self.style_state(self.child_overriden, child_modified) + if child_state: + child_state = "child-{}".format(child_state) + + if child_state != self._child_state: + self.setProperty("state", child_state) + self.style().polish(self) + self._child_state = child_state + + state = self.style_state(self.is_overriden, self.is_modified) + if self._state == state: + return + + self.button_toggle_text.setProperty("state", state) + self.button_toggle_text.style().polish(self.button_toggle_text) + + self._state = state + + @property + def is_modified(self): + if self.is_group: + return self.child_modified + return False + + @property + def child_modified(self): + for input_field in self.input_fields: + if input_field.child_modified: + return True + return False + + @property + def child_overriden(self): + for input_field in self.input_fields: + if input_field.child_overriden: + return True + return False + + def item_value(self): + output = {} + for input_field in self.input_fields: + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + def config_value(self): + return {self.key: self.item_value()} + + @property + def is_overidable(self): + return self._parent.is_overidable + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + klass = TypeToKlass.types.get(item_type) + + item = klass( + child_configuration, values, self.keys, self + ) + item.value_changed.connect(self._on_value_change) + self.content_layout.addWidget(item) + + self.input_fields.append(item) + return item + def overrides(self): - if not self.is_overiden: - return NOT_SET - return self.config_value() + if not self.is_overriden and not self.child_overriden: + return NOT_SET, False + + values = {} + groups = [] + for input_field in self.input_fields: + value, is_group = input_field.overrides() + if value is not NOT_SET: + values.update(value) + if is_group: + groups.extend(values.keys()) + if groups: + values[METADATA_KEY] = {"groups": groups} + return {self.key: values}, self.is_group + + +class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): + # TODO is not overridable by itself + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + + self._is_overriden = False + self.is_modified = False + self.is_group = is_group + + super(DictInvisible, self).__init__(parent) + self.setObjectName("DictInvisible") + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + + self.input_fields = [] + + if "key" not in input_data: + print(json.dumps(input_data, indent=4)) + + self.key = input_data["key"] + self.keys = list(parent_keys) + self.keys.append(self.key) + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + + def update_style(self, *args, **kwargs): + return + + @property + def is_overriden(self): + return self._is_overriden or self._parent.is_overriden + + @property + def is_overidable(self): + return self._parent.is_overidable + + @property + def child_modified(self): + for input_field in self.input_fields: + if input_field.child_modified: + return True + return False + + @property + def child_overriden(self): + for input_field in self.input_fields: + if input_field.child_overriden: + return True + return False + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + + def item_value(self): + output = {} + for input_field in self.input_fields: + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + def config_value(self): + return {self.key: self.item_value()} + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + if item_type == "schema": + for _schema in child_configuration["children"]: + children = config.gui_schema(_schema) + self.add_children_gui(children, values) + return + + klass = TypeToKlass.types.get(item_type) + item = klass( + child_configuration, values, self.keys, self + ) + self.layout().addWidget(item) + + item.value_changed.connect(self._on_value_change) + + self.input_fields.append(item) + return item + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + if self.is_group: + if self.is_overidable: + self._is_overriden = True + # TODO update items + if item is not None: + is_overriden = self.is_overriden + for _item in self.input_fields: + if _item is not item: + _item.update_style(is_overriden) + + self.value_changed.emit(self) + + def apply_overrides(self, override_value): + self._is_overriden = False + for item in self.input_fields: + if override_value is None: + child_value = None + else: + child_value = override_value.get(item.key) + item.apply_overrides(child_value) + + self._is_overriden = ( + self.is_group + and self.is_overidable + and ( + override_value is not None + or self.child_overriden + ) + ) + self.update_style() + + def overrides(self): + if not self.is_overriden and not self.child_overriden: + return NOT_SET, False + + values = {} + groups = [] + for input_field in self.input_fields: + value, is_group = input_field.overrides() + if value is not NOT_SET: + values.update(value) + if is_group: + groups.extend(values.keys()) + if groups: + values[METADATA_KEY] = {"groups": groups} + return {self.key: values}, self.is_group + + +class DictFormWidget(QtWidgets.QWidget): + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + self.any_parent_is_group = any_parent_is_group + + self.is_modified = False + self._is_overriden = False + self.is_group = False + + super(DictFormWidget, self).__init__(parent) + + self.input_fields = {} + self.content_layout = QtWidgets.QFormLayout(self) + + self.keys = list(parent_keys) + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + self.value_changed.emit(self) + + @property + def is_overriden(self): + return self._parent.is_overriden + + @property + def child_modified(self): + for input_field in self.input_fields.values(): + if input_field.child_modified: + return True + return False + + @property + def child_overriden(self): + for input_field in self.input_fields.values(): + if input_field.child_overriden: + return True + return False + + @property + def is_overidable(self): + return self._parent.is_overidable + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + key = child_configuration["key"] + # Pop label to not be set in child + label = child_configuration["label"] + + klass = TypeToKlass.types.get(item_type) + + label_widget = QtWidgets.QLabel(label) + + item = klass( + child_configuration, values, self.keys, self, label_widget + ) + item.value_changed.connect(self._on_value_change) + self.content_layout.addRow(label_widget, item) + self.input_fields[key] = item + return item + + def item_value(self): + output = {} + for input_field in self.input_fields.values(): + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + def config_value(self): + return self.item_value() + + def overrides(self): + if not self.is_overriden and not self.child_overriden: + return NOT_SET, False + + values = {} + groups = [] + for input_field in self.input_fields: + value, is_group = input_field.overrides() + if value is not NOT_SET: + values.update(value) + if is_group: + groups.extend(values.keys()) + if groups: + values[METADATA_KEY] = {"groups": groups} + return {self.key: values}, self.is_group TypeToKlass.types["boolean"] = BooleanWidget diff --git a/pype/tools/config_setting/widgets/lib.py b/pype/tools/config_setting/widgets/lib.py index ac0a353d53..bf6d2d0fbd 100644 --- a/pype/tools/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/widgets/lib.py @@ -41,4 +41,13 @@ class CustomNone: NOT_SET = CustomNone() -AS_WIDGET = CustomNone() +AS_WIDGET = type("AS_WIDGET", (), {}) +METADATA_KEY = type("METADATA_KEY", (), {}) + + +def convert_gui_data_to_overrides(data): + pass + + +def convert_overrides_to_gui_data(data): + pass From f1d5ef05aae4a94a3cbf1877537a7b97b091b03a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 19 Aug 2020 16:47:25 +0200 Subject: [PATCH 060/507] added conversion from override gui data to regular override and back --- pype/tools/config_setting/widgets/base.py | 4 +- pype/tools/config_setting/widgets/config.py | 11 +-- pype/tools/config_setting/widgets/inputs.py | 6 +- pype/tools/config_setting/widgets/lib.py | 80 +++++++++++---------- 4 files changed, 52 insertions(+), 49 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 156f1f80e4..bdacb60559 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -3,7 +3,7 @@ import json from Qt import QtWidgets, QtCore, QtGui from . import config from .widgets import UnsavedChangesDialog -from .lib import NOT_SET, METADATA_KEY +from .lib import NOT_SET, METADATA_KEY, convert_gui_data_to_overrides from avalon import io @@ -404,7 +404,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): if groups: data[METADATA_KEY] = {"groups": groups} - output = convert_to_override(data) + output = convert_gui_data_to_overrides(data) print(json.dumps(output, indent=4)) def _save_defaults(self): diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 8319c3d51d..62a3adb782 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -23,8 +23,9 @@ project_presets_path = os.path.normpath( ) first_run = False -OVERRIDE_KEY = "__overriden__" -POP_KEY = "__popkey__" +OVERRIDEN_KEY = "__overriden_keys__" +# TODO key popping not implemented yet +POP_KEY = "__pop_key__" def load_json(fpath): @@ -178,8 +179,8 @@ def project_preset_overrides(project_name, **kwargs): def merge_overrides(global_dict, override_dict): - if OVERRIDE_KEY in override_dict: - _override = override_dict.pop(OVERRIDE_KEY) + if OVERRIDEN_KEY in override_dict: + _override = override_dict.pop(OVERRIDEN_KEY) if _override: return override_dict @@ -187,7 +188,7 @@ def merge_overrides(global_dict, override_dict): if value == POP_KEY: global_dict.pop(key) - elif key == OVERRIDE_KEY: + elif key == OVERRIDEN_KEY: continue elif key not in global_dict: diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/widgets/inputs.py index bb2d76fc71..1840572cfb 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/widgets/inputs.py @@ -1858,7 +1858,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: values.update(value) if is_group: - groups.extend(values.keys()) + groups.extend(value.keys()) if groups: values[METADATA_KEY] = {"groups": groups} return {self.key: values}, self.is_group @@ -2013,7 +2013,7 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): if value is not NOT_SET: values.update(value) if is_group: - groups.extend(values.keys()) + groups.extend(value.keys()) if groups: values[METADATA_KEY] = {"groups": groups} return {self.key: values}, self.is_group @@ -2118,7 +2118,7 @@ class DictFormWidget(QtWidgets.QWidget): if value is not NOT_SET: values.update(value) if is_group: - groups.extend(values.keys()) + groups.extend(value.keys()) if groups: values[METADATA_KEY] = {"groups": groups} return {self.key: values}, self.is_group diff --git a/pype/tools/config_setting/widgets/lib.py b/pype/tools/config_setting/widgets/lib.py index bf6d2d0fbd..fd3f45b590 100644 --- a/pype/tools/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/widgets/lib.py @@ -1,53 +1,55 @@ -import uuid +from .config import OVERRIDEN_KEY class CustomNone: - """Created object can be used as custom None (not equal to None). - - WARNING: Multiple created objects are not equal either. - Exmple: - >>> a = CustomNone() - >>> a == None - False - >>> b = CustomNone() - >>> a == b - False - >>> a == a - True - """ - - def __init__(self): - """Create uuid as identifier for custom None.""" - self.identifier = str(uuid.uuid4()) - + """Created object can be used as custom None (not equal to None).""" def __bool__(self): """Return False (like default None).""" return False - def __eq__(self, other): - """Equality is compared by identifier value.""" - if type(other) == type(self): - if other.identifier == self.identifier: - return True - return False - - def __str__(self): - """Return value of identifier when converted to string.""" - return "".format(str(self.identifier)) - - def __repr__(self): - """Representation of custom None.""" - return "".format(str(self.identifier)) - NOT_SET = CustomNone() AS_WIDGET = type("AS_WIDGET", (), {}) + METADATA_KEY = type("METADATA_KEY", (), {}) - -def convert_gui_data_to_overrides(data): - pass +OVERRIDE_VERSION = 1 -def convert_overrides_to_gui_data(data): - pass +def convert_gui_data_to_overrides(data, first=True): + if not data or not isinstance(data, dict): + return data + + output = {} + if first: + output["__override_version__"] = OVERRIDE_VERSION + + if METADATA_KEY in data: + metadata = data.pop(METADATA_KEY) + for key, value in metadata.items(): + if key == "groups": + print("**", value) + output[OVERRIDEN_KEY] = value + else: + KeyError("Unknown metadata key \"{}\"".format(key)) + + for key, value in data.items(): + output[key] = convert_gui_data_to_overrides(value, False) + return output + + +def convert_overrides_to_gui_data(data, first=True): + if not data or not isinstance(data, dict): + return data + + output = {} + if OVERRIDEN_KEY in data: + groups = data.pop(OVERRIDEN_KEY) + if METADATA_KEY not in output: + output[METADATA_KEY] = {} + output[METADATA_KEY]["groups"] = groups + + for key, value in data.items(): + output[key] = convert_overrides_to_gui_data(value, False) + + return output From eb74ea9253a42e33e1f034bec2c1d83829e39834 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 20 Aug 2020 10:03:59 +0200 Subject: [PATCH 061/507] get rid of metadata loading --- pype/tools/config_setting/widgets/config.py | 36 +++------------------ 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 62a3adb782..8d9d4fa1d2 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -86,31 +86,16 @@ def load_json(fpath): return {} -def subkey_merge(_dict, value, keys, with_metadata=False): +def subkey_merge(_dict, value, keys): key = keys.pop(0) if not keys: - if with_metadata: - _dict[key] = {"type": "file", "value": value} - else: - _dict[key] = value + _dict[key] = value return _dict if key not in _dict: - if with_metadata: - _dict[key] = {"type": "folder", "value": {}} - else: - _dict[key] = {} + _dict[key] = {} + _dict[key] = subkey_merge(_dict[key], value, keys) - if with_metadata: - sub_dict = _dict[key]["value"] - else: - sub_dict = _dict[key] - - _value = subkey_merge(sub_dict, value, keys, with_metadata) - if with_metadata: - _dict[key]["value"] = _value - else: - _dict[key] = _value return _dict @@ -122,7 +107,6 @@ def load_jsons_from_dir(path, *args, **kwargs): # TODO warning return output - with_metadata = kwargs.get("with_metadata") sub_keys = list(kwargs.pop("subkeys", args)) for sub_key in tuple(sub_keys): _path = os.path.join(path, sub_key) @@ -143,7 +127,7 @@ def load_jsons_from_dir(path, *args, **kwargs): # dict_path = os.path.join(base[base_len:], basename) # dict_keys = dict_path.split(os.path.sep) dict_keys = base[base_len:].split(os.path.sep) + [basename] - output = subkey_merge(output, value, dict_keys, with_metadata) + output = subkey_merge(output, value, dict_keys) for sub_key in sub_keys: output = output[sub_key] @@ -158,16 +142,6 @@ def global_project_presets(**kwargs): return load_jsons_from_dir(project_presets_path, **kwargs) -def studio_presets_with_metadata(*args, **kwargs): - kwargs["with_metadata"] = True - return load_jsons_from_dir(studio_presets_path, *args, **kwargs) - - -def global_project_presets_with_metadata(**kwargs): - kwargs["with_metadata"] = True - return load_jsons_from_dir(project_presets_path, **kwargs) - - def project_preset_overrides(project_name, **kwargs): project_configs_path = os.environ.get("PYPE_PROJECT_CONFIGS") if project_name and project_configs_path: From b855038889b8b7ccb7e0e3cc849f7f896297c5a5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 12:56:14 +0200 Subject: [PATCH 062/507] change project overides that are only one file --- .../kuba_each_case/global/creator.json | 8 -------- .../kuba_each_case/global/intents.json | 3 --- .../kuba_each_case/plugins/maya/publish.json | 8 -------- .../kuba_each_case/project_presets.json | 18 ++++++++++++++++++ 4 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json delete mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json delete mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json create mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json deleted file mode 100644 index d14e779f01..0000000000 --- a/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/creator.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Model": ["model"], - "Render Globals": ["light", "render"], - "Layout": ["layout"], - "Set Dress": ["setdress"], - "Look": ["look"], - "Rig": ["rigging"] -} diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json deleted file mode 100644 index bf147c7a19..0000000000 --- a/pype/tools/config_setting/config/project_overrides/kuba_each_case/global/intents.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "default": "test" -} diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json deleted file mode 100644 index 46fc343b6c..0000000000 --- a/pype/tools/config_setting/config/project_overrides/kuba_each_case/plugins/maya/publish.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ValidateModelName": { - "enabled": true - }, - "ValidateAssemblyName": { - "enabled": false - } -} diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json new file mode 100644 index 0000000000..599a5dcbea --- /dev/null +++ b/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json @@ -0,0 +1,18 @@ +{ + "__override_version__": 1, + "plugins": { + "maya": { + "__overriden_keys__": [ + "publish" + ], + "publish": { + "ValidateModelName": { + "enabled": true + }, + "ValidateAssemblyName": { + "enabled": false + } + } + } + } +} From d01d9d55da1d5e1715cdf3a25a360114c71308ce Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 12:56:35 +0200 Subject: [PATCH 063/507] config can work with single file overrides --- pype/tools/config_setting/widgets/config.py | 34 +++++++++++++-------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 8d9d4fa1d2..321a97a4b8 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -18,8 +18,9 @@ config_path = os.path.dirname(os.path.dirname(__file__)) studio_presets_path = os.path.normpath( os.path.join(config_path, "config", "studio_presets") ) +project_configurations_dir = "project_presets" project_presets_path = os.path.normpath( - os.path.join(config_path, "config", "project_presets") + os.path.join(config_path, "config", project_configurations_dir) ) first_run = False @@ -118,15 +119,18 @@ def load_jsons_from_dir(path, *args, **kwargs): base_len = len(path) + 1 for base, _directories, filenames in os.walk(path): + base_items_str = base[base_len:] + if not base_items_str: + base_items = [] + else: + base_items = base_items_str.split(os.path.sep) + for filename in filenames: basename, ext = os.path.splitext(filename) if ext == ".json": full_path = os.path.join(base, filename) value = load_json(full_path) - - # dict_path = os.path.join(base[base_len:], basename) - # dict_keys = dict_path.split(os.path.sep) - dict_keys = base[base_len:].split(os.path.sep) + [basename] + dict_keys = base_items + [basename] output = subkey_merge(output, value, dict_keys) for sub_key in sub_keys: @@ -145,27 +149,31 @@ def global_project_presets(**kwargs): def project_preset_overrides(project_name, **kwargs): project_configs_path = os.environ.get("PYPE_PROJECT_CONFIGS") if project_name and project_configs_path: - return load_jsons_from_dir( + result = load_jsons_from_dir( os.path.join(project_configs_path, project_name), **kwargs ) + print(json.dumps(result, indent=4)) + if result: + result = result.get(project_configurations_dir) or {} + return result return {} def merge_overrides(global_dict, override_dict): if OVERRIDEN_KEY in override_dict: - _override = override_dict.pop(OVERRIDEN_KEY) - if _override: - return override_dict + overriden_keys = set(override_dict.pop(OVERRIDEN_KEY)) + else: + overriden_keys = set() for key, value in override_dict.items(): if value == POP_KEY: global_dict.pop(key) - elif key == OVERRIDEN_KEY: - continue - - elif key not in global_dict: + elif ( + key in overriden_keys + or key not in global_dict + ): global_dict[key] = value elif isinstance(value, dict) and isinstance(global_dict[key], dict): From 742c2b069b28203ec1703f36109d5497f00e1690 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 13:12:04 +0200 Subject: [PATCH 064/507] removed debug print --- pype/tools/config_setting/widgets/lib.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pype/tools/config_setting/widgets/lib.py b/pype/tools/config_setting/widgets/lib.py index fd3f45b590..d733396d59 100644 --- a/pype/tools/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/widgets/lib.py @@ -28,7 +28,6 @@ def convert_gui_data_to_overrides(data, first=True): metadata = data.pop(METADATA_KEY) for key, value in metadata.items(): if key == "groups": - print("**", value) output[OVERRIDEN_KEY] = value else: KeyError("Unknown metadata key \"{}\"".format(key)) From f8492befdfe8b4a0c5f73139f61a046ec1fac645 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 15:38:09 +0200 Subject: [PATCH 065/507] fixed getting overrides --- pype/tools/config_setting/widgets/config.py | 34 +++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 321a97a4b8..7bce18b7f4 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -18,9 +18,9 @@ config_path = os.path.dirname(os.path.dirname(__file__)) studio_presets_path = os.path.normpath( os.path.join(config_path, "config", "studio_presets") ) -project_configurations_dir = "project_presets" +PROJECT_CONFIGURATION_DIR = "project_presets" project_presets_path = os.path.normpath( - os.path.join(config_path, "config", project_configurations_dir) + os.path.join(config_path, "config", PROJECT_CONFIGURATION_DIR) ) first_run = False @@ -146,18 +146,20 @@ def global_project_presets(**kwargs): return load_jsons_from_dir(project_presets_path, **kwargs) +def path_to_project_overrides(project_name): + project_configs_path = os.environ["PYPE_PROJECT_CONFIGS"] + dirpath = os.path.join(project_configs_path, project_name) + return os.path.join(dirpath, PROJECT_CONFIGURATION_DIR + ".json") + + def project_preset_overrides(project_name, **kwargs): - project_configs_path = os.environ.get("PYPE_PROJECT_CONFIGS") - if project_name and project_configs_path: - result = load_jsons_from_dir( - os.path.join(project_configs_path, project_name), - **kwargs - ) - print(json.dumps(result, indent=4)) - if result: - result = result.get(project_configurations_dir) or {} - return result - return {} + if not project_name: + return {} + + path_to_json = path_to_project_overrides(project_name) + if not os.path.exists(path_to_json): + return {} + return load_json(path_to_json) def merge_overrides(global_dict, override_dict): @@ -227,7 +229,7 @@ def replace_inner_schemas(schema_data, schema_collection): return schema_data -class ShemaMissingFileInfo(Exception): +class SchemaMissingFileInfo(Exception): def __init__(self, invalid): full_path_keys = [] for item in invalid: @@ -237,7 +239,7 @@ class ShemaMissingFileInfo(Exception): "Schema has missing definition of output file (\"is_file\" key)" " for keys. [{}]" ).format(", ".join(full_path_keys)) - super(ShemaMissingFileInfo, self).__init__(msg) + super(SchemaMissingFileInfo, self).__init__(msg) def file_keys_from_schema(schema_data): @@ -290,7 +292,7 @@ def validate_all_has_ending_file(schema_data, is_top=True): if not is_top: return invalid - raise ShemaMissingFileInfo(invalid) + raise SchemaMissingFileInfo(invalid) def validate_schema(schema_data): From 1043b70550ac42409329dc6e6b43fce8d2517028 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 15:38:26 +0200 Subject: [PATCH 066/507] added override saving --- .../projects_schema/project_gui_schema.json | 3 +-- pype/tools/config_setting/widgets/base.py | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json b/pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json index 366400e5ff..0405524b40 100644 --- a/pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json +++ b/pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json @@ -1,7 +1,6 @@ { - "key": "studio", + "key": "project", "type": "dict-invisible", - "label": "Studio", "children": [ { "type": "schema", diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index bdacb60559..259ec9e02c 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -74,8 +74,6 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): content_layout.setAlignment(QtCore.Qt.AlignTop) content_widget.setLayout(content_layout) - # scroll_widget.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - # scroll_widget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) scroll_widget.setWidgetResizable(True) scroll_widget.setWidget(content_widget) @@ -404,8 +402,17 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): if groups: data[METADATA_KEY] = {"groups": groups} - output = convert_gui_data_to_overrides(data) - print(json.dumps(output, indent=4)) + output_data = convert_gui_data_to_overrides(data) + + overrides_json_path = config.path_to_project_overrides( + self.project_name + ) + dirpath = os.path.dirname(overrides_json_path) + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + with open(overrides_json_path, "w") as file_stream: + json.dump(output_data, file_stream, indent=4) def _save_defaults(self): output = {} @@ -429,7 +436,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): all_values = _all_values # Skip first key - all_values = all_values["studio"] + all_values = all_values["project"] # Load studio data with metadata current_presets = config.studio_presets() From 4ce1f70f88909ff0d60dbb6f45d42580c0428d88 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 15:57:50 +0200 Subject: [PATCH 067/507] saving works properly --- .../kuba_each_case/project_presets.json | 2 +- pype/tools/config_setting/widgets/base.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json index 599a5dcbea..b9da242453 100644 --- a/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json +++ b/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json @@ -15,4 +15,4 @@ } } } -} +} \ No newline at end of file diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 259ec9e02c..2421c02a25 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -390,18 +390,17 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): self._save_overrides() def _save_overrides(self): - data = {} - groups = [] + _data = {} for item in self.input_fields: value, is_group = item.overrides() if value is not NOT_SET: - data.update(value) - + _data.update(value) if is_group: - groups.extend(value.keys()) + raise Exception( + "Top item can't be overriden in Project widget." + ) - if groups: - data[METADATA_KEY] = {"groups": groups} + data = _data.get("project") or {} output_data = convert_gui_data_to_overrides(data) overrides_json_path = config.path_to_project_overrides( From 993b0ab21fdc60461176894f461f936721231152 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 16:03:27 +0200 Subject: [PATCH 068/507] default project configurations works --- pype/tools/config_setting/widgets/base.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 2421c02a25..0563f942be 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -357,6 +357,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): schema = config.gui_schema("projects_schema", "project_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) + self.schema = schema def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] @@ -422,10 +423,6 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): _output = {key: output} output = _output - print(json.dumps(output, indent=4)) - return - - # TODO check implementation copied from studio all_values = {} for item in self.input_fields: all_values.update(item.config_value()) @@ -438,7 +435,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): all_values = all_values["project"] # Load studio data with metadata - current_presets = config.studio_presets() + current_presets = config.global_project_presets() keys_to_file = config.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: @@ -458,7 +455,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): origin_values.update(new_values) output_path = os.path.join( - config.studio_presets_path, subpath + config.project_presets_path, subpath ) dirpath = os.path.dirname(output_path) if not os.path.exists(dirpath): From 1c47579334406a1b650c05d49b3dcf99ae8e0023 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 16:08:55 +0200 Subject: [PATCH 069/507] modified getting paths --- pype/tools/config_setting/widgets/config.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index 7bce18b7f4..b071d81afe 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -4,29 +4,25 @@ import logging import copy # DEBUG SETUP -os.environ["AVALON_PROJECT"] = "kuba_each_case" +os.environ["PYPE_CONFIG"] = os.path.dirname(os.path.dirname(__file__)) os.environ["PYPE_PROJECT_CONFIGS"] = os.path.join( - os.path.dirname(os.path.dirname(__file__)), - "config", - "project_overrides" + os.environ["PYPE_CONFIG"], "config", "project_overrides" ) -# log = logging.getLogger(__name__) -config_path = os.path.dirname(os.path.dirname(__file__)) studio_presets_path = os.path.normpath( - os.path.join(config_path, "config", "studio_presets") + os.path.join(os.environ["PYPE_CONFIG"], "config", "studio_presets") ) PROJECT_CONFIGURATION_DIR = "project_presets" project_presets_path = os.path.normpath( - os.path.join(config_path, "config", PROJECT_CONFIGURATION_DIR) + os.path.join(os.environ["PYPE_CONFIG"], "config", PROJECT_CONFIGURATION_DIR) ) first_run = False -OVERRIDEN_KEY = "__overriden_keys__" # TODO key popping not implemented yet POP_KEY = "__pop_key__" +OVERRIDEN_KEY = "__overriden_keys__" def load_json(fpath): From 57cac7135ddb644ba6e3ec9a08efb0d34452febb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 16:10:24 +0200 Subject: [PATCH 070/507] changed global variables --- pype/tools/config_setting/widgets/base.py | 4 ++-- pype/tools/config_setting/widgets/config.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/widgets/base.py index 0563f942be..0fc9c5cabf 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/widgets/base.py @@ -147,7 +147,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): origin_values.update(new_values) output_path = os.path.join( - config.studio_presets_path, subpath + config.STUDIO_PRESETS_PATH, subpath ) dirpath = os.path.dirname(output_path) if not os.path.exists(dirpath): @@ -455,7 +455,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): origin_values.update(new_values) output_path = os.path.join( - config.project_presets_path, subpath + config.PROJECT_PRESETS_PATH, subpath ) dirpath = os.path.dirname(output_path) if not os.path.exists(dirpath): diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py index b071d81afe..34eec69fc7 100644 --- a/pype/tools/config_setting/widgets/config.py +++ b/pype/tools/config_setting/widgets/config.py @@ -11,13 +11,13 @@ os.environ["PYPE_PROJECT_CONFIGS"] = os.path.join( log = logging.getLogger(__name__) -studio_presets_path = os.path.normpath( +STUDIO_PRESETS_PATH = os.path.normpath( os.path.join(os.environ["PYPE_CONFIG"], "config", "studio_presets") ) PROJECT_CONFIGURATION_DIR = "project_presets" -project_presets_path = os.path.normpath( - os.path.join(os.environ["PYPE_CONFIG"], "config", PROJECT_CONFIGURATION_DIR) -) +PROJECT_PRESETS_PATH = os.path.normpath(os.path.join( + os.environ["PYPE_CONFIG"], "config", PROJECT_CONFIGURATION_DIR +)) first_run = False # TODO key popping not implemented yet @@ -135,11 +135,11 @@ def load_jsons_from_dir(path, *args, **kwargs): def studio_presets(*args, **kwargs): - return load_jsons_from_dir(studio_presets_path, *args, **kwargs) + return load_jsons_from_dir(STUDIO_PRESETS_PATH, *args, **kwargs) def global_project_presets(**kwargs): - return load_jsons_from_dir(project_presets_path, **kwargs) + return load_jsons_from_dir(PROJECT_PRESETS_PATH, **kwargs) def path_to_project_overrides(project_name): From 1ac12eadb2d3e2a4c0530e830e195c30e4cf9970 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 17:38:03 +0200 Subject: [PATCH 071/507] reorganized config setting tool to usable as tool --- pype/tools/config_setting/__init__.py | 7 + pype/tools/config_setting/__main__.py | 18 + .../config_setting/config_setting/__init__.py | 10 + .../ftrack_projects_gui_schema.json | 0 .../projects_schema/plugins_gui_schema.json | 0 .../projects_schema/project_gui_schema.json | 0 .../projects_schema/test_project_schema.json | 0 .../applications_gui_schema.json | 0 .../studio_schema/studio_gui_schema.json | 0 .../studio_schema/tools_gui_schema.json | 0 .../{ => config_setting}/style/__init__.py | 0 .../{ => config_setting}/style/pype_icon.png | Bin .../{ => config_setting}/style/style.css | 0 .../config_setting/widgets/__init__.py | 19 + .../{ => config_setting}/widgets/base.py | 28 +- .../{ => config_setting}/widgets/inputs.py | 6 +- .../config_setting/widgets/lib.py | 182 ++++++++++ .../{ => config_setting}/widgets/main.py | 0 .../{ => config_setting}/widgets/tests.py | 0 .../{ => config_setting}/widgets/widgets.py | 0 pype/tools/config_setting/interface.py | 56 --- pype/tools/config_setting/widgets/__init__.py | 6 - pype/tools/config_setting/widgets/config.py | 325 ------------------ pype/tools/config_setting/widgets/lib.py | 54 --- 24 files changed, 251 insertions(+), 460 deletions(-) create mode 100644 pype/tools/config_setting/__init__.py create mode 100644 pype/tools/config_setting/__main__.py create mode 100644 pype/tools/config_setting/config_setting/__init__.py rename pype/tools/config_setting/{ => config_setting}/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json (100%) rename pype/tools/config_setting/{ => config_setting}/config_gui_schema/projects_schema/plugins_gui_schema.json (100%) rename pype/tools/config_setting/{ => config_setting}/config_gui_schema/projects_schema/project_gui_schema.json (100%) rename pype/tools/config_setting/{ => config_setting}/config_gui_schema/projects_schema/test_project_schema.json (100%) rename pype/tools/config_setting/{ => config_setting}/config_gui_schema/studio_schema/applications_gui_schema.json (100%) rename pype/tools/config_setting/{ => config_setting}/config_gui_schema/studio_schema/studio_gui_schema.json (100%) rename pype/tools/config_setting/{ => config_setting}/config_gui_schema/studio_schema/tools_gui_schema.json (100%) rename pype/tools/config_setting/{ => config_setting}/style/__init__.py (100%) rename pype/tools/config_setting/{ => config_setting}/style/pype_icon.png (100%) rename pype/tools/config_setting/{ => config_setting}/style/style.css (100%) create mode 100644 pype/tools/config_setting/config_setting/widgets/__init__.py rename pype/tools/config_setting/{ => config_setting}/widgets/base.py (95%) rename pype/tools/config_setting/{ => config_setting}/widgets/inputs.py (99%) create mode 100644 pype/tools/config_setting/config_setting/widgets/lib.py rename pype/tools/config_setting/{ => config_setting}/widgets/main.py (100%) rename pype/tools/config_setting/{ => config_setting}/widgets/tests.py (100%) rename pype/tools/config_setting/{ => config_setting}/widgets/widgets.py (100%) delete mode 100644 pype/tools/config_setting/interface.py delete mode 100644 pype/tools/config_setting/widgets/__init__.py delete mode 100644 pype/tools/config_setting/widgets/config.py delete mode 100644 pype/tools/config_setting/widgets/lib.py diff --git a/pype/tools/config_setting/__init__.py b/pype/tools/config_setting/__init__.py new file mode 100644 index 0000000000..c3bd49449d --- /dev/null +++ b/pype/tools/config_setting/__init__.py @@ -0,0 +1,7 @@ +from config_setting import style, MainWidget + + +__all__ = ( + "style", + "MainWidget" +) diff --git a/pype/tools/config_setting/__main__.py b/pype/tools/config_setting/__main__.py new file mode 100644 index 0000000000..171b85a775 --- /dev/null +++ b/pype/tools/config_setting/__main__.py @@ -0,0 +1,18 @@ +import os +import sys + +import config_setting +from Qt import QtWidgets, QtGui + + +if __name__ == "__main__": + app = QtWidgets.QApplication(sys.argv) + + stylesheet = config_setting.style.load_stylesheet() + app.setStyleSheet(stylesheet) + app.setWindowIcon(QtGui.QIcon(config_setting.style.app_icon_path())) + + widget = config_setting.MainWidget() + widget.show() + + sys.exit(app.exec_()) diff --git a/pype/tools/config_setting/config_setting/__init__.py b/pype/tools/config_setting/config_setting/__init__.py new file mode 100644 index 0000000000..835754e6a1 --- /dev/null +++ b/pype/tools/config_setting/config_setting/__init__.py @@ -0,0 +1,10 @@ +from . import style +# from . import widgets +from .widgets import MainWidget + + +__all__ = ( + "style", + # "widgets", + "MainWidget" +) diff --git a/pype/tools/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/project_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/projects_schema/project_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/project_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/projects_schema/test_project_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/test_project_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/projects_schema/test_project_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/test_project_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json diff --git a/pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json diff --git a/pype/tools/config_setting/style/__init__.py b/pype/tools/config_setting/config_setting/style/__init__.py similarity index 100% rename from pype/tools/config_setting/style/__init__.py rename to pype/tools/config_setting/config_setting/style/__init__.py diff --git a/pype/tools/config_setting/style/pype_icon.png b/pype/tools/config_setting/config_setting/style/pype_icon.png similarity index 100% rename from pype/tools/config_setting/style/pype_icon.png rename to pype/tools/config_setting/config_setting/style/pype_icon.png diff --git a/pype/tools/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css similarity index 100% rename from pype/tools/config_setting/style/style.css rename to pype/tools/config_setting/config_setting/style/style.css diff --git a/pype/tools/config_setting/config_setting/widgets/__init__.py b/pype/tools/config_setting/config_setting/widgets/__init__.py new file mode 100644 index 0000000000..0197917596 --- /dev/null +++ b/pype/tools/config_setting/config_setting/widgets/__init__.py @@ -0,0 +1,19 @@ +from .lib import ( + NOT_SET, + AS_WIDGET, + METADATA_KEY, + OVERRIDE_VERSION, + convert_gui_data_to_overrides, + convert_overrides_to_gui_data, + TypeToKlass +) + + +from .base import ( + PypeConfigurationWidget, + StudioWidget, + ProjectWidget +) +from .main import MainWidget + +from .inputs import * diff --git a/pype/tools/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py similarity index 95% rename from pype/tools/config_setting/widgets/base.py rename to pype/tools/config_setting/config_setting/widgets/base.py index 0fc9c5cabf..dcbaf743a9 100644 --- a/pype/tools/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -1,16 +1,12 @@ import os import json from Qt import QtWidgets, QtCore, QtGui -from . import config +from pype.api import config from .widgets import UnsavedChangesDialog -from .lib import NOT_SET, METADATA_KEY, convert_gui_data_to_overrides +from . import lib from avalon import io -class TypeToKlass: - types = {} - - class PypeConfigurationWidget: default_state = "" @@ -23,7 +19,7 @@ class PypeConfigurationWidget: def value_from_values(self, values, keys=None): if not values: - return NOT_SET + return lib.NOT_SET if keys is None: keys = self.keys @@ -36,7 +32,7 @@ class PypeConfigurationWidget: ) if key not in value: - return NOT_SET + return lib.NOT_SET value = value[key] return value @@ -109,7 +105,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.input_fields.clear() values = {"studio": config.studio_presets()} - schema = config.gui_schema("studio_schema", "studio_gui_schema") + schema = lib.gui_schema("studio_schema", "studio_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) self.schema = schema @@ -129,7 +125,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): # Load studio data with metadata current_presets = config.studio_presets() - keys_to_file = config.file_keys_from_schema(self.schema) + keys_to_file = lib.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: # Skip first key key_sequence = key_sequence[1:] @@ -158,7 +154,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] - klass = TypeToKlass.types.get(item_type) + klass = lib.TypeToKlass.types.get(item_type) item = klass( child_configuration, values, self.keys, self ) @@ -354,14 +350,14 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): def reset(self): values = config.global_project_presets() - schema = config.gui_schema("projects_schema", "project_gui_schema") + schema = lib.gui_schema("projects_schema", "project_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) self.schema = schema def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] - klass = TypeToKlass.types.get(item_type) + klass = lib.TypeToKlass.types.get(item_type) item = klass( child_configuration, values, self.keys, self @@ -394,7 +390,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): _data = {} for item in self.input_fields: value, is_group = item.overrides() - if value is not NOT_SET: + if value is not lib.NOT_SET: _data.update(value) if is_group: raise Exception( @@ -402,7 +398,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): ) data = _data.get("project") or {} - output_data = convert_gui_data_to_overrides(data) + output_data = lib.convert_gui_data_to_overrides(data) overrides_json_path = config.path_to_project_overrides( self.project_name @@ -437,7 +433,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): # Load studio data with metadata current_presets = config.global_project_presets() - keys_to_file = config.file_keys_from_schema(self.schema) + keys_to_file = lib.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: # Skip first key key_sequence = key_sequence[1:] diff --git a/pype/tools/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py similarity index 99% rename from pype/tools/config_setting/widgets/inputs.py rename to pype/tools/config_setting/config_setting/widgets/inputs.py index 1840572cfb..63415a16d3 100644 --- a/pype/tools/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1,14 +1,14 @@ import json from Qt import QtWidgets, QtCore, QtGui -from . import config -from .base import PypeConfigurationWidget, TypeToKlass +from pype.api import config +from .base import PypeConfigurationWidget from .widgets import ( ClickableWidget, ExpandingWidget, ModifiedIntSpinBox, ModifiedFloatSpinBox ) -from .lib import NOT_SET, AS_WIDGET, METADATA_KEY +from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass class SchemeGroupHierarchyBug(Exception): diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py new file mode 100644 index 0000000000..454c0b07ed --- /dev/null +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -0,0 +1,182 @@ +import os +import json +import copy +from pype.api import config + +OVERRIDEN_KEY = config.OVERRIDEN_KEY + + +# Singleton database of available inputs +class TypeToKlass: + types = {} + + +NOT_SET = type("NOT_SET", (), {}) +AS_WIDGET = type("AS_WIDGET", (), {}) +METADATA_KEY = type("METADATA_KEY", (), {}) +OVERRIDE_VERSION = 1 + + +def convert_gui_data_to_overrides(data, first=True): + if not data or not isinstance(data, dict): + return data + + output = {} + if first: + output["__override_version__"] = OVERRIDE_VERSION + + if METADATA_KEY in data: + metadata = data.pop(METADATA_KEY) + for key, value in metadata.items(): + if key == "groups": + output[OVERRIDEN_KEY] = value + else: + KeyError("Unknown metadata key \"{}\"".format(key)) + + for key, value in data.items(): + output[key] = convert_gui_data_to_overrides(value, False) + return output + + +def convert_overrides_to_gui_data(data, first=True): + if not data or not isinstance(data, dict): + return data + + output = {} + if OVERRIDEN_KEY in data: + groups = data.pop(OVERRIDEN_KEY) + if METADATA_KEY not in output: + output[METADATA_KEY] = {} + output[METADATA_KEY]["groups"] = groups + + for key, value in data.items(): + output[key] = convert_overrides_to_gui_data(value, False) + + return output + + + +def replace_inner_schemas(schema_data, schema_collection): + if schema_data["type"] == "schema": + raise ValueError("First item in schema data can't be schema.") + + children = schema_data.get("children") + if not children: + return schema_data + + new_children = [] + for child in children: + if child["type"] != "schema": + new_child = replace_inner_schemas(child, schema_collection) + new_children.append(new_child) + continue + + for schema_name in child["children"]: + new_child = replace_inner_schemas( + schema_collection[schema_name], + schema_collection + ) + new_children.append(new_child) + + schema_data["children"] = new_children + return schema_data + + +class SchemaMissingFileInfo(Exception): + def __init__(self, invalid): + full_path_keys = [] + for item in invalid: + full_path_keys.append("\"{}\"".format("/".join(item))) + + msg = ( + "Schema has missing definition of output file (\"is_file\" key)" + " for keys. [{}]" + ).format(", ".join(full_path_keys)) + super(SchemaMissingFileInfo, self).__init__(msg) + + +def file_keys_from_schema(schema_data): + output = [] + keys = [] + key = schema_data.get("key") + if key: + keys.append(key) + + for child in schema_data["children"]: + if child.get("is_file"): + _keys = copy.deepcopy(keys) + _keys.append(child["key"]) + output.append(_keys) + continue + + for result in file_keys_from_schema(child): + _keys = copy.deepcopy(keys) + _keys.extend(result) + output.append(_keys) + return output + + +def validate_all_has_ending_file(schema_data, is_top=True): + if schema_data.get("is_file"): + return None + + children = schema_data.get("children") + if not children: + return [[schema_data["key"]]] + + invalid = [] + keyless = "key" not in schema_data + for child in children: + result = validate_all_has_ending_file(child, False) + if result is None: + continue + + if keyless: + invalid.extend(result) + else: + for item in result: + new_invalid = [schema_data["key"]] + new_invalid.extend(item) + invalid.append(new_invalid) + + if not invalid: + return None + + if not is_top: + return invalid + + raise SchemaMissingFileInfo(invalid) + + +def validate_schema(schema_data): + # TODO validator for key uniquenes + # TODO validator that is_group key is not before is_file child + # TODO validator that is_group or is_file is not on child without key + validate_all_has_ending_file(schema_data) + + +def gui_schema(subfolder, main_schema_name): + subfolder, main_schema_name + dirpath = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + "config_gui_schema", + subfolder + ) + + loaded_schemas = {} + for filename in os.listdir(dirpath): + basename, ext = os.path.splitext(filename) + if ext != ".json": + continue + + filepath = os.path.join(dirpath, filename) + with open(filepath, "r") as json_stream: + schema_data = json.load(json_stream) + loaded_schemas[basename] = schema_data + + main_schema = replace_inner_schemas( + loaded_schemas[main_schema_name], + loaded_schemas + ) + validate_schema(main_schema) + return main_schema diff --git a/pype/tools/config_setting/widgets/main.py b/pype/tools/config_setting/config_setting/widgets/main.py similarity index 100% rename from pype/tools/config_setting/widgets/main.py rename to pype/tools/config_setting/config_setting/widgets/main.py diff --git a/pype/tools/config_setting/widgets/tests.py b/pype/tools/config_setting/config_setting/widgets/tests.py similarity index 100% rename from pype/tools/config_setting/widgets/tests.py rename to pype/tools/config_setting/config_setting/widgets/tests.py diff --git a/pype/tools/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py similarity index 100% rename from pype/tools/config_setting/widgets/widgets.py rename to pype/tools/config_setting/config_setting/widgets/widgets.py diff --git a/pype/tools/config_setting/interface.py b/pype/tools/config_setting/interface.py deleted file mode 100644 index a8c05f5af3..0000000000 --- a/pype/tools/config_setting/interface.py +++ /dev/null @@ -1,56 +0,0 @@ -import os -import sys - - -def folder_up(path, times=1): - if times <= 0: - return path - return folder_up(os.path.dirname(path), times - 1) - - -PYPE_SETUP_PATH = folder_up(os.path.realpath(__file__), 6) -os.environ["PYPE_CONFIG"] = os.path.join( - PYPE_SETUP_PATH, "repos", "pype-config" -) -os.environ["AVALON_MONGO"] = "mongodb://localhost:2707" -sys_paths = ( - "C:/Users/Public/pype_env2/Lib/site-packages", - PYPE_SETUP_PATH, - os.path.join(PYPE_SETUP_PATH, "repos", "pype"), - os.path.join(PYPE_SETUP_PATH, "repos", "avalon-core"), - os.path.join(PYPE_SETUP_PATH, "repos", "pyblish-base") -) -for path in sys_paths: - sys.path.append(path) - -from widgets import main -import style -from Qt import QtWidgets, QtGui - - -class MyApp(QtWidgets.QApplication): - def __init__(self, *args, **kwargs): - super(MyApp, self).__init__(*args, **kwargs) - stylesheet = style.load_stylesheet() - self.setStyleSheet(stylesheet) - self.setWindowIcon(QtGui.QIcon(style.app_icon_path())) - - -if __name__ == "__main__": - app = MyApp(sys.argv) - - # main_widget = QtWidgets.QWidget() - # main_widget.setWindowIcon(QtGui.QIcon(style.app_icon_path())) - # - # layout = QtWidgets.QVBoxLayout(main_widget) - # - # widget = main.MainWidget(main_widget) - - # layout.addWidget(widget) - # main_widget.setLayout(layout) - # main_widget.show() - - widget = main.MainWidget() - widget.show() - - sys.exit(app.exec_()) diff --git a/pype/tools/config_setting/widgets/__init__.py b/pype/tools/config_setting/widgets/__init__.py deleted file mode 100644 index 9fbce6e1cf..0000000000 --- a/pype/tools/config_setting/widgets/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from .lib import NOT_SET, AS_WIDGET, METADATA_KEY - - -from .base import * -from .main import * -from .inputs import * diff --git a/pype/tools/config_setting/widgets/config.py b/pype/tools/config_setting/widgets/config.py deleted file mode 100644 index 34eec69fc7..0000000000 --- a/pype/tools/config_setting/widgets/config.py +++ /dev/null @@ -1,325 +0,0 @@ -import os -import json -import logging -import copy - -# DEBUG SETUP -os.environ["PYPE_CONFIG"] = os.path.dirname(os.path.dirname(__file__)) -os.environ["PYPE_PROJECT_CONFIGS"] = os.path.join( - os.environ["PYPE_CONFIG"], "config", "project_overrides" -) - -log = logging.getLogger(__name__) - -STUDIO_PRESETS_PATH = os.path.normpath( - os.path.join(os.environ["PYPE_CONFIG"], "config", "studio_presets") -) -PROJECT_CONFIGURATION_DIR = "project_presets" -PROJECT_PRESETS_PATH = os.path.normpath(os.path.join( - os.environ["PYPE_CONFIG"], "config", PROJECT_CONFIGURATION_DIR -)) -first_run = False - -# TODO key popping not implemented yet -POP_KEY = "__pop_key__" -OVERRIDEN_KEY = "__overriden_keys__" - - -def load_json(fpath): - # Load json data - with open(fpath, "r") as opened_file: - lines = opened_file.read().splitlines() - - # prepare json string - standard_json = "" - for line in lines: - # Remove all whitespace on both sides - line = line.strip() - - # Skip blank lines - if len(line) == 0: - continue - - standard_json += line - - # Check if has extra commas - extra_comma = False - if ",]" in standard_json or ",}" in standard_json: - extra_comma = True - standard_json = standard_json.replace(",]", "]") - standard_json = standard_json.replace(",}", "}") - - global first_run - if extra_comma and first_run: - log.error("Extra comma in json file: \"{}\"".format(fpath)) - - # return empty dict if file is empty - if standard_json == "": - if first_run: - log.error("Empty json file: \"{}\"".format(fpath)) - return {} - - # Try to parse string - try: - return json.loads(standard_json) - - except json.decoder.JSONDecodeError: - # Return empty dict if it is first time that decode error happened - if not first_run: - return {} - - # Repreduce the exact same exception but traceback contains better - # information about position of error in the loaded json - try: - with open(fpath, "r") as opened_file: - json.load(opened_file) - - except json.decoder.JSONDecodeError: - log.warning( - "File has invalid json format \"{}\"".format(fpath), - exc_info=True - ) - - return {} - - -def subkey_merge(_dict, value, keys): - key = keys.pop(0) - if not keys: - _dict[key] = value - return _dict - - if key not in _dict: - _dict[key] = {} - _dict[key] = subkey_merge(_dict[key], value, keys) - - return _dict - - -def load_jsons_from_dir(path, *args, **kwargs): - output = {} - - path = os.path.normpath(path) - if not os.path.exists(path): - # TODO warning - return output - - sub_keys = list(kwargs.pop("subkeys", args)) - for sub_key in tuple(sub_keys): - _path = os.path.join(path, sub_key) - if not os.path.exists(_path): - break - - path = _path - sub_keys.pop(0) - - base_len = len(path) + 1 - for base, _directories, filenames in os.walk(path): - base_items_str = base[base_len:] - if not base_items_str: - base_items = [] - else: - base_items = base_items_str.split(os.path.sep) - - for filename in filenames: - basename, ext = os.path.splitext(filename) - if ext == ".json": - full_path = os.path.join(base, filename) - value = load_json(full_path) - dict_keys = base_items + [basename] - output = subkey_merge(output, value, dict_keys) - - for sub_key in sub_keys: - output = output[sub_key] - return output - - -def studio_presets(*args, **kwargs): - return load_jsons_from_dir(STUDIO_PRESETS_PATH, *args, **kwargs) - - -def global_project_presets(**kwargs): - return load_jsons_from_dir(PROJECT_PRESETS_PATH, **kwargs) - - -def path_to_project_overrides(project_name): - project_configs_path = os.environ["PYPE_PROJECT_CONFIGS"] - dirpath = os.path.join(project_configs_path, project_name) - return os.path.join(dirpath, PROJECT_CONFIGURATION_DIR + ".json") - - -def project_preset_overrides(project_name, **kwargs): - if not project_name: - return {} - - path_to_json = path_to_project_overrides(project_name) - if not os.path.exists(path_to_json): - return {} - return load_json(path_to_json) - - -def merge_overrides(global_dict, override_dict): - if OVERRIDEN_KEY in override_dict: - overriden_keys = set(override_dict.pop(OVERRIDEN_KEY)) - else: - overriden_keys = set() - - for key, value in override_dict.items(): - if value == POP_KEY: - global_dict.pop(key) - - elif ( - key in overriden_keys - or key not in global_dict - ): - global_dict[key] = value - - elif isinstance(value, dict) and isinstance(global_dict[key], dict): - global_dict[key] = merge_overrides(global_dict[key], value) - - else: - global_dict[key] = value - return global_dict - - -def apply_overrides(global_presets, project_overrides): - global_presets = copy.deepcopy(global_presets) - if not project_overrides: - return global_presets - return merge_overrides(global_presets, project_overrides) - - -def project_presets(project_name=None, **kwargs): - global_presets = global_project_presets(**kwargs) - - if not project_name: - project_name = os.environ.get("AVALON_PROJECT") - project_overrides = project_preset_overrides(project_name, **kwargs) - - return apply_overrides(global_presets, project_overrides) - - -def replace_inner_schemas(schema_data, schema_collection): - if schema_data["type"] == "schema": - raise ValueError("First item in schema data can't be schema.") - - children = schema_data.get("children") - if not children: - return schema_data - - new_children = [] - for child in children: - if child["type"] != "schema": - new_child = replace_inner_schemas(child, schema_collection) - new_children.append(new_child) - continue - - for schema_name in child["children"]: - new_child = replace_inner_schemas( - schema_collection[schema_name], - schema_collection - ) - new_children.append(new_child) - - schema_data["children"] = new_children - return schema_data - - -class SchemaMissingFileInfo(Exception): - def __init__(self, invalid): - full_path_keys = [] - for item in invalid: - full_path_keys.append("\"{}\"".format("/".join(item))) - - msg = ( - "Schema has missing definition of output file (\"is_file\" key)" - " for keys. [{}]" - ).format(", ".join(full_path_keys)) - super(SchemaMissingFileInfo, self).__init__(msg) - - -def file_keys_from_schema(schema_data): - output = [] - keys = [] - key = schema_data.get("key") - if key: - keys.append(key) - - for child in schema_data["children"]: - if child.get("is_file"): - _keys = copy.deepcopy(keys) - _keys.append(child["key"]) - output.append(_keys) - continue - - for result in file_keys_from_schema(child): - _keys = copy.deepcopy(keys) - _keys.extend(result) - output.append(_keys) - return output - - -def validate_all_has_ending_file(schema_data, is_top=True): - if schema_data.get("is_file"): - return None - - children = schema_data.get("children") - if not children: - return [[schema_data["key"]]] - - invalid = [] - keyless = "key" not in schema_data - for child in children: - result = validate_all_has_ending_file(child, False) - if result is None: - continue - - if keyless: - invalid.extend(result) - else: - for item in result: - new_invalid = [schema_data["key"]] - new_invalid.extend(item) - invalid.append(new_invalid) - - if not invalid: - return None - - if not is_top: - return invalid - - raise SchemaMissingFileInfo(invalid) - - -def validate_schema(schema_data): - # TODO validator for key uniquenes - # TODO validator that is_group key is not before is_file child - # TODO validator that is_group or is_file is not on child without key - validate_all_has_ending_file(schema_data) - - -def gui_schema(subfolder, main_schema_name): - subfolder, main_schema_name - dirpath = os.path.join( - os.path.dirname(os.path.dirname(__file__)), - "config_gui_schema", - subfolder - ) - - loaded_schemas = {} - for filename in os.listdir(dirpath): - basename, ext = os.path.splitext(filename) - if ext != ".json": - continue - - filepath = os.path.join(dirpath, filename) - with open(filepath, "r") as json_stream: - schema_data = json.load(json_stream) - loaded_schemas[basename] = schema_data - - main_schema = replace_inner_schemas( - loaded_schemas[main_schema_name], - loaded_schemas - ) - validate_schema(main_schema) - return main_schema diff --git a/pype/tools/config_setting/widgets/lib.py b/pype/tools/config_setting/widgets/lib.py deleted file mode 100644 index d733396d59..0000000000 --- a/pype/tools/config_setting/widgets/lib.py +++ /dev/null @@ -1,54 +0,0 @@ -from .config import OVERRIDEN_KEY - - -class CustomNone: - """Created object can be used as custom None (not equal to None).""" - def __bool__(self): - """Return False (like default None).""" - return False - - -NOT_SET = CustomNone() -AS_WIDGET = type("AS_WIDGET", (), {}) - -METADATA_KEY = type("METADATA_KEY", (), {}) - -OVERRIDE_VERSION = 1 - - -def convert_gui_data_to_overrides(data, first=True): - if not data or not isinstance(data, dict): - return data - - output = {} - if first: - output["__override_version__"] = OVERRIDE_VERSION - - if METADATA_KEY in data: - metadata = data.pop(METADATA_KEY) - for key, value in metadata.items(): - if key == "groups": - output[OVERRIDEN_KEY] = value - else: - KeyError("Unknown metadata key \"{}\"".format(key)) - - for key, value in data.items(): - output[key] = convert_gui_data_to_overrides(value, False) - return output - - -def convert_overrides_to_gui_data(data, first=True): - if not data or not isinstance(data, dict): - return data - - output = {} - if OVERRIDEN_KEY in data: - groups = data.pop(OVERRIDEN_KEY) - if METADATA_KEY not in output: - output[METADATA_KEY] = {} - output[METADATA_KEY]["groups"] = groups - - for key, value in data.items(): - output[key] = convert_overrides_to_gui_data(value, False) - - return output From 428382e070a66758104431527e1c24e0c3fd4ae3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 17:38:22 +0200 Subject: [PATCH 072/507] config temporarily moved to ~/pype/pype directory --- pype/api.py | 2 +- pype/config.py | 193 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 pype/config.py diff --git a/pype/api.py b/pype/api.py index 44a31f2626..e2705f81ea 100644 --- a/pype/api.py +++ b/pype/api.py @@ -1,8 +1,8 @@ +from . import config from pypeapp import ( Logger, Anatomy, project_overrides_dir_path, - config, execute ) diff --git a/pype/config.py b/pype/config.py new file mode 100644 index 0000000000..b3e860d72f --- /dev/null +++ b/pype/config.py @@ -0,0 +1,193 @@ +import os +import json +import logging +import copy + +log = logging.getLogger(__name__) + +STUDIO_PRESETS_PATH = os.path.normpath( + os.path.join(os.environ["PYPE_CONFIG"], "config", "studio_presets") +) +PROJECT_CONFIGURATION_DIR = "project_presets" +PROJECT_PRESETS_PATH = os.path.normpath(os.path.join( + os.environ["PYPE_CONFIG"], "config", PROJECT_CONFIGURATION_DIR +)) +first_run = False + +# TODO key popping not implemented yet +POP_KEY = "__pop_key__" +OVERRIDEN_KEY = "__overriden_keys__" + + +def load_json(fpath): + # Load json data + with open(fpath, "r") as opened_file: + lines = opened_file.read().splitlines() + + # prepare json string + standard_json = "" + for line in lines: + # Remove all whitespace on both sides + line = line.strip() + + # Skip blank lines + if len(line) == 0: + continue + + standard_json += line + + # Check if has extra commas + extra_comma = False + if ",]" in standard_json or ",}" in standard_json: + extra_comma = True + standard_json = standard_json.replace(",]", "]") + standard_json = standard_json.replace(",}", "}") + + global first_run + if extra_comma and first_run: + log.error("Extra comma in json file: \"{}\"".format(fpath)) + + # return empty dict if file is empty + if standard_json == "": + if first_run: + log.error("Empty json file: \"{}\"".format(fpath)) + return {} + + # Try to parse string + try: + return json.loads(standard_json) + + except json.decoder.JSONDecodeError: + # Return empty dict if it is first time that decode error happened + if not first_run: + return {} + + # Repreduce the exact same exception but traceback contains better + # information about position of error in the loaded json + try: + with open(fpath, "r") as opened_file: + json.load(opened_file) + + except json.decoder.JSONDecodeError: + log.warning( + "File has invalid json format \"{}\"".format(fpath), + exc_info=True + ) + + return {} + + +def subkey_merge(_dict, value, keys): + key = keys.pop(0) + if not keys: + _dict[key] = value + return _dict + + if key not in _dict: + _dict[key] = {} + _dict[key] = subkey_merge(_dict[key], value, keys) + + return _dict + + +def load_jsons_from_dir(path, *args, **kwargs): + output = {} + + path = os.path.normpath(path) + if not os.path.exists(path): + # TODO warning + return output + + sub_keys = list(kwargs.pop("subkeys", args)) + for sub_key in tuple(sub_keys): + _path = os.path.join(path, sub_key) + if not os.path.exists(_path): + break + + path = _path + sub_keys.pop(0) + + base_len = len(path) + 1 + for base, _directories, filenames in os.walk(path): + base_items_str = base[base_len:] + if not base_items_str: + base_items = [] + else: + base_items = base_items_str.split(os.path.sep) + + for filename in filenames: + basename, ext = os.path.splitext(filename) + if ext == ".json": + full_path = os.path.join(base, filename) + value = load_json(full_path) + dict_keys = base_items + [basename] + output = subkey_merge(output, value, dict_keys) + + for sub_key in sub_keys: + output = output[sub_key] + return output + + +def studio_presets(*args, **kwargs): + return load_jsons_from_dir(STUDIO_PRESETS_PATH, *args, **kwargs) + + +def global_project_presets(**kwargs): + return load_jsons_from_dir(PROJECT_PRESETS_PATH, **kwargs) + + +def path_to_project_overrides(project_name): + project_configs_path = os.environ["PYPE_PROJECT_CONFIGS"] + dirpath = os.path.join(project_configs_path, project_name) + return os.path.join(dirpath, PROJECT_CONFIGURATION_DIR + ".json") + + +def project_preset_overrides(project_name, **kwargs): + if not project_name: + return {} + + path_to_json = path_to_project_overrides(project_name) + if not os.path.exists(path_to_json): + return {} + return load_json(path_to_json) + + +def merge_overrides(global_dict, override_dict): + if OVERRIDEN_KEY in override_dict: + overriden_keys = set(override_dict.pop(OVERRIDEN_KEY)) + else: + overriden_keys = set() + + for key, value in override_dict.items(): + if value == POP_KEY: + global_dict.pop(key) + + elif ( + key in overriden_keys + or key not in global_dict + ): + global_dict[key] = value + + elif isinstance(value, dict) and isinstance(global_dict[key], dict): + global_dict[key] = merge_overrides(global_dict[key], value) + + else: + global_dict[key] = value + return global_dict + + +def apply_overrides(global_presets, project_overrides): + global_presets = copy.deepcopy(global_presets) + if not project_overrides: + return global_presets + return merge_overrides(global_presets, project_overrides) + + +def project_presets(project_name=None, **kwargs): + global_presets = global_project_presets(**kwargs) + + if not project_name: + project_name = os.environ.get("AVALON_PROJECT") + project_overrides = project_preset_overrides(project_name, **kwargs) + + return apply_overrides(global_presets, project_overrides) From 8f84f78d5d57d5e80014b888219c5761edd144de Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 17:47:26 +0200 Subject: [PATCH 073/507] modified imports --- pype/tools/config_setting/__main__.py | 1 - .../config_setting/config_setting/__init__.py | 2 -- .../config_setting/widgets/__init__.py | 25 ++++++------------- .../widgets/{main.py => window.py} | 0 4 files changed, 7 insertions(+), 21 deletions(-) rename pype/tools/config_setting/config_setting/widgets/{main.py => window.py} (100%) diff --git a/pype/tools/config_setting/__main__.py b/pype/tools/config_setting/__main__.py index 171b85a775..aa6f707443 100644 --- a/pype/tools/config_setting/__main__.py +++ b/pype/tools/config_setting/__main__.py @@ -1,4 +1,3 @@ -import os import sys import config_setting diff --git a/pype/tools/config_setting/config_setting/__init__.py b/pype/tools/config_setting/config_setting/__init__.py index 835754e6a1..0c2fd6d4bb 100644 --- a/pype/tools/config_setting/config_setting/__init__.py +++ b/pype/tools/config_setting/config_setting/__init__.py @@ -1,10 +1,8 @@ from . import style -# from . import widgets from .widgets import MainWidget __all__ = ( "style", - # "widgets", "MainWidget" ) diff --git a/pype/tools/config_setting/config_setting/widgets/__init__.py b/pype/tools/config_setting/config_setting/widgets/__init__.py index 0197917596..0682f00324 100644 --- a/pype/tools/config_setting/config_setting/widgets/__init__.py +++ b/pype/tools/config_setting/config_setting/widgets/__init__.py @@ -1,19 +1,8 @@ -from .lib import ( - NOT_SET, - AS_WIDGET, - METADATA_KEY, - OVERRIDE_VERSION, - convert_gui_data_to_overrides, - convert_overrides_to_gui_data, - TypeToKlass -) +from .window import MainWidget +# TODO properly register inputs to TypeToKlass class +from . import inputs - -from .base import ( - PypeConfigurationWidget, - StudioWidget, - ProjectWidget -) -from .main import MainWidget - -from .inputs import * +__all__ = [ + "MainWidget", + "inputs" +] diff --git a/pype/tools/config_setting/config_setting/widgets/main.py b/pype/tools/config_setting/config_setting/widgets/window.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/main.py rename to pype/tools/config_setting/config_setting/widgets/window.py From 1a5389dc5e16ea5968d8d6d9991e1bee5e0f2099 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 18:44:28 +0200 Subject: [PATCH 074/507] cleaned attribute definitions --- .../config_setting/widgets/base.py | 50 +--- .../config_setting/widgets/inputs.py | 264 +++++------------- .../config_setting/widgets/lib.py | 1 - 3 files changed, 80 insertions(+), 235 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index dcbaf743a9..af979c0f9f 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -7,50 +7,7 @@ from . import lib from avalon import io -class PypeConfigurationWidget: - default_state = "" - - def config_value(self): - raise NotImplementedError( - "Method `config_value` is not implemented for `{}`.".format( - self.__class__.__name__ - ) - ) - - def value_from_values(self, values, keys=None): - if not values: - return lib.NOT_SET - - if keys is None: - keys = self.keys - - value = values - for key in keys: - if not isinstance(value, dict): - raise TypeError( - "Expected dictionary got {}.".format(str(type(value))) - ) - - if key not in value: - return lib.NOT_SET - value = value[key] - return value - - def style_state(self, is_overriden, is_modified): - items = [] - if is_overriden: - items.append("overriden") - if is_modified: - items.append("modified") - return "-".join(items) or self.default_state - - def add_children_gui(self, child_configuration, values): - raise NotImplementedError(( - "Method `add_children_gui` is not implemented for `{}`." - ).format(self.__class__.__name__)) - - -class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class StudioWidget(QtWidgets.QWidget): is_overidable = False is_overriden = False is_group = False @@ -149,6 +106,7 @@ class StudioWidget(QtWidgets.QWidget, PypeConfigurationWidget): if not os.path.exists(dirpath): os.makedirs(dirpath) + print("Saving data to: ", output_path) with open(output_path, "w") as file_stream: json.dump(origin_values, file_stream, indent=4) @@ -286,7 +244,7 @@ class ProjectListWidget(QtWidgets.QWidget): ) -class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class ProjectWidget(QtWidgets.QWidget): is_overriden = False is_group = False any_parent_is_group = False @@ -407,6 +365,7 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): if not os.path.exists(dirpath): os.makedirs(dirpath) + print("Saving data to: ", overrides_json_path) with open(overrides_json_path, "w") as file_stream: json.dump(output_data, file_stream, indent=4) @@ -457,5 +416,6 @@ class ProjectWidget(QtWidgets.QWidget, PypeConfigurationWidget): if not os.path.exists(dirpath): os.makedirs(dirpath) + print("Saving data to: ", output_path) with open(output_path, "w") as file_stream: json.dump(origin_values, file_stream, indent=4) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 63415a16d3..4e49406e26 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1,7 +1,6 @@ import json from Qt import QtWidgets, QtCore, QtGui from pype.api import config -from .base import PypeConfigurationWidget from .widgets import ( ClickableWidget, ExpandingWidget, @@ -19,14 +18,73 @@ class SchemeGroupHierarchyBug(Exception): super(SchemeGroupHierarchyBug, self).__init__(msg) -class InputWidget: +class ConfigWidget: + default_state = "" + + @property + def is_overidable(self): + return self._parent.is_overidable + + @property + def ignore_value_changes(self): + return self._parent.ignore_value_changes + + def config_value(self): + raise NotImplementedError( + "Method `config_value` is not implemented for `{}`.".format( + self.__class__.__name__ + ) + ) + + def value_from_values(self, values, keys=None): + if not values: + return NOT_SET + + if keys is None: + keys = self.keys + + value = values + for key in keys: + if not isinstance(value, dict): + raise TypeError( + "Expected dictionary got {}.".format(str(type(value))) + ) + + if key not in value: + return NOT_SET + value = value[key] + return value + + def style_state(self, is_overriden, is_modified): + items = [] + if is_overriden: + items.append("overriden") + if is_modified: + items.append("modified") + return "-".join(items) or self.default_state + + def add_children_gui(self, child_configuration, values): + raise NotImplementedError(( + "Method `add_children_gui` is not implemented for `{}`." + ).format(self.__class__.__name__)) + + +class InputWidget(ConfigWidget): def overrides(self): if not self.is_overriden: return NOT_SET, False return self.config_value(), self.is_group + @property + def child_modified(self): + return self.is_modified -class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): + @property + def child_overriden(self): + return self._is_overriden + + +class BooleanWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -120,30 +178,14 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): self.set_value(value) self.update_style() - @property - def child_modified(self): - return self.is_modified - - @property - def child_overriden(self): - return self._is_overriden - @property def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -185,7 +227,7 @@ class BooleanWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): return {self.key: self.item_value()} -class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): +class IntegerWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -243,30 +285,14 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): self.int_input.valueChanged.connect(self._on_value_change) - @property - def child_modified(self): - return self.is_modified - - @property - def child_overriden(self): - return self._is_overriden - @property def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def set_value(self, value, *, default_value=False): self.int_input.setValue(value) if default_value: @@ -329,7 +355,7 @@ class IntegerWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): return {self.key: self.item_value()} -class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): +class FloatWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -397,30 +423,14 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): self.float_input.valueChanged.connect(self._on_value_change) - @property - def child_modified(self): - return self.is_modified - - @property - def child_overriden(self): - return self._is_overriden - @property def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def set_value(self, value, *, default_value=False): self.float_input.setValue(value) if default_value: @@ -481,7 +491,7 @@ class FloatWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): return {self.key: self.item_value()} -class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): +class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -539,30 +549,14 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidg self.text_input.textChanged.connect(self._on_value_change) - @property - def child_modified(self): - return self.is_modified - - @property - def child_overriden(self): - return self._is_overriden - @property def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def set_value(self, value, *, default_value=False): self.text_input.setText(value) if default_value: @@ -625,7 +619,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidg return {self.key: self.item_value()} -class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): +class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -681,30 +675,14 @@ class TextMultiLineWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidge self.text_input.textChanged.connect(self._on_value_change) - @property - def child_modified(self): - return self.is_modified - - @property - def child_overriden(self): - return self._is_overriden - @property def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) if default_value: @@ -822,7 +800,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.update_style(is_valid) -class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): +class RawJsonWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -879,30 +857,14 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): self.text_input.textChanged.connect(self._on_value_change) - @property - def child_modified(self): - return self.is_modified - - @property - def child_overriden(self): - return self._is_overriden - @property def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) if default_value: @@ -963,7 +925,7 @@ class RawJsonWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): return {self.key: self.item_value()} -class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): +class TextListItem(QtWidgets.QWidget, ConfigWidget): _btn_size = 20 value_changed = QtCore.Signal(object) @@ -1013,7 +975,7 @@ class TextListItem(QtWidgets.QWidget, PypeConfigurationWidget): return self.text_input.text() -class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): value_changed = QtCore.Signal(object) def __init__(self, input_data, values, parent_keys, parent): @@ -1123,7 +1085,7 @@ class TextListSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: self.item_value()} -class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): +class TextListWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) def __init__( @@ -1180,30 +1142,14 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): self.default_value = self.item_value() self.override_value = None - @property - def child_modified(self): - return self.is_modified - - @property - def child_overriden(self): - return self._is_overriden - @property def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1256,7 +1202,7 @@ class TextListWidget(QtWidgets.QWidget, PypeConfigurationWidget, InputWidget): return {self.key: self.item_value()} -class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): +class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): _btn_size = 20 value_changed = QtCore.Signal(object) @@ -1323,18 +1269,10 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): def any_parent_is_group(self): return self._parent.any_parent_is_group - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def is_key_modified(self): return self._key() != self.default_key @@ -1375,7 +1313,7 @@ class ModifiableDictItem(QtWidgets.QWidget, PypeConfigurationWidget): return {key: value} -class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): value_changed = QtCore.Signal(object) def __init__(self, input_data, values, parent_keys, parent): @@ -1408,10 +1346,6 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): self.default_value = self.config_value() self.override_value = None - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._parent.is_overriden @@ -1420,10 +1354,6 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): def is_group(self): return self._parent.is_group - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - @property def any_parent_is_group(self): return self._parent.any_parent_is_group @@ -1492,7 +1422,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, PypeConfigurationWidget): return output -class ModifiableDict(ExpandingWidget, PypeConfigurationWidget, InputWidget): +class ModifiableDict(ExpandingWidget, InputWidget): # Should be used only for dictionary with one datatype as value # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) @@ -1554,34 +1484,14 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget, InputWidget): self.update_style() - @property - def child_modified(self): - return self.is_modified - @property def is_modified(self): return self._is_modified - @property - def child_overriden(self): - return self._is_overriden - - @property - def is_overidable(self): - return self._parent.is_overidable - @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def is_modified(self): - return self._is_modified - - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def apply_overrides(self, override_value): self._state = None self._is_modified = False @@ -1623,7 +1533,7 @@ class ModifiableDict(ExpandingWidget, PypeConfigurationWidget, InputWidget): return {self.key: self.item_value()} -class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): +class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): value_changed = QtCore.Signal(object) def __init__( @@ -1734,10 +1644,6 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False @@ -1830,10 +1736,6 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): def config_value(self): return {self.key: self.item_value()} - @property - def is_overidable(self): - return self._parent.is_overidable - def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) @@ -1864,7 +1766,7 @@ class DictExpandWidget(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: values}, self.is_group -class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): +class DictInvisible(QtWidgets.QWidget, ConfigWidget): # TODO is not overridable by itself value_changed = QtCore.Signal(object) @@ -1915,10 +1817,6 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): def is_overriden(self): return self._is_overriden or self._parent.is_overriden - @property - def is_overidable(self): - return self._parent.is_overidable - @property def child_modified(self): for input_field in self.input_fields: @@ -1933,10 +1831,6 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): return True return False - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def item_value(self): output = {} for input_field in self.input_fields: @@ -2019,7 +1913,7 @@ class DictInvisible(QtWidgets.QWidget, PypeConfigurationWidget): return {self.key: values}, self.is_group -class DictFormWidget(QtWidgets.QWidget): +class DictFormWidget(QtWidgets.QWidget, ConfigWidget): value_changed = QtCore.Signal(object) def __init__( @@ -2070,14 +1964,6 @@ class DictFormWidget(QtWidgets.QWidget): return True return False - @property - def is_overidable(self): - return self._parent.is_overidable - - @property - def ignore_value_changes(self): - return self._parent.ignore_value_changes - def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] key = child_configuration["key"] diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index 454c0b07ed..c6379b4816 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -55,7 +55,6 @@ def convert_overrides_to_gui_data(data, first=True): return output - def replace_inner_schemas(schema_data, schema_collection): if schema_data["type"] == "schema": raise ValueError("First item in schema data can't be schema.") From 8f4cb392f8ba967491bcfb9febd19ea1510219db Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 18:56:12 +0200 Subject: [PATCH 075/507] _is_overriden is global attribute --- .../config_setting/widgets/inputs.py | 70 ++----------------- 1 file changed, 7 insertions(+), 63 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4e49406e26..8f6908eb3a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -20,6 +20,11 @@ class SchemeGroupHierarchyBug(Exception): class ConfigWidget: default_state = "" + _is_overriden = False + + @property + def is_overriden(self): + return self._is_overriden or self._parent.is_overriden @property def is_overidable(self): @@ -107,7 +112,6 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False self._was_overriden = False - self._is_overriden = False self._state = None @@ -182,10 +186,6 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -250,7 +250,6 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False self._was_overriden = False - self._is_overriden = False self._state = None @@ -289,10 +288,6 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def set_value(self, value, *, default_value=False): self.int_input.setValue(value) if default_value: @@ -378,7 +373,6 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False self._was_overriden = False - self._is_overriden = False self._state = None @@ -427,10 +421,6 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def set_value(self, value, *, default_value=False): self.float_input.setValue(value) if default_value: @@ -514,7 +504,6 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False self._was_overriden = False - self._is_overriden = False self._state = None @@ -553,10 +542,6 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def set_value(self, value, *, default_value=False): self.text_input.setText(value) if default_value: @@ -642,7 +627,6 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False self._was_overriden = False - self._is_overriden = False self._state = None @@ -679,10 +663,6 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) if default_value: @@ -823,7 +803,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False self._was_overriden = False - self._is_overriden = False self._state = None @@ -861,10 +840,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) if default_value: @@ -1107,7 +1082,6 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self.is_group = is_group self._was_overriden = False - self._is_overriden = False self._state = None @@ -1146,10 +1120,6 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): def is_modified(self): return self._is_modified or (self._was_overriden != self.is_overriden) - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1269,10 +1239,6 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): def any_parent_is_group(self): return self._parent.any_parent_is_group - @property - def is_overriden(self): - return self._parent.is_overriden - def is_key_modified(self): return self._key() != self.default_key @@ -1346,10 +1312,6 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): self.default_value = self.config_value() self.override_value = None - @property - def is_overriden(self): - return self._parent.is_overriden - @property def is_group(self): return self._parent.is_group @@ -1448,7 +1410,6 @@ class ModifiableDict(ExpandingWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._is_overriden = False self._was_overriden = False self._state = None @@ -1488,10 +1449,6 @@ class ModifiableDict(ExpandingWidget, InputWidget): def is_modified(self): return self._is_modified - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def apply_overrides(self, override_value): self._state = None self._is_modified = False @@ -1533,6 +1490,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): return {self.key: self.item_value()} +# Dictionaries class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): value_changed = QtCore.Signal(object) @@ -1556,7 +1514,6 @@ class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): self.any_parent_is_group = any_parent_is_group self._is_modified = False - self._is_overriden = False self.is_group = is_group self._state = None @@ -1640,10 +1597,6 @@ class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): super(DictExpandWidget, self).resizeEvent(event) self.content_widget.updateGeometry() - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False @@ -1785,7 +1738,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): self.any_parent_is_group = any_parent_is_group - self._is_overriden = False self.is_modified = False self.is_group = is_group @@ -1813,10 +1765,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): def update_style(self, *args, **kwargs): return - @property - def is_overriden(self): - return self._is_overriden or self._parent.is_overriden - @property def child_modified(self): for input_field in self.input_fields: @@ -1913,6 +1861,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): return {self.key: values}, self.is_group +# Proxy for form layout class DictFormWidget(QtWidgets.QWidget, ConfigWidget): value_changed = QtCore.Signal(object) @@ -1928,7 +1877,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigWidget): self.any_parent_is_group = any_parent_is_group self.is_modified = False - self._is_overriden = False self.is_group = False super(DictFormWidget, self).__init__(parent) @@ -1946,10 +1894,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigWidget): return self.value_changed.emit(self) - @property - def is_overriden(self): - return self._parent.is_overriden - @property def child_modified(self): for input_field in self.input_fields.values(): From 949c844cc1b85648a99e3f82336a55f161f50230 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 19:01:32 +0200 Subject: [PATCH 076/507] was overriden as global attribute --- .../config_setting/widgets/inputs.py | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 8f6908eb3a..bbc5387c02 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -21,11 +21,16 @@ class SchemeGroupHierarchyBug(Exception): class ConfigWidget: default_state = "" _is_overriden = False + _was_overriden = False @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden + @property + def was_overriden(self): + return self._was_overriden + @property def is_overidable(self): return self._parent.is_overidable @@ -111,7 +116,6 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._was_overriden = False self._state = None @@ -184,7 +188,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self.was_overriden != self.is_overriden) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -249,7 +253,6 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._was_overriden = False self._state = None @@ -286,7 +289,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self.was_overriden != self.is_overriden) def set_value(self, value, *, default_value=False): self.int_input.setValue(value) @@ -372,7 +375,6 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._was_overriden = False self._state = None @@ -419,7 +421,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self.was_overriden != self.is_overriden) def set_value(self, value, *, default_value=False): self.float_input.setValue(value) @@ -503,7 +505,6 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._was_overriden = False self._state = None @@ -540,7 +541,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self.was_overriden != self.is_overriden) def set_value(self, value, *, default_value=False): self.text_input.setText(value) @@ -626,7 +627,6 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._was_overriden = False self._state = None @@ -661,7 +661,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self.was_overriden != self.is_overriden) def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) @@ -802,7 +802,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._was_overriden = False self._state = None @@ -838,7 +837,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self.was_overriden != self.is_overriden) def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) @@ -1081,7 +1080,6 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self.is_group = is_group - self._was_overriden = False self._state = None @@ -1118,7 +1116,7 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): @property def is_modified(self): - return self._is_modified or (self._was_overriden != self.is_overriden) + return self._is_modified or (self.was_overriden != self.is_overriden) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -1410,7 +1408,6 @@ class ModifiableDict(ExpandingWidget, InputWidget): self.is_group = is_group self._is_modified = False - self._was_overriden = False self._state = None super(ModifiableDict, self).__init__(input_data["label"], parent) From aaab8b4bf014fee3f6a728121b1c3d78788ebfe7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 19:08:40 +0200 Subject: [PATCH 077/507] working path to config --- pype/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/config.py b/pype/config.py index b3e860d72f..488492d722 100644 --- a/pype/config.py +++ b/pype/config.py @@ -6,11 +6,11 @@ import copy log = logging.getLogger(__name__) STUDIO_PRESETS_PATH = os.path.normpath( - os.path.join(os.environ["PYPE_CONFIG"], "config", "studio_presets") + os.path.join(os.environ["PYPE_CONFIG"], "studio_presets") ) PROJECT_CONFIGURATION_DIR = "project_presets" PROJECT_PRESETS_PATH = os.path.normpath(os.path.join( - os.environ["PYPE_CONFIG"], "config", PROJECT_CONFIGURATION_DIR + os.environ["PYPE_CONFIG"], PROJECT_CONFIGURATION_DIR )) first_run = False From 91158eaed98af947a2a487595d5f9c0cfe19c9ac Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 19:10:00 +0200 Subject: [PATCH 078/507] is modified is global attribute --- .../config_setting/widgets/inputs.py | 49 ++----------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index bbc5387c02..72dd0932e7 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -21,8 +21,13 @@ class SchemeGroupHierarchyBug(Exception): class ConfigWidget: default_state = "" _is_overriden = False + _is_modified = False _was_overriden = False + @property + def is_modified(self): + return self._is_modified or (self.was_overriden != self.is_overriden) + @property def is_overriden(self): return self._is_overriden or self._parent.is_overriden @@ -115,7 +120,6 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): is_group = True self.is_group = is_group - self._is_modified = False self._state = None @@ -186,10 +190,6 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): self.set_value(value) self.update_style() - @property - def is_modified(self): - return self._is_modified or (self.was_overriden != self.is_overriden) - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -252,7 +252,6 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): is_group = True self.is_group = is_group - self._is_modified = False self._state = None @@ -287,10 +286,6 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): self.int_input.valueChanged.connect(self._on_value_change) - @property - def is_modified(self): - return self._is_modified or (self.was_overriden != self.is_overriden) - def set_value(self, value, *, default_value=False): self.int_input.setValue(value) if default_value: @@ -374,7 +369,6 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): is_group = True self.is_group = is_group - self._is_modified = False self._state = None @@ -419,10 +413,6 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): self.float_input.valueChanged.connect(self._on_value_change) - @property - def is_modified(self): - return self._is_modified or (self.was_overriden != self.is_overriden) - def set_value(self, value, *, default_value=False): self.float_input.setValue(value) if default_value: @@ -504,7 +494,6 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): is_group = True self.is_group = is_group - self._is_modified = False self._state = None @@ -539,10 +528,6 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): self.text_input.textChanged.connect(self._on_value_change) - @property - def is_modified(self): - return self._is_modified or (self.was_overriden != self.is_overriden) - def set_value(self, value, *, default_value=False): self.text_input.setText(value) if default_value: @@ -626,7 +611,6 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): is_group = True self.is_group = is_group - self._is_modified = False self._state = None @@ -659,10 +643,6 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): self.text_input.textChanged.connect(self._on_value_change) - @property - def is_modified(self): - return self._is_modified or (self.was_overriden != self.is_overriden) - def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) if default_value: @@ -801,7 +781,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): is_group = True self.is_group = is_group - self._is_modified = False self._state = None @@ -835,10 +814,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self.text_input.textChanged.connect(self._on_value_change) - @property - def is_modified(self): - return self._is_modified or (self.was_overriden != self.is_overriden) - def set_value(self, value, *, default_value=False): self.text_input.setPlainText(value) if default_value: @@ -1078,7 +1053,6 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): if not any_parent_is_group and not is_group: is_group = True - self._is_modified = False self.is_group = is_group self._state = None @@ -1114,10 +1088,6 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self.default_value = self.item_value() self.override_value = None - @property - def is_modified(self): - return self._is_modified or (self.was_overriden != self.is_overriden) - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1407,7 +1377,6 @@ class ModifiableDict(ExpandingWidget, InputWidget): self.any_parent_is_group = any_parent_is_group self.is_group = is_group - self._is_modified = False self._state = None super(ModifiableDict, self).__init__(input_data["label"], parent) @@ -1442,10 +1411,6 @@ class ModifiableDict(ExpandingWidget, InputWidget): self.update_style() - @property - def is_modified(self): - return self._is_modified - def apply_overrides(self, override_value): self._state = None self._is_modified = False @@ -1510,7 +1475,6 @@ class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): self.any_parent_is_group = any_parent_is_group - self._is_modified = False self.is_group = is_group self._state = None @@ -1734,8 +1698,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): raise SchemeGroupHierarchyBug() self.any_parent_is_group = any_parent_is_group - - self.is_modified = False self.is_group = is_group super(DictInvisible, self).__init__(parent) @@ -1873,7 +1835,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigWidget): self.any_parent_is_group = any_parent_is_group - self.is_modified = False self.is_group = False super(DictFormWidget, self).__init__(parent) From 0acbc5459eb65acc5b216913578e6df5692b1a23 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 19:17:41 +0200 Subject: [PATCH 079/507] config_value is global method --- .../config_setting/widgets/inputs.py | 57 +++++++------------ 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 72dd0932e7..ee8c800b29 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -44,13 +44,26 @@ class ConfigWidget: def ignore_value_changes(self): return self._parent.ignore_value_changes - def config_value(self): + def reset_attributes(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + + self.reset_children_attributes() + + def reset_children_attributes(self): raise NotImplementedError( - "Method `config_value` is not implemented for `{}`.".format( - self.__class__.__name__ - ) + "Method `reset_children_attributes` not implemented!" ) + def item_value(self): + raise NotImplementedError( + "Method `item_value` not implemented!" + ) + + def config_value(self): + return {self.key: self.item_value()} + def value_from_values(self, values, keys=None): if not values: return NOT_SET @@ -98,6 +111,9 @@ class InputWidget(ConfigWidget): def child_overriden(self): return self._is_overriden + def reset_children_attributes(self): + return + class BooleanWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) @@ -227,9 +243,6 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): def item_value(self): return self.checkbox.isChecked() - def config_value(self): - return {self.key: self.item_value()} - class IntegerWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) @@ -344,9 +357,6 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): def item_value(self): return self.int_input.value() - def config_value(self): - return {self.key: self.item_value()} - class FloatWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) @@ -469,9 +479,6 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): def item_value(self): return self.float_input.value() - def config_value(self): - return {self.key: self.item_value()} - class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) @@ -586,9 +593,6 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): def item_value(self): return self.text_input.text() - def config_value(self): - return {self.key: self.item_value()} - class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) @@ -699,9 +703,6 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): def item_value(self): return self.text_input.toPlainText() - def config_value(self): - return {self.key: self.item_value()} - class RawJsonInput(QtWidgets.QPlainTextEdit): tab_length = 4 @@ -870,9 +871,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): def item_value(self): return self.text_input.toPlainText() - def config_value(self): - return {self.key: self.item_value()} - class TextListItem(QtWidgets.QWidget, ConfigWidget): _btn_size = 20 @@ -1030,9 +1028,6 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): return output - def config_value(self): - return {self.key: self.item_value()} - class TextListWidget(QtWidgets.QWidget, InputWidget): value_changed = QtCore.Signal(object) @@ -1136,9 +1131,6 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): def item_value(self): return self.value_widget.config_value() - def config_value(self): - return {self.key: self.item_value()} - class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): _btn_size = 20 @@ -1448,9 +1440,6 @@ class ModifiableDict(ExpandingWidget, InputWidget): def item_value(self): return self.value_widget.config_value() - def config_value(self): - return {self.key: self.item_value()} - # Dictionaries class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): @@ -1647,9 +1636,6 @@ class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): output.update(input_field.config_value()) return output - def config_value(self): - return {self.key: self.item_value()} - def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) @@ -1746,9 +1732,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): output.update(input_field.config_value()) return output - def config_value(self): - return {self.key: self.item_value()} - def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] if item_type == "schema": From b402c8d0135057809ce2ce9a61999934d1ea4293 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 19:35:44 +0200 Subject: [PATCH 080/507] removed overrides --- .../kuba_each_case/project_presets.json | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json diff --git a/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json b/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json deleted file mode 100644 index b9da242453..0000000000 --- a/pype/tools/config_setting/config/project_overrides/kuba_each_case/project_presets.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "__override_version__": 1, - "plugins": { - "maya": { - "__overriden_keys__": [ - "publish" - ], - "publish": { - "ValidateModelName": { - "enabled": true - }, - "ValidateAssemblyName": { - "enabled": false - } - } - } - } -} \ No newline at end of file From 71c2bb3ec1a5da3b68b5709db3bc6c287c3b0d11 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 21 Aug 2020 22:32:44 +0200 Subject: [PATCH 081/507] moved type up --- .../applications_gui_schema.json | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json index 12fbb3cc26..bbf74a8f3f 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json @@ -9,144 +9,144 @@ "type": "dict-form", "children": [ { - "key": "blender_2.80", "type": "boolean", + "key": "blender_2.80", "label": "Blender 2.80" }, { - "key": "blender_2.81", "type": "boolean", + "key": "blender_2.81", "label": "Blender 2.81" }, { - "key": "blender_2.82", "type": "boolean", + "key": "blender_2.82", "label": "Blender 2.82" }, { - "key": "blender_2.83", "type": "boolean", + "key": "blender_2.83", "label": "Blender 2.83" }, { - "key": "celaction_local", "type": "boolean", + "key": "celaction_local", "label": "Celaction Local" }, { - "key": "celaction_remote", "type": "boolean", + "key": "celaction_remote", "label": "Celaction Remote" }, { - "key": "harmony_17", "type": "boolean", + "key": "harmony_17", "label": "Harmony 17" }, { - "key": "houdini_16", "type": "boolean", + "key": "houdini_16", "label": "Houdini 16" }, { - "key": "houdini_17", "type": "boolean", + "key": "houdini_17", "label": "Houdini 17" }, { - "key": "houdini_18", "type": "boolean", + "key": "houdini_18", "label": "Houdini 18" }, { - "key": "maya_2017", "type": "boolean", + "key": "maya_2017", "label": "Autodest Maya 2017" }, { - "key": "maya_2018", "type": "boolean", + "key": "maya_2018", "label": "Autodest Maya 2018" }, { - "key": "maya_2019", "type": "boolean", + "key": "maya_2019", "label": "Autodest Maya 2019" }, { - "key": "maya_2020", "type": "boolean", + "key": "maya_2020", "label": "Autodest Maya 2020" }, { "key": "nuke_10.0", "type": "boolean", "label": "Nuke 10.0" }, { - "key": "nuke_11.2", "type": "boolean", + "key": "nuke_11.2", "label": "Nuke 11.2" }, { - "key": "nuke_11.3", "type": "boolean", + "key": "nuke_11.3", "label": "Nuke 11.3" }, { - "key": "nuke_12.0", "type": "boolean", + "key": "nuke_12.0", "label": "Nuke 12.0" }, { - "key": "nukex_10.0", "type": "boolean", + "key": "nukex_10.0", "label": "NukeX 10.0" }, { - "key": "nukex_11.2", "type": "boolean", + "key": "nukex_11.2", "label": "NukeX 11.2" }, { - "key": "nukex_11.3", "type": "boolean", + "key": "nukex_11.3", "label": "NukeX 11.3" }, { - "key": "nukex_12.0", "type": "boolean", + "key": "nukex_12.0", "label": "NukeX 12.0" }, { - "key": "nukestudio_10.0", "type": "boolean", + "key": "nukestudio_10.0", "label": "NukeStudio 10.0" }, { - "key": "nukestudio_11.2", "type": "boolean", + "key": "nukestudio_11.2", "label": "NukeStudio 11.2" }, { - "key": "nukestudio_11.3", "type": "boolean", + "key": "nukestudio_11.3", "label": "NukeStudio 11.3" }, { - "key": "nukestudio_12.0", "type": "boolean", + "key": "nukestudio_12.0", "label": "NukeStudio 12.0" }, { - "key": "houdini_16.5", "type": "boolean", + "key": "houdini_16.5", "label": "Houdini 16.5" }, { - "key": "houdini_17", "type": "boolean", + "key": "houdini_17", "label": "Houdini 17" }, { - "key": "houdini_18", "type": "boolean", + "key": "houdini_18", "label": "Houdini 18" }, { - "key": "premiere_2019", "type": "boolean", + "key": "premiere_2019", "label": "Premiere 2019" }, { - "key": "premiere_2020", "type": "boolean", + "key": "premiere_2020", "label": "Premiere 2020" }, { - "key": "premiere_2020", "type": "boolean", + "key": "premiere_2020", "label": "Premiere 2020" }, { + "type": "boolean", "key": "resolve_16", - "type": "boolean", "label": "BM DaVinci Resolve 16" }, { - "key": "storyboardpro_7", "type": "boolean", + "key": "storyboardpro_7", "label": "Storyboard Pro 7" }, { - "key": "unreal_4.24", "type": "boolean", + "key": "unreal_4.24", "label": "Unreal Editor 4.24" } ] From a5e6979a86009d56a52a7ccf41651e4a51277dac Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 10:52:52 +0200 Subject: [PATCH 082/507] renamed gui schemas files and added intent --- ...i_schema.json => 0_studio_gui_schema.json} | 5 +++-- ...ma.json => 1_applications_gui_schema.json} | 0 .../studio_schema/1_intents_gui_schema.json | 19 +++++++++++++++++++ ...ui_schema.json => 1_tools_gui_schema.json} | 0 .../config_setting/widgets/base.py | 2 +- 5 files changed, 23 insertions(+), 3 deletions(-) rename pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/{studio_gui_schema.json => 0_studio_gui_schema.json} (83%) rename pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/{applications_gui_schema.json => 1_applications_gui_schema.json} (100%) create mode 100644 pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json rename pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/{tools_gui_schema.json => 1_tools_gui_schema.json} (100%) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json similarity index 83% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json index 088c407804..868fbea82e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/studio_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json @@ -10,8 +10,9 @@ "children": [{ "type": "schema", "children": [ - "applications_gui_schema", - "tools_gui_schema" + "1_applications_gui_schema", + "1_tools_gui_schema", + "1_intents_gui_schema" ] }] }, { diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/applications_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json new file mode 100644 index 0000000000..1469ffc5fc --- /dev/null +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json @@ -0,0 +1,19 @@ +{ + "key": "intent", + "type": "dict-expanding", + "label": "Intent Setting", + "is_group": true, + "is_file": true, + "children": [ + { + "type": "dict-modifiable", + "key": "items", + "label": "Intent Key/Label", + "object_type": "text-singleline" + }, { + "type": "text-singleline", + "key": "default", + "label": "Default intent" + } + ] +} diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/tools_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index af979c0f9f..a794ea64f3 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -62,7 +62,7 @@ class StudioWidget(QtWidgets.QWidget): self.input_fields.clear() values = {"studio": config.studio_presets()} - schema = lib.gui_schema("studio_schema", "studio_gui_schema") + schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) self.schema = schema From df0eae7719495b8cf8bc7740b20e68067cf39e81 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 11:39:38 +0200 Subject: [PATCH 083/507] added tray items --- .../studio_schema/0_studio_gui_schema.json | 15 +-- .../studio_schema/1_muster.json | 12 ++ .../studio_schema/1_tray_items.json | 106 ++++++++++++++++++ 3 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json create mode 100644 pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json index 868fbea82e..9063dfcc8e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json @@ -10,22 +10,13 @@ "children": [{ "type": "schema", "children": [ + "1_tray_items", "1_applications_gui_schema", "1_tools_gui_schema", - "1_intents_gui_schema" + "1_intents_gui_schema", + "1_muster" ] }] - }, { - "key": "muster", - "type": "dict-invisible", - "is_group": true, - "children": [{ - "key": "templates_mapping", - "label": "Muster", - "is_file": true, - "type": "dict-modifiable", - "object_type": "int" - }] } ] } diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json new file mode 100644 index 0000000000..224f2efc71 --- /dev/null +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json @@ -0,0 +1,12 @@ +{ + "key": "muster", + "type": "dict-invisible", + "is_group": true, + "children": [{ + "key": "templates_mapping", + "label": "Muster", + "is_file": true, + "type": "dict-modifiable", + "object_type": "int" + }] +} diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json new file mode 100644 index 0000000000..0456e52985 --- /dev/null +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -0,0 +1,106 @@ +{ + "key": "tray_modules", + "type": "dict-expanding", + "label": "Modules", + "is_file": true, + "is_group": true, + "children": [ + { + "key": "item_usage", + "type": "dict-invisible", + "children": [ + { + "type": "dict-form", + "children": [ + { + "type": "boolean", + "key": "User settings", + "label": "User settings" + }, { + "type": "boolean", + "key": "Ftrack", + "label": "Ftrack" + }, { + "type": "boolean", + "key": "Muster", + "label": "Muster" + }, { + "type": "boolean", + "key": "Avalon", + "label": "Avalon" + }, { + "type": "boolean", + "key": "Clockify", + "label": "Clockify" + }, { + "type": "boolean", + "key": "Standalone Publish", + "label": "Standalone Publish" + }, { + "type": "boolean", + "key": "Logging", + "label": "Logging" + }, { + "type": "boolean", + "key": "Idle Manager", + "label": "Idle Manager" + }, { + "type": "boolean", + "key": "Rest Api", + "label": "Rest Api" + }, { + "type": "boolean", + "key": "Adobe Communicator", + "label": "Adobe Communicator" + } + ] + } + ] + }, { + "key": "attributes", + "type": "dict-expanding", + "label": "Module attributes", + "children": [ + { + "type": "dict-expanding", + "key": "Rest Api", + "label": "Rest Api", + "MISINGKEYCONF": {"exclude_ports": []}, + "children": [ + { + "type": "int", + "key": "default_port", + "label": "Default Port" + } + ] + }, { + "type": "dict-expanding", + "key": "Timers Manager", + "label": "Timers Manager", + "children": [ + { + "type": "float", + "key": "full_time", + "label": "Max idle time" + }, { + "type": "float", + "key": "message_time", + "label": "When dialog will show" + } + ] + }, { + "type": "dict-expanding", + "key": "Clockify", + "label": "Clockify", + "children": [ + { + "type": "text-singleline", + "key": "workspace_name", + "label": "Workspace name" + } + ] + } + ] + } + ] +} From f32aa4fd84abfa09e53bc4ceb5c07f3bf3d4f391 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 11:48:40 +0200 Subject: [PATCH 084/507] do not show the attributes label --- .../config_gui_schema/studio_schema/1_tray_items.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json index 0456e52985..e6f9a41e51 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -58,8 +58,7 @@ ] }, { "key": "attributes", - "type": "dict-expanding", - "label": "Module attributes", + "type": "dict-invisible", "children": [ { "type": "dict-expanding", From 4a375737e346540d0c93422177b9a54c758079ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 12:18:17 +0200 Subject: [PATCH 085/507] moved muster back to studio --- .../studio_schema/0_studio_gui_schema.json | 14 ++++++++++++-- .../config_gui_schema/studio_schema/1_muster.json | 12 ------------ 2 files changed, 12 insertions(+), 14 deletions(-) delete mode 100644 pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json index 9063dfcc8e..2fd63c7cdc 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json @@ -13,10 +13,20 @@ "1_tray_items", "1_applications_gui_schema", "1_tools_gui_schema", - "1_intents_gui_schema", - "1_muster" + "1_intents_gui_schema" ] }] + }, { + "key": "muster", + "type": "dict-invisible", + "children": [{ + "is_group": true, + "is_file": true, + "key": "templates_mapping", + "label": "Muster - Templates mapping", + "type": "dict-modifiable", + "object_type": "int" + }] } ] } diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json deleted file mode 100644 index 224f2efc71..0000000000 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_muster.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "key": "muster", - "type": "dict-invisible", - "is_group": true, - "children": [{ - "key": "templates_mapping", - "label": "Muster", - "is_file": true, - "type": "dict-modifiable", - "object_type": "int" - }] -} From fce265af47a8bb297e0d4b86b1bef88eccc4d1f5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 12:52:46 +0200 Subject: [PATCH 086/507] renamed presets to configurations --- pype/config.py | 12 ++++----- .../config_setting/widgets/base.py | 26 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pype/config.py b/pype/config.py index 488492d722..454835e005 100644 --- a/pype/config.py +++ b/pype/config.py @@ -6,7 +6,7 @@ import copy log = logging.getLogger(__name__) STUDIO_PRESETS_PATH = os.path.normpath( - os.path.join(os.environ["PYPE_CONFIG"], "studio_presets") + os.path.join(os.environ["PYPE_CONFIG"], "studio_configurations") ) PROJECT_CONFIGURATION_DIR = "project_presets" PROJECT_PRESETS_PATH = os.path.normpath(os.path.join( @@ -128,11 +128,11 @@ def load_jsons_from_dir(path, *args, **kwargs): return output -def studio_presets(*args, **kwargs): +def studio_configurations(*args, **kwargs): return load_jsons_from_dir(STUDIO_PRESETS_PATH, *args, **kwargs) -def global_project_presets(**kwargs): +def global_project_configurations(**kwargs): return load_jsons_from_dir(PROJECT_PRESETS_PATH, **kwargs) @@ -142,7 +142,7 @@ def path_to_project_overrides(project_name): return os.path.join(dirpath, PROJECT_CONFIGURATION_DIR + ".json") -def project_preset_overrides(project_name, **kwargs): +def project_configurations_overrides(project_name, **kwargs): if not project_name: return {} @@ -184,10 +184,10 @@ def apply_overrides(global_presets, project_overrides): def project_presets(project_name=None, **kwargs): - global_presets = global_project_presets(**kwargs) + global_presets = global_project_configurations(**kwargs) if not project_name: project_name = os.environ.get("AVALON_PROJECT") - project_overrides = project_preset_overrides(project_name, **kwargs) + project_overrides = project_configurations_overrides(project_name, **kwargs) return apply_overrides(global_presets, project_overrides) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index a794ea64f3..23eabdb531 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -61,7 +61,7 @@ class StudioWidget(QtWidgets.QWidget): widget.deleteLater() self.input_fields.clear() - values = {"studio": config.studio_presets()} + values = {"studio": config.studio_configurations()} schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) @@ -80,14 +80,14 @@ class StudioWidget(QtWidgets.QWidget): all_values = all_values["studio"] # Load studio data with metadata - current_presets = config.studio_presets() + current_configurations = config.studio_configurations() keys_to_file = lib.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: # Skip first key key_sequence = key_sequence[1:] subpath = "/".join(key_sequence) + ".json" - origin_values = current_presets + origin_values = current_configurations for key in key_sequence: if key not in origin_values: origin_values = {} @@ -280,13 +280,13 @@ class ProjectWidget(QtWidgets.QWidget): footer_layout.addWidget(spacer_widget, 1) footer_layout.addWidget(save_btn, 0) - presets_widget = QtWidgets.QWidget() - presets_layout = QtWidgets.QVBoxLayout(presets_widget) - presets_layout.setContentsMargins(0, 0, 0, 0) - presets_layout.setSpacing(0) + configurations_widget = QtWidgets.QWidget() + configurations_layout = QtWidgets.QVBoxLayout(configurations_widget) + configurations_layout.setContentsMargins(0, 0, 0, 0) + configurations_layout.setSpacing(0) - presets_layout.addWidget(scroll_widget, 1) - presets_layout.addWidget(footer_widget, 0) + configurations_layout.addWidget(scroll_widget, 1) + configurations_layout.addWidget(footer_widget, 0) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -294,7 +294,7 @@ class ProjectWidget(QtWidgets.QWidget): self.setLayout(layout) layout.addWidget(project_list_widget, 0) - layout.addWidget(presets_widget, 1) + layout.addWidget(configurations_widget, 1) save_btn.clicked.connect(self._save) project_list_widget.project_changed.connect(self._on_project_change) @@ -307,7 +307,7 @@ class ProjectWidget(QtWidgets.QWidget): self.reset() def reset(self): - values = config.global_project_presets() + values = config.global_project_configurations() schema = lib.gui_schema("projects_schema", "project_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) @@ -390,14 +390,14 @@ class ProjectWidget(QtWidgets.QWidget): all_values = all_values["project"] # Load studio data with metadata - current_presets = config.global_project_presets() + current_configurations = config.global_project_configurations() keys_to_file = lib.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: # Skip first key key_sequence = key_sequence[1:] subpath = "/".join(key_sequence) + ".json" - origin_values = current_presets + origin_values = current_configurations for key in key_sequence: if key not in origin_values: origin_values = {} From eb3406751119d6581bc9380b08110849f05217c6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 13:01:04 +0200 Subject: [PATCH 087/507] changed input from vertical to horizontal layout --- .../config_setting/widgets/inputs.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ee8c800b29..3a862b7a3e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -141,9 +141,9 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): super(BooleanWidget, self).__init__(parent) - layout = QtWidgets.QVBoxLayout(self) + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) + layout.setSpacing(5) self.checkbox = QtWidgets.QCheckBox() self.checkbox.setAttribute(QtCore.Qt.WA_StyledBackground) @@ -270,9 +270,9 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): super(IntegerWidget, self).__init__(parent) - layout = QtWidgets.QVBoxLayout(self) + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) + layout.setSpacing(5) self.int_input = ModifiedIntSpinBox() @@ -384,9 +384,9 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): super(FloatWidget, self).__init__(parent) - layout = QtWidgets.QVBoxLayout(self) + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) + layout.setSpacing(5) self.float_input = ModifiedFloatSpinBox() @@ -506,9 +506,9 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): super(TextSingleLineWidget, self).__init__(parent) - layout = QtWidgets.QVBoxLayout(self) + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) + layout.setSpacing(5) self.text_input = QtWidgets.QLineEdit() @@ -620,9 +620,9 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): super(TextMultiLineWidget, self).__init__(parent) - layout = QtWidgets.QVBoxLayout(self) + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) + layout.setSpacing(5) self.text_input = QtWidgets.QPlainTextEdit() if not label_widget: From f62d7b8cac476378fb109e64996eeb9d7a5d814c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 14:42:25 +0200 Subject: [PATCH 088/507] removed temp configurations --- .../studio_presets/ftrack/server_plugins.json | 1 - .../studio_presets/ftrack/user_plugins.json | 5 --- .../studio_presets/global/applications.json | 43 ------------------- .../config/studio_presets/global/intents.json | 9 ---- .../config/studio_presets/global/tools.json | 6 --- .../studio_presets/global/tray_items.json | 25 ----------- .../muster/templates_mapping.json | 19 -------- 7 files changed, 108 deletions(-) delete mode 100644 pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json delete mode 100644 pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json delete mode 100644 pype/tools/config_setting/config/studio_presets/global/applications.json delete mode 100644 pype/tools/config_setting/config/studio_presets/global/intents.json delete mode 100644 pype/tools/config_setting/config/studio_presets/global/tools.json delete mode 100644 pype/tools/config_setting/config/studio_presets/global/tray_items.json delete mode 100644 pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json diff --git a/pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json b/pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/tools/config_setting/config/studio_presets/ftrack/server_plugins.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json b/pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json deleted file mode 100644 index 1ba8e9b511..0000000000 --- a/pype/tools/config_setting/config/studio_presets/ftrack/user_plugins.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "TestAction": { - "ignore_me": true - } -} diff --git a/pype/tools/config_setting/config/studio_presets/global/applications.json b/pype/tools/config_setting/config/studio_presets/global/applications.json deleted file mode 100644 index 21693e5fee..0000000000 --- a/pype/tools/config_setting/config/studio_presets/global/applications.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "blender_2.80": true, - "blender_2.81": true, - "blender_2.82": true, - "blender_2.83": true, - "harmony_17": true, - "houdini_16": true, - "houdini_17": true, - "houdini_18": true, - "maya_2016": true, - "maya_2017": true, - "maya_2018": true, - "maya_2019": true, - "maya_2020": true, - "nuke_10.0": true, - "nuke_11.0": true, - "nuke_11.2": true, - "nuke_11.3": true, - "nuke_12.0": true, - "nukex_10.0": true, - "nukex_11.0": true, - "nukex_11.2": true, - "nukex_11.3": true, - "nukex_12.0": true, - "nukestudio_10.0": true, - "nukestudio_11.0": true, - "nukestudio_11.2": true, - "nukestudio_11.3": true, - "nukestudio_12.0": true, - "photoshop_2020": true, - "premiere_2019": true, - "premiere_2020": true, - "python_2": true, - "python_3": true, - "resolve_16": true, - "shell": true, - "storyboardpro_7": true, - "unreal_4.21": true, - "celaction_local": true, - "celaction_remote": true, - "houdini_16.5": false, - "unreal_4.24": true -} \ No newline at end of file diff --git a/pype/tools/config_setting/config/studio_presets/global/intents.json b/pype/tools/config_setting/config/studio_presets/global/intents.json deleted file mode 100644 index c853e27b7f..0000000000 --- a/pype/tools/config_setting/config/studio_presets/global/intents.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "default": "wip", - "items": { - "": "", - "wip": "WIP", - "test": "TEST", - "final": "FINAL" - } -} diff --git a/pype/tools/config_setting/config/studio_presets/global/tools.json b/pype/tools/config_setting/config/studio_presets/global/tools.json deleted file mode 100644 index 53aab7b2ca..0000000000 --- a/pype/tools/config_setting/config/studio_presets/global/tools.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "mtoa_3.0.1": false, - "mtoa_3.1.1": false, - "mtoa_3.2.0": false, - "yeti_2.1.2": false -} \ No newline at end of file diff --git a/pype/tools/config_setting/config/studio_presets/global/tray_items.json b/pype/tools/config_setting/config/studio_presets/global/tray_items.json deleted file mode 100644 index a42bf67c38..0000000000 --- a/pype/tools/config_setting/config/studio_presets/global/tray_items.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "usage": { - "User settings": false, - "Ftrack": false, - "Muster": false, - "Avalon": true, - "Clockify": false, - "Standalone Publish": true, - "Logging": true, - "Idle Manager": true, - "Timers Manager": true, - "Rest Api": true, - "Premiere Communicator": true - }, - "attributes": { - "Rest Api": { - "default_port": 8021, - "exclude_ports": [] - }, - "Timers Manager": { - "full_time": 15, - "message_time": 0.5 - } - } -} diff --git a/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json b/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json deleted file mode 100644 index 0c09113515..0000000000 --- a/pype/tools/config_setting/config/studio_presets/muster/templates_mapping.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "3delight": 41, - "arnold": 46, - "arnold_sf": 57, - "gelato": 30, - "harware": 3, - "krakatoa": 51, - "file_layers": 7, - "mentalray": 2, - "mentalray_sf": 6, - "redshift": 55, - "renderman": 29, - "software": 1, - "software_sf": 5, - "turtle": 10, - "vector": 4, - "vray": 37, - "ffmpeg": 48 -} \ No newline at end of file From b13c05919a50a4df8546a2b47ed7c1de0e39ede6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 14:58:07 +0200 Subject: [PATCH 089/507] changed names of project schemas --- ..._schema.json => 0_project_gui_schema.json} | 5 ++- ...json => 1_ftrack_projects_gui_schema.json} | 0 ..._schema.json => 1_plugins_gui_schema.json} | 10 +++--- .../projects_schema/test_project_schema.json | 34 ------------------- .../config_setting/widgets/base.py | 2 +- 5 files changed, 8 insertions(+), 43 deletions(-) rename pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/{project_gui_schema.json => 0_project_gui_schema.json} (58%) rename pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/{ftrack_projects_gui_schema.json => 1_ftrack_projects_gui_schema.json} (100%) rename pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/{plugins_gui_schema.json => 1_plugins_gui_schema.json} (100%) delete mode 100644 pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/test_project_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/project_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json similarity index 58% rename from pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/project_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json index 0405524b40..c281ce3c79 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/project_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json @@ -5,9 +5,8 @@ { "type": "schema", "children": [ - "test_project_schema", - "ftrack_projects_gui_schema", - "plugins_gui_schema" + "1_ftrack_projects_gui_schema", + "1_plugins_gui_schema" ] } ] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/ftrack_projects_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 1eaecbb8e5..1d1f299b55 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -1,23 +1,23 @@ { - "key": "plugins", "type": "dict-expanding", + "key": "plugins", "label": "Plugins", "children": [ { - "key": "maya", "type": "dict-expanding", + "key": "maya", "label": "Maya", "children": [ { - "key": "publish", "type": "dict-expanding", + "key": "publish", "label": "Publish plugins", "is_group": true, "is_file": true, "children": [ { - "key": "ValidateModelName", "type": "dict-invisible", + "key": "ValidateModelName", "label": "Validate Model Name", "children": [ { @@ -27,8 +27,8 @@ } ] }, { - "key": "ValidateAssemblyName", "type": "dict-invisible", + "key": "ValidateAssemblyName", "label": "Validate Assembly Name", "children": [ { diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/test_project_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/test_project_schema.json deleted file mode 100644 index 43c9a647f4..0000000000 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/test_project_schema.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "key": "test_inputs", - "type": "dict-expanding", - "label": "Test inputs", - "is_group": true, - "is_file": true, - "children": [ - { - "key": "boolean", - "type": "boolean", - "label": "Boolean" - }, { - "key": "test_singleline", - "type": "text-singleline", - "label": "Text singleline" - }, { - "key": "test_multiline", - "type": "text-multiline", - "label": "Text multiline" - }, { - "key": "raw_json", - "type": "raw-json", - "label": "Raw json" - }, { - "key": "int", - "type": "int", - "label": "Int" - }, { - "key": "float", - "type": "float", - "label": "Float" - } - ] -} diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 23eabdb531..7bbd95b135 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -308,7 +308,7 @@ class ProjectWidget(QtWidgets.QWidget): def reset(self): values = config.global_project_configurations() - schema = lib.gui_schema("projects_schema", "project_gui_schema") + schema = lib.gui_schema("projects_schema", "0_project_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) self.schema = schema From 332fe3f668b9eef7251539ae47d9b40b2d628b78 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 14:58:24 +0200 Subject: [PATCH 090/507] DictExpandWidget inherits ExpandingWidget --- .../config_setting/widgets/inputs.py | 60 ++----------------- 1 file changed, 4 insertions(+), 56 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3a862b7a3e..9bcc54655b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1442,7 +1442,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): # Dictionaries -class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): +class DictExpandWidget(ExpandingWidget, ConfigWidget): value_changed = QtCore.Signal(object) def __init__( @@ -1469,31 +1469,8 @@ class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): self._state = None self._child_state = None - super(DictExpandWidget, self).__init__(parent) + super(DictExpandWidget, self).__init__(input_data["label"], parent) self.setObjectName("DictExpandWidget") - top_part = ClickableWidget(parent=self) - - button_size = QtCore.QSize(5, 5) - button_toggle = QtWidgets.QToolButton(parent=top_part) - button_toggle.setProperty("btn-type", "expand-toggle") - button_toggle.setIconSize(button_size) - button_toggle.setArrowType(QtCore.Qt.RightArrow) - button_toggle.setCheckable(True) - button_toggle.setChecked(False) - - label = input_data["label"] - button_toggle_text = QtWidgets.QLabel(label, parent=top_part) - button_toggle_text.setObjectName("ExpandLabel") - - layout = QtWidgets.QHBoxLayout(top_part) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - layout.addWidget(button_toggle) - layout.addWidget(button_toggle_text) - top_part.setLayout(layout) - - main_layout = QtWidgets.QVBoxLayout(self) - main_layout.setContentsMargins(9, 9, 9, 9) content_widget = QtWidgets.QWidget(self) content_widget.setVisible(False) @@ -1501,22 +1478,13 @@ class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(3, 3, 3, 3) - main_layout.addWidget(top_part) - main_layout.addWidget(content_widget) - self.setLayout(main_layout) + self.set_content_widget(content_widget) self.setAttribute(QtCore.Qt.WA_StyledBackground) - self.top_part = top_part - self.button_toggle = button_toggle - self.button_toggle_text = button_toggle_text - self.content_widget = content_widget self.content_layout = content_layout - self.top_part.clicked.connect(self._top_part_clicked) - self.button_toggle.clicked.connect(self.toggle_content) - self.input_fields = [] self.key = input_data["key"] @@ -1527,26 +1495,6 @@ class DictExpandWidget(QtWidgets.QWidget, ConfigWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) - def _top_part_clicked(self): - self.toggle_content(not self.button_toggle.isChecked()) - - def toggle_content(self, *args): - if len(args) > 0: - checked = args[0] - else: - checked = self.button_toggle.isChecked() - arrow_type = QtCore.Qt.RightArrow - if checked: - arrow_type = QtCore.Qt.DownArrow - self.button_toggle.setChecked(checked) - self.button_toggle.setArrowType(arrow_type) - self.content_widget.setVisible(checked) - self.parent().updateGeometry() - - def resizeEvent(self, event): - super(DictExpandWidget, self).resizeEvent(event) - self.content_widget.updateGeometry() - def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False @@ -1901,8 +1849,8 @@ TypeToKlass.types["text-multiline"] = TextMultiLineWidget TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["int"] = IntegerWidget TypeToKlass.types["float"] = FloatWidget +TypeToKlass.types["dict-modifiable"] = ModifiableDict TypeToKlass.types["dict-expanding"] = DictExpandWidget TypeToKlass.types["dict-form"] = DictFormWidget TypeToKlass.types["dict-invisible"] = DictInvisible -TypeToKlass.types["dict-modifiable"] = ModifiableDict TypeToKlass.types["list-text"] = TextListWidget From 93c30ed32049ecd8eb4b117b634049d6656ed8fe Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 14:59:49 +0200 Subject: [PATCH 091/507] added expanding policy of default input labels --- .../config_setting/widgets/inputs.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 9bcc54655b..0497cb7763 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -151,9 +151,9 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): label = input_data["label"] label_widget = QtWidgets.QLabel(label) label_widget.setAttribute(QtCore.Qt.WA_StyledBackground) - layout.addWidget(label_widget) + layout.addWidget(label_widget, 0) - layout.addWidget(self.checkbox) + layout.addWidget(self.checkbox, 1) if not self._as_widget: self.label_widget = label_widget @@ -279,8 +279,8 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget) - layout.addWidget(self.int_input) + layout.addWidget(label_widget, 0) + layout.addWidget(self.int_input, 1) if not self._as_widget: self.label_widget = label_widget @@ -403,8 +403,8 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget) - layout.addWidget(self.float_input) + layout.addWidget(label_widget, 0) + layout.addWidget(self.float_input, 1) if not self._as_widget: self.label_widget = label_widget @@ -515,8 +515,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget) - layout.addWidget(self.text_input) + layout.addWidget(label_widget, 0) + layout.addWidget(self.text_input, 1) if not self._as_widget: self.label_widget = label_widget @@ -628,8 +628,8 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget) - layout.addWidget(self.text_input) + layout.addWidget(label_widget, 0) + layout.addWidget(self.text_input, 1) self.label_widget = label_widget From f0c7dedb4d021860a0991a07e16b3c3814e11c5e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 16:02:31 +0200 Subject: [PATCH 092/507] adde nonexpanding widget --- .../config_setting/widgets/inputs.py | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0497cb7763..0ceec27d67 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1553,6 +1553,132 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): self.button_toggle_text.setProperty("state", state) self.button_toggle_text.style().polish(self.button_toggle_text) +class DictWidget(QtWidgets.QWidget, ConfigWidget): + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + if values is AS_WIDGET: + raise TypeError("Can't use \"{}\" as widget item.".format( + self.__class__.__name__ + )) + self._parent = parent + + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + is_group = input_data.get("is_group", False) + if is_group and any_parent_is_group: + raise SchemeGroupHierarchyBug() + + self.any_parent_is_group = any_parent_is_group + + self.is_group = is_group + + self._state = None + self._child_state = None + + super(DictWidget, self).__init__(parent) + self.setObjectName("DictWidget") + + body_widget = QtWidgets.QWidget(self) + + label_widget = QtWidgets.QLabel( + input_data["label"], parent=body_widget + ) + label_widget.setObjectName("ExpandLabel") + + content_widget = QtWidgets.QWidget(body_widget) + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(3, 3, 3, 3) + + body_layout = QtWidgets.QVBoxLayout(body_widget) + body_layout.setContentsMargins(0, 0, 0, 0) + body_layout.setSpacing(5) + body_layout.addWidget(label_widget) + body_layout.addWidget(content_widget) + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + main_layout = QtWidgets.QHBoxLayout(self) + main_layout.setContentsMargins(5, 5, 5, 5) + main_layout.setSpacing(0) + main_layout.addWidget(body_widget) + + self.label_widget = label_widget + self.content_widget = content_widget + self.content_layout = content_layout + + self.input_fields = [] + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + + def apply_overrides(self, override_value): + # Make sure this is set to False + self._is_overriden = False + self._state = None + self._child_state = None + for item in self.input_fields: + if override_value is None: + child_value = None + else: + child_value = override_value.get(item.key) + + item.apply_overrides(child_value) + + self._is_overriden = ( + self.is_group + and self.is_overidable + and ( + override_value is not None + or self.child_overriden + ) + ) + self.update_style() + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + if self.is_group: + if self.is_overidable: + self._is_overriden = True + + # TODO update items + if item is not None: + for _item in self.input_fields: + if _item is not item: + _item.update_style() + + self.value_changed.emit(self) + + self.update_style() + + def update_style(self, is_overriden=None): + child_modified = self.child_modified + child_state = self.style_state(self.child_overriden, child_modified) + if child_state: + child_state = "child-{}".format(child_state) + + if child_state != self._child_state: + self.setProperty("state", child_state) + self.style().polish(self) + self._child_state = child_state + + state = self.style_state(self.is_overriden, self.is_modified) + if self._state == state: + return + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) self._state = state @@ -1850,6 +1976,7 @@ TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["int"] = IntegerWidget TypeToKlass.types["float"] = FloatWidget TypeToKlass.types["dict-modifiable"] = ModifiableDict +TypeToKlass.types["dict"] = DictWidget TypeToKlass.types["dict-expanding"] = DictExpandWidget TypeToKlass.types["dict-form"] = DictFormWidget TypeToKlass.types["dict-invisible"] = DictInvisible From 8c6ff3b7f825b54a2ed23cc6b52707921cf13d8f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 16:04:04 +0200 Subject: [PATCH 093/507] fixed dict expanding --- .../config_setting/widgets/inputs.py | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0ceec27d67..61c6385323 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1551,8 +1551,69 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): if self._state == state: return - self.button_toggle_text.setProperty("state", state) - self.button_toggle_text.style().polish(self.button_toggle_text) + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + self._state = state + + @property + def is_modified(self): + if self.is_group: + return self.child_modified + return False + + @property + def child_modified(self): + for input_field in self.input_fields: + if input_field.child_modified: + return True + return False + + @property + def child_overriden(self): + for input_field in self.input_fields: + if input_field.child_overriden: + return True + return False + + def item_value(self): + output = {} + for input_field in self.input_fields: + # TODO maybe merge instead of update should be used + # NOTE merge is custom function which merges 2 dicts + output.update(input_field.config_value()) + return output + + def add_children_gui(self, child_configuration, values): + item_type = child_configuration["type"] + klass = TypeToKlass.types.get(item_type) + + item = klass( + child_configuration, values, self.keys, self + ) + item.value_changed.connect(self._on_value_change) + self.content_layout.addWidget(item) + + self.input_fields.append(item) + return item + + def overrides(self): + if not self.is_overriden and not self.child_overriden: + return NOT_SET, False + + values = {} + groups = [] + for input_field in self.input_fields: + value, is_group = input_field.overrides() + if value is not NOT_SET: + values.update(value) + if is_group: + groups.extend(value.keys()) + if groups: + values[METADATA_KEY] = {"groups": groups} + return {self.key: values}, self.is_group + + class DictWidget(QtWidgets.QWidget, ConfigWidget): value_changed = QtCore.Signal(object) From 4776eaca79c5c3b62c793dfcadbce51d33d18172 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 16:17:34 +0200 Subject: [PATCH 094/507] Added few plugins --- .../projects_schema/1_plugins_gui_schema.json | 129 +++++++++++++++++- 1 file changed, 124 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 1d1f299b55..e2717bca37 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -4,6 +4,21 @@ "label": "Plugins", "children": [ { + "type": "dict-expanding", + "key": "celaction", + "label": "CelAction", + "children": [] + }, { + "type": "dict-expanding", + "key": "ftrack", + "label": "Ftrack", + "children": [] + }, { + "type": "dict-expanding", + "key": "global", + "label": "Global", + "children": [] + }, { "type": "dict-expanding", "key": "maya", "label": "Maya", @@ -12,28 +27,29 @@ "type": "dict-expanding", "key": "publish", "label": "Publish plugins", - "is_group": true, "is_file": true, "children": [ { - "type": "dict-invisible", + "type": "dict", "key": "ValidateModelName", "label": "Validate Model Name", + "is_group": true, "children": [ { - "key": "enabled", "type": "boolean", + "key": "enabled", "label": "Enabled" } ] }, { - "type": "dict-invisible", + "type": "dict", "key": "ValidateAssemblyName", "label": "Validate Assembly Name", + "is_group": true, "children": [ { - "key": "enabled", "type": "boolean", + "key": "enabled", "label": "Enabled" } ] @@ -41,6 +57,109 @@ ] } ] + }, { + "type": "dict-expanding", + "key": "nuke", + "label": "Nuke", + "children": [] + }, { + "type": "dict-expanding", + "key": "nukestudio", + "label": "NukeStudio", + "children": [ + { + "type": "dict-expanding", + "key": "publish", + "label": "Publish plugins", + "is_file": true, + "children": [ + { + "type": "dict", + "key": "CollectInstanceVersion", + "label": "Collect Instance Version", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": false + } + ] + }, { + "type": "dict", + "key": "ExtractReviewCutUpVideo", + "label": "Extract Review Cut Up Video", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": true + }, { + "type": "list-text", + "key": "tags_addition", + "label": "Tags addition", + "default": [] + } + ] + } + ] + } + ] + }, { + "type": "dict-expanding", + "key": "resolve", + "label": "DaVinci Resolve", + "children": [ + { + "type": "dict-expanding", + "key": "create", + "label": "Creator plugins", + "is_file": true, + "children": [ + { + "type": "dict", + "key": "CreateShotClip", + "label": "Create Shot Clip", + "is_group": true, + "children": [ + { + "type": "text-singleline", + "key": "clipName", + "label": "Clip name template", + "default": "{track}{sequence}{shot}" + }, { + "type": "text-singleline", + "key": "folder", + "label": "Folder", + "default": "takes" + }, { + "type": "text-singleline", + "key": "steps", + "label": "Steps", + "default": 20 + } + ] + } + + ] + } + ] + }, { + "type": "dict-expanding", + "key": "standalonepublisher", + "label": "StandalonePublisher", + "children": [ + { + "type": "dict-expanding", + "key": "publish", + "label": "Publish plugins", + "is_file": true, + "children": [] + } + ] } ] } From 044c644c3bcd871af62bd6932e27d8341d3363ff Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 16:21:11 +0200 Subject: [PATCH 095/507] project_presets changed to project_configurations --- pype/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/config.py b/pype/config.py index 454835e005..c65e336e00 100644 --- a/pype/config.py +++ b/pype/config.py @@ -8,7 +8,7 @@ log = logging.getLogger(__name__) STUDIO_PRESETS_PATH = os.path.normpath( os.path.join(os.environ["PYPE_CONFIG"], "studio_configurations") ) -PROJECT_CONFIGURATION_DIR = "project_presets" +PROJECT_CONFIGURATION_DIR = "project_configurations" PROJECT_PRESETS_PATH = os.path.normpath(os.path.join( os.environ["PYPE_CONFIG"], PROJECT_CONFIGURATION_DIR )) From f0217db5da872ffd07b0ea8919b86d15e230df49 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 16:52:04 +0200 Subject: [PATCH 096/507] fixed overrides --- pype/tools/config_setting/config_setting/widgets/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 7bbd95b135..a59b497b2b 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -329,7 +329,7 @@ class ProjectWidget(QtWidgets.QWidget): overrides = None self.is_overidable = False else: - overrides = config.project_preset_overrides(project_name) + overrides = config.project_configurations_overrides(project_name) self.is_overidable = True self.project_name = project_name From 7134b5b9fc2bbb61803c13ba2236d450b974ac78 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 16:52:14 +0200 Subject: [PATCH 097/507] added few plugins --- .../projects_schema/1_plugins_gui_schema.json | 187 +++++++++++++++++- 1 file changed, 183 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index e2717bca37..c12825c3ec 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -7,17 +7,41 @@ "type": "dict-expanding", "key": "celaction", "label": "CelAction", - "children": [] + "children": [ + { + "type": "dict-expanding", + "key": "publish", + "label": "Publish plugins", + "is_file": true, + "children": [] + } + ] }, { "type": "dict-expanding", "key": "ftrack", "label": "Ftrack", - "children": [] + "children": [ + { + "type": "dict-expanding", + "key": "publish", + "label": "Publish plugins", + "is_file": true, + "children": [] + } + ] }, { "type": "dict-expanding", "key": "global", "label": "Global", - "children": [] + "children": [ + { + "type": "dict-expanding", + "key": "publish", + "label": "Publish plugins", + "is_file": true, + "children": [] + } + ] }, { "type": "dict-expanding", "key": "maya", @@ -61,7 +85,162 @@ "type": "dict-expanding", "key": "nuke", "label": "Nuke", - "children": [] + "children": [ + { + "type": "dict-expanding", + "key": "create", + "label": "Create plugins", + "is_file": true, + "children": [ + { + "type": "dict", + "key": "CreateWriteRender", + "label": "CreateWriteRender", + "is_group": true, + "children": [ + { + "type": "text-singleline", + "key": "fpath_template", + "label": "Path template", + "default": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" + } + ] + }, { + "type": "dict", + "key": "CreateWritePrerender", + "label": "CreateWritePrerender", + "is_group": true, + "children": [ + { + "type": "text-singleline", + "key": "fpath_template", + "label": "Path template", + "default": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" + } + ] + } + ] + }, { + "type": "dict-expanding", + "key": "publish", + "label": "Publish plugins", + "is_file": true, + "children": [ + { + "type": "dict", + "key": "ExtractThumbnail", + "label": "ExtractThumbnail", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": false + }, { + "type": "raw-json", + "key": "nodes", + "label": "Nodes" + } + ] + }, { + "type": "dict", + "key": "ValidateNukeWriteKnobs", + "label": "ValidateNukeWriteKnobs", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": false + }, { + "type": "raw-json", + "key": "knobs", + "label": "Knobs" + } + ] + }, { + "type": "dict", + "key": "ExtractReviewDataLut", + "label": "ExtractReviewDataLut", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": false + } + ] + }, { + "type": "dict", + "key": "ExtractReviewDataMov", + "label": "ExtractReviewDataMov", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": true + }, { + "type": "boolean", + "key": "viewer_lut_raw", + "label": "Viewer LUT raw", + "default": false + } + ] + }, { + "type": "dict", + "key": "ExtractSlateFrame", + "label": "ExtractSlateFrame", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "viewer_lut_raw", + "label": "Viewer LUT raw", + "default": false + } + ] + }, { + "type": "dict", + "key": "NukeSubmitDeadline", + "label": "NukeSubmitDeadline", + "is_group": true, + "children": [ + { + "type": "int", + "key": "deadline_priority", + "label": "deadline_priority", + "default": 50 + }, { + "type": "text-singleline", + "key": "deadline_pool", + "label": "deadline_pool", + "default": "" + }, { + "type": "text-singleline", + "key": "deadline_pool_secondary", + "label": "deadline_pool_secondary", + "default": "" + }, { + "type": "int", + "key": "deadline_chunk_size", + "label": "deadline_chunk_size", + "default": 1 + } + ] + } + ] + }, { + "type": "raw-json", + "key": "workfile_build", + "label": "Workfile Build logic", + "is_file": true + } + ] }, { "type": "dict-expanding", "key": "nukestudio", From 1dea23f1cc407cbb1eb78c90c41e36f30f29e240 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 17:09:42 +0200 Subject: [PATCH 098/507] added workfile build to maya plugins --- .../projects_schema/1_plugins_gui_schema.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index c12825c3ec..4b6583dd63 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -79,6 +79,11 @@ ] } ] + }, { + "type": "raw-json", + "key": "workfile_build", + "label": "Workfile Build logic", + "is_file": true } ] }, { From dbd50e0ad24e76f9c15a429f43620f0439c37031 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 18:59:51 +0200 Subject: [PATCH 099/507] added global presets --- .../projects_schema/1_plugins_gui_schema.json | 218 +++++++++++++++++- 1 file changed, 215 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 4b6583dd63..458695da18 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -13,7 +13,52 @@ "key": "publish", "label": "Publish plugins", "is_file": true, - "children": [] + "children": [ + { + "type": "dict", + "key": "ExtractCelactionDeadline", + "label": "ExtractCelactionDeadline", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": true + }, { + "type": "text-singleline", + "key": "deadline_department", + "label": "Deadline apartment", + "default": "" + }, { + "type": "int", + "key": "deadline_priority", + "label": "Deadline priority", + "default": 50 + }, { + "type": "text-singleline", + "key": "deadline_pool", + "label": "Deadline pool", + "default": "" + }, { + "type": "text-singleline", + "key": "deadline_pool_secondary", + "label": "Deadline pool (secondary)", + "default": "" + }, { + "type": "text-singleline", + "key": "deadline_group", + "label": "Deadline Group", + "default": "" + }, { + "type": "int", + "key": "deadline_chunk_size", + "label": "Deadline Chunk size", + "default": 10 + } + ] + } + ] } ] }, { @@ -26,7 +71,31 @@ "key": "publish", "label": "Publish plugins", "is_file": true, - "children": [] + "children": [ + { + "type": "dict", + "key": "IntegrateFtrackNote", + "label": "IntegrateFtrackNote", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { + "type": "text-singleline", + "key": "note_with_intent_template", + "label": "Note with intent template", + "default": "{intent}: {comment}" + }, { + "type": "list-text", + "key": "note_labels", + "label": "Note labels", + "default": [] + } + ] + } + ] } ] }, { @@ -39,7 +108,150 @@ "key": "publish", "label": "Publish plugins", "is_file": true, - "children": [] + "children": [ + { + "type": "dict", + "key": "IntegrateMasterVersion", + "label": "IntegrateMasterVersion", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + } + ] + }, { + "type": "dict", + "key": "ExtractJpegEXR", + "label": "ExtractJpegEXR", + "is_group": true, + "children": [ + { + "type": "dict-invisible", + "key": "ffmpeg_args", + "children": [ + { + "type": "list-text", + "key": "input", + "label": "FFmpeg input arguments", + "default": [] + }, { + "type": "list-text", + "key": "output", + "label": "FFmpeg output arguments", + "default": [] + } + ] + } + ] + }, { + "type": "dict", + "key": "ExtractReview", + "label": "ExtractReview", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { + "type": "raw-json", + "key": "profiles", + "label": "Profiles" + } + ] + }, { + "type": "dict", + "key": "ExtractBurnin", + "label": "ExtractBurnin", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { + "type": "dict-expanding", + "key": "options", + "label": "Burnin formating options", + "children": [ + { + "type": "int", + "key": "font_size", + "label": "Font size", + "default": 42 + }, { + "type": "int", + "key": "opacity", + "label": "Font opacity", + "default": 1 + }, { + "type": "int", + "key": "bg_opacity", + "label": "Background opacity", + "default": 1 + }, { + "type": "int", + "key": "x_offset", + "label": "X Offset", + "default": 5 + }, { + "type": "int", + "key": "y_offset", + "label": "Y Offset", + "default": 5 + }, { + "type": "int", + "key": "bg_padding", + "label": "Padding aroung text", + "default": 5 + } + ] + }, { + "type": "raw-json", + "key": "profiles", + "label": "Burnin profiles" + } + ] + }, { + "type": "dict", + "key": "IntegrateAssetNew", + "label": "IntegrateAssetNew", + "is_group": true, + "children": [ + { + "type": "raw-json", + "key": "template_name_profiles", + "label": "template_name_profiles" + } + ] + }, { + "type": "dict", + "key": "ProcessSubmittedJobOnFarm", + "label": "ProcessSubmittedJobOnFarm", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { + "type": "text-singleline", + "key": "deadline_department", + "label": "Deadline department" + }, { + "type": "text-singleline", + "key": "deadline_pool", + "label": "Deadline Pool" + }, { + "type": "text-singleline", + "key": "deadline_group", + "label": "Deadline Group" + } + ] + } + ] } ] }, { From 4301c5dcdcfee138deee8544c065b132113a3a89 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 19:04:06 +0200 Subject: [PATCH 100/507] updated maya plugins --- .../projects_schema/1_plugins_gui_schema.json | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 458695da18..2b4dfafc56 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -275,6 +275,15 @@ "type": "boolean", "key": "enabled", "label": "Enabled" + }, { + "type": "text-singleline", + "key": "material_file", + "label": "Material File" + }, { + "type": "text-singleline", + "key": "regex", + "label": "Validation regex", + "default": "(.*)_(\\d)*_(?P.*)_(GEO)" } ] }, { @@ -289,6 +298,35 @@ "label": "Enabled" } ] + }, { + "type": "dict", + "key": "ValidateShaderName", + "label": "ValidateShaderName", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { + "type": "text-singleline", + "key": "regex", + "label": "Validation regex", + "default": "(?P.*)_(.*)_SHD" + } + ] + }, { + "type": "dict", + "key": "ValidateMeshHasOverlappingUVs", + "label": "ValidateMeshHasOverlappingUVs", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + } + ] } ] }, { From 5bdee32e7ef7d7fec0909aad23a9703f8e82679e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 19:12:46 +0200 Subject: [PATCH 101/507] few minor fixes --- .../config_setting/config_setting/widgets/base.py | 3 +-- .../config_setting/config_setting/widgets/inputs.py | 10 +--------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index a59b497b2b..74e0543870 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -307,7 +307,7 @@ class ProjectWidget(QtWidgets.QWidget): self.reset() def reset(self): - values = config.global_project_configurations() + values = {"project": config.global_project_configurations()} schema = lib.gui_schema("projects_schema", "0_project_gui_schema") self.keys = schema.get("keys", []) self.add_children_gui(schema, values) @@ -316,7 +316,6 @@ class ProjectWidget(QtWidgets.QWidget): def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] klass = lib.TypeToKlass.types.get(item_type) - item = klass( child_configuration, values, self.keys, self ) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 61c6385323..0f1ef844d3 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1832,9 +1832,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): self.input_fields = [] - if "key" not in input_data: - print(json.dumps(input_data, indent=4)) - self.key = input_data["key"] self.keys = list(parent_keys) self.keys.append(self.key) @@ -1869,13 +1866,8 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] - if item_type == "schema": - for _schema in child_configuration["children"]: - children = config.gui_schema(_schema) - self.add_children_gui(children, values) - return - klass = TypeToKlass.types.get(item_type) + item = klass( child_configuration, values, self.keys, self ) From a575ed37291fe80ce448f99085f0c51760ee0724 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 19:17:06 +0200 Subject: [PATCH 102/507] minor fix in raw json --- .../projects_schema/1_plugins_gui_schema.json | 2 +- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 2b4dfafc56..e6582d82b1 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -570,7 +570,7 @@ "label": "Folder", "default": "takes" }, { - "type": "text-singleline", + "type": "int", "key": "steps", "label": "Steps", "default": 20 diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0f1ef844d3..6100087ac7 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -719,6 +719,8 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.is_valid = None def set_value(self, value, *, default_value=False): + if not isinstance(value, str): + value = json.dumps(value, indent=4) self.setPlainText(value) def setPlainText(self, *args, **kwargs): @@ -808,7 +810,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): value = self.value_from_values(values) if value is not NOT_SET: - self.text_input.setPlainText(value) + self.text_input.set_value(value) self.default_value = self.item_value() self.override_value = None @@ -816,7 +818,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self.text_input.textChanged.connect(self._on_value_change) def set_value(self, value, *, default_value=False): - self.text_input.setPlainText(value) + self.text_input.set_value(value) if default_value: self.default_value = self.item_value() self._on_value_change() From 49a4e73fc65193c73d430d87409b641ac266dd7b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 24 Aug 2020 19:26:01 +0200 Subject: [PATCH 103/507] removed ftrack overrides as not ready yet --- .../config_gui_schema/projects_schema/0_project_gui_schema.json | 1 - 1 file changed, 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json index c281ce3c79..10641d5eda 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json @@ -5,7 +5,6 @@ { "type": "schema", "children": [ - "1_ftrack_projects_gui_schema", "1_plugins_gui_schema" ] } From e35ef732b84f8d7e9603dc50c7aca70e3b957920 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 10:49:02 +0200 Subject: [PATCH 104/507] fixed content margins on right side --- .../config_setting/config_setting/widgets/inputs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 6100087ac7..2cb1be3c63 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -932,7 +932,7 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): self.setObjectName("TextListSubWidget") layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(5, 5, 5, 5) + layout.setContentsMargins(5, 5, 0, 5) layout.setSpacing(5) self.setLayout(layout) @@ -1251,7 +1251,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): self.setObjectName("ModifiableDictSubWidget") layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(5, 5, 5, 5) + layout.setContentsMargins(5, 5, 0, 5) layout.setSpacing(5) self.setLayout(layout) @@ -1478,7 +1478,7 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): content_widget.setVisible(False) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(3, 3, 3, 3) + content_layout.setContentsMargins(3, 3, 0, 3) self.set_content_widget(content_widget) @@ -1655,7 +1655,7 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): content_widget = QtWidgets.QWidget(body_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(3, 3, 3, 3) + content_layout.setContentsMargins(3, 3, 0, 3) body_layout = QtWidgets.QVBoxLayout(body_widget) body_layout.setContentsMargins(0, 0, 0, 0) @@ -1666,7 +1666,7 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): self.setAttribute(QtCore.Qt.WA_StyledBackground) main_layout = QtWidgets.QHBoxLayout(self) - main_layout.setContentsMargins(5, 5, 5, 5) + main_layout.setContentsMargins(5, 5, 0, 5) main_layout.setSpacing(0) main_layout.addWidget(body_widget) From 7cd5b58b653b51379d675867c69a428a2a8b2194 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 10:50:42 +0200 Subject: [PATCH 105/507] modified style --- .../config_setting/style/style.css | 34 +++++++++---------- .../config_setting/widgets/inputs.py | 3 +- .../config_setting/widgets/widgets.py | 4 +-- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index a0c5db86a1..9bd74de282 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -2,6 +2,7 @@ QWidget { color: #bfccd6; background-color: #293742; font-size: 12px; + border-radius: 0px; } QCheckBox::indicator { @@ -58,44 +59,43 @@ QPushButton[btn-type="expand-toggle"] { } #RawJsonInput[state="invalid"] { - border-color: #ff5511; + border-left-color: #ff5511; } #DictKey[state="modified"] { - border-color: #137cbd; + border-left-color: #137cbd; } #DictKey[state="overriden"] { - border-color: #00f; + border-left-color: #00f; } #DictKey[state="overriden-modified"] { - border-color: #0f0; + border-left-color: #0f0; } -#ExpandLabel { +#DictLabel { background: transparent; + font-weight: bold; } -#DictExpandWidget, #ModifiableDict, #ExpandingWidget { - border: 1px solid #455c6e; - border-radius: 3px; +#ExpandingWidget, #ModifiableDict, #DictWidget { + border-left: 3px solid #455c6e; background: #1d272f; } -#DictExpandWidget[state="child-modified"], #ModifiableDict[state="child-modified"] { - border-color: #137cbd; +#ExpandingWidget[state="child-modified"], #ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"] { + border-left-color: #137cbd; } -#DictExpandWidget[state="child-overriden"], #ModifiableDict[state="child-overriden"] { - border-color: #ff8c1a; +#ExpandingWidget[state="child-overriden"], #ModifiableDict[state="child-overriden"], #DictWidget[state="child-overriden"] { + border-left-color: #ff8c1a; } -#DictExpandWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"] { - border-color: #00b386; +#ExpandingWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"] { + border-left-color: #00b386; } #TextListSubWidget { - border: 1px solid #455c6e; - border-radius: 3px; - background: #1d272f; + border-left: 3px solid #455c6e; + /* background: #1d272f; */ } diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 2cb1be3c63..9023d36826 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1472,7 +1472,6 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): self._child_state = None super(DictExpandWidget, self).__init__(input_data["label"], parent) - self.setObjectName("DictExpandWidget") content_widget = QtWidgets.QWidget(self) content_widget.setVisible(False) @@ -1651,7 +1650,7 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): label_widget = QtWidgets.QLabel( input_data["label"], parent=body_widget ) - label_widget.setObjectName("ExpandLabel") + label_widget.setObjectName("DictLabel") content_widget = QtWidgets.QWidget(body_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 3d5528e17a..a15edf58ff 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -54,7 +54,7 @@ class ExpandingWidget(QtWidgets.QWidget): button_toggle.setChecked(False) label_widget = QtWidgets.QLabel(label, parent=top_part) - label_widget.setObjectName("ExpandLabel") + label_widget.setObjectName("DictLabel") layout = QtWidgets.QHBoxLayout(top_part) layout.setContentsMargins(0, 0, 0, 0) @@ -74,7 +74,7 @@ class ExpandingWidget(QtWidgets.QWidget): def set_content_widget(self, content_widget): main_layout = QtWidgets.QVBoxLayout(self) - main_layout.setContentsMargins(9, 9, 9, 9) + main_layout.setContentsMargins(9, 9, 0, 9) content_widget.setVisible(False) From f4cdb85c14ef49987d4e154d28d567fbaeba687e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 10:57:48 +0200 Subject: [PATCH 106/507] fixed project list styles --- .../config_setting/config_setting/style/style.css | 12 ++++++++++-- .../config_setting/config_setting/widgets/base.py | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 9bd74de282..2ea765f442 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -56,6 +56,16 @@ QPushButton[btn-type="text-list"]:hover { QPushButton[btn-type="expand-toggle"] { background: transparent; + background: #1d272f; +} + +#ProjectListWidget QListView { + border: 1px solid #aaaaaa; + background: #1d272f; +} +#ProjectListWidget QLabel { + background: transparent; + font-weight: bold; } #RawJsonInput[state="invalid"] { @@ -80,7 +90,6 @@ QPushButton[btn-type="expand-toggle"] { #ExpandingWidget, #ModifiableDict, #DictWidget { border-left: 3px solid #455c6e; - background: #1d272f; } #ExpandingWidget[state="child-modified"], #ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"] { @@ -97,5 +106,4 @@ QPushButton[btn-type="expand-toggle"] { #TextListSubWidget { border-left: 3px solid #455c6e; - /* background: #1d272f; */ } diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 74e0543870..5f48b416c1 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -140,8 +140,10 @@ class ProjectListWidget(QtWidgets.QWidget): self.current_project = None super(ProjectListWidget, self).__init__(parent) + self.setObjectName("ProjectListWidget") label_widget = QtWidgets.QLabel("Projects") + project_list = ProjectListView(self) project_list.setModel(QtGui.QStandardItemModel()) @@ -282,7 +284,7 @@ class ProjectWidget(QtWidgets.QWidget): configurations_widget = QtWidgets.QWidget() configurations_layout = QtWidgets.QVBoxLayout(configurations_widget) - configurations_layout.setContentsMargins(0, 0, 0, 0) + configurations_layout.setContentsMargins(0, 0, 5, 0) configurations_layout.setSpacing(0) configurations_layout.addWidget(scroll_widget, 1) From 62ed17c597398fb6212ea48fd4fb230300d234b7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 10:58:11 +0200 Subject: [PATCH 107/507] removed unused imports --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 9023d36826..0f106c6408 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1,8 +1,6 @@ import json from Qt import QtWidgets, QtCore, QtGui -from pype.api import config from .widgets import ( - ClickableWidget, ExpandingWidget, ModifiedIntSpinBox, ModifiedFloatSpinBox From e9551c7fc476e788f70b4b3c86371e6e0e8491ac Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 11:03:37 +0200 Subject: [PATCH 108/507] group widgets has borders --- pype/tools/config_setting/config_setting/style/style.css | 4 ++++ pype/tools/config_setting/config_setting/widgets/base.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 2ea765f442..aa1f6293d7 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -59,6 +59,10 @@ QPushButton[btn-type="expand-toggle"] { background: #1d272f; } +#GroupWidget { + border: 1px solid #aaaaaa; +} + #ProjectListWidget QListView { border: 1px solid #aaaaaa; background: #1d272f; diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 5f48b416c1..4fe3866096 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -20,6 +20,7 @@ class StudioWidget(QtWidgets.QWidget): self.input_fields = [] scroll_widget = QtWidgets.QScrollArea(self) + scroll_widget.setObjectName("GroupWidget") content_widget = QtWidgets.QWidget(scroll_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(3, 3, 3, 3) @@ -43,7 +44,7 @@ class StudioWidget(QtWidgets.QWidget): footer_layout.addWidget(save_btn, 0) layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) + layout.setContentsMargins(5, 0, 5, 0) layout.setSpacing(0) self.setLayout(layout) @@ -261,6 +262,7 @@ class ProjectWidget(QtWidgets.QWidget): self.input_fields = [] scroll_widget = QtWidgets.QScrollArea(self) + scroll_widget.setObjectName("GroupWidget") content_widget = QtWidgets.QWidget(scroll_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(3, 3, 3, 3) @@ -284,7 +286,7 @@ class ProjectWidget(QtWidgets.QWidget): configurations_widget = QtWidgets.QWidget() configurations_layout = QtWidgets.QVBoxLayout(configurations_widget) - configurations_layout.setContentsMargins(0, 0, 5, 0) + configurations_layout.setContentsMargins(5, 0, 5, 0) configurations_layout.setSpacing(0) configurations_layout.addWidget(scroll_widget, 1) From b51e24318efb2dcb1bc0a3145877fed73bafda69 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 11:14:17 +0200 Subject: [PATCH 109/507] overriden-modified has same color as modified --- .../config_setting/style/style.css | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index aa1f6293d7..961bfa0d03 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -25,7 +25,7 @@ QLabel[state="modified"] { } QLabel[state="overriden-modified"] { - color: #00b386; + color: #137cbd; } QLabel[state="overriden"] { @@ -37,13 +37,18 @@ QWidget[input-state="modified"] { } QWidget[input-state="overriden-modified"] { - border-color: #00b386; + border-color: #137cbd; } QWidget[input-state="overriden"] { border-color: #ff8c1a; } +QPushButton { + border: 1px solid #aaaaaa; + border-radius: 3px; + padding: 5px; +} QPushButton[btn-type="text-list"] { border: 1px solid #bfccd6; border-radius: 10px; @@ -93,19 +98,24 @@ QPushButton[btn-type="expand-toggle"] { } #ExpandingWidget, #ModifiableDict, #DictWidget { - border-left: 3px solid #455c6e; + border-style: solid; + border-color: #455c6e; + border-left-width: 3px; + border-bottom-width: 0px; + border-right-width: 0px; + border-top-width: 0px; } #ExpandingWidget[state="child-modified"], #ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"] { - border-left-color: #137cbd; + border-color: #137cbd; } #ExpandingWidget[state="child-overriden"], #ModifiableDict[state="child-overriden"], #DictWidget[state="child-overriden"] { - border-left-color: #ff8c1a; + border-color: #ff8c1a; } #ExpandingWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"] { - border-left-color: #00b386; + border-color: #137cbd; } #TextListSubWidget { From 43d2a70d0d10a7872fd8d86ce854ec5dde96ac8c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 11:32:21 +0200 Subject: [PATCH 110/507] inputs has different background --- pype/tools/config_setting/config_setting/style/style.css | 1 + pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 961bfa0d03..b040425a02 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -14,6 +14,7 @@ QCheckBox::indicator:focus { QLineEdit, QSpinBox, QDoubleSpinBox, QPlainTextEdit { border: 1px solid #aaaaaa; border-radius: 3px; + background: #1d272f; } QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QPlainTextEdit:focus { diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0f106c6408..c64e0e43cc 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -796,8 +796,8 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget) - layout.addWidget(self.text_input) + layout.addWidget(label_widget, 0) + layout.addWidget(self.text_input, 1) self.label_widget = label_widget From 34416f46ddeeb16ec44dee7873341a14da9e38ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 13:20:07 +0200 Subject: [PATCH 111/507] adde more transparency --- .../config_setting/config_setting/style/style.css | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index b040425a02..e7224533da 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -11,15 +11,18 @@ QCheckBox::indicator:focus { color: #ff0000; } -QLineEdit, QSpinBox, QDoubleSpinBox, QPlainTextEdit { +QLineEdit, QSpinBox, QDoubleSpinBox, QPlainTextEdit, QTextEdit { border: 1px solid #aaaaaa; border-radius: 3px; - background: #1d272f; + background-color: #1d272f; } -QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QPlainTextEdit:focus { +QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QPlainTextEdit:focus, QTextEdit:focus { border: 1px solid #ffffff; } +QLabel, QToolButton { + background: transparent; +} QLabel[state="modified"] { color: #137cbd; @@ -61,7 +64,6 @@ QPushButton[btn-type="text-list"]:hover { } QPushButton[btn-type="expand-toggle"] { - background: transparent; background: #1d272f; } @@ -94,7 +96,6 @@ QPushButton[btn-type="expand-toggle"] { } #DictLabel { - background: transparent; font-weight: bold; } From 1390637bb1ce6949935c97b862eb72a011e4f822 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 13:21:23 +0200 Subject: [PATCH 112/507] tried to extend raw json input --- .../config_setting/config_setting/widgets/inputs.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index c64e0e43cc..4e63a4a501 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -752,6 +752,11 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.setProperty("state", state) self.style().polish(self) + def resizeEvent(self, event): + self.updateGeometry() + super().resizeEvent(event) + + def value(self): return self.toPlainText() @@ -791,7 +796,11 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) - self.text_input = RawJsonInput() + self.text_input = RawJsonInput(self) + self.text_input.setSizePolicy( + QtWidgets.QSizePolicy.Minimum, + QtWidgets.QSizePolicy.MinimumExpanding + ) if not label_widget: label = input_data["label"] From cdc407f7ad341132d1b4b1d55809901b37cfa60f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 13:24:48 +0200 Subject: [PATCH 113/507] Hound fixes --- pype/config.py | 4 +++- pype/tools/config_setting/config_setting/widgets/inputs.py | 1 - pype/tools/config_setting/config_setting/widgets/tests.py | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pype/config.py b/pype/config.py index c65e336e00..416704649c 100644 --- a/pype/config.py +++ b/pype/config.py @@ -188,6 +188,8 @@ def project_presets(project_name=None, **kwargs): if not project_name: project_name = os.environ.get("AVALON_PROJECT") - project_overrides = project_configurations_overrides(project_name, **kwargs) + project_overrides = project_configurations_overrides( + project_name, **kwargs + ) return apply_overrides(global_presets, project_overrides) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4e63a4a501..19286a19b5 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -756,7 +756,6 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.updateGeometry() super().resizeEvent(event) - def value(self): return self.toPlainText() diff --git a/pype/tools/config_setting/config_setting/widgets/tests.py b/pype/tools/config_setting/config_setting/widgets/tests.py index 53b67de3a1..16c97a85ef 100644 --- a/pype/tools/config_setting/config_setting/widgets/tests.py +++ b/pype/tools/config_setting/config_setting/widgets/tests.py @@ -63,8 +63,6 @@ class AddibleComboBox(QtWidgets.QComboBox): # self.addItems([text]) # index = self.findText(text) - - def populate(self, items): self.clear() # self.addItems([""]) # ensure first item is placeholder From 6d31920609220ad8e584a7d96f34a405314d660b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 13:31:05 +0200 Subject: [PATCH 114/507] added hovering on labels --- .../config_setting/style/style.css | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index e7224533da..af4808b443 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -24,17 +24,14 @@ QLabel, QToolButton { background: transparent; } -QLabel[state="modified"] { - color: #137cbd; -} +QLabel:hover {color: #ffffff;} -QLabel[state="overriden-modified"] { - color: #137cbd; -} - -QLabel[state="overriden"] { - color: #ff8c1a; -} +QLabel[state="modified"] {color: #137cbd;} +QLabel[state="modified"]:hover {color: #1798e8;} +QLabel[state="overriden-modified"] {color: #137cbd;} +QLabel[state="overriden-modified"]:hover {color: #1798e8;} +QLabel[state="overriden"] {color: #ff8c1a;} +QLabel[state="overriden"]:hover {color: #ffa64d;} QWidget[input-state="modified"] { border-color: #137cbd; From 422930ea8782a68f5ed008b9be55c1c72deed9aa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 13:54:17 +0200 Subject: [PATCH 115/507] fixed raw json height sizes --- .../config_setting/widgets/inputs.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 19286a19b5..bd945f18e8 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -716,6 +716,21 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.is_valid = None + def sizeHint(self): + document = self.document() + layout = document.documentLayout() + + height = document.documentMargin() + 2 * self.frameWidth() + 1 + block = document.begin() + while block != document.end(): + height += layout.blockBoundingRect(block).height() + block = block.next() + + value = super().sizeHint() + value.setHeight(height) + + return value + def set_value(self, value, *, default_value=False): if not isinstance(value, str): value = json.dumps(value, indent=4) From 1ac0c781338ab5734016cab12b8a3ae771fb3dfa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 14:16:21 +0200 Subject: [PATCH 116/507] text list widget does not have modification line next to it --- .../config_setting/config_setting/style/style.css | 4 ---- .../config_setting/config_setting/widgets/inputs.py | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index af4808b443..0099e6ed76 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -116,7 +116,3 @@ QPushButton[btn-type="expand-toggle"] { #ExpandingWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"] { border-color: #137cbd; } - -#TextListSubWidget { - border-left: 3px solid #455c6e; -} diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index bd945f18e8..0d07383d3c 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -953,8 +953,8 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): self.setObjectName("TextListSubWidget") layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(5, 5, 0, 5) - layout.setSpacing(5) + layout.setContentsMargins(0, 5, 0, 5) + layout.setSpacing(3) self.setLayout(layout) self.input_fields = [] @@ -1088,9 +1088,9 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): layout.addWidget(label_widget) self.label_widget = label_widget - # keys = list(parent_keys) - # keys.append(input_data["key"]) - # self.keys = keys + keys = list(parent_keys) + keys.append(input_data["key"]) + self.keys = keys self.value_widget = TextListSubWidget( input_data, values, parent_keys, self From b7807f81f05697fc70a8a65a5cd2877a4720717e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 15:07:25 +0200 Subject: [PATCH 117/507] fix super --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0d07383d3c..e9104e6c0c 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -726,7 +726,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): height += layout.blockBoundingRect(block).height() block = block.next() - value = super().sizeHint() + value = super(RawJsonInput, self).sizeHint() value.setHeight(height) return value @@ -769,7 +769,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): def resizeEvent(self, event): self.updateGeometry() - super().resizeEvent(event) + super(RawJsonInput, self).resizeEvent(event) def value(self): return self.toPlainText() From 6a585b082a744157addb859487cc2f06d27284b2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 15:29:47 +0200 Subject: [PATCH 118/507] renamed default_value to global_value --- .../config_setting/widgets/inputs.py | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e9104e6c0c..140d67c0ad 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -164,18 +164,18 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.checkbox.setChecked(value) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None self.checkbox.stateChanged.connect(self._on_value_change) - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): # Ignore value change because if `self.isChecked()` has same # value as `value` the `_on_value_change` is not triggered self.checkbox.setChecked(value) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() @@ -183,7 +183,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): if self.is_overidable and self.override_value is not None: self.set_value(self.override_value) else: - self.set_value(self.default_value) + self.set_value(self.global_value) def clear_value(self): self.reset_value() @@ -195,7 +195,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): if override_value is None: self._is_overriden = False self._was_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True self._was_overriden = True @@ -216,7 +216,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): is_modified = _value != self.override_value if is_modified is None: - is_modified = _value != self.default_value + is_modified = _value != self.global_value self._is_modified = is_modified @@ -292,22 +292,22 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.int_input.setValue(value) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None self.int_input.valueChanged.connect(self._on_value_change) - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): self.int_input.setValue(value) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() def clear_value(self): self.set_value(0) def reset_value(self): - self.set_value(self.default_value) + self.set_value(self.global_value) def apply_overrides(self, override_value): self._is_modified = False @@ -316,7 +316,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): if override_value is None: self._is_overriden = False self._was_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True self._was_overriden = True @@ -329,7 +329,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.default_value + self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True @@ -416,19 +416,19 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.float_input.setValue(value) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None self.float_input.valueChanged.connect(self._on_value_change) - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): self.float_input.setValue(value) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.default_value) + self.set_value(self.global_value) def apply_overrides(self, override_value): self._is_modified = False @@ -436,7 +436,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): self.override_value = override_value if override_value is None: self._is_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True value = override_value @@ -451,7 +451,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.default_value + self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True @@ -528,19 +528,19 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.text_input.setText(value) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None self.text_input.textChanged.connect(self._on_value_change) - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): self.text_input.setText(value) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.default_value) + self.set_value(self.global_value) def apply_overrides(self, override_value): self._is_modified = False @@ -549,7 +549,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): if override_value is None: self._is_overriden = False self._was_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True self._was_overriden = True @@ -565,7 +565,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.default_value + self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True @@ -640,19 +640,19 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.text_input.setPlainText(value) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None self.text_input.textChanged.connect(self._on_value_change) - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): self.text_input.setPlainText(value) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.default_value) + self.set_value(self.global_value) def apply_overrides(self, override_value): self._is_modified = False @@ -660,7 +660,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): self.override_value = override_value if override_value is None: self._is_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True value = override_value @@ -675,7 +675,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.default_value + self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True @@ -731,7 +731,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): return value - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): if not isinstance(value, str): value = json.dumps(value, indent=4) self.setPlainText(value) @@ -833,19 +833,19 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.text_input.set_value(value) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None self.text_input.textChanged.connect(self._on_value_change) - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): self.text_input.set_value(value) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.default_value) + self.set_value(self.global_value) def clear_value(self): self.set_value("") @@ -856,7 +856,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self.override_value = override_value if override_value is None: self._is_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True value = override_value @@ -868,7 +868,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.default_value + self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True @@ -969,22 +969,22 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): if value is not NOT_SET: self.set_value(value) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): for input_field in self.input_fields: self.remove_row(input_field) for item_text in value: self.add_row(text=item_text) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.default_value) + self.set_value(self.global_value) def clear_value(self): self.set_value([]) @@ -1103,13 +1103,13 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): layout.addWidget(self.value_widget) self.setLayout(layout) - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None def _on_value_change(self, item=None): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.default_value + self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True @@ -1117,14 +1117,14 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self.value_changed.emit(self) - def set_value(self, value, *, default_value=False): + def set_value(self, value, *, global_value=False): self.value_widget.set_value(value) - if default_value: - self.default_value = self.item_value() + if global_value: + self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.default_value) + self.set_value(self.global_value) def clear_value(self): self.set_value([]) @@ -1135,7 +1135,7 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self.override_value = override_value if override_value is None: self._is_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True value = override_value @@ -1200,7 +1200,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): self.value_input.value_changed.connect(self._on_value_change) self.default_key = self._key() - self.default_value = self.value_input.item_value() + self.global_value = self.value_input.item_value() self.override_key = None self.override_value = None @@ -1292,7 +1292,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): if self.count() == 0: self.add_row() - self.default_value = self.config_value() + self.global_value = self.config_value() self.override_value = None @property @@ -1335,7 +1335,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): if value is not None and key is not None: item_widget.default_key = key item_widget.key_input.setText(key) - item_widget.value_input.set_value(value, default_value=True) + item_widget.value_input.set_value(value, global_value=True) else: self._on_value_change() self.parent().updateGeometry() @@ -1407,7 +1407,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): self.key = input_data["key"] - self.default_value = self.item_value() + self.global_value = self.item_value() self.override_value = None def _on_value_change(self, item=None): @@ -1420,7 +1420,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): if self.is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.default_value + self._is_modified = self.item_value() != self.global_value self.value_changed.emit(self) @@ -1433,7 +1433,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): if override_value is None: self._is_overriden = False self._was_overriden = False - value = self.default_value + value = self.global_value else: self._is_overriden = True self._was_overriden = True From 4aca6fd3378615ae8adcf237a05dafce28194ca5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 16:08:14 +0200 Subject: [PATCH 119/507] override value is NOT_SET by default instead of None --- .../config_setting/widgets/base.py | 2 +- .../config_setting/widgets/inputs.py | 62 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 4fe3866096..94754bda0d 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -329,7 +329,7 @@ class ProjectWidget(QtWidgets.QWidget): def _on_project_change(self): project_name = self.project_list_widget.project_name() if project_name is None: - overrides = None + overrides = lib.NOT_SET self.is_overidable = False else: overrides = config.project_configurations_overrides(project_name) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 140d67c0ad..1697271b4d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -165,7 +165,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): self.checkbox.setChecked(value) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET self.checkbox.stateChanged.connect(self._on_value_change) @@ -180,7 +180,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): self._on_value_change() def reset_value(self): - if self.is_overidable and self.override_value is not None: + if self.is_overidable and self.override_value is not NOT_SET: self.set_value(self.override_value) else: self.set_value(self.global_value) @@ -192,7 +192,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self._state = None self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False value = self.global_value @@ -293,7 +293,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): self.int_input.setValue(value) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET self.int_input.valueChanged.connect(self._on_value_change) @@ -313,7 +313,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self._state = None self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False value = self.global_value @@ -417,7 +417,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): self.float_input.setValue(value) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET self.float_input.valueChanged.connect(self._on_value_change) @@ -434,7 +434,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self._state = None self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False value = self.global_value else: @@ -529,7 +529,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): self.text_input.setText(value) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET self.text_input.textChanged.connect(self._on_value_change) @@ -546,7 +546,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self._state = None self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False value = self.global_value @@ -641,7 +641,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): self.text_input.setPlainText(value) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET self.text_input.textChanged.connect(self._on_value_change) @@ -658,7 +658,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self._state = None self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False value = self.global_value else: @@ -834,7 +834,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self.text_input.set_value(value) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET self.text_input.textChanged.connect(self._on_value_change) @@ -854,7 +854,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self._state = None self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False value = self.global_value else: @@ -970,7 +970,7 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): self.set_value(value) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET def set_value(self, value, *, global_value=False): for input_field in self.input_fields: @@ -1104,7 +1104,7 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self.setLayout(layout) self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -1133,7 +1133,7 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self._is_modified = False self._state = None self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False value = self.global_value else: @@ -1203,7 +1203,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): self.global_value = self.value_input.item_value() self.override_key = None - self.override_value = None + self.override_value = NOT_SET self.is_single = False @@ -1293,7 +1293,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): self.add_row() self.global_value = self.config_value() - self.override_value = None + self.override_value = NOT_SET @property def is_group(self): @@ -1408,7 +1408,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): self.key = input_data["key"] self.global_value = self.item_value() - self.override_value = None + self.override_value = NOT_SET def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -1430,7 +1430,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): self._state = None self._is_modified = False self.override_value = override_value - if override_value is None: + if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False value = self.global_value @@ -1523,10 +1523,10 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): self._state = None self._child_state = None for item in self.input_fields: - if override_value is None: - child_value = None + if override_value is NOT_SET: + child_value = NOT_SET else: - child_value = override_value.get(item.key) + child_value = override_value.get(item.key, NOT_SET) item.apply_overrides(child_value) @@ -1534,7 +1534,7 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): self.is_group and self.is_overidable and ( - override_value is not None + override_value is not NOT_SET or self.child_overriden ) ) @@ -1710,10 +1710,10 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): self._state = None self._child_state = None for item in self.input_fields: - if override_value is None: - child_value = None + if override_value is NOT_SET: + child_value = NOT_SET else: - child_value = override_value.get(item.key) + child_value = override_value.get(item.key, NOT_SET) item.apply_overrides(child_value) @@ -1721,7 +1721,7 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): self.is_group and self.is_overidable and ( - override_value is not None + override_value is not NOT_SET or self.child_overriden ) ) @@ -1919,10 +1919,10 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): def apply_overrides(self, override_value): self._is_overriden = False for item in self.input_fields: - if override_value is None: - child_value = None + if override_value is NOT_SET: + child_value = NOT_SET else: - child_value = override_value.get(item.key) + child_value = override_value.get(item.key, NOT_SET) item.apply_overrides(child_value) self._is_overriden = ( From 6342f02574ec0a0560e659161953d793bf9bd1cc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 17:00:03 +0200 Subject: [PATCH 120/507] it is possible to right click on widgets, actions do nothing --- .../config_setting/widgets/inputs.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 1697271b4d..baf524d5da 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -94,6 +94,41 @@ class ConfigWidget: "Method `add_children_gui` is not implemented for `{}`." ).format(self.__class__.__name__)) + def _discard_changes(self): + print("_discard_changes") + + def _remove_overrides(self): + print("_remove_overrides") + + def mouseReleaseEvent(self, event): + if event.button() == QtCore.Qt.RightButton: + menu = QtWidgets.QMenu() + + actions_mapping = {} + if self.child_modified: + action = QtWidgets.QAction("Discard changes") + actions_mapping[action] = self._discard_changes + menu.addAction(action) + + if self.child_overriden: + # TODO better label + action = QtWidgets.QAction("Remove override") + actions_mapping[action] = self._remove_overrides + menu.addAction(action) + + if not actions_mapping: + action = QtWidgets.QAction("< No action >") + actions_mapping[action] = None + menu.addAction(action) + + result = menu.exec_(QtGui.QCursor.pos()) + if result: + to_run = actions_mapping[result] + if to_run: + to_run() + return + super(self.__class__, self).mouseReleaseEvent(event) + class InputWidget(ConfigWidget): def overrides(self): From 31d75aa5cc24c7fdcf86ff5c9f10941d2b3ecd46 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 18:09:02 +0200 Subject: [PATCH 121/507] styles are automatically updated on _ignore_value_changes changed to False --- .../config_setting/widgets/base.py | 33 +++++++++++++++++-- .../config_setting/widgets/inputs.py | 20 +++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 94754bda0d..2018b4bde3 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -12,11 +12,12 @@ class StudioWidget(QtWidgets.QWidget): is_overriden = False is_group = False any_parent_is_group = False - ignore_value_changes = False def __init__(self, parent=None): super(StudioWidget, self).__init__(parent) + self._ignore_value_changes = False + self.input_fields = [] scroll_widget = QtWidgets.QScrollArea(self) @@ -55,6 +56,20 @@ class StudioWidget(QtWidgets.QWidget): self.reset() + @property + def ignore_value_changes(self): + return self._ignore_value_changes + + @ignore_value_changes.setter + def ignore_value_changes(self, value): + self._ignore_value_changes = value + if value is False: + self.hierarchical_style_update() + + def hierarchical_style_update(self): + for input_field in self.input_fields: + input_field.hierarchical_style_update() + def reset(self): if self.content_layout.count() != 0: for widget in self.input_fields: @@ -256,7 +271,7 @@ class ProjectWidget(QtWidgets.QWidget): super(ProjectWidget, self).__init__(parent) self.is_overidable = False - self.ignore_value_changes = False + self._ignore_value_changes = False self.project_name = None self.input_fields = [] @@ -310,6 +325,20 @@ class ProjectWidget(QtWidgets.QWidget): self.reset() + @property + def ignore_value_changes(self): + return self._ignore_value_changes + + @ignore_value_changes.setter + def ignore_value_changes(self, value): + self._ignore_value_changes = value + if value is False: + self.hierarchical_style_update() + + def hierarchical_style_update(self): + for input_field in self.input_fields: + input_field.hierarchical_style_update() + def reset(self): values = {"project": config.global_project_configurations()} schema = lib.gui_schema("projects_schema", "0_project_gui_schema") diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index baf524d5da..c5afe1a7e7 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -53,6 +53,9 @@ class ConfigWidget: raise NotImplementedError( "Method `reset_children_attributes` not implemented!" ) + @ignore_value_changes.setter + def ignore_value_changes(self, value): + self._parent.ignore_value_changes = value def item_value(self): raise NotImplementedError( @@ -136,6 +139,9 @@ class InputWidget(ConfigWidget): return NOT_SET, False return self.config_value(), self.is_group + def hierarchical_style_update(self): + self.update_style() + @property def child_modified(self): return self.is_modified @@ -1780,6 +1786,11 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): self.update_style() + def hierarchical_style_update(self): + self.update_style() + for input_field in self.input_fields: + input_field.hierarchical_style_update() + def update_style(self, is_overriden=None): child_modified = self.child_modified child_state = self.style_state(self.child_overriden, child_modified) @@ -1951,6 +1962,11 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): self.value_changed.emit(self) + def hierarchical_style_update(self): + self.update_style() + for input_field in self.input_fields: + input_field.hierarchical_style_update() + def apply_overrides(self, override_value): self._is_overriden = False for item in self.input_fields: @@ -2051,6 +2067,10 @@ class DictFormWidget(QtWidgets.QWidget, ConfigWidget): self.input_fields[key] = item return item + def hierarchical_style_update(self): + for input_field in self.input_fields.items(): + input_field.hierarchical_style_update() + def item_value(self): output = {} for input_field in self.input_fields.values(): From 6a6a50978460f5302b782b653d08c0cbfb7ac9cf Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:09:19 +0200 Subject: [PATCH 122/507] global_value split into global_value and start_value --- .../config_setting/widgets/inputs.py | 144 +++++++++++------- 1 file changed, 91 insertions(+), 53 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index c5afe1a7e7..2bda38e207 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -194,6 +194,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): layout.addWidget(self.checkbox, 1) + value = NOT_SET if not self._as_widget: self.label_widget = label_widget self.key = input_data["key"] @@ -201,11 +202,16 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): keys.append(self.key) self.keys = keys + default_value = input_data.get("default", NOT_SET) value = self.value_from_values(values) if value is not NOT_SET: self.checkbox.setChecked(value) - self.global_value = self.item_value() + elif default_value is not NOT_SET: + self.checkbox.setChecked(default_value) + + self.global_value = value + self.start_value = self.item_value() self.override_value = NOT_SET self.checkbox.stateChanged.connect(self._on_value_change) @@ -236,7 +242,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False - value = self.global_value + value = self.start_value else: self._is_overriden = True self._was_overriden = True @@ -321,6 +327,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): layout.addWidget(label_widget, 0) layout.addWidget(self.int_input, 1) + value = NOT_SET if not self._as_widget: self.label_widget = label_widget @@ -333,7 +340,8 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.int_input.setValue(value) - self.global_value = self.item_value() + self.global_value = value + self.start_value = self.item_value() self.override_value = NOT_SET self.int_input.valueChanged.connect(self._on_value_change) @@ -341,6 +349,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): def set_value(self, value, *, global_value=False): self.int_input.setValue(value) if global_value: + self.start_value = self.item_value() self.global_value = self.item_value() self._on_value_change() @@ -348,7 +357,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): self.set_value(0) def reset_value(self): - self.set_value(self.global_value) + self.set_value(self.start_value) def apply_overrides(self, override_value): self._is_modified = False @@ -445,6 +454,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): layout.addWidget(label_widget, 0) layout.addWidget(self.float_input, 1) + value = NOT_SET if not self._as_widget: self.label_widget = label_widget @@ -457,7 +467,8 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.float_input.setValue(value) - self.global_value = self.item_value() + self.start_value = self.item_value() + self.global_value = value self.override_value = NOT_SET self.float_input.valueChanged.connect(self._on_value_change) @@ -465,6 +476,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): def set_value(self, value, *, global_value=False): self.float_input.setValue(value) if global_value: + self.start_value = self.item_value() self.global_value = self.item_value() self._on_value_change() @@ -477,7 +489,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): self.override_value = override_value if override_value is NOT_SET: self._is_overriden = False - value = self.global_value + value = self.start_value else: self._is_overriden = True value = override_value @@ -557,6 +569,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): layout.addWidget(label_widget, 0) layout.addWidget(self.text_input, 1) + value = NOT_SET if not self._as_widget: self.label_widget = label_widget @@ -569,7 +582,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): if value is not NOT_SET: self.text_input.setText(value) - self.global_value = self.item_value() + self.global_value = value + self.start_value = self.item_value() self.override_value = NOT_SET self.text_input.textChanged.connect(self._on_value_change) @@ -577,11 +591,12 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): def set_value(self, value, *, global_value=False): self.text_input.setText(value) if global_value: + self.start_value = self.item_value() self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.global_value) + self.set_value(self.start_value) def apply_overrides(self, override_value): self._is_modified = False @@ -590,7 +605,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False - value = self.global_value + value = self.start_value else: self._is_overriden = True self._was_overriden = True @@ -664,24 +679,27 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): layout.setSpacing(5) self.text_input = QtWidgets.QPlainTextEdit() - if not label_widget: + if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) layout.addWidget(label_widget, 0) layout.addWidget(self.text_input, 1) - self.label_widget = label_widget + value = NOT_SET + if not self._as_widget: + self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys - value = self.value_from_values(values) - if value is not NOT_SET: - self.text_input.setPlainText(value) + value = self.value_from_values(values) + if value is not NOT_SET: + self.text_input.setPlainText(value) - self.global_value = self.item_value() + self.global_value = value + self.start_value = self.item_value() self.override_value = NOT_SET self.text_input.textChanged.connect(self._on_value_change) @@ -689,11 +707,12 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): def set_value(self, value, *, global_value=False): self.text_input.setPlainText(value) if global_value: + self.start_value = self.item_value() self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.global_value) + self.set_value(self.start_value) def apply_overrides(self, override_value): self._is_modified = False @@ -701,7 +720,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): self.override_value = override_value if override_value is NOT_SET: self._is_overriden = False - value = self.global_value + value = self.start_value else: self._is_overriden = True value = override_value @@ -857,24 +876,27 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): QtWidgets.QSizePolicy.MinimumExpanding ) - if not label_widget: + if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) layout.addWidget(label_widget, 0) layout.addWidget(self.text_input, 1) - self.label_widget = label_widget + value = NOT_SET + if not self._as_widget: + self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys - value = self.value_from_values(values) - if value is not NOT_SET: - self.text_input.set_value(value) + value = self.value_from_values(values) + if value is not NOT_SET: + self.text_input.set_value(value) - self.global_value = self.item_value() + self.global_value = value + self.start_value = self.item_value() self.override_value = NOT_SET self.text_input.textChanged.connect(self._on_value_change) @@ -882,11 +904,12 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): def set_value(self, value, *, global_value=False): self.text_input.set_value(value) if global_value: + self.start_value = self.item_value() self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.global_value) + self.set_value(self.start_value) def clear_value(self): self.set_value("") @@ -897,7 +920,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): self.override_value = override_value if override_value is NOT_SET: self._is_overriden = False - value = self.global_value + value = self.start_value else: self._is_overriden = True value = override_value @@ -1010,7 +1033,8 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): if value is not NOT_SET: self.set_value(value) - self.global_value = self.item_value() + self.global_value = value + self.start_value = self.item_value() self.override_value = NOT_SET def set_value(self, value, *, global_value=False): @@ -1021,11 +1045,23 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): self.add_row(text=item_text) if global_value: - self.global_value = self.item_value() + self.global_value = value + self.start_value = self.item_value() self._on_value_change() + def apply_overrides(self, override_value): + self.override_value = override_value + if override_value is NOT_SET: + self._is_overriden = False + value = self.start_value + else: + self._is_overriden = True + value = override_value + + self.set_value(value) + def reset_value(self): - self.set_value(self.global_value) + self.set_value(self.start_value) def clear_value(self): self.set_value([]) @@ -1144,8 +1180,17 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): layout.addWidget(self.value_widget) self.setLayout(layout) - self.global_value = self.item_value() - self.override_value = NOT_SET + @property + def start_value(self): + return self.value_widget.start_value + + @property + def global_value(self): + return self.value_widget.global_value + + @property + def override_value(self): + return self.value_widget.override_value def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -1159,29 +1204,20 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): self.value_changed.emit(self) def set_value(self, value, *, global_value=False): - self.value_widget.set_value(value) + self.value_widget.set_value(value, global_value=global_value) if global_value: - self.global_value = self.item_value() self._on_value_change() def reset_value(self): - self.set_value(self.global_value) + self.value_widget.reset_value() def clear_value(self): - self.set_value([]) + self.value_widget.clear_value() def apply_overrides(self, override_value): + self.value_widget.apply_overrides(override_value) self._is_modified = False self._state = None - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - value = self.global_value - else: - self._is_overriden = True - value = override_value - - self.set_value(value) self.update_style() def update_style(self): @@ -1240,10 +1276,11 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): self.key_input.textChanged.connect(self._on_value_change) self.value_input.value_changed.connect(self._on_value_change) + # TODO This doesn't make sence! self.default_key = self._key() self.global_value = self.value_input.item_value() - self.override_key = None + self.override_key = NOT_SET self.override_value = NOT_SET self.is_single = False @@ -1333,7 +1370,8 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): if self.count() == 0: self.add_row() - self.global_value = self.config_value() + self.global_value = value + self.start_value = self.config_value() self.override_value = NOT_SET @property From 8361db1f79620e77ebb484c79bc3d4b4a770d822 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:09:38 +0200 Subject: [PATCH 123/507] removed unused methods --- .../config_setting/config_setting/widgets/inputs.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 2bda38e207..7abbd87863 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -42,17 +42,6 @@ class ConfigWidget: def ignore_value_changes(self): return self._parent.ignore_value_changes - def reset_attributes(self): - self._is_overriden = False - self._is_modified = False - self._was_overriden = False - - self.reset_children_attributes() - - def reset_children_attributes(self): - raise NotImplementedError( - "Method `reset_children_attributes` not implemented!" - ) @ignore_value_changes.setter def ignore_value_changes(self, value): self._parent.ignore_value_changes = value From e1209b2f13e29a8f5cdef2dc158cbaf847e1ca86 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:09:51 +0200 Subject: [PATCH 124/507] fix value_from_values --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 7abbd87863..04a13ca487 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -55,7 +55,7 @@ class ConfigWidget: return {self.key: self.item_value()} def value_from_values(self, values, keys=None): - if not values: + if not values or values is AS_WIDGET: return NOT_SET if keys is None: From 6c77e43d6b334d5a3c3937b41b221ca1437e6a42 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:10:30 +0200 Subject: [PATCH 125/507] made preparation for abstract methods --- .../config_setting/widgets/inputs.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 04a13ca487..3b07bb1c99 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -86,11 +86,23 @@ class ConfigWidget: "Method `add_children_gui` is not implemented for `{}`." ).format(self.__class__.__name__)) - def _discard_changes(self): - print("_discard_changes") + def discard_changes(self, is_source=False): + print("discard_changes") + # raise NotImplementedError( + # "Method `discard_changes` not implemented!" + # ) - def _remove_overrides(self): - print("_remove_overrides") + def remove_overrides(self, is_source=False): + print("remove_overrides") + # raise NotImplementedError( + # "Method `remove_overrides` not implemented!" + # ) + + def hierarchical_style_update(self): + print("hierarchical_style_update") + # raise NotImplementedError( + # "Method `hierarchical_style_update` not implemented!" + # ) def mouseReleaseEvent(self, event): if event.button() == QtCore.Qt.RightButton: From 403c2f4888a9e7c6401032e22c62847ec8e9e42d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:10:46 +0200 Subject: [PATCH 126/507] preparation for discard changes --- .../config_setting/widgets/inputs.py | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3b07bb1c99..7fce3606f5 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -111,13 +111,13 @@ class ConfigWidget: actions_mapping = {} if self.child_modified: action = QtWidgets.QAction("Discard changes") - actions_mapping[action] = self._discard_changes + actions_mapping[action] = self.discard_changes menu.addAction(action) if self.child_overriden: # TODO better label action = QtWidgets.QAction("Remove override") - actions_mapping[action] = self._remove_overrides + actions_mapping[action] = self.remove_overrides menu.addAction(action) if not actions_mapping: @@ -129,7 +129,7 @@ class ConfigWidget: if result: to_run = actions_mapping[result] if to_run: - to_run() + to_run(True) return super(self.__class__, self).mouseReleaseEvent(event) @@ -143,6 +143,24 @@ class InputWidget(ConfigWidget): def hierarchical_style_update(self): self.update_style() + def discard_changes(self, is_source=False): + if ( + self.is_overidable + and self.override_value is not NOT_SET + and self._was_overriden is True + ): + self.set_value(self.override_value) + else: + self.set_value(self.start_value) + + if not self.is_overidable: + self._is_modified = self.global_value != self.item_value() + self._is_overriden = False + return + + self._is_modified = False + self._is_overriden = self._was_overriden + @property def child_modified(self): return self.is_modified From 82949978488a627f4031c36d242fb4b3c9c7f2c4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:11:39 +0200 Subject: [PATCH 127/507] implemented discard changes for most of input widgets --- .../config_setting/widgets/inputs.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 7fce3606f5..b593248470 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1615,6 +1615,19 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + def discard_changes(self, is_source=False): + if is_source: + self.ignore_value_changes = True + + for item in self.input_fields: + item.discard_changes() + + if is_source: + self.ignore_value_changes = False + + self._is_modified = self.child_modified + self._is_overriden = self._was_overriden + def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False @@ -1636,6 +1649,7 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): or self.child_overriden ) ) + self._was_overriden = bool(self._is_overriden) self.update_style() def _on_value_change(self, item=None): @@ -1802,6 +1816,19 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + def discard_changes(self, is_source=False): + if is_source: + self.ignore_value_changes = True + + for item in self.input_fields: + item.discard_changes() + + self._is_modified = self.child_modified + self._is_overriden = self._was_overriden + + if is_source: + self.ignore_value_changes = False + def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False From 43da05a6183b6270b252c08c613e84fb164ed315 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:12:09 +0200 Subject: [PATCH 128/507] added forgotten hierarchical style update --- .../config_setting/config_setting/widgets/inputs.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b593248470..5e4fe0bbf3 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -245,14 +245,8 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): self._on_value_change() - def reset_value(self): - if self.is_overidable and self.override_value is not NOT_SET: - self.set_value(self.override_value) - else: - self.set_value(self.global_value) - def clear_value(self): - self.reset_value() + self.set_value(False) def apply_overrides(self, override_value): self._is_modified = False @@ -1670,6 +1664,11 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): self.update_style() + def hierarchical_style_update(self): + self.update_style() + for input_field in self.input_fields: + input_field.hierarchical_style_update() + def update_style(self, is_overriden=None): child_modified = self.child_modified child_state = self.style_state(self.child_overriden, child_modified) From 82570533d0512f7c263fd02892feeb850bff2fca Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:14:46 +0200 Subject: [PATCH 129/507] hierarchical_style_update and discard_changes are abstract methods now --- .../config_setting/widgets/inputs.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 5e4fe0bbf3..33facc1a18 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -87,10 +87,9 @@ class ConfigWidget: ).format(self.__class__.__name__)) def discard_changes(self, is_source=False): - print("discard_changes") - # raise NotImplementedError( - # "Method `discard_changes` not implemented!" - # ) + raise NotImplementedError( + "Method `discard_changes` not implemented!" + ) def remove_overrides(self, is_source=False): print("remove_overrides") @@ -99,10 +98,9 @@ class ConfigWidget: # ) def hierarchical_style_update(self): - print("hierarchical_style_update") - # raise NotImplementedError( - # "Method `hierarchical_style_update` not implemented!" - # ) + raise NotImplementedError( + "Method `hierarchical_style_update` not implemented!" + ) def mouseReleaseEvent(self, event): if event.button() == QtCore.Qt.RightButton: From e343cd65cfb6c3682d41ff110fe6ce795fbbc1d3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:36:27 +0200 Subject: [PATCH 130/507] wrapped discard_changes remove_overrides to proxy methods setting ignore value changes --- .../config_setting/widgets/inputs.py | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 33facc1a18..379b27cdb6 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -86,12 +86,22 @@ class ConfigWidget: "Method `add_children_gui` is not implemented for `{}`." ).format(self.__class__.__name__)) - def discard_changes(self, is_source=False): + def _discard_changes(self): + self.ignore_value_changes = True + self.discard_changes() + self.ignore_value_changes = False + + def discard_changes(self): raise NotImplementedError( - "Method `discard_changes` not implemented!" + "{} Method `discard_changes` not implemented!".format(repr(self)) ) - def remove_overrides(self, is_source=False): + def _remove_overrides(self): + self.ignore_value_changes = True + self.remove_overrides() + self.ignore_value_changes = False + + def remove_overrides(self): print("remove_overrides") # raise NotImplementedError( # "Method `remove_overrides` not implemented!" @@ -109,13 +119,16 @@ class ConfigWidget: actions_mapping = {} if self.child_modified: action = QtWidgets.QAction("Discard changes") - actions_mapping[action] = self.discard_changes + actions_mapping[action] = self._discard_changes menu.addAction(action) - if self.child_overriden: + if ( + not self.any_parent_overriden() + and (self.is_overriden or self.child_overriden) + ): # TODO better label action = QtWidgets.QAction("Remove override") - actions_mapping[action] = self.remove_overrides + actions_mapping[action] = self._remove_overrides menu.addAction(action) if not actions_mapping: @@ -127,7 +140,7 @@ class ConfigWidget: if result: to_run = actions_mapping[result] if to_run: - to_run(True) + to_run() return super(self.__class__, self).mouseReleaseEvent(event) From f80cd9492e2338cb80d3d9940cdfb70af8818b75 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:37:09 +0200 Subject: [PATCH 131/507] implemented missing discard changes --- .../config_setting/widgets/inputs.py | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 379b27cdb6..feae2d2943 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -154,7 +154,7 @@ class InputWidget(ConfigWidget): def hierarchical_style_update(self): self.update_style() - def discard_changes(self, is_source=False): + def discard_changes(self): if ( self.is_overidable and self.override_value is not NOT_SET @@ -1620,16 +1620,10 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) - def discard_changes(self, is_source=False): - if is_source: - self.ignore_value_changes = True - + def discard_changes(self): for item in self.input_fields: item.discard_changes() - if is_source: - self.ignore_value_changes = False - self._is_modified = self.child_modified self._is_overriden = self._was_overriden @@ -1826,19 +1820,13 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) - def discard_changes(self, is_source=False): - if is_source: - self.ignore_value_changes = True - + def discard_changes(self): for item in self.input_fields: item.discard_changes() self._is_modified = self.child_modified self._is_overriden = self._was_overriden - if is_source: - self.ignore_value_changes = False - def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False @@ -2061,6 +2049,13 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): for input_field in self.input_fields: input_field.hierarchical_style_update() + def discard_changes(self): + for item in self.input_fields: + item.discard_changes() + + self._is_modified = self.child_modified + self._is_overriden = self._was_overriden + def apply_overrides(self, override_value): self._is_overriden = False for item in self.input_fields: From dba9c98060de3a650e54412e4b82ffcf3d68de89 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:37:37 +0200 Subject: [PATCH 132/507] added any_parent_overriden for remove overrides action --- .../config_setting/widgets/base.py | 42 ++++++++++++++++--- .../config_setting/widgets/inputs.py | 5 +++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 2018b4bde3..c0246dd8a2 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -9,9 +9,9 @@ from avalon import io class StudioWidget(QtWidgets.QWidget): is_overidable = False - is_overriden = False - is_group = False - any_parent_is_group = False + _is_overriden = False + _is_group = False + _any_parent_is_group = False def __init__(self, parent=None): super(StudioWidget, self).__init__(parent) @@ -56,6 +56,21 @@ class StudioWidget(QtWidgets.QWidget): self.reset() + def any_parent_overriden(self): + return False + + @property + def is_overriden(self): + return self._is_overriden + + @property + def is_group(self): + return self._is_group + + @property + def any_parent_is_group(self): + return self._any_parent_is_group + @property def ignore_value_changes(self): return self._ignore_value_changes @@ -263,9 +278,9 @@ class ProjectListWidget(QtWidgets.QWidget): class ProjectWidget(QtWidgets.QWidget): - is_overriden = False - is_group = False - any_parent_is_group = False + _is_overriden = False + _is_group = False + _any_parent_is_group = False def __init__(self, parent=None): super(ProjectWidget, self).__init__(parent) @@ -325,6 +340,21 @@ class ProjectWidget(QtWidgets.QWidget): self.reset() + def any_parent_overriden(self): + return False + + @property + def is_overriden(self): + return self._is_overriden + + @property + def is_group(self): + return self._is_group + + @property + def any_parent_is_group(self): + return self._any_parent_is_group + @property def ignore_value_changes(self): return self._ignore_value_changes diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index feae2d2943..f946b4cac8 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -38,6 +38,11 @@ class ConfigWidget: def is_overidable(self): return self._parent.is_overidable + def any_parent_overriden(self): + if self._parent._is_overriden: + return True + return self._parent.any_parent_overriden() + @property def ignore_value_changes(self): return self._parent.ignore_value_changes From 9923427df8e5d285bc89df945830fe73d182cfb7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:37:56 +0200 Subject: [PATCH 133/507] added remove overrides for inputs --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f946b4cac8..ff0a871e17 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -159,6 +159,12 @@ class InputWidget(ConfigWidget): def hierarchical_style_update(self): self.update_style() + def remove_overrides(self): + self.set_value(self.start_value) + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + def discard_changes(self): if ( self.is_overidable From 71e61a6c68d86ac2b9c253fd46a8d7665d028372 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:40:16 +0200 Subject: [PATCH 134/507] remove_overrides is abstract --- .../config_setting/widgets/inputs.py | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ff0a871e17..d67d32990a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -87,9 +87,11 @@ class ConfigWidget: return "-".join(items) or self.default_state def add_children_gui(self, child_configuration, values): - raise NotImplementedError(( - "Method `add_children_gui` is not implemented for `{}`." - ).format(self.__class__.__name__)) + raise NotImplementedError( + "{} Method `add_children_gui` is not implemented!.".format( + repr(self) + ) + ) def _discard_changes(self): self.ignore_value_changes = True @@ -98,7 +100,9 @@ class ConfigWidget: def discard_changes(self): raise NotImplementedError( - "{} Method `discard_changes` not implemented!".format(repr(self)) + "{} Method `discard_changes` not implemented!".format( + repr(self) + ) ) def _remove_overrides(self): @@ -107,10 +111,11 @@ class ConfigWidget: self.ignore_value_changes = False def remove_overrides(self): - print("remove_overrides") - # raise NotImplementedError( - # "Method `remove_overrides` not implemented!" - # ) + raise NotImplementedError( + "{} Method `remove_overrides` not implemented!".format( + repr(self) + ) + ) def hierarchical_style_update(self): raise NotImplementedError( From 2a65a2ccb97a42b4bcaed9925a259fba1a011d46 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 25 Aug 2020 19:42:31 +0200 Subject: [PATCH 135/507] remove overrides should work now --- .../config_setting/widgets/inputs.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d67d32990a..3e344cd703 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1636,6 +1636,13 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + def remove_overrides(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + for item in self.input_fields: + item.remove_overrides() + def discard_changes(self): for item in self.input_fields: item.discard_changes() @@ -1836,6 +1843,13 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + def remove_overrides(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + for item in self.input_fields: + item.remove_overrides() + def discard_changes(self): for item in self.input_fields: item.discard_changes() @@ -2065,6 +2079,13 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): for input_field in self.input_fields: input_field.hierarchical_style_update() + def remove_overrides(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + for item in self.input_fields: + item.remove_overrides() + def discard_changes(self): for item in self.input_fields: item.discard_changes() From f66d14e582d540bf262dc3d3d5cacf60f96bede0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 17:55:53 +0200 Subject: [PATCH 136/507] scrollers are a littlebit better --- .../config_setting/style/style.css | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 0099e6ed76..73715d892d 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -116,3 +116,118 @@ QPushButton[btn-type="expand-toggle"] { #ExpandingWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"] { border-color: #137cbd; } + +QScrollBar:horizontal { + height: 15px; + margin: 3px 15px 3px 15px; + border: 1px transparent #1d272f; + border-radius: 4px; + background-color: #1d272f; +} + +QScrollBar::handle:horizontal { + background-color: #61839e; + min-width: 5px; + border-radius: 4px; +} + +QScrollBar::add-line:horizontal { + margin: 0px 3px 0px 3px; + border-image: url(:/qss_icons/rc/right_arrow_disabled.png); + width: 10px; + height: 10px; + subcontrol-position: right; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:horizontal { + margin: 0px 3px 0px 3px; + border-image: url(:/qss_icons/rc/left_arrow_disabled.png); + height: 10px; + width: 10px; + subcontrol-position: left; + subcontrol-origin: margin; +} + +QScrollBar::add-line:horizontal:hover,QScrollBar::add-line:horizontal:on { + border-image: url(:/qss_icons/rc/right_arrow.png); + height: 10px; + width: 10px; + subcontrol-position: right; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:horizontal:hover, QScrollBar::sub-line:horizontal:on { + border-image: url(:/qss_icons/rc/left_arrow.png); + height: 10px; + width: 10px; + subcontrol-position: left; + subcontrol-origin: margin; +} + +QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal { + background: none; +} + +QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { + background: none; +} + +QScrollBar:vertical { + background-color: #1d272f; + width: 15px; + margin: 15px 3px 15px 3px; + border: 1px transparent #1d272f; + border-radius: 4px; +} + +QScrollBar::handle:vertical { + background-color: #61839e; + min-height: 5px; + border-radius: 4px; +} + +QScrollBar::sub-line:vertical { + margin: 3px 0px 3px 0px; + border-image: url(:/qss_icons/rc/up_arrow_disabled.png); + height: 10px; + width: 10px; + subcontrol-position: top; + subcontrol-origin: margin; +} + +QScrollBar::add-line:vertical { + margin: 3px 0px 3px 0px; + border-image: url(:/qss_icons/rc/down_arrow_disabled.png); + height: 10px; + width: 10px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:vertical:hover,QScrollBar::sub-line:vertical:on { + + border-image: url(:/qss_icons/rc/up_arrow.png); + height: 10px; + width: 10px; + subcontrol-position: top; + subcontrol-origin: margin; +} + + +QScrollBar::add-line:vertical:hover, QScrollBar::add-line:vertical:on { + border-image: url(:/qss_icons/rc/down_arrow.png); + height: 10px; + width: 10px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical { + background: none; +} + + +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; +} From d1ffd17f5f925be45d66d499478ea112285418da Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 17:56:03 +0200 Subject: [PATCH 137/507] qmenu items are visible --- .../config_setting/config_setting/style/style.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 73715d892d..9bf8828920 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -5,6 +5,19 @@ QWidget { border-radius: 0px; } +QMenu { + border: 1px solid #555555; + background-color: #1d272f; +} + +QMenu::item { + padding: 5px 10px 5px 10px; +} + +QMenu::item:selected { + background-color: #202e3a; +} + QCheckBox::indicator { } QCheckBox::indicator:focus { From b274cfed16dc39c5945914f8e7bd8626872abf3c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 18:04:39 +0200 Subject: [PATCH 138/507] mae qmenu in same style --- pype/tools/config_setting/config_setting/style/style.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 9bf8828920..c5f1f33500 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -12,10 +12,12 @@ QMenu { QMenu::item { padding: 5px 10px 5px 10px; + border-left: 5px solid #313131; } QMenu::item:selected { - background-color: #202e3a; + border-left-color: #61839e; + background-color: #222d37; } QCheckBox::indicator { From e5960d7fa0fab9b294b611cd3b98ca2987564f78 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 18:42:08 +0200 Subject: [PATCH 139/507] added validation for is_group --- .../config_setting/widgets/lib.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index c6379b4816..e7173f1c56 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -94,6 +94,19 @@ class SchemaMissingFileInfo(Exception): super(SchemaMissingFileInfo, self).__init__(msg) +class SchemeGroupHierarchyBug(Exception): + def __init__(self, invalid): + full_path_keys = [] + for item in invalid: + full_path_keys.append("\"{}\"".format("/".join(item))) + + msg = ( + "Items with attribute \"is_group\" can't have another item with" + " \"is_group\" attribute as child. Error happened for keys: [{}]" + ).format(", ".join(full_path_keys)) + super(SchemeGroupHierarchyBug, self).__init__(msg) + + def file_keys_from_schema(schema_data): output = [] keys = [] @@ -147,11 +160,55 @@ def validate_all_has_ending_file(schema_data, is_top=True): raise SchemaMissingFileInfo(invalid) +def validate_is_group_is_unique_in_hierarchy( + schema_data, any_parent_is_group=False, keys=None +): + is_top = keys is None + if keys is None: + keys = [] + + keyless = "key" not in schema_data + + if not keyless: + keys.append(schema_data["key"]) + + invalid = [] + is_group = schema_data.get("is_group") + if is_group and any_parent_is_group: + invalid.append(copy.deepcopy(keys)) + + if is_group: + any_parent_is_group = is_group + + children = schema_data.get("children") + if not children: + return invalid + + for child in children: + result = validate_is_group_is_unique_in_hierarchy( + child, any_parent_is_group, copy.deepcopy(keys) + ) + if not result: + continue + + invalid.extend(result) + + if invalid and is_group and keys not in invalid: + invalid.append(copy.deepcopy(keys)) + + if not is_top: + return invalid + + if invalid: + raise SchemeGroupHierarchyBug(invalid) + + def validate_schema(schema_data): # TODO validator for key uniquenes # TODO validator that is_group key is not before is_file child # TODO validator that is_group or is_file is not on child without key validate_all_has_ending_file(schema_data) + validate_is_group_is_unique_in_hierarchy(schema_data) def gui_schema(subfolder, main_schema_name): From 28c4a69ea13804b96744a3a56afeb5cd0a24ea7b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 19:52:35 +0200 Subject: [PATCH 140/507] added ConfigWidget for reimplementing Qt methods --- .../config_setting/widgets/widgets.py | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index a15edf58ff..89f6782cfd 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -1,4 +1,4 @@ -from Qt import QtWidgets, QtCore +from Qt import QtWidgets, QtCore, QtGui class ModifiedIntSpinBox(QtWidgets.QSpinBox): @@ -38,7 +38,43 @@ class ClickableWidget(QtWidgets.QLabel): super(ClickableWidget, self).mouseReleaseEvent(event) -class ExpandingWidget(QtWidgets.QWidget): +class ConfigWidget(QtWidgets.QWidget): + allow_actions = True + + def mouseReleaseEvent(self, event): + if self.allow_actions and event.button() == QtCore.Qt.RightButton: + menu = QtWidgets.QMenu() + + actions_mapping = {} + if self.child_modified: + action = QtWidgets.QAction("Discard changes") + actions_mapping[action] = self._discard_changes + menu.addAction(action) + + if ( + not self.any_parent_overriden() + and (self.is_overriden or self.child_overriden) + ): + # TODO better label + action = QtWidgets.QAction("Remove override") + actions_mapping[action] = self._remove_overrides + menu.addAction(action) + + if not actions_mapping: + action = QtWidgets.QAction("< No action >") + actions_mapping[action] = None + menu.addAction(action) + + result = menu.exec_(QtGui.QCursor.pos()) + if result: + to_run = actions_mapping[result] + if to_run: + to_run() + return + super(ConfigWidget, self).mouseReleaseEvent(event) + + +class ExpandingWidget(ConfigWidget): def __init__(self, label, parent): super(ExpandingWidget, self).__init__(parent) self.setObjectName("ExpandingWidget") From d320924b9e9831d41fe49a204805e8c7ec9855b2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 19:55:02 +0200 Subject: [PATCH 141/507] ConfigWidget and InputWidget renamed to ConfigObject and InputWidget --- .../config_setting/widgets/inputs.py | 72 ++++++------------- 1 file changed, 21 insertions(+), 51 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3e344cd703..e30f437cd9 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1,6 +1,7 @@ import json from Qt import QtWidgets, QtCore, QtGui from .widgets import ( + ConfigWidget, ExpandingWidget, ModifiedIntSpinBox, ModifiedFloatSpinBox @@ -16,7 +17,7 @@ class SchemeGroupHierarchyBug(Exception): super(SchemeGroupHierarchyBug, self).__init__(msg) -class ConfigWidget: +class ConfigObject: default_state = "" _is_overriden = False _is_modified = False @@ -122,40 +123,8 @@ class ConfigWidget: "Method `hierarchical_style_update` not implemented!" ) - def mouseReleaseEvent(self, event): - if event.button() == QtCore.Qt.RightButton: - menu = QtWidgets.QMenu() - actions_mapping = {} - if self.child_modified: - action = QtWidgets.QAction("Discard changes") - actions_mapping[action] = self._discard_changes - menu.addAction(action) - - if ( - not self.any_parent_overriden() - and (self.is_overriden or self.child_overriden) - ): - # TODO better label - action = QtWidgets.QAction("Remove override") - actions_mapping[action] = self._remove_overrides - menu.addAction(action) - - if not actions_mapping: - action = QtWidgets.QAction("< No action >") - actions_mapping[action] = None - menu.addAction(action) - - result = menu.exec_(QtGui.QCursor.pos()) - if result: - to_run = actions_mapping[result] - if to_run: - to_run() - return - super(self.__class__, self).mouseReleaseEvent(event) - - -class InputWidget(ConfigWidget): +class InputObject(ConfigObject): def overrides(self): if not self.is_overriden: return NOT_SET, False @@ -200,7 +169,7 @@ class InputWidget(ConfigWidget): return -class BooleanWidget(QtWidgets.QWidget, InputWidget): +class BooleanWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -329,7 +298,7 @@ class BooleanWidget(QtWidgets.QWidget, InputWidget): return self.checkbox.isChecked() -class IntegerWidget(QtWidgets.QWidget, InputWidget): +class IntegerWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -446,7 +415,7 @@ class IntegerWidget(QtWidgets.QWidget, InputWidget): return self.int_input.value() -class FloatWidget(QtWidgets.QWidget, InputWidget): +class FloatWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -571,7 +540,7 @@ class FloatWidget(QtWidgets.QWidget, InputWidget): return self.float_input.value() -class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): +class TextSingleLineWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -580,7 +549,6 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): self._parent = parent self._as_widget = values is AS_WIDGET - any_parent_is_group = parent.is_group if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group @@ -688,7 +656,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputWidget): return self.text_input.text() -class TextMultiLineWidget(QtWidgets.QWidget, InputWidget): +class TextMultiLineWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -880,7 +848,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.update_style(is_valid) -class RawJsonWidget(QtWidgets.QWidget, InputWidget): +class RawJsonWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -999,7 +967,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputWidget): return self.text_input.toPlainText() -class TextListItem(QtWidgets.QWidget, ConfigWidget): +class TextListItem(QtWidgets.QWidget, ConfigObject): _btn_size = 20 value_changed = QtCore.Signal(object) @@ -1049,7 +1017,7 @@ class TextListItem(QtWidgets.QWidget, ConfigWidget): return self.text_input.text() -class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): +class TextListSubWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__(self, input_data, values, parent_keys, parent): @@ -1169,7 +1137,7 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigWidget): return output -class TextListWidget(QtWidgets.QWidget, InputWidget): +class TextListWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -1272,7 +1240,7 @@ class TextListWidget(QtWidgets.QWidget, InputWidget): return self.value_widget.config_value() -class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): +class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): _btn_size = 20 value_changed = QtCore.Signal(object) @@ -1380,7 +1348,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigWidget): return {key: value} -class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): +class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__(self, input_data, values, parent_keys, parent): @@ -1486,7 +1454,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigWidget): return output -class ModifiableDict(ExpandingWidget, InputWidget): +class ModifiableDict(ExpandingWidget, InputObject): # Should be used only for dictionary with one datatype as value # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) @@ -1584,7 +1552,7 @@ class ModifiableDict(ExpandingWidget, InputWidget): # Dictionaries -class DictExpandWidget(ExpandingWidget, ConfigWidget): +class DictExpandWidget(ExpandingWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__( @@ -1775,7 +1743,7 @@ class DictExpandWidget(ExpandingWidget, ConfigWidget): return {self.key: values}, self.is_group -class DictWidget(QtWidgets.QWidget, ConfigWidget): +class DictWidget(ConfigWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__( @@ -1981,9 +1949,10 @@ class DictWidget(QtWidgets.QWidget, ConfigWidget): return {self.key: values}, self.is_group -class DictInvisible(QtWidgets.QWidget, ConfigWidget): +class DictInvisible(ConfigWidget, ConfigObject): # TODO is not overridable by itself value_changed = QtCore.Signal(object) + allow_actions = False def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -2130,8 +2099,9 @@ class DictInvisible(QtWidgets.QWidget, ConfigWidget): # Proxy for form layout -class DictFormWidget(QtWidgets.QWidget, ConfigWidget): +class DictFormWidget(ConfigWidget, ConfigObject): value_changed = QtCore.Signal(object) + allow_actions = False def __init__( self, input_data, values, parent_keys, parent, label_widget=None From 7887cb3d7215379e532cc7f10188c8a1707832d8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 19:55:28 +0200 Subject: [PATCH 142/507] FormWIdget can handle mouse right clicks for its items --- .../config_setting/widgets/inputs.py | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e30f437cd9..64a5a90b45 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2098,6 +2098,12 @@ class DictInvisible(ConfigWidget, ConfigObject): return {self.key: values}, self.is_group +class FormLabel(QtWidgets.QLabel): + def __init__(self, *args, **kwargs): + super(FormLabel, self).__init__(*args, **kwargs) + self.item = None + + # Proxy for form layout class DictFormWidget(ConfigWidget, ConfigObject): value_changed = QtCore.Signal(object) @@ -2126,6 +2132,16 @@ class DictFormWidget(ConfigWidget, ConfigObject): for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) + def mouseReleaseEvent(self, event): + if event.button() == QtCore.Qt.RightButton: + position = self.mapFromGlobal(QtGui.QCursor().pos()) + widget = self.childAt(position) + if widget and isinstance(widget, FormLabel): + widget.item.mouseReleaseEvent(event) + event.accept() + return + super(DictFormWidget, self).mouseReleaseEvent(event) + def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -2153,18 +2169,20 @@ class DictFormWidget(ConfigWidget, ConfigObject): klass = TypeToKlass.types.get(item_type) - label_widget = QtWidgets.QLabel(label) + label_widget = FormLabel(label, self) item = klass( child_configuration, values, self.keys, self, label_widget ) + label_widget.item = item + item.value_changed.connect(self._on_value_change) self.content_layout.addRow(label_widget, item) self.input_fields[key] = item return item def hierarchical_style_update(self): - for input_field in self.input_fields.items(): + for input_field in self.input_fields.values(): input_field.hierarchical_style_update() def item_value(self): From 1c40104d512837360ea6ea4a20703cc369195a9a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 20:01:56 +0200 Subject: [PATCH 143/507] removed SchemeGroupHierarchyBug as is already validated when loading schemas --- .../config_setting/widgets/inputs.py | 127 ++---------------- 1 file changed, 12 insertions(+), 115 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 64a5a90b45..09174b7c0e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -9,14 +9,6 @@ from .widgets import ( from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass -class SchemeGroupHierarchyBug(Exception): - def __init__(self, msg=None): - if not msg: - # TODO better message - msg = "SCHEME BUG: Attribute `is_group` is mixed in the hierarchy" - super(SchemeGroupHierarchyBug, self).__init__(msg) - - class ConfigObject: default_state = "" _is_overriden = False @@ -175,21 +167,10 @@ class BooleanWidget(ConfigWidget, InputObject): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): - self._as_widget = values is AS_WIDGET self._parent = parent + self._as_widget = values is AS_WIDGET - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None @@ -307,18 +288,7 @@ class IntegerWidget(ConfigWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None @@ -424,18 +394,7 @@ class FloatWidget(ConfigWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None @@ -549,17 +508,7 @@ class TextSingleLineWidget(ConfigWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None @@ -665,18 +614,7 @@ class TextMultiLineWidget(ConfigWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None @@ -857,18 +795,7 @@ class RawJsonWidget(ConfigWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None @@ -1145,18 +1072,7 @@ class TextListWidget(ConfigWidget, InputObject): ): self._parent = parent - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None @@ -1469,16 +1385,9 @@ class ModifiableDict(ExpandingWidget, InputObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - - if not any_parent_is_group and not is_group: - is_group = True - self.any_parent_is_group = any_parent_is_group - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None super(ModifiableDict, self).__init__(input_data["label"], parent) @@ -1568,13 +1477,9 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - self.any_parent_is_group = any_parent_is_group - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None self._child_state = None @@ -1759,13 +1664,9 @@ class DictWidget(ConfigWidget, ConfigObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - self.any_parent_is_group = any_parent_is_group - self.is_group = is_group + self.is_group = input_data.get("is_group", False) self._state = None self._child_state = None @@ -1963,12 +1864,8 @@ class DictInvisible(ConfigWidget, ConfigObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - is_group = input_data.get("is_group", False) - if is_group and any_parent_is_group: - raise SchemeGroupHierarchyBug() - self.any_parent_is_group = any_parent_is_group - self.is_group = is_group + self.is_group = input_data.get("is_group", False) super(DictInvisible, self).__init__(parent) self.setObjectName("DictInvisible") From bb78d47d482afcd494bf27b8822cd05d53c235f2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 20:02:09 +0200 Subject: [PATCH 144/507] implemented discard changes for form layout --- pype/tools/config_setting/config_setting/widgets/inputs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 09174b7c0e..d4806b4a5d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2039,6 +2039,13 @@ class DictFormWidget(ConfigWidget, ConfigObject): return super(DictFormWidget, self).mouseReleaseEvent(event) + def discard_changes(self): + for item in self.input_fields.values(): + item.discard_changes() + + self._is_modified = self.child_modified + self._is_overriden = self._was_overriden + def _on_value_change(self, item=None): if self.ignore_value_changes: return From a295c6420f9756e79e8b9be2005b849049e8f0c5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 20:24:44 +0200 Subject: [PATCH 145/507] removed duplicated keys --- .../1_applications_gui_schema.json | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json index bbf74a8f3f..2e60ed360d 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json @@ -36,18 +36,6 @@ "type": "boolean", "key": "harmony_17", "label": "Harmony 17" - }, { - "type": "boolean", - "key": "houdini_16", - "label": "Houdini 16" - }, { - "type": "boolean", - "key": "houdini_17", - "label": "Houdini 17" - }, { - "type": "boolean", - "key": "houdini_18", - "label": "Houdini 18" }, { "type": "boolean", "key": "maya_2017", @@ -112,6 +100,10 @@ "type": "boolean", "key": "nukestudio_12.0", "label": "NukeStudio 12.0" + }, { + "type": "boolean", + "key": "houdini_16", + "label": "Houdini 16" }, { "type": "boolean", "key": "houdini_16.5", @@ -132,10 +124,6 @@ "type": "boolean", "key": "premiere_2020", "label": "Premiere 2020" - }, { - "type": "boolean", - "key": "premiere_2020", - "label": "Premiere 2020" }, { "type": "boolean", "key": "resolve_16", From 25404fbadceb0e3afe0e7167a3e623ff9de90733 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 26 Aug 2020 20:28:52 +0200 Subject: [PATCH 146/507] implemented validation for duplicated keys --- .../config_setting/widgets/lib.py | 70 ++++++++++++++++++- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index e7173f1c56..fe4e514aaf 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -2,7 +2,7 @@ import os import json import copy from pype.api import config - +from queue import Queue OVERRIDEN_KEY = config.OVERRIDEN_KEY @@ -107,6 +107,21 @@ class SchemeGroupHierarchyBug(Exception): super(SchemeGroupHierarchyBug, self).__init__(msg) +class SchemaDuplicatedKeys(Exception): + def __init__(self, invalid): + items = [] + for key_path, keys in invalid.items(): + joined_keys = ", ".join([ + "\"{}\"".format(key) for key in keys + ]) + items.append("\"{}\" ({})".format(key_path, joined_keys)) + + msg = ( + "Schema items contain duplicated keys in one hierarchy level. {}" + ).format(" || ".join(items)) + super(SchemaDuplicatedKeys, self).__init__(msg) + + def file_keys_from_schema(schema_data): output = [] keys = [] @@ -203,12 +218,63 @@ def validate_is_group_is_unique_in_hierarchy( raise SchemeGroupHierarchyBug(invalid) +def validate_keys_are_unique(schema_data, keys=None): + is_top = keys is None + if keys is None: + keys = [schema_data["key"]] + else: + keys.append(schema_data["key"]) + + children = schema_data.get("children") + if not children: + return + + child_queue = Queue() + for child in children: + child_queue.put(child) + + child_inputs = [] + while not child_queue.empty(): + child = child_queue.get() + if "key" not in child: + _children = child.get("children") or [] + for _child in _children: + child_queue.put(_child) + else: + child_inputs.append(child) + + duplicated_keys = set() + child_keys = set() + for child in child_inputs: + key = child["key"] + if key in child_keys: + duplicated_keys.add(key) + else: + child_keys.add(key) + + invalid = {} + if duplicated_keys: + joined_keys = "/".join(keys) + invalid[joined_keys] = duplicated_keys + + for child in child_inputs: + result = validate_keys_are_unique(child, copy.deepcopy(keys)) + if result: + invalid.update(result) + + if not is_top: + return invalid + + if invalid: + raise SchemaDuplicatedKeys(invalid) + + def validate_schema(schema_data): - # TODO validator for key uniquenes # TODO validator that is_group key is not before is_file child # TODO validator that is_group or is_file is not on child without key validate_all_has_ending_file(schema_data) validate_is_group_is_unique_in_hierarchy(schema_data) + validate_keys_are_unique(schema_data) def gui_schema(subfolder, main_schema_name): From e074bc7733fa9464bbb0abef8f4011f56dcba6b3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 16:01:19 +0200 Subject: [PATCH 147/507] added hovering actions --- .../config_setting/config_setting/style/style.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index c5f1f33500..9478892b60 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -119,16 +119,29 @@ QPushButton[btn-type="expand-toggle"] { border-right-width: 0px; border-top-width: 0px; } +#ExpandingWidget:hover, #ModifiableDict:hover, #DictWidget:hover { + border-color: #62839d; +} + #ExpandingWidget[state="child-modified"], #ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"] { + border-color: #106aa2; +} +#ExpandingWidget[state="child-modified"]:hover, #ModifiableDict[state="child-modified"]:hover, #DictWidget[state="child-modified"]:hover { border-color: #137cbd; } #ExpandingWidget[state="child-overriden"], #ModifiableDict[state="child-overriden"], #DictWidget[state="child-overriden"] { + border-color: #e67300; +} +#ExpandingWidget[state="child-overriden"]:hover, #ModifiableDict[state="child-overriden"]:hover, #DictWidget[state="child-overriden"]:hover { border-color: #ff8c1a; } #ExpandingWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"] { + border-color: #106aa2; +} +#ExpandingWidget[state="child-overriden-modified"]:hover, #ModifiableDict[state="child-overriden-modified"]:hover, #DictWidget[state="child-overriden-modified"]:hover { border-color: #137cbd; } From ae30e3c3befb9fecc32bc823ad52c8229d48f814 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 16:07:06 +0200 Subject: [PATCH 148/507] fixed raw json item value --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d4806b4a5d..8036eb5e1b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -777,6 +777,10 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.updateGeometry() super(RawJsonInput, self).resizeEvent(event) + def item_value(self): + value = self.value() + return json.loads(value) + def value(self): return self.toPlainText() @@ -891,7 +895,7 @@ class RawJsonWidget(ConfigWidget, InputObject): widget.style().polish(widget) def item_value(self): - return self.text_input.toPlainText() + return self.text_input.item_value() class TextListItem(QtWidgets.QWidget, ConfigObject): From b8ea2eea3a153f5abe0624735b445be50a14941c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 16:12:54 +0200 Subject: [PATCH 149/507] fixed text list items --- pype/tools/config_setting/config_setting/widgets/inputs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 8036eb5e1b..67f1ac81ec 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -977,12 +977,13 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): self.override_value = NOT_SET def set_value(self, value, *, global_value=False): - for input_field in self.input_fields: - self.remove_row(input_field) - + previous_inputs = tuple(self.input_fields) for item_text in value: self.add_row(text=item_text) + for input_field in previous_inputs: + self.remove_row(input_field) + if global_value: self.global_value = value self.start_value = self.item_value() From 3c71ae5d2a28546c7e523cf9f3042cc2429ae589 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 16:21:36 +0200 Subject: [PATCH 150/507] raw json works better --- .../config_setting/widgets/inputs.py | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 67f1ac81ec..d800f8c635 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -709,6 +709,7 @@ class TextMultiLineWidget(ConfigWidget, InputObject): class RawJsonInput(QtWidgets.QPlainTextEdit): + value_changed = QtCore.Signal(object) tab_length = 4 def __init__(self, *args, **kwargs): @@ -720,7 +721,9 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): ).horizontalAdvance(" ") * self.tab_length ) + self._state = None self.is_valid = None + self.textChanged.connect(self._on_value_change) def sizeHint(self): document = self.document() @@ -742,13 +745,9 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): value = json.dumps(value, indent=4) self.setPlainText(value) - def setPlainText(self, *args, **kwargs): - super(RawJsonInput, self).setPlainText(*args, **kwargs) - self.validate() - - def focusOutEvent(self, event): - super(RawJsonInput, self).focusOutEvent(event) + def _on_value_change(self): self.validate() + self.value_changed.emit(self) def validate_value(self, value): if isinstance(value, str) and not value: @@ -760,16 +759,18 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): except Exception: return False - def update_style(self, is_valid=None): - if is_valid is None: + def update_style(self): + if self.is_valid is None: return self.validate() - if is_valid != self.is_valid: - self.is_valid = is_valid - if is_valid: - state = "" - else: - state = "invalid" + if self.is_valid: + state = "" + else: + state = "invalid" + + if self._state is None or self._state != state: + self._state = state + self.setProperty("state", state) self.style().polish(self) @@ -778,16 +779,12 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): super(RawJsonInput, self).resizeEvent(event) def item_value(self): - value = self.value() - return json.loads(value) - - def value(self): - return self.toPlainText() + return json.loads(self.toPlainText()) def validate(self): - value = self.value() - is_valid = self.validate_value(value) - self.update_style(is_valid) + value = self.toPlainText() + self.is_valid = self.validate_value(value) + self.update_style() class RawJsonWidget(ConfigWidget, InputObject): @@ -838,7 +835,7 @@ class RawJsonWidget(ConfigWidget, InputObject): self.start_value = self.item_value() self.override_value = NOT_SET - self.text_input.textChanged.connect(self._on_value_change) + self.text_input.value_changed.connect(self._on_value_change) def set_value(self, value, *, global_value=False): self.text_input.set_value(value) @@ -871,7 +868,11 @@ class RawJsonWidget(ConfigWidget, InputObject): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.global_value + if self.text_input.is_valid: + self._is_modified = self.item_value() != self.global_value + else: + self._is_modified = True + if self.is_overidable: self._is_overriden = True From 9af852b0cfd21eb03e9812dffe2fa83fd32e0737 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 16:24:34 +0200 Subject: [PATCH 151/507] invalid looks better --- pype/tools/config_setting/config_setting/style/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 9478892b60..ce014f0768 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -93,7 +93,8 @@ QPushButton[btn-type="expand-toggle"] { } #RawJsonInput[state="invalid"] { - border-left-color: #ff5511; + border-color: #ab2e46; + border-width: 2px; } #DictKey[state="modified"] { From 3fdcff6185771979966f47348e27e25d65f04f78 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 16:28:11 +0200 Subject: [PATCH 152/507] reset state on set value in json raw input --- pype/tools/config_setting/config_setting/widgets/inputs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d800f8c635..6568543799 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -741,6 +741,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): return value def set_value(self, value, *, global_value=False): + self._state = None if not isinstance(value, str): value = json.dumps(value, indent=4) self.setPlainText(value) From 39a1a560aa485a456eb7d4435a6686fdee780f7e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 16:41:45 +0200 Subject: [PATCH 153/507] fixed json files with list inside --- pype/tools/config_setting/config_setting/widgets/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index c0246dd8a2..d5f9a05aea 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -469,7 +469,10 @@ class ProjectWidget(QtWidgets.QWidget): new_values = all_values for key in key_sequence: new_values = new_values[key] - origin_values.update(new_values) + if isinstance(new_values, dict): + origin_values.update(new_values) + else: + origin_values = new_values output_path = os.path.join( config.PROJECT_PRESETS_PATH, subpath From 5fe6a1e25d5e624980dd4d8a7577e04e586f5e5a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 17:08:53 +0200 Subject: [PATCH 154/507] fixed list input --- pype/tools/config_setting/config_setting/widgets/inputs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 6568543799..c7d02471a7 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1096,8 +1096,9 @@ class TextListWidget(ConfigWidget, InputObject): layout.addWidget(label_widget) self.label_widget = label_widget + self.key = input_data["key"] keys = list(parent_keys) - keys.append(input_data["key"]) + keys.append(self.key) self.keys = keys self.value_widget = TextListSubWidget( @@ -1107,7 +1108,7 @@ class TextListWidget(ConfigWidget, InputObject): self.value_widget.value_changed.connect(self._on_value_change) # self.value_widget.se - self.key = input_data["key"] + layout.addWidget(self.value_widget) self.setLayout(layout) @@ -1160,7 +1161,7 @@ class TextListWidget(ConfigWidget, InputObject): self.label_widget.style().polish(self.label_widget) def item_value(self): - return self.value_widget.config_value() + return self.value_widget.item_value() class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): From 66f99b321194493a5933be3fa5ac18adc745daa7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 17:46:41 +0200 Subject: [PATCH 155/507] list item does not have focus on btns --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index c7d02471a7..4cba89f251 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -914,6 +914,8 @@ class TextListItem(QtWidgets.QWidget, ConfigObject): self.text_input = QtWidgets.QLineEdit() self.add_btn = QtWidgets.QPushButton("+") self.remove_btn = QtWidgets.QPushButton("-") + self.add_btn.setFocusPolicy(QtCore.Qt.ClickFocus) + self.remove_btn.setFocusPolicy(QtCore.Qt.ClickFocus) self.add_btn.setProperty("btn-type", "text-list") self.remove_btn.setProperty("btn-type", "text-list") From 893173e1b8511d4f89754c5b53897eade89687e1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 17:46:57 +0200 Subject: [PATCH 156/507] list items has right order --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4cba89f251..d353b6e53e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1037,6 +1037,12 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): self.layout().insertWidget(row, item_widget) self.input_fields.insert(row, item_widget) + previous_input = None + for input_field in self.input_fields: + if previous_input is not None: + self.setTabOrder(previous_input, input_field.text_input) + previous_input = input_field.text_input + # Set text if entered text is not None # else (when add button clicked) trigger `_on_value_change` if text is not None: From 9fbdfcc1cf4a87e2a84ff85c18ff027b3ed7ad60 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 17:50:16 +0200 Subject: [PATCH 157/507] fixed tab order of key->value for modifieble dict item --- pype/tools/config_setting/config_setting/widgets/inputs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d353b6e53e..74505bebca 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1187,7 +1187,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): ItemKlass = TypeToKlass.types[object_type] - self.key_input = QtWidgets.QLineEdit() + self.key_input = QtWidgets.QLineEdit(self) self.key_input.setObjectName("DictKey") self.value_input = ItemKlass( @@ -1200,6 +1200,9 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.add_btn = QtWidgets.QPushButton("+") self.remove_btn = QtWidgets.QPushButton("-") + self.add_btn.setFocusPolicy(QtCore.Qt.ClickFocus) + self.remove_btn.setFocusPolicy(QtCore.Qt.ClickFocus) + self.add_btn.setProperty("btn-type", "text-list") self.remove_btn.setProperty("btn-type", "text-list") From a3b6d64004bb249ab6524e4c3dd4bdfdc68bae07 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 27 Aug 2020 18:22:05 +0200 Subject: [PATCH 158/507] fixed most issues with tab order in modifiable dict --- .../config_setting/widgets/inputs.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 74505bebca..172b93e4ba 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -181,6 +181,9 @@ class BooleanWidget(ConfigWidget, InputObject): layout.setSpacing(5) self.checkbox = QtWidgets.QCheckBox() + + self.setFocusProxy(self.checkbox) + self.checkbox.setAttribute(QtCore.Qt.WA_StyledBackground) if not self._as_widget and not label_widget: label = input_data["label"] @@ -300,6 +303,8 @@ class IntegerWidget(ConfigWidget, InputObject): self.int_input = ModifiedIntSpinBox() + self.setFocusProxy(self.int_input) + if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) @@ -406,6 +411,8 @@ class FloatWidget(ConfigWidget, InputObject): self.float_input = ModifiedFloatSpinBox() + self.setFocusProxy(self.float_input) + decimals = input_data.get("decimals", 5) maximum = input_data.get("maximum") minimum = input_data.get("minimum") @@ -520,6 +527,8 @@ class TextSingleLineWidget(ConfigWidget, InputObject): self.text_input = QtWidgets.QLineEdit() + self.setFocusProxy(self.text_input) + if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) @@ -625,6 +634,9 @@ class TextMultiLineWidget(ConfigWidget, InputObject): layout.setSpacing(5) self.text_input = QtWidgets.QPlainTextEdit() + + self.setFocusProxy(self.text_input) + if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) @@ -813,6 +825,8 @@ class RawJsonWidget(ConfigWidget, InputObject): QtWidgets.QSizePolicy.MinimumExpanding ) + self.setFocusProxy(self.text_input) + if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) @@ -1211,6 +1225,8 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): layout.addWidget(self.add_btn, 0) layout.addWidget(self.remove_btn, 0) + self.setFocusProxy(self.value_input) + self.add_btn.setFixedSize(self._btn_size, self._btn_size) self.remove_btn.setFixedSize(self._btn_size, self._btn_size) self.add_btn.clicked.connect(self.on_add_clicked) @@ -1352,6 +1368,17 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): self.layout().insertWidget(row, item_widget) self.input_fields.insert(row, item_widget) + previous_input = None + for input_field in self.input_fields: + if previous_input is not None: + self.setTabOrder( + previous_input, input_field.key_input + ) + previous_input = input_field.value_input.focusProxy() + self.setTabOrder( + input_field.key_input, previous_input + ) + # Set value if entered value is not None # else (when add button clicked) trigger `_on_value_change` if value is not None and key is not None: From 401d1ad6132d7fd4dcc781150e41ca7785f9a73a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 10:04:04 +0200 Subject: [PATCH 159/507] make sure ignore_value_changes will raise proper error --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 172b93e4ba..050966dd63 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -38,6 +38,10 @@ class ConfigObject: @property def ignore_value_changes(self): + if not hasattr(self, "_parent"): + raise NotImplementedError( + "Object {} does not have `_parent` attribute".format(self) + ) return self._parent.ignore_value_changes @ignore_value_changes.setter From e2061c230f8023e0e150ec65afbb793bb6294248 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 10:04:24 +0200 Subject: [PATCH 160/507] set parenting to real input widgets --- .../config_setting/config_setting/widgets/inputs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 050966dd63..8f4d15912d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -184,7 +184,7 @@ class BooleanWidget(ConfigWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.checkbox = QtWidgets.QCheckBox() + self.checkbox = QtWidgets.QCheckBox(self) self.setFocusProxy(self.checkbox) @@ -305,7 +305,7 @@ class IntegerWidget(ConfigWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.int_input = ModifiedIntSpinBox() + self.int_input = ModifiedIntSpinBox(self) self.setFocusProxy(self.int_input) @@ -413,7 +413,7 @@ class FloatWidget(ConfigWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.float_input = ModifiedFloatSpinBox() + self.float_input = ModifiedFloatSpinBox(self) self.setFocusProxy(self.float_input) @@ -529,7 +529,7 @@ class TextSingleLineWidget(ConfigWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.text_input = QtWidgets.QLineEdit() + self.text_input = QtWidgets.QLineEdit(self) self.setFocusProxy(self.text_input) @@ -637,7 +637,7 @@ class TextMultiLineWidget(ConfigWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.text_input = QtWidgets.QPlainTextEdit() + self.text_input = QtWidgets.QPlainTextEdit(self) self.setFocusProxy(self.text_input) From 3edb2f4080f0bfadbd41732b8f32eec673afe458 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 10:05:30 +0200 Subject: [PATCH 161/507] TextListWidget changed to ListWidget --- .../config_setting/widgets/inputs.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 8f4d15912d..67e44023e7 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1097,7 +1097,7 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): return output -class TextListWidget(ConfigWidget, InputObject): +class ListWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -1109,8 +1109,8 @@ class TextListWidget(ConfigWidget, InputObject): self._state = None - super(TextListWidget, self).__init__(parent) - self.setObjectName("TextListWidget") + super(ListWidget, self).__init__(parent) + self.setObjectName("ListWidget") layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -1127,17 +1127,16 @@ class TextListWidget(ConfigWidget, InputObject): keys.append(self.key) self.keys = keys - self.value_widget = TextListSubWidget( + self.value_widget = ListSubWidget( input_data, values, parent_keys, self ) self.value_widget.setAttribute(QtCore.Qt.WA_StyledBackground) - self.value_widget.value_changed.connect(self._on_value_change) - - # self.value_widget.se layout.addWidget(self.value_widget) self.setLayout(layout) + self.value_widget.value_changed.connect(self._on_value_change) + @property def start_value(self): return self.value_widget.start_value @@ -2178,4 +2177,4 @@ TypeToKlass.types["dict"] = DictWidget TypeToKlass.types["dict-expanding"] = DictExpandWidget TypeToKlass.types["dict-form"] = DictFormWidget TypeToKlass.types["dict-invisible"] = DictInvisible -TypeToKlass.types["list-text"] = TextListWidget +TypeToKlass.types["list"] = ListWidget From 4cfc0a7c1210024c709fe56c3b9cd45548d87731 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 10:06:46 +0200 Subject: [PATCH 162/507] TextListItem changed to ListItem --- .../config_setting/widgets/inputs.py | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 67e44023e7..e10a4a841d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -918,37 +918,50 @@ class RawJsonWidget(ConfigWidget, InputObject): return self.text_input.item_value() -class TextListItem(QtWidgets.QWidget, ConfigObject): +class ListItem(QtWidgets.QWidget, ConfigObject): _btn_size = 20 value_changed = QtCore.Signal(object) - def __init__(self, parent): - super(TextListItem, self).__init__(parent) + def __init__(self, object_type, parent): + self._parent = parent + + super(ListItem, self).__init__(parent) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) - self.text_input = QtWidgets.QLineEdit() + ItemKlass = TypeToKlass.types[object_type] + self.value_input = ItemKlass( + {}, + AS_WIDGET, + [], + self, + None + ) + self.add_btn = QtWidgets.QPushButton("+") self.remove_btn = QtWidgets.QPushButton("-") + self.add_btn.setFocusPolicy(QtCore.Qt.ClickFocus) self.remove_btn.setFocusPolicy(QtCore.Qt.ClickFocus) + self.add_btn.setFixedSize(self._btn_size, self._btn_size) + self.remove_btn.setFixedSize(self._btn_size, self._btn_size) + self.add_btn.setProperty("btn-type", "text-list") self.remove_btn.setProperty("btn-type", "text-list") - layout.addWidget(self.text_input, 1) + layout.addWidget(self.value_input, 1) layout.addWidget(self.add_btn, 0) layout.addWidget(self.remove_btn, 0) - self.add_btn.setFixedSize(self._btn_size, self._btn_size) - self.remove_btn.setFixedSize(self._btn_size, self._btn_size) self.add_btn.clicked.connect(self.on_add_clicked) self.remove_btn.clicked.connect(self.on_remove_clicked) - self.text_input.textChanged.connect(self._on_value_change) + self.value_input.value_changed.connect(self._on_value_change) + self.value_input.item_value() self.is_single = False def _on_value_change(self, item=None): @@ -962,12 +975,12 @@ class TextListItem(QtWidgets.QWidget, ConfigObject): def on_remove_clicked(self): if self.is_single: - self.text_input.setText("") + self.value_input.clear() else: self.parent().remove_row(self) def config_value(self): - return self.text_input.text() + return self.value_input.item_value() class TextListSubWidget(QtWidgets.QWidget, ConfigObject): From d82118cd8e8cc869ca04481d15a88e71fecb0373 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 10:07:06 +0200 Subject: [PATCH 163/507] TextListSubWidget changed to ListSubWidget --- .../config_setting/widgets/inputs.py | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e10a4a841d..2f0d85fd4e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -983,12 +983,14 @@ class ListItem(QtWidgets.QWidget, ConfigObject): return self.value_input.item_value() -class TextListSubWidget(QtWidgets.QWidget, ConfigObject): +class ListSubWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__(self, input_data, values, parent_keys, parent): - super(TextListSubWidget, self).__init__(parent) - self.setObjectName("TextListSubWidget") + self._parent = parent + + super(ListSubWidget, self).__init__(parent) + self.setObjectName("ListSubWidget") layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 5, 0, 5) @@ -996,7 +998,7 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): self.setLayout(layout) self.input_fields = [] - self.add_row() + self.object_type = input_data["object_type"] self.key = input_data["key"] keys = list(parent_keys) @@ -1005,7 +1007,11 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): value = self.value_from_values(values) if value is not NOT_SET: - self.set_value(value) + for item_value in value: + self.add_row(value=item_value) + + if self.count() == 0: + self.add_row() self.global_value = value self.start_value = self.item_value() @@ -1013,8 +1019,8 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): def set_value(self, value, *, global_value=False): previous_inputs = tuple(self.input_fields) - for item_text in value: - self.add_row(text=item_text) + for item_value in value: + self.add_row(value=item_value) for input_field in previous_inputs: self.remove_row(input_field) @@ -1047,9 +1053,9 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): def count(self): return len(self.input_fields) - def add_row(self, row=None, text=None): + def add_row(self, row=None, value=None): # Create new item - item_widget = TextListItem(self) + item_widget = ListItem(self.object_type, self) # Set/unset if new item is single item current_count = self.count() @@ -1071,13 +1077,15 @@ class TextListSubWidget(QtWidgets.QWidget, ConfigObject): previous_input = None for input_field in self.input_fields: if previous_input is not None: - self.setTabOrder(previous_input, input_field.text_input) - previous_input = input_field.text_input + self.setTabOrder( + previous_input, input_field.value_input.focusProxy() + ) + previous_input = input_field.value_input.focusProxy() # Set text if entered text is not None # else (when add button clicked) trigger `_on_value_change` - if text is not None: - item_widget.text_input.setText(text) + if value is not None: + item_widget.value_input.set_value(value, global_value=True) else: self._on_value_change() self.parent().updateGeometry() From 710c97f9a1ee0af00a66c5f0e9cd275b6db21df1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 10:08:25 +0200 Subject: [PATCH 164/507] use "list" instead of "list-text" --- .../projects_schema/1_plugins_gui_schema.json | 12 ++++++++---- .../studio_schema/0_studio_gui_schema.json | 10 +++++----- .../studio_schema/1_intents_gui_schema.json | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index e6582d82b1..9f40c7871b 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -88,7 +88,8 @@ "label": "Note with intent template", "default": "{intent}: {comment}" }, { - "type": "list-text", + "type": "list", + "object_type": "text-singleline", "key": "note_labels", "label": "Note labels", "default": [] @@ -132,12 +133,14 @@ "key": "ffmpeg_args", "children": [ { - "type": "list-text", + "type": "list", + "object_type": "text-singleline", "key": "input", "label": "FFmpeg input arguments", "default": [] }, { - "type": "list-text", + "type": "list", + "object_type": "text-singleline", "key": "output", "label": "FFmpeg output arguments", "default": [] @@ -532,7 +535,8 @@ "label": "Enabled", "default": true }, { - "type": "list-text", + "type": "list", + "object_type": "text-singleline", "key": "tags_addition", "label": "Tags addition", "default": [] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json index 2fd63c7cdc..921122166b 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json @@ -4,8 +4,8 @@ "label": "Studio", "children": [ { - "key": "global", "type": "dict-invisible", + "key": "global", "label": "Global", "children": [{ "type": "schema", @@ -17,15 +17,15 @@ ] }] }, { - "key": "muster", "type": "dict-invisible", + "key": "muster", "children": [{ + "type": "dict-modifiable", + "object_type": "int", "is_group": true, "is_file": true, "key": "templates_mapping", - "label": "Muster - Templates mapping", - "type": "dict-modifiable", - "object_type": "int" + "label": "Muster - Templates mapping" }] } ] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json index 1469ffc5fc..37d525cfb6 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json @@ -7,9 +7,9 @@ "children": [ { "type": "dict-modifiable", + "object_type": "text-singleline", "key": "items", - "label": "Intent Key/Label", - "object_type": "text-singleline" + "label": "Intent Key/Label" }, { "type": "text-singleline", "key": "default", From 98f7be5f9047f25a87b4401ca90573549e1fd667 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:26:16 +0200 Subject: [PATCH 165/507] added log to objects --- .../tools/config_setting/config_setting/widgets/inputs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 2f0d85fd4e..573d66556e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1,4 +1,5 @@ import json +import logging from Qt import QtWidgets, QtCore, QtGui from .widgets import ( ConfigWidget, @@ -14,6 +15,13 @@ class ConfigObject: _is_overriden = False _is_modified = False _was_overriden = False + _log = None + + @property + def log(self): + if self._log is None: + self._log = logging.getLogger(self.__class__.__name__) + return self._log @property def is_modified(self): From 95a68cca5755b56cd00822a21d1e7c353ce6173e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:28:00 +0200 Subject: [PATCH 166/507] child_modified and child_overriden are abstract --- .../config_setting/config_setting/widgets/inputs.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 573d66556e..405ad3502d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -56,6 +56,19 @@ class ConfigObject: def ignore_value_changes(self, value): self._parent.ignore_value_changes = value + @property + def child_modified(self): + """Any children item is modified.""" + raise NotImplementedError( + "{} does not have implemented `child_modified`".format(self) + ) + + @property + def child_overriden(self): + """Any children item is overriden.""" + raise NotImplementedError( + "{} does not have implemented `child_overriden`".format(self) + ) def item_value(self): raise NotImplementedError( "Method `item_value` not implemented!" From 8032a38a1a80cbd52c6f8c008520e5f5cb5eb975 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:28:35 +0200 Subject: [PATCH 167/507] added few docstrings --- .../config_setting/config_setting/widgets/inputs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 405ad3502d..eb713d5fd9 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -25,27 +25,33 @@ class ConfigObject: @property def is_modified(self): + """Has object any changes that require saving.""" return self._is_modified or (self.was_overriden != self.is_overriden) @property def is_overriden(self): + """Is object overriden so should be saved to overrides.""" return self._is_overriden or self._parent.is_overriden @property def was_overriden(self): + """Initial state after applying overrides.""" return self._was_overriden @property def is_overidable(self): + """Should care about overrides.""" return self._parent.is_overidable def any_parent_overriden(self): + """Any of parent object up to top hiearchy is overriden.""" if self._parent._is_overriden: return True return self._parent.any_parent_overriden() @property def ignore_value_changes(self): + """Most of attribute changes are ignored on value change when True.""" if not hasattr(self, "_parent"): raise NotImplementedError( "Object {} does not have `_parent` attribute".format(self) @@ -54,6 +60,7 @@ class ConfigObject: @ignore_value_changes.setter def ignore_value_changes(self, value): + """Setter for global parent item to apply changes for all inputs.""" self._parent.ignore_value_changes = value @property @@ -70,14 +77,17 @@ class ConfigObject: "{} does not have implemented `child_overriden`".format(self) ) def item_value(self): + """Value of an item without key.""" raise NotImplementedError( "Method `item_value` not implemented!" ) def config_value(self): + """Output for saving changes or overrides.""" return {self.key: self.item_value()} def value_from_values(self, values, keys=None): + """Global getter of value based on loaded values.""" if not values or values is AS_WIDGET: return NOT_SET From 1d82c562d0a0717abe3815ec16c6919edfcaf84e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:28:55 +0200 Subject: [PATCH 168/507] added is invalid attribute --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index eb713d5fd9..310717e47a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -15,6 +15,7 @@ class ConfigObject: _is_overriden = False _is_modified = False _was_overriden = False + _is_invalid = False _log = None @property @@ -38,6 +39,11 @@ class ConfigObject: """Initial state after applying overrides.""" return self._was_overriden + @property + def is_invalid(self): + """Value set in is not valid.""" + return self._is_invalid + @property def is_overidable(self): """Should care about overrides.""" From 51ad1d39372fbd2a102d1049c2520e1e313647f0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:36:57 +0200 Subject: [PATCH 169/507] remove line that is not needed --- pype/tools/config_setting/config_setting/widgets/inputs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 310717e47a..b97bde5a2e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -998,7 +998,6 @@ class ListItem(QtWidgets.QWidget, ConfigObject): self.value_input.value_changed.connect(self._on_value_change) - self.value_input.item_value() self.is_single = False def _on_value_change(self, item=None): From 03c1aeac2e31df13c6232a6dc0791c95da63b2b9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:48:20 +0200 Subject: [PATCH 170/507] RawJsonInput is much simpler --- .../config_setting/widgets/inputs.py | 58 +++++-------------- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b97bde5a2e..aacef27f66 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -762,7 +762,6 @@ class TextMultiLineWidget(ConfigWidget, InputObject): class RawJsonInput(QtWidgets.QPlainTextEdit): - value_changed = QtCore.Signal(object) tab_length = 4 def __init__(self, *args, **kwargs): @@ -774,10 +773,6 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): ).horizontalAdvance(" ") * self.tab_length ) - self._state = None - self.is_valid = None - self.textChanged.connect(self._on_value_change) - def sizeHint(self): document = self.document() layout = document.documentLayout() @@ -788,58 +783,35 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): height += layout.blockBoundingRect(block).height() block = block.next() - value = super(RawJsonInput, self).sizeHint() - value.setHeight(height) + hint = super(RawJsonInput, self).sizeHint() + hint.setHeight(height) - return value + return hint def set_value(self, value, *, global_value=False): - self._state = None + if not value or value is NOT_SET: + value = "" if not isinstance(value, str): - value = json.dumps(value, indent=4) + try: + value = json.dumps(value, indent=4) + except Exception: + value = "" self.setPlainText(value) - def _on_value_change(self): - self.validate() - self.value_changed.emit(self) - - def validate_value(self, value): - if isinstance(value, str) and not value: - return True + def json_value(self): + return json.loads(self.toPlainText()) + def has_invalid_value(self): try: - json.loads(value) - return True - except Exception: + self.json_value() return False - - def update_style(self): - if self.is_valid is None: - return self.validate() - - if self.is_valid: - state = "" - else: - state = "invalid" - - if self._state is None or self._state != state: - self._state = state - - self.setProperty("state", state) - self.style().polish(self) + except Exception: + return True def resizeEvent(self, event): self.updateGeometry() super(RawJsonInput, self).resizeEvent(event) - def item_value(self): - return json.loads(self.toPlainText()) - - def validate(self): - value = self.toPlainText() - self.is_valid = self.validate_value(value) - self.update_style() - class RawJsonWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) From 111912cf0fd3097158e71490ae5821e7516b8609 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:49:34 +0200 Subject: [PATCH 171/507] RawJsonWidget modified to be able to handle simpler input --- .../config_setting/widgets/inputs.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index aacef27f66..0a1dd5551b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -858,12 +858,13 @@ class RawJsonWidget(ConfigWidget, InputObject): value = self.value_from_values(values) if value is not NOT_SET: self.text_input.set_value(value) + self._is_invalid = self.text_input.has_invalid_value() self.global_value = value self.start_value = self.item_value() self.override_value = NOT_SET - self.text_input.value_changed.connect(self._on_value_change) + self.text_input.textChanged.connect(self._on_value_change) def set_value(self, value, *, global_value=False): self.text_input.set_value(value) @@ -896,10 +897,11 @@ class RawJsonWidget(ConfigWidget, InputObject): if self.ignore_value_changes: return - if self.text_input.is_valid: - self._is_modified = self.item_value() != self.global_value - else: + self._is_invalid = self.text_input.has_invalid_value() + if self._is_invalid: self._is_modified = True + else: + self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True @@ -924,7 +926,9 @@ class RawJsonWidget(ConfigWidget, InputObject): widget.style().polish(widget) def item_value(self): - return self.text_input.item_value() + if self.is_invalid: + return NOT_SET + return self.text_input.json_value() class ListItem(QtWidgets.QWidget, ConfigObject): From 358362ed6c30e4780a29456bd56504d0d9a9acc8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:50:15 +0200 Subject: [PATCH 172/507] state also works with invalid --- .../config_setting/widgets/inputs.py | 61 +++++++++++++------ 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0a1dd5551b..878ae8f05e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -112,12 +112,15 @@ class ConfigObject: value = value[key] return value - def style_state(self, is_overriden, is_modified): + def style_state(self, is_invalid, is_overriden, is_modified): items = [] - if is_overriden: - items.append("overriden") - if is_modified: - items.append("modified") + if is_invalid: + items.append("invalid") + else: + if is_overriden: + items.append("overriden") + if is_modified: + items.append("modified") return "-".join(items) or self.default_state def add_children_gui(self, child_configuration, values): @@ -306,7 +309,9 @@ class BooleanWidget(ConfigWidget, InputObject): self.value_changed.emit(self) def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -413,7 +418,9 @@ class IntegerWidget(ConfigWidget, InputObject): self.value_changed.emit(self) def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -529,7 +536,9 @@ class FloatWidget(ConfigWidget, InputObject): self.value_changed.emit(self) def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -637,7 +646,9 @@ class TextSingleLineWidget(ConfigWidget, InputObject): self.value_changed.emit(self) def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -743,7 +754,9 @@ class TextMultiLineWidget(ConfigWidget, InputObject): self.value_changed.emit(self) def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -911,7 +924,9 @@ class RawJsonWidget(ConfigWidget, InputObject): self.value_changed.emit(self) def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -1211,7 +1226,9 @@ class ListWidget(ConfigWidget, InputObject): self.update_style() def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -1521,7 +1538,9 @@ class ModifiableDict(ExpandingWidget, InputObject): self.update_style() def update_style(self): - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -1654,7 +1673,9 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): def update_style(self, is_overriden=None): child_modified = self.child_modified - child_state = self.style_state(self.child_overriden, child_modified) + child_state = self.style_state( + self.child_invalid, self.child_overriden, child_modified + ) if child_state: child_state = "child-{}".format(child_state) @@ -1663,7 +1684,9 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): self.style().polish(self) self._child_state = child_state - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return @@ -1856,7 +1879,9 @@ class DictWidget(ConfigWidget, ConfigObject): def update_style(self, is_overriden=None): child_modified = self.child_modified - child_state = self.style_state(self.child_overriden, child_modified) + child_state = self.style_state( + self.child_invalid, self.child_overriden, child_modified + ) if child_state: child_state = "child-{}".format(child_state) @@ -1865,7 +1890,9 @@ class DictWidget(ConfigWidget, ConfigObject): self.style().polish(self) self._child_state = child_state - state = self.style_state(self.is_overriden, self.is_modified) + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) if self._state == state: return From 55175426c48fce8cfecaf00f299eb80579360f0a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 12:50:38 +0200 Subject: [PATCH 173/507] implemented child invalid to be able show them --- .../config_setting/widgets/inputs.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 878ae8f05e..9c515ece8c 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -82,6 +82,14 @@ class ConfigObject: raise NotImplementedError( "{} does not have implemented `child_overriden`".format(self) ) + + @property + def child_invalid(self): + """Any children item does not have valid value.""" + raise NotImplementedError( + "{} does not have implemented `child_invalid`".format(self) + ) + def item_value(self): """Value of an item without key.""" raise NotImplementedError( @@ -201,6 +209,10 @@ class InputObject(ConfigObject): def child_overriden(self): return self._is_overriden + @property + def child_invalid(self): + return self.is_invalid + def reset_children_attributes(self): return @@ -1715,6 +1727,13 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): return True return False + @property + def child_invalid(self): + for input_field in self.input_fields: + if input_field.child_invalid: + return True + return False + def item_value(self): output = {} for input_field in self.input_fields: @@ -1921,6 +1940,13 @@ class DictWidget(ConfigWidget, ConfigObject): return True return False + @property + def child_invalid(self): + for input_field in self.input_fields: + if input_field.child_invalid: + return True + return False + def item_value(self): output = {} for input_field in self.input_fields: @@ -2011,6 +2037,13 @@ class DictInvisible(ConfigWidget, ConfigObject): return True return False + @property + def child_invalid(self): + for input_field in self.input_fields: + if input_field.child_invalid: + return True + return False + def item_value(self): output = {} for input_field in self.input_fields: From 88dd72f76182dddc2d30b513910c5c0b5a383713 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 13:03:20 +0200 Subject: [PATCH 174/507] added hover color to buttons and separated item-tool btn --- pype/tools/config_setting/config_setting/style/style.css | 8 ++++++-- .../tools/config_setting/config_setting/widgets/inputs.py | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index ce014f0768..01e6503e6e 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -65,14 +65,18 @@ QPushButton { border-radius: 3px; padding: 5px; } -QPushButton[btn-type="text-list"] { +QPushButton:hover { + background-color: #31424e; +} +QPushButton[btn-type="tool-item"] { border: 1px solid #bfccd6; border-radius: 10px; } -QPushButton[btn-type="text-list"]:hover { +QPushButton[btn-type="tool-item"]:hover { border-color: #137cbd; color: #137cbd; + background-color: transparent; } QPushButton[btn-type="expand-toggle"] { diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 9c515ece8c..aada384286 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -989,8 +989,8 @@ class ListItem(QtWidgets.QWidget, ConfigObject): self.add_btn.setFixedSize(self._btn_size, self._btn_size) self.remove_btn.setFixedSize(self._btn_size, self._btn_size) - self.add_btn.setProperty("btn-type", "text-list") - self.remove_btn.setProperty("btn-type", "text-list") + self.add_btn.setProperty("btn-type", "tool-item") + self.remove_btn.setProperty("btn-type", "tool-item") layout.addWidget(self.value_input, 1) layout.addWidget(self.add_btn, 0) @@ -1282,8 +1282,8 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.add_btn.setFocusPolicy(QtCore.Qt.ClickFocus) self.remove_btn.setFocusPolicy(QtCore.Qt.ClickFocus) - self.add_btn.setProperty("btn-type", "text-list") - self.remove_btn.setProperty("btn-type", "text-list") + self.add_btn.setProperty("btn-type", "tool-item") + self.remove_btn.setProperty("btn-type", "tool-item") layout.addWidget(self.key_input, 0) layout.addWidget(self.value_input, 1) From dd7772d36881c0f9c7b9454cb786180198e64ce6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 13:03:35 +0200 Subject: [PATCH 175/507] fixed dict widget invalid style --- pype/tools/config_setting/config_setting/widgets/inputs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index aada384286..afe805c69f 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1898,8 +1898,9 @@ class DictWidget(ConfigWidget, ConfigObject): def update_style(self, is_overriden=None): child_modified = self.child_modified + child_invalid = self.child_invalid child_state = self.style_state( - self.child_invalid, self.child_overriden, child_modified + child_invalid, self.child_overriden, child_modified ) if child_state: child_state = "child-{}".format(child_state) @@ -1910,7 +1911,7 @@ class DictWidget(ConfigWidget, ConfigObject): self._child_state = child_state state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + child_invalid, self.is_overriden, self.is_modified ) if self._state == state: return From a05e45acebd2894ffdf0544ba4f84a2acaedbd2c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 13:03:50 +0200 Subject: [PATCH 176/507] added invalid colors to style --- .../config_setting/style/style.css | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 01e6503e6e..c575ed64c3 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -47,6 +47,8 @@ QLabel[state="overriden-modified"] {color: #137cbd;} QLabel[state="overriden-modified"]:hover {color: #1798e8;} QLabel[state="overriden"] {color: #ff8c1a;} QLabel[state="overriden"]:hover {color: #ffa64d;} +QLabel[state="invalid"] {color: #ad2e2e; font-weight: bold;} +QLabel[state="invalid"]:hover {color: #ad2e2e; font-weight: bold;} QWidget[input-state="modified"] { border-color: #137cbd; @@ -60,6 +62,10 @@ QWidget[input-state="overriden"] { border-color: #ff8c1a; } +QWidget[input-state="invalid"] { + border-color: #ad2e2e; +} + QPushButton { border: 1px solid #aaaaaa; border-radius: 3px; @@ -96,20 +102,18 @@ QPushButton[btn-type="expand-toggle"] { font-weight: bold; } -#RawJsonInput[state="invalid"] { - border-color: #ab2e46; - border-width: 2px; -} - #DictKey[state="modified"] { - border-left-color: #137cbd; + border-color: #137cbd; } #DictKey[state="overriden"] { - border-left-color: #00f; + border-color: #00f; } #DictKey[state="overriden-modified"] { - border-left-color: #0f0; + border-color: #0f0; +} +#DictKey[state="invalid"] { + border-color: #ad2e2e; } #DictLabel { @@ -136,6 +140,13 @@ QPushButton[btn-type="expand-toggle"] { border-color: #137cbd; } +#ExpandingWidget[state="child-invalid"], #ModifiableDict[state="child-invalid"], #DictWidget[state="child-invalid"] { + border-color: #ad2e2e; +} +#ExpandingWidget[state="child-invalid"]:hover, #ModifiableDict[state="child-invalid"]:hover, #DictWidget[state="child-invalid"]:hover { + border-color: #c93636; +} + #ExpandingWidget[state="child-overriden"], #ModifiableDict[state="child-overriden"], #DictWidget[state="child-overriden"] { border-color: #e67300; } From 76777790523f77aae9a235d8567a010ce4c9f6f3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:06:41 +0200 Subject: [PATCH 177/507] added methods for getting invalid items --- .../config_setting/config_setting/widgets/inputs.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index afe805c69f..be3a1813d3 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -90,6 +90,12 @@ class ConfigObject: "{} does not have implemented `child_invalid`".format(self) ) + def get_invalid(self): + """Returns invalid items all down the hierarchy.""" + raise NotImplementedError( + "{} does not have implemented `get_invalid`".format(self) + ) + def item_value(self): """Value of an item without key.""" raise NotImplementedError( @@ -213,6 +219,12 @@ class InputObject(ConfigObject): def child_invalid(self): return self.is_invalid + def get_invalid(self): + output = [] + if self.is_invalid: + output.append(self) + return output + def reset_children_attributes(self): return From c8e2963c91b0e467d00ac02ea264442066afe91c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:31:42 +0200 Subject: [PATCH 178/507] basees won't allow save invalid values --- .../config_setting/widgets/base.py | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index d5f9a05aea..34405d2ad0 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -99,6 +99,30 @@ class StudioWidget(QtWidgets.QWidget): self.schema = schema def _save(self): + has_invalid = False + for item in self.input_fields: + if item.child_invalid: + has_invalid = True + + if has_invalid: + invalid_items = [] + for item in self.input_fields: + invalid_items.extend(item.get_invalid()) + msg_box = QtWidgets.QMessageBox( + QtWidgets.QMessageBox.Warning, + "Invalid input", + "There is invalid value in one of inputs." + " Please lead red color and fix them." + ) + msg_box.setStandardButtons(QtWidgets.QMessageBox.Ok) + msg_box.exec_() + + first_invalid_item = invalid_items[0] + self.scroll_widget.ensureWidgetVisible(first_invalid_item) + if first_invalid_item.isVisible(): + first_invalid_item.setFocus(True) + return + all_values = {} for item in self.input_fields: all_values.update(item.config_value()) @@ -401,6 +425,30 @@ class ProjectWidget(QtWidgets.QWidget): self.ignore_value_changes = False def _save(self): + has_invalid = False + for item in self.input_fields: + if item.child_invalid: + has_invalid = True + + if has_invalid: + invalid_items = [] + for item in self.input_fields: + invalid_items.extend(item.get_invalid()) + msg_box = QtWidgets.QMessageBox( + QtWidgets.QMessageBox.Warning, + "Invalid input", + "There is invalid value in one of inputs." + " Please lead red color and fix them." + ) + msg_box.setStandardButtons(QtWidgets.QMessageBox.Ok) + msg_box.exec_() + + first_invalid_item = invalid_items[0] + self.scroll_widget.ensureWidgetVisible(first_invalid_item) + if first_invalid_item.isVisible(): + first_invalid_item.setFocus(True) + return + if self.project_name is None: self._save_defaults() else: From 31227069ffe219f3fad787d974772c1711eb6995 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:45:36 +0200 Subject: [PATCH 179/507] update styles after initialization --- .../config_setting/widgets/base.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 34405d2ad0..283a5ad0a4 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -93,10 +93,10 @@ class StudioWidget(QtWidgets.QWidget): self.input_fields.clear() values = {"studio": config.studio_configurations()} - schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") - self.keys = schema.get("keys", []) - self.add_children_gui(schema, values) - self.schema = schema + self.schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") + self.keys = self.schema.get("keys", []) + self.add_children_gui(self.schema, values) + self.hierarchical_style_update() def _save(self): has_invalid = False @@ -395,10 +395,10 @@ class ProjectWidget(QtWidgets.QWidget): def reset(self): values = {"project": config.global_project_configurations()} - schema = lib.gui_schema("projects_schema", "0_project_gui_schema") - self.keys = schema.get("keys", []) - self.add_children_gui(schema, values) - self.schema = schema + self.schema = lib.gui_schema("projects_schema", "0_project_gui_schema") + self.keys = self.schema.get("keys", []) + self.add_children_gui(self.schema, values) + self.hierarchical_style_update() def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] From de1ed6d639a2dfbbf86343615f80afc302d9d89e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:48:26 +0200 Subject: [PATCH 180/507] added default values to inputs --- .../config_setting/widgets/inputs.py | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index be3a1813d3..7d25880045 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -239,6 +239,7 @@ class BooleanWidget(ConfigWidget, InputObject): self._as_widget = values is AS_WIDGET self.is_group = input_data.get("is_group", False) + self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -268,14 +269,12 @@ class BooleanWidget(ConfigWidget, InputObject): keys = list(parent_keys) keys.append(self.key) self.keys = keys - - default_value = input_data.get("default", NOT_SET) value = self.value_from_values(values) if value is not NOT_SET: self.checkbox.setChecked(value) - elif default_value is not NOT_SET: - self.checkbox.setChecked(default_value) + elif self.default_value is not NOT_SET: + self.checkbox.setChecked(self.default_value) self.global_value = value self.start_value = self.item_value() @@ -362,6 +361,7 @@ class IntegerWidget(ConfigWidget, InputObject): self._as_widget = values is AS_WIDGET self.is_group = input_data.get("is_group", False) + self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -394,6 +394,9 @@ class IntegerWidget(ConfigWidget, InputObject): if value is not NOT_SET: self.int_input.setValue(value) + elif self.default_value is not NOT_SET: + self.int_input.setValue(self.default_value) + self.global_value = value self.start_value = self.item_value() self.override_value = NOT_SET @@ -472,6 +475,7 @@ class FloatWidget(ConfigWidget, InputObject): self._as_widget = values is AS_WIDGET self.is_group = input_data.get("is_group", False) + self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -514,6 +518,9 @@ class FloatWidget(ConfigWidget, InputObject): if value is not NOT_SET: self.float_input.setValue(value) + elif self.default_value is not NOT_SET: + self.float_input.setValue(self.default_value) + self.start_value = self.item_value() self.global_value = value self.override_value = NOT_SET @@ -590,6 +597,7 @@ class TextSingleLineWidget(ConfigWidget, InputObject): self._as_widget = values is AS_WIDGET self.is_group = input_data.get("is_group", False) + self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -622,6 +630,9 @@ class TextSingleLineWidget(ConfigWidget, InputObject): if value is not NOT_SET: self.text_input.setText(value) + elif self.default_value is not NOT_SET: + self.text_input.setText(self.default_value) + self.global_value = value self.start_value = self.item_value() self.override_value = NOT_SET @@ -700,6 +711,7 @@ class TextMultiLineWidget(ConfigWidget, InputObject): self._as_widget = values is AS_WIDGET self.is_group = input_data.get("is_group", False) + self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -732,6 +744,9 @@ class TextMultiLineWidget(ConfigWidget, InputObject): if value is not NOT_SET: self.text_input.setPlainText(value) + elif self.default_value is not NOT_SET: + self.text_input.setPlainText(self.default_value) + self.global_value = value self.start_value = self.item_value() self.override_value = NOT_SET @@ -860,6 +875,7 @@ class RawJsonWidget(ConfigWidget, InputObject): self._as_widget = values is AS_WIDGET self.is_group = input_data.get("is_group", False) + self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -895,6 +911,9 @@ class RawJsonWidget(ConfigWidget, InputObject): value = self.value_from_values(values) if value is not NOT_SET: self.text_input.set_value(value) + + elif self.default_value is not NOT_SET: + self.text_input.set_value(self.default_value) self._is_invalid = self.text_input.has_invalid_value() self.global_value = value @@ -1050,6 +1069,7 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.object_type = input_data["object_type"] + self.default_value = input_data.get("default", NOT_SET) self.key = input_data["key"] keys = list(parent_keys) @@ -1061,6 +1081,10 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): for item_value in value: self.add_row(value=item_value) + elif self.default_value is not NOT_SET: + for item_value in self.default_value: + self.add_row(value=item_value) + if self.count() == 0: self.add_row() @@ -1392,6 +1416,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.object_type = input_data["object_type"] + self.default_value = input_data.get("default", NOT_SET) self.key = input_data["key"] keys = list(parent_keys) @@ -1403,6 +1428,10 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): for item_key, item_value in value.items(): self.add_row(key=item_key, value=item_value) + elif self.default_value is not NOT_SET: + for item_key, item_value in self.default_value.items(): + self.add_row(key=item_key, value=item_value) + if self.count() == 0: self.add_row() From f6839a79530b490fc9fddb576573576f7b64732a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:48:54 +0200 Subject: [PATCH 181/507] implemented get_invalid for dictionaries --- .../config_setting/widgets/inputs.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 7d25880045..e2aa2e01a1 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1775,6 +1775,12 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): return True return False + def get_invalid(self): + output = [] + for input_field in self.input_fields: + output.extend(input_field.get_invalid()) + return output + def item_value(self): output = {} for input_field in self.input_fields: @@ -1989,6 +1995,12 @@ class DictWidget(ConfigWidget, ConfigObject): return True return False + def get_invalid(self): + output = [] + for input_field in self.input_fields: + output.extend(input_field.get_invalid()) + return output + def item_value(self): output = {} for input_field in self.input_fields: @@ -2086,6 +2098,12 @@ class DictInvisible(ConfigWidget, ConfigObject): return True return False + def get_invalid(self): + output = [] + for input_field in self.input_fields: + output.extend(input_field.get_invalid()) + return output + def item_value(self): output = {} for input_field in self.input_fields: @@ -2249,6 +2267,19 @@ class DictFormWidget(ConfigWidget, ConfigObject): return True return False + @property + def child_invalid(self): + for input_field in self.input_fields.values(): + if input_field.child_invalid: + return True + return False + + def get_invalid(self): + output = [] + for input_field in self.input_fields.values(): + output.extend(input_field.get_invalid()) + return output + def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] key = child_configuration["key"] From 2dc39e276f1961a9c58aff1d3d3c03791d73c6dd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:49:43 +0200 Subject: [PATCH 182/507] set is modified on input init --- .../config_setting/widgets/inputs.py | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e2aa2e01a1..20ccf20290 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -276,9 +276,11 @@ class BooleanWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.checkbox.setChecked(self.default_value) + self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value self.checkbox.stateChanged.connect(self._on_value_change) @@ -397,9 +399,11 @@ class IntegerWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.int_input.setValue(self.default_value) + self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value self.int_input.valueChanged.connect(self._on_value_change) @@ -521,9 +525,11 @@ class FloatWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.float_input.setValue(self.default_value) + self.override_value = NOT_SET self.start_value = self.item_value() self.global_value = value - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value self.float_input.valueChanged.connect(self._on_value_change) @@ -633,9 +639,11 @@ class TextSingleLineWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.text_input.setText(self.default_value) + self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value self.text_input.textChanged.connect(self._on_value_change) @@ -747,9 +755,11 @@ class TextMultiLineWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.text_input.setPlainText(self.default_value) + self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value self.text_input.textChanged.connect(self._on_value_change) @@ -916,9 +926,11 @@ class RawJsonWidget(ConfigWidget, InputObject): self.text_input.set_value(self.default_value) self._is_invalid = self.text_input.has_invalid_value() + self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value self.text_input.textChanged.connect(self._on_value_change) @@ -1088,9 +1100,11 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): if self.count() == 0: self.add_row() + self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value def set_value(self, value, *, global_value=False): previous_inputs = tuple(self.input_fields) @@ -1435,9 +1449,12 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): if self.count() == 0: self.add_row() + self.override_value = NOT_SET + self.global_value = value self.start_value = self.config_value() - self.override_value = NOT_SET + + self._is_modified = self.global_value != self.start_value @property def is_group(self): @@ -1555,8 +1572,11 @@ class ModifiableDict(ExpandingWidget, InputObject): self.key = input_data["key"] - self.global_value = self.item_value() self.override_value = NOT_SET + self.start_value = self.value_widget.start_value + self.global_value = self.value_widget.global_value + + self._is_modified = self.global_value != self.start_value def _on_value_change(self, item=None): if self.ignore_value_changes: From 61e11552667839bbe9b53f7ddcf8f059bd0fa6dd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:50:05 +0200 Subject: [PATCH 183/507] rawjson set's invalid bool even if values changes are ignored --- pype/tools/config_setting/config_setting/widgets/inputs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 20ccf20290..9fcbd20454 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -962,6 +962,7 @@ class RawJsonWidget(ConfigWidget, InputObject): self.update_style() def _on_value_change(self, item=None): + self._is_invalid = self.text_input.has_invalid_value() if self.ignore_value_changes: return @@ -1064,7 +1065,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def config_value(self): return self.value_input.item_value() - +# TODO Move subwidget to main widget class ListSubWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) From ad69ee3e4b9179da221b39de05c2248a39874296 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 16:59:55 +0200 Subject: [PATCH 184/507] allow empty objects in raw json --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 9fcbd20454..b290927ed1 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -851,9 +851,9 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): return hint def set_value(self, value, *, global_value=False): - if not value or value is NOT_SET: + if value is NOT_SET: value = "" - if not isinstance(value, str): + elif not isinstance(value, str): try: value = json.dumps(value, indent=4) except Exception: From 24ab3fcaad29b380fa854b2ac524f085bbd3b15a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 17:00:17 +0200 Subject: [PATCH 185/507] added few default values --- .../projects_schema/1_plugins_gui_schema.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 9f40c7871b..dbbcaf2b36 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -81,7 +81,8 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled" + "label": "Enabled", + "default": true }, { "type": "text-singleline", "key": "note_with_intent_template", @@ -157,11 +158,13 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled" + "label": "Enabled", + "default": true }, { "type": "raw-json", "key": "profiles", - "label": "Profiles" + "label": "Profiles", + "default": [] } ] }, { From 81a433941f1b7adbb4281157d7d1f8f76566f6e1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 17:04:11 +0200 Subject: [PATCH 186/507] modified default min/max for number inputs --- pype/tools/config_setting/config_setting/widgets/widgets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 89f6782cfd..c2de371ffc 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -5,6 +5,8 @@ class ModifiedIntSpinBox(QtWidgets.QSpinBox): def __init__(self, *args, **kwargs): super(ModifiedIntSpinBox, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) + self.setMinimum(-99999) + self.setMaximum(99999) def wheelEvent(self, event): if self.hasFocus(): @@ -17,6 +19,8 @@ class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): def __init__(self, *args, **kwargs): super(ModifiedFloatSpinBox, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) + self.setMinimum(-99999) + self.setMaximum(99999) def wheelEvent(self, event): if self.hasFocus(): From a910969c02b1e3488e4432b9c02fe62d3018df39 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 17:08:44 +0200 Subject: [PATCH 187/507] default number are settable by kwargs --- .../config_setting/widgets/widgets.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index c2de371ffc..0b493d307d 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -3,10 +3,12 @@ from Qt import QtWidgets, QtCore, QtGui class ModifiedIntSpinBox(QtWidgets.QSpinBox): def __init__(self, *args, **kwargs): + min_value = kwargs.pop("min", -99999) + max_value = kwargs.pop("max", 99999) super(ModifiedIntSpinBox, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) - self.setMinimum(-99999) - self.setMaximum(99999) + self.setMinimum(min_value) + self.setMaximum(max_value) def wheelEvent(self, event): if self.hasFocus(): @@ -17,10 +19,14 @@ class ModifiedIntSpinBox(QtWidgets.QSpinBox): class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): def __init__(self, *args, **kwargs): + min_value = kwargs.pop("min", -99999) + max_value = kwargs.pop("max", 99999) + decimals = kwargs.pop("decimal", 2) super(ModifiedFloatSpinBox, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) - self.setMinimum(-99999) - self.setMaximum(99999) + self.setDecimals(decimals) + self.setMinimum(min_value) + self.setMaximum(max_value) def wheelEvent(self, event): if self.hasFocus(): From 0fb411cff071d383d0219a83bdf75e99ccb8f9e0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 17:15:10 +0200 Subject: [PATCH 188/507] added modifiers for number inputs --- .../studio_schema/1_tray_items.json | 4 +++- .../config_setting/widgets/inputs.py | 16 ++++++++++++++-- .../config_setting/widgets/widgets.py | 8 ++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json index e6f9a41e51..45b1bc65ce 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -69,7 +69,9 @@ { "type": "int", "key": "default_port", - "label": "Default Port" + "label": "Default Port", + "minimum": 1, + "maximum": 65535 } ] }, { diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b290927ed1..4136069d6a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -355,6 +355,7 @@ class BooleanWidget(ConfigWidget, InputObject): class IntegerWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) + input_modifiers = ("minimum", "maximum") def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -373,7 +374,12 @@ class IntegerWidget(ConfigWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.int_input = ModifiedIntSpinBox(self) + kwargs = { + modifier: input_data.get(modifier) + for modifier in self.input_modifiers + if input_data.get(modifier) + } + self.int_input = ModifiedIntSpinBox(self, **kwargs) self.setFocusProxy(self.int_input) @@ -471,6 +477,7 @@ class IntegerWidget(ConfigWidget, InputObject): class FloatWidget(ConfigWidget, InputObject): value_changed = QtCore.Signal(object) + input_modifiers = ("minimum", "maximum", "decimal") def __init__( self, input_data, values, parent_keys, parent, label_widget=None @@ -489,7 +496,12 @@ class FloatWidget(ConfigWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.float_input = ModifiedFloatSpinBox(self) + kwargs = { + modifier: input_data.get(modifier) + for modifier in self.input_modifiers + if input_data.get(modifier) + } + self.float_input = ModifiedFloatSpinBox(self, **kwargs) self.setFocusProxy(self.float_input) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 0b493d307d..b824ea8720 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -3,8 +3,8 @@ from Qt import QtWidgets, QtCore, QtGui class ModifiedIntSpinBox(QtWidgets.QSpinBox): def __init__(self, *args, **kwargs): - min_value = kwargs.pop("min", -99999) - max_value = kwargs.pop("max", 99999) + min_value = kwargs.pop("minimum", -99999) + max_value = kwargs.pop("maximum", 99999) super(ModifiedIntSpinBox, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) self.setMinimum(min_value) @@ -19,8 +19,8 @@ class ModifiedIntSpinBox(QtWidgets.QSpinBox): class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): def __init__(self, *args, **kwargs): - min_value = kwargs.pop("min", -99999) - max_value = kwargs.pop("max", 99999) + min_value = kwargs.pop("minimum", -99999) + max_value = kwargs.pop("maximum", 99999) decimals = kwargs.pop("decimal", 2) super(ModifiedFloatSpinBox, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) From 95aa493aaf5f35cf8db77ccd2f0190a081d2f6a9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 17:21:51 +0200 Subject: [PATCH 189/507] added possibility of input modifier for list and modifiable dict --- .../studio_schema/0_studio_gui_schema.json | 4 ++++ .../config_setting/widgets/inputs.py | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json index 921122166b..db465fb392 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json @@ -22,6 +22,10 @@ "children": [{ "type": "dict-modifiable", "object_type": "int", + "input_modifiers": { + "minimum": 0, + "maximum": 300 + }, "is_group": true, "is_file": true, "key": "templates_mapping", diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4136069d6a..35b8719bb6 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -11,6 +11,8 @@ from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass class ConfigObject: + input_modifiers = tuple() + default_state = "" _is_overriden = False _is_modified = False @@ -1018,7 +1020,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): _btn_size = 20 value_changed = QtCore.Signal(object) - def __init__(self, object_type, parent): + def __init__(self, object_type, input_modifiers, parent): self._parent = parent super(ListItem, self).__init__(parent) @@ -1029,7 +1031,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): ItemKlass = TypeToKlass.types[object_type] self.value_input = ItemKlass( - {}, + input_modifiers, AS_WIDGET, [], self, @@ -1077,6 +1079,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def config_value(self): return self.value_input.item_value() + # TODO Move subwidget to main widget class ListSubWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) @@ -1095,6 +1098,7 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) + self.input_modifiers = input_data.get("input_modifiers") or {} self.key = input_data["key"] keys = list(parent_keys) @@ -1157,7 +1161,7 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): def add_row(self, row=None, value=None): # Create new item - item_widget = ListItem(self.object_type, self) + item_widget = ListItem(self.object_type, self.input_modifiers, self) # Set/unset if new item is single item current_count = self.count() @@ -1318,7 +1322,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): _btn_size = 20 value_changed = QtCore.Signal(object) - def __init__(self, object_type, parent): + def __init__(self, object_type, input_modifiers, parent): self._parent = parent super(ModifiableDictItem, self).__init__(parent) @@ -1333,7 +1337,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.key_input.setObjectName("DictKey") self.value_input = ItemKlass( - {}, + input_modifiers, AS_WIDGET, [], self, @@ -1444,6 +1448,7 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) + self.input_modifiers = input_data.get("input_modifiers") or {} self.key = input_data["key"] keys = list(parent_keys) @@ -1485,7 +1490,9 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): def add_row(self, row=None, key=None, value=None): # Create new item - item_widget = ModifiableDictItem(self.object_type, self) + item_widget = ModifiableDictItem( + self.object_type, self.input_modifiers, self + ) # Set/unset if new item is single item current_count = self.count() From 7a382f3f2073fdbe34982b50781ad22f3054bc8c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 28 Aug 2020 17:22:51 +0200 Subject: [PATCH 190/507] removed global input_modifiers = tuple() --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 35b8719bb6..e5a63e635a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -11,8 +11,6 @@ from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass class ConfigObject: - input_modifiers = tuple() - default_state = "" _is_overriden = False _is_modified = False From f76331207cec10b3476b8f9dcdb5024d82e25f48 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 10:02:06 +0200 Subject: [PATCH 191/507] fixed json overrides on project change --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e5a63e635a..244d3642ae 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -965,9 +965,11 @@ class RawJsonWidget(ConfigWidget, InputObject): self.override_value = override_value if override_value is NOT_SET: self._is_overriden = False + self._was_overriden = False value = self.start_value else: self._is_overriden = True + self._was_overriden = True value = override_value self.set_value(value) @@ -981,6 +983,8 @@ class RawJsonWidget(ConfigWidget, InputObject): self._is_invalid = self.text_input.has_invalid_value() if self._is_invalid: self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value else: self._is_modified = self.item_value() != self.global_value From 0797edccfd0e65e1e0d5712d853c99c2cf5a1f8b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 10:02:32 +0200 Subject: [PATCH 192/507] overrides are loaded with metadatakey --- pype/tools/config_setting/config_setting/widgets/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 283a5ad0a4..fd558e1ea3 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -412,12 +412,13 @@ class ProjectWidget(QtWidgets.QWidget): def _on_project_change(self): project_name = self.project_list_widget.project_name() if project_name is None: - overrides = lib.NOT_SET + _overrides = lib.NOT_SET self.is_overidable = False else: - overrides = config.project_configurations_overrides(project_name) + _overrides = config.project_configurations_overrides(project_name) self.is_overidable = True + overrides = lib.convert_overrides_to_gui_data(_overrides) self.project_name = project_name self.ignore_value_changes = True for item in self.input_fields: From de0e9f2effe964ab54bdfc53e4634178ca3f7db1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 10:02:51 +0200 Subject: [PATCH 193/507] project overrides cancel modifcation changes on save --- pype/tools/config_setting/config_setting/widgets/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index fd558e1ea3..b412db5308 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -454,6 +454,7 @@ class ProjectWidget(QtWidgets.QWidget): self._save_defaults() else: self._save_overrides() + self._on_project_change() def _save_overrides(self): _data = {} From 6ea8b1ef051831f211c1e90a1aa06f34f150dba4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 10:03:00 +0200 Subject: [PATCH 194/507] changed default for few plugins --- .../projects_schema/1_plugins_gui_schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index dbbcaf2b36..c70daab32c 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -82,7 +82,7 @@ "type": "boolean", "key": "enabled", "label": "Enabled", - "default": true + "default": false }, { "type": "text-singleline", "key": "note_with_intent_template", @@ -397,7 +397,7 @@ "type": "boolean", "key": "enabled", "label": "Enabled", - "default": false + "default": true }, { "type": "raw-json", "key": "nodes", From 78a336939e1b45a32ff8623de57bcec11d8b1b2f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 10:11:09 +0200 Subject: [PATCH 195/507] added possibility to have expanded expandable dict by default --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 244d3642ae..b2b3b3990b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1690,6 +1690,10 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): self.set_content_widget(content_widget) + expanded = input_data.get("expanded", False) + if expanded: + self.toggle_content() + self.setAttribute(QtCore.Qt.WA_StyledBackground) self.content_widget = content_widget From 1bbfae31f9f7b2b25b46b7359fa7a4fe6f7ab028 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 11:05:57 +0200 Subject: [PATCH 196/507] added update_global_values method --- .../config_setting/widgets/inputs.py | 124 ++++++++++++++---- 1 file changed, 97 insertions(+), 27 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b2b3b3990b..950fdb5bf8 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -262,13 +262,22 @@ class BooleanWidget(ConfigWidget, InputObject): layout.addWidget(self.checkbox, 1) - value = NOT_SET if not self._as_widget: self.label_widget = label_widget + self.key = input_data["key"] keys = list(parent_keys) keys.append(self.key) self.keys = keys + + self.update_global_values(values) + self.override_value = NOT_SET + + self.checkbox.stateChanged.connect(self._on_value_change) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: value = self.value_from_values(values) if value is not NOT_SET: self.checkbox.setChecked(value) @@ -276,14 +285,11 @@ class BooleanWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.checkbox.setChecked(self.default_value) - self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value - self.checkbox.stateChanged.connect(self._on_value_change) - def set_value(self, value, *, global_value=False): # Ignore value change because if `self.isChecked()` has same # value as `value` the `_on_value_change` is not triggered @@ -389,7 +395,6 @@ class IntegerWidget(ConfigWidget, InputObject): layout.addWidget(label_widget, 0) layout.addWidget(self.int_input, 1) - value = NOT_SET if not self._as_widget: self.label_widget = label_widget @@ -398,6 +403,15 @@ class IntegerWidget(ConfigWidget, InputObject): keys.append(self.key) self.keys = keys + self.update_global_values(values) + + self.override_value = NOT_SET + + self.int_input.valueChanged.connect(self._on_value_change) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: value = self.value_from_values(values) if value is not NOT_SET: self.int_input.setValue(value) @@ -405,14 +419,11 @@ class IntegerWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.int_input.setValue(self.default_value) - self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value - self.int_input.valueChanged.connect(self._on_value_change) - def set_value(self, value, *, global_value=False): self.int_input.setValue(value) if global_value: @@ -521,7 +532,6 @@ class FloatWidget(ConfigWidget, InputObject): layout.addWidget(label_widget, 0) layout.addWidget(self.float_input, 1) - value = NOT_SET if not self._as_widget: self.label_widget = label_widget @@ -530,6 +540,15 @@ class FloatWidget(ConfigWidget, InputObject): keys.append(self.key) self.keys = keys + self.update_global_values(values) + + self.override_value = NOT_SET + + self.float_input.valueChanged.connect(self._on_value_change) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: value = self.value_from_values(values) if value is not NOT_SET: self.float_input.setValue(value) @@ -537,14 +556,11 @@ class FloatWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.float_input.setValue(self.default_value) - self.override_value = NOT_SET - self.start_value = self.item_value() self.global_value = value + self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value - self.float_input.valueChanged.connect(self._on_value_change) - def set_value(self, value, *, global_value=False): self.float_input.setValue(value) if global_value: @@ -635,7 +651,6 @@ class TextSingleLineWidget(ConfigWidget, InputObject): layout.addWidget(label_widget, 0) layout.addWidget(self.text_input, 1) - value = NOT_SET if not self._as_widget: self.label_widget = label_widget @@ -644,6 +659,15 @@ class TextSingleLineWidget(ConfigWidget, InputObject): keys.append(self.key) self.keys = keys + self.update_global_values(values) + + self.override_value = NOT_SET + + self.text_input.textChanged.connect(self._on_value_change) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: value = self.value_from_values(values) if value is not NOT_SET: self.text_input.setText(value) @@ -651,14 +675,11 @@ class TextSingleLineWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.text_input.setText(self.default_value) - self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value - self.text_input.textChanged.connect(self._on_value_change) - def set_value(self, value, *, global_value=False): self.text_input.setText(value) if global_value: @@ -751,7 +772,6 @@ class TextMultiLineWidget(ConfigWidget, InputObject): layout.addWidget(label_widget, 0) layout.addWidget(self.text_input, 1) - value = NOT_SET if not self._as_widget: self.label_widget = label_widget @@ -760,6 +780,15 @@ class TextMultiLineWidget(ConfigWidget, InputObject): keys.append(self.key) self.keys = keys + self.update_global_values(values) + + self.override_value = NOT_SET + + self.text_input.textChanged.connect(self._on_value_change) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: value = self.value_from_values(values) if value is not NOT_SET: self.text_input.setPlainText(value) @@ -767,14 +796,11 @@ class TextMultiLineWidget(ConfigWidget, InputObject): elif self.default_value is not NOT_SET: self.text_input.setPlainText(self.default_value) - self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value - self.text_input.textChanged.connect(self._on_value_change) - def set_value(self, value, *, global_value=False): self.text_input.setPlainText(value) if global_value: @@ -921,7 +947,8 @@ class RawJsonWidget(ConfigWidget, InputObject): layout.addWidget(label_widget, 0) layout.addWidget(self.text_input, 1) - value = NOT_SET + self.override_value = NOT_SET + if not self._as_widget: self.label_widget = label_widget @@ -930,22 +957,27 @@ class RawJsonWidget(ConfigWidget, InputObject): keys.append(self.key) self.keys = keys + self.update_global_values(values) + + self.text_input.textChanged.connect(self._on_value_change) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: value = self.value_from_values(values) if value is not NOT_SET: self.text_input.set_value(value) elif self.default_value is not NOT_SET: self.text_input.set_value(self.default_value) + self._is_invalid = self.text_input.has_invalid_value() - self.override_value = NOT_SET self.global_value = value self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value - self.text_input.textChanged.connect(self._on_value_change) - def set_value(self, value, *, global_value=False): self.text_input.set_value(value) if global_value: @@ -1107,6 +1139,13 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): keys.append(self.key) self.keys = keys + self.update_global_values(values) + + self.override_value = NOT_SET + + def update_global_values(self, values): + old_inputs = tuple(self.input_fields) + value = self.value_from_values(values) if value is not NOT_SET: for item_value in value: @@ -1119,7 +1158,9 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): if self.count() == 0: self.add_row() - self.override_value = NOT_SET + for old_input in old_inputs: + self.remove_row(old_input) + self.global_value = value self.start_value = self.item_value() @@ -1266,6 +1307,9 @@ class ListWidget(ConfigWidget, InputObject): self.value_widget.value_changed.connect(self._on_value_change) + def update_global_values(self, values): + self.value_widget.update_global_values(values) + @property def start_value(self): return self.value_widget.start_value @@ -1433,6 +1477,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): return {key: value} +# TODO Move subwidget to main widget class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) @@ -1457,6 +1502,11 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): keys.append(self.key) self.keys = keys + self.update_global_values(values) + + def update_global_values(self, values): + old_inputs = tuple(self.input_fields) + value = self.value_from_values(values) if value is not NOT_SET: for item_key, item_value in value.items(): @@ -1469,7 +1519,8 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): if self.count() == 0: self.add_row() - self.override_value = NOT_SET + for old_input in old_inputs: + self.remove_row(old_input) self.global_value = value self.start_value = self.config_value() @@ -1600,6 +1651,9 @@ class ModifiableDict(ExpandingWidget, InputObject): self._is_modified = self.global_value != self.start_value + def update_global_values(self, values): + self.value_widget.update_global_values(values) + def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1723,6 +1777,10 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def update_global_values(self, values): + for item in self.input_fields: + item.update_global_values(values) + def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False @@ -1943,6 +2001,10 @@ class DictWidget(ConfigWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def update_global_values(self, values): + for item in self.input_fields: + item.update_global_values(values) + def apply_overrides(self, override_value): # Make sure this is set to False self._is_overriden = False @@ -2207,6 +2269,10 @@ class DictInvisible(ConfigWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def update_global_values(self, values): + for item in self.input_fields: + item.update_global_values(values) + def apply_overrides(self, override_value): self._is_overriden = False for item in self.input_fields: @@ -2294,6 +2360,10 @@ class DictFormWidget(ConfigWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def update_global_values(self, values): + for item in self.input_fields.values(): + item.update_global_values(values) + def _on_value_change(self, item=None): if self.ignore_value_changes: return From 66d65e85105adfc79e176d04605775d3d8a345e1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 11:19:41 +0200 Subject: [PATCH 197/507] global values are updated on save --- .../config_setting/widgets/base.py | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index b412db5308..afcac74555 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -165,6 +165,16 @@ class StudioWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(origin_values, file_stream, indent=4) + self._update_global_values() + + def _update_global_values(self): + values = {"studio": config.studio_configurations()} + for input_field in self.input_fields: + input_field.update_global_values(values) + + for input_field in self.input_fields: + input_field.hierarchical_style_update() + def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] klass = lib.TypeToKlass.types.get(item_type) @@ -454,7 +464,6 @@ class ProjectWidget(QtWidgets.QWidget): self._save_defaults() else: self._save_overrides() - self._on_project_change() def _save_overrides(self): _data = {} @@ -481,6 +490,8 @@ class ProjectWidget(QtWidgets.QWidget): with open(overrides_json_path, "w") as file_stream: json.dump(output_data, file_stream, indent=4) + self._on_project_change() + def _save_defaults(self): output = {} for item in self.input_fields: @@ -534,3 +545,13 @@ class ProjectWidget(QtWidgets.QWidget): print("Saving data to: ", output_path) with open(output_path, "w") as file_stream: json.dump(origin_values, file_stream, indent=4) + + self._update_global_values() + + def _update_global_values(self): + values = {"project": config.global_project_configurations()} + for input_field in self.input_fields: + input_field.update_global_values(values) + + for input_field in self.input_fields: + input_field.hierarchical_style_update() From b0375abaddf98c569a22e93390b9471047909773 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 15:01:16 +0200 Subject: [PATCH 198/507] removed update_style --- .../config_setting/config_setting/widgets/inputs.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 950fdb5bf8..4df9bb2736 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -317,7 +317,6 @@ class BooleanWidget(ConfigWidget, InputObject): value = override_value self.set_value(value) - self.update_style() def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -451,7 +450,6 @@ class IntegerWidget(ConfigWidget, InputObject): value = override_value self.set_value(value) - self.update_style() def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -583,7 +581,6 @@ class FloatWidget(ConfigWidget, InputObject): value = override_value self.set_value(value) - self.update_style() def clear_value(self): self.set_value(0) @@ -704,7 +701,6 @@ class TextSingleLineWidget(ConfigWidget, InputObject): value = override_value self.set_value(value) - self.update_style() def clear_value(self): self.set_value("") @@ -823,7 +819,6 @@ class TextMultiLineWidget(ConfigWidget, InputObject): value = override_value self.set_value(value) - self.update_style() def clear_value(self): self.set_value("") @@ -1005,7 +1000,6 @@ class RawJsonWidget(ConfigWidget, InputObject): value = override_value self.set_value(value) - self.update_style() def _on_value_change(self, item=None): self._is_invalid = self.text_input.has_invalid_value() @@ -1348,7 +1342,6 @@ class ListWidget(ConfigWidget, InputObject): self.value_widget.apply_overrides(override_value) self._is_modified = False self._state = None - self.update_style() def update_style(self): state = self.style_state( @@ -1684,7 +1677,6 @@ class ModifiableDict(ExpandingWidget, InputObject): value = override_value self.set_value(value) - self.update_style() def update_style(self): state = self.style_state( @@ -1803,7 +1795,6 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): ) ) self._was_overriden = bool(self._is_overriden) - self.update_style() def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -2026,7 +2017,7 @@ class DictWidget(ConfigWidget, ConfigObject): or self.child_overriden ) ) - self.update_style() + self._was_overriden = bool(self._is_overriden) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -2290,7 +2281,7 @@ class DictInvisible(ConfigWidget, ConfigObject): or self.child_overriden ) ) - self.update_style() + self._was_overriden = bool(self._is_overriden) def overrides(self): if not self.is_overriden and not self.child_overriden: From 084d9a9a116bc830daf103c4abe9e218da77be10 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 15:02:16 +0200 Subject: [PATCH 199/507] implemented override_value_from_values for override values --- .../config_setting/widgets/inputs.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4df9bb2736..80cb168fda 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -126,6 +126,39 @@ class ConfigObject: value = value[key] return value + def override_value_from_values(self, values, keys=None): + """Global getter of value based on loaded values.""" + if not values or values is AS_WIDGET: + return NOT_SET + + if keys is None: + keys = self.keys + + value = values + if not keys: + return value, False + + parent_value = None + last_key = None + for key in keys: + if not isinstance(value, dict): + raise TypeError( + "Expected dictionary got {}.".format(str(type(value))) + ) + if key not in value: + return NOT_SET, False + + parent_value = value + last_key = key + value = value[key] + + if not parent_value: + return value, False + + metadata = parent_value.get(METADATA_KEY) or {} + groups = metadata.get("group") or tuple() + return value, last_key in groups + def style_state(self, is_invalid, is_overriden, is_modified): items = [] if is_invalid: From 077f5c7163a7bbeea63f8cbcec9b278a27ba1927 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 16:17:56 +0200 Subject: [PATCH 200/507] different logic for applying overrides --- .../config_setting/widgets/base.py | 2 +- .../config_setting/widgets/inputs.py | 276 ++++++------------ 2 files changed, 96 insertions(+), 182 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index afcac74555..9c1fee5b6f 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -428,7 +428,7 @@ class ProjectWidget(QtWidgets.QWidget): _overrides = config.project_configurations_overrides(project_name) self.is_overidable = True - overrides = lib.convert_overrides_to_gui_data(_overrides) + overrides = {"project": lib.convert_overrides_to_gui_data(_overrides)} self.project_name = project_name self.ignore_value_changes = True for item in self.input_fields: diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 80cb168fda..3eeea4df6a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -126,39 +126,6 @@ class ConfigObject: value = value[key] return value - def override_value_from_values(self, values, keys=None): - """Global getter of value based on loaded values.""" - if not values or values is AS_WIDGET: - return NOT_SET - - if keys is None: - keys = self.keys - - value = values - if not keys: - return value, False - - parent_value = None - last_key = None - for key in keys: - if not isinstance(value, dict): - raise TypeError( - "Expected dictionary got {}.".format(str(type(value))) - ) - if key not in value: - return NOT_SET, False - - parent_value = value - last_key = key - value = value[key] - - if not parent_value: - return value, False - - metadata = parent_value.get(METADATA_KEY) or {} - groups = metadata.get("group") or tuple() - return value, last_key in groups - def style_state(self, is_invalid, is_overriden, is_modified): items = [] if is_invalid: @@ -222,6 +189,28 @@ class InputObject(ConfigObject): self._is_modified = False self._was_overriden = False + def apply_overrides(self, parent_values): + self._is_modified = False + self._state = None + + if parent_values is NOT_SET or self.key not in parent_values: + override_value = NOT_SET + else: + override_value = parent_values[self.key] + + self.override_value = override_value + + if override_value is NOT_SET: + self._is_overriden = False + self._was_overriden = False + value = self.start_value + else: + self._is_overriden = True + self._was_overriden = True + value = override_value + + self.set_value(value) + def discard_changes(self): if ( self.is_overidable @@ -336,21 +325,6 @@ class BooleanWidget(ConfigWidget, InputObject): def clear_value(self): self.set_value(False) - def apply_overrides(self, override_value): - self._is_modified = False - self._state = None - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - self._was_overriden = False - value = self.start_value - else: - self._is_overriden = True - self._was_overriden = True - value = override_value - - self.set_value(value) - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -469,21 +443,6 @@ class IntegerWidget(ConfigWidget, InputObject): def reset_value(self): self.set_value(self.start_value) - def apply_overrides(self, override_value): - self._is_modified = False - self._state = None - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - self._was_overriden = False - value = self.global_value - else: - self._is_overriden = True - self._was_overriden = True - value = override_value - - self.set_value(value) - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -602,19 +561,6 @@ class FloatWidget(ConfigWidget, InputObject): def reset_value(self): self.set_value(self.global_value) - def apply_overrides(self, override_value): - self._is_modified = False - self._state = None - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - value = self.start_value - else: - self._is_overriden = True - value = override_value - - self.set_value(value) - def clear_value(self): self.set_value(0) @@ -720,21 +666,6 @@ class TextSingleLineWidget(ConfigWidget, InputObject): def reset_value(self): self.set_value(self.start_value) - def apply_overrides(self, override_value): - self._is_modified = False - self._state = None - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - self._was_overriden = False - value = self.start_value - else: - self._is_overriden = True - self._was_overriden = True - value = override_value - - self.set_value(value) - def clear_value(self): self.set_value("") @@ -840,19 +771,6 @@ class TextMultiLineWidget(ConfigWidget, InputObject): def reset_value(self): self.set_value(self.start_value) - def apply_overrides(self, override_value): - self._is_modified = False - self._state = None - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - value = self.start_value - else: - self._is_overriden = True - value = override_value - - self.set_value(value) - def clear_value(self): self.set_value("") @@ -1019,21 +937,6 @@ class RawJsonWidget(ConfigWidget, InputObject): def clear_value(self): self.set_value("") - def apply_overrides(self, override_value): - self._is_modified = False - self._state = None - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - self._was_overriden = False - value = self.start_value - else: - self._is_overriden = True - self._was_overriden = True - value = override_value - - self.set_value(value) - def _on_value_change(self, item=None): self._is_invalid = self.text_input.has_invalid_value() if self.ignore_value_changes: @@ -1206,13 +1109,22 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): self.start_value = self.item_value() self._on_value_change() - def apply_overrides(self, override_value): + # TODO use same as InputObject + def apply_overrides(self, parent_values): + if parent_values is NOT_SET or self.key not in parent_values: + override_value = NOT_SET + else: + override_value = parent_values[self.key] + self.override_value = override_value + if override_value is NOT_SET: self._is_overriden = False + self._was_overriden = False value = self.start_value else: self._is_overriden = True + self._was_overriden = True value = override_value self.set_value(value) @@ -1372,9 +1284,9 @@ class ListWidget(ConfigWidget, InputObject): self.value_widget.clear_value() def apply_overrides(self, override_value): - self.value_widget.apply_overrides(override_value) self._is_modified = False self._state = None + self.value_widget.apply_overrides(override_value) def update_style(self): state = self.style_state( @@ -1696,21 +1608,6 @@ class ModifiableDict(ExpandingWidget, InputObject): self.update_style() - def apply_overrides(self, override_value): - self._state = None - self._is_modified = False - self.override_value = override_value - if override_value is NOT_SET: - self._is_overriden = False - self._was_overriden = False - value = self.global_value - else: - self._is_overriden = True - self._was_overriden = True - value = override_value - - self.set_value(value) - def update_style(self): state = self.style_state( self.is_invalid, self.is_overriden, self.is_modified @@ -1806,27 +1703,30 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): for item in self.input_fields: item.update_global_values(values) - def apply_overrides(self, override_value): + def apply_overrides(self, parent_values): # Make sure this is set to False - self._is_overriden = False self._state = None self._child_state = None + + metadata = {} + groups = tuple() + override_values = NOT_SET + if parent_values is not NOT_SET: + metadata = parent_values.get(METADATA_KEY) or metadata + groups = metadata.get("groups") or groups + override_values = parent_values.get(self.key, override_values) + + self._is_overriden = self.key in groups + for item in self.input_fields: - if override_value is NOT_SET: - child_value = NOT_SET - else: - child_value = override_value.get(item.key, NOT_SET) + item.apply_overrides(override_values) - item.apply_overrides(child_value) - - self._is_overriden = ( - self.is_group - and self.is_overidable - and ( - override_value is not NOT_SET - or self.child_overriden + if not self._is_overriden: + self._is_overriden = ( + self.is_group + and self.is_overidable + and self.child_overriden ) - ) self._was_overriden = bool(self._is_overriden) def _on_value_change(self, item=None): @@ -2029,27 +1929,30 @@ class DictWidget(ConfigWidget, ConfigObject): for item in self.input_fields: item.update_global_values(values) - def apply_overrides(self, override_value): + def apply_overrides(self, parent_values): # Make sure this is set to False - self._is_overriden = False self._state = None self._child_state = None + + metadata = {} + groups = tuple() + override_values = NOT_SET + if parent_values is not NOT_SET: + metadata = parent_values.get(METADATA_KEY) or metadata + groups = metadata.get("groups") or groups + override_values = parent_values.get(self.key, override_values) + + self._is_overriden = self.key in groups + for item in self.input_fields: - if override_value is NOT_SET: - child_value = NOT_SET - else: - child_value = override_value.get(item.key, NOT_SET) + item.apply_overrides(override_values) - item.apply_overrides(child_value) - - self._is_overriden = ( - self.is_group - and self.is_overidable - and ( - override_value is not NOT_SET - or self.child_overriden + if not self._is_overriden: + self._is_overriden = ( + self.is_group + and self.is_overidable + and self.child_overriden ) - ) self._was_overriden = bool(self._is_overriden) def _on_value_change(self, item=None): @@ -2297,23 +2200,30 @@ class DictInvisible(ConfigWidget, ConfigObject): for item in self.input_fields: item.update_global_values(values) - def apply_overrides(self, override_value): - self._is_overriden = False - for item in self.input_fields: - if override_value is NOT_SET: - child_value = NOT_SET - else: - child_value = override_value.get(item.key, NOT_SET) - item.apply_overrides(child_value) + def apply_overrides(self, parent_values): + # Make sure this is set to False + self._state = None + self._child_state = None - self._is_overriden = ( - self.is_group - and self.is_overidable - and ( - override_value is not None - or self.child_overriden + metadata = {} + groups = tuple() + override_values = NOT_SET + if parent_values is not NOT_SET: + metadata = parent_values.get(METADATA_KEY) or metadata + groups = metadata.get("groups") or groups + override_values = parent_values.get(self.key, override_values) + + self._is_overriden = self.key in groups + + for item in self.input_fields: + item.apply_overrides(override_values) + + if not self._is_overriden: + self._is_overriden = ( + self.is_group + and self.is_overidable + and self.child_overriden ) - ) self._was_overriden = bool(self._is_overriden) def overrides(self): @@ -2377,6 +2287,10 @@ class DictFormWidget(ConfigWidget, ConfigObject): return super(DictFormWidget, self).mouseReleaseEvent(event) + def apply_overrides(self, parent_values): + for item in self.input_fields.values(): + item.apply_overrides(parent_values) + def discard_changes(self): for item in self.input_fields.values(): item.discard_changes() From 618b2f4825aa87608be50ba4e5491149950a7002 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 17:21:16 +0200 Subject: [PATCH 201/507] added Timers manager to tray modules --- .../config_gui_schema/studio_schema/1_tray_items.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json index 45b1bc65ce..4e0e040dfe 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -44,6 +44,10 @@ "type": "boolean", "key": "Idle Manager", "label": "Idle Manager" + }, { + "type": "boolean", + "key": "Timers Manager", + "label": "Timers Manager" }, { "type": "boolean", "key": "Rest Api", From 1d72f9d01310d5ee72c6e5a51d875f13157c09ac Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 17:22:18 +0200 Subject: [PATCH 202/507] fix method name --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3eeea4df6a..e054f918cd 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1036,7 +1036,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def on_remove_clicked(self): if self.is_single: - self.value_input.clear() + self.value_input.clear_value() else: self.parent().remove_row(self) From 8276c7397154f3423dd184c54aee642b7770110f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 17:22:28 +0200 Subject: [PATCH 203/507] added exclude ports to schema --- .../config_gui_schema/studio_schema/1_tray_items.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json index 4e0e040dfe..849019c89e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -76,6 +76,15 @@ "label": "Default Port", "minimum": 1, "maximum": 65535 + }, { + "type": "list", + "object_type": "int", + "key": "exclude_ports", + "label": "Exclude ports", + "input_modifiers": { + "minimum": 1, + "maximum": 65535 + } } ] }, { From 85df0e3dbbb507d6eab569e6403401dca0f34484 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 17:59:24 +0200 Subject: [PATCH 204/507] item widget in list is after buttons --- .../config_setting/widgets/inputs.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e054f918cd..5d41ce836c 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -993,15 +993,6 @@ class ListItem(QtWidgets.QWidget, ConfigObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) - ItemKlass = TypeToKlass.types[object_type] - self.value_input = ItemKlass( - input_modifiers, - AS_WIDGET, - [], - self, - None - ) - self.add_btn = QtWidgets.QPushButton("+") self.remove_btn = QtWidgets.QPushButton("-") @@ -1014,13 +1005,22 @@ class ListItem(QtWidgets.QWidget, ConfigObject): self.add_btn.setProperty("btn-type", "tool-item") self.remove_btn.setProperty("btn-type", "tool-item") - layout.addWidget(self.value_input, 1) layout.addWidget(self.add_btn, 0) layout.addWidget(self.remove_btn, 0) self.add_btn.clicked.connect(self.on_add_clicked) self.remove_btn.clicked.connect(self.on_remove_clicked) + ItemKlass = TypeToKlass.types[object_type] + self.value_input = ItemKlass( + input_modifiers, + AS_WIDGET, + [], + self, + None + ) + layout.addWidget(self.value_input, 1) + self.value_input.value_changed.connect(self._on_value_change) self.is_single = False From 2e8abd02cb29511726b6f860511b4b31a4dc01a9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 18:00:57 +0200 Subject: [PATCH 205/507] empty list is shown as disabled first item --- .../config_setting/widgets/inputs.py | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 5d41ce836c..d197e85d1e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1023,7 +1023,9 @@ class ListItem(QtWidgets.QWidget, ConfigObject): self.value_input.value_changed.connect(self._on_value_change) - self.is_single = False + def set_as_empty(self, is_empty=True): + self.value_input.setEnabled(not is_empty) + self.remove_btn.setEnabled(not is_empty) def _on_value_change(self, item=None): self.value_changed.emit(self) @@ -1032,16 +1034,18 @@ class ListItem(QtWidgets.QWidget, ConfigObject): return self.parent().input_fields.index(self) def on_add_clicked(self): - self.parent().add_row(row=self.row() + 1) + if self.value_input.isEnabled(): + self.parent().add_row(row=self.row() + 1) + else: + self.set_as_empty(False) def on_remove_clicked(self): - if self.is_single: - self.value_input.clear_value() - else: - self.parent().remove_row(self) + self.parent().remove_row(self) def config_value(self): - return self.value_input.item_value() + if self.value_input.isEnabled(): + return self.value_input.item_value() + return NOT_SET # TODO Move subwidget to main widget @@ -1085,12 +1089,12 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): for item_value in self.default_value: self.add_row(value=item_value) - if self.count() == 0: - self.add_row() - for old_input in old_inputs: self.remove_row(old_input) + if self.count() == 0: + self.add_row(is_empty=True) + self.global_value = value self.start_value = self.item_value() @@ -1141,18 +1145,11 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): def count(self): return len(self.input_fields) - def add_row(self, row=None, value=None): + def add_row(self, row=None, value=None, is_empty=False): # Create new item item_widget = ListItem(self.object_type, self.input_modifiers, self) - - # Set/unset if new item is single item - current_count = self.count() - if current_count == 0: - item_widget.is_single = True - elif current_count == 1: - for _input_field in self.input_fields: - _input_field.is_single = False - + if is_empty: + item_widget.set_as_empty() item_widget.value_changed.connect(self._on_value_change) if row is None: @@ -1186,12 +1183,8 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): item_widget.setParent(None) item_widget.deleteLater() - current_count = self.count() - if current_count == 0: - self.add_row() - elif current_count == 1: - for _input_field in self.input_fields: - _input_field.is_single = True + if self.count() == 0: + self.add_row(is_empty=True) self._on_value_change() self.parent().updateGeometry() @@ -1199,9 +1192,9 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): def item_value(self): output = [] for item in self.input_fields: - text = item.config_value() - if text: - output.append(text) + value = item.config_value() + if value is not NOT_SET: + output.append(value) return output From ed2d4175ed22d6139f4270f7cbc78860dc22a0fd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 18:08:07 +0200 Subject: [PATCH 206/507] added color for disabled widgets --- pype/tools/config_setting/config_setting/style/style.css | 4 ++++ pype/tools/config_setting/config_setting/widgets/inputs.py | 1 + 2 files changed, 5 insertions(+) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index c575ed64c3..b39eaf0802 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -5,6 +5,10 @@ QWidget { border-radius: 0px; } +QWidget:disabled { + background-color: #4e6474; +} + QMenu { border: 1px solid #555555; background-color: #1d272f; diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d197e85d1e..08bc90766f 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1026,6 +1026,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def set_as_empty(self, is_empty=True): self.value_input.setEnabled(not is_empty) self.remove_btn.setEnabled(not is_empty) + self._on_value_change() def _on_value_change(self, item=None): self.value_changed.emit(self) From 8bca9da7902cdf3422d7f3dd35b8a132d85d309c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 18:45:25 +0200 Subject: [PATCH 207/507] removed ConfigWidget --- .../config_setting/widgets/inputs.py | 66 +++++++++++++++---- .../config_setting/widgets/widgets.py | 40 +---------- 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 08bc90766f..f603514784 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2,7 +2,6 @@ import json import logging from Qt import QtWidgets, QtCore, QtGui from .widgets import ( - ConfigWidget, ExpandingWidget, ModifiedIntSpinBox, ModifiedFloatSpinBox @@ -11,6 +10,8 @@ from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass class ConfigObject: + allow_actions = True + default_state = "" _is_overriden = False _is_modified = False @@ -173,6 +174,49 @@ class ConfigObject: "Method `hierarchical_style_update` not implemented!" ) + def mouseReleaseEvent(self, event): + if self.allow_actions and event.button() == QtCore.Qt.RightButton: + menu = QtWidgets.QMenu() + + actions_mapping = {} + if self.child_modified: + action = QtWidgets.QAction("Discard changes") + actions_mapping[action] = self._discard_changes + menu.addAction(action) + + if ( + not self.any_parent_overriden() + and (self.is_overriden or self.child_overriden) + ): + # TODO better label + action = QtWidgets.QAction("Remove override") + actions_mapping[action] = self._remove_overrides + menu.addAction(action) + + if not actions_mapping: + action = QtWidgets.QAction("< No action >") + actions_mapping[action] = None + menu.addAction(action) + + result = menu.exec_(QtGui.QCursor.pos()) + if result: + to_run = actions_mapping[result] + if to_run: + to_run() + return + + mro = type(self).mro() + index = mro.index(self.__class__) + item = None + for idx in range(index + 1, len(mro)): + _item = mro[idx] + if hasattr(_item, "mouseReleaseEvent"): + item = _item + break + + if item: + return item.mouseReleaseEvent(self, event) + class InputObject(ConfigObject): def overrides(self): @@ -251,7 +295,7 @@ class InputObject(ConfigObject): return -class BooleanWidget(ConfigWidget, InputObject): +class BooleanWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -365,7 +409,7 @@ class BooleanWidget(ConfigWidget, InputObject): return self.checkbox.isChecked() -class IntegerWidget(ConfigWidget, InputObject): +class IntegerWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) input_modifiers = ("minimum", "maximum") @@ -476,7 +520,7 @@ class IntegerWidget(ConfigWidget, InputObject): return self.int_input.value() -class FloatWidget(ConfigWidget, InputObject): +class FloatWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) input_modifiers = ("minimum", "maximum", "decimal") @@ -597,7 +641,7 @@ class FloatWidget(ConfigWidget, InputObject): return self.float_input.value() -class TextSingleLineWidget(ConfigWidget, InputObject): +class TextSingleLineWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -702,7 +746,7 @@ class TextSingleLineWidget(ConfigWidget, InputObject): return self.text_input.text() -class TextMultiLineWidget(ConfigWidget, InputObject): +class TextMultiLineWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -859,7 +903,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): super(RawJsonInput, self).resizeEvent(event) -class RawJsonWidget(ConfigWidget, InputObject): +class RawJsonWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -1200,7 +1244,7 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): return output -class ListWidget(ConfigWidget, InputObject): +class ListWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -1841,7 +1885,7 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): return {self.key: values}, self.is_group -class DictWidget(ConfigWidget, ConfigObject): +class DictWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__( @@ -2068,7 +2112,7 @@ class DictWidget(ConfigWidget, ConfigObject): return {self.key: values}, self.is_group -class DictInvisible(ConfigWidget, ConfigObject): +class DictInvisible(QtWidgets.QWidget, ConfigObject): # TODO is not overridable by itself value_changed = QtCore.Signal(object) allow_actions = False @@ -2244,7 +2288,7 @@ class FormLabel(QtWidgets.QLabel): # Proxy for form layout -class DictFormWidget(ConfigWidget, ConfigObject): +class DictFormWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) allow_actions = False diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index b824ea8720..e551d1e9c3 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -1,4 +1,4 @@ -from Qt import QtWidgets, QtCore, QtGui +from Qt import QtWidgets, QtCore class ModifiedIntSpinBox(QtWidgets.QSpinBox): @@ -48,43 +48,7 @@ class ClickableWidget(QtWidgets.QLabel): super(ClickableWidget, self).mouseReleaseEvent(event) -class ConfigWidget(QtWidgets.QWidget): - allow_actions = True - - def mouseReleaseEvent(self, event): - if self.allow_actions and event.button() == QtCore.Qt.RightButton: - menu = QtWidgets.QMenu() - - actions_mapping = {} - if self.child_modified: - action = QtWidgets.QAction("Discard changes") - actions_mapping[action] = self._discard_changes - menu.addAction(action) - - if ( - not self.any_parent_overriden() - and (self.is_overriden or self.child_overriden) - ): - # TODO better label - action = QtWidgets.QAction("Remove override") - actions_mapping[action] = self._remove_overrides - menu.addAction(action) - - if not actions_mapping: - action = QtWidgets.QAction("< No action >") - actions_mapping[action] = None - menu.addAction(action) - - result = menu.exec_(QtGui.QCursor.pos()) - if result: - to_run = actions_mapping[result] - if to_run: - to_run() - return - super(ConfigWidget, self).mouseReleaseEvent(event) - - -class ExpandingWidget(ConfigWidget): +class ExpandingWidget(QtWidgets.QWidget): def __init__(self, label, parent): super(ExpandingWidget, self).__init__(parent) self.setObjectName("ExpandingWidget") From e7875892e992105d0698d0f2b510914408d63537 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 18:45:47 +0200 Subject: [PATCH 208/507] added better disabled style --- pype/tools/config_setting/config_setting/style/style.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index b39eaf0802..996b73b9cd 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -5,10 +5,6 @@ QWidget { border-radius: 0px; } -QWidget:disabled { - background-color: #4e6474; -} - QMenu { border: 1px solid #555555; background-color: #1d272f; @@ -36,6 +32,10 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QPlainTextEdit, QTextEdit { background-color: #1d272f; } +QLineEdit:disabled, QSpinBox:disabled, QDoubleSpinBox:disabled, QPlainTextEdit:disabled, QTextEdit:disabled, QPushButton:disabled { + background-color: #4e6474; +} + QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QPlainTextEdit:focus, QTextEdit:focus { border: 1px solid #ffffff; } From a1d3616bb59d12d52c3b7c2bc97ced31d6a6c4ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 19:23:56 +0200 Subject: [PATCH 209/507] removed list subwidget --- .../config_setting/widgets/inputs.py | 200 +++++++----------- 1 file changed, 74 insertions(+), 126 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f603514784..e4a1fba096 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1093,26 +1093,49 @@ class ListItem(QtWidgets.QWidget, ConfigObject): return NOT_SET -# TODO Move subwidget to main widget -class ListSubWidget(QtWidgets.QWidget, ConfigObject): +class ListWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) - def __init__(self, input_data, values, parent_keys, parent): + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): self._parent = parent - super(ListSubWidget, self).__init__(parent) - self.setObjectName("ListSubWidget") + super(ListWidget, self).__init__(parent) + self.setObjectName("ListWidget") - layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 5, 0, 5) - layout.setSpacing(3) - self.setLayout(layout) + self._state = None + self.is_group = input_data.get("is_group", False) - self.input_fields = [] self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} + self.input_fields = [] + + inputs_widget = QtWidgets.QWidget(self) + inputs_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + + inputs_layout = QtWidgets.QVBoxLayout(inputs_widget) + inputs_layout.setContentsMargins(0, 5, 0, 5) + inputs_layout.setSpacing(3) + + self.inputs_widget = inputs_widget + self.inputs_layout = inputs_layout + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget) + + self.label_widget = label_widget + + layout.addWidget(inputs_widget) + self.key = input_data["key"] keys = list(parent_keys) keys.append(self.key) @@ -1122,10 +1145,22 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): self.override_value = NOT_SET + def count(self): + return len(self.input_fields) + + def reset_value(self): + self.set_value(self.start_value) + + def clear_value(self): + self.set_value([]) + def update_global_values(self, values): old_inputs = tuple(self.input_fields) value = self.value_from_values(values) + + self.global_value = value + if value is not NOT_SET: for item_value in value: self.add_row(value=item_value) @@ -1140,7 +1175,6 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): if self.count() == 0: self.add_row(is_empty=True) - self.global_value = value self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value @@ -1158,37 +1192,16 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): self.start_value = self.item_value() self._on_value_change() - # TODO use same as InputObject - def apply_overrides(self, parent_values): - if parent_values is NOT_SET or self.key not in parent_values: - override_value = NOT_SET - else: - override_value = parent_values[self.key] - - self.override_value = override_value - - if override_value is NOT_SET: - self._is_overriden = False - self._was_overriden = False - value = self.start_value - else: - self._is_overriden = True - self._was_overriden = True - value = override_value - - self.set_value(value) - - def reset_value(self): - self.set_value(self.start_value) - - def clear_value(self): - self.set_value([]) - def _on_value_change(self, item=None): - self.value_changed.emit(self) + if self.ignore_value_changes: + return + self._is_modified = self.item_value() != self.global_value + if self.is_overidable: + self._is_overriden = True - def count(self): - return len(self.input_fields) + self.update_style() + + self.value_changed.emit(self) def add_row(self, row=None, value=None, is_empty=False): # Create new item @@ -1234,97 +1247,27 @@ class ListSubWidget(QtWidgets.QWidget, ConfigObject): self._on_value_change() self.parent().updateGeometry() - def item_value(self): - output = [] - for item in self.input_fields: - value = item.config_value() - if value is not NOT_SET: - output.append(value) + def apply_overrides(self, parent_values): + if parent_values is NOT_SET or self.key not in parent_values: + override_value = NOT_SET + else: + override_value = parent_values[self.key] - return output + self.override_value = override_value - -class ListWidget(QtWidgets.QWidget, InputObject): - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, values, parent_keys, parent, label_widget=None - ): - self._parent = parent - - self.is_group = input_data.get("is_group", False) - - self._state = None - - super(ListWidget, self).__init__(parent) - self.setObjectName("ListWidget") - - layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) - - if not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget) - - self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.value_widget = ListSubWidget( - input_data, values, parent_keys, self - ) - self.value_widget.setAttribute(QtCore.Qt.WA_StyledBackground) - - layout.addWidget(self.value_widget) - self.setLayout(layout) - - self.value_widget.value_changed.connect(self._on_value_change) - - def update_global_values(self, values): - self.value_widget.update_global_values(values) - - @property - def start_value(self): - return self.value_widget.start_value - - @property - def global_value(self): - return self.value_widget.global_value - - @property - def override_value(self): - return self.value_widget.override_value - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - self._is_modified = self.item_value() != self.global_value - if self.is_overidable: + if override_value is NOT_SET: + self._is_overriden = False + self._was_overriden = False + value = self.start_value + else: self._is_overriden = True + self._was_overriden = True + value = override_value - self.update_style() - - self.value_changed.emit(self) - - def set_value(self, value, *, global_value=False): - self.value_widget.set_value(value, global_value=global_value) - if global_value: - self._on_value_change() - - def reset_value(self): - self.value_widget.reset_value() - - def clear_value(self): - self.value_widget.clear_value() - - def apply_overrides(self, override_value): self._is_modified = False self._state = None - self.value_widget.apply_overrides(override_value) + + self.set_value(value) def update_style(self): state = self.style_state( @@ -1337,7 +1280,12 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.label_widget.style().polish(self.label_widget) def item_value(self): - return self.value_widget.item_value() + output = [] + for item in self.input_fields: + value = item.config_value() + if value is not NOT_SET: + output.append(value) + return output class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): From 0f1dc4271ff5da6d1b67a6a99380edaf2745795e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 19:28:04 +0200 Subject: [PATCH 210/507] list changes cleanup --- .../config_setting/widgets/inputs.py | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e4a1fba096..6c33ffacc0 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1028,8 +1028,8 @@ class ListItem(QtWidgets.QWidget, ConfigObject): _btn_size = 20 value_changed = QtCore.Signal(object) - def __init__(self, object_type, input_modifiers, parent): - self._parent = parent + def __init__(self, object_type, input_modifiers, config_parent, parent): + self._parent = config_parent super(ListItem, self).__init__(parent) @@ -1076,16 +1076,16 @@ class ListItem(QtWidgets.QWidget, ConfigObject): self.value_changed.emit(self) def row(self): - return self.parent().input_fields.index(self) + return self._parent.input_fields.index(self) def on_add_clicked(self): if self.value_input.isEnabled(): - self.parent().add_row(row=self.row() + 1) + self._parent.add_row(row=self.row() + 1) else: self.set_as_empty(False) def on_remove_clicked(self): - self.parent().remove_row(self) + self._parent.remove_row(self) def config_value(self): if self.value_input.isEnabled(): @@ -1205,16 +1205,18 @@ class ListWidget(QtWidgets.QWidget, InputObject): def add_row(self, row=None, value=None, is_empty=False): # Create new item - item_widget = ListItem(self.object_type, self.input_modifiers, self) + item_widget = ListItem( + self.object_type, self.input_modifiers, self, self.inputs_widget + ) if is_empty: item_widget.set_as_empty() item_widget.value_changed.connect(self._on_value_change) if row is None: - self.layout().addWidget(item_widget) + self.inputs_layout.addWidget(item_widget) self.input_fields.append(item_widget) else: - self.layout().insertWidget(row, item_widget) + self.inputs_layout.insertWidget(row, item_widget) self.input_fields.insert(row, item_widget) previous_input = None @@ -1231,12 +1233,12 @@ class ListWidget(QtWidgets.QWidget, InputObject): item_widget.value_input.set_value(value, global_value=True) else: self._on_value_change() - self.parent().updateGeometry() + self.updateGeometry() def remove_row(self, item_widget): item_widget.value_changed.disconnect() - self.layout().removeWidget(item_widget) + self.inputs_layout.removeWidget(item_widget) self.input_fields.remove(item_widget) item_widget.setParent(None) item_widget.deleteLater() @@ -1245,7 +1247,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.add_row(is_empty=True) self._on_value_change() - self.parent().updateGeometry() + self.updateGeometry() def apply_overrides(self, parent_values): if parent_values is NOT_SET or self.key not in parent_values: From 7849c707e1a756a8e6605eb3ad367a46896af6eb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 19:33:26 +0200 Subject: [PATCH 211/507] added possibility to set key as overriden --- .../config_setting/widgets/inputs.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 6c33ffacc0..208bfa6685 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -169,6 +169,14 @@ class ConfigObject: ) ) + def _set_as_overriden(self): + self.ignore_value_changes = True + self.set_as_overriden() + self.ignore_value_changes = False + + def set_as_overriden(self): + self._is_overriden = True + def hierarchical_style_update(self): raise NotImplementedError( "Method `hierarchical_style_update` not implemented!" @@ -184,6 +192,15 @@ class ConfigObject: actions_mapping[action] = self._discard_changes menu.addAction(action) + if ( + self.is_overidable + and not self.is_overriden + and not self.any_parent_is_group + ): + action = QtWidgets.QAction("Set as overriden") + actions_mapping[action] = self._set_as_overriden + menu.addAction(action) + if ( not self.any_parent_overriden() and (self.is_overriden or self.child_overriden) From 1ab9162b3b94e1d757bb62c3377263d45883504e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 19:55:50 +0200 Subject: [PATCH 212/507] is group is abstract attribute --- .../config_setting/widgets/inputs.py | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 208bfa6685..d8121367e3 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -13,10 +13,13 @@ class ConfigObject: allow_actions = True default_state = "" + _is_overriden = False _is_modified = False _was_overriden = False _is_invalid = False + _is_group = False + _log = None @property @@ -45,6 +48,11 @@ class ConfigObject: """Value set in is not valid.""" return self._is_invalid + @property + def is_group(self): + """Value set in is not valid.""" + return self._is_group + @property def is_overidable(self): """Should care about overrides.""" @@ -321,7 +329,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -436,7 +444,7 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -547,7 +555,7 @@ class FloatWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -667,7 +675,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -772,7 +780,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -929,7 +937,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -1122,7 +1130,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.setObjectName("ListWidget") self._state = None - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) @@ -1572,7 +1580,7 @@ class ModifiableDict(ExpandingWidget, InputObject): self.any_parent_is_group = any_parent_is_group - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self._state = None super(ModifiableDict, self).__init__(input_data["label"], parent) @@ -1656,7 +1664,7 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): self.any_parent_is_group = any_parent_is_group - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self._state = None self._child_state = None @@ -1870,7 +1878,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.any_parent_is_group = any_parent_is_group - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) self._state = None self._child_state = None @@ -2094,7 +2102,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): any_parent_is_group = parent.any_parent_is_group self.any_parent_is_group = any_parent_is_group - self.is_group = input_data.get("is_group", False) + self._is_group = input_data.get("is_group", False) super(DictInvisible, self).__init__(parent) self.setObjectName("DictInvisible") @@ -2270,7 +2278,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self.any_parent_is_group = any_parent_is_group - self.is_group = False + self._is_group = False super(DictFormWidget, self).__init__(parent) From 724fe35c84aff0cb00503d4f3fc5f88e0b0766d3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 19:56:07 +0200 Subject: [PATCH 213/507] set as overriden is abstract method --- .../config_setting/widgets/inputs.py | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d8121367e3..1261f3b91b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -183,7 +183,9 @@ class ConfigObject: self.ignore_value_changes = False def set_as_overriden(self): - self._is_overriden = True + raise NotImplementedError( + "Method `set_as_overriden` not implemented!" + ) def hierarchical_style_update(self): raise NotImplementedError( @@ -298,6 +300,9 @@ class InputObject(ConfigObject): self._is_modified = False self._is_overriden = self._was_overriden + def set_as_overriden(self): + self._is_overriden = True + @property def child_modified(self): return self.is_modified @@ -1712,6 +1717,17 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def set_as_overriden(self): + if self.is_overriden: + return + + if self.is_group: + self._is_overriden = True + return + + for item in self.input_fields: + item.set_as_overriden() + def update_global_values(self, values): for item in self.input_fields: item.update_global_values(values) @@ -1938,6 +1954,17 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def set_as_overriden(self): + if self.is_overriden: + return + + if self.is_group: + self._is_overriden = True + return + + for item in self.input_fields: + item.set_as_overriden() + def update_global_values(self, values): for item in self.input_fields: item.update_global_values(values) @@ -2209,6 +2236,17 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def set_as_overriden(self): + if self.is_overriden: + return + + if self.is_group: + self._is_overriden = True + return + + for item in self.input_fields: + item.set_as_overriden() + def update_global_values(self, values): for item in self.input_fields: item.update_global_values(values) @@ -2311,6 +2349,17 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def set_as_overriden(self): + if self.is_overriden: + return + + if self.is_group: + self._is_overriden = True + return + + for item in self.input_fields: + item.set_as_overriden() + def update_global_values(self, values): for item in self.input_fields.values(): item.update_global_values(values) From e7a451775611dfe0e14039f2db110e4404a3673d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 20:09:01 +0200 Subject: [PATCH 214/507] fixed determination of overriden keys --- .../tools/config_setting/config_setting/widgets/inputs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 1261f3b91b..0c35f7d10d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1821,7 +1821,7 @@ class DictExpandWidget(ExpandingWidget, ConfigObject): @property def child_overriden(self): for input_field in self.input_fields: - if input_field.child_overriden: + if input_field.is_overriden or input_field.child_overriden: return True return False @@ -2059,7 +2059,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): @property def child_overriden(self): for input_field in self.input_fields: - if input_field.child_overriden: + if input_field.is_overriden or input_field.child_overriden: return True return False @@ -2162,7 +2162,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): @property def child_overriden(self): for input_field in self.input_fields: - if input_field.child_overriden: + if input_field.is_overriden or input_field.child_overriden: return True return False @@ -2379,7 +2379,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): @property def child_overriden(self): for input_field in self.input_fields.values(): - if input_field.child_overriden: + if input_field.is_overriden or input_field.child_overriden: return True return False From d7f48119ed3b7966a413872882b5f3fde38cdb13 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 20:09:55 +0200 Subject: [PATCH 215/507] added testing function --- .../config_setting/config_setting/widgets/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/tests.py b/pype/tools/config_setting/config_setting/widgets/tests.py index 16c97a85ef..fc53e38ad5 100644 --- a/pype/tools/config_setting/config_setting/widgets/tests.py +++ b/pype/tools/config_setting/config_setting/widgets/tests.py @@ -1,6 +1,17 @@ from Qt import QtWidgets, QtCore +def indented_print(data, indent=0): + spaces = " " * (indent * 4) + if not isinstance(data, dict): + print("{}{}".format(spaces, data)) + return + + for key, value in data.items(): + print("{}{}".format(spaces, key)) + indented_print(value, indent + 1) + + class SelectableMenu(QtWidgets.QMenu): selection_changed = QtCore.Signal() From 5986041bf0caaa37be01d6b7175adb5bf38b3949 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 20:26:22 +0200 Subject: [PATCH 216/507] get rid of subwidget of modifiable dictionary --- .../config_setting/widgets/inputs.py | 262 ++++++++---------- 1 file changed, 122 insertions(+), 140 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0c35f7d10d..91882de958 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1324,8 +1324,8 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): _btn_size = 20 value_changed = QtCore.Signal(object) - def __init__(self, object_type, input_modifiers, parent): - self._parent = parent + def __init__(self, object_type, input_modifiers, config_parent, parent): + self._parent = config_parent super(ModifiableDictItem, self).__init__(parent) @@ -1413,17 +1413,17 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.key_input.style().polish(self.key_input) def row(self): - return self.parent().input_fields.index(self) + return self._parent.input_fields.index(self) def on_add_clicked(self): - self.parent().add_row(row=self.row() + 1) + self._parent.add_row(row=self.row() + 1) def on_remove_clicked(self): if self.is_single: self.value_input.clear_value() self.key_input.setText("") else: - self.parent().remove_row(self) + self._parent.remove_row(self) def config_value(self): key = self.key_input.text() @@ -1433,22 +1433,44 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): return {key: value} -# TODO Move subwidget to main widget -class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): +class ModifiableDict(ExpandingWidget, InputObject): + # Should be used only for dictionary with one datatype as value + # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) - def __init__(self, input_data, values, parent_keys, parent): + def __init__( + self, input_data, values, parent_keys, parent, + label_widget=None + ): self._parent = parent - super(ModifiableDictSubWidget, self).__init__(parent) - self.setObjectName("ModifiableDictSubWidget") + super(ModifiableDict, self).__init__(input_data["label"], parent) + self.setObjectName("ModifiableDict") - layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(5, 5, 0, 5) - layout.setSpacing(5) - self.setLayout(layout) + self._state = None self.input_fields = [] + + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + self.any_parent_is_group = any_parent_is_group + + self._is_group = input_data.get("is_group", False) + + inputs_widget = QtWidgets.QWidget(self) + inputs_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + + inputs_layout = QtWidgets.QVBoxLayout(inputs_widget) + inputs_layout.setContentsMargins(5, 5, 0, 5) + inputs_layout.setSpacing(5) + + self.set_content_widget(inputs_widget) + + self.inputs_widget = inputs_widget + self.inputs_layout = inputs_layout + self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} @@ -1458,12 +1480,20 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): keys.append(self.key) self.keys = keys + self.override_value = NOT_SET + self.update_global_values(values) + def count(self): + return len(self.input_fields) + def update_global_values(self, values): old_inputs = tuple(self.input_fields) value = self.value_from_values(values) + + self.global_value = value + if value is not NOT_SET: for item_key, item_value in value.items(): self.add_row(key=item_key, value=item_value) @@ -1478,137 +1508,22 @@ class ModifiableDictSubWidget(QtWidgets.QWidget, ConfigObject): for old_input in old_inputs: self.remove_row(old_input) - self.global_value = value - self.start_value = self.config_value() + self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value - @property - def is_group(self): - return self._parent.is_group + def set_value(self, value, *, global_value=False): + previous_inputs = tuple(self.input_fields) + for item_key, item_value in value.items(): + self.add_row(key=item_key, value=item_value) - @property - def any_parent_is_group(self): - return self._parent.any_parent_is_group + for input_field in previous_inputs: + self.remove_row(input_field) - def _on_value_change(self, item=None): - self.value_changed.emit(self) - - def count(self): - return len(self.input_fields) - - def add_row(self, row=None, key=None, value=None): - # Create new item - item_widget = ModifiableDictItem( - self.object_type, self.input_modifiers, self - ) - - # Set/unset if new item is single item - current_count = self.count() - if current_count == 0: - item_widget.is_single = True - elif current_count == 1: - for _input_field in self.input_fields: - _input_field.is_single = False - - item_widget.value_changed.connect(self._on_value_change) - - if row is None: - self.layout().addWidget(item_widget) - self.input_fields.append(item_widget) - else: - self.layout().insertWidget(row, item_widget) - self.input_fields.insert(row, item_widget) - - previous_input = None - for input_field in self.input_fields: - if previous_input is not None: - self.setTabOrder( - previous_input, input_field.key_input - ) - previous_input = input_field.value_input.focusProxy() - self.setTabOrder( - input_field.key_input, previous_input - ) - - # Set value if entered value is not None - # else (when add button clicked) trigger `_on_value_change` - if value is not None and key is not None: - item_widget.default_key = key - item_widget.key_input.setText(key) - item_widget.value_input.set_value(value, global_value=True) - else: + if global_value: + self.global_value = value + self.start_value = self.item_value() self._on_value_change() - self.parent().updateGeometry() - - def remove_row(self, item_widget): - item_widget.value_changed.disconnect() - - self.layout().removeWidget(item_widget) - self.input_fields.remove(item_widget) - item_widget.setParent(None) - item_widget.deleteLater() - - current_count = self.count() - if current_count == 0: - self.add_row() - elif current_count == 1: - for _input_field in self.input_fields: - _input_field.is_single = True - - self._on_value_change() - self.parent().updateGeometry() - - def config_value(self): - output = {} - for item in self.input_fields: - item_value = item.config_value() - if item_value: - output.update(item_value) - return output - - -class ModifiableDict(ExpandingWidget, InputObject): - # Should be used only for dictionary with one datatype as value - # TODO this is actually input field (do not care if is group or not) - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, values, parent_keys, parent, - label_widget=None - ): - self._parent = parent - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - self.any_parent_is_group = any_parent_is_group - - self._is_group = input_data.get("is_group", False) - self._state = None - - super(ModifiableDict, self).__init__(input_data["label"], parent) - self.setObjectName("ModifiableDict") - - self.value_widget = ModifiableDictSubWidget( - input_data, values, parent_keys, self - ) - self.value_widget.setAttribute(QtCore.Qt.WA_StyledBackground) - self.value_widget.value_changed.connect(self._on_value_change) - - self.set_content_widget(self.value_widget) - - self.key = input_data["key"] - - self.override_value = NOT_SET - self.start_value = self.value_widget.start_value - self.global_value = self.value_widget.global_value - - self._is_modified = self.global_value != self.start_value - - def update_global_values(self, values): - self.value_widget.update_global_values(values) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -1647,7 +1562,74 @@ class ModifiableDict(ExpandingWidget, InputObject): self._state = state def item_value(self): - return self.value_widget.config_value() + output = {} + for item in self.input_fields: + item_value = item.config_value() + if item_value: + output.update(item_value) + return output + + def add_row(self, row=None, key=None, value=None): + # Create new item + item_widget = ModifiableDictItem( + self.object_type, self.input_modifiers, self, self.inputs_widget + ) + + # Set/unset if new item is single item + current_count = self.count() + if current_count == 0: + item_widget.is_single = True + elif current_count == 1: + for _input_field in self.input_fields: + _input_field.is_single = False + + item_widget.value_changed.connect(self._on_value_change) + + if row is None: + self.inputs_layout.addWidget(item_widget) + self.input_fields.append(item_widget) + else: + self.inputs_layout.insertWidget(row, item_widget) + self.input_fields.insert(row, item_widget) + + previous_input = None + for input_field in self.input_fields: + if previous_input is not None: + self.setTabOrder( + previous_input, input_field.key_input + ) + previous_input = input_field.value_input.focusProxy() + self.setTabOrder( + input_field.key_input, previous_input + ) + + # Set value if entered value is not None + # else (when add button clicked) trigger `_on_value_change` + if value is not None and key is not None: + item_widget.default_key = key + item_widget.key_input.setText(key) + item_widget.value_input.set_value(value, global_value=True) + else: + self._on_value_change() + self.parent().updateGeometry() + + def remove_row(self, item_widget): + item_widget.value_changed.disconnect() + + self.inputs_layout.removeWidget(item_widget) + self.input_fields.remove(item_widget) + item_widget.setParent(None) + item_widget.deleteLater() + + current_count = self.count() + if current_count == 0: + self.add_row() + elif current_count == 1: + for _input_field in self.input_fields: + _input_field.is_single = True + + self._on_value_change() + self.parent().updateGeometry() # Dictionaries From 416de13fe270b4512609c4da58a48a212881ee06 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 20:34:33 +0200 Subject: [PATCH 217/507] fixed form group for overrides --- .../config_setting/config_setting/widgets/inputs.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 91882de958..873481e352 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2331,6 +2331,13 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def remove_overrides(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + for item in self.input_fields.values(): + item.remove_overrides() + def set_as_overriden(self): if self.is_overriden: return @@ -2350,6 +2357,8 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): if self.ignore_value_changes: return self.value_changed.emit(self) + if self.any_parent_is_group: + self.hierarchical_style_update() @property def child_modified(self): @@ -2419,7 +2428,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): values = {} groups = [] - for input_field in self.input_fields: + for input_field in self.input_fields.values(): value, is_group = input_field.overrides() if value is not NOT_SET: values.update(value) @@ -2427,7 +2436,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): groups.extend(value.keys()) if groups: values[METADATA_KEY] = {"groups": groups} - return {self.key: values}, self.is_group + return values, self.is_group TypeToKlass.types["boolean"] = BooleanWidget From 008204f7d9b3a30f77392b17da2d38aacb9a9f43 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 31 Aug 2020 20:35:14 +0200 Subject: [PATCH 218/507] added form widget to overridable configurations --- .../projects_schema/1_plugins_gui_schema.json | 73 ++++++++++--------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index c70daab32c..bed839e6dc 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -21,40 +21,45 @@ "is_group": true, "children": [ { - "type": "boolean", - "key": "enabled", - "label": "Enabled", - "default": true - }, { - "type": "text-singleline", - "key": "deadline_department", - "label": "Deadline apartment", - "default": "" - }, { - "type": "int", - "key": "deadline_priority", - "label": "Deadline priority", - "default": 50 - }, { - "type": "text-singleline", - "key": "deadline_pool", - "label": "Deadline pool", - "default": "" - }, { - "type": "text-singleline", - "key": "deadline_pool_secondary", - "label": "Deadline pool (secondary)", - "default": "" - }, { - "type": "text-singleline", - "key": "deadline_group", - "label": "Deadline Group", - "default": "" - }, { - "type": "int", - "key": "deadline_chunk_size", - "label": "Deadline Chunk size", - "default": 10 + "type": "dict-form", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": true + }, { + "type": "text-singleline", + "key": "deadline_department", + "label": "Deadline apartment", + "default": "" + }, { + "type": "int", + "key": "deadline_priority", + "label": "Deadline priority", + "default": 50 + }, { + "type": "text-singleline", + "key": "deadline_pool", + "label": "Deadline pool", + "default": "" + }, { + "type": "text-singleline", + "key": "deadline_pool_secondary", + "label": "Deadline pool (secondary)", + "default": "" + }, { + "type": "text-singleline", + "key": "deadline_group", + "label": "Deadline Group", + "default": "" + }, { + "type": "int", + "key": "deadline_chunk_size", + "label": "Deadline Chunk size", + "default": 10 + } + ] } ] } From 2e1dbec431df446c941b297694fe695e3643443f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 09:45:51 +0200 Subject: [PATCH 219/507] added any_parent_is_group to RawJson --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 873481e352..82befa3276 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -942,6 +942,12 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + self.any_parent_is_group = any_parent_is_group + self._is_group = input_data.get("is_group", False) self.default_value = input_data.get("default", NOT_SET) From 1cafdb0aa89e0fd8c6fcb1deadd53ecb1afad0f9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 09:46:10 +0200 Subject: [PATCH 220/507] input_fields in FormWidget are in list not dict --- .../config_setting/widgets/inputs.py | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 82befa3276..8c9e4a054b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2308,7 +2308,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): super(DictFormWidget, self).__init__(parent) - self.input_fields = {} + self.input_fields = [] self.content_layout = QtWidgets.QFormLayout(self) self.keys = list(parent_keys) @@ -2327,11 +2327,11 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): super(DictFormWidget, self).mouseReleaseEvent(event) def apply_overrides(self, parent_values): - for item in self.input_fields.values(): + for item in self.input_fields: item.apply_overrides(parent_values) def discard_changes(self): - for item in self.input_fields.values(): + for item in self.input_fields: item.discard_changes() self._is_modified = self.child_modified @@ -2341,7 +2341,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self._is_overriden = False self._is_modified = False self._was_overriden = False - for item in self.input_fields.values(): + for item in self.input_fields: item.remove_overrides() def set_as_overriden(self): @@ -2356,7 +2356,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): item.set_as_overriden() def update_global_values(self, values): - for item in self.input_fields.values(): + for item in self.input_fields: item.update_global_values(values) def _on_value_change(self, item=None): @@ -2368,34 +2368,33 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): @property def child_modified(self): - for input_field in self.input_fields.values(): + for input_field in self.input_fields: if input_field.child_modified: return True return False @property def child_overriden(self): - for input_field in self.input_fields.values(): + for input_field in self.input_fields: if input_field.is_overriden or input_field.child_overriden: return True return False @property def child_invalid(self): - for input_field in self.input_fields.values(): + for input_field in self.input_fields: if input_field.child_invalid: return True return False def get_invalid(self): output = [] - for input_field in self.input_fields.values(): + for input_field in self.input_fields: output.extend(input_field.get_invalid()) return output def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] - key = child_configuration["key"] # Pop label to not be set in child label = child_configuration["label"] @@ -2410,16 +2409,16 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): item.value_changed.connect(self._on_value_change) self.content_layout.addRow(label_widget, item) - self.input_fields[key] = item + self.input_fields.append(item) return item def hierarchical_style_update(self): - for input_field in self.input_fields.values(): + for input_field in self.input_fields: input_field.hierarchical_style_update() def item_value(self): output = {} - for input_field in self.input_fields.values(): + for input_field in self.input_fields: # TODO maybe merge instead of update should be used # NOTE merge is custom function which merges 2 dicts output.update(input_field.config_value()) @@ -2434,7 +2433,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): values = {} groups = [] - for input_field in self.input_fields.values(): + for input_field in self.input_fields: value, is_group = input_field.overrides() if value is not NOT_SET: values.update(value) From bfc4a7d595bd152a67a585a8c23e6fa3b629fdfd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 10:10:59 +0200 Subject: [PATCH 221/507] DictWidget can be also expandable --- .../config_setting/widgets/inputs.py | 85 +++++++++++-------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 8c9e4a054b..8e66a5b1c2 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1874,50 +1874,22 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): raise TypeError("Can't use \"{}\" as widget item.".format( self.__class__.__name__ )) + + super(DictWidget, self).__init__(parent) + self.setObjectName("DictWidget") + + self._state = None + self._child_state = None + self._parent = parent any_parent_is_group = parent.is_group if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - self.any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) - self._state = None - self._child_state = None - - super(DictWidget, self).__init__(parent) - self.setObjectName("DictWidget") - - body_widget = QtWidgets.QWidget(self) - - label_widget = QtWidgets.QLabel( - input_data["label"], parent=body_widget - ) - label_widget.setObjectName("DictLabel") - - content_widget = QtWidgets.QWidget(body_widget) - content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(3, 3, 0, 3) - - body_layout = QtWidgets.QVBoxLayout(body_widget) - body_layout.setContentsMargins(0, 0, 0, 0) - body_layout.setSpacing(5) - body_layout.addWidget(label_widget) - body_layout.addWidget(content_widget) - - self.setAttribute(QtCore.Qt.WA_StyledBackground) - - main_layout = QtWidgets.QHBoxLayout(self) - main_layout.setContentsMargins(5, 5, 0, 5) - main_layout.setSpacing(0) - main_layout.addWidget(body_widget) - - self.label_widget = label_widget - self.content_widget = content_widget - self.content_layout = content_layout - self.input_fields = [] self.key = input_data["key"] @@ -1925,6 +1897,49 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): keys.append(self.key) self.keys = keys + main_layout = QtWidgets.QHBoxLayout(self) + main_layout.setSpacing(0) + + expandable = input_data.get("expandable", True) + if expandable: + main_layout.setContentsMargins(0, 0, 0, 0) + body_widget = ExpandingWidget(input_data["label"], self) + else: + main_layout.setContentsMargins(5, 5, 0, 5) + body_widget = QtWidgets.QWidget(self) + + main_layout.addWidget(body_widget) + + content_widget = QtWidgets.QWidget(body_widget) + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(3, 3, 0, 3) + + self.content_widget = content_widget + self.content_layout = content_layout + + if not expandable: + label_widget = QtWidgets.QLabel( + input_data["label"], parent=body_widget + ) + label_widget.setObjectName("DictLabel") + + body_layout = QtWidgets.QVBoxLayout(body_widget) + body_layout.setContentsMargins(0, 0, 0, 0) + body_layout.setSpacing(5) + body_layout.addWidget(label_widget) + body_layout.addWidget(content_widget) + + self.label_widget = label_widget + + else: + body_widget.set_content_widget(content_widget) + self.label_widget = body_widget.label_widget + expanded = input_data.get("expanded", False) + if expanded: + self.toggle_content() + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) From cedb8dd2d78650806058f09a5b9c8db51ebc15aa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 10:11:22 +0200 Subject: [PATCH 222/507] added expandable false to current dict types --- .../projects_schema/1_plugins_gui_schema.json | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index bed839e6dc..4b7b19a74d 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -16,6 +16,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "ExtractCelactionDeadline", "label": "ExtractCelactionDeadline", "is_group": true, @@ -79,6 +80,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "IntegrateFtrackNote", "label": "IntegrateFtrackNote", "is_group": true, @@ -118,6 +120,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "IntegrateMasterVersion", "label": "IntegrateMasterVersion", "is_group": true, @@ -130,6 +133,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ExtractJpegEXR", "label": "ExtractJpegEXR", "is_group": true, @@ -156,6 +160,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ExtractReview", "label": "ExtractReview", "is_group": true, @@ -174,6 +179,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ExtractBurnin", "label": "ExtractBurnin", "is_group": true, @@ -227,6 +233,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "IntegrateAssetNew", "label": "IntegrateAssetNew", "is_group": true, @@ -239,6 +246,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ProcessSubmittedJobOnFarm", "label": "ProcessSubmittedJobOnFarm", "is_group": true, @@ -278,6 +286,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "ValidateModelName", "label": "Validate Model Name", "is_group": true, @@ -299,6 +308,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ValidateAssemblyName", "label": "Validate Assembly Name", "is_group": true, @@ -311,6 +321,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ValidateShaderName", "label": "ValidateShaderName", "is_group": true, @@ -328,6 +339,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ValidateMeshHasOverlappingUVs", "label": "ValidateMeshHasOverlappingUVs", "is_group": true, @@ -360,6 +372,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "CreateWriteRender", "label": "CreateWriteRender", "is_group": true, @@ -373,6 +386,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "CreateWritePrerender", "label": "CreateWritePrerender", "is_group": true, @@ -394,6 +408,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "ExtractThumbnail", "label": "ExtractThumbnail", "is_group": true, @@ -411,6 +426,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ValidateNukeWriteKnobs", "label": "ValidateNukeWriteKnobs", "is_group": true, @@ -428,6 +444,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ExtractReviewDataLut", "label": "ExtractReviewDataLut", "is_group": true, @@ -441,6 +458,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ExtractReviewDataMov", "label": "ExtractReviewDataMov", "is_group": true, @@ -459,6 +477,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ExtractSlateFrame", "label": "ExtractSlateFrame", "is_group": true, @@ -472,6 +491,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "NukeSubmitDeadline", "label": "NukeSubmitDeadline", "is_group": true, @@ -520,6 +540,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "CollectInstanceVersion", "label": "Collect Instance Version", "is_group": true, @@ -533,6 +554,7 @@ ] }, { "type": "dict", + "expandable": false, "key": "ExtractReviewCutUpVideo", "label": "Extract Review Cut Up Video", "is_group": true, @@ -567,6 +589,7 @@ "children": [ { "type": "dict", + "expandable": false, "key": "CreateShotClip", "label": "Create Shot Clip", "is_group": true, From 32ac3a77d7afd073e26b1b1fac94f6444c8754c6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 10:16:23 +0200 Subject: [PATCH 223/507] extended modified attribute --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 8e66a5b1c2..4a23b93a85 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2049,7 +2049,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): @property def is_modified(self): if self.is_group: - return self.child_modified + return self._is_modified or self.child_modified return False @property From 00b5ac261a6379f529de684de040c79858416287 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 10:19:49 +0200 Subject: [PATCH 224/507] removed dict-expanding input type as is duplicated --- .../1_ftrack_projects_gui_schema.json | 9 +- .../projects_schema/1_plugins_gui_schema.json | 57 +++-- .../1_applications_gui_schema.json | 3 +- .../studio_schema/1_intents_gui_schema.json | 3 +- .../studio_schema/1_tools_gui_schema.json | 3 +- .../studio_schema/1_tray_items.json | 13 +- .../config_setting/widgets/inputs.py | 226 ------------------ 7 files changed, 58 insertions(+), 256 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json index ac696d18d0..51c05aeb3a 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json @@ -1,11 +1,13 @@ { "key": "ftrack", - "type": "dict-expanding", + "type": "dict", + "expandable": true, "label": "Ftrack", "children": [ { "key": "status_update", - "type": "dict-expanding", + "type": "dict", + "expandable": true, "label": "Status updates", "is_group": true, "is_file": true, @@ -22,7 +24,8 @@ ] }, { "key": "status_version_to_task", - "type": "dict-expanding", + "type": "dict", + "expandable": true, "label": "Version status to Task status", "is_group": true, "is_file": true, diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 4b7b19a74d..bb323c9803 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -1,15 +1,18 @@ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "plugins", "label": "Plugins", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "celaction", "label": "CelAction", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "publish", "label": "Publish plugins", "is_file": true, @@ -68,12 +71,14 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "ftrack", "label": "Ftrack", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "publish", "label": "Publish plugins", "is_file": true, @@ -108,12 +113,14 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "global", "label": "Global", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "publish", "label": "Publish plugins", "is_file": true, @@ -189,7 +196,8 @@ "key": "enabled", "label": "Enabled" }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "options", "label": "Burnin formating options", "children": [ @@ -274,12 +282,14 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "maya", "label": "Maya", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "publish", "label": "Publish plugins", "is_file": true, @@ -360,12 +370,14 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "nuke", "label": "Nuke", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "create", "label": "Create plugins", "is_file": true, @@ -401,7 +413,8 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "publish", "label": "Publish plugins", "is_file": true, @@ -528,12 +541,14 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "nukestudio", "label": "NukeStudio", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "publish", "label": "Publish plugins", "is_file": true, @@ -577,12 +592,14 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "resolve", "label": "DaVinci Resolve", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "create", "label": "Creator plugins", "is_file": true, @@ -617,12 +634,14 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "standalonepublisher", "label": "StandalonePublisher", "children": [ { - "type": "dict-expanding", + "type": "dict", + "expandable": true, "key": "publish", "label": "Publish plugins", "is_file": true, diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json index 2e60ed360d..bc2c9f239c 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json @@ -1,7 +1,8 @@ { "key": "applications", - "type": "dict-expanding", + "type": "dict", "label": "Applications", + "expandable": true, "is_file": true, "is_group": true, "children": [ diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json index 37d525cfb6..18f3d42ba7 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json @@ -1,7 +1,8 @@ { "key": "intent", - "type": "dict-expanding", + "type": "dict", "label": "Intent Setting", + "expandable": true, "is_group": true, "is_file": true, "children": [ diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json index 4c905a3826..bf35326d1c 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json @@ -1,7 +1,8 @@ { "key": "tools", - "type": "dict-expanding", + "type": "dict", "label": "Tools", + "expandable": true, "is_group": true, "is_file": true, "children": [ diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json index 849019c89e..7cea724f29 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -1,7 +1,8 @@ { "key": "tray_modules", - "type": "dict-expanding", + "type": "dict", "label": "Modules", + "expandable": true, "is_file": true, "is_group": true, "children": [ @@ -65,10 +66,10 @@ "type": "dict-invisible", "children": [ { - "type": "dict-expanding", + "type": "dict", "key": "Rest Api", "label": "Rest Api", - "MISINGKEYCONF": {"exclude_ports": []}, + "expandable": true, "children": [ { "type": "int", @@ -88,9 +89,10 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", "key": "Timers Manager", "label": "Timers Manager", + "expandable": true, "children": [ { "type": "float", @@ -103,9 +105,10 @@ } ] }, { - "type": "dict-expanding", + "type": "dict", "key": "Clockify", "label": "Clockify", + "expandable": true, "children": [ { "type": "text-singleline", diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4a23b93a85..f0feb6fce3 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1639,231 +1639,6 @@ class ModifiableDict(ExpandingWidget, InputObject): # Dictionaries -class DictExpandWidget(ExpandingWidget, ConfigObject): - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, values, parent_keys, parent, label_widget=None - ): - if values is AS_WIDGET: - raise TypeError("Can't use \"{}\" as widget item.".format( - self.__class__.__name__ - )) - self._parent = parent - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - self.any_parent_is_group = any_parent_is_group - - self._is_group = input_data.get("is_group", False) - - self._state = None - self._child_state = None - - super(DictExpandWidget, self).__init__(input_data["label"], parent) - - content_widget = QtWidgets.QWidget(self) - content_widget.setVisible(False) - - content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(3, 3, 0, 3) - - self.set_content_widget(content_widget) - - expanded = input_data.get("expanded", False) - if expanded: - self.toggle_content() - - self.setAttribute(QtCore.Qt.WA_StyledBackground) - - self.content_widget = content_widget - self.content_layout = content_layout - - self.input_fields = [] - - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - for child_data in input_data.get("children", []): - self.add_children_gui(child_data, values) - - def remove_overrides(self): - self._is_overriden = False - self._is_modified = False - self._was_overriden = False - for item in self.input_fields: - item.remove_overrides() - - def discard_changes(self): - for item in self.input_fields: - item.discard_changes() - - self._is_modified = self.child_modified - self._is_overriden = self._was_overriden - - def set_as_overriden(self): - if self.is_overriden: - return - - if self.is_group: - self._is_overriden = True - return - - for item in self.input_fields: - item.set_as_overriden() - - def update_global_values(self, values): - for item in self.input_fields: - item.update_global_values(values) - - def apply_overrides(self, parent_values): - # Make sure this is set to False - self._state = None - self._child_state = None - - metadata = {} - groups = tuple() - override_values = NOT_SET - if parent_values is not NOT_SET: - metadata = parent_values.get(METADATA_KEY) or metadata - groups = metadata.get("groups") or groups - override_values = parent_values.get(self.key, override_values) - - self._is_overriden = self.key in groups - - for item in self.input_fields: - item.apply_overrides(override_values) - - if not self._is_overriden: - self._is_overriden = ( - self.is_group - and self.is_overidable - and self.child_overriden - ) - self._was_overriden = bool(self._is_overriden) - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_group: - if self.is_overidable: - self._is_overriden = True - - # TODO update items - if item is not None: - for _item in self.input_fields: - if _item is not item: - _item.update_style() - - self.value_changed.emit(self) - - self.update_style() - - def hierarchical_style_update(self): - self.update_style() - for input_field in self.input_fields: - input_field.hierarchical_style_update() - - def update_style(self, is_overriden=None): - child_modified = self.child_modified - child_state = self.style_state( - self.child_invalid, self.child_overriden, child_modified - ) - if child_state: - child_state = "child-{}".format(child_state) - - if child_state != self._child_state: - self.setProperty("state", child_state) - self.style().polish(self) - self._child_state = child_state - - state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified - ) - if self._state == state: - return - - self.label_widget.setProperty("state", state) - self.label_widget.style().polish(self.label_widget) - - self._state = state - - @property - def is_modified(self): - if self.is_group: - return self.child_modified - return False - - @property - def child_modified(self): - for input_field in self.input_fields: - if input_field.child_modified: - return True - return False - - @property - def child_overriden(self): - for input_field in self.input_fields: - if input_field.is_overriden or input_field.child_overriden: - return True - return False - - @property - def child_invalid(self): - for input_field in self.input_fields: - if input_field.child_invalid: - return True - return False - - def get_invalid(self): - output = [] - for input_field in self.input_fields: - output.extend(input_field.get_invalid()) - return output - - def item_value(self): - output = {} - for input_field in self.input_fields: - # TODO maybe merge instead of update should be used - # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) - return output - - def add_children_gui(self, child_configuration, values): - item_type = child_configuration["type"] - klass = TypeToKlass.types.get(item_type) - - item = klass( - child_configuration, values, self.keys, self - ) - item.value_changed.connect(self._on_value_change) - self.content_layout.addWidget(item) - - self.input_fields.append(item) - return item - - def overrides(self): - if not self.is_overriden and not self.child_overriden: - return NOT_SET, False - - values = {} - groups = [] - for input_field in self.input_fields: - value, is_group = input_field.overrides() - if value is not NOT_SET: - values.update(value) - if is_group: - groups.extend(value.keys()) - if groups: - values[METADATA_KEY] = {"groups": groups} - return {self.key: values}, self.is_group - - class DictWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) @@ -2467,7 +2242,6 @@ TypeToKlass.types["int"] = IntegerWidget TypeToKlass.types["float"] = FloatWidget TypeToKlass.types["dict-modifiable"] = ModifiableDict TypeToKlass.types["dict"] = DictWidget -TypeToKlass.types["dict-expanding"] = DictExpandWidget TypeToKlass.types["dict-form"] = DictFormWidget TypeToKlass.types["dict-invisible"] = DictInvisible TypeToKlass.types["list"] = ListWidget From 8f4a7138e5104cb6b89e03678ad321e121df5b12 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:26:44 +0200 Subject: [PATCH 225/507] form widget has update_style method --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f0feb6fce3..dd1af3eb9d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2127,6 +2127,10 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def update_style(self): + for item in self.input_fields: + item.update_style() + def remove_overrides(self): self._is_overriden = False self._is_modified = False From c954fafeb0e4a9fbaafe2c416cd7971a1dd1ac6c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:29:10 +0200 Subject: [PATCH 226/507] trigger hierarchical_style_update instead of triggering update_style for each item --- pype/tools/config_setting/config_setting/widgets/inputs.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index dd1af3eb9d..9896fda4e1 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1986,12 +1986,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): if self.is_group: if self.is_overidable: self._is_overriden = True - # TODO update items - if item is not None: - is_overriden = self.is_overriden - for _item in self.input_fields: - if _item is not item: - _item.update_style(is_overriden) + self.hierarchical_style_update() self.value_changed.emit(self) From 5393b79d987c81bd51f4e3c3d8c4348b4546b062 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:31:24 +0200 Subject: [PATCH 227/507] label widget in dictionary widget is wrapped with QWidget --- .../config_setting/widgets/inputs.py | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 9896fda4e1..f6fc0310aa 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1692,26 +1692,33 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.content_widget = content_widget self.content_layout = content_layout - if not expandable: - label_widget = QtWidgets.QLabel( - input_data["label"], parent=body_widget - ) - label_widget.setObjectName("DictLabel") - - body_layout = QtWidgets.QVBoxLayout(body_widget) - body_layout.setContentsMargins(0, 0, 0, 0) - body_layout.setSpacing(5) - body_layout.addWidget(label_widget) - body_layout.addWidget(content_widget) - - self.label_widget = label_widget - - else: + if expandable: body_widget.set_content_widget(content_widget) self.label_widget = body_widget.label_widget expanded = input_data.get("expanded", False) if expanded: - self.toggle_content() + body_widget.toggle_content() + + else: + top_widget = QtWidgets.QWidget(body_widget) + top_layout = QtWidgets.QHBoxLayout(top_widget) + top_layout.setContentsMargins(0, 0, 0, 0) + top_layout.setSpacing(5) + + label_widget = QtWidgets.QLabel( + input_data["label"], parent=top_widget + ) + label_widget.setObjectName("DictLabel") + + top_layout.addWidget(label_widget) + + body_layout = QtWidgets.QVBoxLayout(body_widget) + body_layout.setContentsMargins(0, 0, 0, 0) + body_layout.setSpacing(5) + body_layout.addWidget(top_widget) + body_layout.addWidget(content_widget) + + self.label_widget = label_widget self.setAttribute(QtCore.Qt.WA_StyledBackground) From f994d56464fa2f0fe6e104d385a22e5c266554e8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:35:58 +0200 Subject: [PATCH 228/507] it is possible to add checkbox next to label instead of child input --- .../config_setting/widgets/inputs.py | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f6fc0310aa..56ce22bdaf 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1722,6 +1722,31 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.setAttribute(QtCore.Qt.WA_StyledBackground) + checkbox_widget = None + checkbox_key = input_data.get("checkbox_key") + if checkbox_key: + checkbox_input_data = { + "key": checkbox_key, + "label": "test" + } + if expandable: + checkbox_widget = BooleanWidget( + checkbox_input_data, values, self.keys, self, + label_widget=self.label_widget, + # parent_widget=body_widget.top_part + ) + body_widget.top_part.layout().addWidget(checkbox_widget) + else: + checkbox_widget = BooleanWidget( + checkbox_input_data, values, self.keys, self, + label_widget=self.label_widget, + # parent_widget=top_widget + ) + top_layout.addWidget(checkbox_widget) + + self.input_fields.append(checkbox_widget) + checkbox_widget.value_changed.connect(self._on_value_change) + for child_data in input_data.get("children", []): self.add_children_gui(child_data, values) @@ -2129,10 +2154,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified self._is_overriden = self._was_overriden - def update_style(self): - for item in self.input_fields: - item.update_style() - def remove_overrides(self): self._is_overriden = False self._is_modified = False From 354b5b26f4c81bde9185c247364d87847ca0d51b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:44:51 +0200 Subject: [PATCH 229/507] added validation for checkbox_key --- .../config_setting/config_setting/widgets/lib.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index fe4e514aaf..ac18f09669 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -219,20 +219,24 @@ def validate_is_group_is_unique_in_hierarchy( def validate_keys_are_unique(schema_data, keys=None): + children = schema_data.get("children") + if not children: + return + is_top = keys is None if keys is None: keys = [schema_data["key"]] else: keys.append(schema_data["key"]) - children = schema_data.get("children") - if not children: - return - child_queue = Queue() for child in children: child_queue.put(child) + checkbox_key = schema_data.get("checkbox_key") + if checkbox_key: + child_queue.put({"key": checkbox_key}) + child_inputs = [] while not child_queue.empty(): child = child_queue.get() From 2960dcb1e0808b7623369bd49602fc4e93d467c3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:45:09 +0200 Subject: [PATCH 230/507] expandable widget has ability to hide toolbox button --- .../config_setting/config_setting/widgets/widgets.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index e551d1e9c3..d90242600e 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -53,6 +53,8 @@ class ExpandingWidget(QtWidgets.QWidget): super(ExpandingWidget, self).__init__(parent) self.setObjectName("ExpandingWidget") + self.toolbox_hidden = False + top_part = ClickableWidget(parent=self) button_size = QtCore.QSize(5, 5) @@ -82,6 +84,12 @@ class ExpandingWidget(QtWidgets.QWidget): self.top_part.clicked.connect(self._top_part_clicked) self.button_toggle.clicked.connect(self.toggle_content) + def hide_toolbox(self): + self.button_toggle.setArrowType(QtCore.Qt.NoArrow) + self.toolbox_hidden = True + self.content_widget.setVisible(False) + self.parent().updateGeometry() + def set_content_widget(self, content_widget): main_layout = QtWidgets.QVBoxLayout(self) main_layout.setContentsMargins(9, 9, 0, 9) @@ -98,6 +106,8 @@ class ExpandingWidget(QtWidgets.QWidget): self.toggle_content(not self.button_toggle.isChecked()) def toggle_content(self, *args): + if self.toolbox_hidden: + return if len(args) > 0: checked = args[0] else: From 977855566b51f484890955c1e520eaee1f9a1d15 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:45:34 +0200 Subject: [PATCH 231/507] checkbox creation is same --- .../config_setting/widgets/inputs.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 56ce22bdaf..477fdc9292 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1726,22 +1726,15 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): checkbox_key = input_data.get("checkbox_key") if checkbox_key: checkbox_input_data = { - "key": checkbox_key, - "label": "test" + "key": checkbox_key } + checkbox_widget = BooleanWidget( + checkbox_input_data, values, self.keys, self, + label_widget=self.label_widget + ) if expandable: - checkbox_widget = BooleanWidget( - checkbox_input_data, values, self.keys, self, - label_widget=self.label_widget, - # parent_widget=body_widget.top_part - ) body_widget.top_part.layout().addWidget(checkbox_widget) else: - checkbox_widget = BooleanWidget( - checkbox_input_data, values, self.keys, self, - label_widget=self.label_widget, - # parent_widget=top_widget - ) top_layout.addWidget(checkbox_widget) self.input_fields.append(checkbox_widget) From 7b679f5e79239565875b490c7d89208ed4d2e7f7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:45:56 +0200 Subject: [PATCH 232/507] trigger hierarchical_style_update instead of individual update_style on items --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 477fdc9292..3c5c246c43 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1806,11 +1806,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): if self.is_overidable: self._is_overriden = True - # TODO update items - if item is not None: - for _item in self.input_fields: - if _item is not item: - _item.update_style() + self.hierarchical_style_update() self.value_changed.emit(self) From 3800fc91dc3e9b796ff95e60a4f232b6c017a13d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 11:46:19 +0200 Subject: [PATCH 233/507] hide content and arrow if only checkbox key is set in dict widget --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3c5c246c43..64d2cbb761 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1740,7 +1740,11 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.input_fields.append(checkbox_widget) checkbox_widget.value_changed.connect(self._on_value_change) - for child_data in input_data.get("children", []): + children_data = input_data.get("children", []) + if expandable and checkbox_widget and not children_data: + body_widget.hide_toolbox() + + for child_data in children_data: self.add_children_gui(child_data, values) def remove_overrides(self): From 5e3599b8d08272923bac24f5f1bf623c50563249 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 12:33:57 +0200 Subject: [PATCH 234/507] expandign widget can set custom context margins --- pype/tools/config_setting/config_setting/widgets/widgets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index d90242600e..ba6a3c6629 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -90,9 +90,11 @@ class ExpandingWidget(QtWidgets.QWidget): self.content_widget.setVisible(False) self.parent().updateGeometry() - def set_content_widget(self, content_widget): + def set_content_widget(self, content_widget, margins=None): main_layout = QtWidgets.QVBoxLayout(self) - main_layout.setContentsMargins(9, 9, 0, 9) + if margins is None: + margins = (9, 9, 0, 9) + main_layout.setContentsMargins(*margins) content_widget.setVisible(False) From bbea0da42c57fe6c488e7e5f25e617068d995c4c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 12:34:21 +0200 Subject: [PATCH 235/507] ExpandingWidget style is not used anymore --- .../config_setting/config_setting/style/style.css | 12 ++++++------ .../config_setting/config_setting/widgets/widgets.py | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 996b73b9cd..937259ba7b 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -124,7 +124,7 @@ QPushButton[btn-type="expand-toggle"] { font-weight: bold; } -#ExpandingWidget, #ModifiableDict, #DictWidget { +#ModifiableDict, #DictWidget { border-style: solid; border-color: #455c6e; border-left-width: 3px; @@ -132,22 +132,22 @@ QPushButton[btn-type="expand-toggle"] { border-right-width: 0px; border-top-width: 0px; } -#ExpandingWidget:hover, #ModifiableDict:hover, #DictWidget:hover { +#ModifiableDict:hover, #DictWidget:hover { border-color: #62839d; } -#ExpandingWidget[state="child-modified"], #ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"] { +#ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"] { border-color: #106aa2; } -#ExpandingWidget[state="child-modified"]:hover, #ModifiableDict[state="child-modified"]:hover, #DictWidget[state="child-modified"]:hover { +#ModifiableDict[state="child-modified"]:hover, #DictWidget[state="child-modified"]:hover { border-color: #137cbd; } -#ExpandingWidget[state="child-invalid"], #ModifiableDict[state="child-invalid"], #DictWidget[state="child-invalid"] { +#ModifiableDict[state="child-invalid"], #DictWidget[state="child-invalid"] { border-color: #ad2e2e; } -#ExpandingWidget[state="child-invalid"]:hover, #ModifiableDict[state="child-invalid"]:hover, #DictWidget[state="child-invalid"]:hover { +#ModifiableDict[state="child-invalid"]:hover, #DictWidget[state="child-invalid"]:hover { border-color: #c93636; } diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index ba6a3c6629..c0045e37fd 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -51,7 +51,6 @@ class ClickableWidget(QtWidgets.QLabel): class ExpandingWidget(QtWidgets.QWidget): def __init__(self, label, parent): super(ExpandingWidget, self).__init__(parent) - self.setObjectName("ExpandingWidget") self.toolbox_hidden = False From 9bd6f5961c315a17148383164ab8b23fdddd84c5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 12:34:46 +0200 Subject: [PATCH 236/507] expanding widget can hide arrow and keep context showed --- pype/tools/config_setting/config_setting/widgets/widgets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index c0045e37fd..db41fda1f6 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -83,10 +83,10 @@ class ExpandingWidget(QtWidgets.QWidget): self.top_part.clicked.connect(self._top_part_clicked) self.button_toggle.clicked.connect(self.toggle_content) - def hide_toolbox(self): + def hide_toolbox(self, hide_content=False): self.button_toggle.setArrowType(QtCore.Qt.NoArrow) self.toolbox_hidden = True - self.content_widget.setVisible(False) + self.content_widget.setVisible(not hide_content) self.parent().updateGeometry() def set_content_widget(self, content_widget, margins=None): From 5c806ca77e7254896a5c43616bdde20f693def77 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 12:35:15 +0200 Subject: [PATCH 237/507] content margins are same for both cases --- pype/tools/config_setting/config_setting/widgets/inputs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 64d2cbb761..2fb83566b0 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1673,14 +1673,13 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.keys = keys main_layout = QtWidgets.QHBoxLayout(self) + main_layout.setContentsMargins(5, 5, 0, 5) main_layout.setSpacing(0) expandable = input_data.get("expandable", True) if expandable: - main_layout.setContentsMargins(0, 0, 0, 0) body_widget = ExpandingWidget(input_data["label"], self) else: - main_layout.setContentsMargins(5, 5, 0, 5) body_widget = QtWidgets.QWidget(self) main_layout.addWidget(body_widget) From fd58aeb7fdd5a68018c171fae3c44e20ae396c74 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 12:35:42 +0200 Subject: [PATCH 238/507] as body widget is always used expanding widget in dict widget --- .../config_setting/widgets/inputs.py | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 2fb83566b0..3737d8c858 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1676,11 +1676,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): main_layout.setContentsMargins(5, 5, 0, 5) main_layout.setSpacing(0) - expandable = input_data.get("expandable", True) - if expandable: - body_widget = ExpandingWidget(input_data["label"], self) - else: - body_widget = QtWidgets.QWidget(self) + body_widget = ExpandingWidget(input_data["label"], self) main_layout.addWidget(body_widget) @@ -1691,33 +1687,16 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.content_widget = content_widget self.content_layout = content_layout + body_widget.set_content_widget(content_widget, (4, 4, 0, 4)) + self.label_widget = body_widget.label_widget + + expandable = input_data.get("expandable", True) if expandable: - body_widget.set_content_widget(content_widget) - self.label_widget = body_widget.label_widget expanded = input_data.get("expanded", False) if expanded: body_widget.toggle_content() - else: - top_widget = QtWidgets.QWidget(body_widget) - top_layout = QtWidgets.QHBoxLayout(top_widget) - top_layout.setContentsMargins(0, 0, 0, 0) - top_layout.setSpacing(5) - - label_widget = QtWidgets.QLabel( - input_data["label"], parent=top_widget - ) - label_widget.setObjectName("DictLabel") - - top_layout.addWidget(label_widget) - - body_layout = QtWidgets.QVBoxLayout(body_widget) - body_layout.setContentsMargins(0, 0, 0, 0) - body_layout.setSpacing(5) - body_layout.addWidget(top_widget) - body_layout.addWidget(content_widget) - - self.label_widget = label_widget + body_widget.hide_toolbox(hide_content=False) self.setAttribute(QtCore.Qt.WA_StyledBackground) @@ -1741,7 +1720,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): children_data = input_data.get("children", []) if expandable and checkbox_widget and not children_data: - body_widget.hide_toolbox() + body_widget.hide_toolbox(hide_content=True) for child_data in children_data: self.add_children_gui(child_data, values) From 01ae1ef294226fce524b6045d660400dcb8f5de1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 12:55:26 +0200 Subject: [PATCH 239/507] checkbox key requires to have widget specification in children --- .../config_setting/widgets/inputs.py | 59 ++++++++++--------- .../config_setting/widgets/lib.py | 4 -- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3737d8c858..cf1e7b017e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1684,47 +1684,33 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(3, 3, 0, 3) + body_widget.set_content_widget(content_widget, (4, 4, 0, 4)) + + self.body_widget = body_widget self.content_widget = content_widget self.content_layout = content_layout - body_widget.set_content_widget(content_widget, (4, 4, 0, 4)) self.label_widget = body_widget.label_widget + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + self.checkbox_widget = None + self.checkbox_key = input_data.get("checkbox_key") + + for child_data in input_data.get("children", []): + self.add_children_gui(child_data, values) + expandable = input_data.get("expandable", True) - if expandable: + if len(self.input_fields) == 1 and self.checkbox_widget: + body_widget.hide_toolbox(hide_content=True) + + elif expandable: expanded = input_data.get("expanded", False) if expanded: body_widget.toggle_content() else: body_widget.hide_toolbox(hide_content=False) - self.setAttribute(QtCore.Qt.WA_StyledBackground) - - checkbox_widget = None - checkbox_key = input_data.get("checkbox_key") - if checkbox_key: - checkbox_input_data = { - "key": checkbox_key - } - checkbox_widget = BooleanWidget( - checkbox_input_data, values, self.keys, self, - label_widget=self.label_widget - ) - if expandable: - body_widget.top_part.layout().addWidget(checkbox_widget) - else: - top_layout.addWidget(checkbox_widget) - - self.input_fields.append(checkbox_widget) - checkbox_widget.value_changed.connect(self._on_value_change) - - children_data = input_data.get("children", []) - if expandable and checkbox_widget and not children_data: - body_widget.hide_toolbox(hide_content=True) - - for child_data in children_data: - self.add_children_gui(child_data, values) - def remove_overrides(self): self._is_overriden = False self._is_modified = False @@ -1868,6 +1854,10 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): def add_children_gui(self, child_configuration, values): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) + if self.checkbox_key and not self.checkbox_widget: + key = child_configuration.get("key") + if key == self.checkbox_key: + return self._add_checkbox_child(child_configuration, values) item = klass( child_configuration, values, self.keys, self @@ -1878,6 +1868,17 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.input_fields.append(item) return item + def _add_checkbox_child(self, child_configuration, values): + item = BooleanWidget( + child_configuration, values, self.keys, self, self.label_widget + ) + item.value_changed.connect(self._on_value_change) + + self.body_widget.top_part.layout().addWidget(item) + self.checkbox_widget = item + self.input_fields.append(item) + return item + def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index ac18f09669..c416f7a5b0 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -233,10 +233,6 @@ def validate_keys_are_unique(schema_data, keys=None): for child in children: child_queue.put(child) - checkbox_key = schema_data.get("checkbox_key") - if checkbox_key: - child_queue.put({"key": checkbox_key}) - child_inputs = [] while not child_queue.empty(): child = child_queue.get() From aae3fbf971afbcf96956aea5903badbee10e7a79 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 13:01:03 +0200 Subject: [PATCH 240/507] modified few schemas to match new dict checkbox key --- .../projects_schema/1_plugins_gui_schema.json | 69 ++++++++++++------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index bb323c9803..19d5127a95 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -19,20 +19,21 @@ "children": [ { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "ExtractCelactionDeadline", "label": "ExtractCelactionDeadline", "is_group": true, "children": [ { + "type": "boolean", + "key": "enabled", + "label": "Enabled", + "default": true + }, { "type": "dict-form", "children": [ { - "type": "boolean", - "key": "enabled", - "label": "Enabled", - "default": true - }, { "type": "text-singleline", "key": "deadline_department", "label": "Deadline apartment", @@ -85,7 +86,8 @@ "children": [ { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "IntegrateFtrackNote", "label": "IntegrateFtrackNote", "is_group": true, @@ -127,7 +129,8 @@ "children": [ { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "IntegrateMasterVersion", "label": "IntegrateMasterVersion", "is_group": true, @@ -140,7 +143,8 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "ExtractJpegEXR", "label": "ExtractJpegEXR", "is_group": true, @@ -167,9 +171,10 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "ExtractReview", "label": "ExtractReview", + "checkbox_key": "enabled", "is_group": true, "children": [ { @@ -186,9 +191,10 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "ExtractBurnin", "label": "ExtractBurnin", + "checkbox_key": "enabled", "is_group": true, "children": [ { @@ -241,7 +247,7 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "IntegrateAssetNew", "label": "IntegrateAssetNew", "is_group": true, @@ -254,9 +260,10 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "ProcessSubmittedJobOnFarm", "label": "ProcessSubmittedJobOnFarm", + "checkbox_key": "enabled", "is_group": true, "children": [ { @@ -296,9 +303,10 @@ "children": [ { "type": "dict", - "expandable": false, + "expandable": true, "key": "ValidateModelName", "label": "Validate Model Name", + "checkbox_key": "enabled", "is_group": true, "children": [ { @@ -318,9 +326,10 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "ValidateAssemblyName", "label": "Validate Assembly Name", + "checkbox_key": "enabled", "is_group": true, "children": [ { @@ -331,9 +340,10 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "ValidateShaderName", "label": "ValidateShaderName", + "checkbox_key": "enabled", "is_group": true, "children": [ { @@ -349,9 +359,10 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "ValidateMeshHasOverlappingUVs", "label": "ValidateMeshHasOverlappingUVs", + "checkbox_key": "enabled", "is_group": true, "children": [ { @@ -421,7 +432,8 @@ "children": [ { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "ExtractThumbnail", "label": "ExtractThumbnail", "is_group": true, @@ -439,7 +451,8 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "ValidateNukeWriteKnobs", "label": "ValidateNukeWriteKnobs", "is_group": true, @@ -457,7 +470,8 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "ExtractReviewDataLut", "label": "ExtractReviewDataLut", "is_group": true, @@ -471,7 +485,8 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "ExtractReviewDataMov", "label": "ExtractReviewDataMov", "is_group": true, @@ -490,7 +505,7 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "ExtractSlateFrame", "label": "ExtractSlateFrame", "is_group": true, @@ -504,7 +519,7 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, "key": "NukeSubmitDeadline", "label": "NukeSubmitDeadline", "is_group": true, @@ -555,7 +570,8 @@ "children": [ { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "CollectInstanceVersion", "label": "Collect Instance Version", "is_group": true, @@ -569,7 +585,8 @@ ] }, { "type": "dict", - "expandable": false, + "expandable": true, + "checkbox_key": "enabled", "key": "ExtractReviewCutUpVideo", "label": "Extract Review Cut Up Video", "is_group": true, @@ -606,7 +623,7 @@ "children": [ { "type": "dict", - "expandable": false, + "expandable": true, "key": "CreateShotClip", "label": "Create Shot Clip", "is_group": true, From ce6e64e5734dcde2a7c0f0b5282f7e1f9532c2e9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 14:45:09 +0200 Subject: [PATCH 241/507] adde is_nullable to inputs --- .../config_setting/widgets/inputs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index cf1e7b017e..f1eee2b33b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -19,6 +19,7 @@ class ConfigObject: _was_overriden = False _is_invalid = False _is_group = False + _is_nullable = False _log = None @@ -53,6 +54,10 @@ class ConfigObject: """Value set in is not valid.""" return self._is_group + @property + def is_nullable(self): + return self._is_nullable + @property def is_overidable(self): """Should care about overrides.""" @@ -335,6 +340,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self._as_widget = values is AS_WIDGET self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -450,6 +456,7 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): self._as_widget = values is AS_WIDGET self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -561,6 +568,7 @@ class FloatWidget(QtWidgets.QWidget, InputObject): self._as_widget = values is AS_WIDGET self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -681,6 +689,7 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): self._as_widget = values is AS_WIDGET self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -786,6 +795,7 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputObject): self._as_widget = values is AS_WIDGET self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -949,6 +959,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) self._state = None @@ -1142,6 +1153,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self._state = None self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) @@ -1464,6 +1476,7 @@ class ModifiableDict(ExpandingWidget, InputObject): self.any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) inputs_widget = QtWidgets.QWidget(self) inputs_widget.setAttribute(QtCore.Qt.WA_StyledBackground) @@ -1664,6 +1677,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) self.input_fields = [] From dabe68f28cd1c391a2b4930af40d60b801bc78e2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 16:50:00 +0200 Subject: [PATCH 242/507] initial commit for anatomy widget --- .../projects_schema/0_project_gui_schema.json | 4 ++ .../config_setting/widgets/__init__.py | 4 +- .../config_setting/widgets/anatomy_inputs.py | 63 +++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json index 10641d5eda..91bacf2e5a 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json @@ -3,6 +3,10 @@ "type": "dict-invisible", "children": [ { + "type": "anatomy", + "key": "anatomy", + "is_file": true + }, { "type": "schema", "children": [ "1_plugins_gui_schema" diff --git a/pype/tools/config_setting/config_setting/widgets/__init__.py b/pype/tools/config_setting/config_setting/widgets/__init__.py index 0682f00324..034692898c 100644 --- a/pype/tools/config_setting/config_setting/widgets/__init__.py +++ b/pype/tools/config_setting/config_setting/widgets/__init__.py @@ -1,8 +1,10 @@ from .window import MainWidget # TODO properly register inputs to TypeToKlass class from . import inputs +from . import anatomy_inputs __all__ = [ "MainWidget", - "inputs" + "inputs", + "anatomy_inputs" ] diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py new file mode 100644 index 0000000000..addd0d6666 --- /dev/null +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -0,0 +1,63 @@ +import json +import logging +from Qt import QtWidgets, QtCore, QtGui +from .widgets import ( + ExpandingWidget, + ModifiedIntSpinBox, + ModifiedFloatSpinBox +) +from .inputs import ConfigObject, InputObject +from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass + + +class AnatomyWidget(QtWidgets.QWidget, InputObject): + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + self._as_widget = values is AS_WIDGET + + self._is_group = True + self._state = None + + self.key = "anatomy" + self.start_value = None + + super(AnatomyWidget, self).__init__(parent) + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + label = QtWidgets.QLabel("Test") + layout.addWidget(label) + + self.override_value = NOT_SET + + def update_global_values(self, values): + print("* update_global_values") + + def set_value(self, value, *, global_value=False): + print("* set_value") + + def clear_value(self): + print("* clear_value") + + def _on_value_change(self, item=None): + print("* _on_value_change") + + def update_style(self): + print("* update_style") + + def item_value(self): + print("* item_value") + + +class TemplatesWidget: + pass + + + + +TypeToKlass.types["anatomy"] = AnatomyWidget From 13ee08a4ac73fdf4b5e000224da2bbb715b4cc12 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 1 Sep 2020 17:55:24 +0200 Subject: [PATCH 243/507] initial commit of path input --- .../config_setting/widgets/inputs.py | 283 ++++++++++++++++++ 1 file changed, 283 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f1eee2b33b..1416bbebda 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2247,8 +2247,291 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): return values, self.is_group +class PathInput(QtWidgets.QLineEdit): + def clear_end_path(self): + value = self.text().strip() + print("clearing") + if value.endswith("/"): + while value and value[-1] == "/": + value = value[:-1] + self.setText(value) + + def keyPressEvent(self, event): + if event.key() == QtCore.Qt.Key_Backslash: + event.accept() + new_event = QtGui.QKeyEvent( + event.type(), + QtCore.Qt.Key_Slash, + event.modifiers(), + "/", + event.isAutoRepeat(), + event.count() + ) + QtWidgets.QApplication.sendEvent(self, new_event) + return + super(PathInput, self).keyPressEvent(event) + + def focusOutEvent(self, event): + super(PathInput, self).focusOutEvent(event) + self.clear_end_path() + + +class PathWidgetInput(QtWidgets.QWidget, InputObject): + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + self._parent = parent + self._as_widget = values is AS_WIDGET + + self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) + self.default_value = input_data.get("default", NOT_SET) + + self._state = None + + super(PathWidgetInput, self).__init__(parent) + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + + self.path_input = PathInput(self) + + self.setFocusProxy(self.path_input) + + if not self._as_widget and not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) + layout.addWidget(self.path_input, 1) + + if not self._as_widget: + self.label_widget = label_widget + + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + self.update_global_values(values) + + self.override_value = NOT_SET + + self.path_input.textChanged.connect(self._on_value_change) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: + value = self.value_from_values(values) + if value is not NOT_SET: + self.path_input.setText(value) + + elif self.default_value is not NOT_SET: + self.path_input.setText(self.default_value) + + self.global_value = value + self.start_value = self.item_value() + + self._is_modified = self.global_value != self.start_value + + def set_value(self, value, *, global_value=False): + self.path_input.setText(value) + if global_value: + self.start_value = self.item_value() + self.global_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.start_value) + + def clear_value(self): + self.set_value("") + + def focusOutEvent(self, event): + super(PathInput, self).focusOutEvent(event) + value = self.item_value().strip() + if value.endswith("/"): + while value and value[-1] == "/": + value = value[:-1] + self.set_value(value) + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + self._is_modified = self.item_value() != self.global_value + if self.is_overidable: + self._is_overriden = True + + self.update_style() + + self.value_changed.emit(self) + + def update_style(self): + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) + if self._state == state: + return + + if self._as_widget: + property_name = "input-state" + widget = self.path_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) + + def item_value(self): + return self.path_input.text() + + +class PathWidget(QtWidgets.QWidget, InputObject): + value_changed = QtCore.Signal(object) + + platforms = ("windows", "darwin", "linux") + platform_labels_mapping = { + "windows": "Windows", + "darwin": "MacOS", + "linux": "Linux" + } + platform_separators = { + "windows": ";", + "darwin": ":", + "linux": ":" + } + + def __init__( + self, input_data, values, parent_keys, parent, label_widget=None + ): + super(PathWidget, self).__init__(parent) + + self._parent = parent + self._as_widget = values is AS_WIDGET + + self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) + + self.default_value = input_data.get("default", NOT_SET) + self.multi_platform = input_data.get("multi_platform", NOT_SET) + self.multi_path = input_data.get("multi_path", NOT_SET) + + self.override_value = NOT_SET + + self._state = None + + self.input_fields = [] + + if not self._as_widget: + self.key = input_data["key"] + keys = list(parent_keys) + keys.append(self.key) + self.keys = keys + + if not self.multi_platform and not self.multi_path: + layout = QtWidgets.QVBoxLayout(self) + else: + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + + if not self._as_widget and not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) + + self.label_widget = label_widget + + self.content_widget = QtWidgets.QWidget(self) + self.content_layout = QtWidgets.QVBoxLayout(self.content_widget) + + layout.addWidget(self.content_widget) + + self.create_gui() + + self.update_global_values(values) + + def create_gui(self): + if self.multi_platform and self.multi_path: + pass + elif self.multi_platform: + pass + elif self.multi_path: + pass + else: + text_input = QtWidgets.QLineEdit(self.content_widget) + self.setFocusProxy(text_input) + self.content_layout.addWidget(text_input, 1) + self.input_fields.append(text_input) + + def update_global_values(self, values): + value = NOT_SET + if not self._as_widget: + value = self.value_from_values(values) + if value is not NOT_SET: + self.text_input.setText(value) + + elif self.default_value is not NOT_SET: + self.text_input.setText(self.default_value) + + self.global_value = value + self.start_value = self.item_value() + + self._is_modified = self.global_value != self.start_value + + def set_value(self, value, *, global_value=False): + self.text_input.setText(value) + if global_value: + self.start_value = self.item_value() + self.global_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.start_value) + + def clear_value(self): + self.set_value("") + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + self._is_modified = self.item_value() != self.global_value + if self.is_overidable: + self._is_overriden = True + + self.update_style() + + self.value_changed.emit(self) + + def update_style(self): + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) + if self._state == state: + return + + if self._as_widget: + property_name = "input-state" + widget = self.text_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) + + def item_value(self): + return self.text_input.text() + + TypeToKlass.types["boolean"] = BooleanWidget TypeToKlass.types["text-singleline"] = TextSingleLineWidget +TypeToKlass.types["path-input"] = PathWidgetInput TypeToKlass.types["text-multiline"] = TextMultiLineWidget TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["int"] = IntegerWidget From 5b74678220750d0da52c9f290bcbc1299fc7106e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 10:50:27 +0200 Subject: [PATCH 244/507] PathWidgetInput cleanup --- .../config_setting/widgets/inputs.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 1416bbebda..24d0259baf 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2250,13 +2250,13 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): class PathInput(QtWidgets.QLineEdit): def clear_end_path(self): value = self.text().strip() - print("clearing") if value.endswith("/"): while value and value[-1] == "/": value = value[:-1] self.setText(value) def keyPressEvent(self, event): + # Always change backslash `\` for forwardslash `/` if event.key() == QtCore.Qt.Key_Backslash: event.accept() new_event = QtGui.QKeyEvent( @@ -2276,7 +2276,7 @@ class PathInput(QtWidgets.QLineEdit): self.clear_end_path() -class PathWidgetInput(QtWidgets.QWidget, InputObject): +class PathInputWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( @@ -2291,7 +2291,7 @@ class PathWidgetInput(QtWidgets.QWidget, InputObject): self._state = None - super(PathWidgetInput, self).__init__(parent) + super(PathInputWidget, self).__init__(parent) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -2350,12 +2350,8 @@ class PathWidgetInput(QtWidgets.QWidget, InputObject): self.set_value("") def focusOutEvent(self, event): + self.path_input.clear_end_path() super(PathInput, self).focusOutEvent(event) - value = self.item_value().strip() - if value.endswith("/"): - while value and value[-1] == "/": - value = value[:-1] - self.set_value(value) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -2531,7 +2527,7 @@ class PathWidget(QtWidgets.QWidget, InputObject): TypeToKlass.types["boolean"] = BooleanWidget TypeToKlass.types["text-singleline"] = TextSingleLineWidget -TypeToKlass.types["path-input"] = PathWidgetInput +TypeToKlass.types["path-input"] = PathInputWidget TypeToKlass.types["text-multiline"] = TextMultiLineWidget TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["int"] = IntegerWidget From bf4205f23d8f4467376696a3b2b0263c75b69665 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 11:08:03 +0200 Subject: [PATCH 245/507] path widget is partially completed --- .../config_setting/widgets/inputs.py | 107 ++++++++++++------ 1 file changed, 73 insertions(+), 34 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 24d0259baf..63db5cb2e2 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2413,8 +2413,8 @@ class PathWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self.multi_platform = input_data.get("multi_platform", NOT_SET) - self.multi_path = input_data.get("multi_path", NOT_SET) + self.multiplatform = input_data.get("multiplatform", False) + self.multipath = input_data.get("multipath", False) self.override_value = NOT_SET @@ -2428,10 +2428,10 @@ class PathWidget(QtWidgets.QWidget, InputObject): keys.append(self.key) self.keys = keys - if not self.multi_platform and not self.multi_path: - layout = QtWidgets.QVBoxLayout(self) - else: + if not self.multiplatform and not self.multipath: layout = QtWidgets.QHBoxLayout(self) + else: + layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) @@ -2441,30 +2441,69 @@ class PathWidget(QtWidgets.QWidget, InputObject): layout.addWidget(label_widget, 0) self.label_widget = label_widget + layout.addWidget(label_widget) self.content_widget = QtWidgets.QWidget(self) self.content_layout = QtWidgets.QVBoxLayout(self.content_widget) + self.content_layout.setSpacing(0) + self.content_layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self.content_widget) - self.create_gui() + self.create_gui(values) self.update_global_values(values) - def create_gui(self): - if self.multi_platform and self.multi_path: - pass - elif self.multi_platform: - pass - elif self.multi_path: - pass - else: - text_input = QtWidgets.QLineEdit(self.content_widget) - self.setFocusProxy(text_input) - self.content_layout.addWidget(text_input, 1) - self.input_fields.append(text_input) + def create_gui(self, values): + if not self.multiplatform and not self.multipath: + input_data = {"key": self.key} + path_input = PathInputWidget( + input_data, values, self.keys, self, self.label_widget + ) + self.setFocusProxy(path_input) + self.content_layout.addWidget(path_input) + self.input_fields.append(path_input) + path_input.value_changed.connect(self._on_value_change) + return + + input_data_for_list = { + "object_type": "path-input" + } + if not self.multiplatform: + input_data_for_list["key"] = self.key + input_widget = ListWidget( + input_data_for_list, values, self.keys, self, self.label_widget + ) + self.setFocusProxy(input_widget) + self.content_layout.addWidget(input_widget) + self.input_fields.append(input_widget) + input_widget.value_changed.connect(self._on_value_change) + return + + proxy_widget = QtWidgets.QWidget(self.content_widget) + proxy_layout = QtWidgets.QFormLayout(proxy_widget) + for platform_key in self.platforms: + platform_label = self.platform_labels_mapping[platform_key] + label_widget = QtWidgets.QLabel(platform_label, proxy_widget) + if self.multipath: + input_data_for_list["key"] = platform_key + input_widget = ListWidget( + input_data_for_list, values, self.keys, self, label_widget + ) + else: + input_data = {"key": platform_key} + input_widget = PathInputWidget( + input_data, values, self.keys, self, label_widget + ) + proxy_layout.addRow(label_widget, input_widget) + self.input_fields.append(input_widget) + input_widget.value_changed.connect(self._on_value_change) + + self.setFocusProxy(self.input_fields[0]) + self.content_layout.addWidget(proxy_widget) def update_global_values(self, values): + print(self.__class__.__name__, "* TODO implement `update_global_values`") value = NOT_SET if not self._as_widget: value = self.value_from_values(values) @@ -2480,6 +2519,7 @@ class PathWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value def set_value(self, value, *, global_value=False): + print(self.__class__.__name__, "* TODO implement `set_value`") self.text_input.setText(value) if global_value: self.start_value = self.item_value() @@ -2487,12 +2527,15 @@ class PathWidget(QtWidgets.QWidget, InputObject): self._on_value_change() def reset_value(self): + print(self.__class__.__name__, "* TODO implement `reset_value`") self.set_value(self.start_value) def clear_value(self): + print(self.__class__.__name__, "* TODO implement `clear_value`") self.set_value("") def _on_value_change(self, item=None): + print(self.__class__.__name__, "* TODO implement `_on_value_change`") if self.ignore_value_changes: return @@ -2505,29 +2548,25 @@ class PathWidget(QtWidgets.QWidget, InputObject): self.value_changed.emit(self) def update_style(self): - state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified - ) - if self._state == state: - return - - if self._as_widget: - property_name = "input-state" - widget = self.text_input - else: - property_name = "state" - widget = self.label_widget - - widget.setProperty(property_name, state) - widget.style().polish(widget) + print(self.__class__.__name__, "* TODO implement `update_style`") def item_value(self): - return self.text_input.text() + if not self.multiplatform and not self.multipath: + return self.input_fields[0].item_value() + + if not self.multiplatform: + return self.input_fields[0].item_value() + + output = {} + for input_field in self.input_fields: + output.update(input_field.config_value()) + return output TypeToKlass.types["boolean"] = BooleanWidget TypeToKlass.types["text-singleline"] = TextSingleLineWidget TypeToKlass.types["path-input"] = PathInputWidget +TypeToKlass.types["path-widget"] = PathWidget TypeToKlass.types["text-multiline"] = TextMultiLineWidget TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["int"] = IntegerWidget From a8b4daa4646e66c326dd1c9926800cdc6a853c2e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 11:09:13 +0200 Subject: [PATCH 246/507] PathInput moved to widgets --- .../config_setting/widgets/inputs.py | 32 ++----------------- .../config_setting/widgets/widgets.py | 31 +++++++++++++++++- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 63db5cb2e2..812d005153 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -4,7 +4,8 @@ from Qt import QtWidgets, QtCore, QtGui from .widgets import ( ExpandingWidget, ModifiedIntSpinBox, - ModifiedFloatSpinBox + ModifiedFloatSpinBox, + PathInput ) from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass @@ -2247,35 +2248,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): return values, self.is_group -class PathInput(QtWidgets.QLineEdit): - def clear_end_path(self): - value = self.text().strip() - if value.endswith("/"): - while value and value[-1] == "/": - value = value[:-1] - self.setText(value) - - def keyPressEvent(self, event): - # Always change backslash `\` for forwardslash `/` - if event.key() == QtCore.Qt.Key_Backslash: - event.accept() - new_event = QtGui.QKeyEvent( - event.type(), - QtCore.Qt.Key_Slash, - event.modifiers(), - "/", - event.isAutoRepeat(), - event.count() - ) - QtWidgets.QApplication.sendEvent(self, new_event) - return - super(PathInput, self).keyPressEvent(event) - - def focusOutEvent(self, event): - super(PathInput, self).focusOutEvent(event) - self.clear_end_path() - - class PathInputWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index db41fda1f6..8e0dda42fd 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -1,4 +1,4 @@ -from Qt import QtWidgets, QtCore +from Qt import QtWidgets, QtCore, QtGui class ModifiedIntSpinBox(QtWidgets.QSpinBox): @@ -35,6 +35,35 @@ class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): event.ignore() +class PathInput(QtWidgets.QLineEdit): + def clear_end_path(self): + value = self.text().strip() + if value.endswith("/"): + while value and value[-1] == "/": + value = value[:-1] + self.setText(value) + + def keyPressEvent(self, event): + # Always change backslash `\` for forwardslash `/` + if event.key() == QtCore.Qt.Key_Backslash: + event.accept() + new_event = QtGui.QKeyEvent( + event.type(), + QtCore.Qt.Key_Slash, + event.modifiers(), + "/", + event.isAutoRepeat(), + event.count() + ) + QtWidgets.QApplication.sendEvent(self, new_event) + return + super(PathInput, self).keyPressEvent(event) + + def focusOutEvent(self, event): + super(PathInput, self).focusOutEvent(event) + self.clear_end_path() + + class ClickableWidget(QtWidgets.QLabel): clicked = QtCore.Signal() From 78c88a9429cfb0c7b6de22da6b332c1a97aae383 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 11:16:49 +0200 Subject: [PATCH 247/507] fixed ListItem right click --- .../tools/config_setting/config_setting/widgets/inputs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 812d005153..dbc220d89a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1140,6 +1140,14 @@ class ListItem(QtWidgets.QWidget, ConfigObject): return self.value_input.item_value() return NOT_SET + @property + def child_modified(self): + return self.value_input.child_modified + + @property + def child_overriden(self): + return self.value_input.child_overriden + class ListWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) From 22ec0a03b9116ce42e31c0d0ea71f4f05840d68e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 11:39:59 +0200 Subject: [PATCH 248/507] integer and lfoat widget merged into one number widget --- .../config_setting/widgets/widgets.py | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 8e0dda42fd..d5b0f088de 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -1,28 +1,12 @@ from Qt import QtWidgets, QtCore, QtGui -class ModifiedIntSpinBox(QtWidgets.QSpinBox): +class NumberSpinBox(QtWidgets.QDoubleSpinBox): def __init__(self, *args, **kwargs): min_value = kwargs.pop("minimum", -99999) max_value = kwargs.pop("maximum", 99999) - super(ModifiedIntSpinBox, self).__init__(*args, **kwargs) - self.setFocusPolicy(QtCore.Qt.StrongFocus) - self.setMinimum(min_value) - self.setMaximum(max_value) - - def wheelEvent(self, event): - if self.hasFocus(): - super(ModifiedIntSpinBox, self).wheelEvent(event) - else: - event.ignore() - - -class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): - def __init__(self, *args, **kwargs): - min_value = kwargs.pop("minimum", -99999) - max_value = kwargs.pop("maximum", 99999) - decimals = kwargs.pop("decimal", 2) - super(ModifiedFloatSpinBox, self).__init__(*args, **kwargs) + decimals = kwargs.pop("decimal", 0) + super(NumberSpinBox, self).__init__(*args, **kwargs) self.setFocusPolicy(QtCore.Qt.StrongFocus) self.setDecimals(decimals) self.setMinimum(min_value) @@ -30,7 +14,7 @@ class ModifiedFloatSpinBox(QtWidgets.QDoubleSpinBox): def wheelEvent(self, event): if self.hasFocus(): - super(ModifiedFloatSpinBox, self).wheelEvent(event) + super(NumberSpinBox, self).wheelEvent(event) else: event.ignore() From d0a5d2800650ac5a1165dfa5abf40faf1e72a081 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 11:40:52 +0200 Subject: [PATCH 249/507] integer and float input widgets also reduced to one input field with changeable "decimal" attribute --- .../projects_schema/1_plugins_gui_schema.json | 22 +-- .../studio_schema/0_studio_gui_schema.json | 2 +- .../studio_schema/1_tray_items.json | 10 +- .../config_setting/widgets/inputs.py | 154 ++---------------- 4 files changed, 33 insertions(+), 155 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 19d5127a95..e43518989a 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -39,7 +39,7 @@ "label": "Deadline apartment", "default": "" }, { - "type": "int", + "type": "number", "key": "deadline_priority", "label": "Deadline priority", "default": 50 @@ -59,7 +59,7 @@ "label": "Deadline Group", "default": "" }, { - "type": "int", + "type": "number", "key": "deadline_chunk_size", "label": "Deadline Chunk size", "default": 10 @@ -208,32 +208,32 @@ "label": "Burnin formating options", "children": [ { - "type": "int", + "type": "number", "key": "font_size", "label": "Font size", "default": 42 }, { - "type": "int", + "type": "number", "key": "opacity", "label": "Font opacity", "default": 1 }, { - "type": "int", + "type": "number", "key": "bg_opacity", "label": "Background opacity", "default": 1 }, { - "type": "int", + "type": "number", "key": "x_offset", "label": "X Offset", "default": 5 }, { - "type": "int", + "type": "number", "key": "y_offset", "label": "Y Offset", "default": 5 }, { - "type": "int", + "type": "number", "key": "bg_padding", "label": "Padding aroung text", "default": 5 @@ -525,7 +525,7 @@ "is_group": true, "children": [ { - "type": "int", + "type": "number", "key": "deadline_priority", "label": "deadline_priority", "default": 50 @@ -540,7 +540,7 @@ "label": "deadline_pool_secondary", "default": "" }, { - "type": "int", + "type": "number", "key": "deadline_chunk_size", "label": "deadline_chunk_size", "default": 1 @@ -639,7 +639,7 @@ "label": "Folder", "default": "takes" }, { - "type": "int", + "type": "number", "key": "steps", "label": "Steps", "default": 20 diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json index db465fb392..bde340250e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json @@ -21,7 +21,7 @@ "key": "muster", "children": [{ "type": "dict-modifiable", - "object_type": "int", + "object_type": "number", "input_modifiers": { "minimum": 0, "maximum": 300 diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json index 7cea724f29..610430b25e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -72,14 +72,14 @@ "expandable": true, "children": [ { - "type": "int", + "type": "number", "key": "default_port", "label": "Default Port", "minimum": 1, "maximum": 65535 }, { "type": "list", - "object_type": "int", + "object_type": "number", "key": "exclude_ports", "label": "Exclude ports", "input_modifiers": { @@ -95,11 +95,13 @@ "expandable": true, "children": [ { - "type": "float", + "type": "number", + "decimal": 2, "key": "full_time", "label": "Max idle time" }, { - "type": "float", + "type": "number", + "decimal": 2, "key": "message_time", "label": "When dialog will show" } diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index dbc220d89a..3e86b864b4 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -3,8 +3,7 @@ import logging from Qt import QtWidgets, QtCore, QtGui from .widgets import ( ExpandingWidget, - ModifiedIntSpinBox, - ModifiedFloatSpinBox, + NumberSpinBox, PathInput ) from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass @@ -446,13 +445,15 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): return self.checkbox.isChecked() -class IntegerWidget(QtWidgets.QWidget, InputObject): +class NumberWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) - input_modifiers = ("minimum", "maximum") + input_modifiers = ("minimum", "maximum", "decimal") def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + super(NumberWidget, self).__init__(parent) + self._parent = parent self._as_widget = values is AS_WIDGET @@ -462,8 +463,6 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): self._state = None - super(IntegerWidget, self).__init__(parent) - layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) @@ -473,15 +472,15 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): for modifier in self.input_modifiers if input_data.get(modifier) } - self.int_input = ModifiedIntSpinBox(self, **kwargs) + self.input_field = NumberSpinBox(self, **kwargs) - self.setFocusProxy(self.int_input) + self.setFocusProxy(self.input_field) if not self._as_widget and not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) layout.addWidget(label_widget, 0) - layout.addWidget(self.int_input, 1) + layout.addWidget(self.input_field, 1) if not self._as_widget: self.label_widget = label_widget @@ -495,17 +494,17 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): self.override_value = NOT_SET - self.int_input.valueChanged.connect(self._on_value_change) + self.input_field.valueChanged.connect(self._on_value_change) def update_global_values(self, values): value = NOT_SET if not self._as_widget: value = self.value_from_values(values) if value is not NOT_SET: - self.int_input.setValue(value) + self.input_field.setValue(value) elif self.default_value is not NOT_SET: - self.int_input.setValue(self.default_value) + self.input_field.setValue(self.default_value) self.global_value = value self.start_value = self.item_value() @@ -513,7 +512,7 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value def set_value(self, value, *, global_value=False): - self.int_input.setValue(value) + self.input_field.setValue(value) if global_value: self.start_value = self.item_value() self.global_value = self.item_value() @@ -546,7 +545,7 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): if self._as_widget: property_name = "input-state" - widget = self.int_input + widget = self.input_field else: property_name = "state" widget = self.label_widget @@ -555,129 +554,7 @@ class IntegerWidget(QtWidgets.QWidget, InputObject): widget.style().polish(widget) def item_value(self): - return self.int_input.value() - - -class FloatWidget(QtWidgets.QWidget, InputObject): - value_changed = QtCore.Signal(object) - input_modifiers = ("minimum", "maximum", "decimal") - - def __init__( - self, input_data, values, parent_keys, parent, label_widget=None - ): - self._parent = parent - self._as_widget = values is AS_WIDGET - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) - - self._state = None - - super(FloatWidget, self).__init__(parent) - - layout = QtWidgets.QHBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - - kwargs = { - modifier: input_data.get(modifier) - for modifier in self.input_modifiers - if input_data.get(modifier) - } - self.float_input = ModifiedFloatSpinBox(self, **kwargs) - - self.setFocusProxy(self.float_input) - - decimals = input_data.get("decimals", 5) - maximum = input_data.get("maximum") - minimum = input_data.get("minimum") - - self.float_input.setDecimals(decimals) - if maximum is not None: - self.float_input.setMaximum(float(maximum)) - if minimum is not None: - self.float_input.setMinimum(float(minimum)) - - if not self._as_widget and not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - layout.addWidget(self.float_input, 1) - - if not self._as_widget: - self.label_widget = label_widget - - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.update_global_values(values) - - self.override_value = NOT_SET - - self.float_input.valueChanged.connect(self._on_value_change) - - def update_global_values(self, values): - value = NOT_SET - if not self._as_widget: - value = self.value_from_values(values) - if value is not NOT_SET: - self.float_input.setValue(value) - - elif self.default_value is not NOT_SET: - self.float_input.setValue(self.default_value) - - self.global_value = value - self.start_value = self.item_value() - - self._is_modified = self.global_value != self.start_value - - def set_value(self, value, *, global_value=False): - self.float_input.setValue(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() - - def reset_value(self): - self.set_value(self.global_value) - - def clear_value(self): - self.set_value(0) - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - self._is_modified = self.item_value() != self.global_value - if self.is_overidable: - self._is_overriden = True - - self.update_style() - - self.value_changed.emit(self) - - def update_style(self): - state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified - ) - if self._state == state: - return - - if self._as_widget: - property_name = "input-state" - widget = self.float_input - else: - property_name = "state" - widget = self.label_widget - - widget.setProperty(property_name, state) - widget.style().polish(widget) - - def item_value(self): - return self.float_input.value() + return self.input_field.value() class TextSingleLineWidget(QtWidgets.QWidget, InputObject): @@ -2549,8 +2426,7 @@ TypeToKlass.types["path-input"] = PathInputWidget TypeToKlass.types["path-widget"] = PathWidget TypeToKlass.types["text-multiline"] = TextMultiLineWidget TypeToKlass.types["raw-json"] = RawJsonWidget -TypeToKlass.types["int"] = IntegerWidget -TypeToKlass.types["float"] = FloatWidget +TypeToKlass.types["number"] = NumberWidget TypeToKlass.types["dict-modifiable"] = ModifiableDict TypeToKlass.types["dict"] = DictWidget TypeToKlass.types["dict-form"] = DictFormWidget From d4a3a2ec17ed9fa87f8ddea823451d413432c513 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 11:56:06 +0200 Subject: [PATCH 250/507] changed order in boolean input --- .../config_setting/widgets/inputs.py | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3e86b864b4..0d2ff628ce 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -351,22 +351,20 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.checkbox = QtWidgets.QCheckBox(self) - - self.setFocusProxy(self.checkbox) - - self.checkbox.setAttribute(QtCore.Qt.WA_StyledBackground) - if not self._as_widget and not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - label_widget.setAttribute(QtCore.Qt.WA_StyledBackground) - layout.addWidget(label_widget, 0) - - layout.addWidget(self.checkbox, 1) - if not self._as_widget: + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + label_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + layout.addWidget(label_widget, 0) self.label_widget = label_widget + self.checkbox = QtWidgets.QCheckBox(self) + self.checkbox.setAttribute(QtCore.Qt.WA_StyledBackground) + layout.addWidget(self.checkbox, 1) + self.setFocusProxy(self.checkbox) + + if not self._as_widget: self.key = input_data["key"] keys = list(parent_keys) keys.append(self.key) From e79b051b59330027e1080cf648f10dfa55766d21 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 12:43:24 +0200 Subject: [PATCH 251/507] cleanup anatomy input imports --- .../config_setting/widgets/anatomy_inputs.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index addd0d6666..feae91ba99 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -1,13 +1,6 @@ -import json -import logging -from Qt import QtWidgets, QtCore, QtGui -from .widgets import ( - ExpandingWidget, - ModifiedIntSpinBox, - ModifiedFloatSpinBox -) -from .inputs import ConfigObject, InputObject -from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass +from Qt import QtWidgets, QtCore +from .inputs import InputObject +from .lib import NOT_SET, AS_WIDGET, TypeToKlass class AnatomyWidget(QtWidgets.QWidget, InputObject): From 0ceb697c21be236711e179dcd15f90d8cea522a9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 12:45:52 +0200 Subject: [PATCH 252/507] changed way how global values a propagated to inputs --- .../config_setting/widgets/base.py | 8 +- .../config_setting/widgets/inputs.py | 361 ++++++++---------- 2 files changed, 164 insertions(+), 205 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 9c1fee5b6f..cd459aa674 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -92,10 +92,10 @@ class StudioWidget(QtWidgets.QWidget): widget.deleteLater() self.input_fields.clear() - values = {"studio": config.studio_configurations()} self.schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") self.keys = self.schema.get("keys", []) - self.add_children_gui(self.schema, values) + self.add_children_gui(self.schema, lib.NOT_SET) + self._update_global_values() self.hierarchical_style_update() def _save(self): @@ -404,10 +404,10 @@ class ProjectWidget(QtWidgets.QWidget): input_field.hierarchical_style_update() def reset(self): - values = {"project": config.global_project_configurations()} self.schema = lib.gui_schema("projects_schema", "0_project_gui_schema") self.keys = self.schema.get("keys", []) - self.add_children_gui(self.schema, values) + self.add_children_gui(self.schema, lib.NOT_SET) + self._update_global_values() self.hierarchical_style_update() def add_children_gui(self, child_configuration, values): diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 0d2ff628ce..5f5747fd71 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -120,26 +120,6 @@ class ConfigObject: """Output for saving changes or overrides.""" return {self.key: self.item_value()} - def value_from_values(self, values, keys=None): - """Global getter of value based on loaded values.""" - if not values or values is AS_WIDGET: - return NOT_SET - - if keys is None: - keys = self.keys - - value = values - for key in keys: - if not isinstance(value, dict): - raise TypeError( - "Expected dictionary got {}.".format(str(type(value))) - ) - - if key not in value: - return NOT_SET - value = value[key] - return value - def style_state(self, is_invalid, is_overriden, is_modified): items = [] if is_invalid: @@ -336,22 +316,26 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + super(BooleanWidget, self).__init__(parent) + self._parent = parent self._as_widget = values is AS_WIDGET + self._state = None self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self._state = None - - super(BooleanWidget, self).__init__(parent) + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) if not self._as_widget: + self.key = input_data["key"] if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) @@ -364,21 +348,14 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): layout.addWidget(self.checkbox, 1) self.setFocusProxy(self.checkbox) - if not self._as_widget: - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.update_global_values(values) - self.override_value = NOT_SET - self.checkbox.stateChanged.connect(self._on_value_change) - def update_global_values(self, values): + def update_global_values(self, parent_values): value = NOT_SET if not self._as_widget: - value = self.value_from_values(values) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + if value is not NOT_SET: self.checkbox.setChecked(value) @@ -454,12 +431,15 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._as_widget = values is AS_WIDGET + self._state = None self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self._state = None + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -474,30 +454,24 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.setFocusProxy(self.input_field) - if not self._as_widget and not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - layout.addWidget(self.input_field, 1) - if not self._as_widget: + self.key = input_data["key"] + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.update_global_values(values) - - self.override_value = NOT_SET + layout.addWidget(self.input_field, 1) self.input_field.valueChanged.connect(self._on_value_change) - def update_global_values(self, values): + def update_global_values(self, parent_values): value = NOT_SET if not self._as_widget: - value = self.value_from_values(values) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + if value is not NOT_SET: self.input_field.setValue(value) @@ -561,16 +535,19 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + super(TextSingleLineWidget, self).__init__(parent) + self._parent = parent self._as_widget = values is AS_WIDGET + self._state = None self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self._state = None - - super(TextSingleLineWidget, self).__init__(parent) + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -580,30 +557,24 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): self.setFocusProxy(self.text_input) - if not self._as_widget and not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - layout.addWidget(self.text_input, 1) - if not self._as_widget: + self.key = input_data["key"] + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.update_global_values(values) - - self.override_value = NOT_SET + layout.addWidget(self.text_input, 1) self.text_input.textChanged.connect(self._on_value_change) - def update_global_values(self, values): + def update_global_values(self, parent_values): value = NOT_SET if not self._as_widget: - value = self.value_from_values(values) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + if value is not NOT_SET: self.text_input.setText(value) @@ -667,16 +638,19 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputObject): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + super(TextMultiLineWidget, self).__init__(parent) + self._parent = parent self._as_widget = values is AS_WIDGET + self._state = None self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self._state = None - - super(TextMultiLineWidget, self).__init__(parent) + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -686,30 +660,23 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputObject): self.setFocusProxy(self.text_input) - if not self._as_widget and not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - layout.addWidget(self.text_input, 1) - if not self._as_widget: - self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.update_global_values(values) - - self.override_value = NOT_SET + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) + self.label_widget = label_widget + layout.addWidget(self.text_input, 1) self.text_input.textChanged.connect(self._on_value_change) - def update_global_values(self, values): + def update_global_values(self, parent_values): value = NOT_SET if not self._as_widget: - value = self.value_from_values(values) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + if value is not NOT_SET: self.text_input.setPlainText(value) @@ -825,8 +792,11 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + super(RawJsonWidget, self).__init__(parent) + self._parent = parent self._as_widget = values is AS_WIDGET + self._state = None any_parent_is_group = parent.is_group if not any_parent_is_group: @@ -838,9 +808,9 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self._state = None - - super(RawJsonWidget, self).__init__(parent) + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -854,30 +824,23 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.setFocusProxy(self.text_input) - if not self._as_widget and not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - layout.addWidget(self.text_input, 1) - - self.override_value = NOT_SET - if not self._as_widget: - self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.update_global_values(values) + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) + self.label_widget = label_widget + layout.addWidget(self.text_input, 1) self.text_input.textChanged.connect(self._on_value_change) - def update_global_values(self, values): + def update_global_values(self, parent_values): value = NOT_SET if not self._as_widget: - value = self.value_from_values(values) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + if value is not NOT_SET: self.text_input.set_value(value) @@ -1030,12 +993,12 @@ class ListWidget(QtWidgets.QWidget, InputObject): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): - self._parent = parent - super(ListWidget, self).__init__(parent) self.setObjectName("ListWidget") + self._parent = parent self._state = None + self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) @@ -1043,18 +1006,14 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET + + self.key = input_data["key"] + self.input_fields = [] - inputs_widget = QtWidgets.QWidget(self) - inputs_widget.setAttribute(QtCore.Qt.WA_StyledBackground) - - inputs_layout = QtWidgets.QVBoxLayout(inputs_widget) - inputs_layout.setContentsMargins(0, 5, 0, 5) - inputs_layout.setSpacing(3) - - self.inputs_widget = inputs_widget - self.inputs_layout = inputs_layout - layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) @@ -1063,19 +1022,18 @@ class ListWidget(QtWidgets.QWidget, InputObject): label = input_data["label"] label_widget = QtWidgets.QLabel(label) layout.addWidget(label_widget) - self.label_widget = label_widget + inputs_widget = QtWidgets.QWidget(self) + inputs_widget.setAttribute(QtCore.Qt.WA_StyledBackground) layout.addWidget(inputs_widget) - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys + inputs_layout = QtWidgets.QVBoxLayout(inputs_widget) + inputs_layout.setContentsMargins(0, 5, 0, 5) + inputs_layout.setSpacing(3) - self.update_global_values(values) - - self.override_value = NOT_SET + self.inputs_widget = inputs_widget + self.inputs_layout = inputs_layout def count(self): return len(self.input_fields) @@ -1086,10 +1044,12 @@ class ListWidget(QtWidgets.QWidget, InputObject): def clear_value(self): self.set_value([]) - def update_global_values(self, values): + def update_global_values(self, parent_values): old_inputs = tuple(self.input_fields) - value = self.value_from_values(values) + value = NOT_SET + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) self.global_value = value @@ -1227,10 +1187,10 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__(self, object_type, input_modifiers, config_parent, parent): - self._parent = config_parent - super(ModifiableDictItem, self).__init__(parent) + self._parent = config_parent + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) @@ -1344,13 +1304,18 @@ class ModifiableDict(ExpandingWidget, InputObject): self, input_data, values, parent_keys, parent, label_widget=None ): - self._parent = parent - super(ModifiableDict, self).__init__(input_data["label"], parent) self.setObjectName("ModifiableDict") + self._parent = parent self._state = None + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET + + self.key = input_data["key"] + self.input_fields = [] any_parent_is_group = parent.is_group @@ -1378,22 +1343,15 @@ class ModifiableDict(ExpandingWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.override_value = NOT_SET - - self.update_global_values(values) - def count(self): return len(self.input_fields) - def update_global_values(self, values): + def update_global_values(self, parent_values): old_inputs = tuple(self.input_fields) - value = self.value_from_values(values) + value = NOT_SET + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) self.global_value = value @@ -1566,9 +1524,6 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys main_layout = QtWidgets.QHBoxLayout(self) main_layout.setContentsMargins(5, 5, 0, 5) @@ -1596,7 +1551,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.checkbox_key = input_data.get("checkbox_key") for child_data in input_data.get("children", []): - self.add_children_gui(child_data, values) + self.add_children_gui(child_data) expandable = input_data.get("expandable", True) if len(self.input_fields) == 1 and self.checkbox_widget: @@ -1634,9 +1589,13 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() - def update_global_values(self, values): + def update_global_values(self, parent_values): + value = NOT_SET + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + for item in self.input_fields: - item.update_global_values(values) + item.update_global_values(value) def apply_overrides(self, parent_values): # Make sure this is set to False @@ -1749,16 +1708,16 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): output.update(input_field.config_value()) return output - def add_children_gui(self, child_configuration, values): + def add_children_gui(self, child_configuration): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) if self.checkbox_key and not self.checkbox_widget: key = child_configuration.get("key") if key == self.checkbox_key: - return self._add_checkbox_child(child_configuration, values) + return self._add_checkbox_child(child_configuration) item = klass( - child_configuration, values, self.keys, self + child_configuration, NOT_SET, self.keys, self ) item.value_changed.connect(self._on_value_change) self.content_layout.addWidget(item) @@ -1766,9 +1725,9 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.input_fields.append(item) return item - def _add_checkbox_child(self, child_configuration, values): + def _add_checkbox_child(self, child_configuration): item = BooleanWidget( - child_configuration, values, self.keys, self, self.label_widget + child_configuration, NOT_SET, self.keys, self, self.label_widget ) item.value_changed.connect(self._on_value_change) @@ -1823,11 +1782,9 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.key = input_data["key"] - self.keys = list(parent_keys) - self.keys.append(self.key) for child_data in input_data.get("children", []): - self.add_children_gui(child_data, values) + self.add_children_gui(child_data) def update_style(self, *args, **kwargs): return @@ -1867,12 +1824,12 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): output.update(input_field.config_value()) return output - def add_children_gui(self, child_configuration, values): + def add_children_gui(self, child_configuration): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) item = klass( - child_configuration, values, self.keys, self + child_configuration, NOT_SET, self.keys, self ) self.layout().addWidget(item) @@ -1922,9 +1879,13 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() - def update_global_values(self, values): + def update_global_values(self, parent_values): + value = NOT_SET + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + for item in self.input_fields: - item.update_global_values(values) + item.update_global_values(value) def apply_overrides(self, parent_values): # Make sure this is set to False @@ -2001,7 +1962,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self.keys = list(parent_keys) for child_data in input_data.get("children", []): - self.add_children_gui(child_data, values) + self.add_children_gui(child_data) def mouseReleaseEvent(self, event): if event.button() == QtCore.Qt.RightButton: @@ -2042,9 +2003,9 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() - def update_global_values(self, values): + def update_global_values(self, value): for item in self.input_fields: - item.update_global_values(values) + item.update_global_values(value) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -2080,7 +2041,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): output.extend(input_field.get_invalid()) return output - def add_children_gui(self, child_configuration, values): + def add_children_gui(self, child_configuration): item_type = child_configuration["type"] # Pop label to not be set in child label = child_configuration["label"] @@ -2090,7 +2051,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): label_widget = FormLabel(label, self) item = klass( - child_configuration, values, self.keys, self, label_widget + child_configuration, NOT_SET, self.keys, self, label_widget ) label_widget.item = item @@ -2137,16 +2098,19 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): def __init__( self, input_data, values, parent_keys, parent, label_widget=None ): + super(PathInputWidget, self).__init__(parent) + self._parent = parent self._as_widget = values is AS_WIDGET + self._state = None self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self._state = None - - super(PathInputWidget, self).__init__(parent) + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -2156,30 +2120,23 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self.setFocusProxy(self.path_input) - if not self._as_widget and not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - layout.addWidget(self.path_input, 1) - if not self._as_widget: - self.label_widget = label_widget - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - - self.update_global_values(values) - - self.override_value = NOT_SET + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) + self.label_widget = label_widget + layout.addWidget(self.path_input, 1) self.path_input.textChanged.connect(self._on_value_change) - def update_global_values(self, values): + def update_global_values(self, parent_values): value = NOT_SET if not self._as_widget: - value = self.value_from_values(values) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + if value is not NOT_SET: self.path_input.setText(value) @@ -2305,15 +2262,13 @@ class PathWidget(QtWidgets.QWidget, InputObject): layout.addWidget(self.content_widget) - self.create_gui(values) + self.create_gui() - self.update_global_values(values) - - def create_gui(self, values): + def create_gui(self): if not self.multiplatform and not self.multipath: input_data = {"key": self.key} path_input = PathInputWidget( - input_data, values, self.keys, self, self.label_widget + input_data, NOT_SET, self.keys, self, self.label_widget ) self.setFocusProxy(path_input) self.content_layout.addWidget(path_input) @@ -2327,7 +2282,7 @@ class PathWidget(QtWidgets.QWidget, InputObject): if not self.multiplatform: input_data_for_list["key"] = self.key input_widget = ListWidget( - input_data_for_list, values, self.keys, self, self.label_widget + input_data_for_list, NOT_SET, self.keys, self, self.label_widget ) self.setFocusProxy(input_widget) self.content_layout.addWidget(input_widget) @@ -2343,12 +2298,12 @@ class PathWidget(QtWidgets.QWidget, InputObject): if self.multipath: input_data_for_list["key"] = platform_key input_widget = ListWidget( - input_data_for_list, values, self.keys, self, label_widget + input_data_for_list, NOT_SET, self.keys, self, label_widget ) else: input_data = {"key": platform_key} input_widget = PathInputWidget( - input_data, values, self.keys, self, label_widget + input_data, NOT_SET, self.keys, self, label_widget ) proxy_layout.addRow(label_widget, input_widget) self.input_fields.append(input_widget) @@ -2357,11 +2312,15 @@ class PathWidget(QtWidgets.QWidget, InputObject): self.setFocusProxy(self.input_fields[0]) self.content_layout.addWidget(proxy_widget) - def update_global_values(self, values): - print(self.__class__.__name__, "* TODO implement `update_global_values`") + def update_global_values(self, parent_values): + print( + self.__class__.__name__, "* TODO implement `update_global_values`" + ) value = NOT_SET if not self._as_widget: - value = self.value_from_values(values) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + if value is not NOT_SET: self.text_input.setText(value) From 370705a10a286770c1eb67994da67d2495762496 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 13:07:13 +0200 Subject: [PATCH 253/507] removed AS_WIDGET constant and reduced input args --- .../config_setting/widgets/anatomy_inputs.py | 6 +- .../config_setting/widgets/base.py | 16 +- .../config_setting/widgets/inputs.py | 193 ++++++++---------- .../config_setting/widgets/lib.py | 1 - 4 files changed, 95 insertions(+), 121 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index feae91ba99..7c9ac0d8f4 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -1,16 +1,16 @@ from Qt import QtWidgets, QtCore from .inputs import InputObject -from .lib import NOT_SET, AS_WIDGET, TypeToKlass +from .lib import NOT_SET, TypeToKlass class AnatomyWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): self._parent = parent - self._as_widget = values is AS_WIDGET + self._as_widget = as_widget self._is_group = True self._state = None diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index cd459aa674..f057f5a0f6 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -94,7 +94,7 @@ class StudioWidget(QtWidgets.QWidget): self.schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") self.keys = self.schema.get("keys", []) - self.add_children_gui(self.schema, lib.NOT_SET) + self.add_children_gui(self.schema) self._update_global_values() self.hierarchical_style_update() @@ -175,12 +175,10 @@ class StudioWidget(QtWidgets.QWidget): for input_field in self.input_fields: input_field.hierarchical_style_update() - def add_children_gui(self, child_configuration, values): + def add_children_gui(self, child_configuration): item_type = child_configuration["type"] klass = lib.TypeToKlass.types.get(item_type) - item = klass( - child_configuration, values, self.keys, self - ) + item = klass(child_configuration, self) self.input_fields.append(item) self.content_layout.addWidget(item) @@ -406,16 +404,14 @@ class ProjectWidget(QtWidgets.QWidget): def reset(self): self.schema = lib.gui_schema("projects_schema", "0_project_gui_schema") self.keys = self.schema.get("keys", []) - self.add_children_gui(self.schema, lib.NOT_SET) + self.add_children_gui(self.schema) self._update_global_values() self.hierarchical_style_update() - def add_children_gui(self, child_configuration, values): + def add_children_gui(self, child_configuration): item_type = child_configuration["type"] klass = lib.TypeToKlass.types.get(item_type) - item = klass( - child_configuration, values, self.keys, self - ) + item = klass(child_configuration, self) self.input_fields.append(item) self.content_layout.addWidget(item) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 5f5747fd71..336a8ef93e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -6,7 +6,7 @@ from .widgets import ( NumberSpinBox, PathInput ) -from .lib import NOT_SET, AS_WIDGET, METADATA_KEY, TypeToKlass +from .lib import NOT_SET, METADATA_KEY, TypeToKlass class ConfigObject: @@ -314,12 +314,12 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(BooleanWidget, self).__init__(parent) self._parent = parent - self._as_widget = values is AS_WIDGET + self._as_widget = as_widget self._state = None self._is_group = input_data.get("is_group", False) @@ -334,7 +334,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - if not self._as_widget: + if not as_widget: self.key = input_data["key"] if not label_widget: label = input_data["label"] @@ -425,12 +425,12 @@ class NumberWidget(QtWidgets.QWidget, InputObject): input_modifiers = ("minimum", "maximum", "decimal") def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(NumberWidget, self).__init__(parent) self._parent = parent - self._as_widget = values is AS_WIDGET + self._as_widget = as_widget self._state = None self._is_group = input_data.get("is_group", False) @@ -533,12 +533,12 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(TextSingleLineWidget, self).__init__(parent) self._parent = parent - self._as_widget = values is AS_WIDGET + self._as_widget = as_widget self._state = None self._is_group = input_data.get("is_group", False) @@ -636,12 +636,12 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(TextMultiLineWidget, self).__init__(parent) self._parent = parent - self._as_widget = values is AS_WIDGET + self._as_widget = as_widget self._state = None self._is_group = input_data.get("is_group", False) @@ -790,12 +790,12 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(RawJsonWidget, self).__init__(parent) self._parent = parent - self._as_widget = values is AS_WIDGET + self._as_widget = as_widget self._state = None any_parent_is_group = parent.is_group @@ -944,10 +944,9 @@ class ListItem(QtWidgets.QWidget, ConfigObject): ItemKlass = TypeToKlass.types[object_type] self.value_input = ItemKlass( input_modifiers, - AS_WIDGET, - [], self, - None + as_widget=True, + label_widget=None ) layout.addWidget(self.value_input, 1) @@ -991,7 +990,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(ListWidget, self).__init__(parent) self.setObjectName("ListWidget") @@ -1202,10 +1201,9 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.value_input = ItemKlass( input_modifiers, - AS_WIDGET, - [], self, - None + as_widget=True, + label_widget=None ) self.add_btn = QtWidgets.QPushButton("+") self.remove_btn = QtWidgets.QPushButton("-") @@ -1301,8 +1299,7 @@ class ModifiableDict(ExpandingWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, - label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(ModifiableDict, self).__init__(input_data["label"], parent) self.setObjectName("ModifiableDict") @@ -1498,9 +1495,9 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): - if values is AS_WIDGET: + if as_widget: raise TypeError("Can't use \"{}\" as widget item.".format( self.__class__.__name__ )) @@ -1564,6 +1561,32 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): else: body_widget.hide_toolbox(hide_content=False) + def add_children_gui(self, child_configuration): + item_type = child_configuration["type"] + klass = TypeToKlass.types.get(item_type) + if self.checkbox_key and not self.checkbox_widget: + key = child_configuration.get("key") + if key == self.checkbox_key: + return self._add_checkbox_child(child_configuration) + + item = klass(child_configuration, self) + item.value_changed.connect(self._on_value_change) + self.content_layout.addWidget(item) + + self.input_fields.append(item) + return item + + def _add_checkbox_child(self, child_configuration): + item = BooleanWidget( + child_configuration, self, label_widget=self.label_widget + ) + item.value_changed.connect(self._on_value_change) + + self.body_widget.top_part.layout().addWidget(item) + self.checkbox_widget = item + self.input_fields.append(item) + return item + def remove_overrides(self): self._is_overriden = False self._is_modified = False @@ -1708,34 +1731,6 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): output.update(input_field.config_value()) return output - def add_children_gui(self, child_configuration): - item_type = child_configuration["type"] - klass = TypeToKlass.types.get(item_type) - if self.checkbox_key and not self.checkbox_widget: - key = child_configuration.get("key") - if key == self.checkbox_key: - return self._add_checkbox_child(child_configuration) - - item = klass( - child_configuration, NOT_SET, self.keys, self - ) - item.value_changed.connect(self._on_value_change) - self.content_layout.addWidget(item) - - self.input_fields.append(item) - return item - - def _add_checkbox_child(self, child_configuration): - item = BooleanWidget( - child_configuration, NOT_SET, self.keys, self, self.label_widget - ) - item.value_changed.connect(self._on_value_change) - - self.body_widget.top_part.layout().addWidget(item) - self.checkbox_widget = item - self.input_fields.append(item) - return item - def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False @@ -1759,7 +1754,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): allow_actions = False def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): self._parent = parent @@ -1786,6 +1781,18 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): for child_data in input_data.get("children", []): self.add_children_gui(child_data) + def add_children_gui(self, child_configuration): + item_type = child_configuration["type"] + klass = TypeToKlass.types.get(item_type) + + item = klass(child_configuration, self) + self.layout().addWidget(item) + + item.value_changed.connect(self._on_value_change) + + self.input_fields.append(item) + return item + def update_style(self, *args, **kwargs): return @@ -1824,20 +1831,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): output.update(input_field.config_value()) return output - def add_children_gui(self, child_configuration): - item_type = child_configuration["type"] - klass = TypeToKlass.types.get(item_type) - - item = klass( - child_configuration, NOT_SET, self.keys, self - ) - self.layout().addWidget(item) - - item.value_changed.connect(self._on_value_change) - - self.input_fields.append(item) - return item - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1942,7 +1935,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): allow_actions = False def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): self._parent = parent @@ -1959,11 +1952,26 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.content_layout = QtWidgets.QFormLayout(self) - self.keys = list(parent_keys) - for child_data in input_data.get("children", []): self.add_children_gui(child_data) + def add_children_gui(self, child_configuration): + item_type = child_configuration["type"] + # Pop label to not be set in child + label = child_configuration["label"] + + klass = TypeToKlass.types.get(item_type) + + label_widget = FormLabel(label, self) + + item = klass(child_configuration, self, label_widget=label_widget) + label_widget.item = item + + item.value_changed.connect(self._on_value_change) + self.content_layout.addRow(label_widget, item) + self.input_fields.append(item) + return item + def mouseReleaseEvent(self, event): if event.button() == QtCore.Qt.RightButton: position = self.mapFromGlobal(QtGui.QCursor().pos()) @@ -2041,25 +2049,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): output.extend(input_field.get_invalid()) return output - def add_children_gui(self, child_configuration): - item_type = child_configuration["type"] - # Pop label to not be set in child - label = child_configuration["label"] - - klass = TypeToKlass.types.get(item_type) - - label_widget = FormLabel(label, self) - - item = klass( - child_configuration, NOT_SET, self.keys, self, label_widget - ) - label_widget.item = item - - item.value_changed.connect(self._on_value_change) - self.content_layout.addRow(label_widget, item) - self.input_fields.append(item) - return item - def hierarchical_style_update(self): for input_field in self.input_fields: input_field.hierarchical_style_update() @@ -2096,12 +2085,12 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(PathInputWidget, self).__init__(parent) self._parent = parent - self._as_widget = values is AS_WIDGET + self._as_widget = as_widget self._state = None self._is_group = input_data.get("is_group", False) @@ -2214,12 +2203,11 @@ class PathWidget(QtWidgets.QWidget, InputObject): } def __init__( - self, input_data, values, parent_keys, parent, label_widget=None + self, input_data, parent, as_widget=False, label_widget=None ): super(PathWidget, self).__init__(parent) self._parent = parent - self._as_widget = values is AS_WIDGET self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) @@ -2234,12 +2222,6 @@ class PathWidget(QtWidgets.QWidget, InputObject): self.input_fields = [] - if not self._as_widget: - self.key = input_data["key"] - keys = list(parent_keys) - keys.append(self.key) - self.keys = keys - if not self.multiplatform and not self.multipath: layout = QtWidgets.QHBoxLayout(self) else: @@ -2247,13 +2229,12 @@ class PathWidget(QtWidgets.QWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - if not self._as_widget and not label_widget: + self.key = input_data["key"] + if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) layout.addWidget(label_widget, 0) - self.label_widget = label_widget - layout.addWidget(label_widget) self.content_widget = QtWidgets.QWidget(self) self.content_layout = QtWidgets.QVBoxLayout(self.content_widget) @@ -2267,9 +2248,7 @@ class PathWidget(QtWidgets.QWidget, InputObject): def create_gui(self): if not self.multiplatform and not self.multipath: input_data = {"key": self.key} - path_input = PathInputWidget( - input_data, NOT_SET, self.keys, self, self.label_widget - ) + path_input = PathInputWidget(input_data, self, self.label_widget) self.setFocusProxy(path_input) self.content_layout.addWidget(path_input) self.input_fields.append(path_input) @@ -2282,7 +2261,7 @@ class PathWidget(QtWidgets.QWidget, InputObject): if not self.multiplatform: input_data_for_list["key"] = self.key input_widget = ListWidget( - input_data_for_list, NOT_SET, self.keys, self, self.label_widget + input_data_for_list, self, self.label_widget ) self.setFocusProxy(input_widget) self.content_layout.addWidget(input_widget) @@ -2298,12 +2277,12 @@ class PathWidget(QtWidgets.QWidget, InputObject): if self.multipath: input_data_for_list["key"] = platform_key input_widget = ListWidget( - input_data_for_list, NOT_SET, self.keys, self, label_widget + input_data_for_list, self, label_widget ) else: input_data = {"key": platform_key} input_widget = PathInputWidget( - input_data, NOT_SET, self.keys, self, label_widget + input_data, self, label_widget ) proxy_layout.addRow(label_widget, input_widget) self.input_fields.append(input_widget) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index c416f7a5b0..4669004b53 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -12,7 +12,6 @@ class TypeToKlass: NOT_SET = type("NOT_SET", (), {}) -AS_WIDGET = type("AS_WIDGET", (), {}) METADATA_KEY = type("METADATA_KEY", (), {}) OVERRIDE_VERSION = 1 From 9c34ee32abd971a80ff4c4fb44f26d23d96bda65 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 16:37:03 +0200 Subject: [PATCH 254/507] few updates and fixes for path input --- .../config_setting/widgets/inputs.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 336a8ef93e..53054b27a6 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2105,10 +2105,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.path_input = PathInput(self) - - self.setFocusProxy(self.path_input) - if not self._as_widget: self.key = input_data["key"] if not label_widget: @@ -2116,6 +2112,9 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): label_widget = QtWidgets.QLabel(label) layout.addWidget(label_widget, 0) self.label_widget = label_widget + + self.path_input = PathInput(self) + self.setFocusProxy(self.path_input) layout.addWidget(self.path_input, 1) self.path_input.textChanged.connect(self._on_value_change) @@ -2217,6 +2216,8 @@ class PathWidget(QtWidgets.QWidget, InputObject): self.multipath = input_data.get("multipath", False) self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET self._state = None @@ -2248,7 +2249,9 @@ class PathWidget(QtWidgets.QWidget, InputObject): def create_gui(self): if not self.multiplatform and not self.multipath: input_data = {"key": self.key} - path_input = PathInputWidget(input_data, self, self.label_widget) + path_input = PathInputWidget( + input_data, self, label_widget=self.label_widget + ) self.setFocusProxy(path_input) self.content_layout.addWidget(path_input) self.input_fields.append(path_input) @@ -2261,7 +2264,7 @@ class PathWidget(QtWidgets.QWidget, InputObject): if not self.multiplatform: input_data_for_list["key"] = self.key input_widget = ListWidget( - input_data_for_list, self, self.label_widget + input_data_for_list, self, label_widget=self.label_widget ) self.setFocusProxy(input_widget) self.content_layout.addWidget(input_widget) @@ -2277,12 +2280,12 @@ class PathWidget(QtWidgets.QWidget, InputObject): if self.multipath: input_data_for_list["key"] = platform_key input_widget = ListWidget( - input_data_for_list, self, label_widget + input_data_for_list, self, label_widget=label_widget ) else: input_data = {"key": platform_key} input_widget = PathInputWidget( - input_data, self, label_widget + input_data, self, label_widget=label_widget ) proxy_layout.addRow(label_widget, input_widget) self.input_fields.append(input_widget) From e3a62eae3fd2cd17fa186eb1982f56017c7a24be Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 16:37:15 +0200 Subject: [PATCH 255/507] path widget can update global values --- .../config_setting/widgets/inputs.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 53054b27a6..23068ce236 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2295,19 +2295,16 @@ class PathWidget(QtWidgets.QWidget, InputObject): self.content_layout.addWidget(proxy_widget) def update_global_values(self, parent_values): - print( - self.__class__.__name__, "* TODO implement `update_global_values`" - ) value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) - if value is not NOT_SET: - self.text_input.setText(value) + if not self.multiplatform: + self.input_fields[0].update_global_values(parent_values) - elif self.default_value is not NOT_SET: - self.text_input.setText(self.default_value) + elif self.multiplatform: + for input_field in self.input_fields: + input_field.update_global_values(value) self.global_value = value self.start_value = self.item_value() From 4c0f0a6bddcd688f255d6475db8e196be50d559d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 16:45:18 +0200 Subject: [PATCH 256/507] reorganization --- .../config_setting/widgets/inputs.py | 572 +++++++++--------- 1 file changed, 289 insertions(+), 283 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 23068ce236..ac08a9ae4f 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -734,6 +734,111 @@ class TextMultiLineWidget(QtWidgets.QWidget, InputObject): return self.text_input.toPlainText() +class PathInputWidget(QtWidgets.QWidget, InputObject): + value_changed = QtCore.Signal(object) + + def __init__( + self, input_data, parent, as_widget=False, label_widget=None + ): + super(PathInputWidget, self).__init__(parent) + + self._parent = parent + self._as_widget = as_widget + self._state = None + + self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) + self.default_value = input_data.get("default", NOT_SET) + + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + + if not self._as_widget: + self.key = input_data["key"] + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) + self.label_widget = label_widget + + self.path_input = PathInput(self) + self.setFocusProxy(self.path_input) + layout.addWidget(self.path_input, 1) + + self.path_input.textChanged.connect(self._on_value_change) + + def update_global_values(self, parent_values): + value = NOT_SET + if not self._as_widget: + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + if value is not NOT_SET: + self.path_input.setText(value) + + elif self.default_value is not NOT_SET: + self.path_input.setText(self.default_value) + + self.global_value = value + self.start_value = self.item_value() + + self._is_modified = self.global_value != self.start_value + + def set_value(self, value, *, global_value=False): + self.path_input.setText(value) + if global_value: + self.start_value = self.item_value() + self.global_value = self.item_value() + self._on_value_change() + + def reset_value(self): + self.set_value(self.start_value) + + def clear_value(self): + self.set_value("") + + def focusOutEvent(self, event): + self.path_input.clear_end_path() + super(PathInput, self).focusOutEvent(event) + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + self._is_modified = self.item_value() != self.global_value + if self.is_overidable: + self._is_overriden = True + + self.update_style() + + self.value_changed.emit(self) + + def update_style(self): + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) + if self._state == state: + return + + if self._as_widget: + property_name = "input-state" + widget = self.path_input + else: + property_name = "state" + widget = self.label_widget + + widget.setProperty(property_name, state) + widget.style().polish(widget) + + def item_value(self): + return self.path_input.text() + + class RawJsonInput(QtWidgets.QPlainTextEdit): tab_length = 4 @@ -1923,13 +2028,189 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): return {self.key: values}, self.is_group +class PathWidget(QtWidgets.QWidget, InputObject): + value_changed = QtCore.Signal(object) + + platforms = ("windows", "darwin", "linux") + platform_labels_mapping = { + "windows": "Windows", + "darwin": "MacOS", + "linux": "Linux" + } + platform_separators = { + "windows": ";", + "darwin": ":", + "linux": ":" + } + + def __init__( + self, input_data, parent, as_widget=False, label_widget=None + ): + super(PathWidget, self).__init__(parent) + + self._parent = parent + + self._is_group = input_data.get("is_group", False) + self._is_nullable = input_data.get("is_nullable", False) + + self.default_value = input_data.get("default", NOT_SET) + self.multiplatform = input_data.get("multiplatform", False) + self.multipath = input_data.get("multipath", False) + + self.override_value = NOT_SET + self.global_value = NOT_SET + self.start_value = NOT_SET + + self._state = None + + self.input_fields = [] + + if not self.multiplatform and not self.multipath: + layout = QtWidgets.QHBoxLayout(self) + else: + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(5) + + self.key = input_data["key"] + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + layout.addWidget(label_widget, 0) + self.label_widget = label_widget + + self.content_widget = QtWidgets.QWidget(self) + self.content_layout = QtWidgets.QVBoxLayout(self.content_widget) + self.content_layout.setSpacing(0) + self.content_layout.setContentsMargins(0, 0, 0, 0) + + layout.addWidget(self.content_widget) + + self.create_gui() + + def create_gui(self): + if not self.multiplatform and not self.multipath: + input_data = {"key": self.key} + path_input = PathInputWidget( + input_data, self, label_widget=self.label_widget + ) + self.setFocusProxy(path_input) + self.content_layout.addWidget(path_input) + self.input_fields.append(path_input) + path_input.value_changed.connect(self._on_value_change) + return + + input_data_for_list = { + "object_type": "path-input" + } + if not self.multiplatform: + input_data_for_list["key"] = self.key + input_widget = ListWidget( + input_data_for_list, self, label_widget=self.label_widget + ) + self.setFocusProxy(input_widget) + self.content_layout.addWidget(input_widget) + self.input_fields.append(input_widget) + input_widget.value_changed.connect(self._on_value_change) + return + + proxy_widget = QtWidgets.QWidget(self.content_widget) + proxy_layout = QtWidgets.QFormLayout(proxy_widget) + for platform_key in self.platforms: + platform_label = self.platform_labels_mapping[platform_key] + label_widget = QtWidgets.QLabel(platform_label, proxy_widget) + if self.multipath: + input_data_for_list["key"] = platform_key + input_widget = ListWidget( + input_data_for_list, self, label_widget=label_widget + ) + else: + input_data = {"key": platform_key} + input_widget = PathInputWidget( + input_data, self, label_widget=label_widget + ) + proxy_layout.addRow(label_widget, input_widget) + self.input_fields.append(input_widget) + input_widget.value_changed.connect(self._on_value_change) + + self.setFocusProxy(self.input_fields[0]) + self.content_layout.addWidget(proxy_widget) + + def update_global_values(self, parent_values): + value = NOT_SET + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + if not self.multiplatform: + self.input_fields[0].update_global_values(parent_values) + + elif self.multiplatform: + for input_field in self.input_fields: + input_field.update_global_values(value) + + self.global_value = value + self.start_value = self.item_value() + + self._is_modified = self.global_value != self.start_value + + def set_value(self, value, *, global_value=False): + if not self.multiplatform: + self.input_fields[0].set_value(value, global_value=global_value) + + else: + for input_field in self.input_fields: + _value = value[input_field.key] + input_field.set_value(_value) + + if global_value: + self.global_value = value + self.start_value = self.item_value() + self._on_value_change() + + def reset_value(self): + for input_field in self.input_fields: + input_field.reset_value() + + def clear_value(self): + for input_field in self.input_fields: + input_field.clear_value() + + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + self._is_modified = self.item_value() != self.global_value + if self.is_overidable: + self._is_overriden = True + + self.update_style() + + self.value_changed.emit(self) + + def update_style(self): + for input_field in self.input_fields: + input_field.update_style() + + def item_value(self): + if not self.multiplatform and not self.multipath: + return self.input_fields[0].item_value() + + if not self.multiplatform: + return self.input_fields[0].item_value() + + output = {} + for input_field in self.input_fields: + output.update(input_field.config_value()) + return output + + +# Proxy for form layout class FormLabel(QtWidgets.QLabel): def __init__(self, *args, **kwargs): super(FormLabel, self).__init__(*args, **kwargs) self.item = None -# Proxy for form layout class DictFormWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) allow_actions = False @@ -2081,290 +2362,15 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): return values, self.is_group -class PathInputWidget(QtWidgets.QWidget, InputObject): - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, parent, as_widget=False, label_widget=None - ): - super(PathInputWidget, self).__init__(parent) - - self._parent = parent - self._as_widget = as_widget - self._state = None - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) - - self.override_value = NOT_SET - self.global_value = NOT_SET - self.start_value = NOT_SET - - layout = QtWidgets.QHBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - - if not self._as_widget: - self.key = input_data["key"] - if not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - self.label_widget = label_widget - - self.path_input = PathInput(self) - self.setFocusProxy(self.path_input) - layout.addWidget(self.path_input, 1) - - self.path_input.textChanged.connect(self._on_value_change) - - def update_global_values(self, parent_values): - value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if value is not NOT_SET: - self.path_input.setText(value) - - elif self.default_value is not NOT_SET: - self.path_input.setText(self.default_value) - - self.global_value = value - self.start_value = self.item_value() - - self._is_modified = self.global_value != self.start_value - - def set_value(self, value, *, global_value=False): - self.path_input.setText(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() - - def reset_value(self): - self.set_value(self.start_value) - - def clear_value(self): - self.set_value("") - - def focusOutEvent(self, event): - self.path_input.clear_end_path() - super(PathInput, self).focusOutEvent(event) - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - self._is_modified = self.item_value() != self.global_value - if self.is_overidable: - self._is_overriden = True - - self.update_style() - - self.value_changed.emit(self) - - def update_style(self): - state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified - ) - if self._state == state: - return - - if self._as_widget: - property_name = "input-state" - widget = self.path_input - else: - property_name = "state" - widget = self.label_widget - - widget.setProperty(property_name, state) - widget.style().polish(widget) - - def item_value(self): - return self.path_input.text() - - -class PathWidget(QtWidgets.QWidget, InputObject): - value_changed = QtCore.Signal(object) - - platforms = ("windows", "darwin", "linux") - platform_labels_mapping = { - "windows": "Windows", - "darwin": "MacOS", - "linux": "Linux" - } - platform_separators = { - "windows": ";", - "darwin": ":", - "linux": ":" - } - - def __init__( - self, input_data, parent, as_widget=False, label_widget=None - ): - super(PathWidget, self).__init__(parent) - - self._parent = parent - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - - self.default_value = input_data.get("default", NOT_SET) - self.multiplatform = input_data.get("multiplatform", False) - self.multipath = input_data.get("multipath", False) - - self.override_value = NOT_SET - self.global_value = NOT_SET - self.start_value = NOT_SET - - self._state = None - - self.input_fields = [] - - if not self.multiplatform and not self.multipath: - layout = QtWidgets.QHBoxLayout(self) - else: - layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - - self.key = input_data["key"] - if not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - self.label_widget = label_widget - - self.content_widget = QtWidgets.QWidget(self) - self.content_layout = QtWidgets.QVBoxLayout(self.content_widget) - self.content_layout.setSpacing(0) - self.content_layout.setContentsMargins(0, 0, 0, 0) - - layout.addWidget(self.content_widget) - - self.create_gui() - - def create_gui(self): - if not self.multiplatform and not self.multipath: - input_data = {"key": self.key} - path_input = PathInputWidget( - input_data, self, label_widget=self.label_widget - ) - self.setFocusProxy(path_input) - self.content_layout.addWidget(path_input) - self.input_fields.append(path_input) - path_input.value_changed.connect(self._on_value_change) - return - - input_data_for_list = { - "object_type": "path-input" - } - if not self.multiplatform: - input_data_for_list["key"] = self.key - input_widget = ListWidget( - input_data_for_list, self, label_widget=self.label_widget - ) - self.setFocusProxy(input_widget) - self.content_layout.addWidget(input_widget) - self.input_fields.append(input_widget) - input_widget.value_changed.connect(self._on_value_change) - return - - proxy_widget = QtWidgets.QWidget(self.content_widget) - proxy_layout = QtWidgets.QFormLayout(proxy_widget) - for platform_key in self.platforms: - platform_label = self.platform_labels_mapping[platform_key] - label_widget = QtWidgets.QLabel(platform_label, proxy_widget) - if self.multipath: - input_data_for_list["key"] = platform_key - input_widget = ListWidget( - input_data_for_list, self, label_widget=label_widget - ) - else: - input_data = {"key": platform_key} - input_widget = PathInputWidget( - input_data, self, label_widget=label_widget - ) - proxy_layout.addRow(label_widget, input_widget) - self.input_fields.append(input_widget) - input_widget.value_changed.connect(self._on_value_change) - - self.setFocusProxy(self.input_fields[0]) - self.content_layout.addWidget(proxy_widget) - - def update_global_values(self, parent_values): - value = NOT_SET - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if not self.multiplatform: - self.input_fields[0].update_global_values(parent_values) - - elif self.multiplatform: - for input_field in self.input_fields: - input_field.update_global_values(value) - - self.global_value = value - self.start_value = self.item_value() - - self._is_modified = self.global_value != self.start_value - - def set_value(self, value, *, global_value=False): - print(self.__class__.__name__, "* TODO implement `set_value`") - self.text_input.setText(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() - - def reset_value(self): - print(self.__class__.__name__, "* TODO implement `reset_value`") - self.set_value(self.start_value) - - def clear_value(self): - print(self.__class__.__name__, "* TODO implement `clear_value`") - self.set_value("") - - def _on_value_change(self, item=None): - print(self.__class__.__name__, "* TODO implement `_on_value_change`") - if self.ignore_value_changes: - return - - self._is_modified = self.item_value() != self.global_value - if self.is_overidable: - self._is_overriden = True - - self.update_style() - - self.value_changed.emit(self) - - def update_style(self): - print(self.__class__.__name__, "* TODO implement `update_style`") - - def item_value(self): - if not self.multiplatform and not self.multipath: - return self.input_fields[0].item_value() - - if not self.multiplatform: - return self.input_fields[0].item_value() - - output = {} - for input_field in self.input_fields: - output.update(input_field.config_value()) - return output - - TypeToKlass.types["boolean"] = BooleanWidget -TypeToKlass.types["text-singleline"] = TextSingleLineWidget -TypeToKlass.types["path-input"] = PathInputWidget -TypeToKlass.types["path-widget"] = PathWidget -TypeToKlass.types["text-multiline"] = TextMultiLineWidget -TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["number"] = NumberWidget +TypeToKlass.types["text-singleline"] = TextSingleLineWidget +TypeToKlass.types["text-multiline"] = TextMultiLineWidget +TypeToKlass.types["path-input"] = PathInputWidget +TypeToKlass.types["raw-json"] = RawJsonWidget +TypeToKlass.types["list"] = ListWidget TypeToKlass.types["dict-modifiable"] = ModifiableDict TypeToKlass.types["dict"] = DictWidget -TypeToKlass.types["dict-form"] = DictFormWidget TypeToKlass.types["dict-invisible"] = DictInvisible -TypeToKlass.types["list"] = ListWidget +TypeToKlass.types["path-widget"] = PathWidget +TypeToKlass.types["dict-form"] = DictFormWidget From b183564954bd29735a85630ef2246fec0f1f3282 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 16:52:13 +0200 Subject: [PATCH 257/507] text input has one input widget with settable attribute "multiline" --- .../1_ftrack_projects_gui_schema.json | 6 +- .../projects_schema/1_plugins_gui_schema.json | 42 +++--- .../studio_schema/1_intents_gui_schema.json | 4 +- .../studio_schema/1_tray_items.json | 2 +- .../config_setting/widgets/inputs.py | 128 +++--------------- 5 files changed, 45 insertions(+), 137 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json index 51c05aeb3a..6608463100 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json @@ -14,11 +14,11 @@ "children": [ { "key": "Ready", - "type": "text-singleline", + "type": "text", "label": "Ready" }, { "key": "Ready2", - "type": "text-singleline", + "type": "text", "label": "Ready2" } ] @@ -32,7 +32,7 @@ "children": [ { "key": "in progress", - "type": "text-singleline", + "type": "text", "label": "In Progress" } ] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index e43518989a..98fbfb206d 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -34,7 +34,7 @@ "type": "dict-form", "children": [ { - "type": "text-singleline", + "type": "text", "key": "deadline_department", "label": "Deadline apartment", "default": "" @@ -44,17 +44,17 @@ "label": "Deadline priority", "default": 50 }, { - "type": "text-singleline", + "type": "text", "key": "deadline_pool", "label": "Deadline pool", "default": "" }, { - "type": "text-singleline", + "type": "text", "key": "deadline_pool_secondary", "label": "Deadline pool (secondary)", "default": "" }, { - "type": "text-singleline", + "type": "text", "key": "deadline_group", "label": "Deadline Group", "default": "" @@ -98,13 +98,13 @@ "label": "Enabled", "default": false }, { - "type": "text-singleline", + "type": "text", "key": "note_with_intent_template", "label": "Note with intent template", "default": "{intent}: {comment}" }, { "type": "list", - "object_type": "text-singleline", + "object_type": "text", "key": "note_labels", "label": "Note labels", "default": [] @@ -155,13 +155,13 @@ "children": [ { "type": "list", - "object_type": "text-singleline", + "object_type": "text", "key": "input", "label": "FFmpeg input arguments", "default": [] }, { "type": "list", - "object_type": "text-singleline", + "object_type": "text", "key": "output", "label": "FFmpeg output arguments", "default": [] @@ -271,15 +271,15 @@ "key": "enabled", "label": "Enabled" }, { - "type": "text-singleline", + "type": "text", "key": "deadline_department", "label": "Deadline department" }, { - "type": "text-singleline", + "type": "text", "key": "deadline_pool", "label": "Deadline Pool" }, { - "type": "text-singleline", + "type": "text", "key": "deadline_group", "label": "Deadline Group" } @@ -314,11 +314,11 @@ "key": "enabled", "label": "Enabled" }, { - "type": "text-singleline", + "type": "text", "key": "material_file", "label": "Material File" }, { - "type": "text-singleline", + "type": "text", "key": "regex", "label": "Validation regex", "default": "(.*)_(\\d)*_(?P.*)_(GEO)" @@ -351,7 +351,7 @@ "key": "enabled", "label": "Enabled" }, { - "type": "text-singleline", + "type": "text", "key": "regex", "label": "Validation regex", "default": "(?P.*)_(.*)_SHD" @@ -401,7 +401,7 @@ "is_group": true, "children": [ { - "type": "text-singleline", + "type": "text", "key": "fpath_template", "label": "Path template", "default": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" @@ -415,7 +415,7 @@ "is_group": true, "children": [ { - "type": "text-singleline", + "type": "text", "key": "fpath_template", "label": "Path template", "default": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" @@ -530,12 +530,12 @@ "label": "deadline_priority", "default": 50 }, { - "type": "text-singleline", + "type": "text", "key": "deadline_pool", "label": "deadline_pool", "default": "" }, { - "type": "text-singleline", + "type": "text", "key": "deadline_pool_secondary", "label": "deadline_pool_secondary", "default": "" @@ -598,7 +598,7 @@ "default": true }, { "type": "list", - "object_type": "text-singleline", + "object_type": "text", "key": "tags_addition", "label": "Tags addition", "default": [] @@ -629,12 +629,12 @@ "is_group": true, "children": [ { - "type": "text-singleline", + "type": "text", "key": "clipName", "label": "Clip name template", "default": "{track}{sequence}{shot}" }, { - "type": "text-singleline", + "type": "text", "key": "folder", "label": "Folder", "default": "takes" diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json index 18f3d42ba7..a4b5e16fa1 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json @@ -8,11 +8,11 @@ "children": [ { "type": "dict-modifiable", - "object_type": "text-singleline", + "object_type": "text", "key": "items", "label": "Intent Key/Label" }, { - "type": "text-singleline", + "type": "text", "key": "default", "label": "Default intent" } diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json index 610430b25e..13ab0293de 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json @@ -113,7 +113,7 @@ "expandable": true, "children": [ { - "type": "text-singleline", + "type": "text", "key": "workspace_name", "label": "Workspace name" } diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ac08a9ae4f..ce14e575cf 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -529,13 +529,13 @@ class NumberWidget(QtWidgets.QWidget, InputObject): return self.input_field.value() -class TextSingleLineWidget(QtWidgets.QWidget, InputObject): +class TextWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( self, input_data, parent, as_widget=False, label_widget=None ): - super(TextSingleLineWidget, self).__init__(parent) + super(TextWidget, self).__init__(parent) self._parent = parent self._as_widget = as_widget @@ -545,6 +545,8 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) + self.multiline = input_data.get("multiline", False) + self.override_value = NOT_SET self.global_value = NOT_SET self.start_value = NOT_SET @@ -553,7 +555,10 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.text_input = QtWidgets.QLineEdit(self) + if self.multiline: + self.text_input = QtWidgets.QPlainTextEdit(self) + else: + self.text_input = QtWidgets.QLineEdit(self) self.setFocusProxy(self.text_input) @@ -576,10 +581,10 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): value = parent_values.get(self.key, NOT_SET) if value is not NOT_SET: - self.text_input.setText(value) + self.set_value(value) elif self.default_value is not NOT_SET: - self.text_input.setText(self.default_value) + self.set_value(self.default_value) self.global_value = value self.start_value = self.item_value() @@ -587,7 +592,10 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value def set_value(self, value, *, global_value=False): - self.text_input.setText(value) + if self.multiline: + self.text_input.setPlainText(value) + else: + self.text_input.setText(value) if global_value: self.start_value = self.item_value() self.global_value = self.item_value() @@ -629,109 +637,10 @@ class TextSingleLineWidget(QtWidgets.QWidget, InputObject): widget.style().polish(widget) def item_value(self): - return self.text_input.text() - - -class TextMultiLineWidget(QtWidgets.QWidget, InputObject): - value_changed = QtCore.Signal(object) - - def __init__( - self, input_data, parent, as_widget=False, label_widget=None - ): - super(TextMultiLineWidget, self).__init__(parent) - - self._parent = parent - self._as_widget = as_widget - self._state = None - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) - - self.override_value = NOT_SET - self.global_value = NOT_SET - self.start_value = NOT_SET - - layout = QtWidgets.QHBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - - self.text_input = QtWidgets.QPlainTextEdit(self) - - self.setFocusProxy(self.text_input) - - if not self._as_widget: - self.key = input_data["key"] - if not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - self.label_widget = label_widget - layout.addWidget(self.text_input, 1) - - self.text_input.textChanged.connect(self._on_value_change) - - def update_global_values(self, parent_values): - value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if value is not NOT_SET: - self.text_input.setPlainText(value) - - elif self.default_value is not NOT_SET: - self.text_input.setPlainText(self.default_value) - - self.global_value = value - self.start_value = self.item_value() - - self._is_modified = self.global_value != self.start_value - - def set_value(self, value, *, global_value=False): - self.text_input.setPlainText(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() - - def reset_value(self): - self.set_value(self.start_value) - - def clear_value(self): - self.set_value("") - - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - self._is_modified = self.item_value() != self.global_value - if self.is_overidable: - self._is_overriden = True - - self.update_style() - - self.value_changed.emit(self) - - def update_style(self): - state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified - ) - if self._state == state: - return - - if self._as_widget: - property_name = "input-state" - widget = self.text_input + if self.multiline: + return self.text_input.toPlainText() else: - property_name = "state" - widget = self.label_widget - - widget.setProperty(property_name, state) - widget.style().polish(widget) - - def item_value(self): - return self.text_input.toPlainText() + return self.text_input.text() class PathInputWidget(QtWidgets.QWidget, InputObject): @@ -2364,8 +2273,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): TypeToKlass.types["boolean"] = BooleanWidget TypeToKlass.types["number"] = NumberWidget -TypeToKlass.types["text-singleline"] = TextSingleLineWidget -TypeToKlass.types["text-multiline"] = TextMultiLineWidget +TypeToKlass.types["text"] = TextWidget TypeToKlass.types["path-input"] = PathInputWidget TypeToKlass.types["raw-json"] = RawJsonWidget TypeToKlass.types["list"] = ListWidget From 5cba39b998bbb563ebbeb59cac415b87f9498ce0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 17:16:08 +0200 Subject: [PATCH 258/507] path widget works right with overrides --- .../config_setting/widgets/inputs.py | 125 ++++++++++++++++-- 1 file changed, 115 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ce14e575cf..09e4629a45 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1937,7 +1937,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): return {self.key: values}, self.is_group -class PathWidget(QtWidgets.QWidget, InputObject): +class PathWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) platforms = ("windows", "darwin", "linux") @@ -1958,8 +1958,19 @@ class PathWidget(QtWidgets.QWidget, InputObject): super(PathWidget, self).__init__(parent) self._parent = parent + self._state = None + self._child_state = None - self._is_group = input_data.get("is_group", False) + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + self.any_parent_is_group = any_parent_is_group + + # This is partial input and dictionary input + if not any_parent_is_group: + self._is_group = True + else: + self._is_group = False self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) @@ -1970,8 +1981,6 @@ class PathWidget(QtWidgets.QWidget, InputObject): self.global_value = NOT_SET self.start_value = NOT_SET - self._state = None - self.input_fields = [] if not self.multiplatform and not self.multipath: @@ -2062,6 +2071,30 @@ class PathWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value + def apply_overrides(self, parent_values): + # Make sure this is set to False + self._state = None + self._child_state = None + self._is_modified = False + override_values = NOT_SET + if parent_values is not NOT_SET: + override_values = parent_values.get(self.key, override_values) + + self._is_overriden = override_values is not NOT_SET + if not self.multiplatform: + self.input_fields[0].apply_overrides(parent_values) + else: + for item in self.input_fields: + item.apply_overrides(override_values) + + if not self._is_overriden: + self._is_overriden = ( + self.is_group + and self.is_overidable + and self.child_overriden + ) + self._was_overriden = bool(self._is_overriden) + def set_value(self, value, *, global_value=False): if not self.multiplatform: self.input_fields[0].set_value(value, global_value=global_value) @@ -2089,16 +2122,79 @@ class PathWidget(QtWidgets.QWidget, InputObject): return self._is_modified = self.item_value() != self.global_value - if self.is_overidable: - self._is_overriden = True - - self.update_style() + if self.is_group: + if self.is_overidable: + self._is_overriden = True + self.hierarchical_style_update() self.value_changed.emit(self) - def update_style(self): + self.update_style() + + def update_style(self, is_overriden=None): + child_modified = self.child_modified + child_invalid = self.child_invalid + child_state = self.style_state( + child_invalid, self.child_overriden, child_modified + ) + if child_state: + child_state = "child-{}".format(child_state) + + if child_state != self._child_state: + self.setProperty("state", child_state) + self.style().polish(self) + self._child_state = child_state + + state = self.style_state( + child_invalid, self.is_overriden, self.is_modified + ) + if self._state == state: + return + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + self._state = state + + def remove_overrides(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + for item in self.input_fields: + item.remove_overrides() + + def discard_changes(self): for input_field in self.input_fields: - input_field.update_style() + input_field.discard_changes() + + self._is_modified = self.child_modified + self._is_overriden = self._was_overriden + + @property + def child_modified(self): + for input_field in self.input_fields: + if input_field.child_modified: + return True + return False + + @property + def child_overriden(self): + for input_field in self.input_fields: + if input_field.child_overriden: + return True + return False + + @property + def child_invalid(self): + for input_field in self.input_fields: + if input_field.child_invalid: + return True + return False + + def hierarchical_style_update(self): + for input_field in self.input_fields: + input_field.hierarchical_style_update() + self.update_style() def item_value(self): if not self.multiplatform and not self.multipath: @@ -2112,6 +2208,15 @@ class PathWidget(QtWidgets.QWidget, InputObject): output.update(input_field.config_value()) return output + def overrides(self): + if not self.is_overriden and not self.child_overriden: + return NOT_SET, False + + value = self.item_value() + if not self.multiplatform: + value = {self.key: value} + return value, self.is_group + # Proxy for form layout class FormLabel(QtWidgets.QLabel): From cbf1519645ff0e200af6e464314a8dbe276fea14 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 19:10:43 +0200 Subject: [PATCH 259/507] first introducing enhancement of anatomy widget --- .../config_setting/widgets/anatomy_inputs.py | 74 +++++++++++++++++-- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 7c9ac0d8f4..d07f69e7ca 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -5,28 +5,59 @@ from .lib import NOT_SET, TypeToKlass class AnatomyWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) + template_keys = ( + "project[name]", + "project[code]", + "asset", + "task", + "subset", + "family", + "version", + "ext", + "representation" + ) + default_exmaple_data = { + "project": { + "name": "ProjectPype", + "code": "pp", + }, + "asset": "sq01sh0010", + "task": "compositing", + "subset": "renderMain", + "family": "render", + "version": 1, + "ext": ".png", + "representation": "png" + } def __init__( self, input_data, parent, as_widget=False, label_widget=None ): + super(AnatomyWidget, self).__init__(parent) + self._parent = parent self._as_widget = as_widget self._is_group = True - self._state = None self.key = "anatomy" - self.start_value = None - super(AnatomyWidget, self).__init__(parent) + self.override_value = NOT_SET + self.start_value = NOT_SET + self.global_value = NOT_SET + + self.root_keys = None + self.root_widget = RootsWidget(self) + self.templates_widget = TemplatesWidget(self) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - label = QtWidgets.QLabel("Test") - layout.addWidget(label) - self.override_value = NOT_SET + label = QtWidgets.QLabel("Anatomy", self) + layout.addWidget(label) + layout.addWidget(self.root_widget) + layout.addWidget(self.templates_widget) def update_global_values(self, values): print("* update_global_values") @@ -47,10 +78,37 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): print("* item_value") -class TemplatesWidget: - pass +class RootsWidget(QtWidgets.QWidget): + multiroot_changed = QtCore.QSignal() + + def __init__(self, parent=None): + super(RootsWidget, self).__init__(parent) + + self.root_keys = None + + layout = QtWidgets.QHBoxLayout(self) + multiroot_checkbox = QtWidgets.QCheckBox(self) + layout.addWidget(multiroot_checkbox) + + self.multiroot_checkbox = multiroot_checkbox + multiroot_checkbox.stateChanged.connect(self._on_multiroot_checkbox) + + def _on_multiroot_checkbox(self): + self.set_multiroot(self.multiroot_checkbox.isChecked()) + + def set_multiroot(self, is_multiroot=None): + if is_multiroot is None: + is_multiroot = not self.multiroot_checkbox.isChecked() + + if is_multiroot != self.multiroot_checkbox.isChecked(): + self.multiroot_checkbox.setChecked(is_multiroot) + + self.multiroot_changed.emit() +class TemplatesWidget(QtWidgets.QWidget): + def __init__(self, parent=None): + super(TemplatesWidget, self).__init__(parent) TypeToKlass.types["anatomy"] = AnatomyWidget From 059152188d191240791e9b53f862bb17c452e7d8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 19:25:34 +0200 Subject: [PATCH 260/507] fix numer value when decimals are set to 0 --- .../tools/config_setting/config_setting/widgets/widgets.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index d5b0f088de..35b515d641 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -18,6 +18,13 @@ class NumberSpinBox(QtWidgets.QDoubleSpinBox): else: event.ignore() + def value(self): + output = super(NumberSpinBox, self).value() + print(self.decimals()) + if self.decimals() == 0: + output = int(output) + return output + class PathInput(QtWidgets.QLineEdit): def clear_end_path(self): From 043aec3fef57a430bbed0cd9bede58f466758518 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Sep 2020 19:25:47 +0200 Subject: [PATCH 261/507] fix class name in anatomy --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index d07f69e7ca..46b69aaffe 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -79,7 +79,7 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): class RootsWidget(QtWidgets.QWidget): - multiroot_changed = QtCore.QSignal() + multiroot_changed = QtCore.Signal() def __init__(self, parent=None): super(RootsWidget, self).__init__(parent) From a88fcfe9fa3de9e2b52478b70f1ddb0b8a72f7c2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 11:19:57 +0200 Subject: [PATCH 262/507] removed debug print --- pype/tools/config_setting/config_setting/widgets/widgets.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 35b515d641..e9ba1b798c 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -20,7 +20,6 @@ class NumberSpinBox(QtWidgets.QDoubleSpinBox): def value(self): output = super(NumberSpinBox, self).value() - print(self.decimals()) if self.decimals() == 0: output = int(output) return output From bccaec878ff084bafe8c04cb604b34f2d377f08b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 11:46:11 +0200 Subject: [PATCH 263/507] PathWidget can be as widget --- .../config_setting/widgets/inputs.py | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 09e4629a45..c0c0ba3406 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1960,6 +1960,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self._parent = parent self._state = None self._child_state = None + self._as_widget = as_widget any_parent_is_group = parent.is_group if not any_parent_is_group: @@ -1967,7 +1968,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.any_parent_is_group = any_parent_is_group # This is partial input and dictionary input - if not any_parent_is_group: + if not any_parent_is_group and not as_widget: self._is_group = True else: self._is_group = False @@ -1990,12 +1991,14 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - self.key = input_data["key"] - if not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) - self.label_widget = label_widget + if not as_widget: + self.key = input_data["key"] + if not label_widget: + label = input_data["label"] + label_widget = QtWidgets.QLabel(label) + label_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + layout.addWidget(label_widget, 0) + self.label_widget = label_widget self.content_widget = QtWidgets.QWidget(self) self.content_layout = QtWidgets.QVBoxLayout(self.content_widget) @@ -2056,15 +2059,16 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): def update_global_values(self, parent_values): value = NOT_SET - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if not self._as_widget: + if parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) - if not self.multiplatform: - self.input_fields[0].update_global_values(parent_values) + if not self.multiplatform: + self.input_fields[0].update_global_values(parent_values) - elif self.multiplatform: - for input_field in self.input_fields: - input_field.update_global_values(value) + elif self.multiplatform: + for input_field in self.input_fields: + input_field.update_global_values(value) self.global_value = value self.start_value = self.item_value() From e515895cf38e1c4f73a740dfa4f3c49ff8c80efe Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 11:46:40 +0200 Subject: [PATCH 264/507] roots widget has multiroot and singleroot widget --- .../config_setting/widgets/anatomy_inputs.py | 57 ++++++++++++++++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 46b69aaffe..3148b8f32d 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -1,5 +1,5 @@ from Qt import QtWidgets, QtCore -from .inputs import InputObject +from .inputs import ConfigObject, InputObject, ModifiableDict, PathWidget from .lib import NOT_SET, TypeToKlass @@ -50,7 +50,7 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): self.root_widget = RootsWidget(self) self.templates_widget = TemplatesWidget(self) - layout = QtWidgets.QHBoxLayout(self) + layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) @@ -61,6 +61,8 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): def update_global_values(self, values): print("* update_global_values") + self.root_widget.update_global_values(values) + self.templates_widget.update_global_values(values) def set_value(self, value, *, global_value=False): print("* set_value") @@ -78,21 +80,59 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): print("* item_value") -class RootsWidget(QtWidgets.QWidget): +class RootsWidget(QtWidgets.QWidget, ConfigObject): multiroot_changed = QtCore.Signal() - def __init__(self, parent=None): + def __init__(self, parent): super(RootsWidget, self).__init__(parent) + self._parent = parent + self._is_group = True self.root_keys = None - layout = QtWidgets.QHBoxLayout(self) - multiroot_checkbox = QtWidgets.QCheckBox(self) - layout.addWidget(multiroot_checkbox) + checkbox_widget = QtWidgets.QWidget(self) + + multiroot_label = QtWidgets.QLabel( + "Use multiple roots", checkbox_widget + ) + multiroot_checkbox = QtWidgets.QCheckBox(checkbox_widget) + + checkbox_layout = QtWidgets.QHBoxLayout(checkbox_widget) + checkbox_layout.addWidget(multiroot_label, 0) + checkbox_layout.addWidget(multiroot_checkbox, 1) + + path_widget_data = { + "key": "roots", + "multiplatform": True, + "label": "Roots" + } + singleroot_widget = PathWidget(path_widget_data, self) + multiroot_data = { + "key": "roots", + "label": "Roots", + "object_type": "path-widget", + "input_modifiers": { + "multiplatform": True + } + } + multiroot_widget = ModifiableDict(multiroot_data, self) + + main_layout = QtWidgets.QVBoxLayout(self) + main_layout.addWidget(checkbox_widget) + main_layout.addWidget(singleroot_widget) + main_layout.addWidget(multiroot_widget) self.multiroot_checkbox = multiroot_checkbox + self.singleroot_widget = singleroot_widget + self.multiroot_widget = multiroot_widget + multiroot_checkbox.stateChanged.connect(self._on_multiroot_checkbox) + def update_global_values(self, values): + print(values) + self.singleroot_widget.update_global_values(NOT_SET) + self.multiroot_widget.update_global_values(NOT_SET) + def _on_multiroot_checkbox(self): self.set_multiroot(self.multiroot_checkbox.isChecked()) @@ -110,5 +150,8 @@ class TemplatesWidget(QtWidgets.QWidget): def __init__(self, parent=None): super(TemplatesWidget, self).__init__(parent) + def update_global_values(self, values): + pass + TypeToKlass.types["anatomy"] = AnatomyWidget From f147579ad943baf56c4da157aea2b8cada39fbf0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 11:56:00 +0200 Subject: [PATCH 265/507] pass global values to subwidgets --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 3148b8f32d..a0c94fb846 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -129,9 +129,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): multiroot_checkbox.stateChanged.connect(self._on_multiroot_checkbox) def update_global_values(self, values): - print(values) - self.singleroot_widget.update_global_values(NOT_SET) - self.multiroot_widget.update_global_values(NOT_SET) + self.singleroot_widget.update_global_values(values) + self.multiroot_widget.update_global_values(values) def _on_multiroot_checkbox(self): self.set_multiroot(self.multiroot_checkbox.isChecked()) From 462c350c0bdc25dff4700780a3d289f0c12f2e80 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 11:57:05 +0200 Subject: [PATCH 266/507] modifiable dict has buttons at first place --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index c0c0ba3406..36bb8c9902 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1228,10 +1228,10 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.add_btn.setProperty("btn-type", "tool-item") self.remove_btn.setProperty("btn-type", "tool-item") - layout.addWidget(self.key_input, 0) - layout.addWidget(self.value_input, 1) layout.addWidget(self.add_btn, 0) layout.addWidget(self.remove_btn, 0) + layout.addWidget(self.key_input, 0) + layout.addWidget(self.value_input, 1) self.setFocusProxy(self.value_input) From 93a0905b6f8be0f4607a8169a0c2ddf717a40d6d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 12:11:58 +0200 Subject: [PATCH 267/507] ModifiedDictionary Item looks same as ListItem --- .../config_setting/widgets/inputs.py | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 36bb8c9902..441bc6c9a5 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1263,6 +1263,21 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def is_group(self): return self._parent.is_group + def on_add_clicked(self): + if self.value_input.isEnabled(): + self._parent.add_row(row=self.row() + 1) + else: + self.set_as_empty(False) + + def on_remove_clicked(self): + self._parent.remove_row(self) + + def set_as_empty(self, is_empty=True): + self.key_input.setEnabled(not is_empty) + self.value_input.setEnabled(not is_empty) + self.remove_btn.setEnabled(not is_empty) + self._on_value_change() + @property def any_parent_is_group(self): return self._parent.any_parent_is_group @@ -1289,16 +1304,6 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def row(self): return self._parent.input_fields.index(self) - def on_add_clicked(self): - self._parent.add_row(row=self.row() + 1) - - def on_remove_clicked(self): - if self.is_single: - self.value_input.clear_value() - self.key_input.setText("") - else: - self._parent.remove_row(self) - def config_value(self): key = self.key_input.text() value = self.value_input.item_value() @@ -1374,12 +1379,12 @@ class ModifiableDict(ExpandingWidget, InputObject): for item_key, item_value in self.default_value.items(): self.add_row(key=item_key, value=item_value) - if self.count() == 0: - self.add_row() - for old_input in old_inputs: self.remove_row(old_input) + if self.count() == 0: + self.add_row(is_empty=True) + self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value @@ -1441,19 +1446,13 @@ class ModifiableDict(ExpandingWidget, InputObject): output.update(item_value) return output - def add_row(self, row=None, key=None, value=None): + def add_row(self, row=None, key=None, value=None, is_empty=False): # Create new item item_widget = ModifiableDictItem( self.object_type, self.input_modifiers, self, self.inputs_widget ) - - # Set/unset if new item is single item - current_count = self.count() - if current_count == 0: - item_widget.is_single = True - elif current_count == 1: - for _input_field in self.input_fields: - _input_field.is_single = False + if is_empty: + item_widget.set_as_empty() item_widget.value_changed.connect(self._on_value_change) @@ -1493,12 +1492,8 @@ class ModifiableDict(ExpandingWidget, InputObject): item_widget.setParent(None) item_widget.deleteLater() - current_count = self.count() - if current_count == 0: - self.add_row() - elif current_count == 1: - for _input_field in self.input_fields: - _input_field.is_single = True + if self.count() == 0: + self.add_row(is_empty=True) self._on_value_change() self.parent().updateGeometry() From 787d8516cbaa288b3c8c14c83c0f2fd53cfa52da Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 13:21:11 +0200 Subject: [PATCH 268/507] hide inputs based on checkbox --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index a0c94fb846..943b8b0973 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -128,6 +128,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): multiroot_checkbox.stateChanged.connect(self._on_multiroot_checkbox) + self._on_multiroot_checkbox() + def update_global_values(self, values): self.singleroot_widget.update_global_values(values) self.multiroot_widget.update_global_values(values) @@ -142,6 +144,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if is_multiroot != self.multiroot_checkbox.isChecked(): self.multiroot_checkbox.setChecked(is_multiroot) + self.singleroot_widget.setVisible(not is_multiroot) + self.multiroot_widget.setVisible(is_multiroot) + self.multiroot_changed.emit() From f505f3099ac79d9bdde4fd9c952576eb5672afc0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 13:53:00 +0200 Subject: [PATCH 269/507] modifiable dict is not based on expanding widget but using it inside --- .../config_setting/widgets/inputs.py | 56 ++++++++++++------- .../config_setting/widgets/widgets.py | 2 +- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 441bc6c9a5..394a0f69ca 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1312,7 +1312,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): return {key: value} -class ModifiableDict(ExpandingWidget, InputObject): +class ModifiableDict(QtWidgets.QWidget, InputObject): # Should be used only for dictionary with one datatype as value # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) @@ -1320,7 +1320,7 @@ class ModifiableDict(ExpandingWidget, InputObject): def __init__( self, input_data, parent, as_widget=False, label_widget=None ): - super(ModifiableDict, self).__init__(input_data["label"], parent) + super(ModifiableDict, self).__init__(parent) self.setObjectName("ModifiableDict") self._parent = parent @@ -1330,10 +1330,6 @@ class ModifiableDict(ExpandingWidget, InputObject): self.global_value = NOT_SET self.start_value = NOT_SET - self.key = input_data["key"] - - self.input_fields = [] - any_parent_is_group = parent.is_group if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group @@ -1343,17 +1339,39 @@ class ModifiableDict(ExpandingWidget, InputObject): self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) - inputs_widget = QtWidgets.QWidget(self) - inputs_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + self.input_fields = [] - inputs_layout = QtWidgets.QVBoxLayout(inputs_widget) - inputs_layout.setContentsMargins(5, 5, 0, 5) - inputs_layout.setSpacing(5) + self.key = input_data["key"] - self.set_content_widget(inputs_widget) + main_layout = QtWidgets.QHBoxLayout(self) + main_layout.setContentsMargins(5, 5, 0, 5) + main_layout.setSpacing(0) - self.inputs_widget = inputs_widget - self.inputs_layout = inputs_layout + body_widget = ExpandingWidget(input_data["label"], self) + + main_layout.addWidget(body_widget) + + content_widget = QtWidgets.QWidget(self) + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(3, 3, 0, 3) + + body_widget.set_content_widget(content_widget) + + self.body_widget = body_widget + self.content_widget = content_widget + self.content_layout = content_layout + + self.label_widget = body_widget.label_widget + + self.setAttribute(QtCore.Qt.WA_StyledBackground) + + expandable = input_data.get("expandable", True) + if not expandable: + body_widget.hide_toolbox(hide_content=False) + else: + expanded = input_data.get("expanded", False) + if expanded: + body_widget.toggle_content() self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) @@ -1449,7 +1467,7 @@ class ModifiableDict(ExpandingWidget, InputObject): def add_row(self, row=None, key=None, value=None, is_empty=False): # Create new item item_widget = ModifiableDictItem( - self.object_type, self.input_modifiers, self, self.inputs_widget + self.object_type, self.input_modifiers, self, self.content_widget ) if is_empty: item_widget.set_as_empty() @@ -1457,10 +1475,10 @@ class ModifiableDict(ExpandingWidget, InputObject): item_widget.value_changed.connect(self._on_value_change) if row is None: - self.inputs_layout.addWidget(item_widget) + self.content_layout.addWidget(item_widget) self.input_fields.append(item_widget) else: - self.inputs_layout.insertWidget(row, item_widget) + self.content_layout.insertWidget(row, item_widget) self.input_fields.insert(row, item_widget) previous_input = None @@ -1487,7 +1505,7 @@ class ModifiableDict(ExpandingWidget, InputObject): def remove_row(self, item_widget): item_widget.value_changed.disconnect() - self.inputs_layout.removeWidget(item_widget) + self.content_layout.removeWidget(item_widget) self.input_fields.remove(item_widget) item_widget.setParent(None) item_widget.deleteLater() @@ -1543,7 +1561,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(3, 3, 0, 3) - body_widget.set_content_widget(content_widget, (4, 4, 0, 4)) + body_widget.set_content_widget(content_widget) self.body_widget = body_widget self.content_widget = content_widget diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index e9ba1b798c..fbbc3f26df 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -111,7 +111,7 @@ class ExpandingWidget(QtWidgets.QWidget): def set_content_widget(self, content_widget, margins=None): main_layout = QtWidgets.QVBoxLayout(self) if margins is None: - margins = (9, 9, 0, 9) + margins = (4, 4, 0, 4) main_layout.setContentsMargins(*margins) content_widget.setVisible(False) From 88e2a794d4d79eb6c4a57d922c7b6e1614e7e7e6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 16:23:46 +0200 Subject: [PATCH 270/507] added abstract class for objects --- .../config_setting/widgets/inputs.py | 76 +------- .../config_setting/widgets/widgets.py | 180 ++++++++++++++++++ 2 files changed, 185 insertions(+), 71 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 394a0f69ca..379b255359 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2,6 +2,7 @@ import json import logging from Qt import QtWidgets, QtCore, QtGui from .widgets import ( + AbstractConfigObject, ExpandingWidget, NumberSpinBox, PathInput @@ -9,7 +10,7 @@ from .widgets import ( from .lib import NOT_SET, METADATA_KEY, TypeToKlass -class ConfigObject: +class ConfigObject(AbstractConfigObject): allow_actions = True default_state = "" @@ -72,10 +73,6 @@ class ConfigObject: @property def ignore_value_changes(self): """Most of attribute changes are ignored on value change when True.""" - if not hasattr(self, "_parent"): - raise NotImplementedError( - "Object {} does not have `_parent` attribute".format(self) - ) return self._parent.ignore_value_changes @ignore_value_changes.setter @@ -83,44 +80,12 @@ class ConfigObject: """Setter for global parent item to apply changes for all inputs.""" self._parent.ignore_value_changes = value - @property - def child_modified(self): - """Any children item is modified.""" - raise NotImplementedError( - "{} does not have implemented `child_modified`".format(self) - ) - - @property - def child_overriden(self): - """Any children item is overriden.""" - raise NotImplementedError( - "{} does not have implemented `child_overriden`".format(self) - ) - - @property - def child_invalid(self): - """Any children item does not have valid value.""" - raise NotImplementedError( - "{} does not have implemented `child_invalid`".format(self) - ) - - def get_invalid(self): - """Returns invalid items all down the hierarchy.""" - raise NotImplementedError( - "{} does not have implemented `get_invalid`".format(self) - ) - - def item_value(self): - """Value of an item without key.""" - raise NotImplementedError( - "Method `item_value` not implemented!" - ) - def config_value(self): """Output for saving changes or overrides.""" return {self.key: self.item_value()} - def style_state(self, is_invalid, is_overriden, is_modified): + @classmethod + def style_state(cls, is_invalid, is_overriden, is_modified): items = [] if is_invalid: items.append("invalid") @@ -129,54 +94,23 @@ class ConfigObject: items.append("overriden") if is_modified: items.append("modified") - return "-".join(items) or self.default_state - - def add_children_gui(self, child_configuration, values): - raise NotImplementedError( - "{} Method `add_children_gui` is not implemented!.".format( - repr(self) - ) - ) + return "-".join(items) or cls.default_state def _discard_changes(self): self.ignore_value_changes = True self.discard_changes() self.ignore_value_changes = False - def discard_changes(self): - raise NotImplementedError( - "{} Method `discard_changes` not implemented!".format( - repr(self) - ) - ) - def _remove_overrides(self): self.ignore_value_changes = True self.remove_overrides() self.ignore_value_changes = False - def remove_overrides(self): - raise NotImplementedError( - "{} Method `remove_overrides` not implemented!".format( - repr(self) - ) - ) - def _set_as_overriden(self): self.ignore_value_changes = True self.set_as_overriden() self.ignore_value_changes = False - def set_as_overriden(self): - raise NotImplementedError( - "Method `set_as_overriden` not implemented!" - ) - - def hierarchical_style_update(self): - raise NotImplementedError( - "Method `hierarchical_style_update` not implemented!" - ) - def mouseReleaseEvent(self, event): if self.allow_actions and event.button() == QtCore.Qt.RightButton: menu = QtWidgets.QMenu() diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index fbbc3f26df..42ca49d600 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -180,3 +180,183 @@ class UnsavedChangesDialog(QtWidgets.QDialog): def on_discard_pressed(self): self.done(2) + + +class AbstractConfigObject: + abstract_attributes = ("_parent", ) + + def __getattr__(self, name): + if name in self.abstract_attributes: + raise NotImplementedError( + "Attribute `{}` is not implemented. {}".format(name, self) + ) + return super(AbstractConfigObject, self).__getattribute__(name) + + @property + def log(self): + raise NotImplementedError( + "{} does not have implemented `log`".format(self) + ) + + @property + def is_modified(self): + """Has object any changes that require saving.""" + raise NotImplementedError( + "{} does not have implemented `is_modified`".format(self) + ) + + @property + def is_overriden(self): + """Is object overriden so should be saved to overrides.""" + raise NotImplementedError( + "{} does not have implemented `is_overriden`".format(self) + ) + + @property + def was_overriden(self): + """Initial state after applying overrides.""" + raise NotImplementedError( + "{} does not have implemented `was_overriden`".format(self) + ) + + @property + def is_invalid(self): + """Value set in is not valid.""" + raise NotImplementedError( + "{} does not have implemented `is_invalid`".format(self) + ) + + @property + def is_group(self): + """Value set in is not valid.""" + raise NotImplementedError( + "{} does not have implemented `is_group`".format(self) + ) + + @property + def is_nullable(self): + raise NotImplementedError( + "{} does not have implemented `is_nullable`".format(self) + ) + + @property + def is_overidable(self): + """Should care about overrides.""" + raise NotImplementedError( + "{} does not have implemented `is_overidable`".format(self) + ) + + def any_parent_overriden(self): + """Any of parent object up to top hiearchy is overriden.""" + raise NotImplementedError( + "{} does not have implemented `any_parent_overriden`".format(self) + ) + + @property + def ignore_value_changes(self): + """Most of attribute changes are ignored on value change when True.""" + raise NotImplementedError( + "{} does not have implemented `ignore_value_changes`".format(self) + ) + + @ignore_value_changes.setter + def ignore_value_changes(self, value): + """Setter for global parent item to apply changes for all inputs.""" + raise NotImplementedError(( + "{} does not have implemented setter method `ignore_value_changes`" + ).format(self)) + + @property + def child_modified(self): + """Any children item is modified.""" + raise NotImplementedError( + "{} does not have implemented `child_modified`".format(self) + ) + + @property + def child_overriden(self): + """Any children item is overriden.""" + raise NotImplementedError( + "{} does not have implemented `child_overriden`".format(self) + ) + + @property + def child_invalid(self): + """Any children item does not have valid value.""" + raise NotImplementedError( + "{} does not have implemented `child_invalid`".format(self) + ) + + def get_invalid(self): + """Returns invalid items all down the hierarchy.""" + raise NotImplementedError( + "{} does not have implemented `get_invalid`".format(self) + ) + + def item_value(self): + """Value of an item without key.""" + raise NotImplementedError( + "Method `item_value` not implemented!" + ) + + def config_value(self): + """Output for saving changes or overrides.""" + return {self.key: self.item_value()} + + @classmethod + def style_state(cls, is_invalid, is_overriden, is_modified): + items = [] + if is_invalid: + items.append("invalid") + else: + if is_overriden: + items.append("overriden") + if is_modified: + items.append("modified") + return "-".join(items) or cls.default_state + + def add_children_gui(self, child_configuration, values): + raise NotImplementedError( + "{} Method `add_children_gui` is not implemented!.".format( + repr(self) + ) + ) + + def _discard_changes(self): + self.ignore_value_changes = True + self.discard_changes() + self.ignore_value_changes = False + + def discard_changes(self): + raise NotImplementedError( + "{} Method `discard_changes` not implemented!".format( + repr(self) + ) + ) + + def _remove_overrides(self): + self.ignore_value_changes = True + self.remove_overrides() + self.ignore_value_changes = False + + def remove_overrides(self): + raise NotImplementedError( + "{} Method `remove_overrides` not implemented!".format( + repr(self) + ) + ) + + def _set_as_overriden(self): + self.ignore_value_changes = True + self.set_as_overriden() + self.ignore_value_changes = False + + def set_as_overriden(self): + raise NotImplementedError( + "Method `set_as_overriden` not implemented!" + ) + + def hierarchical_style_update(self): + raise NotImplementedError( + "Method `hierarchical_style_update` not implemented!" + ) From 3ef141c8cadcd77caba894517764ff9730750716 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Sep 2020 16:24:08 +0200 Subject: [PATCH 271/507] Anatmy widget updated style changes --- .../config_setting/style/style.css | 21 +-- .../config_setting/widgets/anatomy_inputs.py | 172 ++++++++++++++++-- 2 files changed, 167 insertions(+), 26 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 937259ba7b..638bf1c6fb 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -123,8 +123,7 @@ QPushButton[btn-type="expand-toggle"] { #DictLabel { font-weight: bold; } - -#ModifiableDict, #DictWidget { +#ModifiableDict, #DictWidget, #AnatomyWidget { border-style: solid; border-color: #455c6e; border-left-width: 3px; @@ -132,36 +131,36 @@ QPushButton[btn-type="expand-toggle"] { border-right-width: 0px; border-top-width: 0px; } -#ModifiableDict:hover, #DictWidget:hover { +#ModifiableDict:hover, #DictWidget:hover, #AnatomyWidget:hover { border-color: #62839d; } -#ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"] { +#ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"], #AnatomyWidget[state="child-modified"] { border-color: #106aa2; } -#ModifiableDict[state="child-modified"]:hover, #DictWidget[state="child-modified"]:hover { +#ModifiableDict[state="child-modified"]:hover, #DictWidget[state="child-modified"]:hover, #AnatomyWidget[state="child-modified"]:hover { border-color: #137cbd; } -#ModifiableDict[state="child-invalid"], #DictWidget[state="child-invalid"] { +#ModifiableDict[state="child-invalid"], #DictWidget[state="child-invalid"], #AnatomyWidget[state="child-invalid"] { border-color: #ad2e2e; } -#ModifiableDict[state="child-invalid"]:hover, #DictWidget[state="child-invalid"]:hover { +#ModifiableDict[state="child-invalid"]:hover, #DictWidget[state="child-invalid"]:hover, #AnatomyWidget[state="child-invalid"]:hover { border-color: #c93636; } -#ExpandingWidget[state="child-overriden"], #ModifiableDict[state="child-overriden"], #DictWidget[state="child-overriden"] { +#ModifiableDict[state="child-overriden"], #DictWidget[state="child-overriden"], #AnatomyWidget[state="child-overriden"] { border-color: #e67300; } -#ExpandingWidget[state="child-overriden"]:hover, #ModifiableDict[state="child-overriden"]:hover, #DictWidget[state="child-overriden"]:hover { +#ModifiableDict[state="child-overriden"]:hover, #DictWidget[state="child-overriden"]:hover, #AnatomyWidget[state="child-overriden"]:hover { border-color: #ff8c1a; } -#ExpandingWidget[state="child-overriden-modified"], #ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"] { +#ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"], #AnatomyWidget[state="child-modified"] { border-color: #106aa2; } -#ExpandingWidget[state="child-overriden-modified"]:hover, #ModifiableDict[state="child-overriden-modified"]:hover, #DictWidget[state="child-overriden-modified"]:hover { +#ModifiableDict[state="child-overriden-modified"]:hover, #DictWidget[state="child-overriden-modified"]:hover, #AnatomyWidget[state="child-modified"]:hover { border-color: #137cbd; } diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 943b8b0973..11d94319e6 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -1,9 +1,10 @@ from Qt import QtWidgets, QtCore -from .inputs import ConfigObject, InputObject, ModifiableDict, PathWidget +from .widgets import ExpandingWidget +from .inputs import ConfigObject, ModifiableDict, PathWidget from .lib import NOT_SET, TypeToKlass -class AnatomyWidget(QtWidgets.QWidget, InputObject): +class AnatomyWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) template_keys = ( "project[name]", @@ -33,10 +34,16 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): def __init__( self, input_data, parent, as_widget=False, label_widget=None ): + if as_widget: + raise TypeError( + "`AnatomyWidget` does not allow to be used as widget." + ) super(AnatomyWidget, self).__init__(parent) - + self.setObjectName("AnatomyWidget") self._parent = parent - self._as_widget = as_widget + + self._child_state = None + self._state = None self._is_group = True @@ -50,14 +57,26 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): self.root_widget = RootsWidget(self) self.templates_widget = TemplatesWidget(self) - layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) + self.setAttribute(QtCore.Qt.WA_StyledBackground) - label = QtWidgets.QLabel("Anatomy", self) - layout.addWidget(label) - layout.addWidget(self.root_widget) - layout.addWidget(self.templates_widget) + body_widget = ExpandingWidget("Anatomy", self) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(5, 5, 0, 5) + layout.setSpacing(0) + layout.addWidget(body_widget) + + content_widget = QtWidgets.QWidget(body_widget) + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(0, 0, 0, 0) + content_layout.setSpacing(5) + + content_layout.addWidget(self.root_widget) + content_layout.addWidget(self.templates_widget) + + body_widget.set_content_widget(content_widget) + + self.label_widget = body_widget.label_widget def update_global_values(self, values): print("* update_global_values") @@ -73,8 +92,63 @@ class AnatomyWidget(QtWidgets.QWidget, InputObject): def _on_value_change(self, item=None): print("* _on_value_change") - def update_style(self): + def update_style(self, is_overriden=None): print("* update_style") + child_modified = self.child_modified + child_invalid = self.child_invalid + child_state = self.style_state( + child_invalid, self.child_overriden, child_modified + ) + if child_state: + child_state = "child-{}".format(child_state) + + if child_state != self._child_state: + self.setProperty("state", child_state) + self.style().polish(self) + self._child_state = child_state + + state = self.style_state( + child_invalid, self.is_overriden, self.is_modified + ) + if self._state == state: + return + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + self._state = state + + def hierarchical_style_update(self): + self.root_widget.hierarchical_style_update() + self.templates_widget.hierarchical_style_update() + self.update_style() + + @property + def is_modified(self): + return self._is_modified or self.child_modified + + @property + def child_modified(self): + return ( + self.root_widget.child_modified + or self.templates_widget.child_modified + ) + + @property + def child_overriden(self): + return ( + self.root_widget.is_overriden + or self.root_widget.child_overriden + or self.templates_widget.is_overriden + or self.templates_widget.child_overriden + ) + + @property + def child_invalid(self): + return ( + self.root_widget.child_invalid + or self.templates_widget.child_invalid + ) def item_value(self): print("* item_value") @@ -85,6 +159,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def __init__(self, parent): super(RootsWidget, self).__init__(parent) + self.setObjectName("RootsWidget") self._parent = parent self._is_group = True @@ -111,6 +186,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): "key": "roots", "label": "Roots", "object_type": "path-widget", + "expandable": False, "input_modifiers": { "multiplatform": True } @@ -130,18 +206,26 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._on_multiroot_checkbox() + @property + def is_multiroot(self): + return self.multiroot_checkbox.isChecked() + def update_global_values(self, values): self.singleroot_widget.update_global_values(values) self.multiroot_widget.update_global_values(values) + def hierarchical_style_update(self): + self.singleroot_widget.hierarchical_style_update() + self.multiroot_widget.hierarchical_style_update() + def _on_multiroot_checkbox(self): - self.set_multiroot(self.multiroot_checkbox.isChecked()) + self.set_multiroot(self.is_multiroot) def set_multiroot(self, is_multiroot=None): if is_multiroot is None: - is_multiroot = not self.multiroot_checkbox.isChecked() + is_multiroot = not self.is_multiroot - if is_multiroot != self.multiroot_checkbox.isChecked(): + if is_multiroot != self.is_multiroot: self.multiroot_checkbox.setChecked(is_multiroot) self.singleroot_widget.setVisible(not is_multiroot) @@ -149,6 +233,41 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.multiroot_changed.emit() + @property + def is_modified(self): + return self._is_modified or self.child_modified + + @property + def is_overriden(self): + return self._is_overriden + + @property + def child_modified(self): + if self.is_multiroot: + return self.multiroot_widget.child_modified + else: + return self.singleroot_widget.child_modified + + @property + def child_overriden(self): + if self.is_multiroot: + return ( + self.multiroot_widget.is_overriden + or self.multiroot_widget.child_overriden + ) + else: + return ( + self.singleroot_widget.is_overriden + or self.singleroot_widget.child_overriden + ) + + @property + def child_invalid(self): + if self.is_multiroot: + return self.multiroot_widget.child_invalid + else: + return self.singleroot_widget.child_invalid + class TemplatesWidget(QtWidgets.QWidget): def __init__(self, parent=None): @@ -157,5 +276,28 @@ class TemplatesWidget(QtWidgets.QWidget): def update_global_values(self, values): pass + def hierarchical_style_update(self): + pass + + @property + def is_modified(self): + return False + + @property + def is_overriden(self): + return False + + @property + def child_modified(self): + return False + + @property + def child_overriden(self): + return False + + @property + def child_invalid(self): + return False + TypeToKlass.types["anatomy"] = AnatomyWidget From 3271346b129f5b5027aec3d5343f771bbbe30a10 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 10:29:22 +0200 Subject: [PATCH 272/507] make sure saving won't crash if current files are not valid --- .../config_setting/config_setting/widgets/base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index f057f5a0f6..066c00c96d 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -144,11 +144,14 @@ class StudioWidget(QtWidgets.QWidget): subpath = "/".join(key_sequence) + ".json" origin_values = current_configurations for key in key_sequence: - if key not in origin_values: + if not origin_values or key not in origin_values: origin_values = {} break origin_values = origin_values[key] + if not origin_values: + origin_values = {} + new_values = all_values for key in key_sequence: new_values = new_values[key] @@ -518,11 +521,14 @@ class ProjectWidget(QtWidgets.QWidget): subpath = "/".join(key_sequence) + ".json" origin_values = current_configurations for key in key_sequence: - if key not in origin_values: + if not origin_values or key not in origin_values: origin_values = {} break origin_values = origin_values[key] + if not origin_values: + origin_values = {} + new_values = all_values for key in key_sequence: new_values = new_values[key] From e87288998db354bae408af01fae131219f69a6d0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 10:30:03 +0200 Subject: [PATCH 273/507] pathwidget does not care about label if is used as widget --- .../config_setting/widgets/inputs.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 379b255359..f925e6e163 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2096,16 +2096,17 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.style().polish(self) self._child_state = child_state - state = self.style_state( - child_invalid, self.is_overriden, self.is_modified - ) - if self._state == state: - return + if not self._as_widget: + state = self.style_state( + child_invalid, self.is_overriden, self.is_modified + ) + if self._state == state: + return - self.label_widget.setProperty("state", state) - self.label_widget.style().polish(self.label_widget) + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) - self._state = state + self._state = state def remove_overrides(self): self._is_overriden = False From 3831af2a26d008f9c01ccd7b851b554adeb50e6d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 10:30:22 +0200 Subject: [PATCH 274/507] roots can collect data --- .../config_setting/widgets/anatomy_inputs.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 11d94319e6..c0a64a8d7d 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -151,7 +151,12 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): ) def item_value(self): - print("* item_value") + output = {} + output.update(self.root_widget.config_value()) + return output + + def config_value(self): + return {self.key: self.item_value()} class RootsWidget(QtWidgets.QWidget, ConfigObject): @@ -162,11 +167,11 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.setObjectName("RootsWidget") self._parent = parent self._is_group = True + self.key = "roots" self.root_keys = None checkbox_widget = QtWidgets.QWidget(self) - multiroot_label = QtWidgets.QLabel( "Use multiple roots", checkbox_widget ) @@ -268,6 +273,15 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: return self.singleroot_widget.child_invalid + def item_value(self): + if self.is_multiroot: + return self.multiroot_widget.item_value() + else: + return self.singleroot_widget.item_value() + + def config_value(self): + return {self.key: self.item_value()} + class TemplatesWidget(QtWidgets.QWidget): def __init__(self, parent=None): From 69dbfd2faf101facbe611c57eec4d8f925d8d248 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 10:41:14 +0200 Subject: [PATCH 275/507] updating global values for roots should work --- .../config_setting/widgets/anatomy_inputs.py | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index c0a64a8d7d..e4f7a6383a 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -78,10 +78,14 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.label_widget = body_widget.label_widget - def update_global_values(self, values): - print("* update_global_values") - self.root_widget.update_global_values(values) - self.templates_widget.update_global_values(values) + def update_global_values(self, parent_values): + if isinstance(parent_values, dict): + value = parent_values.get(self.key, NOT_SET) + else: + value = NOT_SET + + self.root_widget.update_global_values(value) + self.templates_widget.update_global_values(value) def set_value(self, value, *, global_value=False): print("* set_value") @@ -215,9 +219,25 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def is_multiroot(self): return self.multiroot_checkbox.isChecked() - def update_global_values(self, values): - self.singleroot_widget.update_global_values(values) - self.multiroot_widget.update_global_values(values) + def update_global_values(self, parent_values): + if isinstance(parent_values, dict): + value = parent_values.get(self.key, NOT_SET) + else: + value = NOT_SET + + is_multiroot = False + if isinstance(value, dict): + for _value in value.values(): + if isinstance(_value, dict): + is_multiroot = True + break + + self.set_multiroot(is_multiroot) + + if is_multiroot: + self.multiroot_widget.update_global_values(parent_values) + else: + self.singleroot_widget.update_global_values(parent_values) def hierarchical_style_update(self): self.singleroot_widget.hierarchical_style_update() From 7efc99b5ef87dbc9bc2b80fbeed3acb9f4970d63 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 10:44:56 +0200 Subject: [PATCH 276/507] add first row to list and modifiable dictionary by default --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f925e6e163..ae0ece42bd 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -982,6 +982,8 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.inputs_widget = inputs_widget self.inputs_layout = inputs_layout + self.add_row(is_empty=True) + def count(self): return len(self.input_fields) @@ -1311,6 +1313,8 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} + self.add_row(is_empty=True) + def count(self): return len(self.input_fields) From 18812a64e093619422e33834696a786862f9cb25 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 12:49:25 +0200 Subject: [PATCH 277/507] NOT_SET is False when used in condition --- pype/tools/config_setting/config_setting/widgets/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index 4669004b53..0d70885de7 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -11,7 +11,7 @@ class TypeToKlass: types = {} -NOT_SET = type("NOT_SET", (), {}) +NOT_SET = type("NOT_SET", (), {"__bool__": lambda obj: False})() METADATA_KEY = type("METADATA_KEY", (), {}) OVERRIDE_VERSION = 1 From 1d0f00dced4b4001ef0d53d84fba66e4c98e1c25 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 13:01:02 +0200 Subject: [PATCH 278/507] modifiable dict and its item has right hiearrchical update methods --- .../config_setting/config_setting/widgets/inputs.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ae0ece42bd..eeb6cf64cd 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1228,6 +1228,10 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def is_modified(self): return self.is_value_modified() or self.is_key_modified() + def hierarchical_style_update(self): + self.value_input.hierarchical_style_update() + self.update_style() + def update_style(self): if self.is_key_modified(): state = "modified" @@ -1374,6 +1378,11 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.update_style() + def hierarchical_style_update(self): + for input_field in self.input_fields: + input_field.hierarchical_style_update() + self.update_style() + def update_style(self): state = self.style_state( self.is_invalid, self.is_overriden, self.is_modified From e215f2e1407ed14919892d9fb72532b2324b09f4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 13:02:51 +0200 Subject: [PATCH 279/507] inputs' set_value method does not accept global_value as kwarg --- .../config_setting/widgets/inputs.py | 59 ++++--------------- 1 file changed, 12 insertions(+), 47 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index eeb6cf64cd..57785a1bce 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -301,16 +301,11 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value - def set_value(self, value, *, global_value=False): + def set_value(self, value): # Ignore value change because if `self.isChecked()` has same # value as `value` the `_on_value_change` is not triggered self.checkbox.setChecked(value) - if global_value: - self.global_value = self.item_value() - - self._on_value_change() - def clear_value(self): self.set_value(False) @@ -417,12 +412,8 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value - def set_value(self, value, *, global_value=False): + def set_value(self, value): self.input_field.setValue(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() def clear_value(self): self.set_value(0) @@ -525,15 +516,11 @@ class TextWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value - def set_value(self, value, *, global_value=False): + def set_value(self, value): if self.multiline: self.text_input.setPlainText(value) else: self.text_input.setText(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() def reset_value(self): self.set_value(self.start_value) @@ -632,12 +619,8 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value - def set_value(self, value, *, global_value=False): + def set_value(self, value): self.path_input.setText(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() def reset_value(self): self.set_value(self.start_value) @@ -709,7 +692,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): return hint - def set_value(self, value, *, global_value=False): + def set_value(self, value): if value is NOT_SET: value = "" elif not isinstance(value, str): @@ -802,12 +785,8 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value - def set_value(self, value, *, global_value=False): + def set_value(self, value): self.text_input.set_value(value) - if global_value: - self.start_value = self.item_value() - self.global_value = self.item_value() - self._on_value_change() def reset_value(self): self.set_value(self.start_value) @@ -1020,7 +999,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value - def set_value(self, value, *, global_value=False): + def set_value(self, value): previous_inputs = tuple(self.input_fields) for item_value in value: self.add_row(value=item_value) @@ -1028,11 +1007,6 @@ class ListWidget(QtWidgets.QWidget, InputObject): for input_field in previous_inputs: self.remove_row(input_field) - if global_value: - self.global_value = value - self.start_value = self.item_value() - self._on_value_change() - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1349,7 +1323,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self._is_modified = self.global_value != self.start_value - def set_value(self, value, *, global_value=False): + def set_value(self, value): previous_inputs = tuple(self.input_fields) for item_key, item_value in value.items(): self.add_row(key=item_key, value=item_value) @@ -1357,11 +1331,6 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): for input_field in previous_inputs: self.remove_row(input_field) - if global_value: - self.global_value = value - self.start_value = self.item_value() - self._on_value_change() - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1444,7 +1413,8 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): if value is not None and key is not None: item_widget.default_key = key item_widget.key_input.setText(key) - item_widget.value_input.set_value(value, global_value=True) + item_widget.value_input.update_global_values(value) + self.hierarchical_style_update() else: self._on_value_change() self.parent().updateGeometry() @@ -2059,20 +2029,15 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): ) self._was_overriden = bool(self._is_overriden) - def set_value(self, value, *, global_value=False): + def set_value(self, value): if not self.multiplatform: - self.input_fields[0].set_value(value, global_value=global_value) + self.input_fields[0].set_value(value) else: for input_field in self.input_fields: _value = value[input_field.key] input_field.set_value(_value) - if global_value: - self.global_value = value - self.start_value = self.item_value() - self._on_value_change() - def reset_value(self): for input_field in self.input_fields: input_field.reset_value() From 87085481551cefa94c9ddf7775ab6238deeb34b4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 13:03:48 +0200 Subject: [PATCH 280/507] update_global_value can accept values for inputs used as widgets --- .../config_setting/widgets/inputs.py | 102 ++++++++++-------- 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 57785a1bce..ea6cd121bd 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -286,15 +286,16 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): def update_global_values(self, parent_values): value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) - if value is not NOT_SET: - self.checkbox.setChecked(value) + if value is not NOT_SET: + self.set_value(value) - elif self.default_value is not NOT_SET: - self.checkbox.setChecked(self.default_value) + elif self.default_value is not NOT_SET: + self.set_value(self.default_value) self.global_value = value self.start_value = self.item_value() @@ -397,15 +398,17 @@ class NumberWidget(QtWidgets.QWidget, InputObject): def update_global_values(self, parent_values): value = NOT_SET - if not self._as_widget: + if self._as_widget: + value = parent_values + else: if parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) - if value is not NOT_SET: - self.input_field.setValue(value) + if value is not NOT_SET: + self.set_value(value) - elif self.default_value is not NOT_SET: - self.input_field.setValue(self.default_value) + elif self.default_value is not NOT_SET: + self.set_value(self.default_value) self.global_value = value self.start_value = self.item_value() @@ -501,15 +504,16 @@ class TextWidget(QtWidgets.QWidget, InputObject): def update_global_values(self, parent_values): value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) - if value is not NOT_SET: - self.set_value(value) + if value is not NOT_SET: + self.set_value(value) - elif self.default_value is not NOT_SET: - self.set_value(self.default_value) + elif self.default_value is not NOT_SET: + self.set_value(self.default_value) self.global_value = value self.start_value = self.item_value() @@ -604,15 +608,16 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): def update_global_values(self, parent_values): value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) - if value is not NOT_SET: - self.path_input.setText(value) + if value is not NOT_SET: + self.set_value(value) - elif self.default_value is not NOT_SET: - self.path_input.setText(self.default_value) + elif self.default_value is not NOT_SET: + self.set_value(self.default_value) self.global_value = value self.start_value = self.item_value() @@ -768,21 +773,21 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def update_global_values(self, parent_values): value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) - if value is not NOT_SET: - self.text_input.set_value(value) + if value is not NOT_SET: + self.set_value(value) - elif self.default_value is not NOT_SET: - self.text_input.set_value(self.default_value) - - self._is_invalid = self.text_input.has_invalid_value() + elif self.default_value is not NOT_SET: + self.set_value(self.default_value) self.global_value = value self.start_value = self.item_value() + self._is_invalid = self.text_input.has_invalid_value() self._is_modified = self.global_value != self.start_value def set_value(self, value): @@ -924,6 +929,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self._parent = parent self._state = None + self._as_widget = as_widget self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) @@ -976,7 +982,9 @@ class ListWidget(QtWidgets.QWidget, InputObject): old_inputs = tuple(self.input_fields) value = NOT_SET - if parent_values is not NOT_SET: + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) self.global_value = value @@ -1300,7 +1308,9 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): old_inputs = tuple(self.input_fields) value = NOT_SET - if parent_values is not NOT_SET: + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) self.global_value = value @@ -1989,20 +1999,20 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): def update_global_values(self, parent_values): value = NOT_SET - if not self._as_widget: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) - if not self.multiplatform: - self.input_fields[0].update_global_values(parent_values) + if not self.multiplatform: + self.input_fields[0].update_global_values(parent_values) - elif self.multiplatform: - for input_field in self.input_fields: - input_field.update_global_values(value) + elif self.multiplatform: + for input_field in self.input_fields: + input_field.update_global_values(value) self.global_value = value self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value def apply_overrides(self, parent_values): From df2ecaa6696fb55b286b158783cf18435dad9cf8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 13:05:03 +0200 Subject: [PATCH 281/507] styles are updated in right way for as_widget inputs --- .../config_setting/config_setting/widgets/inputs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ea6cd121bd..d2f7f6cae6 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1053,7 +1053,8 @@ class ListWidget(QtWidgets.QWidget, InputObject): # Set text if entered text is not None # else (when add button clicked) trigger `_on_value_change` if value is not None: - item_widget.value_input.set_value(value, global_value=True) + item_widget.value_input.update_global_values(value) + self.hierarchical_style_update() else: self._on_value_change() self.updateGeometry() @@ -1247,6 +1248,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self._parent = parent self._state = None + self._as_widget = as_widget self.override_value = NOT_SET self.global_value = NOT_SET @@ -1615,9 +1617,9 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.update_style() def hierarchical_style_update(self): - self.update_style() for input_field in self.input_fields: input_field.hierarchical_style_update() + self.update_style() def update_style(self, is_overriden=None): child_modified = self.child_modified @@ -1797,9 +1799,9 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): self.value_changed.emit(self) def hierarchical_style_update(self): - self.update_style() for input_field in self.input_fields: input_field.hierarchical_style_update() + self.update_style() def remove_overrides(self): self._is_overriden = False @@ -1886,6 +1888,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): "darwin": "MacOS", "linux": "Linux" } + # TODO be able to save and load with separators platform_separators = { "windows": ";", "darwin": ":", From 575ea828759f22b23ca59213b95b4dc75ae7ba45 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 13:56:32 +0200 Subject: [PATCH 282/507] discard changes and remove overrides works for roots widget --- .../config_setting/widgets/anatomy_inputs.py | 48 +++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index e4f7a6383a..efbcd437ad 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -41,14 +41,13 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): super(AnatomyWidget, self).__init__(parent) self.setObjectName("AnatomyWidget") self._parent = parent + self.key = "anatomy" self._child_state = None self._state = None self._is_group = True - self.key = "anatomy" - self.override_value = NOT_SET self.start_value = NOT_SET self.global_value = NOT_SET @@ -88,7 +87,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.templates_widget.update_global_values(value) def set_value(self, value, *, global_value=False): - print("* set_value") + raise TypeError("AnatomyWidget does not allow to use `set_value`") def clear_value(self): print("* clear_value") @@ -97,7 +96,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): print("* _on_value_change") def update_style(self, is_overriden=None): - print("* update_style") child_modified = self.child_modified child_invalid = self.child_invalid child_state = self.style_state( @@ -154,6 +152,21 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): or self.templates_widget.child_invalid ) + def remove_overrides(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + + self.root_widget.remove_overrides() + self.templates_widget.remove_overrides() + + def discard_changes(self): + self.root_widget.discard_changes() + self.templates_widget.discard_changes() + + self._is_modified = self.child_modified + self._is_overriden = self._was_overriden + def item_value(self): output = {} output.update(self.root_widget.config_value()) @@ -175,6 +188,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.root_keys = None + self.was_multiroot = NOT_SET + checkbox_widget = QtWidgets.QWidget(self) multiroot_label = QtWidgets.QLabel( "Use multiple roots", checkbox_widget @@ -220,6 +235,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): return self.multiroot_checkbox.isChecked() def update_global_values(self, parent_values): + self._is_modified = False if isinstance(parent_values, dict): value = parent_values.get(self.key, NOT_SET) else: @@ -232,12 +248,15 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): is_multiroot = True break + self.was_multiroot = is_multiroot self.set_multiroot(is_multiroot) if is_multiroot: + self.singleroot_widget.update_global_values(NOT_SET) self.multiroot_widget.update_global_values(parent_values) else: self.singleroot_widget.update_global_values(parent_values) + self.multiroot_widget.update_global_values(NOT_SET) def hierarchical_style_update(self): self.singleroot_widget.hierarchical_style_update() @@ -293,6 +312,21 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: return self.singleroot_widget.child_invalid + def remove_overrides(self): + self._is_overriden = False + self._is_modified = False + self._was_overriden = False + + self.singleroot_widget.remove_overrides() + self.multiroot_widget.remove_overrides() + + def discard_changes(self): + self.singleroot_widget.discard_changes() + self.multiroot_widget.discard_changes() + + self._is_modified = self.child_modified + self._is_overriden = self._was_overriden + def item_value(self): if self.is_multiroot: return self.multiroot_widget.item_value() @@ -333,5 +367,11 @@ class TemplatesWidget(QtWidgets.QWidget): def child_invalid(self): return False + def remove_overrides(self): + pass + + def discard_changes(self): + pass + TypeToKlass.types["anatomy"] = AnatomyWidget From d6c3d95478f49bb815fce1a3c91df9ee96ee6065 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 14:40:18 +0200 Subject: [PATCH 283/507] added few missing methods to roots widget --- .../config_setting/widgets/anatomy_inputs.py | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index efbcd437ad..4fb01a468e 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -258,6 +258,33 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.singleroot_widget.update_global_values(parent_values) self.multiroot_widget.update_global_values(NOT_SET) + def apply_overrides(self, parent_values): + # Make sure this is set to False + self._is_modified = False + self._state = None + self._child_state = None + + value = NOT_SET + if parent_values is not NOT_SET: + value = parent_values.get(self.key, value) + + is_multiroot = False + if isinstance(value, dict): + for _value in value.values(): + if isinstance(_value, dict): + is_multiroot = True + break + + self._is_overriden = value is not NOT_SET + self._was_overriden = bool(self._is_overriden) + + if is_multiroot: + self.singleroot_widget.apply_overrides(NOT_SET) + self.multiroot_widget.apply_overrides(value) + else: + self.singleroot_widget.apply_overrides(value) + self.multiroot_widget.apply_overrides(NOT_SET) + def hierarchical_style_update(self): self.singleroot_widget.hierarchical_style_update() self.multiroot_widget.hierarchical_style_update() @@ -265,6 +292,17 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def _on_multiroot_checkbox(self): self.set_multiroot(self.is_multiroot) + def _on_value_change(self, item=None): + if self.is_group and self.is_overidable: + self._is_overriden = True + + self._is_modified = ( + self.was_multiroot != self.is_multiroot + or self.child_modified + ) + + self.value_changed.emit(self) + def set_multiroot(self, is_multiroot=None): if is_multiroot is None: is_multiroot = not self.is_multiroot @@ -337,6 +375,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): return {self.key: self.item_value()} +# TODO implement class TemplatesWidget(QtWidgets.QWidget): def __init__(self, parent=None): super(TemplatesWidget, self).__init__(parent) @@ -344,6 +383,9 @@ class TemplatesWidget(QtWidgets.QWidget): def update_global_values(self, values): pass + def apply_overrides(self, parent_values): + pass + def hierarchical_style_update(self): pass From 2a34a77d168e49f815adebe80937ca1d40078cdb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 14:40:56 +0200 Subject: [PATCH 284/507] more value changes reaction implemented --- .../config_setting/widgets/anatomy_inputs.py | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 4fb01a468e..6b174ca575 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -77,6 +77,9 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.label_widget = body_widget.label_widget + self.root_widget.multiroot_changed.connect(self._on_multiroot_change) + self.root_widget.value_changed.connect(self._on_value_change) + def update_global_values(self, parent_values): if isinstance(parent_values, dict): value = parent_values.get(self.key, NOT_SET) @@ -86,14 +89,41 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.update_global_values(value) self.templates_widget.update_global_values(value) + def apply_overrides(self, parent_values): + # Make sure this is set to False + self._state = None + self._child_state = None + + value = NOT_SET + if parent_values is not NOT_SET: + value = parent_values.get(self.key, value) + + self._is_overriden = value is not NOT_SET + + self.root_widget.apply_overrides(value) + self.templates_widget.apply_overrides(value) + + self._was_overriden = bool(self._is_overriden) + def set_value(self, value, *, global_value=False): raise TypeError("AnatomyWidget does not allow to use `set_value`") def clear_value(self): - print("* clear_value") + raise TypeError("AnatomyWidget does not allow to use `clear_value`") + + def _on_multiroot_change(self): + self.update_style() def _on_value_change(self, item=None): - print("* _on_value_change") + if self.ignore_value_changes: + return + + if self.is_overidable: + self._is_overriden = True + + self.hierarchical_style_update() + + self.value_changed.emit(self) def update_style(self, is_overriden=None): child_modified = self.child_modified @@ -154,7 +184,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False - self._is_modified = False self._was_overriden = False self.root_widget.remove_overrides() @@ -164,9 +193,13 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.discard_changes() self.templates_widget.discard_changes() - self._is_modified = self.child_modified self._is_overriden = self._was_overriden + def overrides(self): + if self.is_overriden: + return self.config_value(), True + return {self.key: {}}, True + def item_value(self): output = {} output.update(self.root_widget.config_value()) @@ -178,6 +211,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): class RootsWidget(QtWidgets.QWidget, ConfigObject): multiroot_changed = QtCore.Signal() + value_changed = QtCore.Signal(object) def __init__(self, parent): super(RootsWidget, self).__init__(parent) @@ -227,6 +261,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.multiroot_widget = multiroot_widget multiroot_checkbox.stateChanged.connect(self._on_multiroot_checkbox) + singleroot_widget.value_changed.connect(self._on_value_change) + multiroot_widget.value_changed.connect(self._on_value_change) self._on_multiroot_checkbox() From d570f287100fb325e8f10ae9c59be93cfab077d4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 15:05:35 +0200 Subject: [PATCH 285/507] _was_overriden is not changed on remove overrides to keep information about change --- .../config_setting/widgets/anatomy_inputs.py | 12 ++++-------- .../config_setting/config_setting/widgets/inputs.py | 5 ----- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 6b174ca575..331921ea68 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -98,14 +98,10 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): if parent_values is not NOT_SET: value = parent_values.get(self.key, value) - self._is_overriden = value is not NOT_SET - self.root_widget.apply_overrides(value) self.templates_widget.apply_overrides(value) - self._was_overriden = bool(self._is_overriden) - - def set_value(self, value, *, global_value=False): + def set_value(self, value): raise TypeError("AnatomyWidget does not allow to use `set_value`") def clear_value(self): @@ -184,7 +180,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False - self._was_overriden = False self.root_widget.remove_overrides() self.templates_widget.remove_overrides() @@ -271,7 +266,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): return self.multiroot_checkbox.isChecked() def update_global_values(self, parent_values): - self._is_modified = False + self._state = None + self._child_state = None + if isinstance(parent_values, dict): value = parent_values.get(self.key, NOT_SET) else: @@ -296,7 +293,6 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def apply_overrides(self, parent_values): # Make sure this is set to False - self._is_modified = False self._state = None self._child_state = None diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d2f7f6cae6..81dad86c25 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -177,7 +177,6 @@ class InputObject(ConfigObject): self.set_value(self.start_value) self._is_overriden = False self._is_modified = False - self._was_overriden = False def apply_overrides(self, parent_values): self._is_modified = False @@ -1546,7 +1545,6 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - self._was_overriden = False for item in self.input_fields: item.remove_overrides() @@ -1806,7 +1804,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - self._was_overriden = False for item in self.input_fields: item.remove_overrides() @@ -2102,7 +2099,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - self._was_overriden = False for item in self.input_fields: item.remove_overrides() @@ -2234,7 +2230,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - self._was_overriden = False for item in self.input_fields: item.remove_overrides() From 38325b8d7f106296273a4b1ac28212cd33d1ec16 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 15:06:24 +0200 Subject: [PATCH 286/507] AnatomyWidget is not group --- .../config_setting/widgets/anatomy_inputs.py | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 331921ea68..96ad0c786b 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -46,13 +46,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self._child_state = None self._state = None - self._is_group = True - - self.override_value = NOT_SET - self.start_value = NOT_SET - self.global_value = NOT_SET - - self.root_keys = None self.root_widget = RootsWidget(self) self.templates_widget = TemplatesWidget(self) @@ -80,7 +73,13 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.multiroot_changed.connect(self._on_multiroot_change) self.root_widget.value_changed.connect(self._on_value_change) + def any_parent_is_group(self): + return False + def update_global_values(self, parent_values): + self._state = None + self._child_state = None + if isinstance(parent_values, dict): value = parent_values.get(self.key, NOT_SET) else: @@ -135,17 +134,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.style().polish(self) self._child_state = child_state - state = self.style_state( - child_invalid, self.is_overriden, self.is_modified - ) - if self._state == state: - return - - self.label_widget.setProperty("state", state) - self.label_widget.style().polish(self.label_widget) - - self._state = state - def hierarchical_style_update(self): self.root_widget.hierarchical_style_update() self.templates_widget.hierarchical_style_update() @@ -310,6 +298,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._is_overriden = value is not NOT_SET self._was_overriden = bool(self._is_overriden) + self.was_multiroot = is_multiroot + self.set_multiroot(is_multiroot) + if is_multiroot: self.singleroot_widget.apply_overrides(NOT_SET) self.multiroot_widget.apply_overrides(value) From 7c48e2544243e832cde214f837fcc67934706af4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 16:08:18 +0200 Subject: [PATCH 287/507] apply override pass right values --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 96ad0c786b..229dff0bd9 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -303,9 +303,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if is_multiroot: self.singleroot_widget.apply_overrides(NOT_SET) - self.multiroot_widget.apply_overrides(value) + self.multiroot_widget.apply_overrides(parent_values) else: - self.singleroot_widget.apply_overrides(value) + self.singleroot_widget.apply_overrides(parent_values) self.multiroot_widget.apply_overrides(NOT_SET) def hierarchical_style_update(self): From bd6d5999c82ec2f7059707825ceff8787dc0e30e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 16:09:11 +0200 Subject: [PATCH 288/507] is_modified is set right on overrides --- .../config_setting/widgets/inputs.py | 82 +++++++++++++------ 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 81dad86c25..93ce5603aa 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -313,17 +313,15 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): if self.ignore_value_changes: return - _value = self.item_value() - is_modified = None if self.is_overidable: self._is_overriden = True - if self.override_value is not None: - is_modified = _value != self.override_value - if is_modified is None: - is_modified = _value != self.global_value - - self._is_modified = is_modified + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value + else: + self._is_modified = self.item_value() != self.global_value self.update_style() @@ -427,10 +425,16 @@ class NumberWidget(QtWidgets.QWidget, InputObject): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value + else: + self._is_modified = self.item_value() != self.global_value + self.update_style() self.value_changed.emit(self) @@ -535,10 +539,16 @@ class TextWidget(QtWidgets.QWidget, InputObject): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value + else: + self._is_modified = self.item_value() != self.global_value + self.update_style() self.value_changed.emit(self) @@ -640,10 +650,16 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.global_value if self.is_overidable: self._is_overriden = True + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value + else: + self._is_modified = self.item_value() != self.global_value + self.update_style() self.value_changed.emit(self) @@ -803,7 +819,9 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): if self.ignore_value_changes: return - self._is_invalid = self.text_input.has_invalid_value() + if self.is_overidable: + self._is_overriden = True + if self._is_invalid: self._is_modified = True elif self._is_overriden: @@ -811,9 +829,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): else: self._is_modified = self.item_value() != self.global_value - if self.is_overidable: - self._is_overriden = True - self.update_style() self.value_changed.emit(self) @@ -1017,10 +1032,17 @@ class ListWidget(QtWidgets.QWidget, InputObject): def _on_value_change(self, item=None): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.global_value + if self.is_overidable: self._is_overriden = True + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value + else: + self._is_modified = self.item_value() != self.global_value + self.update_style() self.value_changed.emit(self) @@ -1349,15 +1371,17 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): if self.is_overidable: self._is_overriden = True - if self.is_overriden: + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: self._is_modified = self.item_value() != self.global_value - self.value_changed.emit(self) - self.update_style() + self.value_changed.emit(self) + def hierarchical_style_update(self): for input_field in self.input_fields: input_field.hierarchical_style_update() @@ -2019,7 +2043,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): # Make sure this is set to False self._state = None self._child_state = None - self._is_modified = False override_values = NOT_SET if parent_values is not NOT_SET: override_values = parent_values.get(self.key, override_values) @@ -2037,6 +2060,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): and self.is_overidable and self.child_overriden ) + self._is_modified = False self._was_overriden = bool(self._is_overriden) def set_value(self, value): @@ -2060,16 +2084,20 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): if self.ignore_value_changes: return - self._is_modified = self.item_value() != self.global_value - if self.is_group: - if self.is_overidable: - self._is_overriden = True - self.hierarchical_style_update() + if self.is_overidable: + self._is_overriden = True + + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value + else: + self._is_modified = self.item_value() != self.global_value + + self.hierarchical_style_update() self.value_changed.emit(self) - self.update_style() - def update_style(self, is_overriden=None): child_modified = self.child_modified child_invalid = self.child_invalid From 0f0dd751e8e088ea286ee9e708a1252ff1e57bad Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 16:10:16 +0200 Subject: [PATCH 289/507] is_multiroot deduction is better --- .../config_setting/widgets/anatomy_inputs.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 229dff0bd9..fb95f17785 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -288,12 +288,15 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if parent_values is not NOT_SET: value = parent_values.get(self.key, value) - is_multiroot = False - if isinstance(value, dict): - for _value in value.values(): - if isinstance(_value, dict): - is_multiroot = True - break + if value is NOT_SET: + is_multiroot = self.global_is_multiroot + else: + is_multiroot = False + if isinstance(value, dict): + for _value in value.values(): + if isinstance(_value, dict): + is_multiroot = True + break self._is_overriden = value is not NOT_SET self._was_overriden = bool(self._is_overriden) From 0e95344bfc5f321348c8f3c30a6bd1ca59f933ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 16:11:01 +0200 Subject: [PATCH 290/507] _on_value_changed ignore changes of not current roots widget --- .../config_setting/widgets/anatomy_inputs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index fb95f17785..aaea588ab2 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -205,6 +205,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.root_keys = None + self.global_is_multiroot = False self.was_multiroot = NOT_SET checkbox_widget = QtWidgets.QWidget(self) @@ -219,6 +220,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): path_widget_data = { "key": "roots", + "multipath": False, "multiplatform": True, "label": "Roots" } @@ -269,6 +271,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): is_multiroot = True break + self.global_is_multiroot = is_multiroot self.was_multiroot = is_multiroot self.set_multiroot(is_multiroot) @@ -283,6 +286,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): # Make sure this is set to False self._state = None self._child_state = None + self._is_modified = False value = NOT_SET if parent_values is not NOT_SET: @@ -319,6 +323,12 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.set_multiroot(self.is_multiroot) def _on_value_change(self, item=None): + if ( + (self.is_multiroot and item != self.multiroot_widget) + or (not self.is_multiroot and item != self.singleroot_widget) + ): + return + if self.is_group and self.is_overidable: self._is_overriden = True From 2d77236f4c05fd466ee28dc1eb17063ce22cd70b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 16:17:52 +0200 Subject: [PATCH 291/507] skip was removed on removind overrides action --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index aaea588ab2..f3fc1bfd1a 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -153,9 +153,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): @property def child_overriden(self): return ( - self.root_widget.is_overriden - or self.root_widget.child_overriden - or self.templates_widget.is_overriden + self.root_widget.child_overriden or self.templates_widget.child_overriden ) @@ -389,7 +387,6 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - self._was_overriden = False self.singleroot_widget.remove_overrides() self.multiroot_widget.remove_overrides() From b9db80e1bb7051642fa35e85100199360551623e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Sep 2020 16:21:50 +0200 Subject: [PATCH 292/507] discard changes and remove overrides set multiroot widgets right way --- .../config_setting/widgets/anatomy_inputs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index f3fc1bfd1a..8e7bb4bb8a 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -388,10 +388,18 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._is_overriden = False self._is_modified = False + self.set_multiroot(self.global_is_multiroot) + self.singleroot_widget.remove_overrides() self.multiroot_widget.remove_overrides() def discard_changes(self): + is_overriden = bool(self._is_overriden) + if is_overriden: + self.set_multiroot(self.was_multiroot) + else: + self.set_multiroot(self.global_is_multiroot) + self.singleroot_widget.discard_changes() self.multiroot_widget.discard_changes() From 89e96b6cfeb04d9b1808653f07bea81aaceade00 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 09:21:00 +0200 Subject: [PATCH 293/507] modifiable widget can be used as widget --- .../config_setting/widgets/inputs.py | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 93ce5603aa..10dd9913b8 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1292,32 +1292,33 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): main_layout.setContentsMargins(5, 5, 0, 5) main_layout.setSpacing(0) - body_widget = ExpandingWidget(input_data["label"], self) - - main_layout.addWidget(body_widget) - content_widget = QtWidgets.QWidget(self) content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(3, 3, 0, 3) - body_widget.set_content_widget(content_widget) + if as_widget: + main_layout.addWidget(content_widget) + else: + body_widget = ExpandingWidget(input_data["label"], self) + main_layout.addWidget(body_widget) + body_widget.set_content_widget(content_widget) + + self.body_widget = body_widget + self.label_widget = body_widget.label_widget + + expandable = input_data.get("expandable", True) + if not expandable: + body_widget.hide_toolbox(hide_content=False) + else: + expanded = input_data.get("expanded", False) + if expanded: + body_widget.toggle_content() - self.body_widget = body_widget self.content_widget = content_widget self.content_layout = content_layout - self.label_widget = body_widget.label_widget - self.setAttribute(QtCore.Qt.WA_StyledBackground) - expandable = input_data.get("expandable", True) - if not expandable: - body_widget.hide_toolbox(hide_content=False) - else: - expanded = input_data.get("expanded", False) - if expanded: - body_widget.toggle_content() - self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} @@ -1402,8 +1403,9 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.setProperty("state", child_state) self.style().polish(self) - self.label_widget.setProperty("state", state) - self.label_widget.style().polish(self.label_widget) + if not self._as_widget: + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) self._state = state @@ -2044,7 +2046,9 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self._state = None self._child_state = None override_values = NOT_SET - if parent_values is not NOT_SET: + if self._as_widget: + override_values = parent_values + elif parent_values is not NOT_SET: override_values = parent_values.get(self.key, override_values) self._is_overriden = override_values is not NOT_SET From 0ca9cf309c9e39a4b82d1efb28f66f370bc47bc1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 09:21:17 +0200 Subject: [PATCH 294/507] widgets in roots are used as widgets --- .../config_setting/widgets/anatomy_inputs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 8e7bb4bb8a..c6c06a42ae 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -222,7 +222,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): "multiplatform": True, "label": "Roots" } - singleroot_widget = PathWidget(path_widget_data, self) + singleroot_widget = PathWidget(path_widget_data, self, as_widget=True) multiroot_data = { "key": "roots", "label": "Roots", @@ -232,7 +232,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): "multiplatform": True } } - multiroot_widget = ModifiableDict(multiroot_data, self) + multiroot_widget = ModifiableDict(multiroot_data, self, as_widget=True) main_layout = QtWidgets.QVBoxLayout(self) main_layout.addWidget(checkbox_widget) @@ -275,9 +275,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if is_multiroot: self.singleroot_widget.update_global_values(NOT_SET) - self.multiroot_widget.update_global_values(parent_values) + self.multiroot_widget.update_global_values(value) else: - self.singleroot_widget.update_global_values(parent_values) + self.singleroot_widget.update_global_values(value) self.multiroot_widget.update_global_values(NOT_SET) def apply_overrides(self, parent_values): @@ -308,9 +308,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if is_multiroot: self.singleroot_widget.apply_overrides(NOT_SET) - self.multiroot_widget.apply_overrides(parent_values) + self.multiroot_widget.apply_overrides(value) else: - self.singleroot_widget.apply_overrides(parent_values) + self.singleroot_widget.apply_overrides(value) self.multiroot_widget.apply_overrides(NOT_SET) def hierarchical_style_update(self): From ed6c1609dca1b0167af3f6b2e89307da94637cb1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 10:57:54 +0200 Subject: [PATCH 295/507] fixed discard changes --- .../config_setting/widgets/inputs.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 10dd9913b8..a9ca88c171 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -201,10 +201,11 @@ class InputObject(ConfigObject): self.set_value(value) def discard_changes(self): + self._is_overriden = self._was_overriden if ( self.is_overidable + and self._was_overriden and self.override_value is not NOT_SET - and self._was_overriden is True ): self.set_value(self.override_value) else: @@ -1575,11 +1576,13 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): item.remove_overrides() def discard_changes(self): + self._is_overriden = self._was_overriden + self._is_modified = False + for item in self.input_fields: item.discard_changes() self._is_modified = self.child_modified - self._is_overriden = self._was_overriden def set_as_overriden(self): if self.is_overriden: @@ -1834,11 +1837,13 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): item.remove_overrides() def discard_changes(self): + self._is_modified = False + self._is_overriden = self._was_overriden + for item in self.input_fields: item.discard_changes() self._is_modified = self.child_modified - self._is_overriden = self._was_overriden def set_as_overriden(self): if self.is_overriden: @@ -2135,11 +2140,13 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): item.remove_overrides() def discard_changes(self): + self._is_modified = False + self._is_overriden = self._was_overriden + for input_field in self.input_fields: input_field.discard_changes() self._is_modified = self.child_modified - self._is_overriden = self._was_overriden @property def child_modified(self): @@ -2253,11 +2260,13 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): item.apply_overrides(parent_values) def discard_changes(self): + self._is_modified = False + self._is_overriden = self._was_overriden + for item in self.input_fields: item.discard_changes() self._is_modified = self.child_modified - self._is_overriden = self._was_overriden def remove_overrides(self): self._is_overriden = False From 93658f8a3ea7a8f2226fa7b48c765f0db800c227 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 11:02:55 +0200 Subject: [PATCH 296/507] added representation of object to not implemented exception --- pype/tools/config_setting/config_setting/widgets/widgets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 42ca49d600..e547b8181a 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -353,10 +353,12 @@ class AbstractConfigObject: def set_as_overriden(self): raise NotImplementedError( - "Method `set_as_overriden` not implemented!" + "{} Method `set_as_overriden` not implemented!".format(repr(self)) ) def hierarchical_style_update(self): raise NotImplementedError( - "Method `hierarchical_style_update` not implemented!" + "{} Method `hierarchical_style_update` not implemented!".format( + repr(self) + ) ) From 208075acfaf87bdb460a423edbc5984928bbe7a3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:12:36 +0200 Subject: [PATCH 297/507] list and dict items skip right mouse release --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index a9ca88c171..b5e0b2c5b6 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -932,6 +932,9 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def child_overriden(self): return self.value_input.child_overriden + def mouseReleaseEvent(self, event): + return QtWidgets.QWidget.mouseReleaseEvent(self, event) + class ListWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) @@ -1256,6 +1259,9 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): return {} return {key: value} + def mouseReleaseEvent(self, event): + return QtWidgets.QWidget.mouseReleaseEvent(self, event) + class ModifiableDict(QtWidgets.QWidget, InputObject): # Should be used only for dictionary with one datatype as value From 78c68beb3fd2babcf9f20dd5ae9f101c7377995d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:13:55 +0200 Subject: [PATCH 298/507] removed signal multiroot_changed --- .../config_setting/widgets/anatomy_inputs.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index c6c06a42ae..0b825b90e6 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -70,7 +70,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.label_widget = body_widget.label_widget - self.root_widget.multiroot_changed.connect(self._on_multiroot_change) self.root_widget.value_changed.connect(self._on_value_change) def any_parent_is_group(self): @@ -106,9 +105,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): def clear_value(self): raise TypeError("AnatomyWidget does not allow to use `clear_value`") - def _on_multiroot_change(self): - self.update_style() - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -191,7 +187,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): class RootsWidget(QtWidgets.QWidget, ConfigObject): - multiroot_changed = QtCore.Signal() value_changed = QtCore.Signal(object) def __init__(self, parent): @@ -347,7 +342,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.singleroot_widget.setVisible(not is_multiroot) self.multiroot_widget.setVisible(is_multiroot) - self.multiroot_changed.emit() + self._on_value_change() @property def is_modified(self): From 8ec6d0cba5d8793cf2fe2086b696db7bf6c5944c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:14:22 +0200 Subject: [PATCH 299/507] removed label from root widgets --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 0b825b90e6..e4c555138a 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -214,13 +214,11 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): path_widget_data = { "key": "roots", "multipath": False, - "multiplatform": True, - "label": "Roots" + "multiplatform": True } singleroot_widget = PathWidget(path_widget_data, self, as_widget=True) multiroot_data = { "key": "roots", - "label": "Roots", "object_type": "path-widget", "expandable": False, "input_modifiers": { From 04d8e6d2420139f3bbb43adb4cf082d16e836694 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:20:08 +0200 Subject: [PATCH 300/507] any_parent_is_group is real attribute not function --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index e4c555138a..2f1f59c31d 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -46,6 +46,8 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self._child_state = None self._state = None + self.any_parent_is_group = False + self.root_widget = RootsWidget(self) self.templates_widget = TemplatesWidget(self) @@ -72,9 +74,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.value_changed.connect(self._on_value_change) - def any_parent_is_group(self): - return False - def update_global_values(self, parent_values): self._state = None self._child_state = None From d0b05421f722397c76e8060ffb0c898742e8a489 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:21:00 +0200 Subject: [PATCH 301/507] roots widget is expandable --- .../config_setting/widgets/anatomy_inputs.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 2f1f59c31d..6a7906d46e 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -226,11 +226,21 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): } multiroot_widget = ModifiableDict(multiroot_data, self, as_widget=True) - main_layout = QtWidgets.QVBoxLayout(self) - main_layout.addWidget(checkbox_widget) - main_layout.addWidget(singleroot_widget) - main_layout.addWidget(multiroot_widget) + body_widget = ExpandingWidget("Roots", self) + content_widget = QtWidgets.QWidget(body_widget) + contnet_layout = QtWidgets.QVBoxLayout(content_widget) + contnet_layout.addWidget(checkbox_widget) + contnet_layout.addWidget(singleroot_widget) + contnet_layout.addWidget(multiroot_widget) + + body_widget.set_content_widget(content_widget) + self.label_widget = body_widget.label_widget + + main_layout = QtWidgets.QVBoxLayout(self) + main_layout.addWidget(body_widget) + + self.multiroot_label = multiroot_label self.multiroot_checkbox = multiroot_checkbox self.singleroot_widget = singleroot_widget self.multiroot_widget = multiroot_widget From 4e0afbd300b48b0bfcdfd465b92f9e84fa4761e0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:21:22 +0200 Subject: [PATCH 302/507] added mutliroot state for multiroot checkbox label --- .../config_setting/widgets/anatomy_inputs.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 6a7906d46e..81a7357c4d 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -192,10 +192,13 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): super(RootsWidget, self).__init__(parent) self.setObjectName("RootsWidget") self._parent = parent - self._is_group = True self.key = "roots" - self.root_keys = None + self._state = None + self._multiroot_state = None + + self._is_group = True + self.any_parent_is_group = False self.global_is_multiroot = False self.was_multiroot = NOT_SET @@ -257,7 +260,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def update_global_values(self, parent_values): self._state = None - self._child_state = None + self._multiroot_state = None if isinstance(parent_values, dict): value = parent_values.get(self.key, NOT_SET) @@ -285,7 +288,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def apply_overrides(self, parent_values): # Make sure this is set to False self._state = None - self._child_state = None + self._multiroot_state = None self._is_modified = False value = NOT_SET From 41d92b03afb3e89610562493058ab99de73c426f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:22:48 +0200 Subject: [PATCH 303/507] roots value change can ignore changes and do what should if item is not defined --- .../config_setting/widgets/anatomy_inputs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 81a7357c4d..c34418be87 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -326,7 +326,12 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.set_multiroot(self.is_multiroot) def _on_value_change(self, item=None): - if ( + if self.ignore_value_changes: + return + + if item is None: + pass + elif ( (self.is_multiroot and item != self.multiroot_widget) or (not self.is_multiroot and item != self.singleroot_widget) ): From 2d778ae37a43074f06be89be5e2bdbfb6770b94d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:24:01 +0200 Subject: [PATCH 304/507] discard changes sets right multiroot on discard changes --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index c34418be87..5817d67274 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -404,8 +404,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.multiroot_widget.remove_overrides() def discard_changes(self): - is_overriden = bool(self._is_overriden) - if is_overriden: + self._is_overriden = self._was_overriden + self._is_modified = False + if self._is_overriden: self.set_multiroot(self.was_multiroot) else: self.set_multiroot(self.global_is_multiroot) @@ -414,7 +415,6 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.multiroot_widget.discard_changes() self._is_modified = self.child_modified - self._is_overriden = self._was_overriden def item_value(self): if self.is_multiroot: From d35c2b62ff3edcd7a2ad0660fefc6dfdc697746c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:24:13 +0200 Subject: [PATCH 305/507] roots widget has update style --- .../config_setting/widgets/anatomy_inputs.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 5817d67274..df5be5108d 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -321,6 +321,37 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def hierarchical_style_update(self): self.singleroot_widget.hierarchical_style_update() self.multiroot_widget.hierarchical_style_update() + self.update_style() + + def update_style(self): + multiroot_state = self.style_state( + False, + self.is_overriden, + self.was_multiroot and not self.is_multiroot + ) + if multiroot_state != self._multiroot_state: + self.multiroot_label.setProperty("state", multiroot_state) + self.multiroot_label.style().polish(self.multiroot_label) + self._multiroot_state = multiroot_state + + state = self.style_state( + self.is_invalid, self.is_overriden, self.is_modified + ) + if self._state == state: + return + + if state: + child_state = "child-{}".format(state) + else: + child_state = "" + + self.setProperty("state", child_state) + self.style().polish(self) + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + self._state = state def _on_multiroot_checkbox(self): self.set_multiroot(self.is_multiroot) From 9c1e18cc103959b29788f15784136d1ff7b32bd4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 12:24:30 +0200 Subject: [PATCH 306/507] multiroot widget apply parent values --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index df5be5108d..85f562eb8b 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -313,7 +313,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if is_multiroot: self.singleroot_widget.apply_overrides(NOT_SET) - self.multiroot_widget.apply_overrides(value) + self.multiroot_widget.apply_overrides(parent_values) else: self.singleroot_widget.apply_overrides(value) self.multiroot_widget.apply_overrides(NOT_SET) From ec80578304e9f61affee1f63b4ff7b80ebe295e8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 14:15:02 +0200 Subject: [PATCH 307/507] anatomy widget does not care about is overriden --- .../config_setting/widgets/anatomy_inputs.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 85f562eb8b..e918c97bf8 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -108,9 +108,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): if self.ignore_value_changes: return - if self.is_overidable: - self._is_overriden = True - self.hierarchical_style_update() self.value_changed.emit(self) @@ -160,8 +157,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): ) def remove_overrides(self): - self._is_overriden = False - self.root_widget.remove_overrides() self.templates_widget.remove_overrides() @@ -169,8 +164,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.discard_changes() self.templates_widget.discard_changes() - self._is_overriden = self._was_overriden - def overrides(self): if self.is_overriden: return self.config_value(), True @@ -305,9 +298,6 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): is_multiroot = True break - self._is_overriden = value is not NOT_SET - self._was_overriden = bool(self._is_overriden) - self.was_multiroot = is_multiroot self.set_multiroot(is_multiroot) From 964241286bc0d7ec4b884413268ddfcd7750a7b5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 14:16:01 +0200 Subject: [PATCH 308/507] roots widget cares about is overriden and fixed multiroot state --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index e918c97bf8..a1a0879dc2 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -302,12 +302,16 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.set_multiroot(is_multiroot) if is_multiroot: + self._is_overriden = parent_values is not NOT_SET self.singleroot_widget.apply_overrides(NOT_SET) self.multiroot_widget.apply_overrides(parent_values) else: + self._is_overriden = value is not NOT_SET self.singleroot_widget.apply_overrides(value) self.multiroot_widget.apply_overrides(NOT_SET) + self._was_overriden = bool(self._is_overriden) + def hierarchical_style_update(self): self.singleroot_widget.hierarchical_style_update() self.multiroot_widget.hierarchical_style_update() @@ -317,7 +321,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): multiroot_state = self.style_state( False, self.is_overriden, - self.was_multiroot and not self.is_multiroot + self.was_multiroot != self.is_multiroot ) if multiroot_state != self._multiroot_state: self.multiroot_label.setProperty("state", multiroot_state) From 5f6687cd9687bcdba276d686ab8823cd8e800075 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:11:57 +0200 Subject: [PATCH 309/507] inputs can have different parent widget than input parent --- .../config_setting/widgets/inputs.py | 83 +++++++++++++------ 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b5e0b2c5b6..ea40b6d25e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -248,9 +248,12 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(BooleanWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(BooleanWidget, self).__init__(parent_widget) self._parent = parent self._as_widget = as_widget @@ -353,9 +356,12 @@ class NumberWidget(QtWidgets.QWidget, InputObject): input_modifiers = ("minimum", "maximum", "decimal") def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(NumberWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(NumberWidget, self).__init__(parent_widget) self._parent = parent self._as_widget = as_widget @@ -465,9 +471,12 @@ class TextWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(TextWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(TextWidget, self).__init__(parent_widget) self._parent = parent self._as_widget = as_widget @@ -582,9 +591,12 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(PathInputWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(PathInputWidget, self).__init__(parent_widget) self._parent = parent self._as_widget = as_widget @@ -742,9 +754,12 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(RawJsonWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(RawJsonWidget, self).__init__(parent_widget) self._parent = parent self._as_widget = as_widget @@ -940,9 +955,12 @@ class ListWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(ListWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(ListWidget, self).__init__(parent_widget) self.setObjectName("ListWidget") self._parent = parent @@ -1269,9 +1287,12 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(ModifiableDict, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(ModifiableDict, self).__init__(parent_widget) self.setObjectName("ModifiableDict") self._parent = parent @@ -1483,14 +1504,17 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): if as_widget: raise TypeError("Can't use \"{}\" as widget item.".format( self.__class__.__name__ )) - super(DictWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(DictWidget, self).__init__(parent_widget) self.setObjectName("DictWidget") self._state = None @@ -1743,8 +1767,14 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): allow_actions = False def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): + if parent_widget is None: + parent_widget = parent + super(DictInvisible, self).__init__(parent_widget) + self.setObjectName("DictInvisible") + self._parent = parent any_parent_is_group = parent.is_group @@ -1754,9 +1784,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): self.any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) - super(DictInvisible, self).__init__(parent) - self.setObjectName("DictInvisible") - self.setAttribute(QtCore.Qt.WA_StyledBackground) layout = QtWidgets.QVBoxLayout(self) @@ -1930,9 +1957,12 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): } def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): - super(PathWidget, self).__init__(parent) + if parent_widget is None: + parent_widget = parent + super(PathWidget, self).__init__(parent_widget) self._parent = parent self._state = None @@ -2214,8 +2244,13 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): allow_actions = False def __init__( - self, input_data, parent, as_widget=False, label_widget=None + self, input_data, parent, + as_widget=False, label_widget=None, parent_widget=None ): + if parent_widget is None: + parent_widget = parent + super(DictFormWidget, self).__init__(parent_widget) + self._parent = parent any_parent_is_group = parent.is_group @@ -2226,8 +2261,6 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self._is_group = False - super(DictFormWidget, self).__init__(parent) - self.input_fields = [] self.content_layout = QtWidgets.QFormLayout(self) From 4b63222ac76bcbd6805168125905cb56a98cc276 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:20:15 +0200 Subject: [PATCH 310/507] fixed name of content layour in roots --- .../config_setting/widgets/anatomy_inputs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index a1a0879dc2..eec6bf2a13 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -225,10 +225,10 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): body_widget = ExpandingWidget("Roots", self) content_widget = QtWidgets.QWidget(body_widget) - contnet_layout = QtWidgets.QVBoxLayout(content_widget) - contnet_layout.addWidget(checkbox_widget) - contnet_layout.addWidget(singleroot_widget) - contnet_layout.addWidget(multiroot_widget) + content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.addWidget(checkbox_widget) + content_layout.addWidget(singleroot_widget) + content_layout.addWidget(multiroot_widget) body_widget.set_content_widget(content_widget) self.label_widget = body_widget.label_widget From f8d925f7121a2ebc211cd89e9c666acf3af03261 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:20:32 +0200 Subject: [PATCH 311/507] templates widget has something in --- .../config_setting/widgets/anatomy_inputs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index eec6bf2a13..a3d3e74e48 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -456,6 +456,20 @@ class TemplatesWidget(QtWidgets.QWidget): def __init__(self, parent=None): super(TemplatesWidget, self).__init__(parent) + body_widget = ExpandingWidget("Templates", self) + content_widget = QtWidgets.QWidget(body_widget) + body_widget.set_content_widget(content_widget) + content_layout = QtWidgets.QVBoxLayout(content_widget) + + label = QtWidgets.QLabel("Nothing yet", content_widget) + content_layout.addWidget(label) + + layout = QtWidgets.QVBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + layout.addWidget(body_widget) + def update_global_values(self, values): pass From 35482ef9737d254ec62ca951ec5320a0b996765a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:21:08 +0200 Subject: [PATCH 312/507] item_value o dictionary return all keys event if are empty --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ea40b6d25e..3b40775718 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1440,9 +1440,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): def item_value(self): output = {} for item in self.input_fields: - item_value = item.config_value() - if item_value: - output.update(item_value) + output.update(item.config_value()) return output def add_row(self, row=None, key=None, value=None, is_empty=False): From a4424f6f5099c624ab2bb91941877c346ed01888 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:28:37 +0200 Subject: [PATCH 313/507] dictionary item has key_vlaue instead of _key --- .../tools/config_setting/config_setting/widgets/inputs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3b40775718..ad01ea2ad9 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1206,16 +1206,16 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.value_input.value_changed.connect(self._on_value_change) # TODO This doesn't make sence! - self.default_key = self._key() self.global_value = self.value_input.item_value() + self.origin_key = self.key_value() self.override_key = NOT_SET self.override_value = NOT_SET + def key_value(self): + return self.key_input.text() self.is_single = False - def _key(self): - return self.key_input.text() def _on_value_change(self, item=None): self.update_style() @@ -1245,7 +1245,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): return self._parent.any_parent_is_group def is_key_modified(self): - return self._key() != self.default_key + return self.key_value() != self.origin_key def is_value_modified(self): return self.value_input.is_modified From 147f3f29d99f91e0786fff2549e1f7ee16b6f2be Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:29:31 +0200 Subject: [PATCH 314/507] removed unnecessary attributes --- .../config_setting/config_setting/widgets/inputs.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ad01ea2ad9..9f45a2211c 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1166,6 +1166,9 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self._parent = config_parent + self.is_single = False + self.is_key_duplicated = False + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) @@ -1205,16 +1208,11 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.key_input.textChanged.connect(self._on_value_change) self.value_input.value_changed.connect(self._on_value_change) - # TODO This doesn't make sence! - self.global_value = self.value_input.item_value() self.origin_key = self.key_value() - self.override_key = NOT_SET - self.override_value = NOT_SET def key_value(self): return self.key_input.text() - self.is_single = False def _on_value_change(self, item=None): @@ -1273,8 +1271,6 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def config_value(self): key = self.key_input.text() value = self.value_input.item_value() - if not key: - return {} return {key: value} def mouseReleaseEvent(self, event): From a7d6eabe325daed58109f4b325adf737fa2b239f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:29:46 +0200 Subject: [PATCH 315/507] dict item has set_values --- .../config_setting/config_setting/widgets/inputs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 9f45a2211c..21ee1fc6e8 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1219,6 +1219,11 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.update_style() self.value_changed.emit(self) + def set_values(self, key, value): + self.origin_key = key + self.key_input.setText(key) + self.value_input.update_global_values(value) + @property def is_group(self): return self._parent.is_group @@ -1470,9 +1475,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): # Set value if entered value is not None # else (when add button clicked) trigger `_on_value_change` if value is not None and key is not None: - item_widget.default_key = key - item_widget.key_input.setText(key) - item_widget.value_input.update_global_values(value) + item_widget.set_values(key, value) self.hierarchical_style_update() else: self._on_value_change() From 51b4bc4e7dfb24cc7eaf7ae4bdd3ea2b4efa7b03 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:30:02 +0200 Subject: [PATCH 316/507] basic logic of key is valid in dict item --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 21ee1fc6e8..476fc0c69f 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1213,7 +1213,13 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def key_value(self): return self.key_input.text() + def is_key_valid(self): + if self.key_value() == "": + return False + if self.is_key_duplicated: + return False + return True def _on_value_change(self, item=None): self.update_style() From 0a4379557cb9a01195cc298fccc6b21c37bfd6d9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:36:53 +0200 Subject: [PATCH 317/507] added duplication invalidation for dictionary item --- .../config_setting/widgets/inputs.py | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 476fc0c69f..1f21f35d6b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1,5 +1,6 @@ import json import logging +import collections from Qt import QtWidgets, QtCore, QtGui from .widgets import ( AbstractConfigObject, @@ -1268,7 +1269,9 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.update_style() def update_style(self): - if self.is_key_modified(): + if not self.is_key_valid(): + state = "invalid" + elif self.is_key_modified(): state = "modified" else: state = "" @@ -1401,6 +1404,23 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.remove_row(input_field) def _on_value_change(self, item=None): + fields_by_keys = collections.defaultdict(list) + for input_field in self.input_fields: + key = input_field.key_value() + fields_by_keys[key].append(input_field) + + any_invalid = False + for fields in fields_by_keys.values(): + if len(fields) == 1: + field = fields[0] + if field.is_key_duplicated: + field.is_key_duplicated = False + field.update_style() + else: + for field in fields: + field.is_key_duplicated = True + field.update_style() + if self.ignore_value_changes: return From ce7e11e12c95aef286ee6029059edcd29a6f7dc2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:37:30 +0200 Subject: [PATCH 318/507] removed unused variable --- pype/tools/config_setting/config_setting/widgets/inputs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 1f21f35d6b..4a2d955ae4 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1409,7 +1409,6 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): key = input_field.key_value() fields_by_keys[key].append(input_field) - any_invalid = False for fields in fields_by_keys.values(): if len(fields) == 1: field = fields[0] From 0053379aa37aa617a9cf52bffd4b5a3bc5e244f6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 18:43:30 +0200 Subject: [PATCH 319/507] modifiable dict is validated in right way --- .../config_setting/widgets/inputs.py | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4a2d955ae4..2d23085854 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1214,13 +1214,13 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def key_value(self): return self.key_input.text() - def is_key_valid(self): + def is_key_invalid(self): if self.key_value() == "": - return False + return True if self.is_key_duplicated: - return False - return True + return True + return False def _on_value_change(self, item=None): self.update_style() @@ -1268,8 +1268,12 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.value_input.hierarchical_style_update() self.update_style() + @property + def is_invalid(self): + return self.is_key_invalid() or self.value_input.is_invalid + def update_style(self): - if not self.is_key_valid(): + if self.is_key_invalid(): state = "invalid" elif self.is_key_modified(): state = "modified" @@ -1426,7 +1430,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): if self.is_overidable: self._is_overriden = True - if self._is_invalid: + if self.is_invalid: self._is_modified = True elif self._is_overriden: self._is_modified = self.item_value() != self.override_value @@ -1520,6 +1524,17 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self._on_value_change() self.parent().updateGeometry() + @property + def is_invalid(self): + return self._is_invalid or self.child_invalid + + @property + def child_invalid(self): + for input_field in self.input_fields: + if input_field.is_invalid: + return True + return False + # Dictionaries class DictWidget(QtWidgets.QWidget, ConfigObject): From 4d109fb4e2aca4457f245b9edcf226c365e5a3a8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 19:08:06 +0200 Subject: [PATCH 320/507] roots widget at right place --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index a3d3e74e48..9e69d7234e 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -234,6 +234,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.label_widget = body_widget.label_widget main_layout = QtWidgets.QVBoxLayout(self) + main_layout.setContentsMargins(0, 0, 0, 0) main_layout.addWidget(body_widget) self.multiroot_label = multiroot_label From 5350e7a50592a53a2d9b6462647372629060f2cb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 7 Sep 2020 19:22:15 +0200 Subject: [PATCH 321/507] clickable widget does not override init --- pype/tools/config_setting/config_setting/widgets/widgets.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index e547b8181a..dff966fa36 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -57,10 +57,6 @@ class PathInput(QtWidgets.QLineEdit): class ClickableWidget(QtWidgets.QLabel): clicked = QtCore.Signal() - def __init__(self, *args, **kwargs): - super(ClickableWidget, self).__init__(*args, **kwargs) - self.setObjectName("ExpandLabel") - def mouseReleaseEvent(self, event): if event.button() == QtCore.Qt.LeftButton: self.clicked.emit() From 8ef37d3dfa565c22f776cea73e257f0000d07e64 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 10:46:07 +0200 Subject: [PATCH 322/507] defined child offset for nested hierarchy --- pype/tools/config_setting/config_setting/widgets/lib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index 0d70885de7..08b0dfc3c4 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -14,6 +14,7 @@ class TypeToKlass: NOT_SET = type("NOT_SET", (), {"__bool__": lambda obj: False})() METADATA_KEY = type("METADATA_KEY", (), {}) OVERRIDE_VERSION = 1 +CHILD_OFFSET = 15 def convert_gui_data_to_overrides(data, first=True): From de9e7811e40f64093ee92435d93beb2b95b7509b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 10:46:22 +0200 Subject: [PATCH 323/507] clickable widget is not qlabel but qwidget --- pype/tools/config_setting/config_setting/widgets/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index dff966fa36..a2e3e058b0 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -54,7 +54,7 @@ class PathInput(QtWidgets.QLineEdit): self.clear_end_path() -class ClickableWidget(QtWidgets.QLabel): +class ClickableWidget(QtWidgets.QWidget): clicked = QtCore.Signal() def mouseReleaseEvent(self, event): From 4829bbc473963187963392749634851d8283eab6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 10:46:48 +0200 Subject: [PATCH 324/507] expandable widget has one more widget for showing the left side line --- .../config_setting/widgets/widgets.py | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index a2e3e058b0..19d9ad9d25 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -82,40 +82,41 @@ class ExpandingWidget(QtWidgets.QWidget): label_widget = QtWidgets.QLabel(label, parent=top_part) label_widget.setObjectName("DictLabel") - layout = QtWidgets.QHBoxLayout(top_part) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(5) - layout.addWidget(button_toggle) - layout.addWidget(label_widget) - top_part.setLayout(layout) + side_line_widget = QtWidgets.QWidget(top_part) + side_line_widget.setObjectName("SideLineWidget") + side_line_layout = QtWidgets.QHBoxLayout(side_line_widget) + side_line_layout.setContentsMargins(5, 10, 0, 10) + side_line_layout.addWidget(button_toggle) + side_line_layout.addWidget(label_widget) + + top_part_layout = QtWidgets.QHBoxLayout(top_part) + top_part_layout.setContentsMargins(0, 0, 0, 0) + top_part_layout.addWidget(side_line_widget) self.setAttribute(QtCore.Qt.WA_StyledBackground) self.top_part = top_part + self.side_line_widget = side_line_widget self.button_toggle = button_toggle self.label_widget = label_widget self.top_part.clicked.connect(self._top_part_clicked) self.button_toggle.clicked.connect(self.toggle_content) + self.main_layout = QtWidgets.QVBoxLayout(self) + self.main_layout.setContentsMargins(0, 0, 0, 0) + self.main_layout.setSpacing(0) + self.main_layout.addWidget(self.top_part) + def hide_toolbox(self, hide_content=False): self.button_toggle.setArrowType(QtCore.Qt.NoArrow) self.toolbox_hidden = True self.content_widget.setVisible(not hide_content) self.parent().updateGeometry() - def set_content_widget(self, content_widget, margins=None): - main_layout = QtWidgets.QVBoxLayout(self) - if margins is None: - margins = (4, 4, 0, 4) - main_layout.setContentsMargins(*margins) - + def set_content_widget(self, content_widget): content_widget.setVisible(False) - - main_layout.addWidget(self.top_part) - main_layout.addWidget(content_widget) - self.setLayout(main_layout) - + self.main_layout.addWidget(content_widget) self.content_widget = content_widget def _top_part_clicked(self): From 58272c472bc1921127d13339c9d96de2ed220c26 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 10:47:37 +0200 Subject: [PATCH 325/507] modifications to match new expandable widget content properties --- .../config_setting/widgets/inputs.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 2d23085854..4347b1336d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -8,7 +8,7 @@ from .widgets import ( NumberSpinBox, PathInput ) -from .lib import NOT_SET, METADATA_KEY, TypeToKlass +from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET class ConfigObject(AbstractConfigObject): @@ -1331,12 +1331,12 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.key = input_data["key"] main_layout = QtWidgets.QHBoxLayout(self) - main_layout.setContentsMargins(5, 5, 0, 5) + main_layout.setContentsMargins(0, 0, 0, 0) main_layout.setSpacing(0) content_widget = QtWidgets.QWidget(self) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(3, 3, 0, 3) + content_layout.setContentsMargins(CHILD_OFFSET, 3, 0, 3) if as_widget: main_layout.addWidget(content_widget) @@ -1572,7 +1572,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.key = input_data["key"] main_layout = QtWidgets.QHBoxLayout(self) - main_layout.setContentsMargins(5, 5, 0, 5) + main_layout.setContentsMargins(0, 0, 0, 0) main_layout.setSpacing(0) body_widget = ExpandingWidget(input_data["label"], self) @@ -1581,7 +1581,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): content_widget = QtWidgets.QWidget(body_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(3, 3, 0, 3) + content_layout.setContentsMargins(CHILD_OFFSET, 3, 0, 3) body_widget.set_content_widget(content_widget) @@ -1725,8 +1725,10 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): child_state = "child-{}".format(child_state) if child_state != self._child_state: - self.setProperty("state", child_state) - self.style().polish(self) + self.body_widget.side_line_widget.setProperty("state", child_state) + self.body_widget.side_line_widget.style().polish( + self.body_widget.side_line_widget + ) self._child_state = child_state state = self.style_state( @@ -2300,6 +2302,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): self.input_fields = [] self.content_layout = QtWidgets.QFormLayout(self) + self.content_layout.setContentsMargins(0, 0, 0, 0) for child_data in input_data.get("children", []): self.add_children_gui(child_data) From 3a566b306f1857d86a02dff264862434bc9491eb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 10:47:51 +0200 Subject: [PATCH 326/507] only SideLineWidget has changing border colors --- .../config_setting/style/style.css | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 638bf1c6fb..9051130344 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -123,7 +123,7 @@ QPushButton[btn-type="expand-toggle"] { #DictLabel { font-weight: bold; } -#ModifiableDict, #DictWidget, #AnatomyWidget { +#SideLineWidget { border-style: solid; border-color: #455c6e; border-left-width: 3px; @@ -131,36 +131,36 @@ QPushButton[btn-type="expand-toggle"] { border-right-width: 0px; border-top-width: 0px; } -#ModifiableDict:hover, #DictWidget:hover, #AnatomyWidget:hover { +#SideLineWidget:hover { border-color: #62839d; } -#ModifiableDict[state="child-modified"], #DictWidget[state="child-modified"], #AnatomyWidget[state="child-modified"] { +#SideLineWidget[state="child-modified"]{ border-color: #106aa2; } -#ModifiableDict[state="child-modified"]:hover, #DictWidget[state="child-modified"]:hover, #AnatomyWidget[state="child-modified"]:hover { +#SideLineWidget[state="child-modified"]:hover{ border-color: #137cbd; } -#ModifiableDict[state="child-invalid"], #DictWidget[state="child-invalid"], #AnatomyWidget[state="child-invalid"] { +#SideLineWidget[state="child-invalid"]{ border-color: #ad2e2e; } -#ModifiableDict[state="child-invalid"]:hover, #DictWidget[state="child-invalid"]:hover, #AnatomyWidget[state="child-invalid"]:hover { +#SideLineWidget[state="child-invalid"]:hover{ border-color: #c93636; } -#ModifiableDict[state="child-overriden"], #DictWidget[state="child-overriden"], #AnatomyWidget[state="child-overriden"] { +#SideLineWidget[state="child-overriden"]{ border-color: #e67300; } -#ModifiableDict[state="child-overriden"]:hover, #DictWidget[state="child-overriden"]:hover, #AnatomyWidget[state="child-overriden"]:hover { +#SideLineWidget[state="child-overriden"]:hover { border-color: #ff8c1a; } -#ModifiableDict[state="child-overriden-modified"], #DictWidget[state="child-overriden-modified"], #AnatomyWidget[state="child-modified"] { +#SideLineWidget[state="child-overriden-modified"] { border-color: #106aa2; } -#ModifiableDict[state="child-overriden-modified"]:hover, #DictWidget[state="child-overriden-modified"]:hover, #AnatomyWidget[state="child-modified"]:hover { +#SideLineWidget[state="child-overriden-modified"]:hover { border-color: #137cbd; } From bafc82364df22bc9ab8e684232d1adfacb6b5849 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 10:54:44 +0200 Subject: [PATCH 327/507] top part of expandable widget is not used elsewhere --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 +- pype/tools/config_setting/config_setting/widgets/widgets.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4347b1336d..a66f121b3d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1631,7 +1631,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): ) item.value_changed.connect(self._on_value_change) - self.body_widget.top_part.layout().addWidget(item) + self.body_widget.side_line_layout.addWidget(item) self.checkbox_widget = item self.input_fields.append(item) return item diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 19d9ad9d25..8291f56e13 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -95,18 +95,18 @@ class ExpandingWidget(QtWidgets.QWidget): self.setAttribute(QtCore.Qt.WA_StyledBackground) - self.top_part = top_part self.side_line_widget = side_line_widget + self.side_line_layout = side_line_layout self.button_toggle = button_toggle self.label_widget = label_widget - self.top_part.clicked.connect(self._top_part_clicked) + top_part.clicked.connect(self._top_part_clicked) self.button_toggle.clicked.connect(self.toggle_content) self.main_layout = QtWidgets.QVBoxLayout(self) self.main_layout.setContentsMargins(0, 0, 0, 0) self.main_layout.setSpacing(0) - self.main_layout.addWidget(self.top_part) + self.main_layout.addWidget(top_part) def hide_toolbox(self, hide_content=False): self.button_toggle.setArrowType(QtCore.Qt.NoArrow) From e453b1c816084b957244cc5576e932d48aee6e6e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 10:54:57 +0200 Subject: [PATCH 328/507] add bg color to dict parts --- pype/tools/config_setting/config_setting/style/style.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 9051130344..3c8cc59182 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -123,7 +123,9 @@ QPushButton[btn-type="expand-toggle"] { #DictLabel { font-weight: bold; } + #SideLineWidget { + background-color: #31424e; border-style: solid; border-color: #455c6e; border-left-width: 3px; @@ -131,11 +133,11 @@ QPushButton[btn-type="expand-toggle"] { border-right-width: 0px; border-top-width: 0px; } + #SideLineWidget:hover { border-color: #62839d; } - #SideLineWidget[state="child-modified"]{ border-color: #106aa2; } From 19dd51fb98d53f19e010d13681fc140981604241 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 11:48:56 +0200 Subject: [PATCH 329/507] set checkbox spacing --- pype/tools/config_setting/config_setting/style/style.css | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 3c8cc59182..079d2f697e 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -19,12 +19,11 @@ QMenu::item:selected { border-left-color: #61839e; background-color: #222d37; } - -QCheckBox::indicator { -} -QCheckBox::indicator:focus { - color: #ff0000; +QCheckBox { + spacing: 0px; } +QCheckBox::indicator {} +QCheckBox::indicator:focus {} QLineEdit, QSpinBox, QDoubleSpinBox, QPlainTextEdit, QTextEdit { border: 1px solid #aaaaaa; From 842aeaf6de0d2d75d80b3af06a08190ea706bb28 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 11:53:22 +0200 Subject: [PATCH 330/507] expanding widget has more widgets --- .../config_setting/widgets/widgets.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 8291f56e13..31c7df4704 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -95,6 +95,10 @@ class ExpandingWidget(QtWidgets.QWidget): self.setAttribute(QtCore.Qt.WA_StyledBackground) + self.top_part_ending = None + self.after_label_layout = None + self.end_of_layout = None + self.side_line_widget = side_line_widget self.side_line_layout = side_line_layout self.button_toggle = button_toggle @@ -137,6 +141,47 @@ class ExpandingWidget(QtWidgets.QWidget): self.content_widget.setVisible(checked) self.parent().updateGeometry() + def add_widget_after_label(self, widget): + self._add_side_widget_subwidgets() + self.after_label_layout.addWidget(widget) + + def _add_side_widget_subwidgets(self): + if self.top_part_ending is not None: + return + + top_part_ending = QtWidgets.QWidget(self.side_line_widget) + top_part_ending.setAttribute(QtCore.Qt.WA_TranslucentBackground) + + top_part_ending_layout = QtWidgets.QHBoxLayout(top_part_ending) + top_part_ending_layout.setContentsMargins(0, 0, 0, 0) + top_part_ending_layout.setSpacing(0) + top_part_ending_layout.setAlignment(QtCore.Qt.AlignVCenter) + + after_label_widget = QtWidgets.QWidget(top_part_ending) + spacer_item = QtWidgets.QWidget(top_part_ending) + end_of_widget = QtWidgets.QWidget(top_part_ending) + + self.after_label_layout = QtWidgets.QVBoxLayout(after_label_widget) + self.after_label_layout.setContentsMargins(0, 0, 0, 0) + + self.end_of_layout = QtWidgets.QVBoxLayout(end_of_widget) + self.end_of_layout.setContentsMargins(0, 0, 0, 0) + + spacer_layout = QtWidgets.QVBoxLayout(spacer_item) + spacer_layout.setContentsMargins(0, 0, 0, 0) + + top_part_ending_layout.addWidget(after_label_widget, 0) + top_part_ending_layout.addWidget(spacer_item, 1) + top_part_ending_layout.addWidget(end_of_widget, 0) + + top_part_ending.setAttribute(QtCore.Qt.WA_TranslucentBackground) + after_label_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) + spacer_item.setAttribute(QtCore.Qt.WA_TranslucentBackground) + end_of_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) + + self.top_part_ending = top_part_ending + self.side_line_layout.addWidget(top_part_ending) + def resizeEvent(self, event): super(ExpandingWidget, self).resizeEvent(event) self.content_widget.updateGeometry() From 47da6e688449b5c68eeaa179da618ba38cc2526c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 11:54:13 +0200 Subject: [PATCH 331/507] dict widget use different way of adding checkbox to top --- pype/tools/config_setting/config_setting/widgets/inputs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index a66f121b3d..f188471df8 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -282,7 +282,6 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.label_widget = label_widget self.checkbox = QtWidgets.QCheckBox(self) - self.checkbox.setAttribute(QtCore.Qt.WA_StyledBackground) layout.addWidget(self.checkbox, 1) self.setFocusProxy(self.checkbox) @@ -1631,7 +1630,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): ) item.value_changed.connect(self._on_value_change) - self.body_widget.side_line_layout.addWidget(item) + self.body_widget.add_widget_after_label(item) self.checkbox_widget = item self.input_fields.append(item) return item From 37f901ad0979ad0875fc65f68e2bc406d74ec8d9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 11:57:17 +0200 Subject: [PATCH 332/507] dict widget has right margins --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f188471df8..bed0e60339 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1580,7 +1580,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): content_widget = QtWidgets.QWidget(body_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(CHILD_OFFSET, 3, 0, 3) + content_layout.setContentsMargins(CHILD_OFFSET, 5, 0, 0) body_widget.set_content_widget(content_widget) From 03470eb75d9e46f62a35a443218ef3281fc7632b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 12:28:51 +0200 Subject: [PATCH 333/507] changed styled background to transparent in most of cases --- .../config_setting/config_setting/widgets/inputs.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index bed0e60339..f175cb159a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -277,7 +277,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - label_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + label_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) layout.addWidget(label_widget, 0) self.label_widget = label_widget @@ -993,7 +993,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.label_widget = label_widget inputs_widget = QtWidgets.QWidget(self) - inputs_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + inputs_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) layout.addWidget(inputs_widget) inputs_layout = QtWidgets.QVBoxLayout(inputs_widget) @@ -1358,7 +1358,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.content_widget = content_widget self.content_layout = content_layout - self.setAttribute(QtCore.Qt.WA_StyledBackground) + self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.object_type = input_data["object_type"] self.default_value = input_data.get("default", NOT_SET) @@ -1590,7 +1590,6 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.label_widget = body_widget.label_widget - self.setAttribute(QtCore.Qt.WA_StyledBackground) self.checkbox_widget = None self.checkbox_key = input_data.get("checkbox_key") @@ -1822,7 +1821,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): self.any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) - self.setAttribute(QtCore.Qt.WA_StyledBackground) + self.setAttribute(QtCore.Qt.WA_TranslucentBackground) layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -2041,7 +2040,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - label_widget.setAttribute(QtCore.Qt.WA_StyledBackground) + label_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) layout.addWidget(label_widget, 0) self.label_widget = label_widget From 7794f5a20dcbd593d5b28551ef39e264f976ea4c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 12:29:08 +0200 Subject: [PATCH 334/507] chceckbox widget has spacer at the end --- pype/tools/config_setting/config_setting/widgets/inputs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f175cb159a..6fb1f553bd 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -282,7 +282,12 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.label_widget = label_widget self.checkbox = QtWidgets.QCheckBox(self) - layout.addWidget(self.checkbox, 1) + spacer = QtWidgets.QWidget(self) + layout.addWidget(self.checkbox, 0) + layout.addWidget(spacer, 1) + + spacer.setAttribute(QtCore.Qt.WA_TranslucentBackground) + self.setFocusProxy(self.checkbox) self.checkbox.stateChanged.connect(self._on_value_change) From f21c9426aaa4bdf6cc14f687694b5e402f1773bf Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 12:29:25 +0200 Subject: [PATCH 335/507] expanding widget is transparent too --- pype/tools/config_setting/config_setting/widgets/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 31c7df4704..a76f4f6f35 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -93,7 +93,7 @@ class ExpandingWidget(QtWidgets.QWidget): top_part_layout.setContentsMargins(0, 0, 0, 0) top_part_layout.addWidget(side_line_widget) - self.setAttribute(QtCore.Qt.WA_StyledBackground) + self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.top_part_ending = None self.after_label_layout = None From 5224572d23284f5a7bc26c45e19a6ed852318673 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 12:30:23 +0200 Subject: [PATCH 336/507] content widget has darker and darker background --- pype/tools/config_setting/config_setting/style/style.css | 4 ++++ pype/tools/config_setting/config_setting/widgets/inputs.py | 1 + 2 files changed, 5 insertions(+) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 079d2f697e..f238246063 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -123,6 +123,10 @@ QPushButton[btn-type="expand-toggle"] { font-weight: bold; } +#ContentWidget { + background-color: rgba(19, 26, 32, 20%); +} + #SideLineWidget { background-color: #31424e; border-style: solid; diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 6fb1f553bd..221d02ca65 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1584,6 +1584,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): main_layout.addWidget(body_widget) content_widget = QtWidgets.QWidget(body_widget) + content_widget.setObjectName("ContentWidget") content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(CHILD_OFFSET, 5, 0, 0) From 53bbafcb244d9aa9647723486bbe365bfeaa2750 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 13:55:51 +0200 Subject: [PATCH 337/507] ContentWidget is transparent by default --- pype/tools/config_setting/config_setting/style/style.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index f238246063..af61655a36 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -124,6 +124,9 @@ QPushButton[btn-type="expand-toggle"] { } #ContentWidget { + background-color: transparent; +} +#ContentWidget[content_state="hightlighted"] { background-color: rgba(19, 26, 32, 20%); } From 1dabf20d363d7f6331c933a9525e6571d61ebd89 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 13:56:15 +0200 Subject: [PATCH 338/507] dict widget can have set if should highlight background --- .../config_setting/config_setting/widgets/inputs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 221d02ca65..bd046e32dd 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1571,6 +1571,11 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) + if input_data.get("highlight_content", False): + content_state = "hightlighted" + else: + content_state = "" + self.input_fields = [] self.key = input_data["key"] @@ -1585,6 +1590,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): content_widget = QtWidgets.QWidget(body_widget) content_widget.setObjectName("ContentWidget") + content_widget.setProperty("content_state", content_state) content_layout = QtWidgets.QVBoxLayout(content_widget) content_layout.setContentsMargins(CHILD_OFFSET, 5, 0, 0) @@ -1596,7 +1602,6 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.label_widget = body_widget.label_widget - self.checkbox_widget = None self.checkbox_key = input_data.get("checkbox_key") @@ -2311,6 +2316,8 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): for child_data in input_data.get("children", []): self.add_children_gui(child_data) + self.setAttribute(QtCore.Qt.WA_TranslucentBackground) + def add_children_gui(self, child_configuration): item_type = child_configuration["type"] # Pop label to not be set in child From 6efbecff8f49eab23d5a6d5ee84271519320290b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 13:59:54 +0200 Subject: [PATCH 339/507] added bottom margin to content when should highligh content --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index bd046e32dd..908fe8e070 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1573,8 +1573,10 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): if input_data.get("highlight_content", False): content_state = "hightlighted" + bottom_margin = 5 else: content_state = "" + bottom_margin = 0 self.input_fields = [] @@ -1592,7 +1594,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): content_widget.setObjectName("ContentWidget") content_widget.setProperty("content_state", content_state) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(CHILD_OFFSET, 5, 0, 0) + content_layout.setContentsMargins(CHILD_OFFSET, 5, 0, bottom_margin) body_widget.set_content_widget(content_widget) From 967e312df0861751347e3b0b2d2ad2ab4ca20941 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 14:11:48 +0200 Subject: [PATCH 340/507] AnatomyWIdget is using expanding widget --- .../config_setting/widgets/anatomy_inputs.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 9e69d7234e..befd928463 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -1,7 +1,7 @@ from Qt import QtWidgets, QtCore from .widgets import ExpandingWidget from .inputs import ConfigObject, ModifiableDict, PathWidget -from .lib import NOT_SET, TypeToKlass +from .lib import NOT_SET, TypeToKlass, CHILD_OFFSET class AnatomyWidget(QtWidgets.QWidget, ConfigObject): @@ -56,13 +56,13 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): body_widget = ExpandingWidget("Anatomy", self) layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(5, 5, 0, 5) + layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) layout.addWidget(body_widget) content_widget = QtWidgets.QWidget(body_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) - content_layout.setContentsMargins(0, 0, 0, 0) + content_layout.setContentsMargins(CHILD_OFFSET, 5, 0, 0) content_layout.setSpacing(5) content_layout.addWidget(self.root_widget) @@ -206,12 +206,18 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): checkbox_layout.addWidget(multiroot_label, 0) checkbox_layout.addWidget(multiroot_checkbox, 1) + body_widget = ExpandingWidget("Roots", self) + content_widget = QtWidgets.QWidget(body_widget) + path_widget_data = { "key": "roots", "multipath": False, "multiplatform": True } - singleroot_widget = PathWidget(path_widget_data, self, as_widget=True) + singleroot_widget = PathWidget( + path_widget_data, self, + as_widget=True, parent_widget=content_widget + ) multiroot_data = { "key": "roots", "object_type": "path-widget", @@ -220,12 +226,13 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): "multiplatform": True } } - multiroot_widget = ModifiableDict(multiroot_data, self, as_widget=True) + multiroot_widget = ModifiableDict( + multiroot_data, self, + as_widget=True, parent_widget=content_widget + ) - body_widget = ExpandingWidget("Roots", self) - - content_widget = QtWidgets.QWidget(body_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) + content_layout.setContentsMargins(0, 0, 0, 0) content_layout.addWidget(checkbox_widget) content_layout.addWidget(singleroot_widget) content_layout.addWidget(multiroot_widget) From 4e03a7c6a55a8884b2ed62b64bcadfa11d017a65 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 14:12:10 +0200 Subject: [PATCH 341/507] lowered bg color increasing --- pype/tools/config_setting/config_setting/style/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index af61655a36..fe3bba366a 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -127,7 +127,7 @@ QPushButton[btn-type="expand-toggle"] { background-color: transparent; } #ContentWidget[content_state="hightlighted"] { - background-color: rgba(19, 26, 32, 20%); + background-color: rgba(19, 26, 32, 15%); } #SideLineWidget { From 99899a35ea7caca510f883de70ef9452d02b2299 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 14:18:40 +0200 Subject: [PATCH 342/507] fix style updates in list --- .../config_setting/config_setting/widgets/inputs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 908fe8e070..18a6ef690b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -952,6 +952,9 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def child_overriden(self): return self.value_input.child_overriden + def hierarchical_style_update(self): + self.value_input.hierarchical_style_update() + def mouseReleaseEvent(self, event): return QtWidgets.QWidget.mouseReleaseEvent(self, event) @@ -1047,6 +1050,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.start_value = self.item_value() self._is_modified = self.global_value != self.start_value + self.hierarchical_style_update() def set_value(self, value): previous_inputs = tuple(self.input_fields) @@ -1102,7 +1106,6 @@ class ListWidget(QtWidgets.QWidget, InputObject): # else (when add button clicked) trigger `_on_value_change` if value is not None: item_widget.value_input.update_global_values(value) - self.hierarchical_style_update() else: self._on_value_change() self.updateGeometry() @@ -1143,6 +1146,11 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.set_value(value) + def hierarchical_style_update(self): + for input_field in self.input_fields: + input_field.hierarchical_style_update() + self.update_style() + def update_style(self): state = self.style_state( self.is_invalid, self.is_overriden, self.is_modified From 6c37ede07cb9a12a99f4282cc566d43632ebca47 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 14:40:08 +0200 Subject: [PATCH 343/507] fix raw json in-validation --- pype/tools/config_setting/config_setting/widgets/inputs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 18a6ef690b..a08ad88015 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -820,10 +820,11 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): elif self.default_value is not NOT_SET: self.set_value(self.default_value) + self._is_invalid = self.text_input.has_invalid_value() + self.global_value = value self.start_value = self.item_value() - self._is_invalid = self.text_input.has_invalid_value() self._is_modified = self.global_value != self.start_value def set_value(self, value): From 1ceb51a26b3659b95cb517f1a971eb99d6de07ae Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 14:43:17 +0200 Subject: [PATCH 344/507] added simple implementation of Templates --- .../config_setting/widgets/anatomy_inputs.py | 56 +++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index befd928463..7705efd91c 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -1,6 +1,6 @@ from Qt import QtWidgets, QtCore from .widgets import ExpandingWidget -from .inputs import ConfigObject, ModifiableDict, PathWidget +from .inputs import ConfigObject, ModifiableDict, PathWidget, RawJsonWidget from .lib import NOT_SET, TypeToKlass, CHILD_OFFSET @@ -172,6 +172,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): def item_value(self): output = {} output.update(self.root_widget.config_value()) + output.update(self.templates_widget.config_value()) return output def config_value(self): @@ -459,18 +460,30 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): return {self.key: self.item_value()} -# TODO implement -class TemplatesWidget(QtWidgets.QWidget): - def __init__(self, parent=None): +class TemplatesWidget(QtWidgets.QWidget, ConfigObject): + def __init__(self, parent): super(TemplatesWidget, self).__init__(parent) + self._parent = parent + + self._is_group = True + self.any_parent_is_group = False + self.key = "templates" + body_widget = ExpandingWidget("Templates", self) content_widget = QtWidgets.QWidget(body_widget) body_widget.set_content_widget(content_widget) content_layout = QtWidgets.QVBoxLayout(content_widget) - label = QtWidgets.QLabel("Nothing yet", content_widget) - content_layout.addWidget(label) + template_input_data = { + "key": self.key + } + self.label_widget = body_widget.label_widget + self.value_input = RawJsonWidget( + template_input_data, self, + label_widget=self.label_widget + ) + content_layout.addWidget(self.value_input) layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -479,39 +492,50 @@ class TemplatesWidget(QtWidgets.QWidget): layout.addWidget(body_widget) def update_global_values(self, values): - pass + self.value_input.update_global_values(values) def apply_overrides(self, parent_values): - pass + self.value_input.apply_overrides(parent_values) def hierarchical_style_update(self): - pass + self.value_input.hierarchical_style_update() @property def is_modified(self): - return False + return self.value_input.is_modified @property def is_overriden(self): - return False + return self._is_overriden @property def child_modified(self): - return False + return self.value_input.child_modified @property def child_overriden(self): - return False + return self.value_input.child_overriden @property def child_invalid(self): - return False + return self.value_input.child_invalid def remove_overrides(self): - pass + print("* `remove_overrides` NOT IMPLEMENTED") def discard_changes(self): - pass + print("* `discard_changes` NOT IMPLEMENTED") + + def overrides(self): + if not self.is_overriden: + return NOT_SET, False + return self.config_value(), True + + def item_value(self): + return self.value_input.item_value() + + def config_value(self): + return self.value_input.config_value() TypeToKlass.types["anatomy"] = AnatomyWidget From 80ef4bf876ccf60d0b7c1093991321d002a1d6ef Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 14:49:13 +0200 Subject: [PATCH 345/507] implemented set_as_overriden for path widget --- pype/tools/config_setting/config_setting/widgets/inputs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index a08ad88015..155bcbb74d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2243,6 +2243,9 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified + def set_as_overriden(self): + self._is_overriden = True + @property def child_modified(self): for input_field in self.input_fields: From d7e2b07fcc38bbdf025a9d5db529a6bb0c5011d6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 14:57:53 +0200 Subject: [PATCH 346/507] few minor changes about attribute values in anatomy iwdgets --- .../config_setting/widgets/anatomy_inputs.py | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 7705efd91c..688b4bf715 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -131,10 +131,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.templates_widget.hierarchical_style_update() self.update_style() - @property - def is_modified(self): - return self._is_modified or self.child_modified - @property def child_modified(self): return ( @@ -363,9 +359,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if self.ignore_value_changes: return - if item is None: - pass - elif ( + if item is not None and ( (self.is_multiroot and item != self.multiroot_widget) or (not self.is_multiroot and item != self.singleroot_widget) ): @@ -393,14 +387,6 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._on_value_change() - @property - def is_modified(self): - return self._is_modified or self.child_modified - - @property - def is_overriden(self): - return self._is_overriden - @property def child_modified(self): if self.is_multiroot: @@ -450,6 +436,11 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified + def set_as_overriden(self): + self._is_overriden = self._was_overriden + self.singleroot_widget.set_as_overriden() + self.multiroot_widget.set_as_overriden() + def item_value(self): if self.is_multiroot: return self.multiroot_widget.item_value() @@ -521,13 +512,16 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): return self.value_input.child_invalid def remove_overrides(self): - print("* `remove_overrides` NOT IMPLEMENTED") + self.value_input.remove_overrides() def discard_changes(self): - print("* `discard_changes` NOT IMPLEMENTED") + self.value_input.discard_changes() + + def set_as_overriden(self): + self.value_input.set_as_overriden() def overrides(self): - if not self.is_overriden: + if not self.child_overriden: return NOT_SET, False return self.config_value(), True From 019ed41e23ac3b9de57e865cf8645219fdb5a5f7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 16:08:54 +0200 Subject: [PATCH 347/507] overrides for anatomy are saving data --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 688b4bf715..b0aed18e01 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -161,9 +161,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.templates_widget.discard_changes() def overrides(self): - if self.is_overriden: - return self.config_value(), True - return {self.key: {}}, True + return self.config_value(), True def item_value(self): output = {} From 504ae4a1b3f054c1fb8327be89675eede5c56978 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 18:22:13 +0200 Subject: [PATCH 348/507] moved setting attributes on apply overrides --- .../config_setting/widgets/anatomy_inputs.py | 4 ++-- .../config_setting/config_setting/widgets/inputs.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index b0aed18e01..6d4417a6aa 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -306,15 +306,15 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if is_multiroot: self._is_overriden = parent_values is not NOT_SET + self._was_overriden = bool(self._is_overriden) self.singleroot_widget.apply_overrides(NOT_SET) self.multiroot_widget.apply_overrides(parent_values) else: self._is_overriden = value is not NOT_SET + self._was_overriden = bool(self._is_overriden) self.singleroot_widget.apply_overrides(value) self.multiroot_widget.apply_overrides(NOT_SET) - self._was_overriden = bool(self._is_overriden) - def hierarchical_style_update(self): self.singleroot_widget.hierarchical_style_update() self.multiroot_widget.hierarchical_style_update() diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 155bcbb74d..b094e4cf67 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -16,6 +16,7 @@ class ConfigObject(AbstractConfigObject): default_state = "" + _as_widget = False _is_overriden = False _is_modified = False _was_overriden = False @@ -44,6 +45,8 @@ class ConfigObject(AbstractConfigObject): @property def was_overriden(self): """Initial state after applying overrides.""" + if self._as_widget: + return self._parent.was_overriden return self._was_overriden @property @@ -673,7 +676,7 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): if self._is_invalid: self._is_modified = True - elif self._is_overriden: + elif self.is_overriden: self._is_modified = self.item_value() != self.override_value else: self._is_modified = self.item_value() != self.global_value @@ -1126,6 +1129,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.updateGeometry() def apply_overrides(self, parent_values): + self._is_modified = False if parent_values is NOT_SET or self.key not in parent_values: override_value = NOT_SET else: @@ -2142,7 +2146,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.global_value != self.start_value def apply_overrides(self, parent_values): - # Make sure this is set to False + self._is_modified = False self._state = None self._child_state = None override_values = NOT_SET @@ -2152,6 +2156,8 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): override_values = parent_values.get(self.key, override_values) self._is_overriden = override_values is not NOT_SET + self._was_overriden = bool(self._is_overriden) + if not self.multiplatform: self.input_fields[0].apply_overrides(parent_values) else: From d22371d0f53436385af97bb63892eb7c307030ab Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 18:22:36 +0200 Subject: [PATCH 349/507] modifiable dict sets overrides instead of setting values --- .../config_setting/widgets/inputs.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b094e4cf67..f975567a6a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1243,11 +1243,16 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.update_style() self.value_changed.emit(self) - def set_values(self, key, value): + def update_global_values(self, key, value): self.origin_key = key self.key_input.setText(key) self.value_input.update_global_values(value) + def apply_overrides(self, key, value): + self.origin_key = key + self.key_input.setText(key) + self.value_input.apply_overrides(value) + @property def is_group(self): return self._parent.is_group @@ -1521,7 +1526,10 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): # Set value if entered value is not None # else (when add button clicked) trigger `_on_value_change` if value is not None and key is not None: - item_widget.set_values(key, value) + if self._is_overriden: + item_widget.apply_overrides(key, value) + else: + item_widget.update_global_values(key, value) self.hierarchical_style_update() else: self._on_value_change() @@ -2161,8 +2169,8 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): if not self.multiplatform: self.input_fields[0].apply_overrides(parent_values) else: - for item in self.input_fields: - item.apply_overrides(override_values) + for input_field in self.input_fields: + input_field.apply_overrides(override_values) if not self._is_overriden: self._is_overriden = ( From b03687ea055ff30b39b7c9003c888f28acf0c449 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Sep 2020 18:38:52 +0200 Subject: [PATCH 350/507] anatomy widgets propagate child modifications down the hierarchy --- .../config_setting/widgets/anatomy_inputs.py | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 6d4417a6aa..e59de3980f 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -70,6 +70,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): body_widget.set_content_widget(content_widget) + self.body_widget = body_widget self.label_widget = body_widget.label_widget self.root_widget.value_changed.connect(self._on_value_change) @@ -122,8 +123,10 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): child_state = "child-{}".format(child_state) if child_state != self._child_state: - self.setProperty("state", child_state) - self.style().polish(self) + self.body_widget.side_line_widget.setProperty("state", child_state) + self.body_widget.side_line_widget.style().polish( + self.body_widget.side_line_widget + ) self._child_state = child_state def hierarchical_style_update(self): @@ -239,6 +242,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): main_layout.setContentsMargins(0, 0, 0, 0) main_layout.addWidget(body_widget) + self.body_widget = body_widget self.multiroot_label = multiroot_label self.multiroot_checkbox = multiroot_checkbox self.singleroot_widget = singleroot_widget @@ -342,8 +346,10 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: child_state = "" - self.setProperty("state", child_state) - self.style().polish(self) + self.body_widget.side_line_widget.setProperty("state", child_state) + self.body_widget.side_line_widget.style().polish( + self.body_widget.side_line_widget + ) self.label_widget.setProperty("state", state) self.label_widget.style().polish(self.label_widget) @@ -455,6 +461,8 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): self._parent = parent + self._state = None + self._is_group = True self.any_parent_is_group = False self.key = "templates" @@ -467,6 +475,7 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): template_input_data = { "key": self.key } + self.body_widget = body_widget self.label_widget = body_widget.label_widget self.value_input = RawJsonWidget( template_input_data, self, @@ -481,13 +490,38 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): layout.addWidget(body_widget) def update_global_values(self, values): + self._state = None self.value_input.update_global_values(values) def apply_overrides(self, parent_values): + self._state = None self.value_input.apply_overrides(parent_values) def hierarchical_style_update(self): self.value_input.hierarchical_style_update() + self.update_style() + + def update_style(self): + state = self.style_state( + self.child_invalid, self.child_overriden, self.child_modified + ) + if self._state == state: + return + + if state: + child_state = "child-{}".format(state) + else: + child_state = "" + print(child_state) + self.body_widget.side_line_widget.setProperty("state", child_state) + self.body_widget.side_line_widget.style().polish( + self.body_widget.side_line_widget + ) + + self.label_widget.setProperty("state", state) + self.label_widget.style().polish(self.label_widget) + + self._state = state @property def is_modified(self): From ace606efe6e4bac12e0a2c25060ae6f781335ec3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 09:51:25 +0200 Subject: [PATCH 351/507] renamed studio to system window --- pype/tools/config_setting/config_setting/widgets/base.py | 4 ++-- pype/tools/config_setting/config_setting/widgets/window.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 066c00c96d..d39b5789d9 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -7,14 +7,14 @@ from . import lib from avalon import io -class StudioWidget(QtWidgets.QWidget): +class SystemWidget(QtWidgets.QWidget): is_overidable = False _is_overriden = False _is_group = False _any_parent_is_group = False def __init__(self, parent=None): - super(StudioWidget, self).__init__(parent) + super(SystemWidget, self).__init__(parent) self._ignore_value_changes = False diff --git a/pype/tools/config_setting/config_setting/widgets/window.py b/pype/tools/config_setting/config_setting/widgets/window.py index af23e68f77..7ad46b1a06 100644 --- a/pype/tools/config_setting/config_setting/widgets/window.py +++ b/pype/tools/config_setting/config_setting/widgets/window.py @@ -1,5 +1,5 @@ from Qt import QtWidgets -from .base import StudioWidget, ProjectWidget +from .base import SystemWidget, ProjectWidget class MainWidget(QtWidgets.QWidget): @@ -13,9 +13,9 @@ class MainWidget(QtWidgets.QWidget): header_tab_widget = QtWidgets.QTabWidget(parent=self) - studio_widget = StudioWidget() + studio_widget = SystemWidget() project_widget = ProjectWidget() - header_tab_widget.addTab(studio_widget, "Studio") + header_tab_widget.addTab(studio_widget, "System") header_tab_widget.addTab(project_widget, "Project") layout = QtWidgets.QVBoxLayout(self) From 28931dba6b17aff9a634e06e6b351b9b7b6c9781 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:00:42 +0200 Subject: [PATCH 352/507] removed configs from config tool --- .../project_presets/ftrack/ftrack_config.json | 11 - .../project_presets/global/creator.json | 8 - .../global/slates/example_HD.json | 212 ------------------ .../config/project_presets/maya/capture.json | 108 --------- .../project_presets/plugins/config.json | 1 - .../plugins/ftrack/publish.json | 6 - .../plugins/global/create.json | 1 - .../plugins/global/filter.json | 1 - .../project_presets/plugins/global/load.json | 1 - .../plugins/global/publish.json | 73 ------ .../project_presets/plugins/maya/create.json | 1 - .../project_presets/plugins/maya/filter.json | 9 - .../project_presets/plugins/maya/load.json | 18 -- .../project_presets/plugins/maya/publish.json | 17 -- .../plugins/maya/workfile_build.json | 54 ----- .../project_presets/plugins/nuke/create.json | 8 - .../project_presets/plugins/nuke/load.json | 1 - .../project_presets/plugins/nuke/publish.json | 48 ---- .../plugins/nuke/workfile_build.json | 11 - .../plugins/nukestudio/filter.json | 10 - .../plugins/nukestudio/publish.json | 8 - .../plugins/standalonepublisher/publish.json | 17 -- .../project_presets/plugins/test/create.json | 8 - .../project_presets/plugins/test/publish.json | 10 - .../premiere/asset_default.json | 5 - .../project_presets/premiere/rules_tasks.json | 21 -- .../project_presets/unreal/project_setup.json | 4 - 27 files changed, 672 deletions(-) delete mode 100644 pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json delete mode 100644 pype/tools/config_setting/config/project_presets/global/creator.json delete mode 100644 pype/tools/config_setting/config/project_presets/global/slates/example_HD.json delete mode 100644 pype/tools/config_setting/config/project_presets/maya/capture.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/config.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/create.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/filter.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/load.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/global/publish.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/create.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/filter.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/load.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/publish.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/create.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/load.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/test/create.json delete mode 100644 pype/tools/config_setting/config/project_presets/plugins/test/publish.json delete mode 100644 pype/tools/config_setting/config/project_presets/premiere/asset_default.json delete mode 100644 pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json delete mode 100644 pype/tools/config_setting/config/project_presets/unreal/project_setup.json diff --git a/pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json b/pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json deleted file mode 100644 index c9dbde4596..0000000000 --- a/pype/tools/config_setting/config/project_presets/ftrack/ftrack_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "status_update": { - "_ignore_": ["in progress", "ommited", "on hold"], - "Ready": ["not ready"], - "In Progress" : ["_any_"] - }, - "status_version_to_task": { - "in progress": "in progress", - "approved": "approved" - } -} diff --git a/pype/tools/config_setting/config/project_presets/global/creator.json b/pype/tools/config_setting/config/project_presets/global/creator.json deleted file mode 100644 index d14e779f01..0000000000 --- a/pype/tools/config_setting/config/project_presets/global/creator.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Model": ["model"], - "Render Globals": ["light", "render"], - "Layout": ["layout"], - "Set Dress": ["setdress"], - "Look": ["look"], - "Rig": ["rigging"] -} diff --git a/pype/tools/config_setting/config/project_presets/global/slates/example_HD.json b/pype/tools/config_setting/config/project_presets/global/slates/example_HD.json deleted file mode 100644 index b06391fb63..0000000000 --- a/pype/tools/config_setting/config/project_presets/global/slates/example_HD.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "width": 1920, - "height": 1080, - "destination_path": "{destination_path}", - "style": { - "*": { - "font-family": "arial", - "font-color": "#ffffff", - "font-bold": false, - "font-italic": false, - "bg-color": "#0077ff", - "alignment-horizontal": "left", - "alignment-vertical": "top" - }, - "layer": { - "padding": 0, - "margin": 0 - }, - "rectangle": { - "padding": 0, - "margin": 0, - "bg-color": "#E9324B", - "fill": true - }, - "main_frame": { - "padding": 0, - "margin": 0, - "bg-color": "#252525" - }, - "table": { - "padding": 0, - "margin": 0, - "bg-color": "transparent" - }, - "table-item": { - "padding": 5, - "padding-bottom": 10, - "margin": 0, - "bg-color": "#212121", - "bg-alter-color": "#272727", - "font-color": "#dcdcdc", - "font-bold": false, - "font-italic": false, - "alignment-horizontal": "left", - "alignment-vertical": "top", - "word-wrap": false, - "ellide": true, - "max-lines": 1 - }, - "table-item-col[0]": { - "font-size": 20, - "font-color": "#898989", - "font-bold": true, - "ellide": false, - "word-wrap": true, - "max-lines": null - }, - "table-item-col[1]": { - "font-size": 40, - "padding-left": 10 - }, - "#colorbar": { - "bg-color": "#9932CC" - } - }, - "items": [{ - "type": "layer", - "direction": 1, - "name": "MainLayer", - "style": { - "#MainLayer": { - "width": 1094, - "height": 1000, - "margin": 25, - "padding": 0 - }, - "#LeftSide": { - "margin-right": 25 - } - }, - "items": [{ - "type": "layer", - "name": "LeftSide", - "items": [{ - "type": "layer", - "direction": 1, - "style": { - "table-item": { - "bg-color": "transparent", - "padding-bottom": 20 - }, - "table-item-col[0]": { - "font-size": 20, - "font-color": "#898989", - "alignment-horizontal": "right" - }, - "table-item-col[1]": { - "alignment-horizontal": "left", - "font-bold": true, - "font-size": 40 - } - }, - "items": [{ - "type": "table", - "values": [ - ["Show:", "{project[name]}"] - ], - "style": { - "table-item-field[0:0]": { - "width": 150 - }, - "table-item-field[0:1]": { - "width": 580 - } - } - }, { - "type": "table", - "values": [ - ["Submitting For:", "{intent}"] - ], - "style": { - "table-item-field[0:0]": { - "width": 160 - }, - "table-item-field[0:1]": { - "width": 218, - "alignment-horizontal": "right" - } - } - }] - }, { - "type": "rectangle", - "style": { - "bg-color": "#bc1015", - "width": 1108, - "height": 5, - "fill": true - } - }, { - "type": "table", - "use_alternate_color": true, - "values": [ - ["Version name:", "{version_name}"], - ["Date:", "{date}"], - ["Shot Types:", "{shot_type}"], - ["Submission Note:", "{submission_note}"] - ], - "style": { - "table-item": { - "padding-bottom": 20 - }, - "table-item-field[0:1]": { - "font-bold": true - }, - "table-item-field[3:0]": { - "word-wrap": true, - "ellide": true, - "max-lines": 4 - }, - "table-item-col[0]": { - "alignment-horizontal": "right", - "width": 150 - }, - "table-item-col[1]": { - "alignment-horizontal": "left", - "width": 958 - } - } - }] - }, { - "type": "layer", - "name": "RightSide", - "items": [{ - "type": "placeholder", - "name": "thumbnail", - "path": "{thumbnail_path}", - "style": { - "width": 730, - "height": 412 - } - }, { - "type": "placeholder", - "name": "colorbar", - "path": "{color_bar_path}", - "return_data": true, - "style": { - "width": 730, - "height": 55 - } - }, { - "type": "table", - "use_alternate_color": true, - "values": [ - ["Vendor:", "{vendor}"], - ["Shot Name:", "{shot_name}"], - ["Frames:", "{frame_start} - {frame_end} ({duration})"] - ], - "style": { - "table-item-col[0]": { - "alignment-horizontal": "left", - "width": 200 - }, - "table-item-col[1]": { - "alignment-horizontal": "right", - "width": 530, - "font-size": 30 - } - } - }] - }] - }] -} diff --git a/pype/tools/config_setting/config/project_presets/maya/capture.json b/pype/tools/config_setting/config/project_presets/maya/capture.json deleted file mode 100644 index b6c4893034..0000000000 --- a/pype/tools/config_setting/config/project_presets/maya/capture.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "Codec": { - "compression": "jpg", - "format": "image", - "quality": 95 - }, - "Display Options": { - "background": [ - 0.7137254901960784, - 0.7137254901960784, - 0.7137254901960784 - ], - "backgroundBottom": [ - 0.7137254901960784, - 0.7137254901960784, - 0.7137254901960784 - ], - "backgroundTop": [ - 0.7137254901960784, - 0.7137254901960784, - 0.7137254901960784 - ], - "override_display": true - }, - "Generic": { - "isolate_view": true, - "off_screen": true - }, - "IO": { - "name": "", - "open_finished": false, - "raw_frame_numbers": false, - "recent_playblasts": [], - "save_file": false - }, - "PanZoom": { - "pan_zoom": true - }, - "Renderer": { - "rendererName": "vp2Renderer" - }, - "Resolution": { - "height": 1080, - "mode": "Custom", - "percent": 1.0, - "width": 1920 - }, - "Time Range": { - "end_frame": 25, - "frame": "", - "start_frame": 0, - "time": "Time Slider" - }, - "Viewport Options": { - "cameras": false, - "clipGhosts": false, - "controlVertices": false, - "deformers": false, - "dimensions": false, - "displayLights": 0, - "dynamicConstraints": false, - "dynamics": false, - "fluids": false, - "follicles": false, - "gpuCacheDisplayFilter": false, - "greasePencils": false, - "grid": false, - "hairSystems": false, - "handles": false, - "high_quality": true, - "hud": false, - "hulls": false, - "ikHandles": false, - "imagePlane": false, - "joints": false, - "lights": false, - "locators": false, - "manipulators": false, - "motionTrails": false, - "nCloths": false, - "nParticles": false, - "nRigids": false, - "nurbsCurves": false, - "nurbsSurfaces": false, - "override_viewport_options": true, - "particleInstancers": false, - "pivots": false, - "planes": false, - "pluginShapes": false, - "polymeshes": true, - "shadows": false, - "strokes": false, - "subdivSurfaces": false, - "textures": false, - "twoSidedLighting": true - }, - "Camera Options": { - "displayGateMask": false, - "displayResolution": false, - "displayFilmGate": false, - "displayFieldChart": false, - "displaySafeAction": false, - "displaySafeTitle": false, - "displayFilmPivot": false, - "displayFilmOrigin": false, - "overscan": 1.0 - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/config.json b/pype/tools/config_setting/config/project_presets/plugins/config.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/config.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json b/pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json deleted file mode 100644 index d0469ae4f7..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/ftrack/publish.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "IntegrateFtrackNote": { - "note_with_intent_template": "{intent}: {comment}", - "note_labels": [] - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/create.json b/pype/tools/config_setting/config/project_presets/plugins/global/create.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/global/create.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/filter.json b/pype/tools/config_setting/config/project_presets/plugins/global/filter.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/global/filter.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/load.json b/pype/tools/config_setting/config/project_presets/plugins/global/load.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/global/load.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/global/publish.json b/pype/tools/config_setting/config/project_presets/plugins/global/publish.json deleted file mode 100644 index 6e51e00497..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/global/publish.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "IntegrateMasterVersion": { - "enabled": false - }, - "ExtractReview": { - "__documentation__": "http://pype.club/docs/admin_presets_plugins", - "profiles": [ - { - "families": [], - "hosts": [], - "outputs": { - "h264": { - "filter": { - "families": ["render", "review", "ftrack"] - }, - "ext": "mp4", - "ffmpeg_args": { - "input": [ - "-gamma 2.2" - ], - "video_filters": [], - "audio_filters": [], - "output": [ - "-pix_fmt yuv420p", - "-crf 18", - "-intra" - ] - }, - "tags": ["burnin", "ftrackreview"] - } - } - } - ] - }, - "ExtractBurnin": { - "options": { - "opacity": 1, - "x_offset": 5, - "y_offset": 5, - "bg_padding": 5, - "bg_opacity": 0.5, - "font_size": 42 - }, - "fields": { - - }, - "profiles": [ - { - "burnins": { - "burnin": { - "TOP_LEFT": "{yy}-{mm}-{dd}", - "TOP_RIGHT": "{anatomy[version]}", - "TOP_CENTERED": "", - "BOTTOM_RIGHT": "{frame_start}-{current_frame}-{frame_end}", - "BOTTOM_CENTERED": "{asset}", - "BOTTOM_LEFT": "{username}" - } - } - } - ] - }, - "IntegrateAssetNew": { - "template_name_profiles": { - "publish": { - "families": [], - "tasks": [] - }, - "render": { - "families": ["review", "render", "prerender"] - } - } - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/create.json b/pype/tools/config_setting/config/project_presets/plugins/maya/create.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/maya/create.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/filter.json b/pype/tools/config_setting/config/project_presets/plugins/maya/filter.json deleted file mode 100644 index 83d6f05f31..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/maya/filter.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Preset n1": { - "ValidateNoAnimation": false, - "ValidateShapeDefaultNames": false - }, - "Preset n2": { - "ValidateNoAnimation": false - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/load.json b/pype/tools/config_setting/config/project_presets/plugins/maya/load.json deleted file mode 100644 index 260fbb35ee..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/maya/load.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "colors": { - "model": [0.821, 0.518, 0.117], - "rig": [0.144, 0.443, 0.463], - "pointcache": [0.368, 0.821, 0.117], - "animation": [0.368, 0.821, 0.117], - "ass": [1.0, 0.332, 0.312], - "camera": [0.447, 0.312, 1.0], - "fbx": [1.0, 0.931, 0.312], - "mayaAscii": [0.312, 1.0, 0.747], - "setdress": [0.312, 1.0, 0.747], - "layout": [0.312, 1.0, 0.747], - "vdbcache": [0.312, 1.0, 0.428], - "vrayproxy": [0.258, 0.95, 0.541], - "yeticache": [0.2, 0.8, 0.3], - "yetiRig": [0, 0.8, 0.5] - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/publish.json b/pype/tools/config_setting/config/project_presets/plugins/maya/publish.json deleted file mode 100644 index 2e2b3164f3..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/maya/publish.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "ValidateModelName": { - "enabled": false, - "material_file": "/path/to/shader_name_definition.txt", - "regex": "(.*)_(\\d)*_(?P.*)_(GEO)" - }, - "ValidateAssemblyName": { - "enabled": false - }, - "ValidateShaderName": { - "enabled": false, - "regex": "(?P.*)_(.*)_SHD" - }, - "ValidateMeshHasOverlappingUVs": { - "enabled": false - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json b/pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json deleted file mode 100644 index 2872b783cb..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/maya/workfile_build.json +++ /dev/null @@ -1,54 +0,0 @@ -[{ - "tasks": ["lighting"], - - "current_context": [{ - "subset_name_filters": [".+[Mm]ain"], - "families": ["model"], - "repre_names": ["abc", "ma"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["animation", "pointcache"], - "repre_names": ["abc"], - "loaders": ["ReferenceLoader"] - },{ - "families": ["rendersetup"], - "repre_names": ["json"], - "loaders": ["RenderSetupLoader"] - }, { - "families": ["camera"], - "repre_names": ["abc"], - "loaders": ["ReferenceLoader"] - }], - - "linked_assets": [{ - "families": ["setdress"], - "repre_names": ["ma"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["ass"], - "repre_names": ["ass"], - "loaders":["assLoader"] - }] -}, { - "tasks": ["animation"], - - "current_context": [{ - "families": ["camera"], - "repre_names": ["abc", "ma"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["audio"], - "repre_names": ["wav"], - "loaders": ["RenderSetupLoader"] - }], - - "linked_assets": [{ - "families": ["setdress"], - "repre_names": ["proxy"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["rig"], - "repre_names": ["ass"], - "loaders": ["rigLoader"] - }] -}] diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/create.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/create.json deleted file mode 100644 index 4deb0b4ad5..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/nuke/create.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CreateWriteRender": { - "fpath_template": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" - }, - "CreateWritePrerender": { - "fpath_template": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/load.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/load.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/nuke/load.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json deleted file mode 100644 index ab0d0e76a5..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/nuke/publish.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "ExtractThumbnail": { - "nodes": { - "Reformat": [ - ["type", "to format"], - ["format", "HD_1080"], - ["filter", "Lanczos6"], - ["black_outside", true], - ["pbb", false] - ] - } - }, - "ValidateNukeWriteKnobs": { - "enabled": false, - "knobs": { - "render": { - "review": true - } - } - }, - "ExtractReviewDataLut": { - "__documentation__": { - "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", - "enabled": "keep in on `false` if you want Nuke baking colorspace workflow applied else FFmpeg will convert imgsequence with baked LUT" - }, - "enabled": false - }, - "ExtractReviewDataMov": { - "__documentation__": { - "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", - "enabled": "keep in on `true` if you want Nuke baking colorspace workflow applied" - }, - "enabled": true, - "viewer_lut_raw": false - }, - "ExtractSlateFrame": { - "__documentation__": { - "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`" - }, - "viewer_lut_raw": false - }, - "NukeSubmitDeadline": { - "deadline_priority": 50, - "deadline_pool": "", - "deadline_pool_secondary": "", - "deadline_chunk_size": 1 - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json b/pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json deleted file mode 100644 index d3613c929e..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/nuke/workfile_build.json +++ /dev/null @@ -1,11 +0,0 @@ -[{ - "tasks": ["compositing"], - - "current_context": [{ - "families": ["render", "plate"], - "repre_names": ["exr" ,"dpx"], - "loaders": ["LoadSequence"] - }], - - "linked_assets": [] -}] diff --git a/pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json b/pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json deleted file mode 100644 index bd6a0dc1bd..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/nukestudio/filter.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "strict": { - "ValidateVersion": true, - "VersionUpWorkfile": true - }, - "benevolent": { - "ValidateVersion": false, - "VersionUpWorkfile": false - } -} \ No newline at end of file diff --git a/pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json b/pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json deleted file mode 100644 index 8c4ad133f1..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/nukestudio/publish.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CollectInstanceVersion": { - "enabled": false - }, - "ExtractReviewCutUpVideo": { - "tags_addition": [] - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json b/pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json deleted file mode 100644 index ecfff12db9..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/standalonepublisher/publish.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "ExtractReviewSP": { - "outputs": { - "h264": { - "input": [ - "-gamma 2.2" - ], - "output": [ - "-pix_fmt yuv420p", - "-crf 18" - ], - "tags": ["preview"], - "ext": "mov" - } - } - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/test/create.json b/pype/tools/config_setting/config/project_presets/plugins/test/create.json deleted file mode 100644 index fa0b2fc05f..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/test/create.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "MyTestCreator": { - "my_test_property": "B", - "active": false, - "new_property": "new", - "family": "new_family" - } -} diff --git a/pype/tools/config_setting/config/project_presets/plugins/test/publish.json b/pype/tools/config_setting/config/project_presets/plugins/test/publish.json deleted file mode 100644 index 3180dd5d8a..0000000000 --- a/pype/tools/config_setting/config/project_presets/plugins/test/publish.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "MyTestPlugin": { - "label": "loaded from preset", - "optional": true, - "families": ["changed", "by", "preset"] - }, - "MyTestRemovedPlugin": { - "enabled": false - } -} diff --git a/pype/tools/config_setting/config/project_presets/premiere/asset_default.json b/pype/tools/config_setting/config/project_presets/premiere/asset_default.json deleted file mode 100644 index 84d2bde3d8..0000000000 --- a/pype/tools/config_setting/config/project_presets/premiere/asset_default.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "frameStart": 1001, - "handleStart": 0, - "handleEnd": 0 -} diff --git a/pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json b/pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json deleted file mode 100644 index 333c9cd70b..0000000000 --- a/pype/tools/config_setting/config/project_presets/premiere/rules_tasks.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "defaultTasks": ["Layout", "Animation"], - "taskToSubsets": { - "Layout": ["reference", "audio"], - "Animation": ["audio"] - }, - "subsetToRepresentations": { - "reference": { - "preset": "h264", - "representation": "mp4" - }, - "thumbnail": { - "preset": "jpeg_thumb", - "representation": "jpg" - }, - "audio": { - "preset": "48khz", - "representation": "wav" - } - } -} diff --git a/pype/tools/config_setting/config/project_presets/unreal/project_setup.json b/pype/tools/config_setting/config/project_presets/unreal/project_setup.json deleted file mode 100644 index 8a4dffc526..0000000000 --- a/pype/tools/config_setting/config/project_presets/unreal/project_setup.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "dev_mode": false, - "install_unreal_python_engine": false -} From f2bb1af12836a9a298212525da6b9ea0a02e1215 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:03:35 +0200 Subject: [PATCH 353/507] moved config to folder configurations --- pype/api.py | 2 +- pype/{ => configurations}/config.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename pype/{ => configurations}/config.py (100%) diff --git a/pype/api.py b/pype/api.py index e2705f81ea..88dfab19ec 100644 --- a/pype/api.py +++ b/pype/api.py @@ -1,4 +1,4 @@ -from . import config +from .configurations import config from pypeapp import ( Logger, Anatomy, diff --git a/pype/config.py b/pype/configurations/config.py similarity index 100% rename from pype/config.py rename to pype/configurations/config.py From d5e7ccce3f9dbf3b9c5b76180d4cd256e8c0c44d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:04:37 +0200 Subject: [PATCH 354/507] copied pype-config to pype --- .../configurations/defaults/anatomy/README.md | 0 .../defaults/anatomy/default.yaml | 29 ++ .../defaults/anatomy/roots.json | 5 + .../defaults/environments/avalon.json | 16 ++ .../defaults/environments/blender.json | 7 + .../defaults/environments/celaction.json | 3 + .../defaults/environments/deadline.json | 3 + .../defaults/environments/ftrack.json | 18 ++ .../defaults/environments/global.json | 44 +++ .../defaults/environments/harmony.json | 4 + .../defaults/environments/houdini.json | 12 + .../defaults/environments/maya.json | 14 + .../defaults/environments/maya_2018.json | 11 + .../defaults/environments/maya_2020.json | 11 + .../defaults/environments/mayabatch.json | 14 + .../defaults/environments/mayabatch_2019.json | 11 + .../defaults/environments/mtoa_3.1.1.json | 23 ++ .../defaults/environments/muster.json | 3 + .../defaults/environments/nuke.json | 15 + .../defaults/environments/nukestudio.json | 11 + .../environments/nukestudio_10.0.json | 4 + .../defaults/environments/nukex.json | 10 + .../defaults/environments/nukex_10.0.json | 4 + .../defaults/environments/photoshop.json | 4 + .../defaults/environments/premiere.json | 11 + .../defaults/environments/resolve.json | 40 +++ .../defaults/environments/storyboardpro.json | 4 + .../defaults/environments/unreal_4.24.json | 5 + .../defaults/environments/vray_4300.json | 15 + .../defaults/launchers/blender_2.80.toml | 7 + .../defaults/launchers/blender_2.81.toml | 7 + .../defaults/launchers/blender_2.82.toml | 7 + .../defaults/launchers/blender_2.83.toml | 7 + .../defaults/launchers/celaction_local.toml | 8 + .../defaults/launchers/celaction_publish.toml | 7 + .../defaults/launchers/darwin/blender_2.82 | 2 + .../defaults/launchers/darwin/harmony_17 | 9 + .../launchers/darwin/harmony_17_launch | 5 + .../defaults/launchers/darwin/python3 | 2 + .../defaults/launchers/harmony_17.toml | 8 + .../defaults/launchers/houdini_16.toml | 7 + .../defaults/launchers/houdini_17.toml | 7 + .../defaults/launchers/houdini_18.toml | 7 + .../defaults/launchers/linux/maya2016 | 8 + .../defaults/launchers/linux/maya2017 | 8 + .../defaults/launchers/linux/maya2018 | 8 + .../defaults/launchers/linux/maya2019 | 8 + .../defaults/launchers/linux/maya2020 | 8 + .../defaults/launchers/linux/nuke11.3 | 2 + .../defaults/launchers/linux/nuke12.0 | 2 + .../defaults/launchers/linux/nukestudio11.3 | 2 + .../defaults/launchers/linux/nukestudio12.0 | 2 + .../defaults/launchers/linux/nukex11.3 | 2 + .../defaults/launchers/linux/nukex12.0 | 2 + .../defaults/launchers/maya_2016.toml | 26 ++ .../defaults/launchers/maya_2017.toml | 28 ++ .../defaults/launchers/maya_2018.toml | 14 + .../defaults/launchers/maya_2019.toml | 14 + .../defaults/launchers/maya_2020.toml | 14 + .../defaults/launchers/mayabatch_2019.toml | 17 ++ .../defaults/launchers/mayabatch_2020.toml | 17 ++ .../defaults/launchers/mayapy2016.toml | 17 ++ .../defaults/launchers/mayapy2017.toml | 17 ++ .../defaults/launchers/mayapy2018.toml | 17 ++ .../defaults/launchers/mayapy2019.toml | 17 ++ .../defaults/launchers/mayapy2020.toml | 17 ++ .../defaults/launchers/myapp.toml | 5 + .../defaults/launchers/nuke_10.0.toml | 7 + .../defaults/launchers/nuke_11.0.toml | 7 + .../defaults/launchers/nuke_11.2.toml | 7 + .../defaults/launchers/nuke_11.3.toml | 7 + .../defaults/launchers/nuke_12.0.toml | 7 + .../defaults/launchers/nukestudio_10.0.toml | 7 + .../defaults/launchers/nukestudio_11.0.toml | 7 + .../defaults/launchers/nukestudio_11.2.toml | 7 + .../defaults/launchers/nukestudio_11.3.toml | 7 + .../defaults/launchers/nukestudio_12.0.toml | 7 + .../defaults/launchers/nukex_10.0.toml | 7 + .../defaults/launchers/nukex_11.0.toml | 7 + .../defaults/launchers/nukex_11.2.toml | 7 + .../defaults/launchers/nukex_11.3.toml | 7 + .../defaults/launchers/nukex_12.0.toml | 7 + .../defaults/launchers/photoshop_2020.toml | 8 + .../defaults/launchers/premiere_2019.toml | 8 + .../defaults/launchers/premiere_2020.toml | 9 + .../defaults/launchers/python_2.toml | 10 + .../defaults/launchers/python_3.toml | 10 + .../defaults/launchers/resolve_16.toml | 9 + .../defaults/launchers/shell.toml | 7 + .../defaults/launchers/storyboardpro_7.toml | 8 + .../defaults/launchers/unreal_4.24.toml | 8 + .../launchers/windows/blender_2.80.bat | 11 + .../launchers/windows/blender_2.81.bat | 11 + .../launchers/windows/blender_2.82.bat | 11 + .../launchers/windows/blender_2.83.bat | 11 + .../launchers/windows/celaction_local.bat | 19 ++ .../launchers/windows/celaction_publish.bat | 3 + .../defaults/launchers/windows/harmony_17.bat | 13 + .../defaults/launchers/windows/houdini_16.bat | 13 + .../defaults/launchers/windows/houdini_17.bat | 13 + .../defaults/launchers/windows/houdini_18.bat | 13 + .../defaults/launchers/windows/maya2016.bat | 17 ++ .../defaults/launchers/windows/maya2017.bat | 17 ++ .../defaults/launchers/windows/maya2018.bat | 17 ++ .../defaults/launchers/windows/maya2019.bat | 17 ++ .../defaults/launchers/windows/maya2020.bat | 17 ++ .../launchers/windows/mayabatch2019.bat | 14 + .../launchers/windows/mayabatch2020.bat | 14 + .../defaults/launchers/windows/mayapy2016.bat | 13 + .../defaults/launchers/windows/mayapy2017.bat | 13 + .../defaults/launchers/windows/mayapy2018.bat | 13 + .../defaults/launchers/windows/mayapy2019.bat | 13 + .../defaults/launchers/windows/mayapy2020.bat | 13 + .../defaults/launchers/windows/nuke10.0.bat | 13 + .../defaults/launchers/windows/nuke11.0.bat | 13 + .../defaults/launchers/windows/nuke11.2.bat | 13 + .../defaults/launchers/windows/nuke11.3.bat | 13 + .../defaults/launchers/windows/nuke12.0.bat | 13 + .../launchers/windows/nukestudio10.0.bat | 13 + .../launchers/windows/nukestudio11.0.bat | 13 + .../launchers/windows/nukestudio11.2.bat | 13 + .../launchers/windows/nukestudio11.3.bat | 13 + .../launchers/windows/nukestudio12.0.bat | 13 + .../defaults/launchers/windows/nukex10.0.bat | 13 + .../defaults/launchers/windows/nukex11.0.bat | 13 + .../defaults/launchers/windows/nukex11.2.bat | 13 + .../defaults/launchers/windows/nukex11.3.bat | 13 + .../defaults/launchers/windows/nukex12.0.bat | 13 + .../launchers/windows/photoshop_2020.bat | 15 + .../launchers/windows/premiere_pro_2019.bat | 14 + .../launchers/windows/premiere_pro_2020.bat | 13 + .../defaults/launchers/windows/python3.bat | 13 + .../defaults/launchers/windows/resolve_16.bat | 17 ++ .../defaults/launchers/windows/shell.bat | 2 + .../launchers/windows/storyboardpro_7.bat | 13 + .../defaults/launchers/windows/unreal.bat | 11 + .../presets/colorspace/aces103-cg.json | 46 +++ .../defaults/presets/colorspace/default.json | 42 +++ .../defaults/presets/dataflow/aces-exr.json | 58 ++++ .../defaults/presets/dataflow/default.json | 55 ++++ .../presets/ftrack/ftrack_config.json | 16 ++ .../ftrack/ftrack_custom_attributes.json | 165 +++++++++++ .../ftrack/partnership_ftrack_cred.json | 5 + .../presets/ftrack/plugins/server.json | 1 + .../defaults/presets/ftrack/plugins/user.json | 5 + .../presets/ftrack/project_defaults.json | 18 ++ .../configurations/defaults/presets/init.json | 4 + .../defaults/presets/maya/capture.json | 108 ++++++++ .../presets/muster/templates_mapping.json | 19 ++ .../defaults/presets/nukestudio/tags.json | 262 ++++++++++++++++++ .../presets/plugins/celaction/publish.json | 10 + .../defaults/presets/plugins/config.json | 1 + .../presets/plugins/ftrack/publish.json | 6 + .../presets/plugins/global/create.json | 1 + .../presets/plugins/global/filter.json | 1 + .../defaults/presets/plugins/global/load.json | 1 + .../presets/plugins/global/publish.json | 86 ++++++ .../defaults/presets/plugins/maya/create.json | 1 + .../defaults/presets/plugins/maya/filter.json | 9 + .../defaults/presets/plugins/maya/load.json | 18 ++ .../presets/plugins/maya/publish.json | 17 ++ .../presets/plugins/maya/workfile_build.json | 54 ++++ .../defaults/presets/plugins/nuke/create.json | 8 + .../defaults/presets/plugins/nuke/load.json | 1 + .../presets/plugins/nuke/publish.json | 48 ++++ .../presets/plugins/nuke/workfile_build.json | 11 + .../presets/plugins/nukestudio/filter.json | 10 + .../presets/plugins/nukestudio/publish.json | 8 + .../presets/plugins/resolve/create.json | 7 + .../plugins/standalonepublisher/publish.json | 25 ++ .../defaults/presets/plugins/test/create.json | 8 + .../presets/plugins/test/publish.json | 10 + .../presets/premiere/asset_default.json | 5 + .../presets/premiere/rules_tasks.json | 21 ++ .../presets/standalone_publish/families.json | 90 ++++++ .../defaults/presets/tools/creator.json | 8 + .../tools/project_folder_structure.json | 22 ++ .../defaults/presets/tools/pyblish.json | 17 ++ .../presets/tools/slates/example_HD.json | 212 ++++++++++++++ .../defaults/presets/tools/sw_folders.json | 8 + .../defaults/presets/tools/workfiles.json | 7 + .../defaults/presets/tray/menu_items.json | 28 ++ .../presets/unreal/project_setup.json | 4 + .../plugins/celaction/publish.json | 11 + .../plugins/config.json | 1 + .../plugins/ftrack/publish.json | 7 + .../plugins/global/create.json | 1 + .../plugins/global/filter.json | 1 + .../plugins/global/load.json | 1 + .../plugins/global/publish.json | 97 +++++++ .../plugins/maya/create.json | 1 + .../plugins/maya/filter.json | 9 + .../plugins/maya/load.json | 18 ++ .../plugins/maya/publish.json | 17 ++ .../plugins/maya/workfile_build.json | 136 +++++++++ .../plugins/nuke/create.json | 8 + .../plugins/nuke/load.json | 1 + .../plugins/nuke/publish.json | 53 ++++ .../plugins/nuke/workfile_build.json | 23 ++ .../plugins/nukestudio/filter.json | 10 + .../plugins/nukestudio/publish.json | 9 + .../plugins/resolve/create.json | 7 + .../plugins/standalonepublisher/publish.json | 27 ++ .../plugins/test/create.json | 8 + .../plugins/test/publish.json | 10 + .../global/applications.json | 39 +++ .../studio_configurations/global/intent.json | 8 + .../studio_configurations/global/tools.json | 6 + .../global/tray_modules.json | 28 ++ .../muster/templates_mapping.json | 19 ++ .../standalone_publish/families.json | 90 ++++++ 211 files changed, 3697 insertions(+) create mode 100644 pype/configurations/defaults/anatomy/README.md create mode 100644 pype/configurations/defaults/anatomy/default.yaml create mode 100644 pype/configurations/defaults/anatomy/roots.json create mode 100644 pype/configurations/defaults/environments/avalon.json create mode 100644 pype/configurations/defaults/environments/blender.json create mode 100644 pype/configurations/defaults/environments/celaction.json create mode 100644 pype/configurations/defaults/environments/deadline.json create mode 100644 pype/configurations/defaults/environments/ftrack.json create mode 100644 pype/configurations/defaults/environments/global.json create mode 100644 pype/configurations/defaults/environments/harmony.json create mode 100644 pype/configurations/defaults/environments/houdini.json create mode 100644 pype/configurations/defaults/environments/maya.json create mode 100644 pype/configurations/defaults/environments/maya_2018.json create mode 100644 pype/configurations/defaults/environments/maya_2020.json create mode 100644 pype/configurations/defaults/environments/mayabatch.json create mode 100644 pype/configurations/defaults/environments/mayabatch_2019.json create mode 100644 pype/configurations/defaults/environments/mtoa_3.1.1.json create mode 100644 pype/configurations/defaults/environments/muster.json create mode 100644 pype/configurations/defaults/environments/nuke.json create mode 100644 pype/configurations/defaults/environments/nukestudio.json create mode 100644 pype/configurations/defaults/environments/nukestudio_10.0.json create mode 100644 pype/configurations/defaults/environments/nukex.json create mode 100644 pype/configurations/defaults/environments/nukex_10.0.json create mode 100644 pype/configurations/defaults/environments/photoshop.json create mode 100644 pype/configurations/defaults/environments/premiere.json create mode 100644 pype/configurations/defaults/environments/resolve.json create mode 100644 pype/configurations/defaults/environments/storyboardpro.json create mode 100644 pype/configurations/defaults/environments/unreal_4.24.json create mode 100644 pype/configurations/defaults/environments/vray_4300.json create mode 100644 pype/configurations/defaults/launchers/blender_2.80.toml create mode 100644 pype/configurations/defaults/launchers/blender_2.81.toml create mode 100644 pype/configurations/defaults/launchers/blender_2.82.toml create mode 100644 pype/configurations/defaults/launchers/blender_2.83.toml create mode 100644 pype/configurations/defaults/launchers/celaction_local.toml create mode 100644 pype/configurations/defaults/launchers/celaction_publish.toml create mode 100644 pype/configurations/defaults/launchers/darwin/blender_2.82 create mode 100644 pype/configurations/defaults/launchers/darwin/harmony_17 create mode 100644 pype/configurations/defaults/launchers/darwin/harmony_17_launch create mode 100644 pype/configurations/defaults/launchers/darwin/python3 create mode 100644 pype/configurations/defaults/launchers/harmony_17.toml create mode 100644 pype/configurations/defaults/launchers/houdini_16.toml create mode 100644 pype/configurations/defaults/launchers/houdini_17.toml create mode 100644 pype/configurations/defaults/launchers/houdini_18.toml create mode 100644 pype/configurations/defaults/launchers/linux/maya2016 create mode 100644 pype/configurations/defaults/launchers/linux/maya2017 create mode 100644 pype/configurations/defaults/launchers/linux/maya2018 create mode 100644 pype/configurations/defaults/launchers/linux/maya2019 create mode 100644 pype/configurations/defaults/launchers/linux/maya2020 create mode 100644 pype/configurations/defaults/launchers/linux/nuke11.3 create mode 100644 pype/configurations/defaults/launchers/linux/nuke12.0 create mode 100644 pype/configurations/defaults/launchers/linux/nukestudio11.3 create mode 100644 pype/configurations/defaults/launchers/linux/nukestudio12.0 create mode 100644 pype/configurations/defaults/launchers/linux/nukex11.3 create mode 100644 pype/configurations/defaults/launchers/linux/nukex12.0 create mode 100644 pype/configurations/defaults/launchers/maya_2016.toml create mode 100644 pype/configurations/defaults/launchers/maya_2017.toml create mode 100644 pype/configurations/defaults/launchers/maya_2018.toml create mode 100644 pype/configurations/defaults/launchers/maya_2019.toml create mode 100644 pype/configurations/defaults/launchers/maya_2020.toml create mode 100644 pype/configurations/defaults/launchers/mayabatch_2019.toml create mode 100644 pype/configurations/defaults/launchers/mayabatch_2020.toml create mode 100644 pype/configurations/defaults/launchers/mayapy2016.toml create mode 100644 pype/configurations/defaults/launchers/mayapy2017.toml create mode 100644 pype/configurations/defaults/launchers/mayapy2018.toml create mode 100644 pype/configurations/defaults/launchers/mayapy2019.toml create mode 100644 pype/configurations/defaults/launchers/mayapy2020.toml create mode 100644 pype/configurations/defaults/launchers/myapp.toml create mode 100644 pype/configurations/defaults/launchers/nuke_10.0.toml create mode 100644 pype/configurations/defaults/launchers/nuke_11.0.toml create mode 100644 pype/configurations/defaults/launchers/nuke_11.2.toml create mode 100644 pype/configurations/defaults/launchers/nuke_11.3.toml create mode 100644 pype/configurations/defaults/launchers/nuke_12.0.toml create mode 100644 pype/configurations/defaults/launchers/nukestudio_10.0.toml create mode 100644 pype/configurations/defaults/launchers/nukestudio_11.0.toml create mode 100644 pype/configurations/defaults/launchers/nukestudio_11.2.toml create mode 100644 pype/configurations/defaults/launchers/nukestudio_11.3.toml create mode 100644 pype/configurations/defaults/launchers/nukestudio_12.0.toml create mode 100644 pype/configurations/defaults/launchers/nukex_10.0.toml create mode 100644 pype/configurations/defaults/launchers/nukex_11.0.toml create mode 100644 pype/configurations/defaults/launchers/nukex_11.2.toml create mode 100644 pype/configurations/defaults/launchers/nukex_11.3.toml create mode 100644 pype/configurations/defaults/launchers/nukex_12.0.toml create mode 100644 pype/configurations/defaults/launchers/photoshop_2020.toml create mode 100644 pype/configurations/defaults/launchers/premiere_2019.toml create mode 100644 pype/configurations/defaults/launchers/premiere_2020.toml create mode 100644 pype/configurations/defaults/launchers/python_2.toml create mode 100644 pype/configurations/defaults/launchers/python_3.toml create mode 100644 pype/configurations/defaults/launchers/resolve_16.toml create mode 100644 pype/configurations/defaults/launchers/shell.toml create mode 100644 pype/configurations/defaults/launchers/storyboardpro_7.toml create mode 100644 pype/configurations/defaults/launchers/unreal_4.24.toml create mode 100644 pype/configurations/defaults/launchers/windows/blender_2.80.bat create mode 100644 pype/configurations/defaults/launchers/windows/blender_2.81.bat create mode 100644 pype/configurations/defaults/launchers/windows/blender_2.82.bat create mode 100644 pype/configurations/defaults/launchers/windows/blender_2.83.bat create mode 100644 pype/configurations/defaults/launchers/windows/celaction_local.bat create mode 100644 pype/configurations/defaults/launchers/windows/celaction_publish.bat create mode 100644 pype/configurations/defaults/launchers/windows/harmony_17.bat create mode 100644 pype/configurations/defaults/launchers/windows/houdini_16.bat create mode 100644 pype/configurations/defaults/launchers/windows/houdini_17.bat create mode 100644 pype/configurations/defaults/launchers/windows/houdini_18.bat create mode 100644 pype/configurations/defaults/launchers/windows/maya2016.bat create mode 100644 pype/configurations/defaults/launchers/windows/maya2017.bat create mode 100644 pype/configurations/defaults/launchers/windows/maya2018.bat create mode 100644 pype/configurations/defaults/launchers/windows/maya2019.bat create mode 100644 pype/configurations/defaults/launchers/windows/maya2020.bat create mode 100644 pype/configurations/defaults/launchers/windows/mayabatch2019.bat create mode 100644 pype/configurations/defaults/launchers/windows/mayabatch2020.bat create mode 100644 pype/configurations/defaults/launchers/windows/mayapy2016.bat create mode 100644 pype/configurations/defaults/launchers/windows/mayapy2017.bat create mode 100644 pype/configurations/defaults/launchers/windows/mayapy2018.bat create mode 100644 pype/configurations/defaults/launchers/windows/mayapy2019.bat create mode 100644 pype/configurations/defaults/launchers/windows/mayapy2020.bat create mode 100644 pype/configurations/defaults/launchers/windows/nuke10.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nuke11.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nuke11.2.bat create mode 100644 pype/configurations/defaults/launchers/windows/nuke11.3.bat create mode 100644 pype/configurations/defaults/launchers/windows/nuke12.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukestudio10.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukestudio11.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukestudio11.2.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukestudio11.3.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukestudio12.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukex10.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukex11.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukex11.2.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukex11.3.bat create mode 100644 pype/configurations/defaults/launchers/windows/nukex12.0.bat create mode 100644 pype/configurations/defaults/launchers/windows/photoshop_2020.bat create mode 100644 pype/configurations/defaults/launchers/windows/premiere_pro_2019.bat create mode 100644 pype/configurations/defaults/launchers/windows/premiere_pro_2020.bat create mode 100644 pype/configurations/defaults/launchers/windows/python3.bat create mode 100644 pype/configurations/defaults/launchers/windows/resolve_16.bat create mode 100644 pype/configurations/defaults/launchers/windows/shell.bat create mode 100644 pype/configurations/defaults/launchers/windows/storyboardpro_7.bat create mode 100644 pype/configurations/defaults/launchers/windows/unreal.bat create mode 100644 pype/configurations/defaults/presets/colorspace/aces103-cg.json create mode 100644 pype/configurations/defaults/presets/colorspace/default.json create mode 100644 pype/configurations/defaults/presets/dataflow/aces-exr.json create mode 100644 pype/configurations/defaults/presets/dataflow/default.json create mode 100644 pype/configurations/defaults/presets/ftrack/ftrack_config.json create mode 100644 pype/configurations/defaults/presets/ftrack/ftrack_custom_attributes.json create mode 100644 pype/configurations/defaults/presets/ftrack/partnership_ftrack_cred.json create mode 100644 pype/configurations/defaults/presets/ftrack/plugins/server.json create mode 100644 pype/configurations/defaults/presets/ftrack/plugins/user.json create mode 100644 pype/configurations/defaults/presets/ftrack/project_defaults.json create mode 100644 pype/configurations/defaults/presets/init.json create mode 100644 pype/configurations/defaults/presets/maya/capture.json create mode 100644 pype/configurations/defaults/presets/muster/templates_mapping.json create mode 100644 pype/configurations/defaults/presets/nukestudio/tags.json create mode 100644 pype/configurations/defaults/presets/plugins/celaction/publish.json create mode 100644 pype/configurations/defaults/presets/plugins/config.json create mode 100644 pype/configurations/defaults/presets/plugins/ftrack/publish.json create mode 100644 pype/configurations/defaults/presets/plugins/global/create.json create mode 100644 pype/configurations/defaults/presets/plugins/global/filter.json create mode 100644 pype/configurations/defaults/presets/plugins/global/load.json create mode 100644 pype/configurations/defaults/presets/plugins/global/publish.json create mode 100644 pype/configurations/defaults/presets/plugins/maya/create.json create mode 100644 pype/configurations/defaults/presets/plugins/maya/filter.json create mode 100644 pype/configurations/defaults/presets/plugins/maya/load.json create mode 100644 pype/configurations/defaults/presets/plugins/maya/publish.json create mode 100644 pype/configurations/defaults/presets/plugins/maya/workfile_build.json create mode 100644 pype/configurations/defaults/presets/plugins/nuke/create.json create mode 100644 pype/configurations/defaults/presets/plugins/nuke/load.json create mode 100644 pype/configurations/defaults/presets/plugins/nuke/publish.json create mode 100644 pype/configurations/defaults/presets/plugins/nuke/workfile_build.json create mode 100644 pype/configurations/defaults/presets/plugins/nukestudio/filter.json create mode 100644 pype/configurations/defaults/presets/plugins/nukestudio/publish.json create mode 100644 pype/configurations/defaults/presets/plugins/resolve/create.json create mode 100644 pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json create mode 100644 pype/configurations/defaults/presets/plugins/test/create.json create mode 100644 pype/configurations/defaults/presets/plugins/test/publish.json create mode 100644 pype/configurations/defaults/presets/premiere/asset_default.json create mode 100644 pype/configurations/defaults/presets/premiere/rules_tasks.json create mode 100644 pype/configurations/defaults/presets/standalone_publish/families.json create mode 100644 pype/configurations/defaults/presets/tools/creator.json create mode 100644 pype/configurations/defaults/presets/tools/project_folder_structure.json create mode 100644 pype/configurations/defaults/presets/tools/pyblish.json create mode 100644 pype/configurations/defaults/presets/tools/slates/example_HD.json create mode 100644 pype/configurations/defaults/presets/tools/sw_folders.json create mode 100644 pype/configurations/defaults/presets/tools/workfiles.json create mode 100644 pype/configurations/defaults/presets/tray/menu_items.json create mode 100644 pype/configurations/defaults/presets/unreal/project_setup.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/celaction/publish.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/config.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/global/create.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/global/filter.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/global/load.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/global/publish.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/maya/create.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/maya/filter.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/maya/load.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/maya/publish.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/nuke/create.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/nuke/load.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/nuke/publish.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/resolve/create.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/test/create.json create mode 100644 pype/configurations/defaults/project_configurations/plugins/test/publish.json create mode 100644 pype/configurations/defaults/studio_configurations/global/applications.json create mode 100644 pype/configurations/defaults/studio_configurations/global/intent.json create mode 100644 pype/configurations/defaults/studio_configurations/global/tools.json create mode 100644 pype/configurations/defaults/studio_configurations/global/tray_modules.json create mode 100644 pype/configurations/defaults/studio_configurations/muster/templates_mapping.json create mode 100644 pype/configurations/defaults/studio_configurations/standalone_publish/families.json diff --git a/pype/configurations/defaults/anatomy/README.md b/pype/configurations/defaults/anatomy/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pype/configurations/defaults/anatomy/default.yaml b/pype/configurations/defaults/anatomy/default.yaml new file mode 100644 index 0000000000..381aa05d4a --- /dev/null +++ b/pype/configurations/defaults/anatomy/default.yaml @@ -0,0 +1,29 @@ + +version_padding: 3 +version: "v{version:0>{@version_padding}}" +frame_padding: 4 +frame: "{frame:0>{@frame_padding}}" + +work: + folder: "{root}/{project[name]}/{hierarchy}/{asset}/work/{task}" + file: "{project[code]}_{asset}_{task}_{@version}<_{comment}>.{ext}" + path: "{@folder}/{@file}" + +render: + folder: "{root}/{project[name]}/{hierarchy}/{asset}/publish/render/{subset}/{@version}" + file: "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}" + path: "{@folder}/{@file}" + +texture: + path: "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}" + +publish: + folder: "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/{@version}" + file: "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}" + path: "{@folder}/{@file}" + thumbnail: "{thumbnail_root}/{project[name]}/{_id}_{thumbnail_type}{ext}" + +master: + folder: "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/master" + file: "{project[code]}_{asset}_{subset}_master<_{output}><.{frame}>.{representation}" + path: "{@folder}/{@file}" diff --git a/pype/configurations/defaults/anatomy/roots.json b/pype/configurations/defaults/anatomy/roots.json new file mode 100644 index 0000000000..0282471a60 --- /dev/null +++ b/pype/configurations/defaults/anatomy/roots.json @@ -0,0 +1,5 @@ +{ + "windows": "C:/projects", + "linux": "/mnt/share/projects", + "darwin": "/Volumes/path" +} diff --git a/pype/configurations/defaults/environments/avalon.json b/pype/configurations/defaults/environments/avalon.json new file mode 100644 index 0000000000..832ba07e71 --- /dev/null +++ b/pype/configurations/defaults/environments/avalon.json @@ -0,0 +1,16 @@ +{ + "AVALON_CONFIG": "pype", + "AVALON_PROJECTS": "{PYPE_PROJECTS_PATH}", + "AVALON_USERNAME": "avalon", + "AVALON_PASSWORD": "secret", + "AVALON_DEBUG": "1", + "AVALON_MONGO": "mongodb://localhost:2707", + "AVALON_DB": "avalon", + "AVALON_DB_DATA": "{PYPE_SETUP_PATH}/../mongo_db_data", + "AVALON_EARLY_ADOPTER": "1", + "AVALON_SCHEMA": "{PYPE_MODULE_ROOT}/schema", + "AVALON_LOCATION": "http://127.0.0.1", + "AVALON_LABEL": "Pype", + "AVALON_TIMEOUT": "1000", + "AVALON_THUMBNAIL_ROOT": "" +} diff --git a/pype/configurations/defaults/environments/blender.json b/pype/configurations/defaults/environments/blender.json new file mode 100644 index 0000000000..6f4f6a012d --- /dev/null +++ b/pype/configurations/defaults/environments/blender.json @@ -0,0 +1,7 @@ +{ + "BLENDER_USER_SCRIPTS": "{PYPE_SETUP_PATH}/repos/avalon-core/setup/blender", + "PYTHONPATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/blender", + "{PYTHONPATH}" + ] +} diff --git a/pype/configurations/defaults/environments/celaction.json b/pype/configurations/defaults/environments/celaction.json new file mode 100644 index 0000000000..cdd4e609ab --- /dev/null +++ b/pype/configurations/defaults/environments/celaction.json @@ -0,0 +1,3 @@ +{ + "CELACTION_TEMPLATE": "{PYPE_MODULE_ROOT}/pype/hosts/celaction/celaction_template_scene.scn" +} diff --git a/pype/configurations/defaults/environments/deadline.json b/pype/configurations/defaults/environments/deadline.json new file mode 100644 index 0000000000..e8ef52805b --- /dev/null +++ b/pype/configurations/defaults/environments/deadline.json @@ -0,0 +1,3 @@ +{ + "DEADLINE_REST_URL": "http://localhost:8082" +} diff --git a/pype/configurations/defaults/environments/ftrack.json b/pype/configurations/defaults/environments/ftrack.json new file mode 100644 index 0000000000..4f25de027b --- /dev/null +++ b/pype/configurations/defaults/environments/ftrack.json @@ -0,0 +1,18 @@ +{ + "FTRACK_SERVER": "https://pype.ftrackapp.com", + "FTRACK_ACTIONS_PATH": [ + "{PYPE_MODULE_ROOT}/pype/modules/ftrack/actions" + ], + "FTRACK_EVENTS_PATH": [ + "{PYPE_MODULE_ROOT}/pype/modules/ftrack/events" + ], + "PYTHONPATH": [ + "{PYPE_MODULE_ROOT}/pype/vendor", + "{PYTHONPATH}" + ], + "PYBLISHPLUGINPATH": [ + "{PYPE_MODULE_ROOT}/pype/plugins/ftrack/publish" + ], + "FTRACK_EVENTS_MONGO_DB": "pype", + "FTRACK_EVENTS_MONGO_COL": "ftrack_events" +} diff --git a/pype/configurations/defaults/environments/global.json b/pype/configurations/defaults/environments/global.json new file mode 100644 index 0000000000..ef528e6857 --- /dev/null +++ b/pype/configurations/defaults/environments/global.json @@ -0,0 +1,44 @@ +{ + "PYPE_STUDIO_NAME": "Studio Name", + "PYPE_STUDIO_CODE": "stu", + "PYPE_APP_ROOT": "{PYPE_SETUP_PATH}/pypeapp", + "PYPE_MODULE_ROOT": "{PYPE_SETUP_PATH}/repos/pype", + "PYPE_PROJECT_PLUGINS": "", + "STUDIO_SOFT": "{PYP_SETUP_ROOT}/soft", + "FFMPEG_PATH": { + "windows": "{VIRTUAL_ENV}/localized/ffmpeg_exec/windows/bin;{PYPE_SETUP_PATH}/vendor/ffmpeg_exec/windows/bin", + "darwin": "{VIRTUAL_ENV}/localized/ffmpeg_exec/darwin/bin:{PYPE_SETUP_PATH}/vendor/ffmpeg_exec/darwin/bin", + "linux": "{VIRTUAL_ENV}/localized/ffmpeg_exec/linux:{PYPE_SETUP_PATH}/vendor/ffmpeg_exec/linux" + }, + "DJV_PATH": { + "windows": [ + "C:/Program Files/djv-1.1.0-Windows-64/bin/djv_view.exe", + "C:/Program Files/DJV/bin/djv_view.exe", + "{STUDIO_SOFT}/djv/windows/bin/djv_view.exe" + ], + "linux": [ + "usr/local/djv/djv_view", + "{STUDIO_SOFT}/djv/linux/bin/djv_view" + ], + "darwin": "Application/DJV.app/Contents/MacOS/DJV" + }, + "PATH": [ + "{PYPE_CONFIG}/launchers", + "{PYPE_APP_ROOT}", + "{FFMPEG_PATH}", + "{PATH}" + ], + "PYPE_OCIO_CONFIG": "{STUDIO_SOFT}/OpenColorIO-Configs", + "PYTHONPATH": { + "windows": "{VIRTUAL_ENV}/Lib/site-packages;{PYPE_MODULE_ROOT}/pype/tools;{PYTHONPATH}", + "linux": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYTHONPATH}", + "darwin": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYTHONPATH}" + }, + "PYPE_PROJECT_CONFIGS": "{PYPE_SETUP_PATH}/../studio-project-configs", + "PYPE_PYTHON_EXE": { + "windows": "{VIRTUAL_ENV}/Scripts/python.exe", + "linux": "{VIRTUAL_ENV}/Scripts/python", + "darwin": "{VIRTUAL_ENV}/bin/python" + }, + "PYBLISH_GUI": "pyblish_pype" +} diff --git a/pype/configurations/defaults/environments/harmony.json b/pype/configurations/defaults/environments/harmony.json new file mode 100644 index 0000000000..d394343935 --- /dev/null +++ b/pype/configurations/defaults/environments/harmony.json @@ -0,0 +1,4 @@ +{ + "AVALON_HARMONY_WORKFILES_ON_LAUNCH": "1", + "PYBLISH_GUI_ALWAYS_EXEC": "1" +} diff --git a/pype/configurations/defaults/environments/houdini.json b/pype/configurations/defaults/environments/houdini.json new file mode 100644 index 0000000000..95c7d19088 --- /dev/null +++ b/pype/configurations/defaults/environments/houdini.json @@ -0,0 +1,12 @@ +{ + "HOUDINI_PATH": { + "darwin": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "linux": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "windows": "{PYPE_MODULE_ROOT}/setup/houdini;&" + }, + "HOUDINI_MENU_PATH": { + "darwin": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "linux": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "windows": "{PYPE_MODULE_ROOT}/setup/houdini;&" + } +} diff --git a/pype/configurations/defaults/environments/maya.json b/pype/configurations/defaults/environments/maya.json new file mode 100644 index 0000000000..7785b108f7 --- /dev/null +++ b/pype/configurations/defaults/environments/maya.json @@ -0,0 +1,14 @@ +{ + "PYTHONPATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/maya", + "{PYPE_SETUP_PATH}/repos/maya-look-assigner", + "{PYTHON_ENV}/python2/Lib/site-packages", + "{PYTHONPATH}" + ], + "MAYA_DISABLE_CLIC_IPM": "Yes", + "MAYA_DISABLE_CIP": "Yes", + "MAYA_DISABLE_CER": "Yes", + "PYMEL_SKIP_MEL_INIT": "Yes", + "LC_ALL": "C", + "PYPE_LOG_NO_COLORS": "Yes" +} diff --git a/pype/configurations/defaults/environments/maya_2018.json b/pype/configurations/defaults/environments/maya_2018.json new file mode 100644 index 0000000000..72a0c57ce3 --- /dev/null +++ b/pype/configurations/defaults/environments/maya_2018.json @@ -0,0 +1,11 @@ +{ + "MAYA_VERSION": "2018", + "MAYA_LOCATION": { + "darwin": "/Applications/Autodesk/maya{MAYA_VERSION}/Maya.app/Contents", + "linux": "/usr/autodesk/maya{MAYA_VERSION}", + "windows": "C:/Program Files/Autodesk/Maya{MAYA_VERSION}" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MAYA_LOCATION}/MacOS" + } +} diff --git a/pype/configurations/defaults/environments/maya_2020.json b/pype/configurations/defaults/environments/maya_2020.json new file mode 100644 index 0000000000..efd0250bc8 --- /dev/null +++ b/pype/configurations/defaults/environments/maya_2020.json @@ -0,0 +1,11 @@ +{ + "MAYA_VERSION": "2020", + "MAYA_LOCATION": { + "darwin": "/Applications/Autodesk/maya{MAYA_VERSION}/Maya.app/Contents", + "linux": "/usr/autodesk/maya{MAYA_VERSION}", + "windows": "C:/Program Files/Autodesk/Maya{MAYA_VERSION}" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MAYA_LOCATION}/MacOS" + } +} diff --git a/pype/configurations/defaults/environments/mayabatch.json b/pype/configurations/defaults/environments/mayabatch.json new file mode 100644 index 0000000000..7785b108f7 --- /dev/null +++ b/pype/configurations/defaults/environments/mayabatch.json @@ -0,0 +1,14 @@ +{ + "PYTHONPATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/maya", + "{PYPE_SETUP_PATH}/repos/maya-look-assigner", + "{PYTHON_ENV}/python2/Lib/site-packages", + "{PYTHONPATH}" + ], + "MAYA_DISABLE_CLIC_IPM": "Yes", + "MAYA_DISABLE_CIP": "Yes", + "MAYA_DISABLE_CER": "Yes", + "PYMEL_SKIP_MEL_INIT": "Yes", + "LC_ALL": "C", + "PYPE_LOG_NO_COLORS": "Yes" +} diff --git a/pype/configurations/defaults/environments/mayabatch_2019.json b/pype/configurations/defaults/environments/mayabatch_2019.json new file mode 100644 index 0000000000..aa7360a943 --- /dev/null +++ b/pype/configurations/defaults/environments/mayabatch_2019.json @@ -0,0 +1,11 @@ +{ + "MAYA_VERSION": "2019", + "MAYA_LOCATION": { + "darwin": "/Applications/Autodesk/maya{MAYA_VERSION}/Maya.app/Contents", + "linux": "/usr/autodesk/maya{MAYA_VERSION}", + "windows": "C:/Program Files/Autodesk/Maya{MAYA_VERSION}" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MAYA_LOCATION}/MacOS" + } +} diff --git a/pype/configurations/defaults/environments/mtoa_3.1.1.json b/pype/configurations/defaults/environments/mtoa_3.1.1.json new file mode 100644 index 0000000000..f7b9f94d4e --- /dev/null +++ b/pype/configurations/defaults/environments/mtoa_3.1.1.json @@ -0,0 +1,23 @@ +{ + "MTOA": "{PYPE_STUDIO_SOFTWARE}/arnold/mtoa_{MAYA_VERSION}_{MTOA_VERSION}", + "MTOA_VERSION": "3.1.1", + "MAYA_RENDER_DESC_PATH": "{MTOA}", + "MAYA_MODULE_PATH": "{MTOA}", + "ARNOLD_PLUGIN_PATH": "{MTOA}/shaders", + "MTOA_EXTENSIONS_PATH": { + "darwin": "{MTOA}/extensions", + "linux": "{MTOA}/extensions", + "windows": "{MTOA}/extensions" + }, + "MTOA_EXTENSIONS": { + "darwin": "{MTOA}/extensions", + "linux": "{MTOA}/extensions", + "windows": "{MTOA}/extensions" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MTOA}/bin" + }, + "PATH": { + "windows": "{PATH};{MTOA}/bin" + } +} diff --git a/pype/configurations/defaults/environments/muster.json b/pype/configurations/defaults/environments/muster.json new file mode 100644 index 0000000000..26f311146a --- /dev/null +++ b/pype/configurations/defaults/environments/muster.json @@ -0,0 +1,3 @@ +{ + "MUSTER_REST_URL": "http://127.0.0.1:9890" +} diff --git a/pype/configurations/defaults/environments/nuke.json b/pype/configurations/defaults/environments/nuke.json new file mode 100644 index 0000000000..50dd31ac91 --- /dev/null +++ b/pype/configurations/defaults/environments/nuke.json @@ -0,0 +1,15 @@ +{ + "NUKE_PATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/nuke/nuke_path", + "{PYPE_MODULE_ROOT}/setup/nuke/nuke_path", + "{PYPE_STUDIO_PLUGINS}/nuke" + ], + "PATH": { + "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" + }, + "PYPE_LOG_NO_COLORS": "True", + "PYTHONPATH": { + "windows": "{VIRTUAL_ENV}/Lib/site-packages;{PYTHONPATH}", + "linux": "{VIRTUAL_ENV}/lib/python3.6/site-packages:{PYTHONPATH}" + } +} diff --git a/pype/configurations/defaults/environments/nukestudio.json b/pype/configurations/defaults/environments/nukestudio.json new file mode 100644 index 0000000000..b05e2411f0 --- /dev/null +++ b/pype/configurations/defaults/environments/nukestudio.json @@ -0,0 +1,11 @@ +{ + "HIERO_PLUGIN_PATH": [ + "{PYPE_MODULE_ROOT}/setup/nukestudio/hiero_plugin_path" + ], + "PATH": { + "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" + }, + "WORKFILES_STARTUP": "0", + "TAG_ASSETBUILD_STARTUP": "0", + "PYPE_LOG_NO_COLORS": "True" +} diff --git a/pype/configurations/defaults/environments/nukestudio_10.0.json b/pype/configurations/defaults/environments/nukestudio_10.0.json new file mode 100644 index 0000000000..9bdcef53c9 --- /dev/null +++ b/pype/configurations/defaults/environments/nukestudio_10.0.json @@ -0,0 +1,4 @@ +{ + "PYPE_LOG_NO_COLORS": "Yes", + "QT_PREFERRED_BINDING": "PySide" +} \ No newline at end of file diff --git a/pype/configurations/defaults/environments/nukex.json b/pype/configurations/defaults/environments/nukex.json new file mode 100644 index 0000000000..2b77f44076 --- /dev/null +++ b/pype/configurations/defaults/environments/nukex.json @@ -0,0 +1,10 @@ +{ + "NUKE_PATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/nuke/nuke_path", + "{PYPE_MODULE_ROOT}/setup/nuke/nuke_path", + "{PYPE_STUDIO_PLUGINS}/nuke" + ], + "PATH": { + "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" + } +} diff --git a/pype/configurations/defaults/environments/nukex_10.0.json b/pype/configurations/defaults/environments/nukex_10.0.json new file mode 100644 index 0000000000..9bdcef53c9 --- /dev/null +++ b/pype/configurations/defaults/environments/nukex_10.0.json @@ -0,0 +1,4 @@ +{ + "PYPE_LOG_NO_COLORS": "Yes", + "QT_PREFERRED_BINDING": "PySide" +} \ No newline at end of file diff --git a/pype/configurations/defaults/environments/photoshop.json b/pype/configurations/defaults/environments/photoshop.json new file mode 100644 index 0000000000..2208a88665 --- /dev/null +++ b/pype/configurations/defaults/environments/photoshop.json @@ -0,0 +1,4 @@ +{ + "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH": "1", + "PYTHONPATH": "{PYTHONPATH}" +} diff --git a/pype/configurations/defaults/environments/premiere.json b/pype/configurations/defaults/environments/premiere.json new file mode 100644 index 0000000000..27dc5c564b --- /dev/null +++ b/pype/configurations/defaults/environments/premiere.json @@ -0,0 +1,11 @@ +{ + "EXTENSIONS_PATH": { + "windows": "{USERPROFILE}/AppData/Roaming/Adobe/CEP/extensions", + "darvin": "{USER}/Library/Application Support/Adobe/CEP/extensions" + }, + "EXTENSIONS_CACHE_PATH": { + "windows": "{USERPROFILE}/AppData/Local/Temp/cep_cache", + "darvin": "{USER}/Library/Application Support/Adobe/CEP/cep_cache" + }, + "installed_zxp": "" +} diff --git a/pype/configurations/defaults/environments/resolve.json b/pype/configurations/defaults/environments/resolve.json new file mode 100644 index 0000000000..1ff197dd5a --- /dev/null +++ b/pype/configurations/defaults/environments/resolve.json @@ -0,0 +1,40 @@ +{ + "RESOLVE_UTILITY_SCRIPTS_SOURCE_DIR": [ + "{STUDIO_SOFT}/davinci_resolve/scripts/python" + ], + "RESOLVE_SCRIPT_API": { + "windows": "{PROGRAMDATA}/Blackmagic Design/DaVinci Resolve/Support/Developer/Scripting", + "darvin": "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting", + "linux": "/opt/resolve/Developer/Scripting" + }, + "RESOLVE_SCRIPT_LIB": { + "windows": "C:/Program Files/Blackmagic Design/DaVinci Resolve/fusionscript.dll", + "darvin": "/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so", + "linux": "/opt/resolve/libs/Fusion/fusionscript.so" + }, + "RESOLVE_UTILITY_SCRIPTS_DIR": { + "windows": "{PROGRAMDATA}/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Comp", + "darvin": "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Comp", + "linux": "/opt/resolve/Fusion/Scripts/Comp" + }, + "PYTHON36_RESOLVE": { + "windows": "{LOCALAPPDATA}/Programs/Python/Python36", + "darvin": "~/Library/Python/3.6/bin", + "linux": "/opt/Python/3.6/bin" + }, + "PYTHONPATH": [ + "{PYTHON36_RESOLVE}/Lib/site-packages", + "{VIRTUAL_ENV}/Lib/site-packages", + "{PYTHONPATH}", + "{RESOLVE_SCRIPT_API}/Modules", + "{PYTHONPATH}" + ], + "PATH": [ + "{PYTHON36_RESOLVE}", + "{PYTHON36_RESOLVE}/Scripts", + "{PATH}" + ], + "PRE_PYTHON_SCRIPT": "{PYPE_MODULE_ROOT}/pype/resolve/preload_console.py", + "PYPE_LOG_NO_COLORS": "True", + "RESOLVE_DEV": "True" +} diff --git a/pype/configurations/defaults/environments/storyboardpro.json b/pype/configurations/defaults/environments/storyboardpro.json new file mode 100644 index 0000000000..581ad4db45 --- /dev/null +++ b/pype/configurations/defaults/environments/storyboardpro.json @@ -0,0 +1,4 @@ +{ + "AVALON_TOONBOOM_WORKFILES_ON_LAUNCH": "1", + "PYBLISH_LITE_ALWAYS_EXEC": "1" +} diff --git a/pype/configurations/defaults/environments/unreal_4.24.json b/pype/configurations/defaults/environments/unreal_4.24.json new file mode 100644 index 0000000000..8feeb0230f --- /dev/null +++ b/pype/configurations/defaults/environments/unreal_4.24.json @@ -0,0 +1,5 @@ +{ + "AVALON_UNREAL_PLUGIN": "{PYPE_SETUP_PATH}/repos/avalon-unreal-integration", + "PYPE_LOG_NO_COLORS": "True", + "QT_PREFERRED_BINDING": "PySide" +} diff --git a/pype/configurations/defaults/environments/vray_4300.json b/pype/configurations/defaults/environments/vray_4300.json new file mode 100644 index 0000000000..3212188441 --- /dev/null +++ b/pype/configurations/defaults/environments/vray_4300.json @@ -0,0 +1,15 @@ +{ + "VRAY_VERSION": "43001", + "VRAY_ROOT": "C:/vray/vray_{VRAY_VERSION}", + "MAYA_RENDER_DESC_PATH": "{VRAY_ROOT}/maya_root/bin/rendererDesc", + "VRAY_FOR_MAYA2019_MAIN": "{VRAY_ROOT}/maya_vray", + "VRAY_FOR_MAYA2019_PLUGINS": "{VRAY_ROOT}/maya_vray/vrayplugins", + "VRAY_PLUGINS": "{VRAY_ROOT}/maya_vray/vrayplugins", + "VRAY_OSL_PATH_MAYA2019": "{VRAY_ROOT}/vray/opensl", + "PATH": "{VRAY_ROOT}/maya_root/bin;{PATH}", + "MAYA_PLUG_IN_PATH": "{VRAY_ROOT}/maya_vray/plug-ins", + "MAYA_SCRIPT_PATH": "{VRAY_ROOT}/maya_vray/scripts", + "PYTHONPATH": "{VRAY_ROOT}/maya_vray/scripts;{PYTHONPATH}", + "XBMLANGPATH": "{VRAY_ROOT}/maya_vray/icons;{XBMLANGPATH}", + "VRAY_AUTH_CLIENT_FILE_PATH": "{VRAY_ROOT}" +} diff --git a/pype/configurations/defaults/launchers/blender_2.80.toml b/pype/configurations/defaults/launchers/blender_2.80.toml new file mode 100644 index 0000000000..5fea78b7b0 --- /dev/null +++ b/pype/configurations/defaults/launchers/blender_2.80.toml @@ -0,0 +1,7 @@ +application_dir = "blender" +executable = "blender_2.80" +schema = "avalon-core:application-1.0" +label = "Blender 2.80" +ftrack_label = "Blender" +icon ="blender" +ftrack_icon = '{}/app_icons/blender.png' diff --git a/pype/configurations/defaults/launchers/blender_2.81.toml b/pype/configurations/defaults/launchers/blender_2.81.toml new file mode 100644 index 0000000000..4f85ee5558 --- /dev/null +++ b/pype/configurations/defaults/launchers/blender_2.81.toml @@ -0,0 +1,7 @@ +application_dir = "blender" +executable = "blender_2.81" +schema = "avalon-core:application-1.0" +label = "Blender 2.81" +ftrack_label = "Blender" +icon ="blender" +ftrack_icon = '{}/app_icons/blender.png' diff --git a/pype/configurations/defaults/launchers/blender_2.82.toml b/pype/configurations/defaults/launchers/blender_2.82.toml new file mode 100644 index 0000000000..840001452e --- /dev/null +++ b/pype/configurations/defaults/launchers/blender_2.82.toml @@ -0,0 +1,7 @@ +application_dir = "blender" +executable = "blender_2.82" +schema = "avalon-core:application-1.0" +label = "Blender 2.82" +ftrack_label = "Blender" +icon ="blender" +ftrack_icon = '{}/app_icons/blender.png' diff --git a/pype/configurations/defaults/launchers/blender_2.83.toml b/pype/configurations/defaults/launchers/blender_2.83.toml new file mode 100644 index 0000000000..7fc8bf87b9 --- /dev/null +++ b/pype/configurations/defaults/launchers/blender_2.83.toml @@ -0,0 +1,7 @@ +application_dir = "blender" +executable = "blender_2.83" +schema = "avalon-core:application-1.0" +label = "Blender 2.83" +ftrack_label = "Blender" +icon ="blender" +ftrack_icon = '{}/app_icons/blender.png' diff --git a/pype/configurations/defaults/launchers/celaction_local.toml b/pype/configurations/defaults/launchers/celaction_local.toml new file mode 100644 index 0000000000..aef3548e08 --- /dev/null +++ b/pype/configurations/defaults/launchers/celaction_local.toml @@ -0,0 +1,8 @@ +executable = "celaction_local" +schema = "avalon-core:application-1.0" +application_dir = "celaction" +label = "CelAction2D" +ftrack_label = "CelAction2D" +icon ="celaction_local" +launch_hook = "pype/hooks/celaction/prelaunch.py/CelactionPrelaunchHook" +ftrack_icon = '{}/app_icons/celaction_local.png' diff --git a/pype/configurations/defaults/launchers/celaction_publish.toml b/pype/configurations/defaults/launchers/celaction_publish.toml new file mode 100644 index 0000000000..86f4ae39e7 --- /dev/null +++ b/pype/configurations/defaults/launchers/celaction_publish.toml @@ -0,0 +1,7 @@ +schema = "avalon-core:application-1.0" +application_dir = "shell" +executable = "celaction_publish" +label = "Shell" + +[environment] +CREATE_NEW_CONSOLE = "Yes" diff --git a/pype/configurations/defaults/launchers/darwin/blender_2.82 b/pype/configurations/defaults/launchers/darwin/blender_2.82 new file mode 100644 index 0000000000..8254411ea2 --- /dev/null +++ b/pype/configurations/defaults/launchers/darwin/blender_2.82 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +open -a blender $@ diff --git a/pype/configurations/defaults/launchers/darwin/harmony_17 b/pype/configurations/defaults/launchers/darwin/harmony_17 new file mode 100644 index 0000000000..b7eba2c2d0 --- /dev/null +++ b/pype/configurations/defaults/launchers/darwin/harmony_17 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +set >~/environment.tmp +if [ $? -ne -0 ] ; then + echo "ERROR: cannot write to '~/environment.tmp'!" + read -n 1 -s -r -p "Press any key to exit" + return +fi +open -a Terminal.app "$DIRNAME/harmony_17_launch" diff --git a/pype/configurations/defaults/launchers/darwin/harmony_17_launch b/pype/configurations/defaults/launchers/darwin/harmony_17_launch new file mode 100644 index 0000000000..5dcf5db57e --- /dev/null +++ b/pype/configurations/defaults/launchers/darwin/harmony_17_launch @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +source ~/environment.tmp +export $(cut -d= -f1 ~/environment.tmp) +exe="/Applications/Toon Boom Harmony 17 Premium/Harmony Premium.app/Contents/MacOS/Harmony Premium" +$PYPE_PYTHON_EXE -c "import avalon.harmony;avalon.harmony.launch('$exe')" diff --git a/pype/configurations/defaults/launchers/darwin/python3 b/pype/configurations/defaults/launchers/darwin/python3 new file mode 100644 index 0000000000..c2b82c7638 --- /dev/null +++ b/pype/configurations/defaults/launchers/darwin/python3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +open /usr/bin/python3 --args $@ diff --git a/pype/configurations/defaults/launchers/harmony_17.toml b/pype/configurations/defaults/launchers/harmony_17.toml new file mode 100644 index 0000000000..dbb76444a7 --- /dev/null +++ b/pype/configurations/defaults/launchers/harmony_17.toml @@ -0,0 +1,8 @@ +application_dir = "harmony" +label = "Harmony 17" +ftrack_label = "Harmony" +schema = "avalon-core:application-1.0" +executable = "harmony_17" +description = "" +icon ="harmony_icon" +ftrack_icon = '{}/app_icons/harmony.png' diff --git a/pype/configurations/defaults/launchers/houdini_16.toml b/pype/configurations/defaults/launchers/houdini_16.toml new file mode 100644 index 0000000000..e29fa74cad --- /dev/null +++ b/pype/configurations/defaults/launchers/houdini_16.toml @@ -0,0 +1,7 @@ +executable = "houdini_16" +schema = "avalon-core:application-1.0" +application_dir = "houdini" +label = "Houdini 16" +ftrack_label = "Houdini" +icon = "houdini_icon" +ftrack_icon = '{}/app_icons/houdini.png' diff --git a/pype/configurations/defaults/launchers/houdini_17.toml b/pype/configurations/defaults/launchers/houdini_17.toml new file mode 100644 index 0000000000..5d01364330 --- /dev/null +++ b/pype/configurations/defaults/launchers/houdini_17.toml @@ -0,0 +1,7 @@ +executable = "houdini_17" +schema = "avalon-core:application-1.0" +application_dir = "houdini" +label = "Houdini 17.0" +ftrack_label = "Houdini" +icon = "houdini_icon" +ftrack_icon = '{}/app_icons/houdini.png' diff --git a/pype/configurations/defaults/launchers/houdini_18.toml b/pype/configurations/defaults/launchers/houdini_18.toml new file mode 100644 index 0000000000..93b9a3334d --- /dev/null +++ b/pype/configurations/defaults/launchers/houdini_18.toml @@ -0,0 +1,7 @@ +executable = "houdini_18" +schema = "avalon-core:application-1.0" +application_dir = "houdini" +label = "Houdini 18" +ftrack_label = "Houdini" +icon = "houdini_icon" +ftrack_icon = '{}/app_icons/houdini.png' diff --git a/pype/configurations/defaults/launchers/linux/maya2016 b/pype/configurations/defaults/launchers/linux/maya2016 new file mode 100644 index 0000000000..98424304b1 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/maya2016 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2016/bin/maya" + +if [[ -z $PYPE_LOG_NO_COLORS ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/configurations/defaults/launchers/linux/maya2017 b/pype/configurations/defaults/launchers/linux/maya2017 new file mode 100644 index 0000000000..7a2662a55e --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/maya2017 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2017/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/configurations/defaults/launchers/linux/maya2018 b/pype/configurations/defaults/launchers/linux/maya2018 new file mode 100644 index 0000000000..db832b3fe7 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/maya2018 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2018/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/configurations/defaults/launchers/linux/maya2019 b/pype/configurations/defaults/launchers/linux/maya2019 new file mode 100644 index 0000000000..8398734ab9 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/maya2019 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2019/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/configurations/defaults/launchers/linux/maya2020 b/pype/configurations/defaults/launchers/linux/maya2020 new file mode 100644 index 0000000000..18a1edd598 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/maya2020 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2020/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/configurations/defaults/launchers/linux/nuke11.3 b/pype/configurations/defaults/launchers/linux/nuke11.3 new file mode 100644 index 0000000000..b1c9a90d74 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/nuke11.3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke11.3v5/Nuke11.3' diff --git a/pype/configurations/defaults/launchers/linux/nuke12.0 b/pype/configurations/defaults/launchers/linux/nuke12.0 new file mode 100644 index 0000000000..99ea1a6b0c --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/nuke12.0 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke12.0v1/Nuke12.0' diff --git a/pype/configurations/defaults/launchers/linux/nukestudio11.3 b/pype/configurations/defaults/launchers/linux/nukestudio11.3 new file mode 100644 index 0000000000..750d54a7d5 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/nukestudio11.3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke11.3v5/Nuke11.3 --studio' diff --git a/pype/configurations/defaults/launchers/linux/nukestudio12.0 b/pype/configurations/defaults/launchers/linux/nukestudio12.0 new file mode 100644 index 0000000000..ba5cf654a8 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/nukestudio12.0 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke12.0v1/Nuke12.0 --studio' diff --git a/pype/configurations/defaults/launchers/linux/nukex11.3 b/pype/configurations/defaults/launchers/linux/nukex11.3 new file mode 100644 index 0000000000..d913e4b961 --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/nukex11.3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke11.3v5/Nuke11.3 -nukex' diff --git a/pype/configurations/defaults/launchers/linux/nukex12.0 b/pype/configurations/defaults/launchers/linux/nukex12.0 new file mode 100644 index 0000000000..da2721c48b --- /dev/null +++ b/pype/configurations/defaults/launchers/linux/nukex12.0 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke12.0v1/Nuke12.0 -nukex' diff --git a/pype/configurations/defaults/launchers/maya_2016.toml b/pype/configurations/defaults/launchers/maya_2016.toml new file mode 100644 index 0000000000..d69c4effaf --- /dev/null +++ b/pype/configurations/defaults/launchers/maya_2016.toml @@ -0,0 +1,26 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2016x64" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2016" +description = "" +icon ="maya_icon" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" + +[environment] +MAYA_DISABLE_CLIC_IPM = "Yes" # Disable the AdSSO process +MAYA_DISABLE_CIP = "Yes" # Shorten time to boot +MAYA_DISABLE_CER = "Yes" +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/maya_2017.toml b/pype/configurations/defaults/launchers/maya_2017.toml new file mode 100644 index 0000000000..2d1c35b530 --- /dev/null +++ b/pype/configurations/defaults/launchers/maya_2017.toml @@ -0,0 +1,28 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2017" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2017" +description = "" +icon ="maya_icon" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" + +[environment] +MAYA_DISABLE_CLIC_IPM = "Yes" # Disable the AdSSO process +MAYA_DISABLE_CIP = "Yes" # Shorten time to boot +MAYA_DISABLE_CER = "Yes" +PYMEL_SKIP_MEL_INIT = "Yes" +LC_ALL= "C" # Mute color management warnings +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/maya_2018.toml b/pype/configurations/defaults/launchers/maya_2018.toml new file mode 100644 index 0000000000..f180263fa2 --- /dev/null +++ b/pype/configurations/defaults/launchers/maya_2018.toml @@ -0,0 +1,14 @@ +application_dir = "maya" +default_dirs = [ + "renders" +] +label = "Autodesk Maya 2018" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2018" +description = "" +icon ="maya_icon" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" diff --git a/pype/configurations/defaults/launchers/maya_2019.toml b/pype/configurations/defaults/launchers/maya_2019.toml new file mode 100644 index 0000000000..7ec2cbcedd --- /dev/null +++ b/pype/configurations/defaults/launchers/maya_2019.toml @@ -0,0 +1,14 @@ +application_dir = "maya" +default_dirs = [ + "renders" +] +label = "Autodesk Maya 2019" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2019" +description = "" +icon ="maya_icon" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" diff --git a/pype/configurations/defaults/launchers/maya_2020.toml b/pype/configurations/defaults/launchers/maya_2020.toml new file mode 100644 index 0000000000..49d84ef9a0 --- /dev/null +++ b/pype/configurations/defaults/launchers/maya_2020.toml @@ -0,0 +1,14 @@ +application_dir = "maya" +default_dirs = [ + "renders" +] +label = "Autodesk Maya 2020" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2020" +description = "" +icon ="maya_icon" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" diff --git a/pype/configurations/defaults/launchers/mayabatch_2019.toml b/pype/configurations/defaults/launchers/mayabatch_2019.toml new file mode 100644 index 0000000000..a928618d2b --- /dev/null +++ b/pype/configurations/defaults/launchers/mayabatch_2019.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2019x64" +schema = "avalon-core:application-1.0" +executable = "mayabatch2019" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/mayabatch_2020.toml b/pype/configurations/defaults/launchers/mayabatch_2020.toml new file mode 100644 index 0000000000..cd1e1e4474 --- /dev/null +++ b/pype/configurations/defaults/launchers/mayabatch_2020.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2020x64" +schema = "avalon-core:application-1.0" +executable = "mayabatch2020" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/mayapy2016.toml b/pype/configurations/defaults/launchers/mayapy2016.toml new file mode 100644 index 0000000000..ad1e3dee86 --- /dev/null +++ b/pype/configurations/defaults/launchers/mayapy2016.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2016x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2016" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/mayapy2017.toml b/pype/configurations/defaults/launchers/mayapy2017.toml new file mode 100644 index 0000000000..8d2095ff47 --- /dev/null +++ b/pype/configurations/defaults/launchers/mayapy2017.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2017x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2017" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/mayapy2018.toml b/pype/configurations/defaults/launchers/mayapy2018.toml new file mode 100644 index 0000000000..597744fd85 --- /dev/null +++ b/pype/configurations/defaults/launchers/mayapy2018.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2018x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2017" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/mayapy2019.toml b/pype/configurations/defaults/launchers/mayapy2019.toml new file mode 100644 index 0000000000..3c8a9860f9 --- /dev/null +++ b/pype/configurations/defaults/launchers/mayapy2019.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2019x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2019" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/mayapy2020.toml b/pype/configurations/defaults/launchers/mayapy2020.toml new file mode 100644 index 0000000000..8f2d2e4a67 --- /dev/null +++ b/pype/configurations/defaults/launchers/mayapy2020.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2020x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2020" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/configurations/defaults/launchers/myapp.toml b/pype/configurations/defaults/launchers/myapp.toml new file mode 100644 index 0000000000..21da0d52b2 --- /dev/null +++ b/pype/configurations/defaults/launchers/myapp.toml @@ -0,0 +1,5 @@ +executable = "python" +schema = "avalon-core:application-1.0" +application_dir = "myapp" +label = "My App" +arguments = [ "-c", "import sys; from Qt import QtWidgets; if __name__ == '__main__':;\n app = QtWidgets.QApplication(sys.argv);\n window = QtWidgets.QWidget();\n window.setWindowTitle(\"My App\");\n window.resize(400, 300);\n window.show();\n app.exec_();\n",] \ No newline at end of file diff --git a/pype/configurations/defaults/launchers/nuke_10.0.toml b/pype/configurations/defaults/launchers/nuke_10.0.toml new file mode 100644 index 0000000000..2195fd3e82 --- /dev/null +++ b/pype/configurations/defaults/launchers/nuke_10.0.toml @@ -0,0 +1,7 @@ +executable = "nuke10.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke 10.0v4" +ftrack_label = "Nuke" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nuke_11.0.toml b/pype/configurations/defaults/launchers/nuke_11.0.toml new file mode 100644 index 0000000000..0c981b479a --- /dev/null +++ b/pype/configurations/defaults/launchers/nuke_11.0.toml @@ -0,0 +1,7 @@ +executable = "nuke11.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke 11.0" +ftrack_label = "Nuke" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nuke_11.2.toml b/pype/configurations/defaults/launchers/nuke_11.2.toml new file mode 100644 index 0000000000..57c962d126 --- /dev/null +++ b/pype/configurations/defaults/launchers/nuke_11.2.toml @@ -0,0 +1,7 @@ +executable = "nuke11.2" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke 11.2" +ftrack_label = "Nuke" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nuke_11.3.toml b/pype/configurations/defaults/launchers/nuke_11.3.toml new file mode 100644 index 0000000000..87f769c23b --- /dev/null +++ b/pype/configurations/defaults/launchers/nuke_11.3.toml @@ -0,0 +1,7 @@ +executable = "nuke11.3" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke 11.3" +ftrack_label = "Nuke" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nuke_12.0.toml b/pype/configurations/defaults/launchers/nuke_12.0.toml new file mode 100644 index 0000000000..62936b4cdb --- /dev/null +++ b/pype/configurations/defaults/launchers/nuke_12.0.toml @@ -0,0 +1,7 @@ +executable = "nuke12.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke 12.0" +ftrack_label = "Nuke" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nukestudio_10.0.toml b/pype/configurations/defaults/launchers/nukestudio_10.0.toml new file mode 100644 index 0000000000..41601e4d40 --- /dev/null +++ b/pype/configurations/defaults/launchers/nukestudio_10.0.toml @@ -0,0 +1,7 @@ +executable = "nukestudio10.0" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio 10.0" +ftrack_label = "NukeStudio" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nukestudio_11.0.toml b/pype/configurations/defaults/launchers/nukestudio_11.0.toml new file mode 100644 index 0000000000..7a9d84707a --- /dev/null +++ b/pype/configurations/defaults/launchers/nukestudio_11.0.toml @@ -0,0 +1,7 @@ +executable = "nukestudio11.0" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio 11.0" +ftrack_label = "NukeStudio" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nukestudio_11.2.toml b/pype/configurations/defaults/launchers/nukestudio_11.2.toml new file mode 100644 index 0000000000..21557033ca --- /dev/null +++ b/pype/configurations/defaults/launchers/nukestudio_11.2.toml @@ -0,0 +1,7 @@ +executable = "nukestudio11.2" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio 11.2" +ftrack_label = "NukeStudio" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nukestudio_11.3.toml b/pype/configurations/defaults/launchers/nukestudio_11.3.toml new file mode 100644 index 0000000000..1946ad6c3b --- /dev/null +++ b/pype/configurations/defaults/launchers/nukestudio_11.3.toml @@ -0,0 +1,7 @@ +executable = "nukestudio11.3" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio 11.3" +ftrack_label = "NukeStudio" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nukestudio_12.0.toml b/pype/configurations/defaults/launchers/nukestudio_12.0.toml new file mode 100644 index 0000000000..4ce7f9b538 --- /dev/null +++ b/pype/configurations/defaults/launchers/nukestudio_12.0.toml @@ -0,0 +1,7 @@ +executable = "nukestudio12.0" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio 12.0" +ftrack_label = "NukeStudio" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/configurations/defaults/launchers/nukex_10.0.toml b/pype/configurations/defaults/launchers/nukex_10.0.toml new file mode 100644 index 0000000000..7dee22996d --- /dev/null +++ b/pype/configurations/defaults/launchers/nukex_10.0.toml @@ -0,0 +1,7 @@ +executable = "nukex10.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX 10.0" +ftrack_label = "NukeX" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/configurations/defaults/launchers/nukex_11.0.toml b/pype/configurations/defaults/launchers/nukex_11.0.toml new file mode 100644 index 0000000000..c2b4970a26 --- /dev/null +++ b/pype/configurations/defaults/launchers/nukex_11.0.toml @@ -0,0 +1,7 @@ +executable = "nukex11.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX 11.2" +ftrack_label = "NukeX" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/configurations/defaults/launchers/nukex_11.2.toml b/pype/configurations/defaults/launchers/nukex_11.2.toml new file mode 100644 index 0000000000..3857b9995c --- /dev/null +++ b/pype/configurations/defaults/launchers/nukex_11.2.toml @@ -0,0 +1,7 @@ +executable = "nukex11.2" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX 11.2" +ftrack_label = "NukeX" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/configurations/defaults/launchers/nukex_11.3.toml b/pype/configurations/defaults/launchers/nukex_11.3.toml new file mode 100644 index 0000000000..56428470eb --- /dev/null +++ b/pype/configurations/defaults/launchers/nukex_11.3.toml @@ -0,0 +1,7 @@ +executable = "nukex11.3" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX 11.3" +ftrack_label = "NukeX" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/configurations/defaults/launchers/nukex_12.0.toml b/pype/configurations/defaults/launchers/nukex_12.0.toml new file mode 100644 index 0000000000..33d7fddb88 --- /dev/null +++ b/pype/configurations/defaults/launchers/nukex_12.0.toml @@ -0,0 +1,7 @@ +executable = "nukex12.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX 12.0" +ftrack_label = "NukeX" +icon ="nuke_icon" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/configurations/defaults/launchers/photoshop_2020.toml b/pype/configurations/defaults/launchers/photoshop_2020.toml new file mode 100644 index 0000000000..117b668232 --- /dev/null +++ b/pype/configurations/defaults/launchers/photoshop_2020.toml @@ -0,0 +1,8 @@ +executable = "photoshop_2020" +schema = "avalon-core:application-1.0" +application_dir = "photoshop" +label = "Adobe Photoshop 2020" +icon ="photoshop_icon" +ftrack_label = "Photoshop" +ftrack_icon = '{}/app_icons/photoshop.png' +launch_hook = "pype/hooks/photoshop/prelaunch.py/PhotoshopPrelaunch" diff --git a/pype/configurations/defaults/launchers/premiere_2019.toml b/pype/configurations/defaults/launchers/premiere_2019.toml new file mode 100644 index 0000000000..f4c19c62cb --- /dev/null +++ b/pype/configurations/defaults/launchers/premiere_2019.toml @@ -0,0 +1,8 @@ +executable = "premiere_pro_2019" +schema = "avalon-core:application-1.0" +application_dir = "premiere" +label = "Adobe Premiere Pro CC 2019" +icon ="premiere_icon" + +ftrack_label = "Premiere" +ftrack_icon = '{}/app_icons/premiere.png' diff --git a/pype/configurations/defaults/launchers/premiere_2020.toml b/pype/configurations/defaults/launchers/premiere_2020.toml new file mode 100644 index 0000000000..4d721c898f --- /dev/null +++ b/pype/configurations/defaults/launchers/premiere_2020.toml @@ -0,0 +1,9 @@ +executable = "premiere_pro_2020" +schema = "avalon-core:application-1.0" +application_dir = "premiere" +label = "Adobe Premiere Pro CC 2020" +launch_hook = "pype/hooks/premiere/prelaunch.py/PremierePrelaunch" +icon ="premiere_icon" + +ftrack_label = "Premiere" +ftrack_icon = '{}/app_icons/premiere.png' diff --git a/pype/configurations/defaults/launchers/python_2.toml b/pype/configurations/defaults/launchers/python_2.toml new file mode 100644 index 0000000000..e9e8dd7899 --- /dev/null +++ b/pype/configurations/defaults/launchers/python_2.toml @@ -0,0 +1,10 @@ +schema = "avalon-core:application-1.0" +application_dir = "python" +executable = "python" +label = "Python 2" +ftrack_label = "Python" +icon ="python_icon" +ftrack_icon = '{}/app_icons/python.png' + +[environment] +CREATE_NEW_CONSOLE = "Yes" diff --git a/pype/configurations/defaults/launchers/python_3.toml b/pype/configurations/defaults/launchers/python_3.toml new file mode 100644 index 0000000000..5cbd8b2943 --- /dev/null +++ b/pype/configurations/defaults/launchers/python_3.toml @@ -0,0 +1,10 @@ +schema = "avalon-core:application-1.0" +application_dir = "python" +executable = "python3" +label = "Python 3" +ftrack_label = "Python" +icon ="python_icon" +ftrack_icon = '{}/app_icons/python.png' + +[environment] +CREATE_NEW_CONSOLE = "Yes" diff --git a/pype/configurations/defaults/launchers/resolve_16.toml b/pype/configurations/defaults/launchers/resolve_16.toml new file mode 100644 index 0000000000..430fd1a638 --- /dev/null +++ b/pype/configurations/defaults/launchers/resolve_16.toml @@ -0,0 +1,9 @@ +executable = "resolve_16" +schema = "avalon-core:application-1.0" +application_dir = "resolve" +label = "BM DaVinci Resolve 16" +launch_hook = "pype/hooks/resolve/prelaunch.py/ResolvePrelaunch" +icon ="resolve" + +ftrack_label = "BM DaVinci Resolve" +ftrack_icon = '{}/app_icons/resolve.png' diff --git a/pype/configurations/defaults/launchers/shell.toml b/pype/configurations/defaults/launchers/shell.toml new file mode 100644 index 0000000000..959ad392ea --- /dev/null +++ b/pype/configurations/defaults/launchers/shell.toml @@ -0,0 +1,7 @@ +schema = "avalon-core:application-1.0" +application_dir = "shell" +executable = "shell" +label = "Shell" + +[environment] +CREATE_NEW_CONSOLE = "Yes" \ No newline at end of file diff --git a/pype/configurations/defaults/launchers/storyboardpro_7.toml b/pype/configurations/defaults/launchers/storyboardpro_7.toml new file mode 100644 index 0000000000..ce8e96a49d --- /dev/null +++ b/pype/configurations/defaults/launchers/storyboardpro_7.toml @@ -0,0 +1,8 @@ +application_dir = "storyboardpro" +label = "Storyboard Pro 7" +ftrack_label = "Storyboard Pro" +schema = "avalon-core:application-1.0" +executable = "storyboardpro_7" +description = "" +icon ="storyboardpro_icon" +ftrack_icon = '{}/app_icons/storyboardpro.png' diff --git a/pype/configurations/defaults/launchers/unreal_4.24.toml b/pype/configurations/defaults/launchers/unreal_4.24.toml new file mode 100644 index 0000000000..0a799e5dcb --- /dev/null +++ b/pype/configurations/defaults/launchers/unreal_4.24.toml @@ -0,0 +1,8 @@ +executable = "unreal" +schema = "avalon-core:application-1.0" +application_dir = "unreal" +label = "Unreal Editor 4.24" +ftrack_label = "UnrealEditor" +icon ="ue4_icon" +launch_hook = "pype/hooks/unreal/unreal_prelaunch.py/UnrealPrelaunch" +ftrack_icon = '{}/app_icons/ue4.png' diff --git a/pype/configurations/defaults/launchers/windows/blender_2.80.bat b/pype/configurations/defaults/launchers/windows/blender_2.80.bat new file mode 100644 index 0000000000..5b8a37356b --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/blender_2.80.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.80\blender.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/blender_2.81.bat b/pype/configurations/defaults/launchers/windows/blender_2.81.bat new file mode 100644 index 0000000000..a900b18eda --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/blender_2.81.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.81\blender.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/blender_2.82.bat b/pype/configurations/defaults/launchers/windows/blender_2.82.bat new file mode 100644 index 0000000000..7105c1efe1 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/blender_2.82.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.82\blender.exe" --python-use-system-env +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/blender_2.83.bat b/pype/configurations/defaults/launchers/windows/blender_2.83.bat new file mode 100644 index 0000000000..671952f0d7 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/blender_2.83.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.83\blender.exe" --python-use-system-env +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/celaction_local.bat b/pype/configurations/defaults/launchers/windows/celaction_local.bat new file mode 100644 index 0000000000..8f2171617e --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/celaction_local.bat @@ -0,0 +1,19 @@ +set __app__="CelAction2D" +set __app_dir__="C:\Program Files (x86)\CelAction\" +set __exe__="C:\Program Files (x86)\CelAction\CelAction2D.exe" + +if not exist %__exe__% goto :missing_app + +pushd %__app_dir__% + +if "%PYPE_CELACTION_PROJECT_FILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% "%PYPE_CELACTION_PROJECT_FILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/celaction_publish.bat b/pype/configurations/defaults/launchers/windows/celaction_publish.bat new file mode 100644 index 0000000000..77ec2ac24e --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/celaction_publish.bat @@ -0,0 +1,3 @@ +echo %* + +%PYPE_PYTHON_EXE% "%PYPE_MODULE_ROOT%\pype\hosts\celaction\cli.py" %* diff --git a/pype/configurations/defaults/launchers/windows/harmony_17.bat b/pype/configurations/defaults/launchers/windows/harmony_17.bat new file mode 100644 index 0000000000..0822650875 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/harmony_17.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Harmony 17" +set __exe__="C:/Program Files (x86)/Toon Boom Animation/Toon Boom Harmony 17 Premium/win64/bin/HarmonyPremium.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% cmd.exe /k "python -c ^"import avalon.harmony;avalon.harmony.launch("%__exe__%")^"" + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/houdini_16.bat b/pype/configurations/defaults/launchers/windows/houdini_16.bat new file mode 100644 index 0000000000..018ba08b4c --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/houdini_16.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Houdini 16.0" +set __exe__="C:\Program Files\Side Effects Software\Houdini 16.0.621\bin\houdini.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/houdini_17.bat b/pype/configurations/defaults/launchers/windows/houdini_17.bat new file mode 100644 index 0000000000..950a599623 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/houdini_17.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Houdini 17.0" +set __exe__="C:\Program Files\Side Effects Software\Houdini 17.0.459\bin\houdini.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/houdini_18.bat b/pype/configurations/defaults/launchers/windows/houdini_18.bat new file mode 100644 index 0000000000..3d6b1ae258 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/houdini_18.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Houdini 18.0" +set __exe__="C:\Program Files\Side Effects Software\Houdini 18.0.287\bin\houdini.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/maya2016.bat b/pype/configurations/defaults/launchers/windows/maya2016.bat new file mode 100644 index 0000000000..54f15cf269 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/maya2016.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2016" +set __exe__="C:\Program Files\Autodesk\Maya2016\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/maya2017.bat b/pype/configurations/defaults/launchers/windows/maya2017.bat new file mode 100644 index 0000000000..5c2aeb495c --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/maya2017.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2017" +set __exe__="C:\Program Files\Autodesk\Maya2017\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/maya2018.bat b/pype/configurations/defaults/launchers/windows/maya2018.bat new file mode 100644 index 0000000000..28cf776c77 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/maya2018.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2018" +set __exe__="C:\Program Files\Autodesk\Maya2018\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/maya2019.bat b/pype/configurations/defaults/launchers/windows/maya2019.bat new file mode 100644 index 0000000000..7e80dd2557 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/maya2019.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2019" +set __exe__="C:\Program Files\Autodesk\Maya2019\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/maya2020.bat b/pype/configurations/defaults/launchers/windows/maya2020.bat new file mode 100644 index 0000000000..b2acb5df5a --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/maya2020.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2020" +set __exe__="C:\Program Files\Autodesk\maya2020\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/mayabatch2019.bat b/pype/configurations/defaults/launchers/windows/mayabatch2019.bat new file mode 100644 index 0000000000..ddd9b9b956 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/mayabatch2019.bat @@ -0,0 +1,14 @@ +@echo off + +set __app__="Maya Batch 2019" +set __exe__="C:\Program Files\Autodesk\Maya2019\bin\mayabatch.exe" +if not exist %__exe__% goto :missing_app + +echo "running maya : %*" +%__exe__% %* +echo "done." +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/mayabatch2020.bat b/pype/configurations/defaults/launchers/windows/mayabatch2020.bat new file mode 100644 index 0000000000..b1cbc6dbb6 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/mayabatch2020.bat @@ -0,0 +1,14 @@ +@echo off + +set __app__="Maya Batch 2020" +set __exe__="C:\Program Files\Autodesk\Maya2020\bin\mayabatch.exe" +if not exist %__exe__% goto :missing_app + +echo "running maya : %*" +%__exe__% %* +echo "done." +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/mayapy2016.bat b/pype/configurations/defaults/launchers/windows/mayapy2016.bat new file mode 100644 index 0000000000..205991fd3d --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/mayapy2016.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2016" +set __exe__="C:\Program Files\Autodesk\Maya2016\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/mayapy2017.bat b/pype/configurations/defaults/launchers/windows/mayapy2017.bat new file mode 100644 index 0000000000..14aacc5a7f --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/mayapy2017.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2017" +set __exe__="C:\Program Files\Autodesk\Maya2017\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/mayapy2018.bat b/pype/configurations/defaults/launchers/windows/mayapy2018.bat new file mode 100644 index 0000000000..c47c472f46 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/mayapy2018.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2018" +set __exe__="C:\Program Files\Autodesk\Maya2018\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/mayapy2019.bat b/pype/configurations/defaults/launchers/windows/mayapy2019.bat new file mode 100644 index 0000000000..73ca5b2d40 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/mayapy2019.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2019" +set __exe__="C:\Program Files\Autodesk\Maya2019\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/mayapy2020.bat b/pype/configurations/defaults/launchers/windows/mayapy2020.bat new file mode 100644 index 0000000000..770a03dcf5 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/mayapy2020.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2020" +set __exe__="C:\Program Files\Autodesk\Maya2020\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eofS + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nuke10.0.bat b/pype/configurations/defaults/launchers/windows/nuke10.0.bat new file mode 100644 index 0000000000..a47cbdfb20 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nuke10.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke10.0v4" +set __exe__="C:\Program Files\Nuke10.0v4\Nuke10.0.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nuke11.0.bat b/pype/configurations/defaults/launchers/windows/nuke11.0.bat new file mode 100644 index 0000000000..a374c5cf5b --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nuke11.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke11.0v4" +set __exe__="C:\Program Files\Nuke11.0v4\Nuke11.0.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nuke11.2.bat b/pype/configurations/defaults/launchers/windows/nuke11.2.bat new file mode 100644 index 0000000000..4c777ac28c --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nuke11.2.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke11.2v3" +set __exe__="C:\Program Files\Nuke11.2v3\Nuke11.2.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nuke11.3.bat b/pype/configurations/defaults/launchers/windows/nuke11.3.bat new file mode 100644 index 0000000000..a023f5f46f --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nuke11.3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke11.3v1" +set __exe__="C:\Program Files\Nuke11.3v1\Nuke11.3.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nuke12.0.bat b/pype/configurations/defaults/launchers/windows/nuke12.0.bat new file mode 100644 index 0000000000..d8fb5772bb --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nuke12.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke12.0v1" +set __exe__="C:\Program Files\Nuke12.0v1\Nuke12.0.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukestudio10.0.bat b/pype/configurations/defaults/launchers/windows/nukestudio10.0.bat new file mode 100644 index 0000000000..82f833667c --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukestudio10.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio10.0v4" +set __exe__="C:\Program Files\Nuke10.0v4\Nuke10.0.exe" --studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukestudio11.0.bat b/pype/configurations/defaults/launchers/windows/nukestudio11.0.bat new file mode 100644 index 0000000000..b66797727e --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukestudio11.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio11.0v4" +set __exe__="C:\Program Files\Nuke11.0v4\Nuke11.0.exe" -studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukestudio11.2.bat b/pype/configurations/defaults/launchers/windows/nukestudio11.2.bat new file mode 100644 index 0000000000..a653d816b4 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukestudio11.2.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio11.2v3" +set __exe__="C:\Program Files\Nuke11.2v3\Nuke11.2.exe" -studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukestudio11.3.bat b/pype/configurations/defaults/launchers/windows/nukestudio11.3.bat new file mode 100644 index 0000000000..62c8718873 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukestudio11.3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio11.3v1" +set __exe__="C:\Program Files\Nuke11.3v1\Nuke11.3.exe" --studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukestudio12.0.bat b/pype/configurations/defaults/launchers/windows/nukestudio12.0.bat new file mode 100644 index 0000000000..488232bcbf --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukestudio12.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio12.0v1" +set __exe__="C:\Program Files\Nuke12.0v1\Nuke12.0.exe" --studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukex10.0.bat b/pype/configurations/defaults/launchers/windows/nukex10.0.bat new file mode 100644 index 0000000000..1759706a7b --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukex10.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX10.0v4" +set __exe__="C:\Program Files\Nuke10.0v4\Nuke10.0.exe" -nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukex11.0.bat b/pype/configurations/defaults/launchers/windows/nukex11.0.bat new file mode 100644 index 0000000000..b554a7b6fa --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukex11.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX11.0v4" +set __exe__="C:\Program Files\Nuke11.0v4\Nuke11.0.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukex11.2.bat b/pype/configurations/defaults/launchers/windows/nukex11.2.bat new file mode 100644 index 0000000000..a4cb5dec5c --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukex11.2.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX11.2v3" +set __exe__="C:\Program Files\Nuke11.2v3\Nuke11.2.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukex11.3.bat b/pype/configurations/defaults/launchers/windows/nukex11.3.bat new file mode 100644 index 0000000000..490b55cf4c --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukex11.3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX11.3v1" +set __exe__="C:\Program Files\Nuke11.3v1\Nuke11.3.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/nukex12.0.bat b/pype/configurations/defaults/launchers/windows/nukex12.0.bat new file mode 100644 index 0000000000..26adf0d3f1 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/nukex12.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX12.0v1" +set __exe__="C:\Program Files\Nuke12.0v1\Nuke12.0.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/photoshop_2020.bat b/pype/configurations/defaults/launchers/windows/photoshop_2020.bat new file mode 100644 index 0000000000..6b90922ef6 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/photoshop_2020.bat @@ -0,0 +1,15 @@ +@echo off + +set __app__="Photoshop 2020" +set __exe__="C:\Program Files\Adobe\Adobe Photoshop 2020\Photoshop.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% cmd.exe /k "%PYPE_PYTHON_EXE% -c ^"import avalon.photoshop;avalon.photoshop.launch("%__exe__%")^"" + +goto :eof + +pause + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/premiere_pro_2019.bat b/pype/configurations/defaults/launchers/windows/premiere_pro_2019.bat new file mode 100644 index 0000000000..4886737d2f --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/premiere_pro_2019.bat @@ -0,0 +1,14 @@ +@echo off + +set __app__="Adobe Premiere Pro" +set __exe__="C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" +if not exist %__exe__% goto :missing_app + +python -u %PREMIERA_PATH%\init.py +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/premiere_pro_2020.bat b/pype/configurations/defaults/launchers/windows/premiere_pro_2020.bat new file mode 100644 index 0000000000..14662d3be3 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/premiere_pro_2020.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Adobe Premiere Pro" +set __exe__="C:\Program Files\Adobe\Adobe Premiere Pro 2020\Adobe Premiere Pro.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/python3.bat b/pype/configurations/defaults/launchers/windows/python3.bat new file mode 100644 index 0000000000..c7c116fe72 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/python3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Python36" +set __exe__="C:\Python36\python.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/resolve_16.bat b/pype/configurations/defaults/launchers/windows/resolve_16.bat new file mode 100644 index 0000000000..1a5d964e6b --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/resolve_16.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Resolve" +set __appy__="Resolve Python Console" +set __exe__="C:/Program Files/Blackmagic Design/DaVinci Resolve/Resolve.exe" +set __py__="%PYTHON36_RESOLVE%/python.exe" + +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* +IF "%RESOLVE_DEV%"=="True" (start %__appy__% %__py__% -i %PRE_PYTHON_SCRIPT%) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/shell.bat b/pype/configurations/defaults/launchers/windows/shell.bat new file mode 100644 index 0000000000..eb0895364f --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/shell.bat @@ -0,0 +1,2 @@ +@echo off +start cmd diff --git a/pype/configurations/defaults/launchers/windows/storyboardpro_7.bat b/pype/configurations/defaults/launchers/windows/storyboardpro_7.bat new file mode 100644 index 0000000000..122edac572 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/storyboardpro_7.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Storyboard Pro 7" +set __exe__="C:/Program Files (x86)/Toon Boom Animation/Toon Boom Storyboard Pro 7/win64/bin/StoryboardPro.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% cmd.exe /k "python -c ^"import avalon.storyboardpro;avalon.storyboardpro.launch("%__exe__%")^"" + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/launchers/windows/unreal.bat b/pype/configurations/defaults/launchers/windows/unreal.bat new file mode 100644 index 0000000000..7771aaa5a5 --- /dev/null +++ b/pype/configurations/defaults/launchers/windows/unreal.bat @@ -0,0 +1,11 @@ +set __app__="Unreal Editor" +set __exe__="%AVALON_CURRENT_UNREAL_ENGINE%\Engine\Binaries\Win64\UE4Editor.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %PYPE_UNREAL_PROJECT_FILE% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/configurations/defaults/presets/colorspace/aces103-cg.json b/pype/configurations/defaults/presets/colorspace/aces103-cg.json new file mode 100644 index 0000000000..dd3fca4c2d --- /dev/null +++ b/pype/configurations/defaults/presets/colorspace/aces103-cg.json @@ -0,0 +1,46 @@ +{ + "resolve": { + + }, + "nukestudio": { + + }, + "nuke": { + "root": { + "colorManagement": "OCIO", + "OCIO_config": "aces_1.0.3", + "workingSpaceLUT": "ACES - ACEScg", + "defaultViewerLUT": "OCIO LUTs", + "monitorLut": "ACES/sRGB", + "int8Lut": "Utility - sRGB - Texture", + "int16Lut": "Utility - sRGB - Texture", + "logLut": "Input - ADX - ADX10", + "floatLut": "ACES - ACES2065-1" + }, + "viewer": { + "viewerProcess": "sRGB (ACES)" + }, + "write": { + "render": { + "colorspace": "ACES - ACES2065-1" + }, + "prerender": { + "colorspace": "ACES - ACES2065-1" + }, + "still": { + "colorspace": "Utility - Curve - sRGB" + } + }, + "read": { + "[^-a-zA-Z0-9](beauty)[^-a-zA-Z0-9]": "lin_srgb", + "[^-a-zA-Z0-9](P|N|Z|crypto)[^-a-zA-Z0-9]": "raw", + "[^-a-zA-Z0-9](plateRef)[^-a-zA-Z0-9]": "crv_srgb" + } + }, + "maya": { + + }, + "houdini": { + + } +} diff --git a/pype/configurations/defaults/presets/colorspace/default.json b/pype/configurations/defaults/presets/colorspace/default.json new file mode 100644 index 0000000000..8b934f810d --- /dev/null +++ b/pype/configurations/defaults/presets/colorspace/default.json @@ -0,0 +1,42 @@ +{ + "nuke": { + "root": { + "colorManagement": "Nuke", + "OCIO_config": "nuke-default", + "defaultViewerLUT": "Nuke Root LUTs", + "monitorLut": "sRGB", + "int8Lut": "sRGB", + "int16Lut": "sRGB", + "logLut": "Cineon", + "floatLut": "linear" + }, + "viewer": { + "viewerProcess": "sRGB" + }, + "write": { + "render": { + "colorspace": "linear" + }, + "prerender": { + "colorspace": "linear" + }, + "still": { + "colorspace": "sRGB" + } + }, + "read": { + "[^-a-zA-Z0-9]beauty[^-a-zA-Z0-9]": "linear", + "[^-a-zA-Z0-9](P|N|Z|crypto)[^-a-zA-Z0-9]": "linear", + "[^-a-zA-Z0-9](plateRef)[^-a-zA-Z0-9]": "sRGB" + } + }, + "maya": { + + }, + "houdini": { + + }, + "resolve": { + + } +} diff --git a/pype/configurations/defaults/presets/dataflow/aces-exr.json b/pype/configurations/defaults/presets/dataflow/aces-exr.json new file mode 100644 index 0000000000..75846c0bd6 --- /dev/null +++ b/pype/configurations/defaults/presets/dataflow/aces-exr.json @@ -0,0 +1,58 @@ +{ + "nuke": { + "nodes": { + "connected": true, + "modifymetadata": { + "_id": "connect_metadata", + "_previous": "ENDING", + "metadata.set.pype_studio_name": "{PYPE_STUDIO_NAME}", + "metadata.set.avalon_project_name": "{AVALON_PROJECT}", + "metadata.set.avalon_project_code": "{PYPE_STUDIO_CODE}", + "metadata.set.avalon_asset_name": "{AVALON_ASSET}" + }, + "crop": { + "_id": "connect_crop", + "_previous": "connect_metadata", + "box": [ + "{metadata.crop.x}", + "{metadata.crop.y}", + "{metadata.crop.right}", + "{metadata.crop.top}" + ] + }, + "write": { + "render": { + "_id": "output_write", + "_previous": "connect_crop", + "file_type": "exr", + "datatype": "16 bit half", + "compression": "Zip (1 scanline)", + "create_directories": true, + "autocrop": true, + "tile_color": "0xff0000ff", + "channels": "rgb" + }, + "prerender": { + "_id": "output_write", + "_previous": "connect_crop", + "file_type": "exr", + "datatype": "16 bit half", + "compression": "Zip (1 scanline)", + "create_directories": true, + "autocrop": false, + "tile_color": "0xc9892aff", + "channels": "rgba" + }, + "still": { + "_previous": "connect_crop", + "channels": "rgba", + "file_type": "tiff", + "datatype": "16 bit", + "compression": "LZW", + "create_directories": true, + "tile_color": "0x4145afff" + } + } + } + } +} diff --git a/pype/configurations/defaults/presets/dataflow/default.json b/pype/configurations/defaults/presets/dataflow/default.json new file mode 100644 index 0000000000..d2f470b5bc --- /dev/null +++ b/pype/configurations/defaults/presets/dataflow/default.json @@ -0,0 +1,55 @@ +{ + "nuke": { + "nodes": { + "connected": true, + "modifymetadata": { + "_id": "connect_metadata", + "_previous": "ENDING", + "metadata.set.pype_studio_name": "{PYPE_STUDIO_NAME}", + "metadata.set.avalon_project_name": "{AVALON_PROJECT}", + "metadata.set.avalon_project_code": "{PYPE_STUDIO_CODE}", + "metadata.set.avalon_asset_name": "{AVALON_ASSET}" + }, + "crop": { + "_id": "connect_crop", + "_previous": "connect_metadata", + "box": [ + "{metadata.crop.x}", + "{metadata.crop.y}", + "{metadata.crop.right}", + "{metadata.crop.top}" + ] + }, + "write": { + "render": { + "_id": "output_write", + "_previous": "connect_crop", + "file_type": "exr", + "datatype": "16 bit half", + "compression": "Zip (1 scanline)", + "autocrop": true, + "tile_color": "0xff0000ff", + "channels": "rgb" + }, + "prerender": { + "_id": "output_write", + "_previous": "connect_crop", + "file_type": "exr", + "datatype": "16 bit half", + "compression": "Zip (1 scanline)", + "autocrop": false, + "tile_color": "0xc9892aff", + "channels": "rgba" + }, + "still": { + "_previous": "connect_crop", + "channels": "rgba", + "file_type": "tiff", + "datatype": "16 bit", + "compression": "LZW", + "tile_color": "0x4145afff" + } + } + } + } +} diff --git a/pype/configurations/defaults/presets/ftrack/ftrack_config.json b/pype/configurations/defaults/presets/ftrack/ftrack_config.json new file mode 100644 index 0000000000..1ef3a9d69f --- /dev/null +++ b/pype/configurations/defaults/presets/ftrack/ftrack_config.json @@ -0,0 +1,16 @@ +{ + "sync_to_avalon": { + "statuses_name_change": ["not ready", "ready"] + }, + + "status_update": { + "_ignore_": ["in progress", "ommited", "on hold"], + "Ready": ["not ready"], + "In Progress" : ["_any_"] + }, + "status_version_to_task": { + "__description__": "Status `from` (key) must be lowered!", + "in progress": "in progress", + "approved": "approved" + } +} diff --git a/pype/configurations/defaults/presets/ftrack/ftrack_custom_attributes.json b/pype/configurations/defaults/presets/ftrack/ftrack_custom_attributes.json new file mode 100644 index 0000000000..f03d473cd0 --- /dev/null +++ b/pype/configurations/defaults/presets/ftrack/ftrack_custom_attributes.json @@ -0,0 +1,165 @@ +[{ + "label": "FPS", + "key": "fps", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "write_security_role": ["ALL"], + "read_security_role": ["ALL"], + "default": null, + "config": { + "isdecimal": true + } +}, { + "label": "Applications", + "key": "applications", + "type": "enumerator", + "entity_type": "show", + "group": "avalon", + "config": { + "multiselect": true, + "data": [ + {"blender_2.80": "Blender 2.80"}, + {"blender_2.81": "Blender 2.81"}, + {"blender_2.82": "Blender 2.82"}, + {"blender_2.83": "Blender 2.83"}, + {"celaction_local": "CelAction2D Local"}, + {"maya_2017": "Maya 2017"}, + {"maya_2018": "Maya 2018"}, + {"maya_2019": "Maya 2019"}, + {"nuke_10.0": "Nuke 10.0"}, + {"nuke_11.2": "Nuke 11.2"}, + {"nuke_11.3": "Nuke 11.3"}, + {"nuke_12.0": "Nuke 12.0"}, + {"nukex_10.0": "NukeX 10.0"}, + {"nukex_11.2": "NukeX 11.2"}, + {"nukex_11.3": "NukeX 11.3"}, + {"nukex_12.0": "NukeX 12.0"}, + {"nukestudio_10.0": "NukeStudio 10.0"}, + {"nukestudio_11.2": "NukeStudio 11.2"}, + {"nukestudio_11.3": "NukeStudio 11.3"}, + {"nukestudio_12.0": "NukeStudio 12.0"}, + {"harmony_17": "Harmony 17"}, + {"houdini_16.5": "Houdini 16.5"}, + {"houdini_17": "Houdini 17"}, + {"houdini_18": "Houdini 18"}, + {"photoshop_2020": "Photoshop 2020"}, + {"python_3": "Python 3"}, + {"python_2": "Python 2"}, + {"premiere_2019": "Premiere Pro 2019"}, + {"premiere_2020": "Premiere Pro 2020"}, + {"resolve_16": "BM DaVinci Resolve 16"} + ] + } +}, { + "label": "Avalon auto-sync", + "key": "avalon_auto_sync", + "type": "boolean", + "entity_type": "show", + "group": "avalon", + "write_security_role": ["API", "Administrator"], + "read_security_role": ["API", "Administrator"] +}, { + "label": "Intent", + "key": "intent", + "type": "enumerator", + "entity_type": "assetversion", + "group": "avalon", + "config": { + "multiselect": false, + "data": [ + {"test": "Test"}, + {"wip": "WIP"}, + {"final": "Final"} + ] + } +}, { + "label": "Library Project", + "key": "library_project", + "type": "boolean", + "entity_type": "show", + "group": "avalon", + "write_security_role": ["API", "Administrator"], + "read_security_role": ["API", "Administrator"] +}, { + "label": "Clip in", + "key": "clipIn", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +}, { + "label": "Clip out", + "key": "clipOut", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +}, { + "label": "Frame start", + "key": "frameStart", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +}, { + "label": "Frame end", + "key": "frameEnd", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +}, { + "label": "Tools", + "key": "tools_env", + "type": "enumerator", + "is_hierarchical": true, + "group": "avalon", + "config": { + "multiselect": true, + "data": [ + {"mtoa_3.0.1": "mtoa_3.0.1"}, + {"mtoa_3.1.1": "mtoa_3.1.1"}, + {"mtoa_3.2.0": "mtoa_3.2.0"}, + {"yeti_2.1.2": "yeti_2.1"} + ] + } +}, { + "label": "Resolution Width", + "key": "resolutionWidth", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +}, { + "label": "Resolution Height", + "key": "resolutionHeight", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +}, { + "label": "Pixel aspect", + "key": "pixelAspect", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "config": { + "isdecimal": true + } +}, { + "label": "Frame handles start", + "key": "handleStart", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +}, { + "label": "Frame handles end", + "key": "handleEnd", + "type": "number", + "is_hierarchical": true, + "group": "avalon", + "default": null +} +] diff --git a/pype/configurations/defaults/presets/ftrack/partnership_ftrack_cred.json b/pype/configurations/defaults/presets/ftrack/partnership_ftrack_cred.json new file mode 100644 index 0000000000..6b3a32f181 --- /dev/null +++ b/pype/configurations/defaults/presets/ftrack/partnership_ftrack_cred.json @@ -0,0 +1,5 @@ +{ + "server_url": "", + "api_key": "", + "api_user": "" +} diff --git a/pype/configurations/defaults/presets/ftrack/plugins/server.json b/pype/configurations/defaults/presets/ftrack/plugins/server.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/presets/ftrack/plugins/server.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/presets/ftrack/plugins/user.json b/pype/configurations/defaults/presets/ftrack/plugins/user.json new file mode 100644 index 0000000000..1ba8e9b511 --- /dev/null +++ b/pype/configurations/defaults/presets/ftrack/plugins/user.json @@ -0,0 +1,5 @@ +{ + "TestAction": { + "ignore_me": true + } +} diff --git a/pype/configurations/defaults/presets/ftrack/project_defaults.json b/pype/configurations/defaults/presets/ftrack/project_defaults.json new file mode 100644 index 0000000000..a4e3aa3362 --- /dev/null +++ b/pype/configurations/defaults/presets/ftrack/project_defaults.json @@ -0,0 +1,18 @@ +{ + "fps": 25, + "frameStart": 1001, + "frameEnd": 1100, + "clipIn": 1001, + "clipOut": 1100, + "handleStart": 10, + "handleEnd": 10, + + "resolutionHeight": 1080, + "resolutionWidth": 1920, + "pixelAspect": 1.0, + "applications": [ + "maya_2019", "nuke_11.3", "nukex_11.3", "nukestudio_11.3", "deadline" + ], + "tools_env": [], + "avalon_auto_sync": true +} diff --git a/pype/configurations/defaults/presets/init.json b/pype/configurations/defaults/presets/init.json new file mode 100644 index 0000000000..361ee7445b --- /dev/null +++ b/pype/configurations/defaults/presets/init.json @@ -0,0 +1,4 @@ +{ + "colorspace": "default", + "dataflow": "default" +} diff --git a/pype/configurations/defaults/presets/maya/capture.json b/pype/configurations/defaults/presets/maya/capture.json new file mode 100644 index 0000000000..b6c4893034 --- /dev/null +++ b/pype/configurations/defaults/presets/maya/capture.json @@ -0,0 +1,108 @@ +{ + "Codec": { + "compression": "jpg", + "format": "image", + "quality": 95 + }, + "Display Options": { + "background": [ + 0.7137254901960784, + 0.7137254901960784, + 0.7137254901960784 + ], + "backgroundBottom": [ + 0.7137254901960784, + 0.7137254901960784, + 0.7137254901960784 + ], + "backgroundTop": [ + 0.7137254901960784, + 0.7137254901960784, + 0.7137254901960784 + ], + "override_display": true + }, + "Generic": { + "isolate_view": true, + "off_screen": true + }, + "IO": { + "name": "", + "open_finished": false, + "raw_frame_numbers": false, + "recent_playblasts": [], + "save_file": false + }, + "PanZoom": { + "pan_zoom": true + }, + "Renderer": { + "rendererName": "vp2Renderer" + }, + "Resolution": { + "height": 1080, + "mode": "Custom", + "percent": 1.0, + "width": 1920 + }, + "Time Range": { + "end_frame": 25, + "frame": "", + "start_frame": 0, + "time": "Time Slider" + }, + "Viewport Options": { + "cameras": false, + "clipGhosts": false, + "controlVertices": false, + "deformers": false, + "dimensions": false, + "displayLights": 0, + "dynamicConstraints": false, + "dynamics": false, + "fluids": false, + "follicles": false, + "gpuCacheDisplayFilter": false, + "greasePencils": false, + "grid": false, + "hairSystems": false, + "handles": false, + "high_quality": true, + "hud": false, + "hulls": false, + "ikHandles": false, + "imagePlane": false, + "joints": false, + "lights": false, + "locators": false, + "manipulators": false, + "motionTrails": false, + "nCloths": false, + "nParticles": false, + "nRigids": false, + "nurbsCurves": false, + "nurbsSurfaces": false, + "override_viewport_options": true, + "particleInstancers": false, + "pivots": false, + "planes": false, + "pluginShapes": false, + "polymeshes": true, + "shadows": false, + "strokes": false, + "subdivSurfaces": false, + "textures": false, + "twoSidedLighting": true + }, + "Camera Options": { + "displayGateMask": false, + "displayResolution": false, + "displayFilmGate": false, + "displayFieldChart": false, + "displaySafeAction": false, + "displaySafeTitle": false, + "displayFilmPivot": false, + "displayFilmOrigin": false, + "overscan": 1.0 + } +} diff --git a/pype/configurations/defaults/presets/muster/templates_mapping.json b/pype/configurations/defaults/presets/muster/templates_mapping.json new file mode 100644 index 0000000000..4edab9077d --- /dev/null +++ b/pype/configurations/defaults/presets/muster/templates_mapping.json @@ -0,0 +1,19 @@ +{ + "3delight": 41, + "arnold": 46, + "arnold_sf": 57, + "gelato": 30, + "harware": 3, + "krakatoa": 51, + "file_layers": 7, + "mentalray": 2, + "mentalray_sf": 6, + "redshift": 55, + "renderman": 29, + "software": 1, + "software_sf": 5, + "turtle": 10, + "vector": 4, + "vray": 37, + "ffmpeg": 48 +} diff --git a/pype/configurations/defaults/presets/nukestudio/tags.json b/pype/configurations/defaults/presets/nukestudio/tags.json new file mode 100644 index 0000000000..56fcfcbce9 --- /dev/null +++ b/pype/configurations/defaults/presets/nukestudio/tags.json @@ -0,0 +1,262 @@ +{ + "Hierarchy": { + "editable": "1", + "note": "{folder}/{sequence}/{shot}", + "icon": { + "path": "hierarchy.png" + }, + "metadata": { + "folder": "FOLDER_NAME", + "shot": "{clip}", + "track": "{track}", + "sequence": "{sequence}", + "episode": "EPISODE_NAME", + "root": "{projectroot}" + } + }, + "Source Resolution": { + "editable": "1", + "note": "Use source resolution", + "icon": { + "path": "resolution.png" + }, + "metadata": { + "family": "resolution" + } + }, + "Retiming": { + "editable": "1", + "note": "Clip has retime or TimeWarp effects (or multiple effects stacked on the clip)", + "icon": { + "path": "retiming.png" + }, + "metadata": { + "family": "retiming", + "marginIn": 1, + "marginOut": 1 + } + }, + "Frame start": { + "editable": "1", + "note": "Starting frame for comps. \n\n> Use `value` and add either number or write `source` (if you want to preserve source frame numbering)", + "icon": { + "path": "icons:TagBackground.png" + }, + "metadata": { + "family": "frameStart", + "value": "1001" + } + }, + "[Lenses]": { + "Set lense here": { + "editable": "1", + "note": "Adjust parameters of your lense and then drop to clip. Remember! You can always overwrite on clip", + "icon": { + "path": "lense.png" + }, + "metadata": { + "focalLengthMm": 57 + + } + } + }, + "[Subsets]": { + "Audio": { + "editable": "1", + "note": "Export with Audio", + "icon": { + "path": "volume.png" + }, + "metadata": { + "family": "audio", + "subset": "main" + } + }, + "plateFg": { + "editable": "1", + "note": "Add to publish to \"forground\" subset. Change metadata subset name if different order number", + "icon": { + "path": "z_layer_fg.png" + }, + "metadata": { + "family": "plate", + "subset": "Fg01" + } + }, + "plateBg": { + "editable": "1", + "note": "Add to publish to \"background\" subset. Change metadata subset name if different order number", + "icon": { + "path": "z_layer_bg.png" + }, + "metadata": { + "family": "plate", + "subset": "Bg01" + } + }, + "plateRef": { + "editable": "1", + "note": "Add to publish to \"reference\" subset.", + "icon": { + "path": "icons:Reference.png" + }, + "metadata": { + "family": "plate", + "subset": "Ref" + } + }, + "plateMain": { + "editable": "1", + "note": "Add to publish to \"main\" subset.", + "icon": { + "path": "z_layer_main.png" + }, + "metadata": { + "family": "plate", + "subset": "main" + } + }, + "plateProxy": { + "editable": "1", + "note": "Add to publish to \"proxy\" subset.", + "icon": { + "path": "z_layer_main.png" + }, + "metadata": { + "family": "plate", + "subset": "proxy" + } + }, + "review": { + "editable": "1", + "note": "Upload to Ftrack as review component.", + "icon": { + "path": "review.png" + }, + "metadata": { + "family": "review", + "track": "review" + } + } + }, + "[Handles]": { + "start: add 20 frames": { + "editable": "1", + "note": "Adding frames to start of selected clip", + "icon": { + "path": "3_add_handles_start.png" + }, + "metadata": { + "family": "handles", + "value": "20", + "args": "{'op':'add','where':'start'}" + } + }, + "start: add 10 frames": { + "editable": "1", + "note": "Adding frames to start of selected clip", + "icon": { + "path": "3_add_handles_start.png" + }, + "metadata": { + "family": "handles", + "value": "10", + "args": "{'op':'add','where':'start'}" + } + }, + "start: add 5 frames": { + "editable": "1", + "note": "Adding frames to start of selected clip", + "icon": { + "path": "3_add_handles_start.png" + }, + "metadata": { + "family": "handles", + "value": "5", + "args": "{'op':'add','where':'start'}" + } + }, + "start: add 0 frames": { + "editable": "1", + "note": "Adding frames to start of selected clip", + "icon": { + "path": "3_add_handles_start.png" + }, + "metadata": { + "family": "handles", + "value": "0", + "args": "{'op':'add','where':'start'}" + } + }, + "end: add 20 frames": { + "editable": "1", + "note": "Adding frames to end of selected clip", + "icon": { + "path": "1_add_handles_end.png" + }, + "metadata": { + "family": "handles", + "value": "20", + "args": "{'op':'add','where':'end'}" + } + }, + "end: add 10 frames": { + "editable": "1", + "note": "Adding frames to end of selected clip", + "icon": { + "path": "1_add_handles_end.png" + }, + "metadata": { + "family": "handles", + "value": "10", + "args": "{'op':'add','where':'end'}" + } + }, + "end: add 5 frames": { + "editable": "1", + "note": "Adding frames to end of selected clip", + "icon": { + "path": "1_add_handles_end.png" + }, + "metadata": { + "family": "handles", + "value": "5", + "args": "{'op':'add','where':'end'}" + } + }, + "end: add 0 frames": { + "editable": "1", + "note": "Adding frames to end of selected clip", + "icon": { + "path": "1_add_handles_end.png" + }, + "metadata": { + "family": "handles", + "value": "0", + "args": "{'op':'add','where':'end'}" + } + } + }, + "NukeScript": { + "editable": "1", + "note": "Collecting track items to Nuke scripts.", + "icon": { + "path": "icons:TagNuke.png" + }, + "metadata": { + "family": "nukescript", + "subset": "main" + } + }, + "Comment": { + "editable": "1", + "note": "Comment on a shot.", + "icon": { + "path": "icons:TagComment.png" + }, + "metadata": { + "family": "comment", + "subset": "main" + } + } +} diff --git a/pype/configurations/defaults/presets/plugins/celaction/publish.json b/pype/configurations/defaults/presets/plugins/celaction/publish.json new file mode 100644 index 0000000000..e791f574d9 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/celaction/publish.json @@ -0,0 +1,10 @@ +{ + "ExtractCelactionDeadline": { + "deadline_department": "", + "deadline_priority": 50, + "deadline_pool": "", + "deadline_pool_secondary": "", + "deadline_group": "", + "deadline_chunk_size": 10 + } +} diff --git a/pype/configurations/defaults/presets/plugins/config.json b/pype/configurations/defaults/presets/plugins/config.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/config.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pype/configurations/defaults/presets/plugins/ftrack/publish.json b/pype/configurations/defaults/presets/plugins/ftrack/publish.json new file mode 100644 index 0000000000..d0469ae4f7 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/ftrack/publish.json @@ -0,0 +1,6 @@ +{ + "IntegrateFtrackNote": { + "note_with_intent_template": "{intent}: {comment}", + "note_labels": [] + } +} diff --git a/pype/configurations/defaults/presets/plugins/global/create.json b/pype/configurations/defaults/presets/plugins/global/create.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/global/create.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/presets/plugins/global/filter.json b/pype/configurations/defaults/presets/plugins/global/filter.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/global/filter.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/presets/plugins/global/load.json b/pype/configurations/defaults/presets/plugins/global/load.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/global/load.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/presets/plugins/global/publish.json b/pype/configurations/defaults/presets/plugins/global/publish.json new file mode 100644 index 0000000000..016868fc92 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/global/publish.json @@ -0,0 +1,86 @@ +{ + "IntegrateMasterVersion": { + "enabled": false + }, + "ExtractJpegEXR": { + "ffmpeg_args": { + "input": [ + "-gamma 2.2" + ], + "output": [] + } + }, + "ExtractReview": { + "__documentation__": "http://pype.club/docs/admin_presets_plugins", + "profiles": [ + { + "families": [], + "hosts": [], + "outputs": { + "h264": { + "filter": { + "families": ["render", "review", "ftrack"] + }, + "ext": "mp4", + "ffmpeg_args": { + "input": [ + "-gamma 2.2" + ], + "video_filters": [], + "audio_filters": [], + "output": [ + "-pix_fmt yuv420p", + "-crf 18", + "-intra" + ] + }, + "tags": ["burnin", "ftrackreview"] + } + } + } + ] + }, + "ExtractBurnin": { + "options": { + "opacity": 1, + "x_offset": 5, + "y_offset": 5, + "bg_padding": 5, + "bg_opacity": 0.5, + "font_size": 42 + }, + "fields": { + + }, + "profiles": [ + { + "burnins": { + "burnin": { + "TOP_LEFT": "{yy}-{mm}-{dd}", + "TOP_RIGHT": "{anatomy[version]}", + "TOP_CENTERED": "", + "BOTTOM_RIGHT": "{frame_start}-{current_frame}-{frame_end}", + "BOTTOM_CENTERED": "{asset}", + "BOTTOM_LEFT": "{username}" + } + } + } + ] + }, + "IntegrateAssetNew": { + "template_name_profiles": { + "publish": { + "families": [], + "tasks": [] + }, + "render": { + "families": ["review", "render", "prerender"] + } + } + }, + "ProcessSubmittedJobOnFarm": { + "deadline_department": "", + "deadline_pool": "", + "deadline_group": "" + } +} diff --git a/pype/configurations/defaults/presets/plugins/maya/create.json b/pype/configurations/defaults/presets/plugins/maya/create.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/maya/create.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/presets/plugins/maya/filter.json b/pype/configurations/defaults/presets/plugins/maya/filter.json new file mode 100644 index 0000000000..83d6f05f31 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/maya/filter.json @@ -0,0 +1,9 @@ +{ + "Preset n1": { + "ValidateNoAnimation": false, + "ValidateShapeDefaultNames": false + }, + "Preset n2": { + "ValidateNoAnimation": false + } +} diff --git a/pype/configurations/defaults/presets/plugins/maya/load.json b/pype/configurations/defaults/presets/plugins/maya/load.json new file mode 100644 index 0000000000..260fbb35ee --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/maya/load.json @@ -0,0 +1,18 @@ +{ + "colors": { + "model": [0.821, 0.518, 0.117], + "rig": [0.144, 0.443, 0.463], + "pointcache": [0.368, 0.821, 0.117], + "animation": [0.368, 0.821, 0.117], + "ass": [1.0, 0.332, 0.312], + "camera": [0.447, 0.312, 1.0], + "fbx": [1.0, 0.931, 0.312], + "mayaAscii": [0.312, 1.0, 0.747], + "setdress": [0.312, 1.0, 0.747], + "layout": [0.312, 1.0, 0.747], + "vdbcache": [0.312, 1.0, 0.428], + "vrayproxy": [0.258, 0.95, 0.541], + "yeticache": [0.2, 0.8, 0.3], + "yetiRig": [0, 0.8, 0.5] + } +} diff --git a/pype/configurations/defaults/presets/plugins/maya/publish.json b/pype/configurations/defaults/presets/plugins/maya/publish.json new file mode 100644 index 0000000000..2e2b3164f3 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/maya/publish.json @@ -0,0 +1,17 @@ +{ + "ValidateModelName": { + "enabled": false, + "material_file": "/path/to/shader_name_definition.txt", + "regex": "(.*)_(\\d)*_(?P.*)_(GEO)" + }, + "ValidateAssemblyName": { + "enabled": false + }, + "ValidateShaderName": { + "enabled": false, + "regex": "(?P.*)_(.*)_SHD" + }, + "ValidateMeshHasOverlappingUVs": { + "enabled": false + } +} diff --git a/pype/configurations/defaults/presets/plugins/maya/workfile_build.json b/pype/configurations/defaults/presets/plugins/maya/workfile_build.json new file mode 100644 index 0000000000..2872b783cb --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/maya/workfile_build.json @@ -0,0 +1,54 @@ +[{ + "tasks": ["lighting"], + + "current_context": [{ + "subset_name_filters": [".+[Mm]ain"], + "families": ["model"], + "repre_names": ["abc", "ma"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["animation", "pointcache"], + "repre_names": ["abc"], + "loaders": ["ReferenceLoader"] + },{ + "families": ["rendersetup"], + "repre_names": ["json"], + "loaders": ["RenderSetupLoader"] + }, { + "families": ["camera"], + "repre_names": ["abc"], + "loaders": ["ReferenceLoader"] + }], + + "linked_assets": [{ + "families": ["setdress"], + "repre_names": ["ma"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["ass"], + "repre_names": ["ass"], + "loaders":["assLoader"] + }] +}, { + "tasks": ["animation"], + + "current_context": [{ + "families": ["camera"], + "repre_names": ["abc", "ma"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["audio"], + "repre_names": ["wav"], + "loaders": ["RenderSetupLoader"] + }], + + "linked_assets": [{ + "families": ["setdress"], + "repre_names": ["proxy"], + "loaders": ["ReferenceLoader"] + }, { + "families": ["rig"], + "repre_names": ["ass"], + "loaders": ["rigLoader"] + }] +}] diff --git a/pype/configurations/defaults/presets/plugins/nuke/create.json b/pype/configurations/defaults/presets/plugins/nuke/create.json new file mode 100644 index 0000000000..4deb0b4ad5 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/nuke/create.json @@ -0,0 +1,8 @@ +{ + "CreateWriteRender": { + "fpath_template": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" + }, + "CreateWritePrerender": { + "fpath_template": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" + } +} diff --git a/pype/configurations/defaults/presets/plugins/nuke/load.json b/pype/configurations/defaults/presets/plugins/nuke/load.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/nuke/load.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/presets/plugins/nuke/publish.json b/pype/configurations/defaults/presets/plugins/nuke/publish.json new file mode 100644 index 0000000000..ab0d0e76a5 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/nuke/publish.json @@ -0,0 +1,48 @@ +{ + "ExtractThumbnail": { + "nodes": { + "Reformat": [ + ["type", "to format"], + ["format", "HD_1080"], + ["filter", "Lanczos6"], + ["black_outside", true], + ["pbb", false] + ] + } + }, + "ValidateNukeWriteKnobs": { + "enabled": false, + "knobs": { + "render": { + "review": true + } + } + }, + "ExtractReviewDataLut": { + "__documentation__": { + "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", + "enabled": "keep in on `false` if you want Nuke baking colorspace workflow applied else FFmpeg will convert imgsequence with baked LUT" + }, + "enabled": false + }, + "ExtractReviewDataMov": { + "__documentation__": { + "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", + "enabled": "keep in on `true` if you want Nuke baking colorspace workflow applied" + }, + "enabled": true, + "viewer_lut_raw": false + }, + "ExtractSlateFrame": { + "__documentation__": { + "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`" + }, + "viewer_lut_raw": false + }, + "NukeSubmitDeadline": { + "deadline_priority": 50, + "deadline_pool": "", + "deadline_pool_secondary": "", + "deadline_chunk_size": 1 + } +} diff --git a/pype/configurations/defaults/presets/plugins/nuke/workfile_build.json b/pype/configurations/defaults/presets/plugins/nuke/workfile_build.json new file mode 100644 index 0000000000..d3613c929e --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/nuke/workfile_build.json @@ -0,0 +1,11 @@ +[{ + "tasks": ["compositing"], + + "current_context": [{ + "families": ["render", "plate"], + "repre_names": ["exr" ,"dpx"], + "loaders": ["LoadSequence"] + }], + + "linked_assets": [] +}] diff --git a/pype/configurations/defaults/presets/plugins/nukestudio/filter.json b/pype/configurations/defaults/presets/plugins/nukestudio/filter.json new file mode 100644 index 0000000000..bd6a0dc1bd --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/nukestudio/filter.json @@ -0,0 +1,10 @@ +{ + "strict": { + "ValidateVersion": true, + "VersionUpWorkfile": true + }, + "benevolent": { + "ValidateVersion": false, + "VersionUpWorkfile": false + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/presets/plugins/nukestudio/publish.json b/pype/configurations/defaults/presets/plugins/nukestudio/publish.json new file mode 100644 index 0000000000..8c4ad133f1 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/nukestudio/publish.json @@ -0,0 +1,8 @@ +{ + "CollectInstanceVersion": { + "enabled": false + }, + "ExtractReviewCutUpVideo": { + "tags_addition": [] + } +} diff --git a/pype/configurations/defaults/presets/plugins/resolve/create.json b/pype/configurations/defaults/presets/plugins/resolve/create.json new file mode 100644 index 0000000000..29ca5900fb --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/resolve/create.json @@ -0,0 +1,7 @@ +{ + "CreateShotClip": { + "clipName": "{track}{sequence}{shot}", + "folder": "takes", + "steps": 20 + } +} diff --git a/pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json b/pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json new file mode 100644 index 0000000000..2b2fb660c2 --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json @@ -0,0 +1,25 @@ +{ + "ExtractThumbnailSP": { + "ffmpeg_args": { + "input": [ + "-gamma 2.2" + ], + "output": [] + } + }, + "ExtractReviewSP": { + "outputs": { + "h264": { + "input": [ + "-gamma 2.2" + ], + "output": [ + "-pix_fmt yuv420p", + "-crf 18" + ], + "tags": ["preview"], + "ext": "mov" + } + } + } +} diff --git a/pype/configurations/defaults/presets/plugins/test/create.json b/pype/configurations/defaults/presets/plugins/test/create.json new file mode 100644 index 0000000000..fa0b2fc05f --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/test/create.json @@ -0,0 +1,8 @@ +{ + "MyTestCreator": { + "my_test_property": "B", + "active": false, + "new_property": "new", + "family": "new_family" + } +} diff --git a/pype/configurations/defaults/presets/plugins/test/publish.json b/pype/configurations/defaults/presets/plugins/test/publish.json new file mode 100644 index 0000000000..3180dd5d8a --- /dev/null +++ b/pype/configurations/defaults/presets/plugins/test/publish.json @@ -0,0 +1,10 @@ +{ + "MyTestPlugin": { + "label": "loaded from preset", + "optional": true, + "families": ["changed", "by", "preset"] + }, + "MyTestRemovedPlugin": { + "enabled": false + } +} diff --git a/pype/configurations/defaults/presets/premiere/asset_default.json b/pype/configurations/defaults/presets/premiere/asset_default.json new file mode 100644 index 0000000000..84d2bde3d8 --- /dev/null +++ b/pype/configurations/defaults/presets/premiere/asset_default.json @@ -0,0 +1,5 @@ +{ + "frameStart": 1001, + "handleStart": 0, + "handleEnd": 0 +} diff --git a/pype/configurations/defaults/presets/premiere/rules_tasks.json b/pype/configurations/defaults/presets/premiere/rules_tasks.json new file mode 100644 index 0000000000..333c9cd70b --- /dev/null +++ b/pype/configurations/defaults/presets/premiere/rules_tasks.json @@ -0,0 +1,21 @@ +{ + "defaultTasks": ["Layout", "Animation"], + "taskToSubsets": { + "Layout": ["reference", "audio"], + "Animation": ["audio"] + }, + "subsetToRepresentations": { + "reference": { + "preset": "h264", + "representation": "mp4" + }, + "thumbnail": { + "preset": "jpeg_thumb", + "representation": "jpg" + }, + "audio": { + "preset": "48khz", + "representation": "wav" + } + } +} diff --git a/pype/configurations/defaults/presets/standalone_publish/families.json b/pype/configurations/defaults/presets/standalone_publish/families.json new file mode 100644 index 0000000000..d05941cc26 --- /dev/null +++ b/pype/configurations/defaults/presets/standalone_publish/families.json @@ -0,0 +1,90 @@ +{ + "create_look": { + "name": "look", + "label": "Look", + "family": "look", + "icon": "paint-brush", + "defaults": ["Main"], + "help": "Shader connections defining shape look" + }, + "create_model": { + "name": "model", + "label": "Model", + "family": "model", + "icon": "cube", + "defaults": ["Main", "Proxy", "Sculpt"], + "help": "Polygonal static geometry" + }, + "create_workfile": { + "name": "workfile", + "label": "Workfile", + "family": "workfile", + "icon": "cube", + "defaults": ["Main"], + "help": "Working scene backup" + }, + "create_camera": { + "name": "camera", + "label": "Camera", + "family": "camera", + "icon": "video-camera", + "defaults": ["Main"], + "help": "Single baked camera" + }, + "create_pointcache": { + "name": "pointcache", + "label": "Pointcache", + "family": "pointcache", + "icon": "gears", + "defaults": ["Main"], + "help": "Alembic pointcache for animated data" + }, + "create_rig": { + "name": "rig", + "label": "Rig", + "family": "rig", + "icon": "wheelchair", + "defaults": ["Main"], + "help": "Artist-friendly rig with controls" + }, + "create_layout": { + "name": "layout", + "label": "Layout", + "family": "layout", + "icon": "cubes", + "defaults": ["Main"], + "help": "Simple scene for animators with camera" + }, + "create_plate": { + "name": "plate", + "label": "Plate", + "family": "plate", + "icon": "camera", + "defaults": ["Main", "BG", "Reference"], + "help": "Plates for compositors" + }, + "create_matchmove": { + "name": "matchmove", + "label": "Matchmove script", + "family": "matchmove", + "icon": "empire", + "defaults": ["Camera", "Object", "Mocap"], + "help": "Script exported from matchmoving application" + }, + "create_images": { + "name": "image", + "label": "Image file", + "family": "image", + "icon": "image", + "defaults": ["ConceptArt", "Reference", "Texture", "MattePaint"], + "help": "Holder for all kinds of image data" + }, + "create_editorial": { + "name": "editorial", + "label": "Editorial", + "family": "editorial", + "icon": "image", + "defaults": ["Main"], + "help": "Editorial files to generate shots." + } +} diff --git a/pype/configurations/defaults/presets/tools/creator.json b/pype/configurations/defaults/presets/tools/creator.json new file mode 100644 index 0000000000..d14e779f01 --- /dev/null +++ b/pype/configurations/defaults/presets/tools/creator.json @@ -0,0 +1,8 @@ +{ + "Model": ["model"], + "Render Globals": ["light", "render"], + "Layout": ["layout"], + "Set Dress": ["setdress"], + "Look": ["look"], + "Rig": ["rigging"] +} diff --git a/pype/configurations/defaults/presets/tools/project_folder_structure.json b/pype/configurations/defaults/presets/tools/project_folder_structure.json new file mode 100644 index 0000000000..83bd5f12a9 --- /dev/null +++ b/pype/configurations/defaults/presets/tools/project_folder_structure.json @@ -0,0 +1,22 @@ +{ + "__project_root__": { + "prod" : {}, + "resources" : { + "footage": { + "plates": {}, + "offline": {} + }, + "audio": {}, + "art_dept": {} + }, + "editorial" : {}, + "assets[ftrack.Library]": { + "characters[ftrack]": {}, + "locations[ftrack]": {} + }, + "shots[ftrack.Sequence]": { + "scripts": {}, + "editorial[ftrack.Folder]": {} + } + } +} diff --git a/pype/configurations/defaults/presets/tools/pyblish.json b/pype/configurations/defaults/presets/tools/pyblish.json new file mode 100644 index 0000000000..e81932ec45 --- /dev/null +++ b/pype/configurations/defaults/presets/tools/pyblish.json @@ -0,0 +1,17 @@ +{ + "ui": { + "intents": { + "__description__": [ + "In items you can specify {label: value} of intents", + "`default` may be used for setting default value." + ], + "default": "wip", + "items": { + "": "", + "wip": "WIP", + "test": "TEST", + "final": "FINAL" + } + } + } +} diff --git a/pype/configurations/defaults/presets/tools/slates/example_HD.json b/pype/configurations/defaults/presets/tools/slates/example_HD.json new file mode 100644 index 0000000000..b06391fb63 --- /dev/null +++ b/pype/configurations/defaults/presets/tools/slates/example_HD.json @@ -0,0 +1,212 @@ +{ + "width": 1920, + "height": 1080, + "destination_path": "{destination_path}", + "style": { + "*": { + "font-family": "arial", + "font-color": "#ffffff", + "font-bold": false, + "font-italic": false, + "bg-color": "#0077ff", + "alignment-horizontal": "left", + "alignment-vertical": "top" + }, + "layer": { + "padding": 0, + "margin": 0 + }, + "rectangle": { + "padding": 0, + "margin": 0, + "bg-color": "#E9324B", + "fill": true + }, + "main_frame": { + "padding": 0, + "margin": 0, + "bg-color": "#252525" + }, + "table": { + "padding": 0, + "margin": 0, + "bg-color": "transparent" + }, + "table-item": { + "padding": 5, + "padding-bottom": 10, + "margin": 0, + "bg-color": "#212121", + "bg-alter-color": "#272727", + "font-color": "#dcdcdc", + "font-bold": false, + "font-italic": false, + "alignment-horizontal": "left", + "alignment-vertical": "top", + "word-wrap": false, + "ellide": true, + "max-lines": 1 + }, + "table-item-col[0]": { + "font-size": 20, + "font-color": "#898989", + "font-bold": true, + "ellide": false, + "word-wrap": true, + "max-lines": null + }, + "table-item-col[1]": { + "font-size": 40, + "padding-left": 10 + }, + "#colorbar": { + "bg-color": "#9932CC" + } + }, + "items": [{ + "type": "layer", + "direction": 1, + "name": "MainLayer", + "style": { + "#MainLayer": { + "width": 1094, + "height": 1000, + "margin": 25, + "padding": 0 + }, + "#LeftSide": { + "margin-right": 25 + } + }, + "items": [{ + "type": "layer", + "name": "LeftSide", + "items": [{ + "type": "layer", + "direction": 1, + "style": { + "table-item": { + "bg-color": "transparent", + "padding-bottom": 20 + }, + "table-item-col[0]": { + "font-size": 20, + "font-color": "#898989", + "alignment-horizontal": "right" + }, + "table-item-col[1]": { + "alignment-horizontal": "left", + "font-bold": true, + "font-size": 40 + } + }, + "items": [{ + "type": "table", + "values": [ + ["Show:", "{project[name]}"] + ], + "style": { + "table-item-field[0:0]": { + "width": 150 + }, + "table-item-field[0:1]": { + "width": 580 + } + } + }, { + "type": "table", + "values": [ + ["Submitting For:", "{intent}"] + ], + "style": { + "table-item-field[0:0]": { + "width": 160 + }, + "table-item-field[0:1]": { + "width": 218, + "alignment-horizontal": "right" + } + } + }] + }, { + "type": "rectangle", + "style": { + "bg-color": "#bc1015", + "width": 1108, + "height": 5, + "fill": true + } + }, { + "type": "table", + "use_alternate_color": true, + "values": [ + ["Version name:", "{version_name}"], + ["Date:", "{date}"], + ["Shot Types:", "{shot_type}"], + ["Submission Note:", "{submission_note}"] + ], + "style": { + "table-item": { + "padding-bottom": 20 + }, + "table-item-field[0:1]": { + "font-bold": true + }, + "table-item-field[3:0]": { + "word-wrap": true, + "ellide": true, + "max-lines": 4 + }, + "table-item-col[0]": { + "alignment-horizontal": "right", + "width": 150 + }, + "table-item-col[1]": { + "alignment-horizontal": "left", + "width": 958 + } + } + }] + }, { + "type": "layer", + "name": "RightSide", + "items": [{ + "type": "placeholder", + "name": "thumbnail", + "path": "{thumbnail_path}", + "style": { + "width": 730, + "height": 412 + } + }, { + "type": "placeholder", + "name": "colorbar", + "path": "{color_bar_path}", + "return_data": true, + "style": { + "width": 730, + "height": 55 + } + }, { + "type": "table", + "use_alternate_color": true, + "values": [ + ["Vendor:", "{vendor}"], + ["Shot Name:", "{shot_name}"], + ["Frames:", "{frame_start} - {frame_end} ({duration})"] + ], + "style": { + "table-item-col[0]": { + "alignment-horizontal": "left", + "width": 200 + }, + "table-item-col[1]": { + "alignment-horizontal": "right", + "width": 530, + "font-size": 30 + } + } + }] + }] + }] +} diff --git a/pype/configurations/defaults/presets/tools/sw_folders.json b/pype/configurations/defaults/presets/tools/sw_folders.json new file mode 100644 index 0000000000..a154935dce --- /dev/null +++ b/pype/configurations/defaults/presets/tools/sw_folders.json @@ -0,0 +1,8 @@ +{ + "compositing": ["nuke", "ae"], + "modeling": ["maya", "app2"], + "lookdev": ["substance"], + "animation": [], + "lighting": [], + "rigging": [] +} diff --git a/pype/configurations/defaults/presets/tools/workfiles.json b/pype/configurations/defaults/presets/tools/workfiles.json new file mode 100644 index 0000000000..393b2e3c10 --- /dev/null +++ b/pype/configurations/defaults/presets/tools/workfiles.json @@ -0,0 +1,7 @@ +{ + "last_workfile_on_startup": [ + { + "enabled": false + } + ] +} diff --git a/pype/configurations/defaults/presets/tray/menu_items.json b/pype/configurations/defaults/presets/tray/menu_items.json new file mode 100644 index 0000000000..6c6763848b --- /dev/null +++ b/pype/configurations/defaults/presets/tray/menu_items.json @@ -0,0 +1,28 @@ +{ + "item_usage": { + "User settings": false, + "Ftrack": true, + "Muster": false, + "Avalon": true, + "Clockify": false, + "Standalone Publish": true, + "Logging": true, + "Idle Manager": true, + "Timers Manager": true, + "Rest Api": true, + "Adobe Communicator": true + }, + "attributes": { + "Rest Api": { + "default_port": 8021, + "exclude_ports": [] + }, + "Timers Manager": { + "full_time": 15, + "message_time": 0.5 + }, + "Clockify": { + "workspace_name": null + } + } +} diff --git a/pype/configurations/defaults/presets/unreal/project_setup.json b/pype/configurations/defaults/presets/unreal/project_setup.json new file mode 100644 index 0000000000..8a4dffc526 --- /dev/null +++ b/pype/configurations/defaults/presets/unreal/project_setup.json @@ -0,0 +1,4 @@ +{ + "dev_mode": false, + "install_unreal_python_engine": false +} diff --git a/pype/configurations/defaults/project_configurations/plugins/celaction/publish.json b/pype/configurations/defaults/project_configurations/plugins/celaction/publish.json new file mode 100644 index 0000000000..fd1af23d84 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/celaction/publish.json @@ -0,0 +1,11 @@ +{ + "ExtractCelactionDeadline": { + "enabled": true, + "deadline_department": "", + "deadline_priority": 50, + "deadline_pool": "", + "deadline_pool_secondary": "", + "deadline_group": "", + "deadline_chunk_size": 10 + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/config.json b/pype/configurations/defaults/project_configurations/plugins/config.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/config.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json b/pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json new file mode 100644 index 0000000000..d8d93a36ee --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json @@ -0,0 +1,7 @@ +{ + "IntegrateFtrackNote": { + "enabled": false, + "note_with_intent_template": "{intent}: {comment}", + "note_labels": [] + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/global/create.json b/pype/configurations/defaults/project_configurations/plugins/global/create.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/global/create.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/project_configurations/plugins/global/filter.json b/pype/configurations/defaults/project_configurations/plugins/global/filter.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/global/filter.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/project_configurations/plugins/global/load.json b/pype/configurations/defaults/project_configurations/plugins/global/load.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/global/load.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/project_configurations/plugins/global/publish.json b/pype/configurations/defaults/project_configurations/plugins/global/publish.json new file mode 100644 index 0000000000..3c5de85e68 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/global/publish.json @@ -0,0 +1,97 @@ +{ + "IntegrateMasterVersion": { + "enabled": false + }, + "ExtractJpegEXR": { + "ffmpeg_args": { + "input": [ + "-gamma 2.2" + ], + "output": [] + } + }, + "ExtractReview": { + "enabled": true, + "profiles": [ + { + "families": [], + "hosts": [], + "outputs": { + "h264": { + "filter": { + "families": [ + "render", + "review", + "ftrack" + ] + }, + "ext": "mp4", + "ffmpeg_args": { + "input": [ + "-gamma 2.2" + ], + "video_filters": [], + "audio_filters": [], + "output": [ + "-pix_fmt yuv420p", + "-crf 18", + "-intra" + ] + }, + "tags": [ + "burnin", + "ftrackreview" + ] + } + } + } + ] + }, + "ExtractBurnin": { + "enabled": false, + "options": { + "font_size": 42, + "opacity": 1, + "bg_opacity": 0, + "x_offset": 5, + "y_offset": 5, + "bg_padding": 5 + }, + "fields": {}, + "profiles": [ + { + "burnins": { + "burnin": { + "TOP_LEFT": "{yy}-{mm}-{dd}", + "TOP_RIGHT": "{anatomy[version]}", + "TOP_CENTERED": "", + "BOTTOM_RIGHT": "{frame_start}-{current_frame}-{frame_end}", + "BOTTOM_CENTERED": "{asset}", + "BOTTOM_LEFT": "{username}" + } + } + } + ] + }, + "IntegrateAssetNew": { + "template_name_profiles": { + "publish": { + "families": [], + "tasks": [] + }, + "render": { + "families": [ + "review", + "render", + "prerender" + ] + } + } + }, + "ProcessSubmittedJobOnFarm": { + "enabled": false, + "deadline_department": "", + "deadline_pool": "", + "deadline_group": "" + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/create.json b/pype/configurations/defaults/project_configurations/plugins/maya/create.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/maya/create.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/filter.json b/pype/configurations/defaults/project_configurations/plugins/maya/filter.json new file mode 100644 index 0000000000..83d6f05f31 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/maya/filter.json @@ -0,0 +1,9 @@ +{ + "Preset n1": { + "ValidateNoAnimation": false, + "ValidateShapeDefaultNames": false + }, + "Preset n2": { + "ValidateNoAnimation": false + } +} diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/load.json b/pype/configurations/defaults/project_configurations/plugins/maya/load.json new file mode 100644 index 0000000000..260fbb35ee --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/maya/load.json @@ -0,0 +1,18 @@ +{ + "colors": { + "model": [0.821, 0.518, 0.117], + "rig": [0.144, 0.443, 0.463], + "pointcache": [0.368, 0.821, 0.117], + "animation": [0.368, 0.821, 0.117], + "ass": [1.0, 0.332, 0.312], + "camera": [0.447, 0.312, 1.0], + "fbx": [1.0, 0.931, 0.312], + "mayaAscii": [0.312, 1.0, 0.747], + "setdress": [0.312, 1.0, 0.747], + "layout": [0.312, 1.0, 0.747], + "vdbcache": [0.312, 1.0, 0.428], + "vrayproxy": [0.258, 0.95, 0.541], + "yeticache": [0.2, 0.8, 0.3], + "yetiRig": [0, 0.8, 0.5] + } +} diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/publish.json b/pype/configurations/defaults/project_configurations/plugins/maya/publish.json new file mode 100644 index 0000000000..2b3637ff80 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/maya/publish.json @@ -0,0 +1,17 @@ +{ + "ValidateModelName": { + "enabled": false, + "material_file": "/path/to/shader_name_definition.txt", + "regex": "(.*)_(\\d)*_(?P.*)_(GEO)" + }, + "ValidateAssemblyName": { + "enabled": false + }, + "ValidateShaderName": { + "enabled": false, + "regex": "(?P.*)_(.*)_SHD" + }, + "ValidateMeshHasOverlappingUVs": { + "enabled": false + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json b/pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json new file mode 100644 index 0000000000..443bc2cb2c --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json @@ -0,0 +1,136 @@ +[ + { + "tasks": [ + "lighting" + ], + "current_context": [ + { + "subset_name_filters": [ + ".+[Mm]ain" + ], + "families": [ + "model" + ], + "repre_names": [ + "abc", + "ma" + ], + "loaders": [ + "ReferenceLoader" + ] + }, + { + "families": [ + "animation", + "pointcache" + ], + "repre_names": [ + "abc" + ], + "loaders": [ + "ReferenceLoader" + ] + }, + { + "families": [ + "rendersetup" + ], + "repre_names": [ + "json" + ], + "loaders": [ + "RenderSetupLoader" + ] + }, + { + "families": [ + "camera" + ], + "repre_names": [ + "abc" + ], + "loaders": [ + "ReferenceLoader" + ] + } + ], + "linked_assets": [ + { + "families": [ + "setdress" + ], + "repre_names": [ + "ma" + ], + "loaders": [ + "ReferenceLoader" + ] + }, + { + "families": [ + "ass" + ], + "repre_names": [ + "ass" + ], + "loaders": [ + "assLoader" + ] + } + ] + }, + { + "tasks": [ + "animation" + ], + "current_context": [ + { + "families": [ + "camera" + ], + "repre_names": [ + "abc", + "ma" + ], + "loaders": [ + "ReferenceLoader" + ] + }, + { + "families": [ + "audio" + ], + "repre_names": [ + "wav" + ], + "loaders": [ + "RenderSetupLoader" + ] + } + ], + "linked_assets": [ + { + "families": [ + "setdress" + ], + "repre_names": [ + "proxy" + ], + "loaders": [ + "ReferenceLoader" + ] + }, + { + "families": [ + "rig" + ], + "repre_names": [ + "ass" + ], + "loaders": [ + "rigLoader" + ] + } + ] + } +] \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/create.json b/pype/configurations/defaults/project_configurations/plugins/nuke/create.json new file mode 100644 index 0000000000..79ab665696 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/nuke/create.json @@ -0,0 +1,8 @@ +{ + "CreateWriteRender": { + "fpath_template": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" + }, + "CreateWritePrerender": { + "fpath_template": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/load.json b/pype/configurations/defaults/project_configurations/plugins/nuke/load.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/nuke/load.json @@ -0,0 +1 @@ +{} diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/publish.json b/pype/configurations/defaults/project_configurations/plugins/nuke/publish.json new file mode 100644 index 0000000000..08a099a0a0 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/nuke/publish.json @@ -0,0 +1,53 @@ +{ + "ExtractThumbnail": { + "enabled": true, + "nodes": { + "Reformat": [ + [ + "type", + "to format" + ], + [ + "format", + "HD_1080" + ], + [ + "filter", + "Lanczos6" + ], + [ + "black_outside", + true + ], + [ + "pbb", + false + ] + ] + } + }, + "ValidateNukeWriteKnobs": { + "enabled": false, + "knobs": { + "render": { + "review": true + } + } + }, + "ExtractReviewDataLut": { + "enabled": false + }, + "ExtractReviewDataMov": { + "enabled": true, + "viewer_lut_raw": false + }, + "ExtractSlateFrame": { + "viewer_lut_raw": false + }, + "NukeSubmitDeadline": { + "deadline_priority": 50, + "deadline_pool": "", + "deadline_pool_secondary": "", + "deadline_chunk_size": 1 + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json b/pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json new file mode 100644 index 0000000000..4b48b46184 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json @@ -0,0 +1,23 @@ +[ + { + "tasks": [ + "compositing" + ], + "current_context": [ + { + "families": [ + "render", + "plate" + ], + "repre_names": [ + "exr", + "dpx" + ], + "loaders": [ + "LoadSequence" + ] + } + ], + "linked_assets": [] + } +] \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json b/pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json new file mode 100644 index 0000000000..bd6a0dc1bd --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json @@ -0,0 +1,10 @@ +{ + "strict": { + "ValidateVersion": true, + "VersionUpWorkfile": true + }, + "benevolent": { + "ValidateVersion": false, + "VersionUpWorkfile": false + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json b/pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json new file mode 100644 index 0000000000..d99a878c35 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json @@ -0,0 +1,9 @@ +{ + "CollectInstanceVersion": { + "enabled": false + }, + "ExtractReviewCutUpVideo": { + "enabled": true, + "tags_addition": [] + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/resolve/create.json b/pype/configurations/defaults/project_configurations/plugins/resolve/create.json new file mode 100644 index 0000000000..8ff5b15714 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/resolve/create.json @@ -0,0 +1,7 @@ +{ + "CreateShotClip": { + "clipName": "{track}{sequence}{shot}", + "folder": "takes", + "steps": 20 + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json b/pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json new file mode 100644 index 0000000000..2f1a3e7aca --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json @@ -0,0 +1,27 @@ +{ + "ExtractThumbnailSP": { + "ffmpeg_args": { + "input": [ + "-gamma 2.2" + ], + "output": [] + } + }, + "ExtractReviewSP": { + "outputs": { + "h264": { + "input": [ + "-gamma 2.2" + ], + "output": [ + "-pix_fmt yuv420p", + "-crf 18" + ], + "tags": [ + "preview" + ], + "ext": "mov" + } + } + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/test/create.json b/pype/configurations/defaults/project_configurations/plugins/test/create.json new file mode 100644 index 0000000000..fa0b2fc05f --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/test/create.json @@ -0,0 +1,8 @@ +{ + "MyTestCreator": { + "my_test_property": "B", + "active": false, + "new_property": "new", + "family": "new_family" + } +} diff --git a/pype/configurations/defaults/project_configurations/plugins/test/publish.json b/pype/configurations/defaults/project_configurations/plugins/test/publish.json new file mode 100644 index 0000000000..3180dd5d8a --- /dev/null +++ b/pype/configurations/defaults/project_configurations/plugins/test/publish.json @@ -0,0 +1,10 @@ +{ + "MyTestPlugin": { + "label": "loaded from preset", + "optional": true, + "families": ["changed", "by", "preset"] + }, + "MyTestRemovedPlugin": { + "enabled": false + } +} diff --git a/pype/configurations/defaults/studio_configurations/global/applications.json b/pype/configurations/defaults/studio_configurations/global/applications.json new file mode 100644 index 0000000000..8e27f11002 --- /dev/null +++ b/pype/configurations/defaults/studio_configurations/global/applications.json @@ -0,0 +1,39 @@ +{ + "blender_2.80": true, + "blender_2.81": true, + "blender_2.82": true, + "blender_2.83": true, + "celaction_local": true, + "celaction_remote": true, + "harmony_17": true, + "houdini_16": true, + "houdini_17": true, + "houdini_18": true, + "maya_2016": true, + "maya_2017": true, + "maya_2018": true, + "maya_2019": true, + "maya_2020": true, + "nukestudio_10.0": true, + "nukestudio_11.0": true, + "nukestudio_11.2": true, + "nukestudio_11.3": true, + "nukestudio_12.0": true, + "nukex_10.0": true, + "nukex_11.0": true, + "nukex_11.2": true, + "nukex_11.3": true, + "nukex_12.0": true, + "nuke_10.0": true, + "nuke_11.0": true, + "nuke_11.2": true, + "nuke_11.3": true, + "nuke_12.0": true, + "photoshop_2020": true, + "premiere_2019": true, + "premiere_2020": true, + "resolve_16": true, + "storyboardpro_7": true, + "unreal_4.24": true, + "houdini_16.5": false +} \ No newline at end of file diff --git a/pype/configurations/defaults/studio_configurations/global/intent.json b/pype/configurations/defaults/studio_configurations/global/intent.json new file mode 100644 index 0000000000..844bd1b518 --- /dev/null +++ b/pype/configurations/defaults/studio_configurations/global/intent.json @@ -0,0 +1,8 @@ +{ + "items": { + "wip": "WIP", + "test": "TEST", + "final": "FINAL" + }, + "default": "wip" +} \ No newline at end of file diff --git a/pype/configurations/defaults/studio_configurations/global/tools.json b/pype/configurations/defaults/studio_configurations/global/tools.json new file mode 100644 index 0000000000..93895c0e81 --- /dev/null +++ b/pype/configurations/defaults/studio_configurations/global/tools.json @@ -0,0 +1,6 @@ +{ + "mtoa_3.0.1": true, + "mtoa_3.1.1": true, + "mtoa_3.2.0": true, + "yeti_2.1.2": true +} \ No newline at end of file diff --git a/pype/configurations/defaults/studio_configurations/global/tray_modules.json b/pype/configurations/defaults/studio_configurations/global/tray_modules.json new file mode 100644 index 0000000000..0ff5b15552 --- /dev/null +++ b/pype/configurations/defaults/studio_configurations/global/tray_modules.json @@ -0,0 +1,28 @@ +{ + "item_usage": { + "User settings": false, + "Ftrack": true, + "Muster": false, + "Avalon": true, + "Clockify": false, + "Standalone Publish": true, + "Logging": true, + "Idle Manager": true, + "Timers Manager": true, + "Rest Api": true, + "Adobe Communicator": true + }, + "attributes": { + "Rest Api": { + "default_port": 8021, + "exclude_ports": [] + }, + "Timers Manager": { + "full_time": 15.0, + "message_time": 0.5 + }, + "Clockify": { + "workspace_name": "" + } + } +} \ No newline at end of file diff --git a/pype/configurations/defaults/studio_configurations/muster/templates_mapping.json b/pype/configurations/defaults/studio_configurations/muster/templates_mapping.json new file mode 100644 index 0000000000..0c09113515 --- /dev/null +++ b/pype/configurations/defaults/studio_configurations/muster/templates_mapping.json @@ -0,0 +1,19 @@ +{ + "3delight": 41, + "arnold": 46, + "arnold_sf": 57, + "gelato": 30, + "harware": 3, + "krakatoa": 51, + "file_layers": 7, + "mentalray": 2, + "mentalray_sf": 6, + "redshift": 55, + "renderman": 29, + "software": 1, + "software_sf": 5, + "turtle": 10, + "vector": 4, + "vray": 37, + "ffmpeg": 48 +} \ No newline at end of file diff --git a/pype/configurations/defaults/studio_configurations/standalone_publish/families.json b/pype/configurations/defaults/studio_configurations/standalone_publish/families.json new file mode 100644 index 0000000000..d05941cc26 --- /dev/null +++ b/pype/configurations/defaults/studio_configurations/standalone_publish/families.json @@ -0,0 +1,90 @@ +{ + "create_look": { + "name": "look", + "label": "Look", + "family": "look", + "icon": "paint-brush", + "defaults": ["Main"], + "help": "Shader connections defining shape look" + }, + "create_model": { + "name": "model", + "label": "Model", + "family": "model", + "icon": "cube", + "defaults": ["Main", "Proxy", "Sculpt"], + "help": "Polygonal static geometry" + }, + "create_workfile": { + "name": "workfile", + "label": "Workfile", + "family": "workfile", + "icon": "cube", + "defaults": ["Main"], + "help": "Working scene backup" + }, + "create_camera": { + "name": "camera", + "label": "Camera", + "family": "camera", + "icon": "video-camera", + "defaults": ["Main"], + "help": "Single baked camera" + }, + "create_pointcache": { + "name": "pointcache", + "label": "Pointcache", + "family": "pointcache", + "icon": "gears", + "defaults": ["Main"], + "help": "Alembic pointcache for animated data" + }, + "create_rig": { + "name": "rig", + "label": "Rig", + "family": "rig", + "icon": "wheelchair", + "defaults": ["Main"], + "help": "Artist-friendly rig with controls" + }, + "create_layout": { + "name": "layout", + "label": "Layout", + "family": "layout", + "icon": "cubes", + "defaults": ["Main"], + "help": "Simple scene for animators with camera" + }, + "create_plate": { + "name": "plate", + "label": "Plate", + "family": "plate", + "icon": "camera", + "defaults": ["Main", "BG", "Reference"], + "help": "Plates for compositors" + }, + "create_matchmove": { + "name": "matchmove", + "label": "Matchmove script", + "family": "matchmove", + "icon": "empire", + "defaults": ["Camera", "Object", "Mocap"], + "help": "Script exported from matchmoving application" + }, + "create_images": { + "name": "image", + "label": "Image file", + "family": "image", + "icon": "image", + "defaults": ["ConceptArt", "Reference", "Texture", "MattePaint"], + "help": "Holder for all kinds of image data" + }, + "create_editorial": { + "name": "editorial", + "label": "Editorial", + "family": "editorial", + "icon": "image", + "defaults": ["Main"], + "help": "Editorial files to generate shots." + } +} From 3e6cf0cdb8c329de03ef92b58cb6f467a75a8ec0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:34:14 +0200 Subject: [PATCH 355/507] basic reorganization of presets --- .../configurations/defaults/presets/init.json | 4 - .../presets/plugins/celaction/publish.json | 10 --- .../defaults/presets/plugins/config.json | 1 - .../presets/plugins/ftrack/publish.json | 6 -- .../presets/plugins/global/create.json | 1 - .../presets/plugins/global/filter.json | 1 - .../defaults/presets/plugins/global/load.json | 1 - .../presets/plugins/global/publish.json | 86 ------------------- .../defaults/presets/plugins/maya/create.json | 1 - .../defaults/presets/plugins/maya/filter.json | 9 -- .../defaults/presets/plugins/maya/load.json | 18 ---- .../presets/plugins/maya/publish.json | 17 ---- .../presets/plugins/maya/workfile_build.json | 54 ------------ .../defaults/presets/plugins/nuke/create.json | 8 -- .../defaults/presets/plugins/nuke/load.json | 1 - .../presets/plugins/nuke/publish.json | 48 ----------- .../presets/plugins/nuke/workfile_build.json | 11 --- .../presets/plugins/nukestudio/filter.json | 10 --- .../presets/plugins/nukestudio/publish.json | 8 -- .../presets/plugins/resolve/create.json | 7 -- .../plugins/standalonepublisher/publish.json | 25 ------ .../defaults/presets/plugins/test/create.json | 8 -- .../presets/plugins/test/publish.json | 10 --- .../defaults/presets/tools/pyblish.json | 17 ---- .../defaults/presets/tray/menu_items.json | 28 ------ .../anatomy/README.md | 0 .../anatomy/colorspace.json} | 0 .../anatomy}/colorspace/aces103-cg.json | 0 .../anatomy/dataflow.json} | 0 .../anatomy}/dataflow/aces-exr.json | 0 .../anatomy/default.yaml | 0 .../anatomy/roots.json | 0 .../anatomy/templates.json | 35 ++++++++ .../{plugins => }/celaction/publish.json | 0 .../{plugins => }/config.json | 0 .../ftrack/ftrack_config.json | 0 .../ftrack/ftrack_custom_attributes.json | 0 .../ftrack/partnership_ftrack_cred.json | 0 .../ftrack/plugins/server.json | 0 .../ftrack/plugins/user.json | 0 .../ftrack/project_defaults.json | 0 .../{plugins => }/ftrack/publish.json | 0 .../{plugins/maya => global}/create.json | 0 .../global}/creator.json | 0 .../{plugins => }/global/filter.json | 0 .../{plugins/nuke => global}/load.json | 0 .../global}/project_folder_structure.json | 0 .../{plugins => }/global/publish.json | 0 .../global}/sw_folders.json | 0 .../global}/workfiles.json | 0 .../maya/capture.json | 0 .../{plugins/global => maya}/create.json | 0 .../{plugins => }/maya/filter.json | 0 .../{plugins => }/maya/load.json | 0 .../{plugins => }/maya/publish.json | 0 .../{plugins => }/maya/workfile_build.json | 0 .../muster/templates_mapping.json | 0 .../{plugins => }/nuke/create.json | 0 .../{plugins/global => nuke}/load.json | 0 .../{plugins => }/nuke/publish.json | 0 .../{plugins => }/nuke/workfile_build.json | 0 .../{plugins => }/nukestudio/filter.json | 0 .../{plugins => }/nukestudio/publish.json | 0 .../nukestudio/tags.json | 0 .../premiere/asset_default.json | 0 .../premiere/rules_tasks.json | 0 .../{plugins => }/resolve/create.json | 0 .../standalonepublisher}/families.json | 0 .../standalonepublisher/publish.json | 0 .../{plugins => }/test/create.json | 0 .../{plugins => }/test/publish.json | 0 .../tools/slates/example_HD.json | 0 .../unreal/project_setup.json | 0 .../environments/avalon.json | 0 .../environments/blender.json | 0 .../environments/celaction.json | 0 .../environments/deadline.json | 0 .../environments/ftrack.json | 0 .../environments/global.json | 0 .../environments/harmony.json | 0 .../environments/houdini.json | 0 .../environments/maya.json | 0 .../environments/maya_2018.json | 0 .../environments/maya_2020.json | 0 .../environments/mayabatch.json | 0 .../environments/mayabatch_2019.json | 0 .../environments/mtoa_3.1.1.json | 0 .../environments/muster.json | 0 .../environments/nuke.json | 0 .../environments/nukestudio.json | 0 .../environments/nukestudio_10.0.json | 0 .../environments/nukex.json | 0 .../environments/nukex_10.0.json | 0 .../environments/photoshop.json | 0 .../environments/premiere.json | 0 .../environments/resolve.json | 0 .../environments/storyboardpro.json | 0 .../environments/unreal_4.24.json | 0 .../environments/vray_4300.json | 0 .../launchers/blender_2.80.toml | 0 .../launchers/blender_2.81.toml | 0 .../launchers/blender_2.82.toml | 0 .../launchers/blender_2.83.toml | 0 .../launchers/celaction_local.toml | 0 .../launchers/celaction_publish.toml | 0 .../launchers/darwin/blender_2.82 | 0 .../launchers/darwin/harmony_17 | 0 .../launchers/darwin/harmony_17_launch | 0 .../launchers/darwin/python3 | 0 .../launchers/harmony_17.toml | 0 .../launchers/houdini_16.toml | 0 .../launchers/houdini_17.toml | 0 .../launchers/houdini_18.toml | 0 .../launchers/linux/maya2016 | 0 .../launchers/linux/maya2017 | 0 .../launchers/linux/maya2018 | 0 .../launchers/linux/maya2019 | 0 .../launchers/linux/maya2020 | 0 .../launchers/linux/nuke11.3 | 0 .../launchers/linux/nuke12.0 | 0 .../launchers/linux/nukestudio11.3 | 0 .../launchers/linux/nukestudio12.0 | 0 .../launchers/linux/nukex11.3 | 0 .../launchers/linux/nukex12.0 | 0 .../launchers/maya_2016.toml | 0 .../launchers/maya_2017.toml | 0 .../launchers/maya_2018.toml | 0 .../launchers/maya_2019.toml | 0 .../launchers/maya_2020.toml | 0 .../launchers/mayabatch_2019.toml | 0 .../launchers/mayabatch_2020.toml | 0 .../launchers/mayapy2016.toml | 0 .../launchers/mayapy2017.toml | 0 .../launchers/mayapy2018.toml | 0 .../launchers/mayapy2019.toml | 0 .../launchers/mayapy2020.toml | 0 .../launchers/myapp.toml | 0 .../launchers/nuke_10.0.toml | 0 .../launchers/nuke_11.0.toml | 0 .../launchers/nuke_11.2.toml | 0 .../launchers/nuke_11.3.toml | 0 .../launchers/nuke_12.0.toml | 0 .../launchers/nukestudio_10.0.toml | 0 .../launchers/nukestudio_11.0.toml | 0 .../launchers/nukestudio_11.2.toml | 0 .../launchers/nukestudio_11.3.toml | 0 .../launchers/nukestudio_12.0.toml | 0 .../launchers/nukex_10.0.toml | 0 .../launchers/nukex_11.0.toml | 0 .../launchers/nukex_11.2.toml | 0 .../launchers/nukex_11.3.toml | 0 .../launchers/nukex_12.0.toml | 0 .../launchers/photoshop_2020.toml | 0 .../launchers/premiere_2019.toml | 0 .../launchers/premiere_2020.toml | 0 .../launchers/python_2.toml | 0 .../launchers/python_3.toml | 0 .../launchers/resolve_16.toml | 0 .../launchers/shell.toml | 0 .../launchers/storyboardpro_7.toml | 0 .../launchers/unreal_4.24.toml | 0 .../launchers/windows/blender_2.80.bat | 0 .../launchers/windows/blender_2.81.bat | 0 .../launchers/windows/blender_2.82.bat | 0 .../launchers/windows/blender_2.83.bat | 0 .../launchers/windows/celaction_local.bat | 0 .../launchers/windows/celaction_publish.bat | 0 .../launchers/windows/harmony_17.bat | 0 .../launchers/windows/houdini_16.bat | 0 .../launchers/windows/houdini_17.bat | 0 .../launchers/windows/houdini_18.bat | 0 .../launchers/windows/maya2016.bat | 0 .../launchers/windows/maya2017.bat | 0 .../launchers/windows/maya2018.bat | 0 .../launchers/windows/maya2019.bat | 0 .../launchers/windows/maya2020.bat | 0 .../launchers/windows/mayabatch2019.bat | 0 .../launchers/windows/mayabatch2020.bat | 0 .../launchers/windows/mayapy2016.bat | 0 .../launchers/windows/mayapy2017.bat | 0 .../launchers/windows/mayapy2018.bat | 0 .../launchers/windows/mayapy2019.bat | 0 .../launchers/windows/mayapy2020.bat | 0 .../launchers/windows/nuke10.0.bat | 0 .../launchers/windows/nuke11.0.bat | 0 .../launchers/windows/nuke11.2.bat | 0 .../launchers/windows/nuke11.3.bat | 0 .../launchers/windows/nuke12.0.bat | 0 .../launchers/windows/nukestudio10.0.bat | 0 .../launchers/windows/nukestudio11.0.bat | 0 .../launchers/windows/nukestudio11.2.bat | 0 .../launchers/windows/nukestudio11.3.bat | 0 .../launchers/windows/nukestudio12.0.bat | 0 .../launchers/windows/nukex10.0.bat | 0 .../launchers/windows/nukex11.0.bat | 0 .../launchers/windows/nukex11.2.bat | 0 .../launchers/windows/nukex11.3.bat | 0 .../launchers/windows/nukex12.0.bat | 0 .../launchers/windows/photoshop_2020.bat | 0 .../launchers/windows/premiere_pro_2019.bat | 0 .../launchers/windows/premiere_pro_2020.bat | 0 .../launchers/windows/python3.bat | 0 .../launchers/windows/resolve_16.bat | 0 .../launchers/windows/shell.bat | 0 .../launchers/windows/storyboardpro_7.bat | 0 .../launchers/windows/unreal.bat | 0 206 files changed, 35 insertions(+), 390 deletions(-) delete mode 100644 pype/configurations/defaults/presets/init.json delete mode 100644 pype/configurations/defaults/presets/plugins/celaction/publish.json delete mode 100644 pype/configurations/defaults/presets/plugins/config.json delete mode 100644 pype/configurations/defaults/presets/plugins/ftrack/publish.json delete mode 100644 pype/configurations/defaults/presets/plugins/global/create.json delete mode 100644 pype/configurations/defaults/presets/plugins/global/filter.json delete mode 100644 pype/configurations/defaults/presets/plugins/global/load.json delete mode 100644 pype/configurations/defaults/presets/plugins/global/publish.json delete mode 100644 pype/configurations/defaults/presets/plugins/maya/create.json delete mode 100644 pype/configurations/defaults/presets/plugins/maya/filter.json delete mode 100644 pype/configurations/defaults/presets/plugins/maya/load.json delete mode 100644 pype/configurations/defaults/presets/plugins/maya/publish.json delete mode 100644 pype/configurations/defaults/presets/plugins/maya/workfile_build.json delete mode 100644 pype/configurations/defaults/presets/plugins/nuke/create.json delete mode 100644 pype/configurations/defaults/presets/plugins/nuke/load.json delete mode 100644 pype/configurations/defaults/presets/plugins/nuke/publish.json delete mode 100644 pype/configurations/defaults/presets/plugins/nuke/workfile_build.json delete mode 100644 pype/configurations/defaults/presets/plugins/nukestudio/filter.json delete mode 100644 pype/configurations/defaults/presets/plugins/nukestudio/publish.json delete mode 100644 pype/configurations/defaults/presets/plugins/resolve/create.json delete mode 100644 pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json delete mode 100644 pype/configurations/defaults/presets/plugins/test/create.json delete mode 100644 pype/configurations/defaults/presets/plugins/test/publish.json delete mode 100644 pype/configurations/defaults/presets/tools/pyblish.json delete mode 100644 pype/configurations/defaults/presets/tray/menu_items.json rename pype/configurations/defaults/{ => project_configurations}/anatomy/README.md (100%) rename pype/configurations/defaults/{presets/colorspace/default.json => project_configurations/anatomy/colorspace.json} (100%) rename pype/configurations/defaults/{presets => project_configurations/anatomy}/colorspace/aces103-cg.json (100%) rename pype/configurations/defaults/{presets/dataflow/default.json => project_configurations/anatomy/dataflow.json} (100%) rename pype/configurations/defaults/{presets => project_configurations/anatomy}/dataflow/aces-exr.json (100%) rename pype/configurations/defaults/{ => project_configurations}/anatomy/default.yaml (100%) rename pype/configurations/defaults/{ => project_configurations}/anatomy/roots.json (100%) create mode 100644 pype/configurations/defaults/project_configurations/anatomy/templates.json rename pype/configurations/defaults/project_configurations/{plugins => }/celaction/publish.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/config.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/ftrack/ftrack_config.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/ftrack/ftrack_custom_attributes.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/ftrack/partnership_ftrack_cred.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/ftrack/plugins/server.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/ftrack/plugins/user.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/ftrack/project_defaults.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/ftrack/publish.json (100%) rename pype/configurations/defaults/project_configurations/{plugins/maya => global}/create.json (100%) rename pype/configurations/defaults/{presets/tools => project_configurations/global}/creator.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/global/filter.json (100%) rename pype/configurations/defaults/project_configurations/{plugins/nuke => global}/load.json (100%) rename pype/configurations/defaults/{presets/tools => project_configurations/global}/project_folder_structure.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/global/publish.json (100%) rename pype/configurations/defaults/{presets/tools => project_configurations/global}/sw_folders.json (100%) rename pype/configurations/defaults/{presets/tools => project_configurations/global}/workfiles.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/maya/capture.json (100%) rename pype/configurations/defaults/project_configurations/{plugins/global => maya}/create.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/maya/filter.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/maya/load.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/maya/publish.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/maya/workfile_build.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/muster/templates_mapping.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/nuke/create.json (100%) rename pype/configurations/defaults/project_configurations/{plugins/global => nuke}/load.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/nuke/publish.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/nuke/workfile_build.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/nukestudio/filter.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/nukestudio/publish.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/nukestudio/tags.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/premiere/asset_default.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/premiere/rules_tasks.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/resolve/create.json (100%) rename pype/configurations/defaults/{presets/standalone_publish => project_configurations/standalonepublisher}/families.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/standalonepublisher/publish.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/test/create.json (100%) rename pype/configurations/defaults/project_configurations/{plugins => }/test/publish.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/tools/slates/example_HD.json (100%) rename pype/configurations/defaults/{presets => project_configurations}/unreal/project_setup.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/avalon.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/blender.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/celaction.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/deadline.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/ftrack.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/global.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/harmony.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/houdini.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/maya.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/maya_2018.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/maya_2020.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/mayabatch.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/mayabatch_2019.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/mtoa_3.1.1.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/muster.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/nuke.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/nukestudio.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/nukestudio_10.0.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/nukex.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/nukex_10.0.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/photoshop.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/premiere.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/resolve.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/storyboardpro.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/unreal_4.24.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/environments/vray_4300.json (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/blender_2.80.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/blender_2.81.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/blender_2.82.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/blender_2.83.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/celaction_local.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/celaction_publish.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/darwin/blender_2.82 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/darwin/harmony_17 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/darwin/harmony_17_launch (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/darwin/python3 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/harmony_17.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/houdini_16.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/houdini_17.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/houdini_18.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/maya2016 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/maya2017 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/maya2018 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/maya2019 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/maya2020 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/nuke11.3 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/nuke12.0 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/nukestudio11.3 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/nukestudio12.0 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/nukex11.3 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/linux/nukex12.0 (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/maya_2016.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/maya_2017.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/maya_2018.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/maya_2019.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/maya_2020.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/mayabatch_2019.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/mayabatch_2020.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/mayapy2016.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/mayapy2017.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/mayapy2018.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/mayapy2019.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/mayapy2020.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/myapp.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nuke_10.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nuke_11.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nuke_11.2.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nuke_11.3.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nuke_12.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukestudio_10.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukestudio_11.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukestudio_11.2.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukestudio_11.3.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukestudio_12.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukex_10.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukex_11.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukex_11.2.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukex_11.3.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/nukex_12.0.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/photoshop_2020.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/premiere_2019.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/premiere_2020.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/python_2.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/python_3.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/resolve_16.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/shell.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/storyboardpro_7.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/unreal_4.24.toml (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/blender_2.80.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/blender_2.81.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/blender_2.82.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/blender_2.83.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/celaction_local.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/celaction_publish.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/harmony_17.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/houdini_16.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/houdini_17.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/houdini_18.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/maya2016.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/maya2017.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/maya2018.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/maya2019.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/maya2020.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/mayabatch2019.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/mayabatch2020.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/mayapy2016.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/mayapy2017.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/mayapy2018.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/mayapy2019.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/mayapy2020.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nuke10.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nuke11.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nuke11.2.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nuke11.3.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nuke12.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukestudio10.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukestudio11.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukestudio11.2.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukestudio11.3.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukestudio12.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukex10.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukex11.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukex11.2.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukex11.3.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/nukex12.0.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/photoshop_2020.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/premiere_pro_2019.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/premiere_pro_2020.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/python3.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/resolve_16.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/shell.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/storyboardpro_7.bat (100%) rename pype/configurations/defaults/{ => studio_configurations}/launchers/windows/unreal.bat (100%) diff --git a/pype/configurations/defaults/presets/init.json b/pype/configurations/defaults/presets/init.json deleted file mode 100644 index 361ee7445b..0000000000 --- a/pype/configurations/defaults/presets/init.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "colorspace": "default", - "dataflow": "default" -} diff --git a/pype/configurations/defaults/presets/plugins/celaction/publish.json b/pype/configurations/defaults/presets/plugins/celaction/publish.json deleted file mode 100644 index e791f574d9..0000000000 --- a/pype/configurations/defaults/presets/plugins/celaction/publish.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ExtractCelactionDeadline": { - "deadline_department": "", - "deadline_priority": 50, - "deadline_pool": "", - "deadline_pool_secondary": "", - "deadline_group": "", - "deadline_chunk_size": 10 - } -} diff --git a/pype/configurations/defaults/presets/plugins/config.json b/pype/configurations/defaults/presets/plugins/config.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/pype/configurations/defaults/presets/plugins/config.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/pype/configurations/defaults/presets/plugins/ftrack/publish.json b/pype/configurations/defaults/presets/plugins/ftrack/publish.json deleted file mode 100644 index d0469ae4f7..0000000000 --- a/pype/configurations/defaults/presets/plugins/ftrack/publish.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "IntegrateFtrackNote": { - "note_with_intent_template": "{intent}: {comment}", - "note_labels": [] - } -} diff --git a/pype/configurations/defaults/presets/plugins/global/create.json b/pype/configurations/defaults/presets/plugins/global/create.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/configurations/defaults/presets/plugins/global/create.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/configurations/defaults/presets/plugins/global/filter.json b/pype/configurations/defaults/presets/plugins/global/filter.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/configurations/defaults/presets/plugins/global/filter.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/configurations/defaults/presets/plugins/global/load.json b/pype/configurations/defaults/presets/plugins/global/load.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/configurations/defaults/presets/plugins/global/load.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/configurations/defaults/presets/plugins/global/publish.json b/pype/configurations/defaults/presets/plugins/global/publish.json deleted file mode 100644 index 016868fc92..0000000000 --- a/pype/configurations/defaults/presets/plugins/global/publish.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "IntegrateMasterVersion": { - "enabled": false - }, - "ExtractJpegEXR": { - "ffmpeg_args": { - "input": [ - "-gamma 2.2" - ], - "output": [] - } - }, - "ExtractReview": { - "__documentation__": "http://pype.club/docs/admin_presets_plugins", - "profiles": [ - { - "families": [], - "hosts": [], - "outputs": { - "h264": { - "filter": { - "families": ["render", "review", "ftrack"] - }, - "ext": "mp4", - "ffmpeg_args": { - "input": [ - "-gamma 2.2" - ], - "video_filters": [], - "audio_filters": [], - "output": [ - "-pix_fmt yuv420p", - "-crf 18", - "-intra" - ] - }, - "tags": ["burnin", "ftrackreview"] - } - } - } - ] - }, - "ExtractBurnin": { - "options": { - "opacity": 1, - "x_offset": 5, - "y_offset": 5, - "bg_padding": 5, - "bg_opacity": 0.5, - "font_size": 42 - }, - "fields": { - - }, - "profiles": [ - { - "burnins": { - "burnin": { - "TOP_LEFT": "{yy}-{mm}-{dd}", - "TOP_RIGHT": "{anatomy[version]}", - "TOP_CENTERED": "", - "BOTTOM_RIGHT": "{frame_start}-{current_frame}-{frame_end}", - "BOTTOM_CENTERED": "{asset}", - "BOTTOM_LEFT": "{username}" - } - } - } - ] - }, - "IntegrateAssetNew": { - "template_name_profiles": { - "publish": { - "families": [], - "tasks": [] - }, - "render": { - "families": ["review", "render", "prerender"] - } - } - }, - "ProcessSubmittedJobOnFarm": { - "deadline_department": "", - "deadline_pool": "", - "deadline_group": "" - } -} diff --git a/pype/configurations/defaults/presets/plugins/maya/create.json b/pype/configurations/defaults/presets/plugins/maya/create.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/configurations/defaults/presets/plugins/maya/create.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/configurations/defaults/presets/plugins/maya/filter.json b/pype/configurations/defaults/presets/plugins/maya/filter.json deleted file mode 100644 index 83d6f05f31..0000000000 --- a/pype/configurations/defaults/presets/plugins/maya/filter.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Preset n1": { - "ValidateNoAnimation": false, - "ValidateShapeDefaultNames": false - }, - "Preset n2": { - "ValidateNoAnimation": false - } -} diff --git a/pype/configurations/defaults/presets/plugins/maya/load.json b/pype/configurations/defaults/presets/plugins/maya/load.json deleted file mode 100644 index 260fbb35ee..0000000000 --- a/pype/configurations/defaults/presets/plugins/maya/load.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "colors": { - "model": [0.821, 0.518, 0.117], - "rig": [0.144, 0.443, 0.463], - "pointcache": [0.368, 0.821, 0.117], - "animation": [0.368, 0.821, 0.117], - "ass": [1.0, 0.332, 0.312], - "camera": [0.447, 0.312, 1.0], - "fbx": [1.0, 0.931, 0.312], - "mayaAscii": [0.312, 1.0, 0.747], - "setdress": [0.312, 1.0, 0.747], - "layout": [0.312, 1.0, 0.747], - "vdbcache": [0.312, 1.0, 0.428], - "vrayproxy": [0.258, 0.95, 0.541], - "yeticache": [0.2, 0.8, 0.3], - "yetiRig": [0, 0.8, 0.5] - } -} diff --git a/pype/configurations/defaults/presets/plugins/maya/publish.json b/pype/configurations/defaults/presets/plugins/maya/publish.json deleted file mode 100644 index 2e2b3164f3..0000000000 --- a/pype/configurations/defaults/presets/plugins/maya/publish.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "ValidateModelName": { - "enabled": false, - "material_file": "/path/to/shader_name_definition.txt", - "regex": "(.*)_(\\d)*_(?P.*)_(GEO)" - }, - "ValidateAssemblyName": { - "enabled": false - }, - "ValidateShaderName": { - "enabled": false, - "regex": "(?P.*)_(.*)_SHD" - }, - "ValidateMeshHasOverlappingUVs": { - "enabled": false - } -} diff --git a/pype/configurations/defaults/presets/plugins/maya/workfile_build.json b/pype/configurations/defaults/presets/plugins/maya/workfile_build.json deleted file mode 100644 index 2872b783cb..0000000000 --- a/pype/configurations/defaults/presets/plugins/maya/workfile_build.json +++ /dev/null @@ -1,54 +0,0 @@ -[{ - "tasks": ["lighting"], - - "current_context": [{ - "subset_name_filters": [".+[Mm]ain"], - "families": ["model"], - "repre_names": ["abc", "ma"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["animation", "pointcache"], - "repre_names": ["abc"], - "loaders": ["ReferenceLoader"] - },{ - "families": ["rendersetup"], - "repre_names": ["json"], - "loaders": ["RenderSetupLoader"] - }, { - "families": ["camera"], - "repre_names": ["abc"], - "loaders": ["ReferenceLoader"] - }], - - "linked_assets": [{ - "families": ["setdress"], - "repre_names": ["ma"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["ass"], - "repre_names": ["ass"], - "loaders":["assLoader"] - }] -}, { - "tasks": ["animation"], - - "current_context": [{ - "families": ["camera"], - "repre_names": ["abc", "ma"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["audio"], - "repre_names": ["wav"], - "loaders": ["RenderSetupLoader"] - }], - - "linked_assets": [{ - "families": ["setdress"], - "repre_names": ["proxy"], - "loaders": ["ReferenceLoader"] - }, { - "families": ["rig"], - "repre_names": ["ass"], - "loaders": ["rigLoader"] - }] -}] diff --git a/pype/configurations/defaults/presets/plugins/nuke/create.json b/pype/configurations/defaults/presets/plugins/nuke/create.json deleted file mode 100644 index 4deb0b4ad5..0000000000 --- a/pype/configurations/defaults/presets/plugins/nuke/create.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CreateWriteRender": { - "fpath_template": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" - }, - "CreateWritePrerender": { - "fpath_template": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" - } -} diff --git a/pype/configurations/defaults/presets/plugins/nuke/load.json b/pype/configurations/defaults/presets/plugins/nuke/load.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/pype/configurations/defaults/presets/plugins/nuke/load.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pype/configurations/defaults/presets/plugins/nuke/publish.json b/pype/configurations/defaults/presets/plugins/nuke/publish.json deleted file mode 100644 index ab0d0e76a5..0000000000 --- a/pype/configurations/defaults/presets/plugins/nuke/publish.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "ExtractThumbnail": { - "nodes": { - "Reformat": [ - ["type", "to format"], - ["format", "HD_1080"], - ["filter", "Lanczos6"], - ["black_outside", true], - ["pbb", false] - ] - } - }, - "ValidateNukeWriteKnobs": { - "enabled": false, - "knobs": { - "render": { - "review": true - } - } - }, - "ExtractReviewDataLut": { - "__documentation__": { - "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", - "enabled": "keep in on `false` if you want Nuke baking colorspace workflow applied else FFmpeg will convert imgsequence with baked LUT" - }, - "enabled": false - }, - "ExtractReviewDataMov": { - "__documentation__": { - "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`", - "enabled": "keep in on `true` if you want Nuke baking colorspace workflow applied" - }, - "enabled": true, - "viewer_lut_raw": false - }, - "ExtractSlateFrame": { - "__documentation__": { - "viewer_lut_raw": "set to `true` if you Input_process node on viewer is used with baked screen space, so you have to look with RAW viewer lut. Else just keep it on `false`" - }, - "viewer_lut_raw": false - }, - "NukeSubmitDeadline": { - "deadline_priority": 50, - "deadline_pool": "", - "deadline_pool_secondary": "", - "deadline_chunk_size": 1 - } -} diff --git a/pype/configurations/defaults/presets/plugins/nuke/workfile_build.json b/pype/configurations/defaults/presets/plugins/nuke/workfile_build.json deleted file mode 100644 index d3613c929e..0000000000 --- a/pype/configurations/defaults/presets/plugins/nuke/workfile_build.json +++ /dev/null @@ -1,11 +0,0 @@ -[{ - "tasks": ["compositing"], - - "current_context": [{ - "families": ["render", "plate"], - "repre_names": ["exr" ,"dpx"], - "loaders": ["LoadSequence"] - }], - - "linked_assets": [] -}] diff --git a/pype/configurations/defaults/presets/plugins/nukestudio/filter.json b/pype/configurations/defaults/presets/plugins/nukestudio/filter.json deleted file mode 100644 index bd6a0dc1bd..0000000000 --- a/pype/configurations/defaults/presets/plugins/nukestudio/filter.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "strict": { - "ValidateVersion": true, - "VersionUpWorkfile": true - }, - "benevolent": { - "ValidateVersion": false, - "VersionUpWorkfile": false - } -} \ No newline at end of file diff --git a/pype/configurations/defaults/presets/plugins/nukestudio/publish.json b/pype/configurations/defaults/presets/plugins/nukestudio/publish.json deleted file mode 100644 index 8c4ad133f1..0000000000 --- a/pype/configurations/defaults/presets/plugins/nukestudio/publish.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CollectInstanceVersion": { - "enabled": false - }, - "ExtractReviewCutUpVideo": { - "tags_addition": [] - } -} diff --git a/pype/configurations/defaults/presets/plugins/resolve/create.json b/pype/configurations/defaults/presets/plugins/resolve/create.json deleted file mode 100644 index 29ca5900fb..0000000000 --- a/pype/configurations/defaults/presets/plugins/resolve/create.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "CreateShotClip": { - "clipName": "{track}{sequence}{shot}", - "folder": "takes", - "steps": 20 - } -} diff --git a/pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json b/pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json deleted file mode 100644 index 2b2fb660c2..0000000000 --- a/pype/configurations/defaults/presets/plugins/standalonepublisher/publish.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "ExtractThumbnailSP": { - "ffmpeg_args": { - "input": [ - "-gamma 2.2" - ], - "output": [] - } - }, - "ExtractReviewSP": { - "outputs": { - "h264": { - "input": [ - "-gamma 2.2" - ], - "output": [ - "-pix_fmt yuv420p", - "-crf 18" - ], - "tags": ["preview"], - "ext": "mov" - } - } - } -} diff --git a/pype/configurations/defaults/presets/plugins/test/create.json b/pype/configurations/defaults/presets/plugins/test/create.json deleted file mode 100644 index fa0b2fc05f..0000000000 --- a/pype/configurations/defaults/presets/plugins/test/create.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "MyTestCreator": { - "my_test_property": "B", - "active": false, - "new_property": "new", - "family": "new_family" - } -} diff --git a/pype/configurations/defaults/presets/plugins/test/publish.json b/pype/configurations/defaults/presets/plugins/test/publish.json deleted file mode 100644 index 3180dd5d8a..0000000000 --- a/pype/configurations/defaults/presets/plugins/test/publish.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "MyTestPlugin": { - "label": "loaded from preset", - "optional": true, - "families": ["changed", "by", "preset"] - }, - "MyTestRemovedPlugin": { - "enabled": false - } -} diff --git a/pype/configurations/defaults/presets/tools/pyblish.json b/pype/configurations/defaults/presets/tools/pyblish.json deleted file mode 100644 index e81932ec45..0000000000 --- a/pype/configurations/defaults/presets/tools/pyblish.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "ui": { - "intents": { - "__description__": [ - "In items you can specify {label: value} of intents", - "`default` may be used for setting default value." - ], - "default": "wip", - "items": { - "": "", - "wip": "WIP", - "test": "TEST", - "final": "FINAL" - } - } - } -} diff --git a/pype/configurations/defaults/presets/tray/menu_items.json b/pype/configurations/defaults/presets/tray/menu_items.json deleted file mode 100644 index 6c6763848b..0000000000 --- a/pype/configurations/defaults/presets/tray/menu_items.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "item_usage": { - "User settings": false, - "Ftrack": true, - "Muster": false, - "Avalon": true, - "Clockify": false, - "Standalone Publish": true, - "Logging": true, - "Idle Manager": true, - "Timers Manager": true, - "Rest Api": true, - "Adobe Communicator": true - }, - "attributes": { - "Rest Api": { - "default_port": 8021, - "exclude_ports": [] - }, - "Timers Manager": { - "full_time": 15, - "message_time": 0.5 - }, - "Clockify": { - "workspace_name": null - } - } -} diff --git a/pype/configurations/defaults/anatomy/README.md b/pype/configurations/defaults/project_configurations/anatomy/README.md similarity index 100% rename from pype/configurations/defaults/anatomy/README.md rename to pype/configurations/defaults/project_configurations/anatomy/README.md diff --git a/pype/configurations/defaults/presets/colorspace/default.json b/pype/configurations/defaults/project_configurations/anatomy/colorspace.json similarity index 100% rename from pype/configurations/defaults/presets/colorspace/default.json rename to pype/configurations/defaults/project_configurations/anatomy/colorspace.json diff --git a/pype/configurations/defaults/presets/colorspace/aces103-cg.json b/pype/configurations/defaults/project_configurations/anatomy/colorspace/aces103-cg.json similarity index 100% rename from pype/configurations/defaults/presets/colorspace/aces103-cg.json rename to pype/configurations/defaults/project_configurations/anatomy/colorspace/aces103-cg.json diff --git a/pype/configurations/defaults/presets/dataflow/default.json b/pype/configurations/defaults/project_configurations/anatomy/dataflow.json similarity index 100% rename from pype/configurations/defaults/presets/dataflow/default.json rename to pype/configurations/defaults/project_configurations/anatomy/dataflow.json diff --git a/pype/configurations/defaults/presets/dataflow/aces-exr.json b/pype/configurations/defaults/project_configurations/anatomy/dataflow/aces-exr.json similarity index 100% rename from pype/configurations/defaults/presets/dataflow/aces-exr.json rename to pype/configurations/defaults/project_configurations/anatomy/dataflow/aces-exr.json diff --git a/pype/configurations/defaults/anatomy/default.yaml b/pype/configurations/defaults/project_configurations/anatomy/default.yaml similarity index 100% rename from pype/configurations/defaults/anatomy/default.yaml rename to pype/configurations/defaults/project_configurations/anatomy/default.yaml diff --git a/pype/configurations/defaults/anatomy/roots.json b/pype/configurations/defaults/project_configurations/anatomy/roots.json similarity index 100% rename from pype/configurations/defaults/anatomy/roots.json rename to pype/configurations/defaults/project_configurations/anatomy/roots.json diff --git a/pype/configurations/defaults/project_configurations/anatomy/templates.json b/pype/configurations/defaults/project_configurations/anatomy/templates.json new file mode 100644 index 0000000000..23e9f308f2 --- /dev/null +++ b/pype/configurations/defaults/project_configurations/anatomy/templates.json @@ -0,0 +1,35 @@ +{ + "version_padding": 3, + "version": "v{version:0>{@version_padding}}", + "frame_padding": 4, + "frame": "{frame:0>{@frame_padding}}", + + "work": { + "folder": "{root}/{project[name]}/{hierarchy}/{asset}/work/{task}", + "file": "{project[code]}_{asset}_{task}_{@version}<_{comment}>.{ext}", + "path": "{@folder}/{@file}" + }, + + "render": { + "folder": "{root}/{project[name]}/{hierarchy}/{asset}/publish/render/{subset}/{@version}", + "file": "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}", + "path": "{@folder}/{@file}" + }, + + "texture": { + "path": "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}" + }, + + "publish": { + "folder": "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/{@version}", + "file": "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}", + "path": "{@folder}/{@file}", + "thumbnail": "{thumbnail_root}/{project[name]}/{_id}_{thumbnail_type}{ext}" + }, + + "master": { + "folder": "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/master", + "file": "{project[code]}_{asset}_{subset}_master<_{output}><.{frame}>.{representation}", + "path": "{@folder}/{@file}" + } +} diff --git a/pype/configurations/defaults/project_configurations/plugins/celaction/publish.json b/pype/configurations/defaults/project_configurations/celaction/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/celaction/publish.json rename to pype/configurations/defaults/project_configurations/celaction/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/config.json b/pype/configurations/defaults/project_configurations/config.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/config.json rename to pype/configurations/defaults/project_configurations/config.json diff --git a/pype/configurations/defaults/presets/ftrack/ftrack_config.json b/pype/configurations/defaults/project_configurations/ftrack/ftrack_config.json similarity index 100% rename from pype/configurations/defaults/presets/ftrack/ftrack_config.json rename to pype/configurations/defaults/project_configurations/ftrack/ftrack_config.json diff --git a/pype/configurations/defaults/presets/ftrack/ftrack_custom_attributes.json b/pype/configurations/defaults/project_configurations/ftrack/ftrack_custom_attributes.json similarity index 100% rename from pype/configurations/defaults/presets/ftrack/ftrack_custom_attributes.json rename to pype/configurations/defaults/project_configurations/ftrack/ftrack_custom_attributes.json diff --git a/pype/configurations/defaults/presets/ftrack/partnership_ftrack_cred.json b/pype/configurations/defaults/project_configurations/ftrack/partnership_ftrack_cred.json similarity index 100% rename from pype/configurations/defaults/presets/ftrack/partnership_ftrack_cred.json rename to pype/configurations/defaults/project_configurations/ftrack/partnership_ftrack_cred.json diff --git a/pype/configurations/defaults/presets/ftrack/plugins/server.json b/pype/configurations/defaults/project_configurations/ftrack/plugins/server.json similarity index 100% rename from pype/configurations/defaults/presets/ftrack/plugins/server.json rename to pype/configurations/defaults/project_configurations/ftrack/plugins/server.json diff --git a/pype/configurations/defaults/presets/ftrack/plugins/user.json b/pype/configurations/defaults/project_configurations/ftrack/plugins/user.json similarity index 100% rename from pype/configurations/defaults/presets/ftrack/plugins/user.json rename to pype/configurations/defaults/project_configurations/ftrack/plugins/user.json diff --git a/pype/configurations/defaults/presets/ftrack/project_defaults.json b/pype/configurations/defaults/project_configurations/ftrack/project_defaults.json similarity index 100% rename from pype/configurations/defaults/presets/ftrack/project_defaults.json rename to pype/configurations/defaults/project_configurations/ftrack/project_defaults.json diff --git a/pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json b/pype/configurations/defaults/project_configurations/ftrack/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json rename to pype/configurations/defaults/project_configurations/ftrack/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/create.json b/pype/configurations/defaults/project_configurations/global/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/create.json rename to pype/configurations/defaults/project_configurations/global/create.json diff --git a/pype/configurations/defaults/presets/tools/creator.json b/pype/configurations/defaults/project_configurations/global/creator.json similarity index 100% rename from pype/configurations/defaults/presets/tools/creator.json rename to pype/configurations/defaults/project_configurations/global/creator.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/filter.json b/pype/configurations/defaults/project_configurations/global/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/filter.json rename to pype/configurations/defaults/project_configurations/global/filter.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/load.json b/pype/configurations/defaults/project_configurations/global/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/load.json rename to pype/configurations/defaults/project_configurations/global/load.json diff --git a/pype/configurations/defaults/presets/tools/project_folder_structure.json b/pype/configurations/defaults/project_configurations/global/project_folder_structure.json similarity index 100% rename from pype/configurations/defaults/presets/tools/project_folder_structure.json rename to pype/configurations/defaults/project_configurations/global/project_folder_structure.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/publish.json b/pype/configurations/defaults/project_configurations/global/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/publish.json rename to pype/configurations/defaults/project_configurations/global/publish.json diff --git a/pype/configurations/defaults/presets/tools/sw_folders.json b/pype/configurations/defaults/project_configurations/global/sw_folders.json similarity index 100% rename from pype/configurations/defaults/presets/tools/sw_folders.json rename to pype/configurations/defaults/project_configurations/global/sw_folders.json diff --git a/pype/configurations/defaults/presets/tools/workfiles.json b/pype/configurations/defaults/project_configurations/global/workfiles.json similarity index 100% rename from pype/configurations/defaults/presets/tools/workfiles.json rename to pype/configurations/defaults/project_configurations/global/workfiles.json diff --git a/pype/configurations/defaults/presets/maya/capture.json b/pype/configurations/defaults/project_configurations/maya/capture.json similarity index 100% rename from pype/configurations/defaults/presets/maya/capture.json rename to pype/configurations/defaults/project_configurations/maya/capture.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/create.json b/pype/configurations/defaults/project_configurations/maya/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/create.json rename to pype/configurations/defaults/project_configurations/maya/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/filter.json b/pype/configurations/defaults/project_configurations/maya/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/filter.json rename to pype/configurations/defaults/project_configurations/maya/filter.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/load.json b/pype/configurations/defaults/project_configurations/maya/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/load.json rename to pype/configurations/defaults/project_configurations/maya/load.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/publish.json b/pype/configurations/defaults/project_configurations/maya/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/publish.json rename to pype/configurations/defaults/project_configurations/maya/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json b/pype/configurations/defaults/project_configurations/maya/workfile_build.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json rename to pype/configurations/defaults/project_configurations/maya/workfile_build.json diff --git a/pype/configurations/defaults/presets/muster/templates_mapping.json b/pype/configurations/defaults/project_configurations/muster/templates_mapping.json similarity index 100% rename from pype/configurations/defaults/presets/muster/templates_mapping.json rename to pype/configurations/defaults/project_configurations/muster/templates_mapping.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/create.json b/pype/configurations/defaults/project_configurations/nuke/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/create.json rename to pype/configurations/defaults/project_configurations/nuke/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/load.json b/pype/configurations/defaults/project_configurations/nuke/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/load.json rename to pype/configurations/defaults/project_configurations/nuke/load.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/publish.json b/pype/configurations/defaults/project_configurations/nuke/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/publish.json rename to pype/configurations/defaults/project_configurations/nuke/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json b/pype/configurations/defaults/project_configurations/nuke/workfile_build.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json rename to pype/configurations/defaults/project_configurations/nuke/workfile_build.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json b/pype/configurations/defaults/project_configurations/nukestudio/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json rename to pype/configurations/defaults/project_configurations/nukestudio/filter.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json b/pype/configurations/defaults/project_configurations/nukestudio/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json rename to pype/configurations/defaults/project_configurations/nukestudio/publish.json diff --git a/pype/configurations/defaults/presets/nukestudio/tags.json b/pype/configurations/defaults/project_configurations/nukestudio/tags.json similarity index 100% rename from pype/configurations/defaults/presets/nukestudio/tags.json rename to pype/configurations/defaults/project_configurations/nukestudio/tags.json diff --git a/pype/configurations/defaults/presets/premiere/asset_default.json b/pype/configurations/defaults/project_configurations/premiere/asset_default.json similarity index 100% rename from pype/configurations/defaults/presets/premiere/asset_default.json rename to pype/configurations/defaults/project_configurations/premiere/asset_default.json diff --git a/pype/configurations/defaults/presets/premiere/rules_tasks.json b/pype/configurations/defaults/project_configurations/premiere/rules_tasks.json similarity index 100% rename from pype/configurations/defaults/presets/premiere/rules_tasks.json rename to pype/configurations/defaults/project_configurations/premiere/rules_tasks.json diff --git a/pype/configurations/defaults/project_configurations/plugins/resolve/create.json b/pype/configurations/defaults/project_configurations/resolve/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/resolve/create.json rename to pype/configurations/defaults/project_configurations/resolve/create.json diff --git a/pype/configurations/defaults/presets/standalone_publish/families.json b/pype/configurations/defaults/project_configurations/standalonepublisher/families.json similarity index 100% rename from pype/configurations/defaults/presets/standalone_publish/families.json rename to pype/configurations/defaults/project_configurations/standalonepublisher/families.json diff --git a/pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json b/pype/configurations/defaults/project_configurations/standalonepublisher/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json rename to pype/configurations/defaults/project_configurations/standalonepublisher/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/test/create.json b/pype/configurations/defaults/project_configurations/test/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/test/create.json rename to pype/configurations/defaults/project_configurations/test/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/test/publish.json b/pype/configurations/defaults/project_configurations/test/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/test/publish.json rename to pype/configurations/defaults/project_configurations/test/publish.json diff --git a/pype/configurations/defaults/presets/tools/slates/example_HD.json b/pype/configurations/defaults/project_configurations/tools/slates/example_HD.json similarity index 100% rename from pype/configurations/defaults/presets/tools/slates/example_HD.json rename to pype/configurations/defaults/project_configurations/tools/slates/example_HD.json diff --git a/pype/configurations/defaults/presets/unreal/project_setup.json b/pype/configurations/defaults/project_configurations/unreal/project_setup.json similarity index 100% rename from pype/configurations/defaults/presets/unreal/project_setup.json rename to pype/configurations/defaults/project_configurations/unreal/project_setup.json diff --git a/pype/configurations/defaults/environments/avalon.json b/pype/configurations/defaults/studio_configurations/environments/avalon.json similarity index 100% rename from pype/configurations/defaults/environments/avalon.json rename to pype/configurations/defaults/studio_configurations/environments/avalon.json diff --git a/pype/configurations/defaults/environments/blender.json b/pype/configurations/defaults/studio_configurations/environments/blender.json similarity index 100% rename from pype/configurations/defaults/environments/blender.json rename to pype/configurations/defaults/studio_configurations/environments/blender.json diff --git a/pype/configurations/defaults/environments/celaction.json b/pype/configurations/defaults/studio_configurations/environments/celaction.json similarity index 100% rename from pype/configurations/defaults/environments/celaction.json rename to pype/configurations/defaults/studio_configurations/environments/celaction.json diff --git a/pype/configurations/defaults/environments/deadline.json b/pype/configurations/defaults/studio_configurations/environments/deadline.json similarity index 100% rename from pype/configurations/defaults/environments/deadline.json rename to pype/configurations/defaults/studio_configurations/environments/deadline.json diff --git a/pype/configurations/defaults/environments/ftrack.json b/pype/configurations/defaults/studio_configurations/environments/ftrack.json similarity index 100% rename from pype/configurations/defaults/environments/ftrack.json rename to pype/configurations/defaults/studio_configurations/environments/ftrack.json diff --git a/pype/configurations/defaults/environments/global.json b/pype/configurations/defaults/studio_configurations/environments/global.json similarity index 100% rename from pype/configurations/defaults/environments/global.json rename to pype/configurations/defaults/studio_configurations/environments/global.json diff --git a/pype/configurations/defaults/environments/harmony.json b/pype/configurations/defaults/studio_configurations/environments/harmony.json similarity index 100% rename from pype/configurations/defaults/environments/harmony.json rename to pype/configurations/defaults/studio_configurations/environments/harmony.json diff --git a/pype/configurations/defaults/environments/houdini.json b/pype/configurations/defaults/studio_configurations/environments/houdini.json similarity index 100% rename from pype/configurations/defaults/environments/houdini.json rename to pype/configurations/defaults/studio_configurations/environments/houdini.json diff --git a/pype/configurations/defaults/environments/maya.json b/pype/configurations/defaults/studio_configurations/environments/maya.json similarity index 100% rename from pype/configurations/defaults/environments/maya.json rename to pype/configurations/defaults/studio_configurations/environments/maya.json diff --git a/pype/configurations/defaults/environments/maya_2018.json b/pype/configurations/defaults/studio_configurations/environments/maya_2018.json similarity index 100% rename from pype/configurations/defaults/environments/maya_2018.json rename to pype/configurations/defaults/studio_configurations/environments/maya_2018.json diff --git a/pype/configurations/defaults/environments/maya_2020.json b/pype/configurations/defaults/studio_configurations/environments/maya_2020.json similarity index 100% rename from pype/configurations/defaults/environments/maya_2020.json rename to pype/configurations/defaults/studio_configurations/environments/maya_2020.json diff --git a/pype/configurations/defaults/environments/mayabatch.json b/pype/configurations/defaults/studio_configurations/environments/mayabatch.json similarity index 100% rename from pype/configurations/defaults/environments/mayabatch.json rename to pype/configurations/defaults/studio_configurations/environments/mayabatch.json diff --git a/pype/configurations/defaults/environments/mayabatch_2019.json b/pype/configurations/defaults/studio_configurations/environments/mayabatch_2019.json similarity index 100% rename from pype/configurations/defaults/environments/mayabatch_2019.json rename to pype/configurations/defaults/studio_configurations/environments/mayabatch_2019.json diff --git a/pype/configurations/defaults/environments/mtoa_3.1.1.json b/pype/configurations/defaults/studio_configurations/environments/mtoa_3.1.1.json similarity index 100% rename from pype/configurations/defaults/environments/mtoa_3.1.1.json rename to pype/configurations/defaults/studio_configurations/environments/mtoa_3.1.1.json diff --git a/pype/configurations/defaults/environments/muster.json b/pype/configurations/defaults/studio_configurations/environments/muster.json similarity index 100% rename from pype/configurations/defaults/environments/muster.json rename to pype/configurations/defaults/studio_configurations/environments/muster.json diff --git a/pype/configurations/defaults/environments/nuke.json b/pype/configurations/defaults/studio_configurations/environments/nuke.json similarity index 100% rename from pype/configurations/defaults/environments/nuke.json rename to pype/configurations/defaults/studio_configurations/environments/nuke.json diff --git a/pype/configurations/defaults/environments/nukestudio.json b/pype/configurations/defaults/studio_configurations/environments/nukestudio.json similarity index 100% rename from pype/configurations/defaults/environments/nukestudio.json rename to pype/configurations/defaults/studio_configurations/environments/nukestudio.json diff --git a/pype/configurations/defaults/environments/nukestudio_10.0.json b/pype/configurations/defaults/studio_configurations/environments/nukestudio_10.0.json similarity index 100% rename from pype/configurations/defaults/environments/nukestudio_10.0.json rename to pype/configurations/defaults/studio_configurations/environments/nukestudio_10.0.json diff --git a/pype/configurations/defaults/environments/nukex.json b/pype/configurations/defaults/studio_configurations/environments/nukex.json similarity index 100% rename from pype/configurations/defaults/environments/nukex.json rename to pype/configurations/defaults/studio_configurations/environments/nukex.json diff --git a/pype/configurations/defaults/environments/nukex_10.0.json b/pype/configurations/defaults/studio_configurations/environments/nukex_10.0.json similarity index 100% rename from pype/configurations/defaults/environments/nukex_10.0.json rename to pype/configurations/defaults/studio_configurations/environments/nukex_10.0.json diff --git a/pype/configurations/defaults/environments/photoshop.json b/pype/configurations/defaults/studio_configurations/environments/photoshop.json similarity index 100% rename from pype/configurations/defaults/environments/photoshop.json rename to pype/configurations/defaults/studio_configurations/environments/photoshop.json diff --git a/pype/configurations/defaults/environments/premiere.json b/pype/configurations/defaults/studio_configurations/environments/premiere.json similarity index 100% rename from pype/configurations/defaults/environments/premiere.json rename to pype/configurations/defaults/studio_configurations/environments/premiere.json diff --git a/pype/configurations/defaults/environments/resolve.json b/pype/configurations/defaults/studio_configurations/environments/resolve.json similarity index 100% rename from pype/configurations/defaults/environments/resolve.json rename to pype/configurations/defaults/studio_configurations/environments/resolve.json diff --git a/pype/configurations/defaults/environments/storyboardpro.json b/pype/configurations/defaults/studio_configurations/environments/storyboardpro.json similarity index 100% rename from pype/configurations/defaults/environments/storyboardpro.json rename to pype/configurations/defaults/studio_configurations/environments/storyboardpro.json diff --git a/pype/configurations/defaults/environments/unreal_4.24.json b/pype/configurations/defaults/studio_configurations/environments/unreal_4.24.json similarity index 100% rename from pype/configurations/defaults/environments/unreal_4.24.json rename to pype/configurations/defaults/studio_configurations/environments/unreal_4.24.json diff --git a/pype/configurations/defaults/environments/vray_4300.json b/pype/configurations/defaults/studio_configurations/environments/vray_4300.json similarity index 100% rename from pype/configurations/defaults/environments/vray_4300.json rename to pype/configurations/defaults/studio_configurations/environments/vray_4300.json diff --git a/pype/configurations/defaults/launchers/blender_2.80.toml b/pype/configurations/defaults/studio_configurations/launchers/blender_2.80.toml similarity index 100% rename from pype/configurations/defaults/launchers/blender_2.80.toml rename to pype/configurations/defaults/studio_configurations/launchers/blender_2.80.toml diff --git a/pype/configurations/defaults/launchers/blender_2.81.toml b/pype/configurations/defaults/studio_configurations/launchers/blender_2.81.toml similarity index 100% rename from pype/configurations/defaults/launchers/blender_2.81.toml rename to pype/configurations/defaults/studio_configurations/launchers/blender_2.81.toml diff --git a/pype/configurations/defaults/launchers/blender_2.82.toml b/pype/configurations/defaults/studio_configurations/launchers/blender_2.82.toml similarity index 100% rename from pype/configurations/defaults/launchers/blender_2.82.toml rename to pype/configurations/defaults/studio_configurations/launchers/blender_2.82.toml diff --git a/pype/configurations/defaults/launchers/blender_2.83.toml b/pype/configurations/defaults/studio_configurations/launchers/blender_2.83.toml similarity index 100% rename from pype/configurations/defaults/launchers/blender_2.83.toml rename to pype/configurations/defaults/studio_configurations/launchers/blender_2.83.toml diff --git a/pype/configurations/defaults/launchers/celaction_local.toml b/pype/configurations/defaults/studio_configurations/launchers/celaction_local.toml similarity index 100% rename from pype/configurations/defaults/launchers/celaction_local.toml rename to pype/configurations/defaults/studio_configurations/launchers/celaction_local.toml diff --git a/pype/configurations/defaults/launchers/celaction_publish.toml b/pype/configurations/defaults/studio_configurations/launchers/celaction_publish.toml similarity index 100% rename from pype/configurations/defaults/launchers/celaction_publish.toml rename to pype/configurations/defaults/studio_configurations/launchers/celaction_publish.toml diff --git a/pype/configurations/defaults/launchers/darwin/blender_2.82 b/pype/configurations/defaults/studio_configurations/launchers/darwin/blender_2.82 similarity index 100% rename from pype/configurations/defaults/launchers/darwin/blender_2.82 rename to pype/configurations/defaults/studio_configurations/launchers/darwin/blender_2.82 diff --git a/pype/configurations/defaults/launchers/darwin/harmony_17 b/pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17 similarity index 100% rename from pype/configurations/defaults/launchers/darwin/harmony_17 rename to pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17 diff --git a/pype/configurations/defaults/launchers/darwin/harmony_17_launch b/pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17_launch similarity index 100% rename from pype/configurations/defaults/launchers/darwin/harmony_17_launch rename to pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17_launch diff --git a/pype/configurations/defaults/launchers/darwin/python3 b/pype/configurations/defaults/studio_configurations/launchers/darwin/python3 similarity index 100% rename from pype/configurations/defaults/launchers/darwin/python3 rename to pype/configurations/defaults/studio_configurations/launchers/darwin/python3 diff --git a/pype/configurations/defaults/launchers/harmony_17.toml b/pype/configurations/defaults/studio_configurations/launchers/harmony_17.toml similarity index 100% rename from pype/configurations/defaults/launchers/harmony_17.toml rename to pype/configurations/defaults/studio_configurations/launchers/harmony_17.toml diff --git a/pype/configurations/defaults/launchers/houdini_16.toml b/pype/configurations/defaults/studio_configurations/launchers/houdini_16.toml similarity index 100% rename from pype/configurations/defaults/launchers/houdini_16.toml rename to pype/configurations/defaults/studio_configurations/launchers/houdini_16.toml diff --git a/pype/configurations/defaults/launchers/houdini_17.toml b/pype/configurations/defaults/studio_configurations/launchers/houdini_17.toml similarity index 100% rename from pype/configurations/defaults/launchers/houdini_17.toml rename to pype/configurations/defaults/studio_configurations/launchers/houdini_17.toml diff --git a/pype/configurations/defaults/launchers/houdini_18.toml b/pype/configurations/defaults/studio_configurations/launchers/houdini_18.toml similarity index 100% rename from pype/configurations/defaults/launchers/houdini_18.toml rename to pype/configurations/defaults/studio_configurations/launchers/houdini_18.toml diff --git a/pype/configurations/defaults/launchers/linux/maya2016 b/pype/configurations/defaults/studio_configurations/launchers/linux/maya2016 similarity index 100% rename from pype/configurations/defaults/launchers/linux/maya2016 rename to pype/configurations/defaults/studio_configurations/launchers/linux/maya2016 diff --git a/pype/configurations/defaults/launchers/linux/maya2017 b/pype/configurations/defaults/studio_configurations/launchers/linux/maya2017 similarity index 100% rename from pype/configurations/defaults/launchers/linux/maya2017 rename to pype/configurations/defaults/studio_configurations/launchers/linux/maya2017 diff --git a/pype/configurations/defaults/launchers/linux/maya2018 b/pype/configurations/defaults/studio_configurations/launchers/linux/maya2018 similarity index 100% rename from pype/configurations/defaults/launchers/linux/maya2018 rename to pype/configurations/defaults/studio_configurations/launchers/linux/maya2018 diff --git a/pype/configurations/defaults/launchers/linux/maya2019 b/pype/configurations/defaults/studio_configurations/launchers/linux/maya2019 similarity index 100% rename from pype/configurations/defaults/launchers/linux/maya2019 rename to pype/configurations/defaults/studio_configurations/launchers/linux/maya2019 diff --git a/pype/configurations/defaults/launchers/linux/maya2020 b/pype/configurations/defaults/studio_configurations/launchers/linux/maya2020 similarity index 100% rename from pype/configurations/defaults/launchers/linux/maya2020 rename to pype/configurations/defaults/studio_configurations/launchers/linux/maya2020 diff --git a/pype/configurations/defaults/launchers/linux/nuke11.3 b/pype/configurations/defaults/studio_configurations/launchers/linux/nuke11.3 similarity index 100% rename from pype/configurations/defaults/launchers/linux/nuke11.3 rename to pype/configurations/defaults/studio_configurations/launchers/linux/nuke11.3 diff --git a/pype/configurations/defaults/launchers/linux/nuke12.0 b/pype/configurations/defaults/studio_configurations/launchers/linux/nuke12.0 similarity index 100% rename from pype/configurations/defaults/launchers/linux/nuke12.0 rename to pype/configurations/defaults/studio_configurations/launchers/linux/nuke12.0 diff --git a/pype/configurations/defaults/launchers/linux/nukestudio11.3 b/pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio11.3 similarity index 100% rename from pype/configurations/defaults/launchers/linux/nukestudio11.3 rename to pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio11.3 diff --git a/pype/configurations/defaults/launchers/linux/nukestudio12.0 b/pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio12.0 similarity index 100% rename from pype/configurations/defaults/launchers/linux/nukestudio12.0 rename to pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio12.0 diff --git a/pype/configurations/defaults/launchers/linux/nukex11.3 b/pype/configurations/defaults/studio_configurations/launchers/linux/nukex11.3 similarity index 100% rename from pype/configurations/defaults/launchers/linux/nukex11.3 rename to pype/configurations/defaults/studio_configurations/launchers/linux/nukex11.3 diff --git a/pype/configurations/defaults/launchers/linux/nukex12.0 b/pype/configurations/defaults/studio_configurations/launchers/linux/nukex12.0 similarity index 100% rename from pype/configurations/defaults/launchers/linux/nukex12.0 rename to pype/configurations/defaults/studio_configurations/launchers/linux/nukex12.0 diff --git a/pype/configurations/defaults/launchers/maya_2016.toml b/pype/configurations/defaults/studio_configurations/launchers/maya_2016.toml similarity index 100% rename from pype/configurations/defaults/launchers/maya_2016.toml rename to pype/configurations/defaults/studio_configurations/launchers/maya_2016.toml diff --git a/pype/configurations/defaults/launchers/maya_2017.toml b/pype/configurations/defaults/studio_configurations/launchers/maya_2017.toml similarity index 100% rename from pype/configurations/defaults/launchers/maya_2017.toml rename to pype/configurations/defaults/studio_configurations/launchers/maya_2017.toml diff --git a/pype/configurations/defaults/launchers/maya_2018.toml b/pype/configurations/defaults/studio_configurations/launchers/maya_2018.toml similarity index 100% rename from pype/configurations/defaults/launchers/maya_2018.toml rename to pype/configurations/defaults/studio_configurations/launchers/maya_2018.toml diff --git a/pype/configurations/defaults/launchers/maya_2019.toml b/pype/configurations/defaults/studio_configurations/launchers/maya_2019.toml similarity index 100% rename from pype/configurations/defaults/launchers/maya_2019.toml rename to pype/configurations/defaults/studio_configurations/launchers/maya_2019.toml diff --git a/pype/configurations/defaults/launchers/maya_2020.toml b/pype/configurations/defaults/studio_configurations/launchers/maya_2020.toml similarity index 100% rename from pype/configurations/defaults/launchers/maya_2020.toml rename to pype/configurations/defaults/studio_configurations/launchers/maya_2020.toml diff --git a/pype/configurations/defaults/launchers/mayabatch_2019.toml b/pype/configurations/defaults/studio_configurations/launchers/mayabatch_2019.toml similarity index 100% rename from pype/configurations/defaults/launchers/mayabatch_2019.toml rename to pype/configurations/defaults/studio_configurations/launchers/mayabatch_2019.toml diff --git a/pype/configurations/defaults/launchers/mayabatch_2020.toml b/pype/configurations/defaults/studio_configurations/launchers/mayabatch_2020.toml similarity index 100% rename from pype/configurations/defaults/launchers/mayabatch_2020.toml rename to pype/configurations/defaults/studio_configurations/launchers/mayabatch_2020.toml diff --git a/pype/configurations/defaults/launchers/mayapy2016.toml b/pype/configurations/defaults/studio_configurations/launchers/mayapy2016.toml similarity index 100% rename from pype/configurations/defaults/launchers/mayapy2016.toml rename to pype/configurations/defaults/studio_configurations/launchers/mayapy2016.toml diff --git a/pype/configurations/defaults/launchers/mayapy2017.toml b/pype/configurations/defaults/studio_configurations/launchers/mayapy2017.toml similarity index 100% rename from pype/configurations/defaults/launchers/mayapy2017.toml rename to pype/configurations/defaults/studio_configurations/launchers/mayapy2017.toml diff --git a/pype/configurations/defaults/launchers/mayapy2018.toml b/pype/configurations/defaults/studio_configurations/launchers/mayapy2018.toml similarity index 100% rename from pype/configurations/defaults/launchers/mayapy2018.toml rename to pype/configurations/defaults/studio_configurations/launchers/mayapy2018.toml diff --git a/pype/configurations/defaults/launchers/mayapy2019.toml b/pype/configurations/defaults/studio_configurations/launchers/mayapy2019.toml similarity index 100% rename from pype/configurations/defaults/launchers/mayapy2019.toml rename to pype/configurations/defaults/studio_configurations/launchers/mayapy2019.toml diff --git a/pype/configurations/defaults/launchers/mayapy2020.toml b/pype/configurations/defaults/studio_configurations/launchers/mayapy2020.toml similarity index 100% rename from pype/configurations/defaults/launchers/mayapy2020.toml rename to pype/configurations/defaults/studio_configurations/launchers/mayapy2020.toml diff --git a/pype/configurations/defaults/launchers/myapp.toml b/pype/configurations/defaults/studio_configurations/launchers/myapp.toml similarity index 100% rename from pype/configurations/defaults/launchers/myapp.toml rename to pype/configurations/defaults/studio_configurations/launchers/myapp.toml diff --git a/pype/configurations/defaults/launchers/nuke_10.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nuke_10.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nuke_10.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nuke_10.0.toml diff --git a/pype/configurations/defaults/launchers/nuke_11.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nuke_11.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nuke_11.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nuke_11.0.toml diff --git a/pype/configurations/defaults/launchers/nuke_11.2.toml b/pype/configurations/defaults/studio_configurations/launchers/nuke_11.2.toml similarity index 100% rename from pype/configurations/defaults/launchers/nuke_11.2.toml rename to pype/configurations/defaults/studio_configurations/launchers/nuke_11.2.toml diff --git a/pype/configurations/defaults/launchers/nuke_11.3.toml b/pype/configurations/defaults/studio_configurations/launchers/nuke_11.3.toml similarity index 100% rename from pype/configurations/defaults/launchers/nuke_11.3.toml rename to pype/configurations/defaults/studio_configurations/launchers/nuke_11.3.toml diff --git a/pype/configurations/defaults/launchers/nuke_12.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nuke_12.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nuke_12.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nuke_12.0.toml diff --git a/pype/configurations/defaults/launchers/nukestudio_10.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nukestudio_10.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukestudio_10.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukestudio_10.0.toml diff --git a/pype/configurations/defaults/launchers/nukestudio_11.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukestudio_11.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.0.toml diff --git a/pype/configurations/defaults/launchers/nukestudio_11.2.toml b/pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.2.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukestudio_11.2.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.2.toml diff --git a/pype/configurations/defaults/launchers/nukestudio_11.3.toml b/pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.3.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukestudio_11.3.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.3.toml diff --git a/pype/configurations/defaults/launchers/nukestudio_12.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nukestudio_12.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukestudio_12.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukestudio_12.0.toml diff --git a/pype/configurations/defaults/launchers/nukex_10.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nukex_10.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukex_10.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukex_10.0.toml diff --git a/pype/configurations/defaults/launchers/nukex_11.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nukex_11.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukex_11.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukex_11.0.toml diff --git a/pype/configurations/defaults/launchers/nukex_11.2.toml b/pype/configurations/defaults/studio_configurations/launchers/nukex_11.2.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukex_11.2.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukex_11.2.toml diff --git a/pype/configurations/defaults/launchers/nukex_11.3.toml b/pype/configurations/defaults/studio_configurations/launchers/nukex_11.3.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukex_11.3.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukex_11.3.toml diff --git a/pype/configurations/defaults/launchers/nukex_12.0.toml b/pype/configurations/defaults/studio_configurations/launchers/nukex_12.0.toml similarity index 100% rename from pype/configurations/defaults/launchers/nukex_12.0.toml rename to pype/configurations/defaults/studio_configurations/launchers/nukex_12.0.toml diff --git a/pype/configurations/defaults/launchers/photoshop_2020.toml b/pype/configurations/defaults/studio_configurations/launchers/photoshop_2020.toml similarity index 100% rename from pype/configurations/defaults/launchers/photoshop_2020.toml rename to pype/configurations/defaults/studio_configurations/launchers/photoshop_2020.toml diff --git a/pype/configurations/defaults/launchers/premiere_2019.toml b/pype/configurations/defaults/studio_configurations/launchers/premiere_2019.toml similarity index 100% rename from pype/configurations/defaults/launchers/premiere_2019.toml rename to pype/configurations/defaults/studio_configurations/launchers/premiere_2019.toml diff --git a/pype/configurations/defaults/launchers/premiere_2020.toml b/pype/configurations/defaults/studio_configurations/launchers/premiere_2020.toml similarity index 100% rename from pype/configurations/defaults/launchers/premiere_2020.toml rename to pype/configurations/defaults/studio_configurations/launchers/premiere_2020.toml diff --git a/pype/configurations/defaults/launchers/python_2.toml b/pype/configurations/defaults/studio_configurations/launchers/python_2.toml similarity index 100% rename from pype/configurations/defaults/launchers/python_2.toml rename to pype/configurations/defaults/studio_configurations/launchers/python_2.toml diff --git a/pype/configurations/defaults/launchers/python_3.toml b/pype/configurations/defaults/studio_configurations/launchers/python_3.toml similarity index 100% rename from pype/configurations/defaults/launchers/python_3.toml rename to pype/configurations/defaults/studio_configurations/launchers/python_3.toml diff --git a/pype/configurations/defaults/launchers/resolve_16.toml b/pype/configurations/defaults/studio_configurations/launchers/resolve_16.toml similarity index 100% rename from pype/configurations/defaults/launchers/resolve_16.toml rename to pype/configurations/defaults/studio_configurations/launchers/resolve_16.toml diff --git a/pype/configurations/defaults/launchers/shell.toml b/pype/configurations/defaults/studio_configurations/launchers/shell.toml similarity index 100% rename from pype/configurations/defaults/launchers/shell.toml rename to pype/configurations/defaults/studio_configurations/launchers/shell.toml diff --git a/pype/configurations/defaults/launchers/storyboardpro_7.toml b/pype/configurations/defaults/studio_configurations/launchers/storyboardpro_7.toml similarity index 100% rename from pype/configurations/defaults/launchers/storyboardpro_7.toml rename to pype/configurations/defaults/studio_configurations/launchers/storyboardpro_7.toml diff --git a/pype/configurations/defaults/launchers/unreal_4.24.toml b/pype/configurations/defaults/studio_configurations/launchers/unreal_4.24.toml similarity index 100% rename from pype/configurations/defaults/launchers/unreal_4.24.toml rename to pype/configurations/defaults/studio_configurations/launchers/unreal_4.24.toml diff --git a/pype/configurations/defaults/launchers/windows/blender_2.80.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.80.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/blender_2.80.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.80.bat diff --git a/pype/configurations/defaults/launchers/windows/blender_2.81.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.81.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/blender_2.81.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.81.bat diff --git a/pype/configurations/defaults/launchers/windows/blender_2.82.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.82.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/blender_2.82.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.82.bat diff --git a/pype/configurations/defaults/launchers/windows/blender_2.83.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.83.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/blender_2.83.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.83.bat diff --git a/pype/configurations/defaults/launchers/windows/celaction_local.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/celaction_local.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/celaction_local.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/celaction_local.bat diff --git a/pype/configurations/defaults/launchers/windows/celaction_publish.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/celaction_publish.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/celaction_publish.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/celaction_publish.bat diff --git a/pype/configurations/defaults/launchers/windows/harmony_17.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/harmony_17.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/harmony_17.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/harmony_17.bat diff --git a/pype/configurations/defaults/launchers/windows/houdini_16.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/houdini_16.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/houdini_16.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/houdini_16.bat diff --git a/pype/configurations/defaults/launchers/windows/houdini_17.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/houdini_17.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/houdini_17.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/houdini_17.bat diff --git a/pype/configurations/defaults/launchers/windows/houdini_18.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/houdini_18.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/houdini_18.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/houdini_18.bat diff --git a/pype/configurations/defaults/launchers/windows/maya2016.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/maya2016.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/maya2016.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/maya2016.bat diff --git a/pype/configurations/defaults/launchers/windows/maya2017.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/maya2017.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/maya2017.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/maya2017.bat diff --git a/pype/configurations/defaults/launchers/windows/maya2018.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/maya2018.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/maya2018.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/maya2018.bat diff --git a/pype/configurations/defaults/launchers/windows/maya2019.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/maya2019.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/maya2019.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/maya2019.bat diff --git a/pype/configurations/defaults/launchers/windows/maya2020.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/maya2020.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/maya2020.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/maya2020.bat diff --git a/pype/configurations/defaults/launchers/windows/mayabatch2019.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2019.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/mayabatch2019.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2019.bat diff --git a/pype/configurations/defaults/launchers/windows/mayabatch2020.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2020.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/mayabatch2020.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2020.bat diff --git a/pype/configurations/defaults/launchers/windows/mayapy2016.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2016.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/mayapy2016.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2016.bat diff --git a/pype/configurations/defaults/launchers/windows/mayapy2017.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2017.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/mayapy2017.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2017.bat diff --git a/pype/configurations/defaults/launchers/windows/mayapy2018.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2018.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/mayapy2018.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2018.bat diff --git a/pype/configurations/defaults/launchers/windows/mayapy2019.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2019.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/mayapy2019.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2019.bat diff --git a/pype/configurations/defaults/launchers/windows/mayapy2020.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2020.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/mayapy2020.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2020.bat diff --git a/pype/configurations/defaults/launchers/windows/nuke10.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nuke10.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nuke10.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nuke10.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nuke11.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nuke11.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nuke11.2.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.2.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nuke11.2.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.2.bat diff --git a/pype/configurations/defaults/launchers/windows/nuke11.3.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.3.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nuke11.3.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.3.bat diff --git a/pype/configurations/defaults/launchers/windows/nuke12.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nuke12.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nuke12.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nuke12.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nukestudio10.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio10.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukestudio10.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio10.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nukestudio11.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukestudio11.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nukestudio11.2.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.2.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukestudio11.2.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.2.bat diff --git a/pype/configurations/defaults/launchers/windows/nukestudio11.3.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.3.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukestudio11.3.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.3.bat diff --git a/pype/configurations/defaults/launchers/windows/nukestudio12.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio12.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukestudio12.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio12.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nukex10.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukex10.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukex10.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukex10.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nukex11.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukex11.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.0.bat diff --git a/pype/configurations/defaults/launchers/windows/nukex11.2.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.2.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukex11.2.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.2.bat diff --git a/pype/configurations/defaults/launchers/windows/nukex11.3.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.3.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukex11.3.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.3.bat diff --git a/pype/configurations/defaults/launchers/windows/nukex12.0.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/nukex12.0.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/nukex12.0.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/nukex12.0.bat diff --git a/pype/configurations/defaults/launchers/windows/photoshop_2020.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/photoshop_2020.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/photoshop_2020.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/photoshop_2020.bat diff --git a/pype/configurations/defaults/launchers/windows/premiere_pro_2019.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2019.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/premiere_pro_2019.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2019.bat diff --git a/pype/configurations/defaults/launchers/windows/premiere_pro_2020.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2020.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/premiere_pro_2020.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2020.bat diff --git a/pype/configurations/defaults/launchers/windows/python3.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/python3.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/python3.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/python3.bat diff --git a/pype/configurations/defaults/launchers/windows/resolve_16.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/resolve_16.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/resolve_16.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/resolve_16.bat diff --git a/pype/configurations/defaults/launchers/windows/shell.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/shell.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/shell.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/shell.bat diff --git a/pype/configurations/defaults/launchers/windows/storyboardpro_7.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/storyboardpro_7.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/storyboardpro_7.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/storyboardpro_7.bat diff --git a/pype/configurations/defaults/launchers/windows/unreal.bat b/pype/configurations/defaults/studio_configurations/launchers/windows/unreal.bat similarity index 100% rename from pype/configurations/defaults/launchers/windows/unreal.bat rename to pype/configurations/defaults/studio_configurations/launchers/windows/unreal.bat From 7d7a2e1b230584d4cc99b126ac155c4434f408c0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:37:11 +0200 Subject: [PATCH 356/507] initial commit to save studio configurations to different place --- pype/configurations/config.py | 43 +++++++++++++------ .../config_setting/widgets/base.py | 3 +- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/pype/configurations/config.py b/pype/configurations/config.py index 416704649c..147570acd4 100644 --- a/pype/configurations/config.py +++ b/pype/configurations/config.py @@ -5,18 +5,37 @@ import copy log = logging.getLogger(__name__) -STUDIO_PRESETS_PATH = os.path.normpath( - os.path.join(os.environ["PYPE_CONFIG"], "studio_configurations") +# Metadata keys for work with studio and project overrides +OVERRIDEN_KEY = "__overriden_keys__" +# NOTE key popping not implemented yet +POP_KEY = "__pop_key__" + +# Paths to studio and project overrides +STUDIO_OVERRIDES_PATH = os.environ["PYPE_CONFIG"] + +SYSTEM_CONFIGURATIONS_DIR = "studio_configurations" +SYSTEM_CONFIGURATIONS_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, SYSTEM_CONFIGURATIONS_DIR ) -PROJECT_CONFIGURATION_DIR = "project_configurations" -PROJECT_PRESETS_PATH = os.path.normpath(os.path.join( - os.environ["PYPE_CONFIG"], PROJECT_CONFIGURATION_DIR -)) +PROJECT_CONFIGURATIONS_DIR = "project_configurations" +PROJECT_CONFIGURATIONS_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, PROJECT_CONFIGURATIONS_DIR +) + +# Variable where cache of default configurations are stored +_DEFAULT_CONFIGURATIONS = None + +# TODO remove this as is maybe deprecated first_run = False -# TODO key popping not implemented yet -POP_KEY = "__pop_key__" -OVERRIDEN_KEY = "__overriden_keys__" + +def default_configuration(): + global _DEFAULT_CONFIGURATIONS + if _DEFAULT_CONFIGURATIONS is None: + current_dir = os.path.dirname(__file__) + defaults_path = os.path.join(current_dir, "defaults") + _DEFAULT_CONFIGURATIONS = load_jsons_from_dir(defaults_path) + return _DEFAULT_CONFIGURATIONS def load_json(fpath): @@ -129,17 +148,17 @@ def load_jsons_from_dir(path, *args, **kwargs): def studio_configurations(*args, **kwargs): - return load_jsons_from_dir(STUDIO_PRESETS_PATH, *args, **kwargs) + return load_jsons_from_dir(SYSTEM_CONFIGURATIONS_PATH, *args, **kwargs) def global_project_configurations(**kwargs): - return load_jsons_from_dir(PROJECT_PRESETS_PATH, **kwargs) + return load_jsons_from_dir(PROJECT_CONFIGURATIONS_PATH, **kwargs) def path_to_project_overrides(project_name): project_configs_path = os.environ["PYPE_PROJECT_CONFIGS"] dirpath = os.path.join(project_configs_path, project_name) - return os.path.join(dirpath, PROJECT_CONFIGURATION_DIR + ".json") + return os.path.join(dirpath, PROJECT_CONFIGURATIONS_DIR + ".json") def project_configurations_overrides(project_name, **kwargs): diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index d39b5789d9..0660ab1e06 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -156,7 +156,7 @@ class SystemWidget(QtWidgets.QWidget): for key in key_sequence: new_values = new_values[key] origin_values.update(new_values) - + raise NotImplementedError("Output from global values has changed") output_path = os.path.join( config.STUDIO_PRESETS_PATH, subpath ) @@ -537,6 +537,7 @@ class ProjectWidget(QtWidgets.QWidget): else: origin_values = new_values + raise NotImplementedError("Output from global values has changed") output_path = os.path.join( config.PROJECT_PRESETS_PATH, subpath ) From 4fabd706e820d45755608b7605c32741ab4da5a6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:54:16 +0200 Subject: [PATCH 357/507] renamed studio to system --- .../studio_schema/0_studio_gui_schema.json | 3 +-- .../config_setting/widgets/base.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json index bde340250e..de17328860 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json @@ -1,7 +1,6 @@ { - "key": "studio", + "key": "system", "type": "dict-invisible", - "label": "Studio", "children": [ { "type": "dict-invisible", diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 0660ab1e06..3d255b416e 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -95,7 +95,7 @@ class SystemWidget(QtWidgets.QWidget): self.schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") self.keys = self.schema.get("keys", []) self.add_children_gui(self.schema) - self._update_global_values() + self._update_values() self.hierarchical_style_update() def _save(self): @@ -132,7 +132,7 @@ class SystemWidget(QtWidgets.QWidget): all_values = _all_values # Skip first key - all_values = all_values["studio"] + all_values = all_values["system"] # Load studio data with metadata current_configurations = config.studio_configurations() @@ -168,10 +168,10 @@ class SystemWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(origin_values, file_stream, indent=4) - self._update_global_values() + self._update_values() - def _update_global_values(self): - values = {"studio": config.studio_configurations()} + def _update_values(self): + values = {"system": config.studio_configurations()} for input_field in self.input_fields: input_field.update_global_values(values) @@ -408,7 +408,7 @@ class ProjectWidget(QtWidgets.QWidget): self.schema = lib.gui_schema("projects_schema", "0_project_gui_schema") self.keys = self.schema.get("keys", []) self.add_children_gui(self.schema) - self._update_global_values() + self._update_values() self.hierarchical_style_update() def add_children_gui(self, child_configuration): @@ -549,9 +549,9 @@ class ProjectWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(origin_values, file_stream, indent=4) - self._update_global_values() + self._update_values() - def _update_global_values(self): + def _update_values(self): values = {"project": config.global_project_configurations()} for input_field in self.input_fields: input_field.update_global_values(values) From 8ad8b00713e15556b346c75a31b38df2fb18a2f6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:55:00 +0200 Subject: [PATCH 358/507] renamed also files and folder from studio to system --- .../0_system_gui_schema.json} | 0 .../1_applications_gui_schema.json | 0 .../{studio_schema => system_schema}/1_intents_gui_schema.json | 0 .../{studio_schema => system_schema}/1_tools_gui_schema.json | 0 .../{studio_schema => system_schema}/1_tray_items.json | 0 pype/tools/config_setting/config_setting/widgets/base.py | 3 ++- 6 files changed, 2 insertions(+), 1 deletion(-) rename pype/tools/config_setting/config_setting/config_gui_schema/{studio_schema/0_studio_gui_schema.json => system_schema/0_system_gui_schema.json} (100%) rename pype/tools/config_setting/config_setting/config_gui_schema/{studio_schema => system_schema}/1_applications_gui_schema.json (100%) rename pype/tools/config_setting/config_setting/config_gui_schema/{studio_schema => system_schema}/1_intents_gui_schema.json (100%) rename pype/tools/config_setting/config_setting/config_gui_schema/{studio_schema => system_schema}/1_tools_gui_schema.json (100%) rename pype/tools/config_setting/config_setting/config_gui_schema/{studio_schema => system_schema}/1_tray_items.json (100%) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/0_studio_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_applications_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_intents_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tools_gui_schema.json rename to pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/studio_schema/1_tray_items.json rename to pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 3d255b416e..e5bbe6d929 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -92,7 +92,7 @@ class SystemWidget(QtWidgets.QWidget): widget.deleteLater() self.input_fields.clear() - self.schema = lib.gui_schema("studio_schema", "0_studio_gui_schema") + self.schema = lib.gui_schema("system_schema", "0_system_gui_schema") self.keys = self.schema.get("keys", []) self.add_children_gui(self.schema) self._update_values() @@ -171,6 +171,7 @@ class SystemWidget(QtWidgets.QWidget): self._update_values() def _update_values(self): + config.default_configuration() values = {"system": config.studio_configurations()} for input_field in self.input_fields: input_field.update_global_values(values) From d2f25b0a0cce496f4fbcbceef2bf4ff30b5fdd58 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 10:59:52 +0200 Subject: [PATCH 359/507] is_file removed from schemas --- .../projects_schema/0_project_gui_schema.json | 3 +-- .../1_ftrack_projects_gui_schema.json | 2 -- .../projects_schema/1_plugins_gui_schema.json | 15 ++------------- .../system_schema/0_system_gui_schema.json | 1 - .../system_schema/1_applications_gui_schema.json | 1 - .../system_schema/1_intents_gui_schema.json | 1 - .../system_schema/1_tools_gui_schema.json | 1 - .../system_schema/1_tray_items.json | 1 - 8 files changed, 3 insertions(+), 22 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json index 91bacf2e5a..86504eefd2 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json @@ -4,8 +4,7 @@ "children": [ { "type": "anatomy", - "key": "anatomy", - "is_file": true + "key": "anatomy" }, { "type": "schema", "children": [ diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json index 6608463100..e9937e64b8 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json @@ -10,7 +10,6 @@ "expandable": true, "label": "Status updates", "is_group": true, - "is_file": true, "children": [ { "key": "Ready", @@ -28,7 +27,6 @@ "expandable": true, "label": "Version status to Task status", "is_group": true, - "is_file": true, "children": [ { "key": "in progress", diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 98fbfb206d..302d1dad0a 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -15,7 +15,6 @@ "expandable": true, "key": "publish", "label": "Publish plugins", - "is_file": true, "children": [ { "type": "dict", @@ -82,7 +81,6 @@ "expandable": true, "key": "publish", "label": "Publish plugins", - "is_file": true, "children": [ { "type": "dict", @@ -125,7 +123,6 @@ "expandable": true, "key": "publish", "label": "Publish plugins", - "is_file": true, "children": [ { "type": "dict", @@ -299,7 +296,6 @@ "expandable": true, "key": "publish", "label": "Publish plugins", - "is_file": true, "children": [ { "type": "dict", @@ -376,8 +372,7 @@ }, { "type": "raw-json", "key": "workfile_build", - "label": "Workfile Build logic", - "is_file": true + "label": "Workfile Build logic" } ] }, { @@ -391,7 +386,6 @@ "expandable": true, "key": "create", "label": "Create plugins", - "is_file": true, "children": [ { "type": "dict", @@ -428,7 +422,6 @@ "expandable": true, "key": "publish", "label": "Publish plugins", - "is_file": true, "children": [ { "type": "dict", @@ -551,8 +544,7 @@ }, { "type": "raw-json", "key": "workfile_build", - "label": "Workfile Build logic", - "is_file": true + "label": "Workfile Build logic" } ] }, { @@ -566,7 +558,6 @@ "expandable": true, "key": "publish", "label": "Publish plugins", - "is_file": true, "children": [ { "type": "dict", @@ -619,7 +610,6 @@ "expandable": true, "key": "create", "label": "Creator plugins", - "is_file": true, "children": [ { "type": "dict", @@ -661,7 +651,6 @@ "expandable": true, "key": "publish", "label": "Publish plugins", - "is_file": true, "children": [] } ] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json index de17328860..0b51267f4e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json @@ -26,7 +26,6 @@ "maximum": 300 }, "is_group": true, - "is_file": true, "key": "templates_mapping", "label": "Muster - Templates mapping" }] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json index bc2c9f239c..af128b138f 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json @@ -3,7 +3,6 @@ "type": "dict", "label": "Applications", "expandable": true, - "is_file": true, "is_group": true, "children": [ { diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json index a4b5e16fa1..11b45c8409 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json @@ -4,7 +4,6 @@ "label": "Intent Setting", "expandable": true, "is_group": true, - "is_file": true, "children": [ { "type": "dict-modifiable", diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json index bf35326d1c..a16f00547e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json @@ -4,7 +4,6 @@ "label": "Tools", "expandable": true, "is_group": true, - "is_file": true, "children": [ { "type": "dict-form", diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json index 13ab0293de..afa509254e 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json @@ -3,7 +3,6 @@ "type": "dict", "label": "Modules", "expandable": true, - "is_file": true, "is_group": true, "children": [ { From 0c256fa30a16934cbc8a08da1841086abe1ca5eb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:00:03 +0200 Subject: [PATCH 360/507] skipped validation of is_file attribute --- .../config_setting/widgets/lib.py | 69 ------------------- 1 file changed, 69 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index 08b0dfc3c4..b32fb734c6 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -81,19 +81,6 @@ def replace_inner_schemas(schema_data, schema_collection): return schema_data -class SchemaMissingFileInfo(Exception): - def __init__(self, invalid): - full_path_keys = [] - for item in invalid: - full_path_keys.append("\"{}\"".format("/".join(item))) - - msg = ( - "Schema has missing definition of output file (\"is_file\" key)" - " for keys. [{}]" - ).format(", ".join(full_path_keys)) - super(SchemaMissingFileInfo, self).__init__(msg) - - class SchemeGroupHierarchyBug(Exception): def __init__(self, invalid): full_path_keys = [] @@ -122,59 +109,6 @@ class SchemaDuplicatedKeys(Exception): super(SchemaDuplicatedKeys, self).__init__(msg) -def file_keys_from_schema(schema_data): - output = [] - keys = [] - key = schema_data.get("key") - if key: - keys.append(key) - - for child in schema_data["children"]: - if child.get("is_file"): - _keys = copy.deepcopy(keys) - _keys.append(child["key"]) - output.append(_keys) - continue - - for result in file_keys_from_schema(child): - _keys = copy.deepcopy(keys) - _keys.extend(result) - output.append(_keys) - return output - - -def validate_all_has_ending_file(schema_data, is_top=True): - if schema_data.get("is_file"): - return None - - children = schema_data.get("children") - if not children: - return [[schema_data["key"]]] - - invalid = [] - keyless = "key" not in schema_data - for child in children: - result = validate_all_has_ending_file(child, False) - if result is None: - continue - - if keyless: - invalid.extend(result) - else: - for item in result: - new_invalid = [schema_data["key"]] - new_invalid.extend(item) - invalid.append(new_invalid) - - if not invalid: - return None - - if not is_top: - return invalid - - raise SchemaMissingFileInfo(invalid) - - def validate_is_group_is_unique_in_hierarchy( schema_data, any_parent_is_group=False, keys=None ): @@ -270,9 +204,6 @@ def validate_keys_are_unique(schema_data, keys=None): def validate_schema(schema_data): - # TODO validator that is_group key is not before is_file child - # TODO validator that is_group or is_file is not on child without key - validate_all_has_ending_file(schema_data) validate_is_group_is_unique_in_hierarchy(schema_data) validate_keys_are_unique(schema_data) From a338b8c04e0e8c5445d1f0ca4533e7e97a66b8e4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:20:34 +0200 Subject: [PATCH 361/507] renamed function for inner schemas --- pype/tools/config_setting/config_setting/widgets/lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index b32fb734c6..69c3259b3b 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -55,7 +55,7 @@ def convert_overrides_to_gui_data(data, first=True): return output -def replace_inner_schemas(schema_data, schema_collection): +def _fill_inner_schemas(schema_data, schema_collection): if schema_data["type"] == "schema": raise ValueError("First item in schema data can't be schema.") @@ -66,12 +66,12 @@ def replace_inner_schemas(schema_data, schema_collection): new_children = [] for child in children: if child["type"] != "schema": - new_child = replace_inner_schemas(child, schema_collection) + new_child = _fill_inner_schemas(child, schema_collection) new_children.append(new_child) continue for schema_name in child["children"]: - new_child = replace_inner_schemas( + new_child = _fill_inner_schemas( schema_collection[schema_name], schema_collection ) @@ -227,7 +227,7 @@ def gui_schema(subfolder, main_schema_name): schema_data = json.load(json_stream) loaded_schemas[basename] = schema_data - main_schema = replace_inner_schemas( + main_schema = _fill_inner_schemas( loaded_schemas[main_schema_name], loaded_schemas ) From afcd282ada6c5c8e3c0f1abe50bd800c04cad0ae Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:20:50 +0200 Subject: [PATCH 362/507] ConfigObject has is from defaults --- pype/tools/config_setting/config_setting/widgets/inputs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index f975567a6a..fed9c6b5c7 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -16,6 +16,7 @@ class ConfigObject(AbstractConfigObject): default_state = "" + _is_from_defaults = True _as_widget = False _is_overriden = False _is_modified = False @@ -32,6 +33,10 @@ class ConfigObject(AbstractConfigObject): self._log = logging.getLogger(self.__class__.__name__) return self._log + @property + def is_from_defaults(self): + return self._is_from_defaults + @property def is_modified(self): """Has object any changes that require saving.""" From 7198576e59c0f3ca487f3972a78f017024d8b724 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:39:02 +0200 Subject: [PATCH 363/507] reverse logic of defaults, better is to know if has studi ooverrides --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index fed9c6b5c7..14cf573398 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -16,7 +16,7 @@ class ConfigObject(AbstractConfigObject): default_state = "" - _is_from_defaults = True + _has_studio_override = True _as_widget = False _is_overriden = False _is_modified = False @@ -34,8 +34,8 @@ class ConfigObject(AbstractConfigObject): return self._log @property - def is_from_defaults(self): - return self._is_from_defaults + def has_studio_override(self): + return self._has_studio_override @property def is_modified(self): From 918d592777d41a5e87617acd5562cb4b3a80fcf1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:42:08 +0200 Subject: [PATCH 364/507] renamed global_value to studio_value --- .../config_setting/widgets/anatomy_inputs.py | 20 ++-- .../config_setting/widgets/base.py | 4 +- .../config_setting/widgets/inputs.py | 106 +++++++++--------- 3 files changed, 65 insertions(+), 65 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index e59de3980f..957691cbdc 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -75,7 +75,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.value_changed.connect(self._on_value_change) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): self._state = None self._child_state = None @@ -84,8 +84,8 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): else: value = NOT_SET - self.root_widget.update_global_values(value) - self.templates_widget.update_global_values(value) + self.root_widget.update_studio_values(value) + self.templates_widget.update_studio_values(value) def apply_overrides(self, parent_values): # Make sure this is set to False @@ -258,7 +258,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def is_multiroot(self): return self.multiroot_checkbox.isChecked() - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): self._state = None self._multiroot_state = None @@ -279,11 +279,11 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.set_multiroot(is_multiroot) if is_multiroot: - self.singleroot_widget.update_global_values(NOT_SET) - self.multiroot_widget.update_global_values(value) + self.singleroot_widget.update_studio_values(NOT_SET) + self.multiroot_widget.update_studio_values(value) else: - self.singleroot_widget.update_global_values(value) - self.multiroot_widget.update_global_values(NOT_SET) + self.singleroot_widget.update_studio_values(value) + self.multiroot_widget.update_studio_values(NOT_SET) def apply_overrides(self, parent_values): # Make sure this is set to False @@ -489,9 +489,9 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): layout.addWidget(body_widget) - def update_global_values(self, values): + def update_studio_values(self, values): self._state = None - self.value_input.update_global_values(values) + self.value_input.update_studio_values(values) def apply_overrides(self, parent_values): self._state = None diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index e5bbe6d929..82a5d024b0 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -174,7 +174,7 @@ class SystemWidget(QtWidgets.QWidget): config.default_configuration() values = {"system": config.studio_configurations()} for input_field in self.input_fields: - input_field.update_global_values(values) + input_field.update_studio_values(values) for input_field in self.input_fields: input_field.hierarchical_style_update() @@ -555,7 +555,7 @@ class ProjectWidget(QtWidgets.QWidget): def _update_values(self): values = {"project": config.global_project_configurations()} for input_field in self.input_fields: - input_field.update_global_values(values) + input_field.update_studio_values(values) for input_field in self.input_fields: input_field.hierarchical_style_update() diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 14cf573398..e70b2a9b3a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -221,7 +221,7 @@ class InputObject(ConfigObject): self.set_value(self.start_value) if not self.is_overidable: - self._is_modified = self.global_value != self.item_value() + self._is_modified = self.studio_value != self.item_value() self._is_overriden = False return @@ -273,7 +273,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -300,7 +300,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.checkbox.stateChanged.connect(self._on_value_change) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if self._as_widget: value = parent_values @@ -313,10 +313,10 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): elif self.default_value is not NOT_SET: self.set_value(self.default_value) - self.global_value = value + self.studio_value = value self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value def set_value(self, value): # Ignore value change because if `self.isChecked()` has same @@ -338,7 +338,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.update_style() @@ -385,7 +385,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -413,7 +413,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.input_field.valueChanged.connect(self._on_value_change) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if self._as_widget: value = parent_values @@ -427,10 +427,10 @@ class NumberWidget(QtWidgets.QWidget, InputObject): elif self.default_value is not NOT_SET: self.set_value(self.default_value) - self.global_value = value + self.studio_value = value self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value def set_value(self, value): self.input_field.setValue(value) @@ -453,7 +453,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.update_style() @@ -502,7 +502,7 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.multiline = input_data.get("multiline", False) self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -528,7 +528,7 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.text_input.textChanged.connect(self._on_value_change) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if self._as_widget: value = parent_values @@ -541,10 +541,10 @@ class TextWidget(QtWidgets.QWidget, InputObject): elif self.default_value is not NOT_SET: self.set_value(self.default_value) - self.global_value = value + self.studio_value = value self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value def set_value(self, value): if self.multiline: @@ -570,7 +570,7 @@ class TextWidget(QtWidgets.QWidget, InputObject): elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.update_style() @@ -620,7 +620,7 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -641,7 +641,7 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self.path_input.textChanged.connect(self._on_value_change) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if self._as_widget: value = parent_values @@ -654,10 +654,10 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): elif self.default_value is not NOT_SET: self.set_value(self.default_value) - self.global_value = value + self.studio_value = value self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value def set_value(self, value): self.path_input.setText(value) @@ -684,7 +684,7 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): elif self.is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.update_style() @@ -789,7 +789,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QVBoxLayout(self) @@ -815,7 +815,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.text_input.textChanged.connect(self._on_value_change) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if self._as_widget: value = parent_values @@ -830,10 +830,10 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._is_invalid = self.text_input.has_invalid_value() - self.global_value = value + self.studio_value = value self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value def set_value(self, value): self.text_input.set_value(value) @@ -857,7 +857,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.update_style() @@ -992,7 +992,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.input_modifiers = input_data.get("input_modifiers") or {} self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET self.key = input_data["key"] @@ -1031,7 +1031,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): def clear_value(self): self.set_value([]) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): old_inputs = tuple(self.input_fields) value = NOT_SET @@ -1040,7 +1040,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) - self.global_value = value + self.studio_value = value if value is not NOT_SET: for item_value in value: @@ -1058,7 +1058,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value self.hierarchical_style_update() def set_value(self, value): @@ -1081,7 +1081,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.update_style() @@ -1114,7 +1114,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): # Set text if entered text is not None # else (when add button clicked) trigger `_on_value_change` if value is not None: - item_widget.value_input.update_global_values(value) + item_widget.value_input.update_studio_values(value) else: self._on_value_change() self.updateGeometry() @@ -1248,10 +1248,10 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.update_style() self.value_changed.emit(self) - def update_global_values(self, key, value): + def update_studio_values(self, key, value): self.origin_key = key self.key_input.setText(key) - self.value_input.update_global_values(value) + self.value_input.update_studio_values(value) def apply_overrides(self, key, value): self.origin_key = key @@ -1341,7 +1341,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self._as_widget = as_widget self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET any_parent_is_group = parent.is_group @@ -1397,7 +1397,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): def count(self): return len(self.input_fields) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): old_inputs = tuple(self.input_fields) value = NOT_SET @@ -1406,7 +1406,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) - self.global_value = value + self.studio_value = value if value is not NOT_SET: for item_key, item_value in value.items(): @@ -1424,7 +1424,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value def set_value(self, value): previous_inputs = tuple(self.input_fields) @@ -1462,7 +1462,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.update_style() @@ -1534,7 +1534,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): if self._is_overriden: item_widget.apply_overrides(key, value) else: - item_widget.update_global_values(key, value) + item_widget.update_studio_values(key, value) self.hierarchical_style_update() else: self._on_value_change() @@ -1699,13 +1699,13 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) for item in self.input_fields: - item.update_global_values(value) + item.update_studio_values(value) def apply_overrides(self, parent_values): # Make sure this is set to False @@ -1965,13 +1965,13 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) for item in self.input_fields: - item.update_global_values(value) + item.update_studio_values(value) def apply_overrides(self, parent_values): # Make sure this is set to False @@ -2062,7 +2062,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.multipath = input_data.get("multipath", False) self.override_value = NOT_SET - self.global_value = NOT_SET + self.studio_value = NOT_SET self.start_value = NOT_SET self.input_fields = [] @@ -2140,7 +2140,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.setFocusProxy(self.input_fields[0]) self.content_layout.addWidget(proxy_widget) - def update_global_values(self, parent_values): + def update_studio_values(self, parent_values): value = NOT_SET if self._as_widget: value = parent_values @@ -2148,15 +2148,15 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): value = parent_values.get(self.key, NOT_SET) if not self.multiplatform: - self.input_fields[0].update_global_values(parent_values) + self.input_fields[0].update_studio_values(parent_values) elif self.multiplatform: for input_field in self.input_fields: - input_field.update_global_values(value) + input_field.update_studio_values(value) - self.global_value = value + self.studio_value = value self.start_value = self.item_value() - self._is_modified = self.global_value != self.start_value + self._is_modified = self.studio_value != self.start_value def apply_overrides(self, parent_values): self._is_modified = False @@ -2215,7 +2215,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): elif self._is_overriden: self._is_modified = self.item_value() != self.override_value else: - self._is_modified = self.item_value() != self.global_value + self._is_modified = self.item_value() != self.studio_value self.hierarchical_style_update() @@ -2408,9 +2408,9 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() - def update_global_values(self, value): + def update_studio_values(self, value): for item in self.input_fields: - item.update_global_values(value) + item.update_studio_values(value) def _on_value_change(self, item=None): if self.ignore_value_changes: From 4d44eda38816b874bdb81581163dca28006d668c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:47:53 +0200 Subject: [PATCH 365/507] added default_value next to studio_value and override_value --- .../config_setting/widgets/inputs.py | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e70b2a9b3a..5ad97fb698 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -272,8 +272,9 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -384,8 +385,9 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -501,8 +503,9 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.multiline = input_data.get("multiline", False) - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -619,8 +622,9 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) @@ -788,8 +792,9 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.default_value = input_data.get("default", NOT_SET) - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET layout = QtWidgets.QVBoxLayout(self) @@ -991,8 +996,9 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET self.key = input_data["key"] @@ -1340,8 +1346,9 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self._state = None self._as_widget = as_widget - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET any_parent_is_group = parent.is_group @@ -2061,8 +2068,9 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.multiplatform = input_data.get("multiplatform", False) self.multipath = input_data.get("multipath", False) - self.override_value = NOT_SET + self.default_value = NOT_SET self.studio_value = NOT_SET + self.override_value = NOT_SET self.start_value = NOT_SET self.input_fields = [] From 782424139648021798517cd24a5949a7f292d1ba Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:54:59 +0200 Subject: [PATCH 366/507] removed reset_value method --- .../config_setting/widgets/inputs.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 5ad97fb698..54b7bf96e4 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -440,9 +440,6 @@ class NumberWidget(QtWidgets.QWidget, InputObject): def clear_value(self): self.set_value(0) - def reset_value(self): - self.set_value(self.start_value) - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -555,9 +552,6 @@ class TextWidget(QtWidgets.QWidget, InputObject): else: self.text_input.setText(value) - def reset_value(self): - self.set_value(self.start_value) - def clear_value(self): self.set_value("") @@ -666,9 +660,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): self.path_input.setText(value) - def reset_value(self): - self.set_value(self.start_value) - def clear_value(self): self.set_value("") @@ -843,9 +834,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): self.text_input.set_value(value) - def reset_value(self): - self.set_value(self.start_value) - def clear_value(self): self.set_value("") @@ -1031,9 +1019,6 @@ class ListWidget(QtWidgets.QWidget, InputObject): def count(self): return len(self.input_fields) - def reset_value(self): - self.set_value(self.start_value) - def clear_value(self): self.set_value([]) @@ -2203,10 +2188,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): _value = value[input_field.key] input_field.set_value(_value) - def reset_value(self): - for input_field in self.input_fields: - input_field.reset_value() - def clear_value(self): for input_field in self.input_fields: input_field.clear_value() From f263a71e6b02bd25ea804b741f70d2b7a8aef292 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 11:56:24 +0200 Subject: [PATCH 367/507] removed clear value --- .../config_setting/widgets/anatomy_inputs.py | 3 --- .../config_setting/widgets/inputs.py | 22 ------------------- 2 files changed, 25 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 957691cbdc..fbc3a3a2ed 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -102,9 +102,6 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): def set_value(self, value): raise TypeError("AnatomyWidget does not allow to use `set_value`") - def clear_value(self): - raise TypeError("AnatomyWidget does not allow to use `clear_value`") - def _on_value_change(self, item=None): if self.ignore_value_changes: return diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 54b7bf96e4..40de1c1347 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -324,9 +324,6 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): # value as `value` the `_on_value_change` is not triggered self.checkbox.setChecked(value) - def clear_value(self): - self.set_value(False) - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -437,9 +434,6 @@ class NumberWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): self.input_field.setValue(value) - def clear_value(self): - self.set_value(0) - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -552,9 +546,6 @@ class TextWidget(QtWidgets.QWidget, InputObject): else: self.text_input.setText(value) - def clear_value(self): - self.set_value("") - def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -660,9 +651,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): self.path_input.setText(value) - def clear_value(self): - self.set_value("") - def focusOutEvent(self, event): self.path_input.clear_end_path() super(PathInput, self).focusOutEvent(event) @@ -834,9 +822,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): self.text_input.set_value(value) - def clear_value(self): - self.set_value("") - def _on_value_change(self, item=None): self._is_invalid = self.text_input.has_invalid_value() if self.ignore_value_changes: @@ -1019,9 +1004,6 @@ class ListWidget(QtWidgets.QWidget, InputObject): def count(self): return len(self.input_fields) - def clear_value(self): - self.set_value([]) - def update_studio_values(self, parent_values): old_inputs = tuple(self.input_fields) @@ -2188,10 +2170,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): _value = value[input_field.key] input_field.set_value(_value) - def clear_value(self): - for input_field in self.input_fields: - input_field.clear_value() - def _on_value_change(self, item=None): if self.ignore_value_changes: return From 9924b2899e39a4c9c6d839430076184c865cdd22 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:06:19 +0200 Subject: [PATCH 368/507] removed default from schemas and laoding from schemas --- .../projects_schema/1_plugins_gui_schema.json | 120 ++++++------------ .../config_setting/widgets/inputs.py | 8 -- 2 files changed, 40 insertions(+), 88 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 302d1dad0a..597f51d6fd 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -27,41 +27,34 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": true + "label": "Enabled" }, { "type": "dict-form", "children": [ { "type": "text", "key": "deadline_department", - "label": "Deadline apartment", - "default": "" + "label": "Deadline apartment" }, { "type": "number", "key": "deadline_priority", - "label": "Deadline priority", - "default": 50 + "label": "Deadline priority" }, { "type": "text", "key": "deadline_pool", - "label": "Deadline pool", - "default": "" + "label": "Deadline pool" }, { "type": "text", "key": "deadline_pool_secondary", - "label": "Deadline pool (secondary)", - "default": "" + "label": "Deadline pool (secondary)" }, { "type": "text", "key": "deadline_group", - "label": "Deadline Group", - "default": "" + "label": "Deadline Group" }, { "type": "number", "key": "deadline_chunk_size", - "label": "Deadline Chunk size", - "default": 10 + "label": "Deadline Chunk size" } ] } @@ -93,19 +86,16 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": false + "label": "Enabled" }, { "type": "text", "key": "note_with_intent_template", - "label": "Note with intent template", - "default": "{intent}: {comment}" + "label": "Note with intent template" }, { "type": "list", "object_type": "text", "key": "note_labels", - "label": "Note labels", - "default": [] + "label": "Note labels" } ] } @@ -154,14 +144,12 @@ "type": "list", "object_type": "text", "key": "input", - "label": "FFmpeg input arguments", - "default": [] + "label": "FFmpeg input arguments" }, { "type": "list", "object_type": "text", "key": "output", - "label": "FFmpeg output arguments", - "default": [] + "label": "FFmpeg output arguments" } ] } @@ -177,13 +165,11 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": true + "label": "Enabled" }, { "type": "raw-json", "key": "profiles", - "label": "Profiles", - "default": [] + "label": "Profiles" } ] }, { @@ -207,33 +193,27 @@ { "type": "number", "key": "font_size", - "label": "Font size", - "default": 42 + "label": "Font size" }, { "type": "number", "key": "opacity", - "label": "Font opacity", - "default": 1 + "label": "Font opacity" }, { "type": "number", "key": "bg_opacity", - "label": "Background opacity", - "default": 1 + "label": "Background opacity" }, { "type": "number", "key": "x_offset", - "label": "X Offset", - "default": 5 + "label": "X Offset" }, { "type": "number", "key": "y_offset", - "label": "Y Offset", - "default": 5 + "label": "Y Offset" }, { "type": "number", "key": "bg_padding", - "label": "Padding aroung text", - "default": 5 + "label": "Padding aroung text" } ] }, { @@ -316,8 +296,7 @@ }, { "type": "text", "key": "regex", - "label": "Validation regex", - "default": "(.*)_(\\d)*_(?P.*)_(GEO)" + "label": "Validation regex" } ] }, { @@ -349,8 +328,7 @@ }, { "type": "text", "key": "regex", - "label": "Validation regex", - "default": "(?P.*)_(.*)_SHD" + "label": "Validation regex" } ] }, { @@ -397,8 +375,7 @@ { "type": "text", "key": "fpath_template", - "label": "Path template", - "default": "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}" + "label": "Path template" } ] }, { @@ -411,8 +388,7 @@ { "type": "text", "key": "fpath_template", - "label": "Path template", - "default": "{work}/prerenders/nuke/{subset}/{subset}.{frame}.{ext}" + "label": "Path template" } ] } @@ -434,8 +410,7 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": true + "label": "Enabled" }, { "type": "raw-json", "key": "nodes", @@ -453,8 +428,7 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": false + "label": "Enabled" }, { "type": "raw-json", "key": "knobs", @@ -472,8 +446,7 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": false + "label": "Enabled" } ] }, { @@ -487,13 +460,11 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": true + "label": "Enabled" }, { "type": "boolean", "key": "viewer_lut_raw", - "label": "Viewer LUT raw", - "default": false + "label": "Viewer LUT raw" } ] }, { @@ -506,8 +477,7 @@ { "type": "boolean", "key": "viewer_lut_raw", - "label": "Viewer LUT raw", - "default": false + "label": "Viewer LUT raw" } ] }, { @@ -520,23 +490,19 @@ { "type": "number", "key": "deadline_priority", - "label": "deadline_priority", - "default": 50 + "label": "deadline_priority" }, { "type": "text", "key": "deadline_pool", - "label": "deadline_pool", - "default": "" + "label": "deadline_pool" }, { "type": "text", "key": "deadline_pool_secondary", - "label": "deadline_pool_secondary", - "default": "" + "label": "deadline_pool_secondary" }, { "type": "number", "key": "deadline_chunk_size", - "label": "deadline_chunk_size", - "default": 1 + "label": "deadline_chunk_size" } ] } @@ -570,8 +536,7 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": false + "label": "Enabled" } ] }, { @@ -585,14 +550,12 @@ { "type": "boolean", "key": "enabled", - "label": "Enabled", - "default": true + "label": "Enabled" }, { "type": "list", "object_type": "text", "key": "tags_addition", - "label": "Tags addition", - "default": [] + "label": "Tags addition" } ] } @@ -621,18 +584,15 @@ { "type": "text", "key": "clipName", - "label": "Clip name template", - "default": "{track}{sequence}{shot}" + "label": "Clip name template" }, { "type": "text", "key": "folder", - "label": "Folder", - "default": "takes" + "label": "Folder" }, { "type": "number", "key": "steps", - "label": "Steps", - "default": 20 + "label": "Steps" } ] } diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 40de1c1347..16ecd5cd1a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -270,7 +270,6 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) self.default_value = NOT_SET self.studio_value = NOT_SET @@ -380,7 +379,6 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) self.default_value = NOT_SET self.studio_value = NOT_SET @@ -490,7 +488,6 @@ class TextWidget(QtWidgets.QWidget, InputObject): self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) self.multiline = input_data.get("multiline", False) @@ -605,7 +602,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) self.default_value = NOT_SET self.studio_value = NOT_SET @@ -769,7 +765,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) self.default_value = NOT_SET self.studio_value = NOT_SET @@ -966,7 +961,6 @@ class ListWidget(QtWidgets.QWidget, InputObject): self._is_nullable = input_data.get("is_nullable", False) self.object_type = input_data["object_type"] - self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} self.default_value = NOT_SET @@ -1363,7 +1357,6 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.object_type = input_data["object_type"] - self.default_value = input_data.get("default", NOT_SET) self.input_modifiers = input_data.get("input_modifiers") or {} self.add_row(is_empty=True) @@ -2031,7 +2024,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self._is_group = False self._is_nullable = input_data.get("is_nullable", False) - self.default_value = input_data.get("default", NOT_SET) self.multiplatform = input_data.get("multiplatform", False) self.multipath = input_data.get("multipath", False) From 022214a992e0468d16b1f73c41ac2da618b4aeb5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:08:48 +0200 Subject: [PATCH 369/507] has studi ooverrides is False by default --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 16ecd5cd1a..057ed3b584 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -16,7 +16,7 @@ class ConfigObject(AbstractConfigObject): default_state = "" - _has_studio_override = True + _has_studio_override = False _as_widget = False _is_overriden = False _is_modified = False From ef2b0c955e5c7466a45ebf3c58ff8e32e924c212 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:12:08 +0200 Subject: [PATCH 370/507] studio_configuration folder renamed to system_configuration --- .../environments/avalon.json | 0 .../environments/blender.json | 0 .../environments/celaction.json | 0 .../environments/deadline.json | 0 .../environments/ftrack.json | 0 .../environments/global.json | 0 .../environments/harmony.json | 0 .../environments/houdini.json | 0 .../environments/maya.json | 0 .../environments/maya_2018.json | 0 .../environments/maya_2020.json | 0 .../environments/mayabatch.json | 0 .../environments/mayabatch_2019.json | 0 .../environments/mtoa_3.1.1.json | 0 .../environments/muster.json | 0 .../environments/nuke.json | 0 .../environments/nukestudio.json | 0 .../environments/nukestudio_10.0.json | 0 .../environments/nukex.json | 0 .../environments/nukex_10.0.json | 0 .../environments/photoshop.json | 0 .../environments/premiere.json | 0 .../environments/resolve.json | 0 .../environments/storyboardpro.json | 0 .../environments/unreal_4.24.json | 0 .../environments/vray_4300.json | 0 .../global/applications.json | 0 .../global/intent.json | 0 .../global/tools.json | 0 .../global/tray_modules.json | 0 .../launchers/blender_2.80.toml | 0 .../launchers/blender_2.81.toml | 0 .../launchers/blender_2.82.toml | 0 .../launchers/blender_2.83.toml | 0 .../launchers/celaction_local.toml | 0 .../launchers/celaction_publish.toml | 0 .../launchers/darwin/blender_2.82 | 0 .../launchers/darwin/harmony_17 | 0 .../launchers/darwin/harmony_17_launch | 0 .../launchers/darwin/python3 | 0 .../launchers/harmony_17.toml | 0 .../launchers/houdini_16.toml | 0 .../launchers/houdini_17.toml | 0 .../launchers/houdini_18.toml | 0 .../launchers/linux/maya2016 | 0 .../launchers/linux/maya2017 | 0 .../launchers/linux/maya2018 | 0 .../launchers/linux/maya2019 | 0 .../launchers/linux/maya2020 | 0 .../launchers/linux/nuke11.3 | 0 .../launchers/linux/nuke12.0 | 0 .../launchers/linux/nukestudio11.3 | 0 .../launchers/linux/nukestudio12.0 | 0 .../launchers/linux/nukex11.3 | 0 .../launchers/linux/nukex12.0 | 0 .../launchers/maya_2016.toml | 0 .../launchers/maya_2017.toml | 0 .../launchers/maya_2018.toml | 0 .../launchers/maya_2019.toml | 0 .../launchers/maya_2020.toml | 0 .../launchers/mayabatch_2019.toml | 0 .../launchers/mayabatch_2020.toml | 0 .../launchers/mayapy2016.toml | 0 .../launchers/mayapy2017.toml | 0 .../launchers/mayapy2018.toml | 0 .../launchers/mayapy2019.toml | 0 .../launchers/mayapy2020.toml | 0 .../launchers/myapp.toml | 0 .../launchers/nuke_10.0.toml | 0 .../launchers/nuke_11.0.toml | 0 .../launchers/nuke_11.2.toml | 0 .../launchers/nuke_11.3.toml | 0 .../launchers/nuke_12.0.toml | 0 .../launchers/nukestudio_10.0.toml | 0 .../launchers/nukestudio_11.0.toml | 0 .../launchers/nukestudio_11.2.toml | 0 .../launchers/nukestudio_11.3.toml | 0 .../launchers/nukestudio_12.0.toml | 0 .../launchers/nukex_10.0.toml | 0 .../launchers/nukex_11.0.toml | 0 .../launchers/nukex_11.2.toml | 0 .../launchers/nukex_11.3.toml | 0 .../launchers/nukex_12.0.toml | 0 .../launchers/photoshop_2020.toml | 0 .../launchers/premiere_2019.toml | 0 .../launchers/premiere_2020.toml | 0 .../launchers/python_2.toml | 0 .../launchers/python_3.toml | 0 .../launchers/resolve_16.toml | 0 .../launchers/shell.toml | 0 .../launchers/storyboardpro_7.toml | 0 .../launchers/unreal_4.24.toml | 0 .../launchers/windows/blender_2.80.bat | 0 .../launchers/windows/blender_2.81.bat | 0 .../launchers/windows/blender_2.82.bat | 0 .../launchers/windows/blender_2.83.bat | 0 .../launchers/windows/celaction_local.bat | 0 .../launchers/windows/celaction_publish.bat | 0 .../launchers/windows/harmony_17.bat | 0 .../launchers/windows/houdini_16.bat | 0 .../launchers/windows/houdini_17.bat | 0 .../launchers/windows/houdini_18.bat | 0 .../launchers/windows/maya2016.bat | 0 .../launchers/windows/maya2017.bat | 0 .../launchers/windows/maya2018.bat | 0 .../launchers/windows/maya2019.bat | 0 .../launchers/windows/maya2020.bat | 0 .../launchers/windows/mayabatch2019.bat | 0 .../launchers/windows/mayabatch2020.bat | 0 .../launchers/windows/mayapy2016.bat | 0 .../launchers/windows/mayapy2017.bat | 0 .../launchers/windows/mayapy2018.bat | 0 .../launchers/windows/mayapy2019.bat | 0 .../launchers/windows/mayapy2020.bat | 0 .../launchers/windows/nuke10.0.bat | 0 .../launchers/windows/nuke11.0.bat | 0 .../launchers/windows/nuke11.2.bat | 0 .../launchers/windows/nuke11.3.bat | 0 .../launchers/windows/nuke12.0.bat | 0 .../launchers/windows/nukestudio10.0.bat | 0 .../launchers/windows/nukestudio11.0.bat | 0 .../launchers/windows/nukestudio11.2.bat | 0 .../launchers/windows/nukestudio11.3.bat | 0 .../launchers/windows/nukestudio12.0.bat | 0 .../launchers/windows/nukex10.0.bat | 0 .../launchers/windows/nukex11.0.bat | 0 .../launchers/windows/nukex11.2.bat | 0 .../launchers/windows/nukex11.3.bat | 0 .../launchers/windows/nukex12.0.bat | 0 .../launchers/windows/photoshop_2020.bat | 0 .../launchers/windows/premiere_pro_2019.bat | 0 .../launchers/windows/premiere_pro_2020.bat | 0 .../launchers/windows/python3.bat | 0 .../launchers/windows/resolve_16.bat | 0 .../launchers/windows/shell.bat | 0 .../launchers/windows/storyboardpro_7.bat | 0 .../launchers/windows/unreal.bat | 0 .../muster/templates_mapping.json | 0 .../standalone_publish/families.json | 0 139 files changed, 0 insertions(+), 0 deletions(-) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/avalon.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/blender.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/celaction.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/deadline.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/ftrack.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/global.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/harmony.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/houdini.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/maya.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/maya_2018.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/maya_2020.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/mayabatch.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/mayabatch_2019.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/mtoa_3.1.1.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/muster.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/nuke.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/nukestudio.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/nukestudio_10.0.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/nukex.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/nukex_10.0.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/photoshop.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/premiere.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/resolve.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/storyboardpro.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/unreal_4.24.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/environments/vray_4300.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/global/applications.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/global/intent.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/global/tools.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/global/tray_modules.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/blender_2.80.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/blender_2.81.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/blender_2.82.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/blender_2.83.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/celaction_local.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/celaction_publish.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/darwin/blender_2.82 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/darwin/harmony_17 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/darwin/harmony_17_launch (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/darwin/python3 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/harmony_17.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/houdini_16.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/houdini_17.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/houdini_18.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/maya2016 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/maya2017 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/maya2018 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/maya2019 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/maya2020 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/nuke11.3 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/nuke12.0 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/nukestudio11.3 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/nukestudio12.0 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/nukex11.3 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/linux/nukex12.0 (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/maya_2016.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/maya_2017.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/maya_2018.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/maya_2019.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/maya_2020.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/mayabatch_2019.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/mayabatch_2020.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/mayapy2016.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/mayapy2017.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/mayapy2018.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/mayapy2019.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/mayapy2020.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/myapp.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nuke_10.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nuke_11.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nuke_11.2.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nuke_11.3.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nuke_12.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukestudio_10.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukestudio_11.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukestudio_11.2.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukestudio_11.3.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukestudio_12.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukex_10.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukex_11.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukex_11.2.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukex_11.3.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/nukex_12.0.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/photoshop_2020.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/premiere_2019.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/premiere_2020.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/python_2.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/python_3.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/resolve_16.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/shell.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/storyboardpro_7.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/unreal_4.24.toml (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/blender_2.80.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/blender_2.81.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/blender_2.82.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/blender_2.83.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/celaction_local.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/celaction_publish.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/harmony_17.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/houdini_16.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/houdini_17.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/houdini_18.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/maya2016.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/maya2017.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/maya2018.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/maya2019.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/maya2020.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/mayabatch2019.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/mayabatch2020.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/mayapy2016.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/mayapy2017.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/mayapy2018.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/mayapy2019.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/mayapy2020.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nuke10.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nuke11.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nuke11.2.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nuke11.3.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nuke12.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukestudio10.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukestudio11.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukestudio11.2.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukestudio11.3.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukestudio12.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukex10.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukex11.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukex11.2.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukex11.3.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/nukex12.0.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/photoshop_2020.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/premiere_pro_2019.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/premiere_pro_2020.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/python3.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/resolve_16.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/shell.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/storyboardpro_7.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/launchers/windows/unreal.bat (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/muster/templates_mapping.json (100%) rename pype/configurations/defaults/{studio_configurations => system_configurations}/standalone_publish/families.json (100%) diff --git a/pype/configurations/defaults/studio_configurations/environments/avalon.json b/pype/configurations/defaults/system_configurations/environments/avalon.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/avalon.json rename to pype/configurations/defaults/system_configurations/environments/avalon.json diff --git a/pype/configurations/defaults/studio_configurations/environments/blender.json b/pype/configurations/defaults/system_configurations/environments/blender.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/blender.json rename to pype/configurations/defaults/system_configurations/environments/blender.json diff --git a/pype/configurations/defaults/studio_configurations/environments/celaction.json b/pype/configurations/defaults/system_configurations/environments/celaction.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/celaction.json rename to pype/configurations/defaults/system_configurations/environments/celaction.json diff --git a/pype/configurations/defaults/studio_configurations/environments/deadline.json b/pype/configurations/defaults/system_configurations/environments/deadline.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/deadline.json rename to pype/configurations/defaults/system_configurations/environments/deadline.json diff --git a/pype/configurations/defaults/studio_configurations/environments/ftrack.json b/pype/configurations/defaults/system_configurations/environments/ftrack.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/ftrack.json rename to pype/configurations/defaults/system_configurations/environments/ftrack.json diff --git a/pype/configurations/defaults/studio_configurations/environments/global.json b/pype/configurations/defaults/system_configurations/environments/global.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/global.json rename to pype/configurations/defaults/system_configurations/environments/global.json diff --git a/pype/configurations/defaults/studio_configurations/environments/harmony.json b/pype/configurations/defaults/system_configurations/environments/harmony.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/harmony.json rename to pype/configurations/defaults/system_configurations/environments/harmony.json diff --git a/pype/configurations/defaults/studio_configurations/environments/houdini.json b/pype/configurations/defaults/system_configurations/environments/houdini.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/houdini.json rename to pype/configurations/defaults/system_configurations/environments/houdini.json diff --git a/pype/configurations/defaults/studio_configurations/environments/maya.json b/pype/configurations/defaults/system_configurations/environments/maya.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/maya.json rename to pype/configurations/defaults/system_configurations/environments/maya.json diff --git a/pype/configurations/defaults/studio_configurations/environments/maya_2018.json b/pype/configurations/defaults/system_configurations/environments/maya_2018.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/maya_2018.json rename to pype/configurations/defaults/system_configurations/environments/maya_2018.json diff --git a/pype/configurations/defaults/studio_configurations/environments/maya_2020.json b/pype/configurations/defaults/system_configurations/environments/maya_2020.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/maya_2020.json rename to pype/configurations/defaults/system_configurations/environments/maya_2020.json diff --git a/pype/configurations/defaults/studio_configurations/environments/mayabatch.json b/pype/configurations/defaults/system_configurations/environments/mayabatch.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/mayabatch.json rename to pype/configurations/defaults/system_configurations/environments/mayabatch.json diff --git a/pype/configurations/defaults/studio_configurations/environments/mayabatch_2019.json b/pype/configurations/defaults/system_configurations/environments/mayabatch_2019.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/mayabatch_2019.json rename to pype/configurations/defaults/system_configurations/environments/mayabatch_2019.json diff --git a/pype/configurations/defaults/studio_configurations/environments/mtoa_3.1.1.json b/pype/configurations/defaults/system_configurations/environments/mtoa_3.1.1.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/mtoa_3.1.1.json rename to pype/configurations/defaults/system_configurations/environments/mtoa_3.1.1.json diff --git a/pype/configurations/defaults/studio_configurations/environments/muster.json b/pype/configurations/defaults/system_configurations/environments/muster.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/muster.json rename to pype/configurations/defaults/system_configurations/environments/muster.json diff --git a/pype/configurations/defaults/studio_configurations/environments/nuke.json b/pype/configurations/defaults/system_configurations/environments/nuke.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/nuke.json rename to pype/configurations/defaults/system_configurations/environments/nuke.json diff --git a/pype/configurations/defaults/studio_configurations/environments/nukestudio.json b/pype/configurations/defaults/system_configurations/environments/nukestudio.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/nukestudio.json rename to pype/configurations/defaults/system_configurations/environments/nukestudio.json diff --git a/pype/configurations/defaults/studio_configurations/environments/nukestudio_10.0.json b/pype/configurations/defaults/system_configurations/environments/nukestudio_10.0.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/nukestudio_10.0.json rename to pype/configurations/defaults/system_configurations/environments/nukestudio_10.0.json diff --git a/pype/configurations/defaults/studio_configurations/environments/nukex.json b/pype/configurations/defaults/system_configurations/environments/nukex.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/nukex.json rename to pype/configurations/defaults/system_configurations/environments/nukex.json diff --git a/pype/configurations/defaults/studio_configurations/environments/nukex_10.0.json b/pype/configurations/defaults/system_configurations/environments/nukex_10.0.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/nukex_10.0.json rename to pype/configurations/defaults/system_configurations/environments/nukex_10.0.json diff --git a/pype/configurations/defaults/studio_configurations/environments/photoshop.json b/pype/configurations/defaults/system_configurations/environments/photoshop.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/photoshop.json rename to pype/configurations/defaults/system_configurations/environments/photoshop.json diff --git a/pype/configurations/defaults/studio_configurations/environments/premiere.json b/pype/configurations/defaults/system_configurations/environments/premiere.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/premiere.json rename to pype/configurations/defaults/system_configurations/environments/premiere.json diff --git a/pype/configurations/defaults/studio_configurations/environments/resolve.json b/pype/configurations/defaults/system_configurations/environments/resolve.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/resolve.json rename to pype/configurations/defaults/system_configurations/environments/resolve.json diff --git a/pype/configurations/defaults/studio_configurations/environments/storyboardpro.json b/pype/configurations/defaults/system_configurations/environments/storyboardpro.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/storyboardpro.json rename to pype/configurations/defaults/system_configurations/environments/storyboardpro.json diff --git a/pype/configurations/defaults/studio_configurations/environments/unreal_4.24.json b/pype/configurations/defaults/system_configurations/environments/unreal_4.24.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/unreal_4.24.json rename to pype/configurations/defaults/system_configurations/environments/unreal_4.24.json diff --git a/pype/configurations/defaults/studio_configurations/environments/vray_4300.json b/pype/configurations/defaults/system_configurations/environments/vray_4300.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/environments/vray_4300.json rename to pype/configurations/defaults/system_configurations/environments/vray_4300.json diff --git a/pype/configurations/defaults/studio_configurations/global/applications.json b/pype/configurations/defaults/system_configurations/global/applications.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/global/applications.json rename to pype/configurations/defaults/system_configurations/global/applications.json diff --git a/pype/configurations/defaults/studio_configurations/global/intent.json b/pype/configurations/defaults/system_configurations/global/intent.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/global/intent.json rename to pype/configurations/defaults/system_configurations/global/intent.json diff --git a/pype/configurations/defaults/studio_configurations/global/tools.json b/pype/configurations/defaults/system_configurations/global/tools.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/global/tools.json rename to pype/configurations/defaults/system_configurations/global/tools.json diff --git a/pype/configurations/defaults/studio_configurations/global/tray_modules.json b/pype/configurations/defaults/system_configurations/global/tray_modules.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/global/tray_modules.json rename to pype/configurations/defaults/system_configurations/global/tray_modules.json diff --git a/pype/configurations/defaults/studio_configurations/launchers/blender_2.80.toml b/pype/configurations/defaults/system_configurations/launchers/blender_2.80.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/blender_2.80.toml rename to pype/configurations/defaults/system_configurations/launchers/blender_2.80.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/blender_2.81.toml b/pype/configurations/defaults/system_configurations/launchers/blender_2.81.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/blender_2.81.toml rename to pype/configurations/defaults/system_configurations/launchers/blender_2.81.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/blender_2.82.toml b/pype/configurations/defaults/system_configurations/launchers/blender_2.82.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/blender_2.82.toml rename to pype/configurations/defaults/system_configurations/launchers/blender_2.82.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/blender_2.83.toml b/pype/configurations/defaults/system_configurations/launchers/blender_2.83.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/blender_2.83.toml rename to pype/configurations/defaults/system_configurations/launchers/blender_2.83.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/celaction_local.toml b/pype/configurations/defaults/system_configurations/launchers/celaction_local.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/celaction_local.toml rename to pype/configurations/defaults/system_configurations/launchers/celaction_local.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/celaction_publish.toml b/pype/configurations/defaults/system_configurations/launchers/celaction_publish.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/celaction_publish.toml rename to pype/configurations/defaults/system_configurations/launchers/celaction_publish.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/darwin/blender_2.82 b/pype/configurations/defaults/system_configurations/launchers/darwin/blender_2.82 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/darwin/blender_2.82 rename to pype/configurations/defaults/system_configurations/launchers/darwin/blender_2.82 diff --git a/pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17 b/pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17 rename to pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17 diff --git a/pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17_launch b/pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17_launch similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/darwin/harmony_17_launch rename to pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17_launch diff --git a/pype/configurations/defaults/studio_configurations/launchers/darwin/python3 b/pype/configurations/defaults/system_configurations/launchers/darwin/python3 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/darwin/python3 rename to pype/configurations/defaults/system_configurations/launchers/darwin/python3 diff --git a/pype/configurations/defaults/studio_configurations/launchers/harmony_17.toml b/pype/configurations/defaults/system_configurations/launchers/harmony_17.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/harmony_17.toml rename to pype/configurations/defaults/system_configurations/launchers/harmony_17.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/houdini_16.toml b/pype/configurations/defaults/system_configurations/launchers/houdini_16.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/houdini_16.toml rename to pype/configurations/defaults/system_configurations/launchers/houdini_16.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/houdini_17.toml b/pype/configurations/defaults/system_configurations/launchers/houdini_17.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/houdini_17.toml rename to pype/configurations/defaults/system_configurations/launchers/houdini_17.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/houdini_18.toml b/pype/configurations/defaults/system_configurations/launchers/houdini_18.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/houdini_18.toml rename to pype/configurations/defaults/system_configurations/launchers/houdini_18.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/maya2016 b/pype/configurations/defaults/system_configurations/launchers/linux/maya2016 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/maya2016 rename to pype/configurations/defaults/system_configurations/launchers/linux/maya2016 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/maya2017 b/pype/configurations/defaults/system_configurations/launchers/linux/maya2017 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/maya2017 rename to pype/configurations/defaults/system_configurations/launchers/linux/maya2017 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/maya2018 b/pype/configurations/defaults/system_configurations/launchers/linux/maya2018 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/maya2018 rename to pype/configurations/defaults/system_configurations/launchers/linux/maya2018 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/maya2019 b/pype/configurations/defaults/system_configurations/launchers/linux/maya2019 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/maya2019 rename to pype/configurations/defaults/system_configurations/launchers/linux/maya2019 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/maya2020 b/pype/configurations/defaults/system_configurations/launchers/linux/maya2020 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/maya2020 rename to pype/configurations/defaults/system_configurations/launchers/linux/maya2020 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/nuke11.3 b/pype/configurations/defaults/system_configurations/launchers/linux/nuke11.3 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/nuke11.3 rename to pype/configurations/defaults/system_configurations/launchers/linux/nuke11.3 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/nuke12.0 b/pype/configurations/defaults/system_configurations/launchers/linux/nuke12.0 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/nuke12.0 rename to pype/configurations/defaults/system_configurations/launchers/linux/nuke12.0 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio11.3 b/pype/configurations/defaults/system_configurations/launchers/linux/nukestudio11.3 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio11.3 rename to pype/configurations/defaults/system_configurations/launchers/linux/nukestudio11.3 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio12.0 b/pype/configurations/defaults/system_configurations/launchers/linux/nukestudio12.0 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/nukestudio12.0 rename to pype/configurations/defaults/system_configurations/launchers/linux/nukestudio12.0 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/nukex11.3 b/pype/configurations/defaults/system_configurations/launchers/linux/nukex11.3 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/nukex11.3 rename to pype/configurations/defaults/system_configurations/launchers/linux/nukex11.3 diff --git a/pype/configurations/defaults/studio_configurations/launchers/linux/nukex12.0 b/pype/configurations/defaults/system_configurations/launchers/linux/nukex12.0 similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/linux/nukex12.0 rename to pype/configurations/defaults/system_configurations/launchers/linux/nukex12.0 diff --git a/pype/configurations/defaults/studio_configurations/launchers/maya_2016.toml b/pype/configurations/defaults/system_configurations/launchers/maya_2016.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/maya_2016.toml rename to pype/configurations/defaults/system_configurations/launchers/maya_2016.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/maya_2017.toml b/pype/configurations/defaults/system_configurations/launchers/maya_2017.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/maya_2017.toml rename to pype/configurations/defaults/system_configurations/launchers/maya_2017.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/maya_2018.toml b/pype/configurations/defaults/system_configurations/launchers/maya_2018.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/maya_2018.toml rename to pype/configurations/defaults/system_configurations/launchers/maya_2018.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/maya_2019.toml b/pype/configurations/defaults/system_configurations/launchers/maya_2019.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/maya_2019.toml rename to pype/configurations/defaults/system_configurations/launchers/maya_2019.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/maya_2020.toml b/pype/configurations/defaults/system_configurations/launchers/maya_2020.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/maya_2020.toml rename to pype/configurations/defaults/system_configurations/launchers/maya_2020.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/mayabatch_2019.toml b/pype/configurations/defaults/system_configurations/launchers/mayabatch_2019.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/mayabatch_2019.toml rename to pype/configurations/defaults/system_configurations/launchers/mayabatch_2019.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/mayabatch_2020.toml b/pype/configurations/defaults/system_configurations/launchers/mayabatch_2020.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/mayabatch_2020.toml rename to pype/configurations/defaults/system_configurations/launchers/mayabatch_2020.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/mayapy2016.toml b/pype/configurations/defaults/system_configurations/launchers/mayapy2016.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/mayapy2016.toml rename to pype/configurations/defaults/system_configurations/launchers/mayapy2016.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/mayapy2017.toml b/pype/configurations/defaults/system_configurations/launchers/mayapy2017.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/mayapy2017.toml rename to pype/configurations/defaults/system_configurations/launchers/mayapy2017.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/mayapy2018.toml b/pype/configurations/defaults/system_configurations/launchers/mayapy2018.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/mayapy2018.toml rename to pype/configurations/defaults/system_configurations/launchers/mayapy2018.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/mayapy2019.toml b/pype/configurations/defaults/system_configurations/launchers/mayapy2019.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/mayapy2019.toml rename to pype/configurations/defaults/system_configurations/launchers/mayapy2019.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/mayapy2020.toml b/pype/configurations/defaults/system_configurations/launchers/mayapy2020.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/mayapy2020.toml rename to pype/configurations/defaults/system_configurations/launchers/mayapy2020.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/myapp.toml b/pype/configurations/defaults/system_configurations/launchers/myapp.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/myapp.toml rename to pype/configurations/defaults/system_configurations/launchers/myapp.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nuke_10.0.toml b/pype/configurations/defaults/system_configurations/launchers/nuke_10.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nuke_10.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nuke_10.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nuke_11.0.toml b/pype/configurations/defaults/system_configurations/launchers/nuke_11.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nuke_11.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nuke_11.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nuke_11.2.toml b/pype/configurations/defaults/system_configurations/launchers/nuke_11.2.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nuke_11.2.toml rename to pype/configurations/defaults/system_configurations/launchers/nuke_11.2.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nuke_11.3.toml b/pype/configurations/defaults/system_configurations/launchers/nuke_11.3.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nuke_11.3.toml rename to pype/configurations/defaults/system_configurations/launchers/nuke_11.3.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nuke_12.0.toml b/pype/configurations/defaults/system_configurations/launchers/nuke_12.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nuke_12.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nuke_12.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukestudio_10.0.toml b/pype/configurations/defaults/system_configurations/launchers/nukestudio_10.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukestudio_10.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nukestudio_10.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.0.toml b/pype/configurations/defaults/system_configurations/launchers/nukestudio_11.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nukestudio_11.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.2.toml b/pype/configurations/defaults/system_configurations/launchers/nukestudio_11.2.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.2.toml rename to pype/configurations/defaults/system_configurations/launchers/nukestudio_11.2.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.3.toml b/pype/configurations/defaults/system_configurations/launchers/nukestudio_11.3.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukestudio_11.3.toml rename to pype/configurations/defaults/system_configurations/launchers/nukestudio_11.3.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukestudio_12.0.toml b/pype/configurations/defaults/system_configurations/launchers/nukestudio_12.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukestudio_12.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nukestudio_12.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukex_10.0.toml b/pype/configurations/defaults/system_configurations/launchers/nukex_10.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukex_10.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nukex_10.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukex_11.0.toml b/pype/configurations/defaults/system_configurations/launchers/nukex_11.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukex_11.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nukex_11.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukex_11.2.toml b/pype/configurations/defaults/system_configurations/launchers/nukex_11.2.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukex_11.2.toml rename to pype/configurations/defaults/system_configurations/launchers/nukex_11.2.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukex_11.3.toml b/pype/configurations/defaults/system_configurations/launchers/nukex_11.3.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukex_11.3.toml rename to pype/configurations/defaults/system_configurations/launchers/nukex_11.3.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/nukex_12.0.toml b/pype/configurations/defaults/system_configurations/launchers/nukex_12.0.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/nukex_12.0.toml rename to pype/configurations/defaults/system_configurations/launchers/nukex_12.0.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/photoshop_2020.toml b/pype/configurations/defaults/system_configurations/launchers/photoshop_2020.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/photoshop_2020.toml rename to pype/configurations/defaults/system_configurations/launchers/photoshop_2020.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/premiere_2019.toml b/pype/configurations/defaults/system_configurations/launchers/premiere_2019.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/premiere_2019.toml rename to pype/configurations/defaults/system_configurations/launchers/premiere_2019.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/premiere_2020.toml b/pype/configurations/defaults/system_configurations/launchers/premiere_2020.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/premiere_2020.toml rename to pype/configurations/defaults/system_configurations/launchers/premiere_2020.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/python_2.toml b/pype/configurations/defaults/system_configurations/launchers/python_2.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/python_2.toml rename to pype/configurations/defaults/system_configurations/launchers/python_2.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/python_3.toml b/pype/configurations/defaults/system_configurations/launchers/python_3.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/python_3.toml rename to pype/configurations/defaults/system_configurations/launchers/python_3.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/resolve_16.toml b/pype/configurations/defaults/system_configurations/launchers/resolve_16.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/resolve_16.toml rename to pype/configurations/defaults/system_configurations/launchers/resolve_16.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/shell.toml b/pype/configurations/defaults/system_configurations/launchers/shell.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/shell.toml rename to pype/configurations/defaults/system_configurations/launchers/shell.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/storyboardpro_7.toml b/pype/configurations/defaults/system_configurations/launchers/storyboardpro_7.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/storyboardpro_7.toml rename to pype/configurations/defaults/system_configurations/launchers/storyboardpro_7.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/unreal_4.24.toml b/pype/configurations/defaults/system_configurations/launchers/unreal_4.24.toml similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/unreal_4.24.toml rename to pype/configurations/defaults/system_configurations/launchers/unreal_4.24.toml diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.80.bat b/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.80.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.80.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/blender_2.80.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.81.bat b/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.81.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.81.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/blender_2.81.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.82.bat b/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.82.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.82.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/blender_2.82.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.83.bat b/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.83.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/blender_2.83.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/blender_2.83.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/celaction_local.bat b/pype/configurations/defaults/system_configurations/launchers/windows/celaction_local.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/celaction_local.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/celaction_local.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/celaction_publish.bat b/pype/configurations/defaults/system_configurations/launchers/windows/celaction_publish.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/celaction_publish.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/celaction_publish.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/harmony_17.bat b/pype/configurations/defaults/system_configurations/launchers/windows/harmony_17.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/harmony_17.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/harmony_17.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/houdini_16.bat b/pype/configurations/defaults/system_configurations/launchers/windows/houdini_16.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/houdini_16.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/houdini_16.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/houdini_17.bat b/pype/configurations/defaults/system_configurations/launchers/windows/houdini_17.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/houdini_17.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/houdini_17.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/houdini_18.bat b/pype/configurations/defaults/system_configurations/launchers/windows/houdini_18.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/houdini_18.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/houdini_18.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/maya2016.bat b/pype/configurations/defaults/system_configurations/launchers/windows/maya2016.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/maya2016.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/maya2016.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/maya2017.bat b/pype/configurations/defaults/system_configurations/launchers/windows/maya2017.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/maya2017.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/maya2017.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/maya2018.bat b/pype/configurations/defaults/system_configurations/launchers/windows/maya2018.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/maya2018.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/maya2018.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/maya2019.bat b/pype/configurations/defaults/system_configurations/launchers/windows/maya2019.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/maya2019.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/maya2019.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/maya2020.bat b/pype/configurations/defaults/system_configurations/launchers/windows/maya2020.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/maya2020.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/maya2020.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2019.bat b/pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2019.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2019.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2019.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2020.bat b/pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2020.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/mayabatch2020.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2020.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2016.bat b/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2016.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2016.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/mayapy2016.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2017.bat b/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2017.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2017.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/mayapy2017.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2018.bat b/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2018.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2018.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/mayapy2018.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2019.bat b/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2019.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2019.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/mayapy2019.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2020.bat b/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2020.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/mayapy2020.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/mayapy2020.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nuke10.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nuke10.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nuke10.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nuke10.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nuke11.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nuke11.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.2.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nuke11.2.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.2.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nuke11.2.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.3.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nuke11.3.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nuke11.3.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nuke11.3.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nuke12.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nuke12.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nuke12.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nuke12.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio10.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio10.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio10.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukestudio10.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.2.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.2.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.2.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.2.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.3.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.3.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio11.3.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.3.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio12.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio12.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukestudio12.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukestudio12.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukex10.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukex10.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukex10.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukex10.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukex11.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukex11.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.2.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukex11.2.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.2.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukex11.2.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.3.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukex11.3.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukex11.3.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukex11.3.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/nukex12.0.bat b/pype/configurations/defaults/system_configurations/launchers/windows/nukex12.0.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/nukex12.0.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/nukex12.0.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/photoshop_2020.bat b/pype/configurations/defaults/system_configurations/launchers/windows/photoshop_2020.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/photoshop_2020.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/photoshop_2020.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2019.bat b/pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2019.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2020.bat b/pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/premiere_pro_2020.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/python3.bat b/pype/configurations/defaults/system_configurations/launchers/windows/python3.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/python3.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/python3.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/resolve_16.bat b/pype/configurations/defaults/system_configurations/launchers/windows/resolve_16.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/resolve_16.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/resolve_16.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/shell.bat b/pype/configurations/defaults/system_configurations/launchers/windows/shell.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/shell.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/shell.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/storyboardpro_7.bat b/pype/configurations/defaults/system_configurations/launchers/windows/storyboardpro_7.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/storyboardpro_7.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/storyboardpro_7.bat diff --git a/pype/configurations/defaults/studio_configurations/launchers/windows/unreal.bat b/pype/configurations/defaults/system_configurations/launchers/windows/unreal.bat similarity index 100% rename from pype/configurations/defaults/studio_configurations/launchers/windows/unreal.bat rename to pype/configurations/defaults/system_configurations/launchers/windows/unreal.bat diff --git a/pype/configurations/defaults/studio_configurations/muster/templates_mapping.json b/pype/configurations/defaults/system_configurations/muster/templates_mapping.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/muster/templates_mapping.json rename to pype/configurations/defaults/system_configurations/muster/templates_mapping.json diff --git a/pype/configurations/defaults/studio_configurations/standalone_publish/families.json b/pype/configurations/defaults/system_configurations/standalone_publish/families.json similarity index 100% rename from pype/configurations/defaults/studio_configurations/standalone_publish/families.json rename to pype/configurations/defaults/system_configurations/standalone_publish/families.json From 0cca3c68d10ca993cee378b3b9b52fc26eb80e77 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:19:46 +0200 Subject: [PATCH 371/507] fixed last place where is used stuido instead of system --- pype/configurations/config.py | 4 ++-- pype/tools/config_setting/config_setting/widgets/base.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pype/configurations/config.py b/pype/configurations/config.py index 147570acd4..de310645ac 100644 --- a/pype/configurations/config.py +++ b/pype/configurations/config.py @@ -13,7 +13,7 @@ POP_KEY = "__pop_key__" # Paths to studio and project overrides STUDIO_OVERRIDES_PATH = os.environ["PYPE_CONFIG"] -SYSTEM_CONFIGURATIONS_DIR = "studio_configurations" +SYSTEM_CONFIGURATIONS_DIR = "system_configurations" SYSTEM_CONFIGURATIONS_PATH = os.path.join( STUDIO_OVERRIDES_PATH, SYSTEM_CONFIGURATIONS_DIR ) @@ -147,7 +147,7 @@ def load_jsons_from_dir(path, *args, **kwargs): return output -def studio_configurations(*args, **kwargs): +def system_configurations(*args, **kwargs): return load_jsons_from_dir(SYSTEM_CONFIGURATIONS_PATH, *args, **kwargs) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 82a5d024b0..aaa9831c61 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -135,7 +135,7 @@ class SystemWidget(QtWidgets.QWidget): all_values = all_values["system"] # Load studio data with metadata - current_configurations = config.studio_configurations() + current_configurations = config.system_configurations() keys_to_file = lib.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: @@ -171,10 +171,9 @@ class SystemWidget(QtWidgets.QWidget): self._update_values() def _update_values(self): - config.default_configuration() - values = {"system": config.studio_configurations()} + system_values = {"system": config.system_configurations()} for input_field in self.input_fields: - input_field.update_studio_values(values) + input_field.update_studio_values(system_values) for input_field in self.input_fields: input_field.hierarchical_style_update() From 35bc72014e5046cdeb9774b7995ab02bb4cd81ed Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:21:22 +0200 Subject: [PATCH 372/507] bases sets also default values --- .../config_setting/config_setting/widgets/base.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index aaa9831c61..55ca6096de 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -171,6 +171,11 @@ class SystemWidget(QtWidgets.QWidget): self._update_values() def _update_values(self): + default_values = config.default_configuration() + default_values = {"system": default_values["system_configurations"]} + for input_field in self.input_fields: + input_field.update_default_values(default_values) + system_values = {"system": config.system_configurations()} for input_field in self.input_fields: input_field.update_studio_values(system_values) @@ -552,9 +557,14 @@ class ProjectWidget(QtWidgets.QWidget): self._update_values() def _update_values(self): - values = {"project": config.global_project_configurations()} + default_values = config.default_configuration() + default_values = {"project": default_values["project_configurations"]} for input_field in self.input_fields: - input_field.update_studio_values(values) + input_field.update_default_values(default_values) + + studio_values = {"project": config.global_project_configurations()} + for input_field in self.input_fields: + input_field.update_studio_values(studio_values) for input_field in self.input_fields: input_field.hierarchical_style_update() From 3504f06d7b14f26e6068279bf3e238e03f555d47 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:32:26 +0200 Subject: [PATCH 373/507] removed log from abstract attributes --- pype/tools/config_setting/config_setting/widgets/widgets.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index a76f4f6f35..9e814a81e5 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -234,12 +234,6 @@ class AbstractConfigObject: ) return super(AbstractConfigObject, self).__getattribute__(name) - @property - def log(self): - raise NotImplementedError( - "{} does not have implemented `log`".format(self) - ) - @property def is_modified(self): """Has object any changes that require saving.""" From 2eb16374dc69c3118738c515f18a52092c181186 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:43:54 +0200 Subject: [PATCH 374/507] modified configurations files to match more current schemas for able to test --- .../nukestudio/tags.json | 262 ------------------ .../{ => plugins}/celaction/publish.json | 0 .../{ => plugins}/config.json | 0 .../{ => plugins}/ftrack/publish.json | 0 .../{ => plugins}/global/create.json | 0 .../{ => plugins}/global/filter.json | 0 .../{ => plugins}/global/load.json | 0 .../{ => plugins}/global/publish.json | 4 +- .../{ => plugins}/maya/create.json | 0 .../{ => plugins}/maya/filter.json | 0 .../{ => plugins}/maya/load.json | 0 .../{ => plugins}/maya/publish.json | 0 .../{ => plugins}/maya/workfile_build.json | 0 .../{ => plugins}/nuke/create.json | 0 .../{ => plugins}/nuke/load.json | 0 .../{ => plugins}/nuke/publish.json | 0 .../{ => plugins}/nuke/workfile_build.json | 0 .../{ => plugins}/nukestudio/filter.json | 0 .../{ => plugins}/nukestudio/publish.json | 0 .../{ => plugins}/resolve/create.json | 0 .../standalonepublisher/publish.json | 0 .../{ => plugins}/test/create.json | 0 .../{ => plugins}/test/publish.json | 0 23 files changed, 3 insertions(+), 263 deletions(-) delete mode 100644 pype/configurations/defaults/project_configurations/nukestudio/tags.json rename pype/configurations/defaults/project_configurations/{ => plugins}/celaction/publish.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/config.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/ftrack/publish.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/global/create.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/global/filter.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/global/load.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/global/publish.json (98%) rename pype/configurations/defaults/project_configurations/{ => plugins}/maya/create.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/maya/filter.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/maya/load.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/maya/publish.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/maya/workfile_build.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/nuke/create.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/nuke/load.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/nuke/publish.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/nuke/workfile_build.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/nukestudio/filter.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/nukestudio/publish.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/resolve/create.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/standalonepublisher/publish.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/test/create.json (100%) rename pype/configurations/defaults/project_configurations/{ => plugins}/test/publish.json (100%) diff --git a/pype/configurations/defaults/project_configurations/nukestudio/tags.json b/pype/configurations/defaults/project_configurations/nukestudio/tags.json deleted file mode 100644 index 56fcfcbce9..0000000000 --- a/pype/configurations/defaults/project_configurations/nukestudio/tags.json +++ /dev/null @@ -1,262 +0,0 @@ -{ - "Hierarchy": { - "editable": "1", - "note": "{folder}/{sequence}/{shot}", - "icon": { - "path": "hierarchy.png" - }, - "metadata": { - "folder": "FOLDER_NAME", - "shot": "{clip}", - "track": "{track}", - "sequence": "{sequence}", - "episode": "EPISODE_NAME", - "root": "{projectroot}" - } - }, - "Source Resolution": { - "editable": "1", - "note": "Use source resolution", - "icon": { - "path": "resolution.png" - }, - "metadata": { - "family": "resolution" - } - }, - "Retiming": { - "editable": "1", - "note": "Clip has retime or TimeWarp effects (or multiple effects stacked on the clip)", - "icon": { - "path": "retiming.png" - }, - "metadata": { - "family": "retiming", - "marginIn": 1, - "marginOut": 1 - } - }, - "Frame start": { - "editable": "1", - "note": "Starting frame for comps. \n\n> Use `value` and add either number or write `source` (if you want to preserve source frame numbering)", - "icon": { - "path": "icons:TagBackground.png" - }, - "metadata": { - "family": "frameStart", - "value": "1001" - } - }, - "[Lenses]": { - "Set lense here": { - "editable": "1", - "note": "Adjust parameters of your lense and then drop to clip. Remember! You can always overwrite on clip", - "icon": { - "path": "lense.png" - }, - "metadata": { - "focalLengthMm": 57 - - } - } - }, - "[Subsets]": { - "Audio": { - "editable": "1", - "note": "Export with Audio", - "icon": { - "path": "volume.png" - }, - "metadata": { - "family": "audio", - "subset": "main" - } - }, - "plateFg": { - "editable": "1", - "note": "Add to publish to \"forground\" subset. Change metadata subset name if different order number", - "icon": { - "path": "z_layer_fg.png" - }, - "metadata": { - "family": "plate", - "subset": "Fg01" - } - }, - "plateBg": { - "editable": "1", - "note": "Add to publish to \"background\" subset. Change metadata subset name if different order number", - "icon": { - "path": "z_layer_bg.png" - }, - "metadata": { - "family": "plate", - "subset": "Bg01" - } - }, - "plateRef": { - "editable": "1", - "note": "Add to publish to \"reference\" subset.", - "icon": { - "path": "icons:Reference.png" - }, - "metadata": { - "family": "plate", - "subset": "Ref" - } - }, - "plateMain": { - "editable": "1", - "note": "Add to publish to \"main\" subset.", - "icon": { - "path": "z_layer_main.png" - }, - "metadata": { - "family": "plate", - "subset": "main" - } - }, - "plateProxy": { - "editable": "1", - "note": "Add to publish to \"proxy\" subset.", - "icon": { - "path": "z_layer_main.png" - }, - "metadata": { - "family": "plate", - "subset": "proxy" - } - }, - "review": { - "editable": "1", - "note": "Upload to Ftrack as review component.", - "icon": { - "path": "review.png" - }, - "metadata": { - "family": "review", - "track": "review" - } - } - }, - "[Handles]": { - "start: add 20 frames": { - "editable": "1", - "note": "Adding frames to start of selected clip", - "icon": { - "path": "3_add_handles_start.png" - }, - "metadata": { - "family": "handles", - "value": "20", - "args": "{'op':'add','where':'start'}" - } - }, - "start: add 10 frames": { - "editable": "1", - "note": "Adding frames to start of selected clip", - "icon": { - "path": "3_add_handles_start.png" - }, - "metadata": { - "family": "handles", - "value": "10", - "args": "{'op':'add','where':'start'}" - } - }, - "start: add 5 frames": { - "editable": "1", - "note": "Adding frames to start of selected clip", - "icon": { - "path": "3_add_handles_start.png" - }, - "metadata": { - "family": "handles", - "value": "5", - "args": "{'op':'add','where':'start'}" - } - }, - "start: add 0 frames": { - "editable": "1", - "note": "Adding frames to start of selected clip", - "icon": { - "path": "3_add_handles_start.png" - }, - "metadata": { - "family": "handles", - "value": "0", - "args": "{'op':'add','where':'start'}" - } - }, - "end: add 20 frames": { - "editable": "1", - "note": "Adding frames to end of selected clip", - "icon": { - "path": "1_add_handles_end.png" - }, - "metadata": { - "family": "handles", - "value": "20", - "args": "{'op':'add','where':'end'}" - } - }, - "end: add 10 frames": { - "editable": "1", - "note": "Adding frames to end of selected clip", - "icon": { - "path": "1_add_handles_end.png" - }, - "metadata": { - "family": "handles", - "value": "10", - "args": "{'op':'add','where':'end'}" - } - }, - "end: add 5 frames": { - "editable": "1", - "note": "Adding frames to end of selected clip", - "icon": { - "path": "1_add_handles_end.png" - }, - "metadata": { - "family": "handles", - "value": "5", - "args": "{'op':'add','where':'end'}" - } - }, - "end: add 0 frames": { - "editable": "1", - "note": "Adding frames to end of selected clip", - "icon": { - "path": "1_add_handles_end.png" - }, - "metadata": { - "family": "handles", - "value": "0", - "args": "{'op':'add','where':'end'}" - } - } - }, - "NukeScript": { - "editable": "1", - "note": "Collecting track items to Nuke scripts.", - "icon": { - "path": "icons:TagNuke.png" - }, - "metadata": { - "family": "nukescript", - "subset": "main" - } - }, - "Comment": { - "editable": "1", - "note": "Comment on a shot.", - "icon": { - "path": "icons:TagComment.png" - }, - "metadata": { - "family": "comment", - "subset": "main" - } - } -} diff --git a/pype/configurations/defaults/project_configurations/celaction/publish.json b/pype/configurations/defaults/project_configurations/plugins/celaction/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/celaction/publish.json rename to pype/configurations/defaults/project_configurations/plugins/celaction/publish.json diff --git a/pype/configurations/defaults/project_configurations/config.json b/pype/configurations/defaults/project_configurations/plugins/config.json similarity index 100% rename from pype/configurations/defaults/project_configurations/config.json rename to pype/configurations/defaults/project_configurations/plugins/config.json diff --git a/pype/configurations/defaults/project_configurations/ftrack/publish.json b/pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/ftrack/publish.json rename to pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json diff --git a/pype/configurations/defaults/project_configurations/global/create.json b/pype/configurations/defaults/project_configurations/plugins/global/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/global/create.json rename to pype/configurations/defaults/project_configurations/plugins/global/create.json diff --git a/pype/configurations/defaults/project_configurations/global/filter.json b/pype/configurations/defaults/project_configurations/plugins/global/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/global/filter.json rename to pype/configurations/defaults/project_configurations/plugins/global/filter.json diff --git a/pype/configurations/defaults/project_configurations/global/load.json b/pype/configurations/defaults/project_configurations/plugins/global/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/global/load.json rename to pype/configurations/defaults/project_configurations/plugins/global/load.json diff --git a/pype/configurations/defaults/project_configurations/global/publish.json b/pype/configurations/defaults/project_configurations/plugins/global/publish.json similarity index 98% rename from pype/configurations/defaults/project_configurations/global/publish.json rename to pype/configurations/defaults/project_configurations/plugins/global/publish.json index 3c5de85e68..d531f1aa47 100644 --- a/pype/configurations/defaults/project_configurations/global/publish.json +++ b/pype/configurations/defaults/project_configurations/plugins/global/publish.json @@ -3,6 +3,7 @@ "enabled": false }, "ExtractJpegEXR": { + "enabled": true, "ffmpeg_args": { "input": [ "-gamma 2.2" @@ -74,6 +75,7 @@ ] }, "IntegrateAssetNew": { + "enabled": true, "template_name_profiles": { "publish": { "families": [], @@ -94,4 +96,4 @@ "deadline_pool": "", "deadline_group": "" } -} \ No newline at end of file +} diff --git a/pype/configurations/defaults/project_configurations/maya/create.json b/pype/configurations/defaults/project_configurations/plugins/maya/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/maya/create.json rename to pype/configurations/defaults/project_configurations/plugins/maya/create.json diff --git a/pype/configurations/defaults/project_configurations/maya/filter.json b/pype/configurations/defaults/project_configurations/plugins/maya/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/maya/filter.json rename to pype/configurations/defaults/project_configurations/plugins/maya/filter.json diff --git a/pype/configurations/defaults/project_configurations/maya/load.json b/pype/configurations/defaults/project_configurations/plugins/maya/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/maya/load.json rename to pype/configurations/defaults/project_configurations/plugins/maya/load.json diff --git a/pype/configurations/defaults/project_configurations/maya/publish.json b/pype/configurations/defaults/project_configurations/plugins/maya/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/maya/publish.json rename to pype/configurations/defaults/project_configurations/plugins/maya/publish.json diff --git a/pype/configurations/defaults/project_configurations/maya/workfile_build.json b/pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json similarity index 100% rename from pype/configurations/defaults/project_configurations/maya/workfile_build.json rename to pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json diff --git a/pype/configurations/defaults/project_configurations/nuke/create.json b/pype/configurations/defaults/project_configurations/plugins/nuke/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/nuke/create.json rename to pype/configurations/defaults/project_configurations/plugins/nuke/create.json diff --git a/pype/configurations/defaults/project_configurations/nuke/load.json b/pype/configurations/defaults/project_configurations/plugins/nuke/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/nuke/load.json rename to pype/configurations/defaults/project_configurations/plugins/nuke/load.json diff --git a/pype/configurations/defaults/project_configurations/nuke/publish.json b/pype/configurations/defaults/project_configurations/plugins/nuke/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/nuke/publish.json rename to pype/configurations/defaults/project_configurations/plugins/nuke/publish.json diff --git a/pype/configurations/defaults/project_configurations/nuke/workfile_build.json b/pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json similarity index 100% rename from pype/configurations/defaults/project_configurations/nuke/workfile_build.json rename to pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json diff --git a/pype/configurations/defaults/project_configurations/nukestudio/filter.json b/pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/nukestudio/filter.json rename to pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json diff --git a/pype/configurations/defaults/project_configurations/nukestudio/publish.json b/pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/nukestudio/publish.json rename to pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json diff --git a/pype/configurations/defaults/project_configurations/resolve/create.json b/pype/configurations/defaults/project_configurations/plugins/resolve/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/resolve/create.json rename to pype/configurations/defaults/project_configurations/plugins/resolve/create.json diff --git a/pype/configurations/defaults/project_configurations/standalonepublisher/publish.json b/pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/standalonepublisher/publish.json rename to pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json diff --git a/pype/configurations/defaults/project_configurations/test/create.json b/pype/configurations/defaults/project_configurations/plugins/test/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/test/create.json rename to pype/configurations/defaults/project_configurations/plugins/test/create.json diff --git a/pype/configurations/defaults/project_configurations/test/publish.json b/pype/configurations/defaults/project_configurations/plugins/test/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/test/publish.json rename to pype/configurations/defaults/project_configurations/plugins/test/publish.json From 9f9bad6c5425c97b944be59926db94450705571a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 12:44:16 +0200 Subject: [PATCH 375/507] first commit of update_default_values --- .../config_setting/widgets/anatomy_inputs.py | 35 +++++++++++++++ .../config_setting/widgets/inputs.py | 44 +++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index fbc3a3a2ed..43146f7442 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -75,6 +75,10 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.value_changed.connect(self._on_value_change) + def update_default_values(self, value): + self.root_widget.update_default_values(value) + self.templates_widget.update_default_values(value) + def update_studio_values(self, parent_values): self._state = None self._child_state = None @@ -255,6 +259,33 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def is_multiroot(self): return self.multiroot_checkbox.isChecked() + def update_default_values(self, parent_values): + self._state = None + self._multiroot_state = None + + if isinstance(parent_values, dict): + value = parent_values.get(self.key, NOT_SET) + else: + value = NOT_SET + + is_multiroot = False + if isinstance(value, dict): + for _value in value.values(): + if isinstance(_value, dict): + is_multiroot = True + break + + self.global_is_multiroot = is_multiroot + self.was_multiroot = is_multiroot + self.set_multiroot(is_multiroot) + + if is_multiroot: + self.singleroot_widget.update_studio_values(NOT_SET) + self.multiroot_widget.update_studio_values(value) + else: + self.singleroot_widget.update_studio_values(value) + self.multiroot_widget.update_studio_values(NOT_SET) + def update_studio_values(self, parent_values): self._state = None self._multiroot_state = None @@ -486,6 +517,10 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): layout.addWidget(body_widget) + def update_default_values(self, values): + self._state = None + self.value_input.update_default_values(values) + def update_studio_values(self, values): self._state = None self.value_input.update_studio_values(values) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 057ed3b584..27de95c402 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -174,6 +174,26 @@ class ConfigObject(AbstractConfigObject): class InputObject(ConfigObject): + def update_default_values(self, parent_values): + value = NOT_SET + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + if value is NOT_SET: + if self._as_widget: + print(self) + elif hasattr(self, "_parent"): + print(self._parent.key, self.key, self) + raise ValueError( + "Default value is not set. This is implementation BUG." + ) + self.default_value = value + if not self.has_studio_override: + print(value) + self.set_value(value) + def overrides(self): if not self.is_overriden: return NOT_SET, False @@ -1666,6 +1686,16 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() + def update_default_values(self, parent_values): + value = NOT_SET + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + for item in self.input_fields: + item.update_default_values(value) + def update_studio_values(self, parent_values): value = NOT_SET if parent_values is not NOT_SET: @@ -1932,6 +1962,16 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() + def update_default_values(self, parent_values): + value = NOT_SET + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + for item in self.input_fields: + item.update_default_values(value) + def update_studio_values(self, parent_values): value = NOT_SET if parent_values is not NOT_SET: @@ -2367,6 +2407,10 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): for item in self.input_fields: item.set_as_overriden() + def update_default_values(self, value): + for item in self.input_fields: + item.update_default_values(value) + def update_studio_values(self, value): for item in self.input_fields: item.update_studio_values(value) From 24753d6af787e511768c1d759ae8693fa9485162 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 13:34:27 +0200 Subject: [PATCH 376/507] cleaned debug part --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 27de95c402..989980f2a0 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -182,16 +182,12 @@ class InputObject(ConfigObject): value = parent_values.get(self.key, NOT_SET) if value is NOT_SET: - if self._as_widget: - print(self) - elif hasattr(self, "_parent"): - print(self._parent.key, self.key, self) raise ValueError( "Default value is not set. This is implementation BUG." ) + self.default_value = value if not self.has_studio_override: - print(value) self.set_value(value) def overrides(self): From dbfe43e821372445a0bceb48d8890e534d7c9d7b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 14:03:17 +0200 Subject: [PATCH 377/507] update studio_values should work with new default_values --- .../config_setting/widgets/inputs.py | 216 ++++-------------- 1 file changed, 42 insertions(+), 174 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 989980f2a0..fa07419fde 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -190,6 +190,24 @@ class InputObject(ConfigObject): if not self.has_studio_override: self.set_value(value) + def update_studio_values(self, parent_values): + value = NOT_SET + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + self.studio_value = value + if value is not NOT_SET: + self.set_value(value) + self._has_studio_override = True + + else: + self.set_value(self.default_value) + self._has_studio_override = False + + self._is_modified = False + def overrides(self): if not self.is_overriden: return NOT_SET, False @@ -199,7 +217,10 @@ class InputObject(ConfigObject): self.update_style() def remove_overrides(self): - self.set_value(self.start_value) + if self.has_studio_override: + self.set_value(self.studio_value) + else: + self.set_value(self.default_value) self._is_overriden = False self._is_modified = False @@ -217,7 +238,10 @@ class InputObject(ConfigObject): if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False - value = self.start_value + if self.has_studio_override: + value = self.studio_value + else: + value = self.default_value else: self._is_overriden = True self._was_overriden = True @@ -234,7 +258,10 @@ class InputObject(ConfigObject): ): self.set_value(self.override_value) else: - self.set_value(self.start_value) + if self.has_studio_override: + self.set_value(self.studio_value) + else: + self.set_value(self.defaul_value) if not self.is_overidable: self._is_modified = self.studio_value != self.item_value() @@ -290,7 +317,6 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -316,24 +342,6 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.checkbox.stateChanged.connect(self._on_value_change) - def update_studio_values(self, parent_values): - value = NOT_SET - if self._as_widget: - value = parent_values - elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if value is not NOT_SET: - self.set_value(value) - - elif self.default_value is not NOT_SET: - self.set_value(self.default_value) - - self.studio_value = value - self.start_value = self.item_value() - - self._is_modified = self.studio_value != self.start_value - def set_value(self, value): # Ignore value change because if `self.isChecked()` has same # value as `value` the `_on_value_change` is not triggered @@ -399,7 +407,6 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -426,25 +433,6 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.input_field.valueChanged.connect(self._on_value_change) - def update_studio_values(self, parent_values): - value = NOT_SET - if self._as_widget: - value = parent_values - else: - if parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if value is not NOT_SET: - self.set_value(value) - - elif self.default_value is not NOT_SET: - self.set_value(self.default_value) - - self.studio_value = value - self.start_value = self.item_value() - - self._is_modified = self.studio_value != self.start_value - def set_value(self, value): self.input_field.setValue(value) @@ -510,7 +498,6 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -535,24 +522,6 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.text_input.textChanged.connect(self._on_value_change) - def update_studio_values(self, parent_values): - value = NOT_SET - if self._as_widget: - value = parent_values - elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if value is not NOT_SET: - self.set_value(value) - - elif self.default_value is not NOT_SET: - self.set_value(self.default_value) - - self.studio_value = value - self.start_value = self.item_value() - - self._is_modified = self.studio_value != self.start_value - def set_value(self, value): if self.multiline: self.text_input.setPlainText(value) @@ -622,7 +591,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -642,24 +610,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self.path_input.textChanged.connect(self._on_value_change) - def update_studio_values(self, parent_values): - value = NOT_SET - if self._as_widget: - value = parent_values - elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if value is not NOT_SET: - self.set_value(value) - - elif self.default_value is not NOT_SET: - self.set_value(self.default_value) - - self.studio_value = value - self.start_value = self.item_value() - - self._is_modified = self.studio_value != self.start_value - def set_value(self, value): self.path_input.setText(value) @@ -785,7 +735,6 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -811,25 +760,10 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.text_input.textChanged.connect(self._on_value_change) def update_studio_values(self, parent_values): - value = NOT_SET - if self._as_widget: - value = parent_values - elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if value is not NOT_SET: - self.set_value(value) - - elif self.default_value is not NOT_SET: - self.set_value(self.default_value) + super(RawJsonWidget, self).update_studio_values(parent_values) self._is_invalid = self.text_input.has_invalid_value() - self.studio_value = value - self.start_value = self.item_value() - - self._is_modified = self.studio_value != self.start_value - def set_value(self, value): self.text_input.set_value(value) @@ -982,7 +916,6 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET self.key = input_data["key"] @@ -1015,33 +948,8 @@ class ListWidget(QtWidgets.QWidget, InputObject): return len(self.input_fields) def update_studio_values(self, parent_values): - old_inputs = tuple(self.input_fields) + super(ListWidget, self).update_studio_values(parent_values) - value = NOT_SET - if self._as_widget: - value = parent_values - elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - self.studio_value = value - - if value is not NOT_SET: - for item_value in value: - self.add_row(value=item_value) - - elif self.default_value is not NOT_SET: - for item_value in self.default_value: - self.add_row(value=item_value) - - for old_input in old_inputs: - self.remove_row(old_input) - - if self.count() == 0: - self.add_row(is_empty=True) - - self.start_value = self.item_value() - - self._is_modified = self.studio_value != self.start_value self.hierarchical_style_update() def set_value(self, value): @@ -1052,6 +960,9 @@ class ListWidget(QtWidgets.QWidget, InputObject): for input_field in previous_inputs: self.remove_row(input_field) + if self.count() == 0: + self.add_row(is_empty=True) + def _on_value_change(self, item=None): if self.ignore_value_changes: return @@ -1128,7 +1039,10 @@ class ListWidget(QtWidgets.QWidget, InputObject): if override_value is NOT_SET: self._is_overriden = False self._was_overriden = False - value = self.start_value + if self.has_studio_override: + value = self.studio_value + else: + value = self.default_value else: self._is_overriden = True self._was_overriden = True @@ -1326,7 +1240,6 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET any_parent_is_group = parent.is_group if not any_parent_is_group: @@ -1380,35 +1293,6 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): def count(self): return len(self.input_fields) - def update_studio_values(self, parent_values): - old_inputs = tuple(self.input_fields) - - value = NOT_SET - if self._as_widget: - value = parent_values - elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - self.studio_value = value - - if value is not NOT_SET: - for item_key, item_value in value.items(): - self.add_row(key=item_key, value=item_value) - - elif self.default_value is not NOT_SET: - for item_key, item_value in self.default_value.items(): - self.add_row(key=item_key, value=item_value) - - for old_input in old_inputs: - self.remove_row(old_input) - - if self.count() == 0: - self.add_row(is_empty=True) - - self.start_value = self.item_value() - - self._is_modified = self.studio_value != self.start_value - def set_value(self, value): previous_inputs = tuple(self.input_fields) for item_key, item_value in value.items(): @@ -1417,6 +1301,9 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): for input_field in previous_inputs: self.remove_row(input_field) + if self.count() == 0: + self.add_row(is_empty=True) + def _on_value_change(self, item=None): fields_by_keys = collections.defaultdict(list) for input_field in self.input_fields: @@ -2066,7 +1953,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.default_value = NOT_SET self.studio_value = NOT_SET self.override_value = NOT_SET - self.start_value = NOT_SET self.input_fields = [] @@ -2143,24 +2029,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.setFocusProxy(self.input_fields[0]) self.content_layout.addWidget(proxy_widget) - def update_studio_values(self, parent_values): - value = NOT_SET - if self._as_widget: - value = parent_values - elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) - - if not self.multiplatform: - self.input_fields[0].update_studio_values(parent_values) - - elif self.multiplatform: - for input_field in self.input_fields: - input_field.update_studio_values(value) - - self.studio_value = value - self.start_value = self.item_value() - self._is_modified = self.studio_value != self.start_value - def apply_overrides(self, parent_values): self._is_modified = False self._state = None From 46944e87c996d2ceb987f6eafbaf9b2dda705405 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 14:25:14 +0200 Subject: [PATCH 378/507] simplified state stylesheets --- .../config_setting/style/style.css | 68 +++++-------------- 1 file changed, 17 insertions(+), 51 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index fe3bba366a..fef1278de1 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -53,21 +53,11 @@ QLabel[state="overriden"]:hover {color: #ffa64d;} QLabel[state="invalid"] {color: #ad2e2e; font-weight: bold;} QLabel[state="invalid"]:hover {color: #ad2e2e; font-weight: bold;} -QWidget[input-state="modified"] { - border-color: #137cbd; -} -QWidget[input-state="overriden-modified"] { - border-color: #137cbd; -} - -QWidget[input-state="overriden"] { - border-color: #ff8c1a; -} - -QWidget[input-state="invalid"] { - border-color: #ad2e2e; -} +QWidget[input-state="modified"] {border-color: #137cbd;} +QWidget[input-state="overriden-modified"] {border-color: #137cbd;} +QWidget[input-state="overriden"] {border-color: #ff8c1a;} +QWidget[input-state="invalid"] {border-color: #ad2e2e;} QPushButton { border: 1px solid #aaaaaa; @@ -105,19 +95,10 @@ QPushButton[btn-type="expand-toggle"] { font-weight: bold; } -#DictKey[state="modified"] { - border-color: #137cbd; -} - -#DictKey[state="overriden"] { - border-color: #00f; -} -#DictKey[state="overriden-modified"] { - border-color: #0f0; -} -#DictKey[state="invalid"] { - border-color: #ad2e2e; -} +#DictKey[state="modified"] {border-color: #137cbd;} +#DictKey[state="overriden"] {border-color: #00f;} +#DictKey[state="overriden-modified"] {border-color: #0f0;} +#DictKey[state="invalid"] {border-color: #ad2e2e;} #DictLabel { font-weight: bold; @@ -144,33 +125,18 @@ QPushButton[btn-type="expand-toggle"] { border-color: #62839d; } -#SideLineWidget[state="child-modified"]{ - border-color: #106aa2; -} -#SideLineWidget[state="child-modified"]:hover{ - border-color: #137cbd; -} -#SideLineWidget[state="child-invalid"]{ - border-color: #ad2e2e; -} -#SideLineWidget[state="child-invalid"]:hover{ - border-color: #c93636; -} +#SideLineWidget[state="child-modified"] {border-color: #106aa2;} +#SideLineWidget[state="child-modified"]:hover {border-color: #137cbd;} -#SideLineWidget[state="child-overriden"]{ - border-color: #e67300; -} -#SideLineWidget[state="child-overriden"]:hover { - border-color: #ff8c1a; -} +#SideLineWidget[state="child-invalid"] {border-color: #ad2e2e;} +#SideLineWidget[state="child-invalid"]:hover {border-color: #c93636;} -#SideLineWidget[state="child-overriden-modified"] { - border-color: #106aa2; -} -#SideLineWidget[state="child-overriden-modified"]:hover { - border-color: #137cbd; -} +#SideLineWidget[state="child-overriden"] {border-color: #e67300;} +#SideLineWidget[state="child-overriden"]:hover {border-color: #ff8c1a;} + +#SideLineWidget[state="child-overriden-modified"] {border-color: #106aa2;} +#SideLineWidget[state="child-overriden-modified"]:hover {border-color: #137cbd;} QScrollBar:horizontal { height: 15px; From 5830b637d7b17c0bb0b18e5f9b59db9376bf50a8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 14:25:29 +0200 Subject: [PATCH 379/507] normla label is little bit darker --- pype/tools/config_setting/config_setting/style/style.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index fef1278de1..61581b9124 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -38,11 +38,15 @@ QLineEdit:disabled, QSpinBox:disabled, QDoubleSpinBox:disabled, QPlainTextEdit:d QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QPlainTextEdit:focus, QTextEdit:focus { border: 1px solid #ffffff; } -QLabel, QToolButton { +QToolButton { background: transparent; } -QLabel:hover {color: #ffffff;} +QLabel { + background: transparent; + color: #808080; +} +QLabel:hover {color: #999999;} QLabel[state="modified"] {color: #137cbd;} QLabel[state="modified"]:hover {color: #1798e8;} From ac116aaa02637ddf0efad6b27229eed8ad9288f2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 14:25:45 +0200 Subject: [PATCH 380/507] added child_has_studio_override to abstract methods --- .../config_setting/config_setting/widgets/widgets.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 9e814a81e5..5547f66597 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -302,6 +302,15 @@ class AbstractConfigObject: "{} does not have implemented setter method `ignore_value_changes`" ).format(self)) + @property + def child_has_studio_override(self): + """Any children item is modified.""" + raise NotImplementedError( + "{} does not have implemented `child_has_studio_override`".format( + self + ) + ) + @property def child_modified(self): """Any children item is modified.""" From 82a29d9c2734e1a23cebe4efcabcbb9fc6a9b945 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 14:25:58 +0200 Subject: [PATCH 381/507] implemented child_has_studio_override for inputs --- .../config_setting/widgets/inputs.py | 108 +++++++++++++++--- 1 file changed, 93 insertions(+), 15 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index fa07419fde..a9cbc502e9 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -94,9 +94,13 @@ class ConfigObject(AbstractConfigObject): return {self.key: self.item_value()} @classmethod - def style_state(cls, is_invalid, is_overriden, is_modified): + def style_state( + cls, has_studio_override, is_invalid, is_overriden, is_modified + ): items = [] - if is_invalid: + if has_studio_override: + items.append("studio") + elif is_invalid: items.append("invalid") else: if is_overriden: @@ -261,10 +265,13 @@ class InputObject(ConfigObject): if self.has_studio_override: self.set_value(self.studio_value) else: - self.set_value(self.defaul_value) + self.set_value(self.default_value) if not self.is_overidable: - self._is_modified = self.studio_value != self.item_value() + if self.has_studio_override: + self._is_modified = self.studio_value != self.item_value() + else: + self._is_modified = self.default_value != self.item_value() self._is_overriden = False return @@ -274,6 +281,10 @@ class InputObject(ConfigObject): def set_as_overriden(self): self._is_overriden = True + @property + def child_has_studio_override(self): + return self.has_studio_override + @property def child_modified(self): return self.is_modified @@ -367,7 +378,10 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): def update_style(self): state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -456,7 +470,10 @@ class NumberWidget(QtWidgets.QWidget, InputObject): def update_style(self): state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -548,7 +565,10 @@ class TextWidget(QtWidgets.QWidget, InputObject): def update_style(self): state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -637,7 +657,10 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): def update_style(self): state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -788,7 +811,10 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def update_style(self): state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -876,6 +902,10 @@ class ListItem(QtWidgets.QWidget, ConfigObject): return self.value_input.item_value() return NOT_SET + @property + def child_has_studio_override(self): + return self.value_input.child_has_studio_override + @property def child_modified(self): return self.value_input.child_modified @@ -1060,7 +1090,10 @@ class ListWidget(QtWidgets.QWidget, InputObject): def update_style(self): state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -1345,7 +1378,10 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): def update_style(self): state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -1633,10 +1669,14 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self.update_style() def update_style(self, is_overriden=None): + child_has_studio_override = self.child_has_studio_override child_modified = self.child_modified child_invalid = self.child_invalid child_state = self.style_state( - child_invalid, self.child_overriden, child_modified + child_has_studio_override, + child_invalid, + self.child_overriden, + child_modified ) if child_state: child_state = "child-{}".format(child_state) @@ -1649,7 +1689,10 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self._child_state = child_state state = self.style_state( - child_invalid, self.is_overriden, self.is_modified + child_has_studio_override, + child_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -1665,6 +1708,13 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): return self._is_modified or self.child_modified return False + @property + def child_has_studio_override(self): + for input_field in self.input_fields: + if input_field.child_has_studio_override: + return True + return False + @property def child_modified(self): for input_field in self.input_fields: @@ -1768,6 +1818,13 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): def update_style(self, *args, **kwargs): return + @property + def child_has_studio_override(self): + for input_field in self.input_fields: + if input_field.child_has_studio_override: + return True + return False + @property def child_modified(self): for input_field in self.input_fields: @@ -2085,10 +2142,14 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.value_changed.emit(self) def update_style(self, is_overriden=None): + child_has_studio_override = self.has_studio_override child_modified = self.child_modified child_invalid = self.child_invalid child_state = self.style_state( - child_invalid, self.child_overriden, child_modified + child_has_studio_override, + child_invalid, + self.child_overriden, + child_modified ) if child_state: child_state = "child-{}".format(child_state) @@ -2100,7 +2161,10 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): if not self._as_widget: state = self.style_state( - child_invalid, self.is_overriden, self.is_modified + child_has_studio_override, + child_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -2128,6 +2192,13 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): def set_as_overriden(self): self._is_overriden = True + @property + def child_has_studio_override(self): + for input_field in self.input_fields: + if input_field.child_has_studio_override: + return True + return False + @property def child_modified(self): for input_field in self.input_fields: @@ -2286,6 +2357,13 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): if self.any_parent_is_group: self.hierarchical_style_update() + @property + def child_has_studio_override(self): + for input_field in self.input_fields: + if input_field.child_has_studio_override: + return True + return False + @property def child_modified(self): for input_field in self.input_fields: From 84108c5fda60808b0b2ea4f8424eccfa1b16aa6a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 14:46:44 +0200 Subject: [PATCH 382/507] fixed state values and added styles for studio overrides --- .../config_setting/config_setting/style/style.css | 10 ++++++++-- .../config_setting/config_setting/widgets/inputs.py | 8 +++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 61581b9124..73c1854bee 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -48,6 +48,8 @@ QLabel { } QLabel:hover {color: #999999;} +QLabel[state="studio"] {color: #bfccd6;} +QLabel[state="studio"]:hover {color: #ffffff;} QLabel[state="modified"] {color: #137cbd;} QLabel[state="modified"]:hover {color: #1798e8;} QLabel[state="overriden-modified"] {color: #137cbd;} @@ -58,6 +60,7 @@ QLabel[state="invalid"] {color: #ad2e2e; font-weight: bold;} QLabel[state="invalid"]:hover {color: #ad2e2e; font-weight: bold;} +QWidget[input-state="studio"] {border-color: #bfccd6;} QWidget[input-state="modified"] {border-color: #137cbd;} QWidget[input-state="overriden-modified"] {border-color: #137cbd;} QWidget[input-state="overriden"] {border-color: #ff8c1a;} @@ -99,6 +102,7 @@ QPushButton[btn-type="expand-toggle"] { font-weight: bold; } +#DictKey[state="studio"] {border-color: #bfccd6;} #DictKey[state="modified"] {border-color: #137cbd;} #DictKey[state="overriden"] {border-color: #00f;} #DictKey[state="overriden-modified"] {border-color: #0f0;} @@ -118,7 +122,7 @@ QPushButton[btn-type="expand-toggle"] { #SideLineWidget { background-color: #31424e; border-style: solid; - border-color: #455c6e; + border-color: #808080; border-left-width: 3px; border-bottom-width: 0px; border-right-width: 0px; @@ -126,9 +130,11 @@ QPushButton[btn-type="expand-toggle"] { } #SideLineWidget:hover { - border-color: #62839d; + border-color: #999999; } +#SideLineWidget[state="child-studio"] {border-color: #455c6e;} +#SideLineWidget[state="child-studio"]:hover {border-color: #62839d;} #SideLineWidget[state="child-modified"] {border-color: #106aa2;} #SideLineWidget[state="child-modified"]:hover {border-color: #137cbd;} diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index a9cbc502e9..b0aaa5ed3d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -98,15 +98,17 @@ class ConfigObject(AbstractConfigObject): cls, has_studio_override, is_invalid, is_overriden, is_modified ): items = [] - if has_studio_override: - items.append("studio") - elif is_invalid: + if is_invalid: items.append("invalid") else: if is_overriden: items.append("overriden") if is_modified: items.append("modified") + + if not items and has_studio_override: + items.append("studio") + return "-".join(items) or cls.default_state def _discard_changes(self): From 3af3e46f1018307697ac8f49b7c49b33e7f94109 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 15:35:38 +0200 Subject: [PATCH 383/507] config split into lib and config file --- pype/configurations/config.py | 222 +++------------------------------- pype/configurations/lib.py | 208 +++++++++++++++++++++++++++++++ 2 files changed, 224 insertions(+), 206 deletions(-) create mode 100644 pype/configurations/lib.py diff --git a/pype/configurations/config.py b/pype/configurations/config.py index de310645ac..e19a27f33c 100644 --- a/pype/configurations/config.py +++ b/pype/configurations/config.py @@ -1,214 +1,24 @@ -import os -import json -import logging -import copy - -log = logging.getLogger(__name__) - -# Metadata keys for work with studio and project overrides -OVERRIDEN_KEY = "__overriden_keys__" -# NOTE key popping not implemented yet -POP_KEY = "__pop_key__" - -# Paths to studio and project overrides -STUDIO_OVERRIDES_PATH = os.environ["PYPE_CONFIG"] - -SYSTEM_CONFIGURATIONS_DIR = "system_configurations" -SYSTEM_CONFIGURATIONS_PATH = os.path.join( - STUDIO_OVERRIDES_PATH, SYSTEM_CONFIGURATIONS_DIR -) -PROJECT_CONFIGURATIONS_DIR = "project_configurations" -PROJECT_CONFIGURATIONS_PATH = os.path.join( - STUDIO_OVERRIDES_PATH, PROJECT_CONFIGURATIONS_DIR +from .lib import ( + apply_overrides, + default_configuration, + studio_system_configurations, + studio_project_configurations, + project_configurations_overrides ) -# Variable where cache of default configurations are stored -_DEFAULT_CONFIGURATIONS = None -# TODO remove this as is maybe deprecated -first_run = False +def system_configurations(): + default_values = default_configuration()["system_configurations"] + studio_values = studio_system_configurations() + return apply_overrides(default_values, studio_values) -def default_configuration(): - global _DEFAULT_CONFIGURATIONS - if _DEFAULT_CONFIGURATIONS is None: - current_dir = os.path.dirname(__file__) - defaults_path = os.path.join(current_dir, "defaults") - _DEFAULT_CONFIGURATIONS = load_jsons_from_dir(defaults_path) - return _DEFAULT_CONFIGURATIONS +def project_configurations(project_name): + default_values = default_configuration() + studio_values = studio_project_configurations() + studio_overrides = apply_overrides(default_values, studio_values) -def load_json(fpath): - # Load json data - with open(fpath, "r") as opened_file: - lines = opened_file.read().splitlines() + project_overrides = project_configurations_overrides(project_name) - # prepare json string - standard_json = "" - for line in lines: - # Remove all whitespace on both sides - line = line.strip() - - # Skip blank lines - if len(line) == 0: - continue - - standard_json += line - - # Check if has extra commas - extra_comma = False - if ",]" in standard_json or ",}" in standard_json: - extra_comma = True - standard_json = standard_json.replace(",]", "]") - standard_json = standard_json.replace(",}", "}") - - global first_run - if extra_comma and first_run: - log.error("Extra comma in json file: \"{}\"".format(fpath)) - - # return empty dict if file is empty - if standard_json == "": - if first_run: - log.error("Empty json file: \"{}\"".format(fpath)) - return {} - - # Try to parse string - try: - return json.loads(standard_json) - - except json.decoder.JSONDecodeError: - # Return empty dict if it is first time that decode error happened - if not first_run: - return {} - - # Repreduce the exact same exception but traceback contains better - # information about position of error in the loaded json - try: - with open(fpath, "r") as opened_file: - json.load(opened_file) - - except json.decoder.JSONDecodeError: - log.warning( - "File has invalid json format \"{}\"".format(fpath), - exc_info=True - ) - - return {} - - -def subkey_merge(_dict, value, keys): - key = keys.pop(0) - if not keys: - _dict[key] = value - return _dict - - if key not in _dict: - _dict[key] = {} - _dict[key] = subkey_merge(_dict[key], value, keys) - - return _dict - - -def load_jsons_from_dir(path, *args, **kwargs): - output = {} - - path = os.path.normpath(path) - if not os.path.exists(path): - # TODO warning - return output - - sub_keys = list(kwargs.pop("subkeys", args)) - for sub_key in tuple(sub_keys): - _path = os.path.join(path, sub_key) - if not os.path.exists(_path): - break - - path = _path - sub_keys.pop(0) - - base_len = len(path) + 1 - for base, _directories, filenames in os.walk(path): - base_items_str = base[base_len:] - if not base_items_str: - base_items = [] - else: - base_items = base_items_str.split(os.path.sep) - - for filename in filenames: - basename, ext = os.path.splitext(filename) - if ext == ".json": - full_path = os.path.join(base, filename) - value = load_json(full_path) - dict_keys = base_items + [basename] - output = subkey_merge(output, value, dict_keys) - - for sub_key in sub_keys: - output = output[sub_key] - return output - - -def system_configurations(*args, **kwargs): - return load_jsons_from_dir(SYSTEM_CONFIGURATIONS_PATH, *args, **kwargs) - - -def global_project_configurations(**kwargs): - return load_jsons_from_dir(PROJECT_CONFIGURATIONS_PATH, **kwargs) - - -def path_to_project_overrides(project_name): - project_configs_path = os.environ["PYPE_PROJECT_CONFIGS"] - dirpath = os.path.join(project_configs_path, project_name) - return os.path.join(dirpath, PROJECT_CONFIGURATIONS_DIR + ".json") - - -def project_configurations_overrides(project_name, **kwargs): - if not project_name: - return {} - - path_to_json = path_to_project_overrides(project_name) - if not os.path.exists(path_to_json): - return {} - return load_json(path_to_json) - - -def merge_overrides(global_dict, override_dict): - if OVERRIDEN_KEY in override_dict: - overriden_keys = set(override_dict.pop(OVERRIDEN_KEY)) - else: - overriden_keys = set() - - for key, value in override_dict.items(): - if value == POP_KEY: - global_dict.pop(key) - - elif ( - key in overriden_keys - or key not in global_dict - ): - global_dict[key] = value - - elif isinstance(value, dict) and isinstance(global_dict[key], dict): - global_dict[key] = merge_overrides(global_dict[key], value) - - else: - global_dict[key] = value - return global_dict - - -def apply_overrides(global_presets, project_overrides): - global_presets = copy.deepcopy(global_presets) - if not project_overrides: - return global_presets - return merge_overrides(global_presets, project_overrides) - - -def project_presets(project_name=None, **kwargs): - global_presets = global_project_configurations(**kwargs) - - if not project_name: - project_name = os.environ.get("AVALON_PROJECT") - project_overrides = project_configurations_overrides( - project_name, **kwargs - ) - - return apply_overrides(global_presets, project_overrides) + return apply_overrides(studio_overrides, project_overrides) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py new file mode 100644 index 0000000000..4cd7203626 --- /dev/null +++ b/pype/configurations/lib.py @@ -0,0 +1,208 @@ +import os +import json +import logging +import copy + +log = logging.getLogger(__name__) + +# Metadata keys for work with studio and project overrides +OVERRIDEN_KEY = "__overriden_keys__" +# NOTE key popping not implemented yet +POP_KEY = "__pop_key__" + +# Folder where studio overrides are stored +STUDIO_OVERRIDES_PATH = os.environ["PYPE_CONFIG"] + +# File where studio's system overrides are stored +SYSTEM_CONFIGURATIONS_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, "system_configurations.json" +) + +# File where studio's default project overrides are stored +PROJECT_CONFIGURATIONS_FILENAME = "project_configurations.json" +PROJECT_CONFIGURATIONS_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, PROJECT_CONFIGURATIONS_FILENAME +) + +# Folder where studio's per project overrides are stored +STUDIO_PROJECT_OVERRIDES_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, "project_overrides" +) + +# Variable where cache of default configurations are stored +_DEFAULT_CONFIGURATIONS = None + + +def default_configuration(): + global _DEFAULT_CONFIGURATIONS + if _DEFAULT_CONFIGURATIONS is None: + current_dir = os.path.dirname(__file__) + defaults_path = os.path.join(current_dir, "defaults") + _DEFAULT_CONFIGURATIONS = load_jsons_from_dir(defaults_path) + return _DEFAULT_CONFIGURATIONS + + +def load_json(fpath): + # Load json data + with open(fpath, "r") as opened_file: + lines = opened_file.read().splitlines() + + # prepare json string + standard_json = "" + for line in lines: + # Remove all whitespace on both sides + line = line.strip() + + # Skip blank lines + if len(line) == 0: + continue + + standard_json += line + + # Check if has extra commas + extra_comma = False + if ",]" in standard_json or ",}" in standard_json: + extra_comma = True + standard_json = standard_json.replace(",]", "]") + standard_json = standard_json.replace(",}", "}") + + if extra_comma: + log.error("Extra comma in json file: \"{}\"".format(fpath)) + + # return empty dict if file is empty + if standard_json == "": + return {} + + # Try to parse string + try: + return json.loads(standard_json) + + except json.decoder.JSONDecodeError: + # Return empty dict if it is first time that decode error happened + return {} + + # Repreduce the exact same exception but traceback contains better + # information about position of error in the loaded json + try: + with open(fpath, "r") as opened_file: + json.load(opened_file) + + except json.decoder.JSONDecodeError: + log.warning( + "File has invalid json format \"{}\"".format(fpath), + exc_info=True + ) + + return {} + + +def subkey_merge(_dict, value, keys): + key = keys.pop(0) + if not keys: + _dict[key] = value + return _dict + + if key not in _dict: + _dict[key] = {} + _dict[key] = subkey_merge(_dict[key], value, keys) + + return _dict + + +def load_jsons_from_dir(path, *args, **kwargs): + output = {} + + path = os.path.normpath(path) + if not os.path.exists(path): + # TODO warning + return output + + sub_keys = list(kwargs.pop("subkeys", args)) + for sub_key in tuple(sub_keys): + _path = os.path.join(path, sub_key) + if not os.path.exists(_path): + break + + path = _path + sub_keys.pop(0) + + base_len = len(path) + 1 + for base, _directories, filenames in os.walk(path): + base_items_str = base[base_len:] + if not base_items_str: + base_items = [] + else: + base_items = base_items_str.split(os.path.sep) + + for filename in filenames: + basename, ext = os.path.splitext(filename) + if ext == ".json": + full_path = os.path.join(base, filename) + value = load_json(full_path) + dict_keys = base_items + [basename] + output = subkey_merge(output, value, dict_keys) + + for sub_key in sub_keys: + output = output[sub_key] + return output + + +def studio_system_configurations(): + if os.path.exists(SYSTEM_CONFIGURATIONS_PATH): + return load_json(SYSTEM_CONFIGURATIONS_PATH) + return {} + + +def studio_project_configurations(): + if os.path.exists(PROJECT_CONFIGURATIONS_PATH): + return load_json(PROJECT_CONFIGURATIONS_PATH) + return {} + + +def path_to_project_overrides(project_name): + return os.path.join( + STUDIO_PROJECT_OVERRIDES_PATH, + project_name, + PROJECT_CONFIGURATIONS_FILENAME + ) + + +def project_configurations_overrides(project_name): + if not project_name: + return {} + + path_to_json = path_to_project_overrides(project_name) + if not os.path.exists(path_to_json): + return {} + return load_json(path_to_json) + + +def merge_overrides(global_dict, override_dict): + if OVERRIDEN_KEY in override_dict: + overriden_keys = set(override_dict.pop(OVERRIDEN_KEY)) + else: + overriden_keys = set() + + for key, value in override_dict.items(): + if value == POP_KEY: + global_dict.pop(key) + + elif ( + key in overriden_keys + or key not in global_dict + ): + global_dict[key] = value + + elif isinstance(value, dict) and isinstance(global_dict[key], dict): + global_dict[key] = merge_overrides(global_dict[key], value) + + else: + global_dict[key] = value + return global_dict + + +def apply_overrides(global_presets, project_overrides): + global_presets = copy.deepcopy(global_presets) + if not project_overrides: + return global_presets + return merge_overrides(global_presets, project_overrides) From b6b439c369f164a9f4ed48bc232c283c0cf32564 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 15:36:36 +0200 Subject: [PATCH 384/507] config_value method renamed to studio_value --- .../config_setting/widgets/anatomy_inputs.py | 16 +++++++------- .../config_setting/widgets/base.py | 6 ++--- .../config_setting/widgets/inputs.py | 22 +++++++++---------- .../config_setting/widgets/widgets.py | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 43146f7442..18a58b1dc6 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -165,15 +165,15 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.templates_widget.discard_changes() def overrides(self): - return self.config_value(), True + return self.studio_value(), True def item_value(self): output = {} - output.update(self.root_widget.config_value()) - output.update(self.templates_widget.config_value()) + output.update(self.root_widget.studio_value()) + output.update(self.templates_widget.studio_value()) return output - def config_value(self): + def studio_value(self): return {self.key: self.item_value()} @@ -479,7 +479,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: return self.singleroot_widget.item_value() - def config_value(self): + def studio_value(self): return {self.key: self.item_value()} @@ -587,13 +587,13 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def overrides(self): if not self.child_overriden: return NOT_SET, False - return self.config_value(), True + return self.studio_value(), True def item_value(self): return self.value_input.item_value() - def config_value(self): - return self.value_input.config_value() + def studio_value(self): + return self.value_input.studio_value() TypeToKlass.types["anatomy"] = AnatomyWidget diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 55ca6096de..981713d5ae 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -125,7 +125,7 @@ class SystemWidget(QtWidgets.QWidget): all_values = {} for item in self.input_fields: - all_values.update(item.config_value()) + all_values.update(item.studio_value()) for key in reversed(self.keys): _all_values = {key: all_values} @@ -499,7 +499,7 @@ class ProjectWidget(QtWidgets.QWidget): def _save_defaults(self): output = {} for item in self.input_fields: - output.update(item.config_value()) + output.update(item.studio_value()) for key in reversed(self.keys): _output = {key: output} @@ -507,7 +507,7 @@ class ProjectWidget(QtWidgets.QWidget): all_values = {} for item in self.input_fields: - all_values.update(item.config_value()) + all_values.update(item.studio_value()) for key in reversed(self.keys): _all_values = {key: all_values} diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b0aaa5ed3d..d1b71b2848 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -89,7 +89,7 @@ class ConfigObject(AbstractConfigObject): """Setter for global parent item to apply changes for all inputs.""" self._parent.ignore_value_changes = value - def config_value(self): + def studio_value(self): """Output for saving changes or overrides.""" return {self.key: self.item_value()} @@ -217,7 +217,7 @@ class InputObject(ConfigObject): def overrides(self): if not self.is_overriden: return NOT_SET, False - return self.config_value(), self.is_group + return self.studio_value(), self.is_group def hierarchical_style_update(self): self.update_style() @@ -899,7 +899,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def on_remove_clicked(self): self._parent.remove_row(self) - def config_value(self): + def studio_value(self): if self.value_input.isEnabled(): return self.value_input.item_value() return NOT_SET @@ -1106,7 +1106,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): def item_value(self): output = [] for item in self.input_fields: - value = item.config_value() + value = item.studio_value() if value is not NOT_SET: output.append(value) return output @@ -1245,7 +1245,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def row(self): return self._parent.input_fields.index(self) - def config_value(self): + def studio_value(self): key = self.key_input.text() value = self.value_input.item_value() return {key: value} @@ -1405,7 +1405,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): def item_value(self): output = {} for item in self.input_fields: - output.update(item.config_value()) + output.update(item.studio_value()) return output def add_row(self, row=None, key=None, value=None, is_empty=False): @@ -1749,7 +1749,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): for input_field in self.input_fields: # TODO maybe merge instead of update should be used # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) + output.update(input_field.studio_value()) return output def overrides(self): @@ -1859,7 +1859,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): for input_field in self.input_fields: # TODO maybe merge instead of update should be used # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) + output.update(input_field.studio_value()) return output def _on_value_change(self, item=None): @@ -2236,7 +2236,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): output = {} for input_field in self.input_fields: - output.update(input_field.config_value()) + output.update(input_field.studio_value()) return output def overrides(self): @@ -2402,10 +2402,10 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): for input_field in self.input_fields: # TODO maybe merge instead of update should be used # NOTE merge is custom function which merges 2 dicts - output.update(input_field.config_value()) + output.update(input_field.studio_value()) return output - def config_value(self): + def studio_value(self): return self.item_value() def overrides(self): diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 5547f66597..1e57bf73df 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -344,7 +344,7 @@ class AbstractConfigObject: "Method `item_value` not implemented!" ) - def config_value(self): + def studio_value(self): """Output for saving changes or overrides.""" return {self.key: self.item_value()} From 778f645057f22e076c9b4e6cad4320b724069cb6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:07:05 +0200 Subject: [PATCH 385/507] renamed method studio_value back to config_value --- .../config_setting/widgets/anatomy_inputs.py | 16 +++++++------- .../config_setting/widgets/base.py | 6 ++--- .../config_setting/widgets/inputs.py | 22 +++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 18a58b1dc6..43146f7442 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -165,15 +165,15 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.templates_widget.discard_changes() def overrides(self): - return self.studio_value(), True + return self.config_value(), True def item_value(self): output = {} - output.update(self.root_widget.studio_value()) - output.update(self.templates_widget.studio_value()) + output.update(self.root_widget.config_value()) + output.update(self.templates_widget.config_value()) return output - def studio_value(self): + def config_value(self): return {self.key: self.item_value()} @@ -479,7 +479,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: return self.singleroot_widget.item_value() - def studio_value(self): + def config_value(self): return {self.key: self.item_value()} @@ -587,13 +587,13 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def overrides(self): if not self.child_overriden: return NOT_SET, False - return self.studio_value(), True + return self.config_value(), True def item_value(self): return self.value_input.item_value() - def studio_value(self): - return self.value_input.studio_value() + def config_value(self): + return self.value_input.config_value() TypeToKlass.types["anatomy"] = AnatomyWidget diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 981713d5ae..55ca6096de 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -125,7 +125,7 @@ class SystemWidget(QtWidgets.QWidget): all_values = {} for item in self.input_fields: - all_values.update(item.studio_value()) + all_values.update(item.config_value()) for key in reversed(self.keys): _all_values = {key: all_values} @@ -499,7 +499,7 @@ class ProjectWidget(QtWidgets.QWidget): def _save_defaults(self): output = {} for item in self.input_fields: - output.update(item.studio_value()) + output.update(item.config_value()) for key in reversed(self.keys): _output = {key: output} @@ -507,7 +507,7 @@ class ProjectWidget(QtWidgets.QWidget): all_values = {} for item in self.input_fields: - all_values.update(item.studio_value()) + all_values.update(item.config_value()) for key in reversed(self.keys): _all_values = {key: all_values} diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index d1b71b2848..b0aaa5ed3d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -89,7 +89,7 @@ class ConfigObject(AbstractConfigObject): """Setter for global parent item to apply changes for all inputs.""" self._parent.ignore_value_changes = value - def studio_value(self): + def config_value(self): """Output for saving changes or overrides.""" return {self.key: self.item_value()} @@ -217,7 +217,7 @@ class InputObject(ConfigObject): def overrides(self): if not self.is_overriden: return NOT_SET, False - return self.studio_value(), self.is_group + return self.config_value(), self.is_group def hierarchical_style_update(self): self.update_style() @@ -899,7 +899,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def on_remove_clicked(self): self._parent.remove_row(self) - def studio_value(self): + def config_value(self): if self.value_input.isEnabled(): return self.value_input.item_value() return NOT_SET @@ -1106,7 +1106,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): def item_value(self): output = [] for item in self.input_fields: - value = item.studio_value() + value = item.config_value() if value is not NOT_SET: output.append(value) return output @@ -1245,7 +1245,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def row(self): return self._parent.input_fields.index(self) - def studio_value(self): + def config_value(self): key = self.key_input.text() value = self.value_input.item_value() return {key: value} @@ -1405,7 +1405,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): def item_value(self): output = {} for item in self.input_fields: - output.update(item.studio_value()) + output.update(item.config_value()) return output def add_row(self, row=None, key=None, value=None, is_empty=False): @@ -1749,7 +1749,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): for input_field in self.input_fields: # TODO maybe merge instead of update should be used # NOTE merge is custom function which merges 2 dicts - output.update(input_field.studio_value()) + output.update(input_field.config_value()) return output def overrides(self): @@ -1859,7 +1859,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): for input_field in self.input_fields: # TODO maybe merge instead of update should be used # NOTE merge is custom function which merges 2 dicts - output.update(input_field.studio_value()) + output.update(input_field.config_value()) return output def _on_value_change(self, item=None): @@ -2236,7 +2236,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): output = {} for input_field in self.input_fields: - output.update(input_field.studio_value()) + output.update(input_field.config_value()) return output def overrides(self): @@ -2402,10 +2402,10 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): for input_field in self.input_fields: # TODO maybe merge instead of update should be used # NOTE merge is custom function which merges 2 dicts - output.update(input_field.studio_value()) + output.update(input_field.config_value()) return output - def studio_value(self): + def config_value(self): return self.item_value() def overrides(self): From c483705a91e6cd9c4cf82634afdfc9428053022b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:16:22 +0200 Subject: [PATCH 386/507] any_parent_is_group is abstract attribute --- .../config_setting/widgets/inputs.py | 18 +++++++++++------- .../config_setting/widgets/widgets.py | 6 ++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index b0aaa5ed3d..9e712fd087 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -25,6 +25,7 @@ class ConfigObject(AbstractConfigObject): _is_group = False _is_nullable = False + _any_parent_is_group = None _log = None @property @@ -36,6 +37,10 @@ class ConfigObject(AbstractConfigObject): @property def has_studio_override(self): return self._has_studio_override + def any_parent_is_group(self): + if self._any_parent_is_group is None: + return super(ConfigObject, self).any_parent_is_group + return self._any_parent_is_group @property def is_modified(self): @@ -752,7 +757,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - self.any_parent_is_group = any_parent_is_group + self._any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) @@ -843,7 +848,6 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def __init__(self, object_type, input_modifiers, config_parent, parent): self._parent = config_parent - super(ListItem, self).__init__(parent) layout = QtWidgets.QHBoxLayout(self) @@ -1280,7 +1284,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - self.any_parent_is_group = any_parent_is_group + self._any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) @@ -1500,7 +1504,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): any_parent_is_group = parent.is_group if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - self.any_parent_is_group = any_parent_is_group + self._any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) self._is_nullable = input_data.get("is_nullable", False) @@ -1789,7 +1793,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - self.any_parent_is_group = any_parent_is_group + self._any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) self.setAttribute(QtCore.Qt.WA_TranslucentBackground) @@ -1997,7 +2001,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): any_parent_is_group = parent.is_group if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - self.any_parent_is_group = any_parent_is_group + self._any_parent_is_group = any_parent_is_group # This is partial input and dictionary input if not any_parent_is_group and not as_widget: @@ -2274,7 +2278,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): if not any_parent_is_group: any_parent_is_group = parent.any_parent_is_group - self.any_parent_is_group = any_parent_is_group + self._any_parent_is_group = any_parent_is_group self._is_group = False diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index 1e57bf73df..d803624850 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -248,6 +248,12 @@ class AbstractConfigObject: "{} does not have implemented `is_overriden`".format(self) ) + @property + def any_parent_is_group(self): + raise NotImplementedError( + "{} does not have implemented `any_parent_is_group`".format(self) + ) + @property def was_overriden(self): """Initial state after applying overrides.""" From daebec1faec9fca76812ab8f9285849a25b66f19 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:16:33 +0200 Subject: [PATCH 387/507] fixe override key import --- pype/tools/config_setting/config_setting/widgets/lib.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index 69c3259b3b..6b3aa53c8f 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -1,9 +1,8 @@ import os import json import copy -from pype.api import config +from pype.configurations.lib import OVERRIDEN_KEY from queue import Queue -OVERRIDEN_KEY = config.OVERRIDEN_KEY # Singleton database of available inputs From ce90e8a1835cbef57ead0739bf980367b7b9d884 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:16:44 +0200 Subject: [PATCH 388/507] has_studio_override fix --- pype/tools/config_setting/config_setting/widgets/inputs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 9e712fd087..e7f3f71620 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -36,7 +36,8 @@ class ConfigObject(AbstractConfigObject): @property def has_studio_override(self): - return self._has_studio_override + return self._has_studio_override or self._parent.has_studio_override + def any_parent_is_group(self): if self._any_parent_is_group is None: return super(ConfigObject, self).any_parent_is_group @@ -290,7 +291,7 @@ class InputObject(ConfigObject): @property def child_has_studio_override(self): - return self.has_studio_override + return self._has_studio_override @property def child_modified(self): From 39cde9bd82e6d3852f7d92550a10e2884ba05e95 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:34:46 +0200 Subject: [PATCH 389/507] update saving of studio overrides --- .../config_setting/widgets/base.py | 146 +++++------------- 1 file changed, 40 insertions(+), 106 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 55ca6096de..9abe05946e 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -1,7 +1,15 @@ import os import json from Qt import QtWidgets, QtCore, QtGui -from pype.api import config +from pype.configurations.lib import ( + SYSTEM_CONFIGURATIONS_PATH, + PROJECT_CONFIGURATIONS_PATH, + default_configuration, + studio_system_configurations, + project_configurations_overrides, + path_to_project_overrides, + studio_project_configurations +) from .widgets import UnsavedChangesDialog from . import lib from avalon import io @@ -123,60 +131,31 @@ class SystemWidget(QtWidgets.QWidget): first_invalid_item.setFocus(True) return - all_values = {} - for item in self.input_fields: - all_values.update(item.config_value()) + _data = {} + for input_field in self.input_fields: + value, is_group = input_field.studio_overrides() + if value is not lib.NOT_SET: + _data.update(value) - for key in reversed(self.keys): - _all_values = {key: all_values} - all_values = _all_values + values = _data["system"] - # Skip first key - all_values = all_values["system"] + dirpath = os.path.dirname(SYSTEM_CONFIGURATIONS_PATH) + if not os.path.exists(dirpath): + os.makedirs(dirpath) - # Load studio data with metadata - current_configurations = config.system_configurations() - - keys_to_file = lib.file_keys_from_schema(self.schema) - for key_sequence in keys_to_file: - # Skip first key - key_sequence = key_sequence[1:] - subpath = "/".join(key_sequence) + ".json" - origin_values = current_configurations - for key in key_sequence: - if not origin_values or key not in origin_values: - origin_values = {} - break - origin_values = origin_values[key] - - if not origin_values: - origin_values = {} - - new_values = all_values - for key in key_sequence: - new_values = new_values[key] - origin_values.update(new_values) - raise NotImplementedError("Output from global values has changed") - output_path = os.path.join( - config.STUDIO_PRESETS_PATH, subpath - ) - dirpath = os.path.dirname(output_path) - if not os.path.exists(dirpath): - os.makedirs(dirpath) - - print("Saving data to: ", output_path) - with open(output_path, "w") as file_stream: - json.dump(origin_values, file_stream, indent=4) + print("Saving data to:", SYSTEM_CONFIGURATIONS_PATH) + with open(SYSTEM_CONFIGURATIONS_PATH, "w") as file_stream: + json.dump(values, file_stream, indent=4) self._update_values() def _update_values(self): - default_values = config.default_configuration() + default_values = default_configuration() default_values = {"system": default_values["system_configurations"]} for input_field in self.input_fields: input_field.update_default_values(default_values) - system_values = {"system": config.system_configurations()} + system_values = {"system": studio_system_configurations()} for input_field in self.input_fields: input_field.update_studio_values(system_values) @@ -429,7 +408,7 @@ class ProjectWidget(QtWidgets.QWidget): _overrides = lib.NOT_SET self.is_overidable = False else: - _overrides = config.project_configurations_overrides(project_name) + _overrides = project_configurations_overrides(project_name) self.is_overidable = True overrides = {"project": lib.convert_overrides_to_gui_data(_overrides)} @@ -475,94 +454,49 @@ class ProjectWidget(QtWidgets.QWidget): value, is_group = item.overrides() if value is not lib.NOT_SET: _data.update(value) - if is_group: - raise Exception( - "Top item can't be overriden in Project widget." - ) data = _data.get("project") or {} output_data = lib.convert_gui_data_to_overrides(data) - overrides_json_path = config.path_to_project_overrides( + overrides_json_path = path_to_project_overrides( self.project_name ) dirpath = os.path.dirname(overrides_json_path) if not os.path.exists(dirpath): os.makedirs(dirpath) - print("Saving data to: ", overrides_json_path) + print("Saving data to:", overrides_json_path) with open(overrides_json_path, "w") as file_stream: json.dump(output_data, file_stream, indent=4) self._on_project_change() def _save_defaults(self): - output = {} - for item in self.input_fields: - output.update(item.config_value()) + _data = {} + for input_field in self.input_fields: + value, is_group = input_field.studio_overrides() + if value is not lib.NOT_SET: + _data.update(value) - for key in reversed(self.keys): - _output = {key: output} - output = _output + output = _data["project"] - all_values = {} - for item in self.input_fields: - all_values.update(item.config_value()) + dirpath = os.path.dirname(PROJECT_CONFIGURATIONS_PATH) + if not os.path.exists(dirpath): + os.makedirs(dirpath) - for key in reversed(self.keys): - _all_values = {key: all_values} - all_values = _all_values - - # Skip first key - all_values = all_values["project"] - - # Load studio data with metadata - current_configurations = config.global_project_configurations() - - keys_to_file = lib.file_keys_from_schema(self.schema) - for key_sequence in keys_to_file: - # Skip first key - key_sequence = key_sequence[1:] - subpath = "/".join(key_sequence) + ".json" - origin_values = current_configurations - for key in key_sequence: - if not origin_values or key not in origin_values: - origin_values = {} - break - origin_values = origin_values[key] - - if not origin_values: - origin_values = {} - - new_values = all_values - for key in key_sequence: - new_values = new_values[key] - if isinstance(new_values, dict): - origin_values.update(new_values) - else: - origin_values = new_values - - raise NotImplementedError("Output from global values has changed") - output_path = os.path.join( - config.PROJECT_PRESETS_PATH, subpath - ) - dirpath = os.path.dirname(output_path) - if not os.path.exists(dirpath): - os.makedirs(dirpath) - - print("Saving data to: ", output_path) - with open(output_path, "w") as file_stream: - json.dump(origin_values, file_stream, indent=4) + print("Saving data to:", PROJECT_CONFIGURATIONS_PATH) + with open(PROJECT_CONFIGURATIONS_PATH, "w") as file_stream: + json.dump(output, file_stream, indent=4) self._update_values() def _update_values(self): - default_values = config.default_configuration() + default_values = default_configuration() default_values = {"project": default_values["project_configurations"]} for input_field in self.input_fields: input_field.update_default_values(default_values) - studio_values = {"project": config.global_project_configurations()} + studio_values = {"project": studio_project_configurations()} for input_field in self.input_fields: input_field.update_studio_values(studio_values) From 9cda39766cb7e8361b5f1c9db41bb973ab9acac3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:35:01 +0200 Subject: [PATCH 390/507] inputs has studio_overrides methods now --- .../config_setting/widgets/inputs.py | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index e7f3f71620..6e229fb9ea 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -220,6 +220,11 @@ class InputObject(ConfigObject): self._is_modified = False + def studio_overrides(self): + if not self.has_studio_override: + return NOT_SET, False + return self.config_value(), self.is_group + def overrides(self): if not self.is_overriden: return NOT_SET, False @@ -1757,6 +1762,22 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): output.update(input_field.config_value()) return output + def studio_overrides(self): + if not self.has_studio_override and not self.child_has_studio_override: + return NOT_SET, False + + values = {} + groups = [] + for input_field in self.input_fields: + value, is_group = input_field.overrides() + if value is not NOT_SET: + values.update(value) + if is_group: + groups.extend(value.keys()) + if groups: + values[METADATA_KEY] = {"groups": groups} + return {self.key: values}, self.is_group + def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False @@ -1953,6 +1974,22 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): ) self._was_overriden = bool(self._is_overriden) + def studio_overrides(self): + if not self.has_studio_override and not self.child_has_studio_override: + return NOT_SET, False + + values = {} + groups = [] + for input_field in self.input_fields: + value, is_group = input_field.overrides() + if value is not NOT_SET: + values.update(value) + if is_group: + groups.extend(value.keys()) + if groups: + values[METADATA_KEY] = {"groups": groups} + return {self.key: values}, self.is_group + def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False @@ -2244,6 +2281,15 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): output.update(input_field.config_value()) return output + def studio_overrides(self): + if not self.has_studio_override and not self.child_has_studio_override: + return NOT_SET, False + + value = self.item_value() + if not self.multiplatform: + value = {self.key: value} + return value, self.is_group + def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False @@ -2413,6 +2459,22 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): def config_value(self): return self.item_value() + def studio_overrides(self): + if not self.has_studio_override and not self.child_has_studio_override: + return NOT_SET, False + + values = {} + groups = [] + for input_field in self.input_fields: + value, is_group = input_field.overrides() + if value is not NOT_SET: + values.update(value) + if is_group: + groups.extend(value.keys()) + if groups: + values[METADATA_KEY] = {"groups": groups} + return values, self.is_group + def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False From 9521ea3f08ee69b532c1991ac82d644404483b7c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:40:40 +0200 Subject: [PATCH 391/507] removed attribute methods from base widgets --- .../config_setting/widgets/base.py | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 9abe05946e..172450684b 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -17,9 +17,10 @@ from avalon import io class SystemWidget(QtWidgets.QWidget): is_overidable = False - _is_overriden = False - _is_group = False - _any_parent_is_group = False + has_studio_override = False + is_overriden = False + is_group = False + any_parent_is_group = False def __init__(self, parent=None): super(SystemWidget, self).__init__(parent) @@ -67,18 +68,6 @@ class SystemWidget(QtWidgets.QWidget): def any_parent_overriden(self): return False - @property - def is_overriden(self): - return self._is_overriden - - @property - def is_group(self): - return self._is_group - - @property - def any_parent_is_group(self): - return self._any_parent_is_group - @property def ignore_value_changes(self): return self._ignore_value_changes @@ -297,9 +286,10 @@ class ProjectListWidget(QtWidgets.QWidget): class ProjectWidget(QtWidgets.QWidget): - _is_overriden = False - _is_group = False - _any_parent_is_group = False + has_studio_override = False + is_overriden = False + is_group = False + any_parent_is_group = False def __init__(self, parent=None): super(ProjectWidget, self).__init__(parent) @@ -362,18 +352,6 @@ class ProjectWidget(QtWidgets.QWidget): def any_parent_overriden(self): return False - @property - def is_overriden(self): - return self._is_overriden - - @property - def is_group(self): - return self._is_group - - @property - def any_parent_is_group(self): - return self._any_parent_is_group - @property def ignore_value_changes(self): return self._ignore_value_changes From 9693a6a37b886e1ae3646f52903d493532542b85 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 16:40:58 +0200 Subject: [PATCH 392/507] any parent is group is attribute --- pype/tools/config_setting/config_setting/widgets/inputs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 6e229fb9ea..3a3d517cc1 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -38,6 +38,7 @@ class ConfigObject(AbstractConfigObject): def has_studio_override(self): return self._has_studio_override or self._parent.has_studio_override + @property def any_parent_is_group(self): if self._any_parent_is_group is None: return super(ConfigObject, self).any_parent_is_group From 93f7391e5a899a14adb1c8a0c964a26a9e565c23 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 17:49:19 +0200 Subject: [PATCH 393/507] convert data from gui data t o config data --- pype/tools/config_setting/config_setting/widgets/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 172450684b..02116b6044 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -126,7 +126,7 @@ class SystemWidget(QtWidgets.QWidget): if value is not lib.NOT_SET: _data.update(value) - values = _data["system"] + values = lib.convert_gui_data_to_overrides(_data.get("system", {})) dirpath = os.path.dirname(SYSTEM_CONFIGURATIONS_PATH) if not os.path.exists(dirpath): @@ -456,7 +456,7 @@ class ProjectWidget(QtWidgets.QWidget): if value is not lib.NOT_SET: _data.update(value) - output = _data["project"] + output = lib.convert_gui_data_to_overrides(_data.get("project", {})) dirpath = os.path.dirname(PROJECT_CONFIGURATIONS_PATH) if not os.path.exists(dirpath): From 037a573f7ca7f774d3855bbf16250844dd517827 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 17:51:22 +0200 Subject: [PATCH 394/507] a lot of changes to be able to get studio overrides --- .../config_setting/widgets/inputs.py | 223 ++++++++---------- 1 file changed, 93 insertions(+), 130 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3a3d517cc1..cf42d47ab5 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -16,15 +16,20 @@ class ConfigObject(AbstractConfigObject): default_state = "" - _has_studio_override = False _as_widget = False - _is_overriden = False - _is_modified = False - _was_overriden = False - _is_invalid = False _is_group = False + # TODO not implemented yet _is_nullable = False + _has_studio_override = False + _had_studio_override = False + + _is_overriden = False + _was_overriden = False + + _is_modified = False + _is_invalid = False + _any_parent_is_group = None _log = None @@ -38,6 +43,10 @@ class ConfigObject(AbstractConfigObject): def has_studio_override(self): return self._has_studio_override or self._parent.has_studio_override + @property + def had_studio_override(self): + return self._had_studio_override + @property def any_parent_is_group(self): if self._any_parent_is_group is None: @@ -47,7 +56,11 @@ class ConfigObject(AbstractConfigObject): @property def is_modified(self): """Has object any changes that require saving.""" - return self._is_modified or (self.was_overriden != self.is_overriden) + return ( + self._is_modified + or (self.was_overriden != self.is_overriden) + or (self.has_studio_override != self.had_studio_override) + ) @property def is_overriden(self): @@ -200,8 +213,9 @@ class InputObject(ConfigObject): ) self.default_value = value - if not self.has_studio_override: - self.set_value(value) + self._has_studio_override = False + self._had_studio_override = False + self.set_value(value) def update_studio_values(self, parent_values): value = NOT_SET @@ -219,8 +233,31 @@ class InputObject(ConfigObject): self.set_value(self.default_value) self._has_studio_override = False + self._had_studio_override = bool(self._has_studio_override) self._is_modified = False + def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + + if self.is_overidable: + self._is_overriden = True + else: + self._has_studio_override = True + + if self._is_invalid: + self._is_modified = True + elif self._is_overriden: + self._is_modified = self.item_value() != self.override_value + elif self._has_studio_override: + self._is_modified = self.item_value() != self.studio_value + else: + self._is_modified = self.item_value() != self.default_value + + self.update_style() + + self.value_changed.emit(self) + def studio_overrides(self): if not self.has_studio_override: return NOT_SET, False @@ -372,24 +409,6 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): # value as `value` the `_on_value_change` is not triggered self.checkbox.setChecked(value) - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_overidable: - self._is_overriden = True - - if self._is_invalid: - self._is_modified = True - elif self._is_overriden: - self._is_modified = self.item_value() != self.override_value - else: - self._is_modified = self.item_value() != self.studio_value - - self.update_style() - - self.value_changed.emit(self) - def update_style(self): state = self.style_state( self.has_studio_override, @@ -464,24 +483,6 @@ class NumberWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): self.input_field.setValue(value) - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_overidable: - self._is_overriden = True - - if self._is_invalid: - self._is_modified = True - elif self._is_overriden: - self._is_modified = self.item_value() != self.override_value - else: - self._is_modified = self.item_value() != self.studio_value - - self.update_style() - - self.value_changed.emit(self) - def update_style(self): state = self.style_state( self.has_studio_override, @@ -559,24 +560,6 @@ class TextWidget(QtWidgets.QWidget, InputObject): else: self.text_input.setText(value) - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_overidable: - self._is_overriden = True - - if self._is_invalid: - self._is_modified = True - elif self._is_overriden: - self._is_modified = self.item_value() != self.override_value - else: - self._is_modified = self.item_value() != self.studio_value - - self.update_style() - - self.value_changed.emit(self) - def update_style(self): state = self.style_state( self.has_studio_override, @@ -651,24 +634,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self.path_input.clear_end_path() super(PathInput, self).focusOutEvent(event) - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_overidable: - self._is_overriden = True - - if self._is_invalid: - self._is_modified = True - elif self.is_overriden: - self._is_modified = self.item_value() != self.override_value - else: - self._is_modified = self.item_value() != self.studio_value - - self.update_style() - - self.value_changed.emit(self) - def update_style(self): state = self.style_state( self.has_studio_override, @@ -804,24 +769,9 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): self.text_input.set_value(value) - def _on_value_change(self, item=None): + def _on_value_change(self, *args, **kwargs): self._is_invalid = self.text_input.has_invalid_value() - if self.ignore_value_changes: - return - - if self.is_overidable: - self._is_overriden = True - - if self._is_invalid: - self._is_modified = True - elif self._is_overriden: - self._is_modified = self.item_value() != self.override_value - else: - self._is_modified = self.item_value() != self.studio_value - - self.update_style() - - self.value_changed.emit(self) + return super(RawJsonWidget, self)._on_value_change(*args, **kwargs) def update_style(self): state = self.style_state( @@ -1006,24 +956,6 @@ class ListWidget(QtWidgets.QWidget, InputObject): if self.count() == 0: self.add_row(is_empty=True) - def _on_value_change(self, item=None): - if self.ignore_value_changes: - return - - if self.is_overidable: - self._is_overriden = True - - if self._is_invalid: - self._is_modified = True - elif self._is_overriden: - self._is_modified = self.item_value() != self.override_value - else: - self._is_modified = self.item_value() != self.studio_value - - self.update_style() - - self.value_changed.emit(self) - def add_row(self, row=None, value=None, is_empty=False): # Create new item item_widget = ListItem( @@ -1351,6 +1283,9 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.add_row(is_empty=True) def _on_value_change(self, item=None): + if self.ignore_value_changes: + return + fields_by_keys = collections.defaultdict(list) for input_field in self.input_fields: key = input_field.key_value() @@ -1367,18 +1302,19 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): field.is_key_duplicated = True field.update_style() - if self.ignore_value_changes: - return - if self.is_overidable: self._is_overriden = True + else: + self._has_studio_override = True - if self.is_invalid: + if self._is_invalid: self._is_modified = True elif self._is_overriden: self._is_modified = self.item_value() != self.override_value - else: + elif self._has_studio_override: self._is_modified = self.item_value() != self.studio_value + else: + self._is_modified = self.item_value() != self.default_value self.update_style() @@ -1633,6 +1569,12 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): if parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) + if value is NOT_SET: + self._has_studio_override = False + else: + self._has_studio_override = True + self._had_studio_override = bool(self._has_studio_override) + for item in self.input_fields: item.update_studio_values(value) @@ -1669,6 +1611,8 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): if self.is_group: if self.is_overidable: self._is_overriden = True + else: + self._has_studio_override = True self.hierarchical_style_update() @@ -1702,7 +1646,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): self._child_state = child_state state = self.style_state( - child_has_studio_override, + self.had_studio_override, child_invalid, self.is_overriden, self.is_modified @@ -1724,7 +1668,10 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): @property def child_has_studio_override(self): for input_field in self.input_fields: - if input_field.child_has_studio_override: + if ( + input_field.has_studio_override + or input_field.child_has_studio_override + ): return True return False @@ -1770,7 +1717,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): values = {} groups = [] for input_field in self.input_fields: - value, is_group = input_field.overrides() + value, is_group = input_field.studio_overrides() if value is not NOT_SET: values.update(value) if is_group: @@ -1850,7 +1797,10 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): @property def child_has_studio_override(self): for input_field in self.input_fields: - if input_field.child_has_studio_override: + if ( + input_field.has_studio_override + or input_field.child_has_studio_override + ): return True return False @@ -1896,6 +1846,8 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): if self.is_group: if self.is_overidable: self._is_overriden = True + else: + self._has_studio_override = True self.hierarchical_style_update() self.value_changed.emit(self) @@ -1982,7 +1934,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): values = {} groups = [] for input_field in self.input_fields: - value, is_group = input_field.overrides() + value, is_group = input_field.studio_overrides() if value is not NOT_SET: values.update(value) if is_group: @@ -2174,20 +2126,24 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): if self.is_overidable: self._is_overriden = True + else: + self._has_studio_override = True if self._is_invalid: self._is_modified = True elif self._is_overriden: self._is_modified = self.item_value() != self.override_value - else: + elif self._has_studio_override: self._is_modified = self.item_value() != self.studio_value + else: + self._is_modified = self.item_value() != self.default_value self.hierarchical_style_update() self.value_changed.emit(self) def update_style(self, is_overriden=None): - child_has_studio_override = self.has_studio_override + child_has_studio_override = self.child_has_studio_override child_modified = self.child_modified child_invalid = self.child_invalid child_state = self.style_state( @@ -2240,7 +2196,10 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): @property def child_has_studio_override(self): for input_field in self.input_fields: - if input_field.child_has_studio_override: + if ( + input_field.has_studio_override + or input_field.child_has_studio_override + ): return True return False @@ -2407,6 +2366,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): def _on_value_change(self, item=None): if self.ignore_value_changes: return + self.value_changed.emit(self) if self.any_parent_is_group: self.hierarchical_style_update() @@ -2414,7 +2374,10 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): @property def child_has_studio_override(self): for input_field in self.input_fields: - if input_field.child_has_studio_override: + if ( + input_field.has_studio_override + or input_field.child_has_studio_override + ): return True return False @@ -2467,7 +2430,7 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): values = {} groups = [] for input_field in self.input_fields: - value, is_group = input_field.overrides() + value, is_group = input_field.studio_overrides() if value is not NOT_SET: values.update(value) if is_group: From 6bdee49e2fd0d66e2b32b31eb56bcac3699d26f6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 17:52:52 +0200 Subject: [PATCH 395/507] underscored attributes are kept --- .../config_setting/widgets/base.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 02116b6044..cfbed884d9 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -17,10 +17,10 @@ from avalon import io class SystemWidget(QtWidgets.QWidget): is_overidable = False - has_studio_override = False - is_overriden = False - is_group = False - any_parent_is_group = False + has_studio_override = _has_studio_override = False + is_overriden = _is_overriden = False + is_group = _is_group = False + any_parent_is_group = _any_parent_is_group = False def __init__(self, parent=None): super(SystemWidget, self).__init__(parent) @@ -286,10 +286,10 @@ class ProjectListWidget(QtWidgets.QWidget): class ProjectWidget(QtWidgets.QWidget): - has_studio_override = False - is_overriden = False - is_group = False - any_parent_is_group = False + has_studio_override = _has_studio_override = False + is_overriden = _is_overriden = False + is_group = _is_group = False + any_parent_is_group = _any_parent_is_group = False def __init__(self, parent=None): super(ProjectWidget, self).__init__(parent) From b3f6c8296510e37f5940f945210496c64f6689b1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 18:00:41 +0200 Subject: [PATCH 396/507] ignore value changes during loading of studio overrides --- .../config_setting/widgets/base.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index cfbed884d9..a143e584dd 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -139,8 +139,11 @@ class SystemWidget(QtWidgets.QWidget): self._update_values() def _update_values(self): - default_values = default_configuration() - default_values = {"system": default_values["system_configurations"]} + self.ignore_value_changes = True + + default_values = { + "system": default_configuration()["system_configurations"] + } for input_field in self.input_fields: input_field.update_default_values(default_values) @@ -148,8 +151,7 @@ class SystemWidget(QtWidgets.QWidget): for input_field in self.input_fields: input_field.update_studio_values(system_values) - for input_field in self.input_fields: - input_field.hierarchical_style_update() + self.ignore_value_changes = False def add_children_gui(self, child_configuration): item_type = child_configuration["type"] @@ -469,8 +471,11 @@ class ProjectWidget(QtWidgets.QWidget): self._update_values() def _update_values(self): - default_values = default_configuration() - default_values = {"project": default_values["project_configurations"]} + self.ignore_value_changes = True + + default_values = { + "project": default_configuration()["project_configurations"] + } for input_field in self.input_fields: input_field.update_default_values(default_values) @@ -478,5 +483,4 @@ class ProjectWidget(QtWidgets.QWidget): for input_field in self.input_fields: input_field.update_studio_values(studio_values) - for input_field in self.input_fields: - input_field.hierarchical_style_update() + self.ignore_value_changes = False From a4babc31da11cab5e9841c5187e03d409db99640 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 18:00:59 +0200 Subject: [PATCH 397/507] few minor changes --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index cf42d47ab5..ff4448992d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -762,10 +762,10 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.text_input.textChanged.connect(self._on_value_change) def update_studio_values(self, parent_values): - super(RawJsonWidget, self).update_studio_values(parent_values) - self._is_invalid = self.text_input.has_invalid_value() + super(RawJsonWidget, self).update_studio_values(parent_values) + def set_value(self, value): self.text_input.set_value(value) @@ -1765,6 +1765,8 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): self._any_parent_is_group = any_parent_is_group self._is_group = input_data.get("is_group", False) + if self._is_group: + raise TypeError("DictInvisible can't be marked as group input.") self.setAttribute(QtCore.Qt.WA_TranslucentBackground) From 0506d513954a29950a517a194d8203c7da4da84b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Sep 2020 18:38:54 +0200 Subject: [PATCH 398/507] fix dict studio override --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ff4448992d..4a71f0380c 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1569,10 +1569,10 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): if parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) - if value is NOT_SET: - self._has_studio_override = False - else: + self._has_studio_override = False + if self.is_group and value is not NOT_SET: self._has_studio_override = True + self._had_studio_override = bool(self._has_studio_override) for item in self.input_fields: From 431a52689ebdd91e7c1047a815da3a1c277b5f1a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 10:25:34 +0200 Subject: [PATCH 399/507] discard changes fix --- .../config_setting/config_setting/widgets/inputs.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4a71f0380c..afdcc207cf 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -306,14 +306,12 @@ class InputObject(ConfigObject): def discard_changes(self): self._is_overriden = self._was_overriden - if ( - self.is_overidable - and self._was_overriden - and self.override_value is not NOT_SET - ): - self.set_value(self.override_value) + self._has_studio_override = self._had_studio_override + if self.is_overidable: + if self._was_overriden and self.override_value is not NOT_SET: + self.set_value(self.override_value) else: - if self.has_studio_override: + if self._had_studio_override: self.set_value(self.studio_value) else: self.set_value(self.default_value) From 729b474f20332f3d5ebc7132b9b0675ade7c1662 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 10:39:15 +0200 Subject: [PATCH 400/507] restart states on value updates --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index afdcc207cf..c9c40f251c 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -201,6 +201,7 @@ class ConfigObject(AbstractConfigObject): class InputObject(ConfigObject): def update_default_values(self, parent_values): + self._state = None value = NOT_SET if self._as_widget: value = parent_values @@ -218,6 +219,7 @@ class InputObject(ConfigObject): self.set_value(value) def update_studio_values(self, parent_values): + self._state = None value = NOT_SET if self._as_widget: value = parent_values From 50aea9f15061129cb0fcdeb3cb6d0db252b11229 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 10:40:01 +0200 Subject: [PATCH 401/507] apply_overrides works for widget inputs --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index c9c40f251c..945ad0f255 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -285,7 +285,9 @@ class InputObject(ConfigObject): self._is_modified = False self._state = None - if parent_values is NOT_SET or self.key not in parent_values: + if self._as_widget: + override_value = parent_values + elif parent_values is NOT_SET or self.key not in parent_values: override_value = NOT_SET else: override_value = parent_values[self.key] From 6ed724d040bf85fa0dadbcc64699caa65fc124ec Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 10:56:08 +0200 Subject: [PATCH 402/507] state for disabled widgets is different --- .../config_setting/widgets/inputs.py | 107 +++++++++++------- 1 file changed, 65 insertions(+), 42 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 945ad0f255..eea33d3ef6 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -412,12 +412,15 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.checkbox.setChecked(value) def update_style(self): - state = self.style_state( - self.has_studio_override, - self.is_invalid, - self.is_overriden, - self.is_modified - ) + if self._as_widget and not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified + ) if self._state == state: return @@ -486,12 +489,15 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.input_field.setValue(value) def update_style(self): - state = self.style_state( - self.has_studio_override, - self.is_invalid, - self.is_overriden, - self.is_modified - ) + if self._as_widget and not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified + ) if self._state == state: return @@ -563,12 +569,15 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.text_input.setText(value) def update_style(self): - state = self.style_state( - self.has_studio_override, - self.is_invalid, - self.is_overriden, - self.is_modified - ) + if self._as_widget and not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified + ) if self._state == state: return @@ -637,12 +646,16 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): super(PathInput, self).focusOutEvent(event) def update_style(self): - state = self.style_state( - self.has_studio_override, - self.is_invalid, - self.is_overriden, - self.is_modified - ) + if self._as_widget and not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified + ) + if self._state == state: return @@ -776,12 +789,16 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): return super(RawJsonWidget, self)._on_value_change(*args, **kwargs) def update_style(self): - state = self.style_state( - self.has_studio_override, - self.is_invalid, - self.is_overriden, - self.is_modified - ) + if self._as_widget and not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified + ) + if self._state == state: return @@ -1036,12 +1053,15 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.update_style() def update_style(self): - state = self.style_state( - self.has_studio_override, - self.is_invalid, - self.is_overriden, - self.is_modified - ) + if self._as_widget and not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified + ) if self._state == state: return @@ -1328,12 +1348,15 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.update_style() def update_style(self): - state = self.style_state( - self.has_studio_override, - self.is_invalid, - self.is_overriden, - self.is_modified - ) + if self._as_widget and not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified + ) if self._state == state: return From c55d2ee91f589522662e21b8e34c66efa91f5d20 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 10:56:38 +0200 Subject: [PATCH 403/507] list items has apply_overrides and update_studio_values --- .../config_setting/config_setting/widgets/inputs.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index eea33d3ef6..ae55679d73 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -902,6 +902,12 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def mouseReleaseEvent(self, event): return QtWidgets.QWidget.mouseReleaseEvent(self, event) + def update_studio_values(self, value): + self.value_input.update_studio_values(value) + + def apply_overrides(self, value): + self.value_input.apply_overrides(value) + class ListWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) @@ -1002,7 +1008,11 @@ class ListWidget(QtWidgets.QWidget, InputObject): # Set text if entered text is not None # else (when add button clicked) trigger `_on_value_change` if value is not None: - item_widget.value_input.update_studio_values(value) + if self._is_overriden: + item_widget.apply_overrides(value) + else: + item_widget.update_studio_values(value) + self.hierarchical_style_update() else: self._on_value_change() self.updateGeometry() From 1164d0b9880716c231d05df679be21e7966d15e9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 11:33:47 +0200 Subject: [PATCH 404/507] moved setting attributes much earlier --- pype/tools/config_setting/config_setting/widgets/inputs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ae55679d73..7096f70ecd 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -228,14 +228,15 @@ class InputObject(ConfigObject): self.studio_value = value if value is not NOT_SET: - self.set_value(value) self._has_studio_override = True + self._had_studio_override = True + self.set_value(value) else: - self.set_value(self.default_value) self._has_studio_override = False + self._had_studio_override = False + self.set_value(self.default_value) - self._had_studio_override = bool(self._has_studio_override) self._is_modified = False def _on_value_change(self, item=None): From c210b317042ae2dbab6e12b3fb027dde6c363330 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 11:34:05 +0200 Subject: [PATCH 405/507] is_modified cares if is_overridable or not --- .../config_setting/config_setting/widgets/inputs.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 7096f70ecd..8aebb6dd5f 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -56,11 +56,13 @@ class ConfigObject(AbstractConfigObject): @property def is_modified(self): """Has object any changes that require saving.""" - return ( - self._is_modified - or (self.was_overriden != self.is_overriden) - or (self.has_studio_override != self.had_studio_override) - ) + if self._is_modified: + return True + + if self.is_overidable: + return self.was_overriden != self.is_overriden + else: + return self.has_studio_override != self.had_studio_override @property def is_overriden(self): From adc086ba0f14ffc8f41c9404f70349e59874dfe2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 11:34:29 +0200 Subject: [PATCH 406/507] method apply_overrides moved --- .../config_setting/widgets/inputs.py | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 8aebb6dd5f..a7e09abb6d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -239,7 +239,32 @@ class InputObject(ConfigObject): self._had_studio_override = False self.set_value(self.default_value) + def apply_overrides(self, parent_values): self._is_modified = False + self._state = None + self._had_studio_override = bool(self._has_studio_override) + if self._as_widget: + override_value = parent_values + elif parent_values is NOT_SET or self.key not in parent_values: + override_value = NOT_SET + else: + override_value = parent_values[self.key] + + self.override_value = override_value + + if override_value is NOT_SET: + self._is_overriden = False + self._was_overriden = False + if self.has_studio_override: + value = self.studio_value + else: + value = self.default_value + else: + self._is_overriden = True + self._was_overriden = True + value = override_value + + self.set_value(value) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -284,33 +309,6 @@ class InputObject(ConfigObject): self._is_overriden = False self._is_modified = False - def apply_overrides(self, parent_values): - self._is_modified = False - self._state = None - - if self._as_widget: - override_value = parent_values - elif parent_values is NOT_SET or self.key not in parent_values: - override_value = NOT_SET - else: - override_value = parent_values[self.key] - - self.override_value = override_value - - if override_value is NOT_SET: - self._is_overriden = False - self._was_overriden = False - if self.has_studio_override: - value = self.studio_value - else: - value = self.default_value - else: - self._is_overriden = True - self._was_overriden = True - value = override_value - - self.set_value(value) - def discard_changes(self): self._is_overriden = self._was_overriden self._has_studio_override = self._had_studio_override From 2e9ef743536ed41be674e8cb2aaa7e4499d15947 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 11:36:43 +0200 Subject: [PATCH 407/507] as widget input does not care about overrides --- .../config_setting/widgets/inputs.py | 85 ++++++++++++++++--- 1 file changed, 71 insertions(+), 14 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index a7e09abb6d..81218855c9 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -413,8 +413,16 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): self.checkbox.setChecked(value) def update_style(self): - if self._as_widget and not self.isEnabled(): - state = self.style_state(False, False, False, False) + if self._as_widget: + if not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + False, + self._is_invalid, + False, + self._is_modified + ) else: state = self.style_state( self.has_studio_override, @@ -490,8 +498,16 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.input_field.setValue(value) def update_style(self): - if self._as_widget and not self.isEnabled(): - state = self.style_state(False, False, False, False) + if self._as_widget: + if not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + False, + self._is_invalid, + False, + self._is_modified + ) else: state = self.style_state( self.has_studio_override, @@ -570,8 +586,16 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.text_input.setText(value) def update_style(self): - if self._as_widget and not self.isEnabled(): - state = self.style_state(False, False, False, False) + if self._as_widget: + if not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + False, + self._is_invalid, + False, + self._is_modified + ) else: state = self.style_state( self.has_studio_override, @@ -579,6 +603,7 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.is_overriden, self.is_modified ) + if self._state == state: return @@ -647,8 +672,16 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): super(PathInput, self).focusOutEvent(event) def update_style(self): - if self._as_widget and not self.isEnabled(): - state = self.style_state(False, False, False, False) + if self._as_widget: + if not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + False, + self._is_invalid, + False, + self._is_modified + ) else: state = self.style_state( self.has_studio_override, @@ -790,8 +823,16 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): return super(RawJsonWidget, self)._on_value_change(*args, **kwargs) def update_style(self): - if self._as_widget and not self.isEnabled(): - state = self.style_state(False, False, False, False) + if self._as_widget: + if not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + False, + self._is_invalid, + False, + self._is_modified + ) else: state = self.style_state( self.has_studio_override, @@ -1064,8 +1105,16 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.update_style() def update_style(self): - if self._as_widget and not self.isEnabled(): - state = self.style_state(False, False, False, False) + if self._as_widget: + if not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + False, + self._is_invalid, + False, + self._is_modified + ) else: state = self.style_state( self.has_studio_override, @@ -1359,8 +1408,16 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.update_style() def update_style(self): - if self._as_widget and not self.isEnabled(): - state = self.style_state(False, False, False, False) + if self._as_widget: + if not self.isEnabled(): + state = self.style_state(False, False, False, False) + else: + state = self.style_state( + False, + self._is_invalid, + False, + self._is_modified + ) else: state = self.style_state( self.has_studio_override, From 78dc9b1c3bedcc049d1904c0ca2b91ab5dbbfc08 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 11:37:34 +0200 Subject: [PATCH 408/507] list has updating default values --- .../config_setting/config_setting/widgets/inputs.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 81218855c9..3f59f751e5 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -204,6 +204,8 @@ class ConfigObject(AbstractConfigObject): class InputObject(ConfigObject): def update_default_values(self, parent_values): self._state = None + self._is_modified = False + value = NOT_SET if self._as_widget: value = parent_values @@ -222,6 +224,8 @@ class InputObject(ConfigObject): def update_studio_values(self, parent_values): self._state = None + self._is_modified = False + value = NOT_SET if self._as_widget: value = parent_values @@ -944,6 +948,9 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def mouseReleaseEvent(self, event): return QtWidgets.QWidget.mouseReleaseEvent(self, event) + def update_default_values(self, value): + self.value_input.update_default_values(value) + def update_studio_values(self, value): self.value_input.update_studio_values(value) @@ -1050,7 +1057,9 @@ class ListWidget(QtWidgets.QWidget, InputObject): # Set text if entered text is not None # else (when add button clicked) trigger `_on_value_change` if value is not None: - if self._is_overriden: + if not self._has_studio_override: + item_widget.update_default_values(value) + elif self._is_overriden: item_widget.apply_overrides(value) else: item_widget.update_studio_values(value) From 442e5ccfd3099524f9c204d200905278e531202d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 11:41:43 +0200 Subject: [PATCH 409/507] fixed any_parent_is_group attribute in anatomy inputs --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 43146f7442..525e1bcd88 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -46,7 +46,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self._child_state = None self._state = None - self.any_parent_is_group = False + self._any_parent_is_group = False self.root_widget = RootsWidget(self) self.templates_widget = TemplatesWidget(self) @@ -190,7 +190,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._multiroot_state = None self._is_group = True - self.any_parent_is_group = False + self._any_parent_is_group = False self.global_is_multiroot = False self.was_multiroot = NOT_SET @@ -492,7 +492,7 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): self._state = None self._is_group = True - self.any_parent_is_group = False + self._any_parent_is_group = False self.key = "templates" body_widget = ExpandingWidget("Templates", self) From e8459167a8aaa4626e7d5c0e21ae8ad881584524 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 11:41:51 +0200 Subject: [PATCH 410/507] abstracted updating methods --- .../config_setting/widgets/widgets.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index d803624850..d7631e6fea 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -234,6 +234,21 @@ class AbstractConfigObject: ) return super(AbstractConfigObject, self).__getattribute__(name) + def update_default_values(self, parent_values): + raise NotImplementedError( + "{} does not have implemented `update_default_values`".format(self) + ) + + def update_studio_values(self, parent_values): + raise NotImplementedError( + "{} does not have implemented `update_studio_values`".format(self) + ) + + def apply_overrides(self, parent_values): + raise NotImplementedError( + "{} does not have implemented `apply_overrides`".format(self) + ) + @property def is_modified(self): """Has object any changes that require saving.""" From 36fff023017c835927b5b0af256aa9a6b5d465cb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 12:00:43 +0200 Subject: [PATCH 411/507] PathWIdget has update values methods --- .../config_setting/widgets/inputs.py | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 3f59f751e5..8e5e8c2a5d 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2187,6 +2187,49 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.setFocusProxy(self.input_fields[0]) self.content_layout.addWidget(proxy_widget) + def update_default_values(self, parent_values): + self._state = None + self._child_state = None + self._is_modified = False + + value = NOT_SET + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + if value is NOT_SET: + raise ValueError( + "Default value is not set. This is implementation BUG." + ) + + self.default_value = value + self._has_studio_override = False + self._had_studio_override = False + self.set_value(value) + + def update_studio_values(self, parent_values): + self._state = None + self._child_state = None + self._is_modified = False + + value = NOT_SET + if self._as_widget: + value = parent_values + elif parent_values is not NOT_SET: + value = parent_values.get(self.key, NOT_SET) + + self.studio_value = value + if value is not NOT_SET: + self._has_studio_override = True + self._had_studio_override = True + self.set_value(value) + + else: + self._has_studio_override = False + self._had_studio_override = False + self.set_value(self.default_value) + def apply_overrides(self, parent_values): self._is_modified = False self._state = None From 42dcad9655e03655e0724a2e36f6eb8ce203ef9c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 12:00:59 +0200 Subject: [PATCH 412/507] fixed update defaults in anatomy widget --- .../config_setting/widgets/anatomy_inputs.py | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 525e1bcd88..4756ac25a4 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -75,7 +75,15 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.value_changed.connect(self._on_value_change) - def update_default_values(self, value): + def update_default_values(self, parent_values): + self._state = None + self._child_state = None + + if isinstance(parent_values, dict): + value = parent_values.get(self.key, NOT_SET) + else: + value = NOT_SET + self.root_widget.update_default_values(value) self.templates_widget.update_default_values(value) @@ -280,11 +288,17 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.set_multiroot(is_multiroot) if is_multiroot: - self.singleroot_widget.update_studio_values(NOT_SET) - self.multiroot_widget.update_studio_values(value) + for _value in value.values(): + singleroot_value = _value + break + + multiroot_value = value else: - self.singleroot_widget.update_studio_values(value) - self.multiroot_widget.update_studio_values(NOT_SET) + singleroot_value = value + multiroot_value = {"": value} + + self.singleroot_widget.update_default_values(singleroot_value) + self.multiroot_widget.update_default_values(multiroot_value) def update_studio_values(self, parent_values): self._state = None From c31267906fc7fe5ac7427b5012e7a650936120fd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 12:08:17 +0200 Subject: [PATCH 413/507] added studio overrides to anatomy inputs --- .../config_setting/widgets/anatomy_inputs.py | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 4756ac25a4..141feee61d 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -123,10 +123,14 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.value_changed.emit(self) def update_style(self, is_overriden=None): + child_has_studio_override = self.child_has_studio_override child_modified = self.child_modified child_invalid = self.child_invalid child_state = self.style_state( - child_invalid, self.child_overriden, child_modified + child_has_studio_override, + child_invalid, + self.child_overriden, + child_modified ) if child_state: child_state = "child-{}".format(child_state) @@ -143,6 +147,13 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.templates_widget.hierarchical_style_update() self.update_style() + @property + def child_has_studio_override(self): + return ( + self.root_widget.child_has_studio_override + or self.templates_widget.child_has_studio_override + ) + @property def child_modified(self): return ( @@ -320,6 +331,13 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.was_multiroot = is_multiroot self.set_multiroot(is_multiroot) + if value is NOT_SET: + self._has_studio_override = False + self._had_studio_override = False + else: + self._has_studio_override = True + self._had_studio_override = True + if is_multiroot: self.singleroot_widget.update_studio_values(NOT_SET) self.multiroot_widget.update_studio_values(value) @@ -368,6 +386,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def update_style(self): multiroot_state = self.style_state( + self.has_studio_override, False, self.is_overriden, self.was_multiroot != self.is_multiroot @@ -378,7 +397,10 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._multiroot_state = multiroot_state state = self.style_state( - self.is_invalid, self.is_overriden, self.is_modified + self.has_studio_override, + self.is_invalid, + self.is_overriden, + self.is_modified ) if self._state == state: return @@ -433,6 +455,13 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._on_value_change() + @property + def child_has_studio_override(self): + if self.is_multiroot: + return self.multiroot_widget.child_has_studio_override + else: + return self.singleroot_widget.child_has_studio_override + @property def child_modified(self): if self.is_multiroot: @@ -549,7 +578,10 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def update_style(self): state = self.style_state( - self.child_invalid, self.child_overriden, self.child_modified + self.has_studio_override, + self.child_invalid, + self.child_overriden, + self.child_modified ) if self._state == state: return @@ -577,6 +609,10 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def is_overriden(self): return self._is_overriden + @property + def child_has_studio_override(self): + return self.value_input.child_has_studio_override + @property def child_modified(self): return self.value_input.child_modified From c618cd0b4421a32412fee2806a93db72673cb1cc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 16:01:23 +0200 Subject: [PATCH 414/507] modified pathwidget --- .../config_setting/widgets/inputs.py | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 8e5e8c2a5d..c32d45246b 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1197,7 +1197,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.key_input.textChanged.connect(self._on_value_change) self.value_input.value_changed.connect(self._on_value_change) - self.origin_key = self.key_value() + self.origin_key = NOT_SET def key_value(self): return self.key_input.text() @@ -1214,6 +1214,11 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): self.update_style() self.value_changed.emit(self) + def update_default_values(self, key, value): + self.origin_key = key + self.key_input.setText(key) + self.value_input.update_default_values(value) + def update_studio_values(self, key, value): self.origin_key = key self.key_input.setText(key) @@ -1488,7 +1493,9 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): # Set value if entered value is not None # else (when add button clicked) trigger `_on_value_change` if value is not None and key is not None: - if self._is_overriden: + if not self._has_studio_override: + item_widget.update_default_values(key, value) + elif self._is_overriden: item_widget.apply_overrides(key, value) else: item_widget.update_studio_values(key, value) @@ -2206,7 +2213,12 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.default_value = value self._has_studio_override = False self._had_studio_override = False - self.set_value(value) + + if not self.multiplatform: + self.input_fields[0].update_studio_values(value) + else: + for input_field in self.input_fields: + input_field.update_studio_values(value) def update_studio_values(self, parent_values): self._state = None @@ -2223,12 +2235,16 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): if value is not NOT_SET: self._has_studio_override = True self._had_studio_override = True - self.set_value(value) - else: self._has_studio_override = False self._had_studio_override = False - self.set_value(self.default_value) + value = self.default_value + + if not self.multiplatform: + self.input_fields[0].update_studio_values(value) + else: + for input_field in self.input_fields: + input_field.update_studio_values(value) def apply_overrides(self, parent_values): self._is_modified = False From 3e5b0cf82f0a547d0f2668d455e5357d02b4eafa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 16:01:41 +0200 Subject: [PATCH 415/507] fixed saving in bases --- .../config_setting/widgets/base.py | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index a143e584dd..a8bdd9b1a4 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -429,14 +429,15 @@ class ProjectWidget(QtWidgets.QWidget): self._save_overrides() def _save_overrides(self): - _data = {} + data = {} for item in self.input_fields: value, is_group = item.overrides() if value is not lib.NOT_SET: - _data.update(value) + data.update(value) - data = _data.get("project") or {} - output_data = lib.convert_gui_data_to_overrides(data) + output_data = lib.convert_gui_data_to_overrides( + data.get("project") or {} + ) overrides_json_path = path_to_project_overrides( self.project_name @@ -452,21 +453,27 @@ class ProjectWidget(QtWidgets.QWidget): self._on_project_change() def _save_defaults(self): - _data = {} + data = {} for input_field in self.input_fields: value, is_group = input_field.studio_overrides() if value is not lib.NOT_SET: - _data.update(value) + data.update(value) - output = lib.convert_gui_data_to_overrides(_data.get("project", {})) + output_data = lib.convert_gui_data_to_overrides( + data.get("project", {}) + ) dirpath = os.path.dirname(PROJECT_CONFIGURATIONS_PATH) if not os.path.exists(dirpath): os.makedirs(dirpath) print("Saving data to:", PROJECT_CONFIGURATIONS_PATH) - with open(PROJECT_CONFIGURATIONS_PATH, "w") as file_stream: - json.dump(output, file_stream, indent=4) + try: + with open(PROJECT_CONFIGURATIONS_PATH, "w") as file_stream: + json.dump(output_data, file_stream, indent=4) + except Exception as exc: + print(output_data) + raise self._update_values() From 25f3d91b6d6a60eeee3b0eaad0c3258a093b4ec0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 16:01:53 +0200 Subject: [PATCH 416/507] fixed anatomy inputs filling --- .../config_setting/widgets/anatomy_inputs.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 141feee61d..e5f0dd5990 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -1,7 +1,7 @@ from Qt import QtWidgets, QtCore from .widgets import ExpandingWidget from .inputs import ConfigObject, ModifiableDict, PathWidget, RawJsonWidget -from .lib import NOT_SET, TypeToKlass, CHILD_OFFSET +from .lib import NOT_SET, TypeToKlass, CHILD_OFFSET, METADATA_KEY class AnatomyWidget(QtWidgets.QWidget, ConfigObject): @@ -192,6 +192,17 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): output.update(self.templates_widget.config_value()) return output + def studio_overrides(self): + if ( + self.root_widget.child_has_studio_override + or self.templates_widget.child_has_studio_override + ): + groups = [self.root_widget.key, self.templates_widget.key] + value = self.config_value() + value[self.key][METADATA_KEY] = {"groups": groups} + return value, True + return NOT_SET, False + def config_value(self): return {self.key: self.item_value()} @@ -339,11 +350,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._had_studio_override = True if is_multiroot: - self.singleroot_widget.update_studio_values(NOT_SET) self.multiroot_widget.update_studio_values(value) else: self.singleroot_widget.update_studio_values(value) - self.multiroot_widget.update_studio_values(NOT_SET) def apply_overrides(self, parent_values): # Make sure this is set to False @@ -371,13 +380,11 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if is_multiroot: self._is_overriden = parent_values is not NOT_SET self._was_overriden = bool(self._is_overriden) - self.singleroot_widget.apply_overrides(NOT_SET) self.multiroot_widget.apply_overrides(parent_values) else: self._is_overriden = value is not NOT_SET self._was_overriden = bool(self._is_overriden) self.singleroot_widget.apply_overrides(value) - self.multiroot_widget.apply_overrides(NOT_SET) def hierarchical_style_update(self): self.singleroot_widget.hierarchical_style_update() From f2372c27b9e873b0008a8d0484888ba73ff5f4b2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 17:02:04 +0200 Subject: [PATCH 417/507] fixed roots input statuses --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index e5f0dd5990..bf2477bd7c 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -292,6 +292,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def update_default_values(self, parent_values): self._state = None self._multiroot_state = None + self._is_modified = False if isinstance(parent_values, dict): value = parent_values.get(self.key, NOT_SET) @@ -309,6 +310,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.was_multiroot = is_multiroot self.set_multiroot(is_multiroot) + self._has_studio_override = False + self._had_studio_override = False if is_multiroot: for _value in value.values(): singleroot_value = _value @@ -325,6 +328,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def update_studio_values(self, parent_values): self._state = None self._multiroot_state = None + self._is_modified = False if isinstance(parent_values, dict): value = parent_values.get(self.key, NOT_SET) @@ -597,7 +601,7 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): child_state = "child-{}".format(state) else: child_state = "" - print(child_state) + self.body_widget.side_line_widget.setProperty("state", child_state) self.body_widget.side_line_widget.style().polish( self.body_widget.side_line_widget From 5aa922026d338c487a13c0e12642e47741319511 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 17:18:39 +0200 Subject: [PATCH 418/507] templates widget has value_changed signal --- .../config_setting/widgets/anatomy_inputs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index bf2477bd7c..404fe589d3 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -74,6 +74,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.label_widget = body_widget.label_widget self.root_widget.value_changed.connect(self._on_value_change) + self.templates_widget.value_changed.connect(self._on_value_change) def update_default_values(self, parent_values): self._state = None @@ -538,6 +539,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): class TemplatesWidget(QtWidgets.QWidget, ConfigObject): + value_changed = QtCore.Signal(object) + def __init__(self, parent): super(TemplatesWidget, self).__init__(parent) @@ -571,6 +574,13 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): layout.addWidget(body_widget) + self.value_input.value_changed.connect(self._on_value_change) + + def _on_value_change(self, item): + self.update_style() + + self.value_changed.emit(self) + def update_default_values(self, values): self._state = None self.value_input.update_default_values(values) @@ -620,6 +630,10 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def is_overriden(self): return self._is_overriden + @property + def has_studio_override(self): + return self.value_input.has_studio_override + @property def child_has_studio_override(self): return self.value_input.child_has_studio_override From 5928990cb3159395bd7521a0335e256fd3d21a32 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 17:18:51 +0200 Subject: [PATCH 419/507] just small modification --- pype/tools/config_setting/config_setting/widgets/inputs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index c32d45246b..05fd9e8aab 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -816,8 +816,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def update_studio_values(self, parent_values): self._is_invalid = self.text_input.has_invalid_value() - - super(RawJsonWidget, self).update_studio_values(parent_values) + return super(RawJsonWidget, self).update_studio_values(parent_values) def set_value(self, value): self.text_input.set_value(value) From d020503f53e01983b4184ed2c5fc6b5418f50e29 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 17:53:41 +0200 Subject: [PATCH 420/507] ModifiableDict has fixed invalid state --- .../config_setting/config_setting/widgets/inputs.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 05fd9e8aab..5763738351 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1337,6 +1337,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): if as_widget: main_layout.addWidget(content_widget) + body_widget = None else: body_widget = ExpandingWidget(input_data["label"], self) main_layout.addWidget(body_widget) @@ -1353,6 +1354,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): if expanded: body_widget.toggle_content() + self.body_widget = body_widget self.content_widget = content_widget self.content_layout = content_layout @@ -1427,7 +1429,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): else: state = self.style_state( False, - self._is_invalid, + self.is_invalid, False, self._is_modified ) @@ -1446,8 +1448,11 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): else: child_state = "" - self.setProperty("state", child_state) - self.style().polish(self) + if self.body_widget: + self.body_widget.side_line_widget.setProperty("state", child_state) + self.body_widget.side_line_widget.style().polish( + self.body_widget.side_line_widget + ) if not self._as_widget: self.label_widget.setProperty("state", state) From 139c1b50cf417cd2ac313f9bb77f74422ff57f32 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 10 Sep 2020 18:02:07 +0200 Subject: [PATCH 421/507] fixed style updates for root widget --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 404fe589d3..efba588692 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -410,7 +410,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): state = self.style_state( self.has_studio_override, - self.is_invalid, + self.child_invalid, self.is_overriden, self.is_modified ) @@ -453,6 +453,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): or self.child_modified ) + self.update_style() + self.value_changed.emit(self) def set_multiroot(self, is_multiroot=None): From b161dda7adea6a43b2e58f99a29823dddd7ea255 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 11:27:13 +0200 Subject: [PATCH 422/507] fix config loading --- pype/configurations/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/configurations/config.py b/pype/configurations/config.py index e19a27f33c..ed7104427f 100644 --- a/pype/configurations/config.py +++ b/pype/configurations/config.py @@ -14,7 +14,7 @@ def system_configurations(): def project_configurations(project_name): - default_values = default_configuration() + default_values = default_configuration()["project_configurations"] studio_values = studio_project_configurations() studio_overrides = apply_overrides(default_values, studio_values) From 2f87b60f2e2dd967a465682f9420a030564bcb99 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 11:27:44 +0200 Subject: [PATCH 423/507] add develop button to save as default --- pype/tools/config_setting/__main__.py | 3 ++- .../config_setting/widgets/base.py | 23 +++++++++++++++++-- .../config_setting/widgets/window.py | 6 ++--- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/__main__.py b/pype/tools/config_setting/__main__.py index aa6f707443..0e4ab1c0aa 100644 --- a/pype/tools/config_setting/__main__.py +++ b/pype/tools/config_setting/__main__.py @@ -11,7 +11,8 @@ if __name__ == "__main__": app.setStyleSheet(stylesheet) app.setWindowIcon(QtGui.QIcon(config_setting.style.app_icon_path())) - widget = config_setting.MainWidget() + develop = "-dev" in sys.argv + widget = config_setting.MainWidget(develop) widget.show() sys.exit(app.exec_()) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index a8bdd9b1a4..52d6b73c98 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -22,9 +22,10 @@ class SystemWidget(QtWidgets.QWidget): is_group = _is_group = False any_parent_is_group = _any_parent_is_group = False - def __init__(self, parent=None): + def __init__(self, develop, parent=None): super(SystemWidget, self).__init__(parent) + self.develop = develop self._ignore_value_changes = False self.input_fields = [] @@ -48,6 +49,11 @@ class SystemWidget(QtWidgets.QWidget): footer_widget = QtWidgets.QWidget() footer_layout = QtWidgets.QHBoxLayout(footer_widget) + if self.develop: + save_as_default_btn = QtWidgets.QPushButton("Save as Default") + footer_layout.addWidget(save_as_default_btn, 0) + save_as_default_btn.clicked.connect(self._save_as_defaults) + save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() footer_layout.addWidget(spacer_widget, 1) @@ -138,6 +144,9 @@ class SystemWidget(QtWidgets.QWidget): self._update_values() + def _save_as_defaults(self): + print("_save_as_defaults") + def _update_values(self): self.ignore_value_changes = True @@ -293,9 +302,11 @@ class ProjectWidget(QtWidgets.QWidget): is_group = _is_group = False any_parent_is_group = _any_parent_is_group = False - def __init__(self, parent=None): + def __init__(self, develop, parent=None): super(ProjectWidget, self).__init__(parent) + self.develop = develop + self.is_overidable = False self._ignore_value_changes = False self.project_name = None @@ -320,6 +331,11 @@ class ProjectWidget(QtWidgets.QWidget): footer_widget = QtWidgets.QWidget() footer_layout = QtWidgets.QHBoxLayout(footer_widget) + if self.develop: + save_as_default_btn = QtWidgets.QPushButton("Save as Default") + footer_layout.addWidget(save_as_default_btn, 0) + save_as_default_btn.clicked.connect(self._save_as_defaults) + save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() footer_layout.addWidget(spacer_widget, 1) @@ -398,6 +414,9 @@ class ProjectWidget(QtWidgets.QWidget): item.apply_overrides(overrides) self.ignore_value_changes = False + def _save_as_defaults(self): + print("_save_as_defaults") + def _save(self): has_invalid = False for item in self.input_fields: diff --git a/pype/tools/config_setting/config_setting/widgets/window.py b/pype/tools/config_setting/config_setting/widgets/window.py index 7ad46b1a06..f8da9a196e 100644 --- a/pype/tools/config_setting/config_setting/widgets/window.py +++ b/pype/tools/config_setting/config_setting/widgets/window.py @@ -6,15 +6,15 @@ class MainWidget(QtWidgets.QWidget): widget_width = 1000 widget_height = 600 - def __init__(self, parent=None): + def __init__(self, develop, parent=None): super(MainWidget, self).__init__(parent) self.resize(self.widget_width, self.widget_height) header_tab_widget = QtWidgets.QTabWidget(parent=self) - studio_widget = SystemWidget() - project_widget = ProjectWidget() + studio_widget = SystemWidget(develop) + project_widget = ProjectWidget(develop) header_tab_widget.addTab(studio_widget, "System") header_tab_widget.addTab(project_widget, "Project") From 6539dc325c2bd9ba43265d2adc3358dbc2b5d7f2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 11:49:06 +0200 Subject: [PATCH 424/507] removed ftrack project config --- .../1_ftrack_projects_gui_schema.json | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json deleted file mode 100644 index e9937e64b8..0000000000 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_ftrack_projects_gui_schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "key": "ftrack", - "type": "dict", - "expandable": true, - "label": "Ftrack", - "children": [ - { - "key": "status_update", - "type": "dict", - "expandable": true, - "label": "Status updates", - "is_group": true, - "children": [ - { - "key": "Ready", - "type": "text", - "label": "Ready" - }, { - "key": "Ready2", - "type": "text", - "label": "Ready2" - } - ] - }, { - "key": "status_version_to_task", - "type": "dict", - "expandable": true, - "label": "Version status to Task status", - "is_group": true, - "children": [ - { - "key": "in progress", - "type": "text", - "label": "In Progress" - } - ] - } - ] -} From e9b9198f4384d7c068959dcaea153652dc5bee01 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 11:52:46 +0200 Subject: [PATCH 425/507] added is_file attribute back --- .../projects_schema/0_project_gui_schema.json | 13 +++- .../projects_schema/1_plugins_gui_schema.json | 15 ++++- .../system_schema/0_system_gui_schema.json | 3 +- .../1_applications_gui_schema.json | 1 + .../system_schema/1_intents_gui_schema.json | 1 + .../system_schema/1_tools_gui_schema.json | 1 + .../system_schema/1_tray_items.json | 1 + .../config_setting/widgets/lib.py | 67 +++++++++++++++++++ 8 files changed, 98 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json index 86504eefd2..52565640bc 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json @@ -4,7 +4,18 @@ "children": [ { "type": "anatomy", - "key": "anatomy" + "key": "anatomy", + "children": [ + { + "type": "anatomy_roots", + "key": "roots", + "is_file": true + }, { + "type": "anatomy_templates", + "key": "templates", + "is_file": true + } + ] }, { "type": "schema", "children": [ diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 597f51d6fd..5dad665b2d 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -15,6 +15,7 @@ "expandable": true, "key": "publish", "label": "Publish plugins", + "is_file": true, "children": [ { "type": "dict", @@ -74,6 +75,7 @@ "expandable": true, "key": "publish", "label": "Publish plugins", + "is_file": true, "children": [ { "type": "dict", @@ -113,6 +115,7 @@ "expandable": true, "key": "publish", "label": "Publish plugins", + "is_file": true, "children": [ { "type": "dict", @@ -276,6 +279,7 @@ "expandable": true, "key": "publish", "label": "Publish plugins", + "is_file": true, "children": [ { "type": "dict", @@ -350,7 +354,8 @@ }, { "type": "raw-json", "key": "workfile_build", - "label": "Workfile Build logic" + "label": "Workfile Build logic", + "is_file": true } ] }, { @@ -364,6 +369,7 @@ "expandable": true, "key": "create", "label": "Create plugins", + "is_file": true, "children": [ { "type": "dict", @@ -398,6 +404,7 @@ "expandable": true, "key": "publish", "label": "Publish plugins", + "is_file": true, "children": [ { "type": "dict", @@ -510,7 +517,8 @@ }, { "type": "raw-json", "key": "workfile_build", - "label": "Workfile Build logic" + "label": "Workfile Build logic", + "is_file": true } ] }, { @@ -524,6 +532,7 @@ "expandable": true, "key": "publish", "label": "Publish plugins", + "is_file": true, "children": [ { "type": "dict", @@ -573,6 +582,7 @@ "expandable": true, "key": "create", "label": "Creator plugins", + "is_file": true, "children": [ { "type": "dict", @@ -611,6 +621,7 @@ "expandable": true, "key": "publish", "label": "Publish plugins", + "is_file": true, "children": [] } ] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json index 0b51267f4e..bdc0158511 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json @@ -27,7 +27,8 @@ }, "is_group": true, "key": "templates_mapping", - "label": "Muster - Templates mapping" + "label": "Muster - Templates mapping", + "is_file": true }] } ] diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json index af128b138f..5ee769eed8 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json @@ -4,6 +4,7 @@ "label": "Applications", "expandable": true, "is_group": true, + "is_file": true, "children": [ { "type": "dict-form", diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json index 11b45c8409..a4b5e16fa1 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json @@ -4,6 +4,7 @@ "label": "Intent Setting", "expandable": true, "is_group": true, + "is_file": true, "children": [ { "type": "dict-modifiable", diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json index a16f00547e..bf35326d1c 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json @@ -4,6 +4,7 @@ "label": "Tools", "expandable": true, "is_group": true, + "is_file": true, "children": [ { "type": "dict-form", diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json index afa509254e..7507050900 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json @@ -4,6 +4,7 @@ "label": "Modules", "expandable": true, "is_group": true, + "is_file": true, "children": [ { "key": "item_usage", diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/config_setting/config_setting/widgets/lib.py index 6b3aa53c8f..daba87de15 100644 --- a/pype/tools/config_setting/config_setting/widgets/lib.py +++ b/pype/tools/config_setting/config_setting/widgets/lib.py @@ -80,6 +80,19 @@ def _fill_inner_schemas(schema_data, schema_collection): return schema_data +class SchemaMissingFileInfo(Exception): + def __init__(self, invalid): + full_path_keys = [] + for item in invalid: + full_path_keys.append("\"{}\"".format("/".join(item))) + + msg = ( + "Schema has missing definition of output file (\"is_file\" key)" + " for keys. [{}]" + ).format(", ".join(full_path_keys)) + super(SchemaMissingFileInfo, self).__init__(msg) + + class SchemeGroupHierarchyBug(Exception): def __init__(self, invalid): full_path_keys = [] @@ -108,6 +121,59 @@ class SchemaDuplicatedKeys(Exception): super(SchemaDuplicatedKeys, self).__init__(msg) +def file_keys_from_schema(schema_data): + output = [] + keys = [] + key = schema_data.get("key") + if key: + keys.append(key) + + for child in schema_data["children"]: + if child.get("is_file"): + _keys = copy.deepcopy(keys) + _keys.append(child["key"]) + output.append(_keys) + continue + + for result in file_keys_from_schema(child): + _keys = copy.deepcopy(keys) + _keys.extend(result) + output.append(_keys) + return output + + +def validate_all_has_ending_file(schema_data, is_top=True): + if schema_data.get("is_file"): + return None + + children = schema_data.get("children") + if not children: + return [[schema_data["key"]]] + + invalid = [] + keyless = "key" not in schema_data + for child in children: + result = validate_all_has_ending_file(child, False) + if result is None: + continue + + if keyless: + invalid.extend(result) + else: + for item in result: + new_invalid = [schema_data["key"]] + new_invalid.extend(item) + invalid.append(new_invalid) + + if not invalid: + return None + + if not is_top: + return invalid + + raise SchemaMissingFileInfo(invalid) + + def validate_is_group_is_unique_in_hierarchy( schema_data, any_parent_is_group=False, keys=None ): @@ -203,6 +269,7 @@ def validate_keys_are_unique(schema_data, keys=None): def validate_schema(schema_data): + validate_all_has_ending_file(schema_data) validate_is_group_is_unique_in_hierarchy(schema_data) validate_keys_are_unique(schema_data) From b8c15fd5144a22bf675bae4b074205e8b5ef53f0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 12:01:16 +0200 Subject: [PATCH 426/507] added develop_mode attribute to inputs --- .../config_setting/config_setting/widgets/base.py | 12 ++++++------ .../config_setting/config_setting/widgets/inputs.py | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 52d6b73c98..58e53b8c58 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -22,10 +22,10 @@ class SystemWidget(QtWidgets.QWidget): is_group = _is_group = False any_parent_is_group = _any_parent_is_group = False - def __init__(self, develop, parent=None): + def __init__(self, develop_mode, parent=None): super(SystemWidget, self).__init__(parent) - self.develop = develop + self.develop_mode = develop_mode self._ignore_value_changes = False self.input_fields = [] @@ -49,7 +49,7 @@ class SystemWidget(QtWidgets.QWidget): footer_widget = QtWidgets.QWidget() footer_layout = QtWidgets.QHBoxLayout(footer_widget) - if self.develop: + if self.develop_mode: save_as_default_btn = QtWidgets.QPushButton("Save as Default") footer_layout.addWidget(save_as_default_btn, 0) save_as_default_btn.clicked.connect(self._save_as_defaults) @@ -302,10 +302,10 @@ class ProjectWidget(QtWidgets.QWidget): is_group = _is_group = False any_parent_is_group = _any_parent_is_group = False - def __init__(self, develop, parent=None): + def __init__(self, develop_mode, parent=None): super(ProjectWidget, self).__init__(parent) - self.develop = develop + self.develop_mode = develop_mode self.is_overidable = False self._ignore_value_changes = False @@ -331,7 +331,7 @@ class ProjectWidget(QtWidgets.QWidget): footer_widget = QtWidgets.QWidget() footer_layout = QtWidgets.QHBoxLayout(footer_widget) - if self.develop: + if self.develop_mode: save_as_default_btn = QtWidgets.QPushButton("Save as Default") footer_layout.addWidget(save_as_default_btn, 0) save_as_default_btn.clicked.connect(self._save_as_defaults) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 5763738351..5f56f39518 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -33,6 +33,10 @@ class ConfigObject(AbstractConfigObject): _any_parent_is_group = None _log = None + @property + def develop_mode(self): + return self._parent.develop_mode + @property def log(self): if self._log is None: From 68ba48bcf294c1a48958150b010e0d098444db03 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 13:29:15 +0200 Subject: [PATCH 427/507] in develop mode empty defaults won't crash the gui --- .../config_setting/widgets/inputs.py | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 5f56f39518..ea774d90de 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -12,6 +12,7 @@ from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET class ConfigObject(AbstractConfigObject): + default_input_value = NOT_SET allow_actions = True default_state = "" @@ -217,11 +218,20 @@ class InputObject(ConfigObject): value = parent_values.get(self.key, NOT_SET) if value is NOT_SET: - raise ValueError( - "Default value is not set. This is implementation BUG." - ) + if self.develop_mode: + value = self.default_input_value + if value is NOT_SET: + raise NotImplementedError(( + "{} Does not have implemented" + " attribute `default_input_value`" + ).format(self)) - self.default_value = value + else: + raise ValueError( + "Default value is not set. This is implementation BUG." + ) + + self._default_value = value self._has_studio_override = False self._had_studio_override = False self.set_value(value) @@ -370,6 +380,7 @@ class InputObject(ConfigObject): class BooleanWidget(QtWidgets.QWidget, InputObject): + default_input_value = True value_changed = QtCore.Signal(object) def __init__( @@ -455,6 +466,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): class NumberWidget(QtWidgets.QWidget, InputObject): + default_input_value = 0 value_changed = QtCore.Signal(object) input_modifiers = ("minimum", "maximum", "decimal") @@ -541,6 +553,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): class TextWidget(QtWidgets.QWidget, InputObject): + default_input_value = "" value_changed = QtCore.Signal(object) def __init__( @@ -633,6 +646,7 @@ class TextWidget(QtWidgets.QWidget, InputObject): class PathInputWidget(QtWidgets.QWidget, InputObject): + default_input_value = "" value_changed = QtCore.Signal(object) def __init__( @@ -768,6 +782,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): class RawJsonWidget(QtWidgets.QWidget, InputObject): + default_input_value = "{}" value_changed = QtCore.Signal(object) def __init__( @@ -872,9 +887,9 @@ class ListItem(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) def __init__(self, object_type, input_modifiers, config_parent, parent): - self._parent = config_parent super(ListItem, self).__init__(parent) + self._parent = config_parent layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) @@ -962,6 +977,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): class ListWidget(QtWidgets.QWidget, InputObject): + default_input_value = [] value_changed = QtCore.Signal(object) def __init__( @@ -1297,6 +1313,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): class ModifiableDict(QtWidgets.QWidget, InputObject): + default_input_value = {} # Should be used only for dictionary with one datatype as value # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) From 72221cfafd75ae167f907608faed624a497728d7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 13:39:17 +0200 Subject: [PATCH 428/507] it is possible to know that defaults are not set --- .../config_setting/widgets/inputs.py | 218 +++++++----------- 1 file changed, 77 insertions(+), 141 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index ea774d90de..32befd6ef8 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -14,25 +14,58 @@ from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET class ConfigObject(AbstractConfigObject): default_input_value = NOT_SET allow_actions = True - default_state = "" - _as_widget = False - _is_group = False - # TODO not implemented yet - _is_nullable = False + def set_default_attributes(self): + # Default input attributes + self._has_studio_override = False + self._had_studio_override = False - _has_studio_override = False - _had_studio_override = False + self._is_overriden = False + self._was_overriden = False - _is_overriden = False - _was_overriden = False + self._is_modified = False + self._is_invalid = False - _is_modified = False - _is_invalid = False + self._is_nullable = False + self._as_widget = False + self._is_group = False - _any_parent_is_group = None - _log = None + self._any_parent_is_group = None + + # Parent input + self._parent = None + + # States of inputs + self._state = None + self._child_state = None + + # Attributes where values are stored + self.default_value = NOT_SET + self.studio_value = NOT_SET + self.override_value = NOT_SET + + # Log object + self._log = None + + # Only for develop mode + self.defaults_not_set = False + + def initial_attributes(self, input_data, parent, as_widget): + self.set_default_attributes() + + self._parent = parent + self._as_widget = as_widget + + self._is_group = input_data.get("is_group", False) + # TODO not implemented yet + self._is_nullable = input_data.get("is_nullable", False) + + any_parent_is_group = parent.is_group + if not any_parent_is_group: + any_parent_is_group = parent.any_parent_is_group + + self._any_parent_is_group = any_parent_is_group @property def develop_mode(self): @@ -61,7 +94,7 @@ class ConfigObject(AbstractConfigObject): @property def is_modified(self): """Has object any changes that require saving.""" - if self._is_modified: + if self._is_modified or self.defaults_not_set: return True if self.is_overidable: @@ -220,6 +253,7 @@ class InputObject(ConfigObject): if value is NOT_SET: if self.develop_mode: value = self.default_input_value + self.defaults_not_set = True if value is NOT_SET: raise NotImplementedError(( "{} Does not have implemented" @@ -231,7 +265,7 @@ class InputObject(ConfigObject): "Default value is not set. This is implementation BUG." ) - self._default_value = value + self.default_value = value self._has_studio_override = False self._had_studio_override = False self.set_value(value) @@ -391,22 +425,13 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): parent_widget = parent super(BooleanWidget, self).__init__(parent_widget) - self._parent = parent - self._as_widget = as_widget - self._state = None - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET + self.initial_attributes(input_data, parent, as_widget) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - if not as_widget: + if not self._as_widget: self.key = input_data["key"] if not label_widget: label = input_data["label"] @@ -478,16 +503,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): parent_widget = parent super(NumberWidget, self).__init__(parent_widget) - self._parent = parent - self._as_widget = as_widget - self._state = None - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET + self.initial_attributes(input_data, parent, as_widget) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -564,19 +580,10 @@ class TextWidget(QtWidgets.QWidget, InputObject): parent_widget = parent super(TextWidget, self).__init__(parent_widget) - self._parent = parent - self._as_widget = as_widget - self._state = None - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) + self.initial_attributes(input_data, parent, as_widget) self.multiline = input_data.get("multiline", False) - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET - layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) @@ -657,16 +664,7 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): parent_widget = parent super(PathInputWidget, self).__init__(parent_widget) - self._parent = parent - self._as_widget = as_widget - self._state = None - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET + self.initial_attributes(input_data, parent, as_widget) layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -793,22 +791,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): parent_widget = parent super(RawJsonWidget, self).__init__(parent_widget) - self._parent = parent - self._as_widget = as_widget - self._state = None - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - self._any_parent_is_group = any_parent_is_group - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) - - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET + self.initial_attributes(input_data, parent, as_widget) layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) @@ -889,7 +872,10 @@ class ListItem(QtWidgets.QWidget, ConfigObject): def __init__(self, object_type, input_modifiers, config_parent, parent): super(ListItem, self).__init__(parent) + self.set_default_attributes() self._parent = config_parent + self._any_parent_is_group = True + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) @@ -989,20 +975,11 @@ class ListWidget(QtWidgets.QWidget, InputObject): super(ListWidget, self).__init__(parent_widget) self.setObjectName("ListWidget") - self._parent = parent - self._state = None - self._as_widget = as_widget - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) + self.initial_attributes(input_data, parent, as_widget) self.object_type = input_data["object_type"] self.input_modifiers = input_data.get("input_modifiers") or {} - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET - self.key = input_data["key"] self.input_fields = [] @@ -1327,22 +1304,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): super(ModifiableDict, self).__init__(parent_widget) self.setObjectName("ModifiableDict") - self._parent = parent - self._state = None - self._as_widget = as_widget - - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - self._any_parent_is_group = any_parent_is_group - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) + self.initial_attributes(input_data, parent, as_widget) self.input_fields = [] @@ -1573,18 +1535,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): super(DictWidget, self).__init__(parent_widget) self.setObjectName("DictWidget") - self._state = None - self._child_state = None - - self._parent = parent - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - self._any_parent_is_group = any_parent_is_group - - self._is_group = input_data.get("is_group", False) - self._is_nullable = input_data.get("is_nullable", False) + self.initial_attributes(input_data, parent, as_widget) if input_data.get("highlight_content", False): content_state = "hightlighted" @@ -1891,14 +1842,8 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): super(DictInvisible, self).__init__(parent_widget) self.setObjectName("DictInvisible") - self._parent = parent + self.initial_attributes(input_data, parent, as_widget) - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - self._any_parent_is_group = any_parent_is_group - self._is_group = input_data.get("is_group", False) if self._is_group: raise TypeError("DictInvisible can't be marked as group input.") @@ -2098,7 +2043,6 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): class PathWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) - platforms = ("windows", "darwin", "linux") platform_labels_mapping = { "windows": "Windows", @@ -2120,30 +2064,17 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): parent_widget = parent super(PathWidget, self).__init__(parent_widget) - self._parent = parent - self._state = None - self._child_state = None - self._as_widget = as_widget - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - self._any_parent_is_group = any_parent_is_group + self.initial_attributes(input_data, parent, as_widget) # This is partial input and dictionary input - if not any_parent_is_group and not as_widget: + if not self.any_parent_is_group and not self._as_widget: self._is_group = True else: self._is_group = False - self._is_nullable = input_data.get("is_nullable", False) self.multiplatform = input_data.get("multiplatform", False) self.multipath = input_data.get("multipath", False) - self.default_value = NOT_SET - self.studio_value = NOT_SET - self.override_value = NOT_SET - self.input_fields = [] if not self.multiplatform and not self.multipath: @@ -2153,7 +2084,7 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) - if not as_widget: + if not self._as_widget: self.key = input_data["key"] if not label_widget: label = input_data["label"] @@ -2171,6 +2102,16 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self.create_gui() + @property + def default_input_value(self): + if self.multiplatform: + return { + platform: "" + for platform in self.platforms + } + else: + return "" + def create_gui(self): if not self.multiplatform and not self.multipath: input_data = {"key": self.key} @@ -2467,14 +2408,9 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): parent_widget = parent super(DictFormWidget, self).__init__(parent_widget) - self._parent = parent - - any_parent_is_group = parent.is_group - if not any_parent_is_group: - any_parent_is_group = parent.any_parent_is_group - - self._any_parent_is_group = any_parent_is_group + self.initial_attributes(input_data, parent, as_widget) + self._as_widget = False self._is_group = False self.input_fields = [] From 3cd46bb0f2e7045a406e25c19e23ca9cb00a6a5f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 13:42:59 +0200 Subject: [PATCH 429/507] configurations lib has constant path to defaults --- pype/configurations/lib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index 4cd7203626..b555ea0167 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -29,6 +29,9 @@ STUDIO_PROJECT_OVERRIDES_PATH = os.path.join( STUDIO_OVERRIDES_PATH, "project_overrides" ) +# Path to default configurations +DEFAULTS_DIR = os.path.join(os.path.dirname(__file__), "defaults") + # Variable where cache of default configurations are stored _DEFAULT_CONFIGURATIONS = None @@ -36,9 +39,7 @@ _DEFAULT_CONFIGURATIONS = None def default_configuration(): global _DEFAULT_CONFIGURATIONS if _DEFAULT_CONFIGURATIONS is None: - current_dir = os.path.dirname(__file__) - defaults_path = os.path.join(current_dir, "defaults") - _DEFAULT_CONFIGURATIONS = load_jsons_from_dir(defaults_path) + _DEFAULT_CONFIGURATIONS = load_jsons_from_dir(DEFAULTS_DIR) return _DEFAULT_CONFIGURATIONS From 714bd5794327785596964ee05d521a7e5b70c2d3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 13:59:54 +0200 Subject: [PATCH 430/507] added specific keys as constants --- pype/configurations/lib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index b555ea0167..c0b783e3fb 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -14,12 +14,14 @@ POP_KEY = "__pop_key__" STUDIO_OVERRIDES_PATH = os.environ["PYPE_CONFIG"] # File where studio's system overrides are stored +SYSTEM_CONFIGURATIONS_KEY = "system_configurations" SYSTEM_CONFIGURATIONS_PATH = os.path.join( - STUDIO_OVERRIDES_PATH, "system_configurations.json" + STUDIO_OVERRIDES_PATH, SYSTEM_CONFIGURATIONS_KEY + ".json" ) # File where studio's default project overrides are stored -PROJECT_CONFIGURATIONS_FILENAME = "project_configurations.json" +PROJECT_CONFIGURATIONS_KEY = "project_configurations" +PROJECT_CONFIGURATIONS_FILENAME = PROJECT_CONFIGURATIONS_KEY + ".json" PROJECT_CONFIGURATIONS_PATH = os.path.join( STUDIO_OVERRIDES_PATH, PROJECT_CONFIGURATIONS_FILENAME ) From ebfa87a3ac2cc57108a87cdec9b11da3f342928d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 14:05:12 +0200 Subject: [PATCH 431/507] removed standalone publisher as not complete yet --- .../projects_schema/1_plugins_gui_schema.json | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index 5dad665b2d..df0de07a4d 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -610,21 +610,6 @@ ] } ] - }, { - "type": "dict", - "expandable": true, - "key": "standalonepublisher", - "label": "StandalonePublisher", - "children": [ - { - "type": "dict", - "expandable": true, - "key": "publish", - "label": "Publish plugins", - "is_file": true, - "children": [] - } - ] } ] } From ce198d1c4a3460174c16637eb8b6c04e04083351 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 14:09:26 +0200 Subject: [PATCH 432/507] added possibility to reset defaults --- pype/configurations/lib.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index c0b783e3fb..b8832ceacb 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -38,6 +38,11 @@ DEFAULTS_DIR = os.path.join(os.path.dirname(__file__), "defaults") _DEFAULT_CONFIGURATIONS = None +def reset_default_configurations(): + global _DEFAULT_CONFIGURATIONS + _DEFAULT_CONFIGURATIONS = None + + def default_configuration(): global _DEFAULT_CONFIGURATIONS if _DEFAULT_CONFIGURATIONS is None: From a4a4b5244f07b08099748217c86a4e15057d85e1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 14:34:26 +0200 Subject: [PATCH 433/507] added ability to save as defaults --- .../global/applications.json | 31 +++--- .../projects_schema/1_plugins_gui_schema.json | 4 + .../config_setting/widgets/base.py | 94 ++++++++++++++++++- 3 files changed, 109 insertions(+), 20 deletions(-) diff --git a/pype/configurations/defaults/system_configurations/global/applications.json b/pype/configurations/defaults/system_configurations/global/applications.json index 8e27f11002..3a74a85468 100644 --- a/pype/configurations/defaults/system_configurations/global/applications.json +++ b/pype/configurations/defaults/system_configurations/global/applications.json @@ -6,34 +6,29 @@ "celaction_local": true, "celaction_remote": true, "harmony_17": true, - "houdini_16": true, - "houdini_17": true, - "houdini_18": true, - "maya_2016": true, "maya_2017": true, "maya_2018": true, "maya_2019": true, "maya_2020": true, - "nukestudio_10.0": true, - "nukestudio_11.0": true, - "nukestudio_11.2": true, - "nukestudio_11.3": true, - "nukestudio_12.0": true, - "nukex_10.0": true, - "nukex_11.0": true, - "nukex_11.2": true, - "nukex_11.3": true, - "nukex_12.0": true, "nuke_10.0": true, - "nuke_11.0": true, "nuke_11.2": true, "nuke_11.3": true, "nuke_12.0": true, - "photoshop_2020": true, + "nukex_10.0": true, + "nukex_11.2": true, + "nukex_11.3": true, + "nukex_12.0": true, + "nukestudio_10.0": true, + "nukestudio_11.2": true, + "nukestudio_11.3": true, + "nukestudio_12.0": true, + "houdini_16": true, + "houdini_16.5": false, + "houdini_17": true, + "houdini_18": true, "premiere_2019": true, "premiere_2020": true, "resolve_16": true, "storyboardpro_7": true, - "unreal_4.24": true, - "houdini_16.5": false + "unreal_4.24": true } \ No newline at end of file diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json index df0de07a4d..c279a6b04a 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json @@ -140,6 +140,10 @@ "is_group": true, "children": [ { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { "type": "dict-invisible", "key": "ffmpeg_args", "children": [ diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 58e53b8c58..d7078e4ab6 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -2,8 +2,12 @@ import os import json from Qt import QtWidgets, QtCore, QtGui from pype.configurations.lib import ( + SYSTEM_CONFIGURATIONS_KEY, SYSTEM_CONFIGURATIONS_PATH, + PROJECT_CONFIGURATIONS_KEY, PROJECT_CONFIGURATIONS_PATH, + DEFAULTS_DIR, + reset_default_configurations, default_configuration, studio_system_configurations, project_configurations_overrides, @@ -145,7 +149,50 @@ class SystemWidget(QtWidgets.QWidget): self._update_values() def _save_as_defaults(self): - print("_save_as_defaults") + output = {} + for item in self.input_fields: + output.update(item.config_value()) + + for key in reversed(self.keys): + _output = {key: output} + output = _output + + all_values = {} + for item in self.input_fields: + all_values.update(item.config_value()) + + for key in reversed(self.keys): + _all_values = {key: all_values} + all_values = _all_values + + # Skip first key + all_values = all_values["system"] + + prject_defaults_dir = os.path.join( + DEFAULTS_DIR, SYSTEM_CONFIGURATIONS_KEY + ) + keys_to_file = lib.file_keys_from_schema(self.schema) + for key_sequence in keys_to_file: + # Skip first key + key_sequence = key_sequence[1:] + subpath = "/".join(key_sequence) + ".json" + + new_values = all_values + for key in key_sequence: + new_values = new_values[key] + + output_path = os.path.join(prject_defaults_dir, subpath) + dirpath = os.path.dirname(output_path) + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + print("Saving data to: ", subpath) + with open(output_path, "w") as file_stream: + json.dump(new_values, file_stream, indent=4) + + reset_default_configurations() + + self._update_values() def _update_values(self): self.ignore_value_changes = True @@ -415,7 +462,50 @@ class ProjectWidget(QtWidgets.QWidget): self.ignore_value_changes = False def _save_as_defaults(self): - print("_save_as_defaults") + output = {} + for item in self.input_fields: + output.update(item.config_value()) + + for key in reversed(self.keys): + _output = {key: output} + output = _output + + all_values = {} + for item in self.input_fields: + all_values.update(item.config_value()) + + for key in reversed(self.keys): + _all_values = {key: all_values} + all_values = _all_values + + # Skip first key + all_values = all_values["project"] + + prject_defaults_dir = os.path.join( + DEFAULTS_DIR, PROJECT_CONFIGURATIONS_KEY + ) + keys_to_file = lib.file_keys_from_schema(self.schema) + for key_sequence in keys_to_file: + # Skip first key + key_sequence = key_sequence[1:] + subpath = "/".join(key_sequence) + ".json" + + new_values = all_values + for key in key_sequence: + new_values = new_values[key] + + output_path = os.path.join(prject_defaults_dir, subpath) + dirpath = os.path.dirname(output_path) + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + print("Saving data to: ", subpath) + with open(output_path, "w") as file_stream: + json.dump(new_values, file_stream, indent=4) + + reset_default_configurations() + + self._update_values() def _save(self): has_invalid = False From 438d456bb55b52158a51859ea347455aefa612a2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 15:21:12 +0200 Subject: [PATCH 434/507] fix dictionary item initialization --- pype/tools/config_setting/config_setting/widgets/inputs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 32befd6ef8..bc63e27f5a 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -873,6 +873,7 @@ class ListItem(QtWidgets.QWidget, ConfigObject): super(ListItem, self).__init__(parent) self.set_default_attributes() + self._parent = config_parent self._any_parent_is_group = True @@ -1149,6 +1150,7 @@ class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): def __init__(self, object_type, input_modifiers, config_parent, parent): super(ModifiableDictItem, self).__init__(parent) + self.set_default_attributes() self._parent = config_parent self.is_single = False From ea8ffca0fadbc8122e2a1b55e4712c61bfb5a33b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 15:21:34 +0200 Subject: [PATCH 435/507] modified anatomy widgets to match new initialization --- .../config_setting/widgets/anatomy_inputs.py | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index efba588692..4ae7d8d290 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -40,14 +40,11 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): ) super(AnatomyWidget, self).__init__(parent) self.setObjectName("AnatomyWidget") - self._parent = parent + + self.initial_attributes(input_data, parent, as_widget) + self.key = "anatomy" - self._child_state = None - self._state = None - - self._any_parent_is_group = False - self.root_widget = RootsWidget(self) self.templates_widget = TemplatesWidget(self) @@ -214,15 +211,13 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def __init__(self, parent): super(RootsWidget, self).__init__(parent) self.setObjectName("RootsWidget") - self._parent = parent + + input_data = {"is_group": True} + self.initial_attributes(input_data, parent, False) + self.key = "roots" - self._state = None self._multiroot_state = None - - self._is_group = True - self._any_parent_is_group = False - self.global_is_multiroot = False self.was_multiroot = NOT_SET @@ -546,12 +541,9 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def __init__(self, parent): super(TemplatesWidget, self).__init__(parent) - self._parent = parent + input_data = {"is_group": True} + self.initial_attributes(input_data, parent, False) - self._state = None - - self._is_group = True - self._any_parent_is_group = False self.key = "templates" body_widget = ExpandingWidget("Templates", self) @@ -634,7 +626,7 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): @property def has_studio_override(self): - return self.value_input.has_studio_override + return self.value_input._has_studio_override @property def child_has_studio_override(self): From f346b80e4d29b25b9406709d26a8bcf74ebceb29 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 15:27:56 +0200 Subject: [PATCH 436/507] set as overriden kinda works on roots widget --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 4ae7d8d290..2c4548df4e 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -173,6 +173,10 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): or self.templates_widget.child_invalid ) + def set_as_overriden(self): + self.root_widget.set_as_overriden() + self.templates_widget.set_as_overriden() + def remove_overrides(self): self.root_widget.remove_overrides() self.templates_widget.remove_overrides() @@ -521,7 +525,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._is_modified = self.child_modified def set_as_overriden(self): - self._is_overriden = self._was_overriden + self._is_overriden = True self.singleroot_widget.set_as_overriden() self.multiroot_widget.set_as_overriden() From 12fff9477a0d4038a3a54d7c6af144144ad675a5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 15:31:01 +0200 Subject: [PATCH 437/507] multiroot label does not care about overrides --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 2c4548df4e..7dd89838d4 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -399,7 +399,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): multiroot_state = self.style_state( self.has_studio_override, False, - self.is_overriden, + False, self.was_multiroot != self.is_multiroot ) if multiroot_state != self._multiroot_state: From c76f9f604c96b82eb26c3fb2b1fd556431803f64 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 15:52:01 +0200 Subject: [PATCH 438/507] anatomy overrides can be unset --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 7dd89838d4..a62b32664e 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -186,7 +186,9 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.templates_widget.discard_changes() def overrides(self): - return self.config_value(), True + if self.child_overriden: + return self.config_value(), True + return NOT_SET, False def item_value(self): output = {} From 47f1429214b73aa6db634e3660b7666471a87bb7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 15:52:41 +0200 Subject: [PATCH 439/507] fixed different cases of set_overrides and removing overrides --- .../config_setting/widgets/anatomy_inputs.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index a62b32664e..306149f9b3 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -510,8 +510,10 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.set_multiroot(self.global_is_multiroot) - self.singleroot_widget.remove_overrides() - self.multiroot_widget.remove_overrides() + if self.is_multiroot: + self.multiroot_widget.remove_overrides() + else: + self.singleroot_widget.remove_overrides() def discard_changes(self): self._is_overriden = self._was_overriden @@ -521,8 +523,10 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: self.set_multiroot(self.global_is_multiroot) - self.singleroot_widget.discard_changes() - self.multiroot_widget.discard_changes() + if self.is_multiroot: + self.multiroot_widget.discard_changes() + else: + self.singleroot_widget.discard_changes() self._is_modified = self.child_modified From 3759920d3873158ccf0c7b5c1ab1844734b0b869 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 16:31:40 +0200 Subject: [PATCH 440/507] modified api to not break old way of loading presets --- pype/api.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pype/api.py b/pype/api.py index ee0d1ef4a2..c5cd28d4de 100644 --- a/pype/api.py +++ b/pype/api.py @@ -1,8 +1,12 @@ -from .configurations import config +from .configurations.config import ( + system_configurations, + project_configurations +) from pypeapp import ( Logger, Anatomy, project_overrides_dir_path, + config, execute ) @@ -49,6 +53,9 @@ from .lib import ( from .lib import _subprocess as subprocess __all__ = [ + "system_configurations", + "project_configurations", + "Logger", "Anatomy", "project_overrides_dir_path", From 201d0aca14a58c419d13fcf298719ccedfb72721 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 17:17:54 +0200 Subject: [PATCH 441/507] moved anatomy to separate folder --- .../colorspace.json | 0 .../anatomy => project_anatomy}/dataflow.json | 0 .../anatomy => project_anatomy}/roots.json | 0 .../templates.json | 0 .../project_configurations/anatomy/README.md | 0 .../anatomy/colorspace/aces103-cg.json | 46 --------------- .../anatomy/dataflow/aces-exr.json | 58 ------------------- .../anatomy/default.yaml | 29 ---------- 8 files changed, 133 deletions(-) rename pype/configurations/defaults/{project_configurations/anatomy => project_anatomy}/colorspace.json (100%) rename pype/configurations/defaults/{project_configurations/anatomy => project_anatomy}/dataflow.json (100%) rename pype/configurations/defaults/{project_configurations/anatomy => project_anatomy}/roots.json (100%) rename pype/configurations/defaults/{project_configurations/anatomy => project_anatomy}/templates.json (100%) delete mode 100644 pype/configurations/defaults/project_configurations/anatomy/README.md delete mode 100644 pype/configurations/defaults/project_configurations/anatomy/colorspace/aces103-cg.json delete mode 100644 pype/configurations/defaults/project_configurations/anatomy/dataflow/aces-exr.json delete mode 100644 pype/configurations/defaults/project_configurations/anatomy/default.yaml diff --git a/pype/configurations/defaults/project_configurations/anatomy/colorspace.json b/pype/configurations/defaults/project_anatomy/colorspace.json similarity index 100% rename from pype/configurations/defaults/project_configurations/anatomy/colorspace.json rename to pype/configurations/defaults/project_anatomy/colorspace.json diff --git a/pype/configurations/defaults/project_configurations/anatomy/dataflow.json b/pype/configurations/defaults/project_anatomy/dataflow.json similarity index 100% rename from pype/configurations/defaults/project_configurations/anatomy/dataflow.json rename to pype/configurations/defaults/project_anatomy/dataflow.json diff --git a/pype/configurations/defaults/project_configurations/anatomy/roots.json b/pype/configurations/defaults/project_anatomy/roots.json similarity index 100% rename from pype/configurations/defaults/project_configurations/anatomy/roots.json rename to pype/configurations/defaults/project_anatomy/roots.json diff --git a/pype/configurations/defaults/project_configurations/anatomy/templates.json b/pype/configurations/defaults/project_anatomy/templates.json similarity index 100% rename from pype/configurations/defaults/project_configurations/anatomy/templates.json rename to pype/configurations/defaults/project_anatomy/templates.json diff --git a/pype/configurations/defaults/project_configurations/anatomy/README.md b/pype/configurations/defaults/project_configurations/anatomy/README.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pype/configurations/defaults/project_configurations/anatomy/colorspace/aces103-cg.json b/pype/configurations/defaults/project_configurations/anatomy/colorspace/aces103-cg.json deleted file mode 100644 index dd3fca4c2d..0000000000 --- a/pype/configurations/defaults/project_configurations/anatomy/colorspace/aces103-cg.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "resolve": { - - }, - "nukestudio": { - - }, - "nuke": { - "root": { - "colorManagement": "OCIO", - "OCIO_config": "aces_1.0.3", - "workingSpaceLUT": "ACES - ACEScg", - "defaultViewerLUT": "OCIO LUTs", - "monitorLut": "ACES/sRGB", - "int8Lut": "Utility - sRGB - Texture", - "int16Lut": "Utility - sRGB - Texture", - "logLut": "Input - ADX - ADX10", - "floatLut": "ACES - ACES2065-1" - }, - "viewer": { - "viewerProcess": "sRGB (ACES)" - }, - "write": { - "render": { - "colorspace": "ACES - ACES2065-1" - }, - "prerender": { - "colorspace": "ACES - ACES2065-1" - }, - "still": { - "colorspace": "Utility - Curve - sRGB" - } - }, - "read": { - "[^-a-zA-Z0-9](beauty)[^-a-zA-Z0-9]": "lin_srgb", - "[^-a-zA-Z0-9](P|N|Z|crypto)[^-a-zA-Z0-9]": "raw", - "[^-a-zA-Z0-9](plateRef)[^-a-zA-Z0-9]": "crv_srgb" - } - }, - "maya": { - - }, - "houdini": { - - } -} diff --git a/pype/configurations/defaults/project_configurations/anatomy/dataflow/aces-exr.json b/pype/configurations/defaults/project_configurations/anatomy/dataflow/aces-exr.json deleted file mode 100644 index 75846c0bd6..0000000000 --- a/pype/configurations/defaults/project_configurations/anatomy/dataflow/aces-exr.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "nuke": { - "nodes": { - "connected": true, - "modifymetadata": { - "_id": "connect_metadata", - "_previous": "ENDING", - "metadata.set.pype_studio_name": "{PYPE_STUDIO_NAME}", - "metadata.set.avalon_project_name": "{AVALON_PROJECT}", - "metadata.set.avalon_project_code": "{PYPE_STUDIO_CODE}", - "metadata.set.avalon_asset_name": "{AVALON_ASSET}" - }, - "crop": { - "_id": "connect_crop", - "_previous": "connect_metadata", - "box": [ - "{metadata.crop.x}", - "{metadata.crop.y}", - "{metadata.crop.right}", - "{metadata.crop.top}" - ] - }, - "write": { - "render": { - "_id": "output_write", - "_previous": "connect_crop", - "file_type": "exr", - "datatype": "16 bit half", - "compression": "Zip (1 scanline)", - "create_directories": true, - "autocrop": true, - "tile_color": "0xff0000ff", - "channels": "rgb" - }, - "prerender": { - "_id": "output_write", - "_previous": "connect_crop", - "file_type": "exr", - "datatype": "16 bit half", - "compression": "Zip (1 scanline)", - "create_directories": true, - "autocrop": false, - "tile_color": "0xc9892aff", - "channels": "rgba" - }, - "still": { - "_previous": "connect_crop", - "channels": "rgba", - "file_type": "tiff", - "datatype": "16 bit", - "compression": "LZW", - "create_directories": true, - "tile_color": "0x4145afff" - } - } - } - } -} diff --git a/pype/configurations/defaults/project_configurations/anatomy/default.yaml b/pype/configurations/defaults/project_configurations/anatomy/default.yaml deleted file mode 100644 index 381aa05d4a..0000000000 --- a/pype/configurations/defaults/project_configurations/anatomy/default.yaml +++ /dev/null @@ -1,29 +0,0 @@ - -version_padding: 3 -version: "v{version:0>{@version_padding}}" -frame_padding: 4 -frame: "{frame:0>{@frame_padding}}" - -work: - folder: "{root}/{project[name]}/{hierarchy}/{asset}/work/{task}" - file: "{project[code]}_{asset}_{task}_{@version}<_{comment}>.{ext}" - path: "{@folder}/{@file}" - -render: - folder: "{root}/{project[name]}/{hierarchy}/{asset}/publish/render/{subset}/{@version}" - file: "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}" - path: "{@folder}/{@file}" - -texture: - path: "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}" - -publish: - folder: "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/{@version}" - file: "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}" - path: "{@folder}/{@file}" - thumbnail: "{thumbnail_root}/{project[name]}/{_id}_{thumbnail_type}{ext}" - -master: - folder: "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/master" - file: "{project[code]}_{asset}_{subset}_master<_{output}><.{frame}>.{representation}" - path: "{@folder}/{@file}" From 5971468b93a22627ed08c28313642bfd7c88323d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 17:21:42 +0200 Subject: [PATCH 442/507] anatomy data are more schema based --- .../config_setting/widgets/anatomy_inputs.py | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 306149f9b3..ed73ad6468 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -43,10 +43,19 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.initial_attributes(input_data, parent, as_widget) - self.key = "anatomy" + self.key = input_data["key"] - self.root_widget = RootsWidget(self) - self.templates_widget = TemplatesWidget(self) + children_data = input_data["children"] + roots_input_data = {} + templates_input_data = {} + for child in children_data: + if child["type"] == "anatomy_roots": + roots_input_data = child + elif child["type"] == "anatomy_templates": + templates_input_data = child + + self.root_widget = RootsWidget(roots_input_data, self) + self.templates_widget = TemplatesWidget(templates_input_data, self) self.setAttribute(QtCore.Qt.WA_StyledBackground) @@ -214,14 +223,14 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): class RootsWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) - def __init__(self, parent): + def __init__(self, input_data, parent): super(RootsWidget, self).__init__(parent) self.setObjectName("RootsWidget") input_data = {"is_group": True} self.initial_attributes(input_data, parent, False) - self.key = "roots" + self.key = input_data["key"] self._multiroot_state = None self.global_is_multiroot = False @@ -548,13 +557,13 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): class TemplatesWidget(QtWidgets.QWidget, ConfigObject): value_changed = QtCore.Signal(object) - def __init__(self, parent): + def __init__(self, input_data, parent): super(TemplatesWidget, self).__init__(parent) input_data = {"is_group": True} self.initial_attributes(input_data, parent, False) - self.key = "templates" + self.key = input_data["key"] body_widget = ExpandingWidget("Templates", self) content_widget = QtWidgets.QWidget(body_widget) From 4bd3c8716bfdd5e4e7d55521d719a1569bc973f1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 17:21:53 +0200 Subject: [PATCH 443/507] wrapped project data more inside --- .../projects_schema/0_project_gui_schema.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json index 52565640bc..3d7cac68fd 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json @@ -4,7 +4,7 @@ "children": [ { "type": "anatomy", - "key": "anatomy", + "key": "project_anatomy", "children": [ { "type": "anatomy_roots", @@ -17,9 +17,15 @@ } ] }, { - "type": "schema", + "type": "dict-invisible", + "key": "project_configurations", "children": [ - "1_plugins_gui_schema" + { + "type": "schema", + "children": [ + "1_plugins_gui_schema" + ] + } ] } ] From e359256b6ebcc100be3e8a83ebce3356a342abf4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 17:22:39 +0200 Subject: [PATCH 444/507] configurations has also functions for getting anatomy --- pype/configurations/lib.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index b8832ceacb..abd848f95c 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -26,6 +26,12 @@ PROJECT_CONFIGURATIONS_PATH = os.path.join( STUDIO_OVERRIDES_PATH, PROJECT_CONFIGURATIONS_FILENAME ) +PROJECT_ANATOMY_KEY = "project_anatomy" +PROJECT_ANATOMY_FILENAME = PROJECT_ANATOMY_KEY + ".json" +PROJECT_ANATOMY_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, PROJECT_ANATOMY_FILENAME +) + # Folder where studio's per project overrides are stored STUDIO_PROJECT_OVERRIDES_PATH = os.path.join( STUDIO_OVERRIDES_PATH, "project_overrides" @@ -167,6 +173,12 @@ def studio_project_configurations(): return {} +def studio_project_anatomy(): + if os.path.exists(PROJECT_ANATOMY_PATH): + return load_json(PROJECT_ANATOMY_PATH) + return {} + + def path_to_project_overrides(project_name): return os.path.join( STUDIO_PROJECT_OVERRIDES_PATH, @@ -175,6 +187,14 @@ def path_to_project_overrides(project_name): ) +def path_to_project_anatomy(project_name): + return os.path.join( + STUDIO_PROJECT_OVERRIDES_PATH, + project_name, + PROJECT_ANATOMY_FILENAME + ) + + def project_configurations_overrides(project_name): if not project_name: return {} @@ -185,6 +205,16 @@ def project_configurations_overrides(project_name): return load_json(path_to_json) +def project_anatomy_overrides(project_name): + if not project_name: + return {} + + path_to_json = path_to_project_anatomy(project_name) + if not os.path.exists(path_to_json): + return {} + return load_json(path_to_json) + + def merge_overrides(global_dict, override_dict): if OVERRIDEN_KEY in override_dict: overriden_keys = set(override_dict.pop(OVERRIDEN_KEY)) From f5736a7e9ab1e7b7ea537df526c63aea6509f503 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 17:23:02 +0200 Subject: [PATCH 445/507] anatomy loading/saving is in project widget separated --- .../config_setting/widgets/base.py | 100 +++++++++++++----- 1 file changed, 75 insertions(+), 25 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index d7078e4ab6..6d25357fc9 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -6,13 +6,23 @@ from pype.configurations.lib import ( SYSTEM_CONFIGURATIONS_PATH, PROJECT_CONFIGURATIONS_KEY, PROJECT_CONFIGURATIONS_PATH, + PROJECT_ANATOMY_KEY, + PROJECT_ANATOMY_PATH, + DEFAULTS_DIR, + reset_default_configurations, default_configuration, + studio_system_configurations, + studio_project_configurations, + studio_project_anatomy, + project_configurations_overrides, + project_anatomy_overrides, + path_to_project_overrides, - studio_project_configurations + path_to_project_anatomy ) from .widgets import UnsavedChangesDialog from . import lib @@ -448,13 +458,22 @@ class ProjectWidget(QtWidgets.QWidget): def _on_project_change(self): project_name = self.project_list_widget.project_name() if project_name is None: - _overrides = lib.NOT_SET + _project_overrides = lib.NOT_SET + _project_anatomy = lib.NOT_SET self.is_overidable = False else: - _overrides = project_configurations_overrides(project_name) + _project_overrides = project_configurations_overrides(project_name) + _project_anatomy = project_anatomy_overrides(project_name) self.is_overidable = True - overrides = {"project": lib.convert_overrides_to_gui_data(_overrides)} + overrides = {"project": { + PROJECT_CONFIGURATIONS_KEY: lib.convert_overrides_to_gui_data( + _project_overrides + ), + PROJECT_ANATOMY_KEY: lib.convert_overrides_to_gui_data( + _project_anatomy + ) + }} self.project_name = project_name self.ignore_value_changes = True for item in self.input_fields: @@ -481,9 +500,6 @@ class ProjectWidget(QtWidgets.QWidget): # Skip first key all_values = all_values["project"] - prject_defaults_dir = os.path.join( - DEFAULTS_DIR, PROJECT_CONFIGURATIONS_KEY - ) keys_to_file = lib.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: # Skip first key @@ -494,7 +510,7 @@ class ProjectWidget(QtWidgets.QWidget): for key in key_sequence: new_values = new_values[key] - output_path = os.path.join(prject_defaults_dir, subpath) + output_path = os.path.join(DEFAULTS_DIR, subpath) dirpath = os.path.dirname(output_path) if not os.path.exists(dirpath): os.makedirs(dirpath) @@ -533,7 +549,7 @@ class ProjectWidget(QtWidgets.QWidget): return if self.project_name is None: - self._save_defaults() + self._save_studio_overrides() else: self._save_overrides() @@ -548,20 +564,40 @@ class ProjectWidget(QtWidgets.QWidget): data.get("project") or {} ) - overrides_json_path = path_to_project_overrides( + # Saving overrides data + project_overrides_data = output_data.get( + PROJECT_CONFIGURATIONS_KEY, {} + ) + project_overrides_json_path = path_to_project_overrides( self.project_name ) - dirpath = os.path.dirname(overrides_json_path) + dirpath = os.path.dirname(project_overrides_json_path) if not os.path.exists(dirpath): os.makedirs(dirpath) - print("Saving data to:", overrides_json_path) - with open(overrides_json_path, "w") as file_stream: - json.dump(output_data, file_stream, indent=4) + print("Saving data to:", project_overrides_json_path) + with open(project_overrides_json_path, "w") as file_stream: + json.dump(project_overrides_data, file_stream, indent=4) + # Saving anatomy data + project_anatomy_data = output_data.get( + PROJECT_ANATOMY_KEY, {} + ) + project_anatomy_json_path = path_to_project_anatomy( + self.project_name + ) + dirpath = os.path.dirname(project_anatomy_json_path) + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + print("Saving data to:", project_anatomy_json_path) + with open(project_anatomy_json_path, "w") as file_stream: + json.dump(project_anatomy_data, file_stream, indent=4) + + # Refill values with overrides self._on_project_change() - def _save_defaults(self): + def _save_studio_overrides(self): data = {} for input_field in self.input_fields: value, is_group = input_field.studio_overrides() @@ -572,30 +608,44 @@ class ProjectWidget(QtWidgets.QWidget): data.get("project", {}) ) + # Project overrides data + project_overrides_data = output_data.get( + PROJECT_CONFIGURATIONS_KEY, {} + ) dirpath = os.path.dirname(PROJECT_CONFIGURATIONS_PATH) if not os.path.exists(dirpath): os.makedirs(dirpath) print("Saving data to:", PROJECT_CONFIGURATIONS_PATH) - try: - with open(PROJECT_CONFIGURATIONS_PATH, "w") as file_stream: - json.dump(output_data, file_stream, indent=4) - except Exception as exc: - print(output_data) - raise + with open(PROJECT_CONFIGURATIONS_PATH, "w") as file_stream: + json.dump(project_overrides_data, file_stream, indent=4) + # Project Anatomy data + project_anatomy_data = output_data.get( + PROJECT_ANATOMY_KEY, {} + ) + dirpath = os.path.dirname(PROJECT_ANATOMY_PATH) + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + print("Saving data to:", PROJECT_ANATOMY_PATH) + with open(PROJECT_ANATOMY_PATH, "w") as file_stream: + json.dump(project_anatomy_data, file_stream, indent=4) + + # Update saved values self._update_values() def _update_values(self): self.ignore_value_changes = True - default_values = { - "project": default_configuration()["project_configurations"] - } + default_values = {"project": default_configuration()} for input_field in self.input_fields: input_field.update_default_values(default_values) - studio_values = {"project": studio_project_configurations()} + studio_values = {"project": { + PROJECT_CONFIGURATIONS_KEY: studio_project_configurations(), + PROJECT_ANATOMY_KEY: studio_project_anatomy() + }} for input_field in self.input_fields: input_field.update_studio_values(studio_values) From 5eb25c7ae3ebdfe7fe66729c2f27a840f6a00dcd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 17:23:28 +0200 Subject: [PATCH 446/507] overrides are not saved to path from PYPE_CONFIG but to PYPE_PROJECT_CONFIGS --- pype/configurations/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index abd848f95c..9ef782ca6a 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -11,7 +11,7 @@ OVERRIDEN_KEY = "__overriden_keys__" POP_KEY = "__pop_key__" # Folder where studio overrides are stored -STUDIO_OVERRIDES_PATH = os.environ["PYPE_CONFIG"] +STUDIO_OVERRIDES_PATH = os.environ["PYPE_PROJECT_CONFIGS"] # File where studio's system overrides are stored SYSTEM_CONFIGURATIONS_KEY = "system_configurations" From 4d05ebaa71d4cc6a2f0194e610e94e01e07f12fc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 17:26:29 +0200 Subject: [PATCH 447/507] fixed roots and templates input data --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index ed73ad6468..b034bc1763 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -227,7 +227,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): super(RootsWidget, self).__init__(parent) self.setObjectName("RootsWidget") - input_data = {"is_group": True} + input_data["is_group"] = True self.initial_attributes(input_data, parent, False) self.key = input_data["key"] @@ -560,7 +560,7 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def __init__(self, input_data, parent): super(TemplatesWidget, self).__init__(parent) - input_data = {"is_group": True} + input_data["is_group"] = True self.initial_attributes(input_data, parent, False) self.key = input_data["key"] From 8a1c164f51efa34dfb5e7a964effdfbea09fcce4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 18:07:53 +0200 Subject: [PATCH 448/507] changed how the margins of main window are --- pype/tools/config_setting/config_setting/widgets/base.py | 4 ++-- pype/tools/config_setting/config_setting/widgets/window.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index 6d25357fc9..a0a470fc97 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -74,7 +74,7 @@ class SystemWidget(QtWidgets.QWidget): footer_layout.addWidget(save_btn, 0) layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(5, 0, 5, 0) + layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) self.setLayout(layout) @@ -400,7 +400,7 @@ class ProjectWidget(QtWidgets.QWidget): configurations_widget = QtWidgets.QWidget() configurations_layout = QtWidgets.QVBoxLayout(configurations_widget) - configurations_layout.setContentsMargins(5, 0, 5, 0) + configurations_layout.setContentsMargins(0, 0, 0, 0) configurations_layout.setSpacing(0) configurations_layout.addWidget(scroll_widget, 1) diff --git a/pype/tools/config_setting/config_setting/widgets/window.py b/pype/tools/config_setting/config_setting/widgets/window.py index f8da9a196e..5c7a35fa52 100644 --- a/pype/tools/config_setting/config_setting/widgets/window.py +++ b/pype/tools/config_setting/config_setting/widgets/window.py @@ -8,18 +8,19 @@ class MainWidget(QtWidgets.QWidget): def __init__(self, develop, parent=None): super(MainWidget, self).__init__(parent) + self.setObjectName("MainWidget") self.resize(self.widget_width, self.widget_height) header_tab_widget = QtWidgets.QTabWidget(parent=self) - studio_widget = SystemWidget(develop) - project_widget = ProjectWidget(develop) + studio_widget = SystemWidget(develop, header_tab_widget) + project_widget = ProjectWidget(develop, header_tab_widget) header_tab_widget.addTab(studio_widget, "System") header_tab_widget.addTab(project_widget, "Project") layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) + layout.setContentsMargins(5, 5, 5, 5) layout.setSpacing(0) layout.addWidget(header_tab_widget) From 375188a5587ca6b36719df56af104fefb356855d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 18:08:06 +0200 Subject: [PATCH 449/507] modified tab style --- .../config_setting/style/style.css | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 73c1854bee..5b6821a85d 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -90,7 +90,7 @@ QPushButton[btn-type="expand-toggle"] { } #GroupWidget { - border: 1px solid #aaaaaa; + border-bottom: 1px solid #1d272f; } #ProjectListWidget QListView { @@ -148,6 +148,53 @@ QPushButton[btn-type="expand-toggle"] { #SideLineWidget[state="child-overriden-modified"] {border-color: #106aa2;} #SideLineWidget[state="child-overriden-modified"]:hover {border-color: #137cbd;} +#MainWidget { + background: #141a1f; +} + +QTabWidget::pane { + border-top-style: none; +} + +QTabBar { + background: transparent; +} + +QTabBar::tab { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding: 5px; +} + +QTabBar::tab:selected { + background: #293742; + border-color: #9B9B9B; + border-bottom-color: #C2C7CB; +} + +QTabBar::tab:!selected { + margin-top: 2px; + background: #1d272f; +} + +QTabBar::tab:!selected:hover { + background: #3b4f5e; +} + + + +QTabBar::tab:first:selected { + margin-left: 0; +} + +QTabBar::tab:last:selected { + margin-right: 0; +} + +QTabBar::tab:only-one { + margin: 0; +} + QScrollBar:horizontal { height: 15px; margin: 3px 15px 3px 15px; From 529570c906ec6f7465206039e5bf7d47310fb74c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 18:44:57 +0200 Subject: [PATCH 450/507] small changes --- .../defaults/project_anatomy/templates.json | 7 +------ .../project_configurations/plugins/global/publish.json | 3 +-- pype/tools/config_setting/config_setting/style/style.css | 8 ++++---- pype/tools/config_setting/config_setting/widgets/base.py | 2 +- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/pype/configurations/defaults/project_anatomy/templates.json b/pype/configurations/defaults/project_anatomy/templates.json index 23e9f308f2..0fff0265b3 100644 --- a/pype/configurations/defaults/project_anatomy/templates.json +++ b/pype/configurations/defaults/project_anatomy/templates.json @@ -3,33 +3,28 @@ "version": "v{version:0>{@version_padding}}", "frame_padding": 4, "frame": "{frame:0>{@frame_padding}}", - "work": { "folder": "{root}/{project[name]}/{hierarchy}/{asset}/work/{task}", "file": "{project[code]}_{asset}_{task}_{@version}<_{comment}>.{ext}", "path": "{@folder}/{@file}" }, - "render": { "folder": "{root}/{project[name]}/{hierarchy}/{asset}/publish/render/{subset}/{@version}", "file": "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}", "path": "{@folder}/{@file}" }, - "texture": { "path": "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}" }, - "publish": { "folder": "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/{@version}", "file": "{project[code]}_{asset}_{subset}_{@version}<_{output}><.{@frame}>.{representation}", "path": "{@folder}/{@file}", "thumbnail": "{thumbnail_root}/{project[name]}/{_id}_{thumbnail_type}{ext}" }, - "master": { "folder": "{root}/{project[name]}/{hierarchy}/{asset}/publish/{family}/{subset}/master", "file": "{project[code]}_{asset}_{subset}_master<_{output}><.{frame}>.{representation}", "path": "{@folder}/{@file}" } -} +} \ No newline at end of file diff --git a/pype/configurations/defaults/project_configurations/plugins/global/publish.json b/pype/configurations/defaults/project_configurations/plugins/global/publish.json index d531f1aa47..b946ac4b32 100644 --- a/pype/configurations/defaults/project_configurations/plugins/global/publish.json +++ b/pype/configurations/defaults/project_configurations/plugins/global/publish.json @@ -75,7 +75,6 @@ ] }, "IntegrateAssetNew": { - "enabled": true, "template_name_profiles": { "publish": { "families": [], @@ -96,4 +95,4 @@ "deadline_pool": "", "deadline_group": "" } -} +} \ No newline at end of file diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/config_setting/config_setting/style/style.css index 5b6821a85d..f6dd354935 100644 --- a/pype/tools/config_setting/config_setting/style/style.css +++ b/pype/tools/config_setting/config_setting/style/style.css @@ -44,9 +44,9 @@ QToolButton { QLabel { background: transparent; - color: #808080; + color: #7390a5; } -QLabel:hover {color: #999999;} +QLabel:hover {color: #839caf;} QLabel[state="studio"] {color: #bfccd6;} QLabel[state="studio"]:hover {color: #ffffff;} @@ -122,7 +122,7 @@ QPushButton[btn-type="expand-toggle"] { #SideLineWidget { background-color: #31424e; border-style: solid; - border-color: #808080; + border-color: #3b4f5e; border-left-width: 3px; border-bottom-width: 0px; border-right-width: 0px; @@ -130,7 +130,7 @@ QPushButton[btn-type="expand-toggle"] { } #SideLineWidget:hover { - border-color: #999999; + border-color: #58768d; } #SideLineWidget[state="child-studio"] {border-color: #455c6e;} diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/config_setting/config_setting/widgets/base.py index a0a470fc97..16192aadf3 100644 --- a/pype/tools/config_setting/config_setting/widgets/base.py +++ b/pype/tools/config_setting/config_setting/widgets/base.py @@ -250,7 +250,7 @@ class ProjectListWidget(QtWidgets.QWidget): self.setObjectName("ProjectListWidget") label_widget = QtWidgets.QLabel("Projects") - + label_widget.setProperty("state", "studio") project_list = ProjectListView(self) project_list.setModel(QtGui.QStandardItemModel()) From e9737d9b3a644a1958c66e18dec34101bb647b7d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:01:27 +0200 Subject: [PATCH 451/507] fix default_values for pathwidget --- pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index bc63e27f5a..4a9dd28df1 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2183,10 +2183,10 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): self._had_studio_override = False if not self.multiplatform: - self.input_fields[0].update_studio_values(value) + self.input_fields[0].update_default_values(value) else: for input_field in self.input_fields: - input_field.update_studio_values(value) + input_field.update_default_values(value) def update_studio_values(self, parent_values): self._state = None From 80c091c7fd36dafcc439b15c6e9774322d0418a4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:01:51 +0200 Subject: [PATCH 452/507] project overrides are not stored in subfolder --- pype/configurations/lib.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index 9ef782ca6a..7e24d25483 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -32,11 +32,6 @@ PROJECT_ANATOMY_PATH = os.path.join( STUDIO_OVERRIDES_PATH, PROJECT_ANATOMY_FILENAME ) -# Folder where studio's per project overrides are stored -STUDIO_PROJECT_OVERRIDES_PATH = os.path.join( - STUDIO_OVERRIDES_PATH, "project_overrides" -) - # Path to default configurations DEFAULTS_DIR = os.path.join(os.path.dirname(__file__), "defaults") @@ -181,7 +176,7 @@ def studio_project_anatomy(): def path_to_project_overrides(project_name): return os.path.join( - STUDIO_PROJECT_OVERRIDES_PATH, + STUDIO_OVERRIDES_PATH, project_name, PROJECT_CONFIGURATIONS_FILENAME ) @@ -189,7 +184,7 @@ def path_to_project_overrides(project_name): def path_to_project_anatomy(project_name): return os.path.join( - STUDIO_PROJECT_OVERRIDES_PATH, + STUDIO_OVERRIDES_PATH, project_name, PROJECT_ANATOMY_FILENAME ) From 098c1bed80f30bcc0dc797b4a43f7e42fa99ff1c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:06:59 +0200 Subject: [PATCH 453/507] fix roots fillings --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index b034bc1763..573f48409d 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -393,9 +393,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.set_multiroot(is_multiroot) if is_multiroot: - self._is_overriden = parent_values is not NOT_SET + self._is_overriden = value is not NOT_SET self._was_overriden = bool(self._is_overriden) - self.multiroot_widget.apply_overrides(parent_values) + self.multiroot_widget.apply_overrides(value) else: self._is_overriden = value is not NOT_SET self._was_overriden = bool(self._is_overriden) From 026358a2ea3b866bda7060a068667fd3711d5f10 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:07:19 +0200 Subject: [PATCH 454/507] change order of filling values logic --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 4a9dd28df1..1280b39904 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -1054,10 +1054,10 @@ class ListWidget(QtWidgets.QWidget, InputObject): # Set text if entered text is not None # else (when add button clicked) trigger `_on_value_change` if value is not None: - if not self._has_studio_override: - item_widget.update_default_values(value) - elif self._is_overriden: + if self._is_overriden: item_widget.apply_overrides(value) + elif not self._has_studio_override: + item_widget.update_default_values(value) else: item_widget.update_studio_values(value) self.hierarchical_style_update() From 35bee377dd6b8c19ee31c62d4ca56510239e08e0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:07:39 +0200 Subject: [PATCH 455/507] change logic of roots changes for default, studio and overrides --- .../config_setting/widgets/anatomy_inputs.py | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 573f48409d..ec6da20c72 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -233,7 +233,8 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.key = input_data["key"] self._multiroot_state = None - self.global_is_multiroot = False + self.default_is_multiroot = False + self.studio_is_multiroot = False self.was_multiroot = NOT_SET checkbox_widget = QtWidgets.QWidget(self) @@ -317,7 +318,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): is_multiroot = True break - self.global_is_multiroot = is_multiroot + self.default_is_multiroot = is_multiroot self.was_multiroot = is_multiroot self.set_multiroot(is_multiroot) @@ -346,24 +347,25 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: value = NOT_SET - is_multiroot = False - if isinstance(value, dict): - for _value in value.values(): - if isinstance(_value, dict): - is_multiroot = True - break - - self.global_is_multiroot = is_multiroot - self.was_multiroot = is_multiroot - self.set_multiroot(is_multiroot) - if value is NOT_SET: + is_multiroot = self.default_is_multiroot + self.studio_is_multiroot = NOT_SET self._has_studio_override = False self._had_studio_override = False else: + is_multiroot = False + if isinstance(value, dict): + for _value in value.values(): + if isinstance(_value, dict): + is_multiroot = True + break + self.studio_is_multiroot = is_multiroot self._has_studio_override = True self._had_studio_override = True + self.was_multiroot = is_multiroot + self.set_multiroot(is_multiroot) + if is_multiroot: self.multiroot_widget.update_studio_values(value) else: @@ -380,7 +382,9 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): value = parent_values.get(self.key, value) if value is NOT_SET: - is_multiroot = self.global_is_multiroot + is_multiroot = self.studio_is_multiroot + if is_multiroot is NOT_SET: + is_multiroot = self.default_is_multiroot else: is_multiroot = False if isinstance(value, dict): @@ -517,7 +521,10 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._is_overriden = False self._is_modified = False - self.set_multiroot(self.global_is_multiroot) + if self.studio_is_multiroot is NOT_SET: + self.set_multiroot(self.default_is_multiroot) + else: + self.set_multiroot(self.studio_is_multiroot) if self.is_multiroot: self.multiroot_widget.remove_overrides() @@ -530,7 +537,10 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): if self._is_overriden: self.set_multiroot(self.was_multiroot) else: - self.set_multiroot(self.global_is_multiroot) + if self.studio_is_multiroot is NOT_SET: + self.set_multiroot(self.default_is_multiroot) + else: + self.set_multiroot(self.studio_is_multiroot) if self.is_multiroot: self.multiroot_widget.discard_changes() From 3351264c7c1028eac98e665f4747687ff6617e32 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:21:28 +0200 Subject: [PATCH 456/507] a little bit better changing from multi to single root --- .../config_setting/widgets/anatomy_inputs.py | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index ec6da20c72..ed104128a0 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -447,7 +447,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self._state = state def _on_multiroot_checkbox(self): - self.set_multiroot(self.is_multiroot) + self.set_multiroot() def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -471,9 +471,37 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): self.value_changed.emit(self) + def _from_single_to_multi(self): + single_value = self.singleroot_widget.item_value() + mutli_value = self.multiroot_widget.item_value() + first_key = None + for key in mutli_value.keys(): + first_key = key + break + + if first_key is None: + first_key = "" + + mutli_value[first_key] = single_value + + self.multiroot_widget.set_value(mutli_value) + + def _from_multi_to_single(self): + mutli_value = self.multiroot_widget.item_value() + first_key = None + for value in mutli_value.values(): + single_value = value + break + + self.singleroot_widget.set_value(single_value) + def set_multiroot(self, is_multiroot=None): if is_multiroot is None: - is_multiroot = not self.is_multiroot + is_multiroot = self.is_multiroot + if is_multiroot: + self._from_single_to_multi() + else: + self._from_multi_to_single() if is_multiroot != self.is_multiroot: self.multiroot_checkbox.setChecked(is_multiroot) From 93c391a9d4f084b2db79fccb9c13d3f7d331f904 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:27:01 +0200 Subject: [PATCH 457/507] changed labels of actions --- .../config_setting/config_setting/widgets/anatomy_inputs.py | 1 - pype/tools/config_setting/config_setting/widgets/inputs.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index ed104128a0..75ee12ee02 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -488,7 +488,6 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): def _from_multi_to_single(self): mutli_value = self.multiroot_widget.item_value() - first_key = None for value in mutli_value.values(): single_value = value break diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 1280b39904..c7f817a48e 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -201,7 +201,7 @@ class ConfigObject(AbstractConfigObject): and not self.is_overriden and not self.any_parent_is_group ): - action = QtWidgets.QAction("Set as overriden") + action = QtWidgets.QAction("Set project override") actions_mapping[action] = self._set_as_overriden menu.addAction(action) @@ -210,7 +210,7 @@ class ConfigObject(AbstractConfigObject): and (self.is_overriden or self.child_overriden) ): # TODO better label - action = QtWidgets.QAction("Remove override") + action = QtWidgets.QAction("Remove project override") actions_mapping[action] = self._remove_overrides menu.addAction(action) From 17362076a5b56f1e065b81a2029dec33503ab4ef Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:37:21 +0200 Subject: [PATCH 458/507] Added possibility to reset to pype's default values --- .../config_setting/widgets/anatomy_inputs.py | 15 +++++ .../config_setting/widgets/inputs.py | 64 +++++++++++++++---- .../config_setting/widgets/widgets.py | 12 ++++ 3 files changed, 79 insertions(+), 12 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py index 75ee12ee02..09544a2455 100644 --- a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py @@ -190,6 +190,10 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): self.root_widget.remove_overrides() self.templates_widget.remove_overrides() + def reset_to_pype_default(self): + self.root_widget.reset_to_pype_default() + self.templates_widget.reset_to_pype_default() + def discard_changes(self): self.root_widget.discard_changes() self.templates_widget.discard_changes() @@ -558,6 +562,14 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): else: self.singleroot_widget.remove_overrides() + def reset_to_pype_default(self): + self.set_multiroot(self.default_is_multiroot) + if self.is_multiroot: + self.multiroot_widget.reset_to_pype_default() + else: + self.singleroot_widget.reset_to_pype_default() + self._has_studio_override = False + def discard_changes(self): self._is_overriden = self._was_overriden self._is_modified = False @@ -703,6 +715,9 @@ class TemplatesWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self.value_input.remove_overrides() + def reset_to_pype_default(self): + self.value_input.reset_to_pype_default() + def discard_changes(self): self.value_input.discard_changes() diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index c7f817a48e..fe2e8032b1 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -176,6 +176,11 @@ class ConfigObject(AbstractConfigObject): self.discard_changes() self.ignore_value_changes = False + def _reset_to_pype_default(self): + self.ignore_value_changes = True + self.reset_to_pype_default() + self.ignore_value_changes = False + def _remove_overrides(self): self.ignore_value_changes = True self.remove_overrides() @@ -205,6 +210,17 @@ class ConfigObject(AbstractConfigObject): actions_mapping[action] = self._set_as_overriden menu.addAction(action) + if ( + not self.is_overidable + and ( + self.has_studio_override + or self.child_has_studio_override + ) + ): + action = QtWidgets.QAction("Reset to pype default") + actions_mapping[action] = self._reset_to_pype_default + menu.addAction(action) + if ( not self.any_parent_overriden() and (self.is_overriden or self.child_overriden) @@ -361,6 +377,10 @@ class InputObject(ConfigObject): self._is_overriden = False self._is_modified = False + def reset_to_pype_default(self): + self.set_value(self.default_value) + self._has_studio_override = False + def discard_changes(self): self._is_overriden = self._was_overriden self._has_studio_override = self._had_studio_override @@ -1618,15 +1638,20 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - for item in self.input_fields: - item.remove_overrides() + for input_field in self.input_fields: + input_field.remove_overrides() + + def reset_to_pype_default(self): + for input_field in self.input_fields: + input_field.reset_to_pype_default() + self._has_studio_override = False def discard_changes(self): self._is_overriden = self._was_overriden self._is_modified = False - for item in self.input_fields: - item.discard_changes() + for input_field in self.input_fields: + input_field.discard_changes() self._is_modified = self.child_modified @@ -1943,15 +1968,20 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - for item in self.input_fields: - item.remove_overrides() + for input_field in self.input_fields: + input_field.remove_overrides() + + def reset_to_pype_default(self): + for input_field in self.input_fields: + input_field.reset_to_pype_default() + self._has_studio_override = False def discard_changes(self): self._is_modified = False self._is_overriden = self._was_overriden - for item in self.input_fields: - item.discard_changes() + for input_field in self.input_fields: + input_field.discard_changes() self._is_modified = self.child_modified @@ -2309,8 +2339,13 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - for item in self.input_fields: - item.remove_overrides() + for input_field in self.input_fields: + input_field.remove_overrides() + + def reset_to_pype_default(self): + for input_field in self.input_fields: + input_field.reset_to_pype_default() + self._has_studio_override = False def discard_changes(self): self._is_modified = False @@ -2467,8 +2502,13 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): def remove_overrides(self): self._is_overriden = False self._is_modified = False - for item in self.input_fields: - item.remove_overrides() + for input_field in self.input_fields: + input_field.remove_overrides() + + def reset_to_pype_default(self): + for input_field in self.input_fields: + input_field.reset_to_pype_default() + self._has_studio_override = False def set_as_overriden(self): if self.is_overriden: diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index d7631e6fea..e8286fd919 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -400,6 +400,18 @@ class AbstractConfigObject: ) ) + def _reset_to_pype_default(self): + self.ignore_value_changes = True + self.reset_to_pype_default() + self.ignore_value_changes = False + + def reset_to_pype_default(self): + raise NotImplementedError( + "{} Method `reset_to_pype_default` not implemented!".format( + repr(self) + ) + ) + def _remove_overrides(self): self.ignore_value_changes = True self.remove_overrides() From 4996c5617041f872d487c67c38700886d3e5ad2a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:38:32 +0200 Subject: [PATCH 459/507] removed duplicated methods --- .../config_setting/widgets/inputs.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index fe2e8032b1..55b0c999d0 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -171,25 +171,6 @@ class ConfigObject(AbstractConfigObject): return "-".join(items) or cls.default_state - def _discard_changes(self): - self.ignore_value_changes = True - self.discard_changes() - self.ignore_value_changes = False - - def _reset_to_pype_default(self): - self.ignore_value_changes = True - self.reset_to_pype_default() - self.ignore_value_changes = False - - def _remove_overrides(self): - self.ignore_value_changes = True - self.remove_overrides() - self.ignore_value_changes = False - - def _set_as_overriden(self): - self.ignore_value_changes = True - self.set_as_overriden() - self.ignore_value_changes = False def mouseReleaseEvent(self, event): if self.allow_actions and event.button() == QtCore.Qt.RightButton: From 57ac12b5140def9432d16de21fc82b28a048b3fd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 11 Sep 2020 19:43:44 +0200 Subject: [PATCH 460/507] added set studio defaults action --- .../config_setting/widgets/inputs.py | 43 ++++++++++++++++++- .../config_setting/widgets/widgets.py | 12 ++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 55b0c999d0..fba799e5c0 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -171,7 +171,6 @@ class ConfigObject(AbstractConfigObject): return "-".join(items) or cls.default_state - def mouseReleaseEvent(self, event): if self.allow_actions and event.button() == QtCore.Qt.RightButton: menu = QtWidgets.QMenu() @@ -202,6 +201,17 @@ class ConfigObject(AbstractConfigObject): actions_mapping[action] = self._reset_to_pype_default menu.addAction(action) + if ( + not self.is_overidable + and ( + (self.is_group and not self._had_studio_override) + or self.any_parent_is_group + ) + ): + action = QtWidgets.QAction("Set sudio default") + actions_mapping[action] = self._set_studio_default + menu.addAction(action) + if ( not self.any_parent_overriden() and (self.is_overriden or self.child_overriden) @@ -362,6 +372,9 @@ class InputObject(ConfigObject): self.set_value(self.default_value) self._has_studio_override = False + def set_studio_default(self): + self._has_studio_override = True + def discard_changes(self): self._is_overriden = self._was_overriden self._has_studio_override = self._had_studio_override @@ -1627,6 +1640,13 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): input_field.reset_to_pype_default() self._has_studio_override = False + def set_studio_default(self): + for input_field in self.input_fields: + input_field.set_studio_default() + + if self.is_group: + self._has_studio_override = True + def discard_changes(self): self._is_overriden = self._was_overriden self._is_modified = False @@ -1957,6 +1977,13 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): input_field.reset_to_pype_default() self._has_studio_override = False + def set_studio_default(self): + for input_field in self.input_fields: + input_field.set_studio_default() + + if self.is_group: + self._has_studio_override = True + def discard_changes(self): self._is_modified = False self._is_overriden = self._was_overriden @@ -2328,6 +2355,13 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): input_field.reset_to_pype_default() self._has_studio_override = False + def set_studio_default(self): + for input_field in self.input_fields: + input_field.set_studio_default() + + if self.is_group: + self._has_studio_override = True + def discard_changes(self): self._is_modified = False self._is_overriden = self._was_overriden @@ -2491,6 +2525,13 @@ class DictFormWidget(QtWidgets.QWidget, ConfigObject): input_field.reset_to_pype_default() self._has_studio_override = False + def set_studio_default(self): + for input_field in self.input_fields: + input_field.set_studio_default() + + if self.is_group: + self._has_studio_override = True + def set_as_overriden(self): if self.is_overriden: return diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/config_setting/config_setting/widgets/widgets.py index e8286fd919..aa1f17a7f4 100644 --- a/pype/tools/config_setting/config_setting/widgets/widgets.py +++ b/pype/tools/config_setting/config_setting/widgets/widgets.py @@ -400,6 +400,18 @@ class AbstractConfigObject: ) ) + def _set_studio_default(self): + self.ignore_value_changes = True + self.set_studio_default() + self.ignore_value_changes = False + + def set_studio_default(self): + raise NotImplementedError( + "{} Method `set_studio_default` not implemented!".format( + repr(self) + ) + ) + def _reset_to_pype_default(self): self.ignore_value_changes = True self.reset_to_pype_default() From 689438f63adfa1f264071c9e9f266a733a272ba6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 10:11:09 +0200 Subject: [PATCH 461/507] removed separators from PathWidget --- pype/tools/config_setting/config_setting/widgets/inputs.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index fba799e5c0..61a5aac435 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -2089,12 +2089,6 @@ class PathWidget(QtWidgets.QWidget, ConfigObject): "darwin": "MacOS", "linux": "Linux" } - # TODO be able to save and load with separators - platform_separators = { - "windows": ";", - "darwin": ":", - "linux": ":" - } def __init__( self, input_data, parent, From ffa4bd4f073997f3092750f6259a35f68c05f2a3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 10:32:20 +0200 Subject: [PATCH 462/507] ListWidget has items next to label instead of under --- .../config_setting/config_setting/widgets/inputs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/config_setting/config_setting/widgets/inputs.py index 61a5aac435..fa809cd2d2 100644 --- a/pype/tools/config_setting/config_setting/widgets/inputs.py +++ b/pype/tools/config_setting/config_setting/widgets/inputs.py @@ -999,14 +999,14 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.input_fields = [] - layout = QtWidgets.QVBoxLayout(self) - layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 5) + layout.setSpacing(5) if not label_widget: - label = input_data["label"] - label_widget = QtWidgets.QLabel(label) + label_widget = QtWidgets.QLabel(input_data["label"], self) layout.addWidget(label_widget) + self.label_widget = label_widget inputs_widget = QtWidgets.QWidget(self) @@ -1014,7 +1014,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): layout.addWidget(inputs_widget) inputs_layout = QtWidgets.QVBoxLayout(inputs_widget) - inputs_layout.setContentsMargins(0, 5, 0, 5) + inputs_layout.setContentsMargins(0, 0, 0, 0) inputs_layout.setSpacing(3) self.inputs_widget = inputs_widget From dff5da3a5ef2e3f2c0d7a9f5b684be8c536b899b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 11:42:33 +0200 Subject: [PATCH 463/507] removed label from dict-invisible --- .../config_gui_schema/system_schema/0_system_gui_schema.json | 1 - 1 file changed, 1 deletion(-) diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json index bdc0158511..b16545111c 100644 --- a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json +++ b/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json @@ -5,7 +5,6 @@ { "type": "dict-invisible", "key": "global", - "label": "Global", "children": [{ "type": "schema", "children": [ From 8f10391b53ae23640c9ffcb016419a57ffa49320 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 12:21:55 +0200 Subject: [PATCH 464/507] renamed config_setting to settings --- pype/tools/helpguide.txt | 153 ++++++++++++++++++ .../{config_setting => settings}/__init__.py | 2 +- .../{config_setting => settings}/__main__.py | 8 +- .../settings}/__init__.py | 0 .../projects_schema/0_project_gui_schema.json | 0 .../projects_schema/1_plugins_gui_schema.json | 0 .../system_schema/0_system_gui_schema.json | 0 .../1_applications_gui_schema.json | 0 .../system_schema/1_intents_gui_schema.json | 0 .../system_schema/1_tools_gui_schema.json | 0 .../system_schema/1_tray_items.json | 0 .../settings}/style/__init__.py | 0 .../settings}/style/pype_icon.png | Bin .../settings}/style/style.css | 0 .../settings}/widgets/__init__.py | 0 .../settings}/widgets/anatomy_inputs.py | 0 .../settings}/widgets/base.py | 0 .../settings}/widgets/inputs.py | 0 .../settings}/widgets/lib.py | 0 .../settings}/widgets/tests.py | 0 .../settings}/widgets/widgets.py | 0 .../settings}/widgets/window.py | 0 22 files changed, 158 insertions(+), 5 deletions(-) create mode 100644 pype/tools/helpguide.txt rename pype/tools/{config_setting => settings}/__init__.py (50%) rename pype/tools/{config_setting => settings}/__main__.py (53%) rename pype/tools/{config_setting/config_setting => settings/settings}/__init__.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/config_gui_schema/projects_schema/0_project_gui_schema.json (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/config_gui_schema/projects_schema/1_plugins_gui_schema.json (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/config_gui_schema/system_schema/0_system_gui_schema.json (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/config_gui_schema/system_schema/1_applications_gui_schema.json (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/config_gui_schema/system_schema/1_intents_gui_schema.json (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/config_gui_schema/system_schema/1_tools_gui_schema.json (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/config_gui_schema/system_schema/1_tray_items.json (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/style/__init__.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/style/pype_icon.png (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/style/style.css (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/__init__.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/anatomy_inputs.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/base.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/inputs.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/lib.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/tests.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/widgets.py (100%) rename pype/tools/{config_setting/config_setting => settings/settings}/widgets/window.py (100%) diff --git a/pype/tools/helpguide.txt b/pype/tools/helpguide.txt new file mode 100644 index 0000000000..b0c9471e3e --- /dev/null +++ b/pype/tools/helpguide.txt @@ -0,0 +1,153 @@ +## Basic rules +- configurations does not define GUI, but GUI defines configurations! +- output is always json (yaml is not needed for anatomy templates anymore) +- GUI schema has multiple input types, all inputs are represented by a dictionary +- each input may have "input modifiers" (keys in dictionary) that are required or optional + - only required modifier for all input items is key `"type"` which says what type of item it is +- there are special keys across all inputs + - `"is_file"` - this key is for storing pype defaults in `pype` repo + - reasons of existence: developing new schemas does not require to create defaults manually + - key is validated, must be once in hierarchy else it won't be possible to store pype defaults + - `"is_group"` - define that all values under key in hierarchy will be overriden if any value is modified, this information is also stored to overrides + - key is validated, can be only once in hierarchy but is not required + +## Basic Dictionary inputs +- these inputs wraps another inputs into {key: value} relation + +## dict-invisible +- this input gives ability to wrap another inputs but keep them in same widget without visible divider + - this is used as first input widget +- has required keys `"key"` and `"children"` + - "children" says what children inputs are underneath + - "key" is key under which will be stored value from it's children +- output is dictionary `{the "key": children values}` + +``` +{ + "type": "dict-invisible", + "key": "global", + "children": [{ + ... + }] +} +``` + +## dict +- this is another dictionary input wrapping more inputs but visually makes them different + +``` +{ + "key": "applications", + "type": "dict", + "label": "Applications", + "expandable": true, + "is_group": true, + "is_file": true, +} +``` + +## Inputs for setting any kind of value (`Pure` inputs) +- all these input must have defined `"key"` under which will be stored and `"label"` which will be shown next to input + - unless they are used in different types of inputs (later) "as widgets" in that case `"key"` and `"label"` are not required as there is not place where to set them + +### boolean +- simple checkbox, nothing more to set +``` +{ + "type": "boolean", + "key": "my_boolean_key", + "label": "Do you want to use Pype?" +} +``` + +### number +- number input, can be used for both integer and float + - key `"decimal"` defines how many decimal places will be used, 0 is for integer input (Default: `0`) + - key `"minimum"` as minimum allowed number to enter (Default: `-99999`) + - key `"maxium"` as maximum allowed number to enter (Default: `99999`) +``` +{ + "type": "number", + "key": "fps", + "label": "Frame rate (FPS)" + "decimal": 2, + "minimum": 1, + "maximum": 300000 +} +``` + +### text +- simple text input + - key `"multiline"` allows to enter multiple lines of text (Default: `False`) + +``` +{ + "type": "text", + "key": "deadline_pool", + "label": "Deadline pool" +} +``` + +### raw-json +- a little bit enhanced text input for raw json +- has validations of json format + - empty value is invalid value, always must be at least `{}` of `[]` + +``` +{ + "type": "raw-json", + "key": "profiles", + "label": "Extract Review profiles" +} +``` + +## Inputs for setting value using Pure inputs +- these inputs also have required `"key"` and `"label"` +- they use Pure inputs "as widgets" + +### list +- output is list +- items can be added and removed +- items in list must be the same type + - type of items is defined with key `"object_type"` where Pure input name is entered (e.g. `number`) + - because Pure inputs may have modifiers (`number` input has `minimum`, `maximum` and `decimals`) you can set these in key `"input_modifiers"` + +``` +{ + "type": "list", + "object_type": "number", + "key": "exclude_ports", + "label": "Exclude ports", + "input_modifiers": { + "minimum": 1, + "maximum": 65535 + } +} +``` + +### dict-modifiable +- one of dictionary inputs, this is only used as value input +- items in this input can be removed and added same way as in `list` input +- value items in dictionary must be the same type + - type of items is defined with key `"object_type"` where Pure input name is entered (e.g. `number`) + - because Pure inputs may have modifiers (`number` input has `minimum`, `maximum` and `decimals`) you can set these in key `"input_modifiers"` +- this input can be expandable + - that can be set with key `"expandable"` as `True`/`False` (Default: `True`) + - with key `"expanded"` as `True`/`False` can be set that is expanded when GUI is opened (Default: `False`) + +``` +{ + "type": "dict-modifiable", + "object_type": "number", + "input_modifiers": { + "minimum": 0, + "maximum": 300 + }, + "is_group": true, + "key": "templates_mapping", + "label": "Muster - Templates mapping", + "is_file": true +} +``` + +Currently there are `system configurations` and `project configurations`. Both has `root` schema where all begins. diff --git a/pype/tools/config_setting/__init__.py b/pype/tools/settings/__init__.py similarity index 50% rename from pype/tools/config_setting/__init__.py rename to pype/tools/settings/__init__.py index c3bd49449d..7df121f06e 100644 --- a/pype/tools/config_setting/__init__.py +++ b/pype/tools/settings/__init__.py @@ -1,4 +1,4 @@ -from config_setting import style, MainWidget +from settings import style, MainWidget __all__ = ( diff --git a/pype/tools/config_setting/__main__.py b/pype/tools/settings/__main__.py similarity index 53% rename from pype/tools/config_setting/__main__.py rename to pype/tools/settings/__main__.py index 0e4ab1c0aa..044c2ef495 100644 --- a/pype/tools/config_setting/__main__.py +++ b/pype/tools/settings/__main__.py @@ -1,18 +1,18 @@ import sys -import config_setting +import settings from Qt import QtWidgets, QtGui if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) - stylesheet = config_setting.style.load_stylesheet() + stylesheet = settings.style.load_stylesheet() app.setStyleSheet(stylesheet) - app.setWindowIcon(QtGui.QIcon(config_setting.style.app_icon_path())) + app.setWindowIcon(QtGui.QIcon(settings.style.app_icon_path())) develop = "-dev" in sys.argv - widget = config_setting.MainWidget(develop) + widget = settings.MainWidget(develop) widget.show() sys.exit(app.exec_()) diff --git a/pype/tools/config_setting/config_setting/__init__.py b/pype/tools/settings/settings/__init__.py similarity index 100% rename from pype/tools/config_setting/config_setting/__init__.py rename to pype/tools/settings/settings/__init__.py diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json b/pype/tools/settings/settings/config_gui_schema/projects_schema/0_project_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/0_project_gui_schema.json rename to pype/tools/settings/settings/config_gui_schema/projects_schema/0_project_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/settings/settings/config_gui_schema/projects_schema/1_plugins_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/projects_schema/1_plugins_gui_schema.json rename to pype/tools/settings/settings/config_gui_schema/projects_schema/1_plugins_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json b/pype/tools/settings/settings/config_gui_schema/system_schema/0_system_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/system_schema/0_system_gui_schema.json rename to pype/tools/settings/settings/config_gui_schema/system_schema/0_system_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json b/pype/tools/settings/settings/config_gui_schema/system_schema/1_applications_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_applications_gui_schema.json rename to pype/tools/settings/settings/config_gui_schema/system_schema/1_applications_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json b/pype/tools/settings/settings/config_gui_schema/system_schema/1_intents_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_intents_gui_schema.json rename to pype/tools/settings/settings/config_gui_schema/system_schema/1_intents_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json b/pype/tools/settings/settings/config_gui_schema/system_schema/1_tools_gui_schema.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tools_gui_schema.json rename to pype/tools/settings/settings/config_gui_schema/system_schema/1_tools_gui_schema.json diff --git a/pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json b/pype/tools/settings/settings/config_gui_schema/system_schema/1_tray_items.json similarity index 100% rename from pype/tools/config_setting/config_setting/config_gui_schema/system_schema/1_tray_items.json rename to pype/tools/settings/settings/config_gui_schema/system_schema/1_tray_items.json diff --git a/pype/tools/config_setting/config_setting/style/__init__.py b/pype/tools/settings/settings/style/__init__.py similarity index 100% rename from pype/tools/config_setting/config_setting/style/__init__.py rename to pype/tools/settings/settings/style/__init__.py diff --git a/pype/tools/config_setting/config_setting/style/pype_icon.png b/pype/tools/settings/settings/style/pype_icon.png similarity index 100% rename from pype/tools/config_setting/config_setting/style/pype_icon.png rename to pype/tools/settings/settings/style/pype_icon.png diff --git a/pype/tools/config_setting/config_setting/style/style.css b/pype/tools/settings/settings/style/style.css similarity index 100% rename from pype/tools/config_setting/config_setting/style/style.css rename to pype/tools/settings/settings/style/style.css diff --git a/pype/tools/config_setting/config_setting/widgets/__init__.py b/pype/tools/settings/settings/widgets/__init__.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/__init__.py rename to pype/tools/settings/settings/widgets/__init__.py diff --git a/pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py b/pype/tools/settings/settings/widgets/anatomy_inputs.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/anatomy_inputs.py rename to pype/tools/settings/settings/widgets/anatomy_inputs.py diff --git a/pype/tools/config_setting/config_setting/widgets/base.py b/pype/tools/settings/settings/widgets/base.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/base.py rename to pype/tools/settings/settings/widgets/base.py diff --git a/pype/tools/config_setting/config_setting/widgets/inputs.py b/pype/tools/settings/settings/widgets/inputs.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/inputs.py rename to pype/tools/settings/settings/widgets/inputs.py diff --git a/pype/tools/config_setting/config_setting/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/lib.py rename to pype/tools/settings/settings/widgets/lib.py diff --git a/pype/tools/config_setting/config_setting/widgets/tests.py b/pype/tools/settings/settings/widgets/tests.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/tests.py rename to pype/tools/settings/settings/widgets/tests.py diff --git a/pype/tools/config_setting/config_setting/widgets/widgets.py b/pype/tools/settings/settings/widgets/widgets.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/widgets.py rename to pype/tools/settings/settings/widgets/widgets.py diff --git a/pype/tools/config_setting/config_setting/widgets/window.py b/pype/tools/settings/settings/widgets/window.py similarity index 100% rename from pype/tools/config_setting/config_setting/widgets/window.py rename to pype/tools/settings/settings/widgets/window.py From 9e016906458aeaa15634f9f9e1ca03f843e1a4ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 12:27:15 +0200 Subject: [PATCH 465/507] folder config_gui_schema renamed to gui_schemas --- .../projects_schema/0_project_gui_schema.json | 0 .../projects_schema/1_plugins_gui_schema.json | 0 .../system_schema/0_system_gui_schema.json | 0 .../system_schema/1_applications_gui_schema.json | 0 .../system_schema/1_intents_gui_schema.json | 0 .../system_schema/1_tools_gui_schema.json | 0 .../system_schema/1_tray_items.json | 0 pype/tools/settings/settings/widgets/lib.py | 2 +- 8 files changed, 1 insertion(+), 1 deletion(-) rename pype/tools/settings/settings/{config_gui_schema => gui_schemas}/projects_schema/0_project_gui_schema.json (100%) rename pype/tools/settings/settings/{config_gui_schema => gui_schemas}/projects_schema/1_plugins_gui_schema.json (100%) rename pype/tools/settings/settings/{config_gui_schema => gui_schemas}/system_schema/0_system_gui_schema.json (100%) rename pype/tools/settings/settings/{config_gui_schema => gui_schemas}/system_schema/1_applications_gui_schema.json (100%) rename pype/tools/settings/settings/{config_gui_schema => gui_schemas}/system_schema/1_intents_gui_schema.json (100%) rename pype/tools/settings/settings/{config_gui_schema => gui_schemas}/system_schema/1_tools_gui_schema.json (100%) rename pype/tools/settings/settings/{config_gui_schema => gui_schemas}/system_schema/1_tray_items.json (100%) diff --git a/pype/tools/settings/settings/config_gui_schema/projects_schema/0_project_gui_schema.json b/pype/tools/settings/settings/gui_schemas/projects_schema/0_project_gui_schema.json similarity index 100% rename from pype/tools/settings/settings/config_gui_schema/projects_schema/0_project_gui_schema.json rename to pype/tools/settings/settings/gui_schemas/projects_schema/0_project_gui_schema.json diff --git a/pype/tools/settings/settings/config_gui_schema/projects_schema/1_plugins_gui_schema.json b/pype/tools/settings/settings/gui_schemas/projects_schema/1_plugins_gui_schema.json similarity index 100% rename from pype/tools/settings/settings/config_gui_schema/projects_schema/1_plugins_gui_schema.json rename to pype/tools/settings/settings/gui_schemas/projects_schema/1_plugins_gui_schema.json diff --git a/pype/tools/settings/settings/config_gui_schema/system_schema/0_system_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json similarity index 100% rename from pype/tools/settings/settings/config_gui_schema/system_schema/0_system_gui_schema.json rename to pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json diff --git a/pype/tools/settings/settings/config_gui_schema/system_schema/1_applications_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json similarity index 100% rename from pype/tools/settings/settings/config_gui_schema/system_schema/1_applications_gui_schema.json rename to pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json diff --git a/pype/tools/settings/settings/config_gui_schema/system_schema/1_intents_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json similarity index 100% rename from pype/tools/settings/settings/config_gui_schema/system_schema/1_intents_gui_schema.json rename to pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json diff --git a/pype/tools/settings/settings/config_gui_schema/system_schema/1_tools_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_tools_gui_schema.json similarity index 100% rename from pype/tools/settings/settings/config_gui_schema/system_schema/1_tools_gui_schema.json rename to pype/tools/settings/settings/gui_schemas/system_schema/1_tools_gui_schema.json diff --git a/pype/tools/settings/settings/config_gui_schema/system_schema/1_tray_items.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_tray_items.json similarity index 100% rename from pype/tools/settings/settings/config_gui_schema/system_schema/1_tray_items.json rename to pype/tools/settings/settings/gui_schemas/system_schema/1_tray_items.json diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index daba87de15..9f54b090cb 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -278,7 +278,7 @@ def gui_schema(subfolder, main_schema_name): subfolder, main_schema_name dirpath = os.path.join( os.path.dirname(os.path.dirname(__file__)), - "config_gui_schema", + "gui_schemas", subfolder ) From 1c8d2c3a3065da76e13d2c65480f320faf6645d5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 12:53:20 +0200 Subject: [PATCH 466/507] removed temp file --- pype/tools/helpguide.txt | 153 --------------------------------------- 1 file changed, 153 deletions(-) delete mode 100644 pype/tools/helpguide.txt diff --git a/pype/tools/helpguide.txt b/pype/tools/helpguide.txt deleted file mode 100644 index b0c9471e3e..0000000000 --- a/pype/tools/helpguide.txt +++ /dev/null @@ -1,153 +0,0 @@ -## Basic rules -- configurations does not define GUI, but GUI defines configurations! -- output is always json (yaml is not needed for anatomy templates anymore) -- GUI schema has multiple input types, all inputs are represented by a dictionary -- each input may have "input modifiers" (keys in dictionary) that are required or optional - - only required modifier for all input items is key `"type"` which says what type of item it is -- there are special keys across all inputs - - `"is_file"` - this key is for storing pype defaults in `pype` repo - - reasons of existence: developing new schemas does not require to create defaults manually - - key is validated, must be once in hierarchy else it won't be possible to store pype defaults - - `"is_group"` - define that all values under key in hierarchy will be overriden if any value is modified, this information is also stored to overrides - - key is validated, can be only once in hierarchy but is not required - -## Basic Dictionary inputs -- these inputs wraps another inputs into {key: value} relation - -## dict-invisible -- this input gives ability to wrap another inputs but keep them in same widget without visible divider - - this is used as first input widget -- has required keys `"key"` and `"children"` - - "children" says what children inputs are underneath - - "key" is key under which will be stored value from it's children -- output is dictionary `{the "key": children values}` - -``` -{ - "type": "dict-invisible", - "key": "global", - "children": [{ - ... - }] -} -``` - -## dict -- this is another dictionary input wrapping more inputs but visually makes them different - -``` -{ - "key": "applications", - "type": "dict", - "label": "Applications", - "expandable": true, - "is_group": true, - "is_file": true, -} -``` - -## Inputs for setting any kind of value (`Pure` inputs) -- all these input must have defined `"key"` under which will be stored and `"label"` which will be shown next to input - - unless they are used in different types of inputs (later) "as widgets" in that case `"key"` and `"label"` are not required as there is not place where to set them - -### boolean -- simple checkbox, nothing more to set -``` -{ - "type": "boolean", - "key": "my_boolean_key", - "label": "Do you want to use Pype?" -} -``` - -### number -- number input, can be used for both integer and float - - key `"decimal"` defines how many decimal places will be used, 0 is for integer input (Default: `0`) - - key `"minimum"` as minimum allowed number to enter (Default: `-99999`) - - key `"maxium"` as maximum allowed number to enter (Default: `99999`) -``` -{ - "type": "number", - "key": "fps", - "label": "Frame rate (FPS)" - "decimal": 2, - "minimum": 1, - "maximum": 300000 -} -``` - -### text -- simple text input - - key `"multiline"` allows to enter multiple lines of text (Default: `False`) - -``` -{ - "type": "text", - "key": "deadline_pool", - "label": "Deadline pool" -} -``` - -### raw-json -- a little bit enhanced text input for raw json -- has validations of json format - - empty value is invalid value, always must be at least `{}` of `[]` - -``` -{ - "type": "raw-json", - "key": "profiles", - "label": "Extract Review profiles" -} -``` - -## Inputs for setting value using Pure inputs -- these inputs also have required `"key"` and `"label"` -- they use Pure inputs "as widgets" - -### list -- output is list -- items can be added and removed -- items in list must be the same type - - type of items is defined with key `"object_type"` where Pure input name is entered (e.g. `number`) - - because Pure inputs may have modifiers (`number` input has `minimum`, `maximum` and `decimals`) you can set these in key `"input_modifiers"` - -``` -{ - "type": "list", - "object_type": "number", - "key": "exclude_ports", - "label": "Exclude ports", - "input_modifiers": { - "minimum": 1, - "maximum": 65535 - } -} -``` - -### dict-modifiable -- one of dictionary inputs, this is only used as value input -- items in this input can be removed and added same way as in `list` input -- value items in dictionary must be the same type - - type of items is defined with key `"object_type"` where Pure input name is entered (e.g. `number`) - - because Pure inputs may have modifiers (`number` input has `minimum`, `maximum` and `decimals`) you can set these in key `"input_modifiers"` -- this input can be expandable - - that can be set with key `"expandable"` as `True`/`False` (Default: `True`) - - with key `"expanded"` as `True`/`False` can be set that is expanded when GUI is opened (Default: `False`) - -``` -{ - "type": "dict-modifiable", - "object_type": "number", - "input_modifiers": { - "minimum": 0, - "maximum": 300 - }, - "is_group": true, - "key": "templates_mapping", - "label": "Muster - Templates mapping", - "is_file": true -} -``` - -Currently there are `system configurations` and `project configurations`. Both has `root` schema where all begins. From 2f2eb3689bf726cf5ecc4613ad6eafe0e1309d9c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:13:43 +0200 Subject: [PATCH 467/507] extracted config.py to __init__.py --- pype/configurations/__init__.py | 9 +++++++++ pype/configurations/config.py | 24 ------------------------ pype/configurations/lib.py | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 pype/configurations/__init__.py delete mode 100644 pype/configurations/config.py diff --git a/pype/configurations/__init__.py b/pype/configurations/__init__.py new file mode 100644 index 0000000000..e3fc53fcfd --- /dev/null +++ b/pype/configurations/__init__.py @@ -0,0 +1,9 @@ +from .lib import ( + system_configurations, + project_configurations +) + +__all__ = ( + "system_configurations", + "project_configurations" +) diff --git a/pype/configurations/config.py b/pype/configurations/config.py deleted file mode 100644 index ed7104427f..0000000000 --- a/pype/configurations/config.py +++ /dev/null @@ -1,24 +0,0 @@ -from .lib import ( - apply_overrides, - default_configuration, - studio_system_configurations, - studio_project_configurations, - project_configurations_overrides -) - - -def system_configurations(): - default_values = default_configuration()["system_configurations"] - studio_values = studio_system_configurations() - return apply_overrides(default_values, studio_values) - - -def project_configurations(project_name): - default_values = default_configuration()["project_configurations"] - studio_values = studio_project_configurations() - - studio_overrides = apply_overrides(default_values, studio_values) - - project_overrides = project_configurations_overrides(project_name) - - return apply_overrides(studio_overrides, project_overrides) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index 7e24d25483..6fb90261e1 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -239,3 +239,20 @@ def apply_overrides(global_presets, project_overrides): if not project_overrides: return global_presets return merge_overrides(global_presets, project_overrides) + + +def system_configurations(): + default_values = default_configuration()["system_configurations"] + studio_values = studio_system_configurations() + return apply_overrides(default_values, studio_values) + + +def project_configurations(project_name): + default_values = default_configuration()["project_configurations"] + studio_values = studio_project_configurations() + + studio_overrides = apply_overrides(default_values, studio_values) + + project_overrides = project_configurations_overrides(project_name) + + return apply_overrides(studio_overrides, project_overrides) From 9b466e93728e324462961cfb210bb059c5b4c279 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:15:40 +0200 Subject: [PATCH 468/507] renamed configuration constants to settings constant names --- pype/configurations/lib.py | 38 ++++++++++---------- pype/tools/settings/settings/widgets/base.py | 26 +++++++------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/pype/configurations/lib.py b/pype/configurations/lib.py index 6fb90261e1..101b579b14 100644 --- a/pype/configurations/lib.py +++ b/pype/configurations/lib.py @@ -14,16 +14,16 @@ POP_KEY = "__pop_key__" STUDIO_OVERRIDES_PATH = os.environ["PYPE_PROJECT_CONFIGS"] # File where studio's system overrides are stored -SYSTEM_CONFIGURATIONS_KEY = "system_configurations" -SYSTEM_CONFIGURATIONS_PATH = os.path.join( - STUDIO_OVERRIDES_PATH, SYSTEM_CONFIGURATIONS_KEY + ".json" +SYSTEM_SETTINGS_KEY = "system_configurations" +SYSTEM_SETTINGS_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, SYSTEM_SETTINGS_KEY + ".json" ) # File where studio's default project overrides are stored -PROJECT_CONFIGURATIONS_KEY = "project_configurations" -PROJECT_CONFIGURATIONS_FILENAME = PROJECT_CONFIGURATIONS_KEY + ".json" -PROJECT_CONFIGURATIONS_PATH = os.path.join( - STUDIO_OVERRIDES_PATH, PROJECT_CONFIGURATIONS_FILENAME +PROJECT_SETTINGS_KEY = "project_configurations" +PROJECT_SETTINGS_FILENAME = PROJECT_SETTINGS_KEY + ".json" +PROJECT_SETTINGS_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, PROJECT_SETTINGS_FILENAME ) PROJECT_ANATOMY_KEY = "project_anatomy" @@ -36,19 +36,19 @@ PROJECT_ANATOMY_PATH = os.path.join( DEFAULTS_DIR = os.path.join(os.path.dirname(__file__), "defaults") # Variable where cache of default configurations are stored -_DEFAULT_CONFIGURATIONS = None +_DEFAULT_SETTINGS = None def reset_default_configurations(): - global _DEFAULT_CONFIGURATIONS - _DEFAULT_CONFIGURATIONS = None + global _DEFAULT_SETTINGS + _DEFAULT_SETTINGS = None def default_configuration(): - global _DEFAULT_CONFIGURATIONS - if _DEFAULT_CONFIGURATIONS is None: - _DEFAULT_CONFIGURATIONS = load_jsons_from_dir(DEFAULTS_DIR) - return _DEFAULT_CONFIGURATIONS + global _DEFAULT_SETTINGS + if _DEFAULT_SETTINGS is None: + _DEFAULT_SETTINGS = load_jsons_from_dir(DEFAULTS_DIR) + return _DEFAULT_SETTINGS def load_json(fpath): @@ -157,14 +157,14 @@ def load_jsons_from_dir(path, *args, **kwargs): def studio_system_configurations(): - if os.path.exists(SYSTEM_CONFIGURATIONS_PATH): - return load_json(SYSTEM_CONFIGURATIONS_PATH) + if os.path.exists(SYSTEM_SETTINGS_PATH): + return load_json(SYSTEM_SETTINGS_PATH) return {} def studio_project_configurations(): - if os.path.exists(PROJECT_CONFIGURATIONS_PATH): - return load_json(PROJECT_CONFIGURATIONS_PATH) + if os.path.exists(PROJECT_SETTINGS_PATH): + return load_json(PROJECT_SETTINGS_PATH) return {} @@ -178,7 +178,7 @@ def path_to_project_overrides(project_name): return os.path.join( STUDIO_OVERRIDES_PATH, project_name, - PROJECT_CONFIGURATIONS_FILENAME + PROJECT_SETTINGS_FILENAME ) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index 16192aadf3..e1d167a9f2 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -3,9 +3,9 @@ import json from Qt import QtWidgets, QtCore, QtGui from pype.configurations.lib import ( SYSTEM_CONFIGURATIONS_KEY, - SYSTEM_CONFIGURATIONS_PATH, - PROJECT_CONFIGURATIONS_KEY, - PROJECT_CONFIGURATIONS_PATH, + SYSTEM_SETTINGS_PATH, + PROJECT_SETTINGS_KEY, + PROJECT_SETTINGS_PATH, PROJECT_ANATOMY_KEY, PROJECT_ANATOMY_PATH, @@ -148,12 +148,12 @@ class SystemWidget(QtWidgets.QWidget): values = lib.convert_gui_data_to_overrides(_data.get("system", {})) - dirpath = os.path.dirname(SYSTEM_CONFIGURATIONS_PATH) + dirpath = os.path.dirname(SYSTEM_SETTINGS_PATH) if not os.path.exists(dirpath): os.makedirs(dirpath) - print("Saving data to:", SYSTEM_CONFIGURATIONS_PATH) - with open(SYSTEM_CONFIGURATIONS_PATH, "w") as file_stream: + print("Saving data to:", SYSTEM_SETTINGS_PATH) + with open(SYSTEM_SETTINGS_PATH, "w") as file_stream: json.dump(values, file_stream, indent=4) self._update_values() @@ -467,7 +467,7 @@ class ProjectWidget(QtWidgets.QWidget): self.is_overidable = True overrides = {"project": { - PROJECT_CONFIGURATIONS_KEY: lib.convert_overrides_to_gui_data( + PROJECT_SETTINGS_KEY: lib.convert_overrides_to_gui_data( _project_overrides ), PROJECT_ANATOMY_KEY: lib.convert_overrides_to_gui_data( @@ -566,7 +566,7 @@ class ProjectWidget(QtWidgets.QWidget): # Saving overrides data project_overrides_data = output_data.get( - PROJECT_CONFIGURATIONS_KEY, {} + PROJECT_SETTINGS_KEY, {} ) project_overrides_json_path = path_to_project_overrides( self.project_name @@ -610,14 +610,14 @@ class ProjectWidget(QtWidgets.QWidget): # Project overrides data project_overrides_data = output_data.get( - PROJECT_CONFIGURATIONS_KEY, {} + PROJECT_SETTINGS_KEY, {} ) - dirpath = os.path.dirname(PROJECT_CONFIGURATIONS_PATH) + dirpath = os.path.dirname(PROJECT_SETTINGS_PATH) if not os.path.exists(dirpath): os.makedirs(dirpath) - print("Saving data to:", PROJECT_CONFIGURATIONS_PATH) - with open(PROJECT_CONFIGURATIONS_PATH, "w") as file_stream: + print("Saving data to:", PROJECT_SETTINGS_PATH) + with open(PROJECT_SETTINGS_PATH, "w") as file_stream: json.dump(project_overrides_data, file_stream, indent=4) # Project Anatomy data @@ -643,7 +643,7 @@ class ProjectWidget(QtWidgets.QWidget): input_field.update_default_values(default_values) studio_values = {"project": { - PROJECT_CONFIGURATIONS_KEY: studio_project_configurations(), + PROJECT_SETTINGS_KEY: studio_project_configurations(), PROJECT_ANATOMY_KEY: studio_project_anatomy() }} for input_field in self.input_fields: From b4860169c58fb8f3a964bb3915668f99fc3d31dc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:17:50 +0200 Subject: [PATCH 469/507] renamed most of variables with configuration in name to settings --- .../settings/widgets/anatomy_inputs.py | 8 ++++---- .../tools/settings/settings/widgets/inputs.py | 20 +++++++++---------- .../settings/settings/widgets/widgets.py | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pype/tools/settings/settings/widgets/anatomy_inputs.py b/pype/tools/settings/settings/widgets/anatomy_inputs.py index 09544a2455..0e7e094be5 100644 --- a/pype/tools/settings/settings/widgets/anatomy_inputs.py +++ b/pype/tools/settings/settings/widgets/anatomy_inputs.py @@ -1,10 +1,10 @@ from Qt import QtWidgets, QtCore from .widgets import ExpandingWidget -from .inputs import ConfigObject, ModifiableDict, PathWidget, RawJsonWidget +from .inputs import SettingObject, ModifiableDict, PathWidget, RawJsonWidget from .lib import NOT_SET, TypeToKlass, CHILD_OFFSET, METADATA_KEY -class AnatomyWidget(QtWidgets.QWidget, ConfigObject): +class AnatomyWidget(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) template_keys = ( "project[name]", @@ -224,7 +224,7 @@ class AnatomyWidget(QtWidgets.QWidget, ConfigObject): return {self.key: self.item_value()} -class RootsWidget(QtWidgets.QWidget, ConfigObject): +class RootsWidget(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) def __init__(self, input_data, parent): @@ -603,7 +603,7 @@ class RootsWidget(QtWidgets.QWidget, ConfigObject): return {self.key: self.item_value()} -class TemplatesWidget(QtWidgets.QWidget, ConfigObject): +class TemplatesWidget(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) def __init__(self, input_data, parent): diff --git a/pype/tools/settings/settings/widgets/inputs.py b/pype/tools/settings/settings/widgets/inputs.py index fa809cd2d2..aa72f1c81f 100644 --- a/pype/tools/settings/settings/widgets/inputs.py +++ b/pype/tools/settings/settings/widgets/inputs.py @@ -3,7 +3,7 @@ import logging import collections from Qt import QtWidgets, QtCore, QtGui from .widgets import ( - AbstractConfigObject, + AbstractSettingObject, ExpandingWidget, NumberSpinBox, PathInput @@ -11,7 +11,7 @@ from .widgets import ( from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET -class ConfigObject(AbstractConfigObject): +class SettingObject(AbstractSettingObject): default_input_value = NOT_SET allow_actions = True default_state = "" @@ -88,7 +88,7 @@ class ConfigObject(AbstractConfigObject): @property def any_parent_is_group(self): if self._any_parent_is_group is None: - return super(ConfigObject, self).any_parent_is_group + return super(SettingObject, self).any_parent_is_group return self._any_parent_is_group @property @@ -246,7 +246,7 @@ class ConfigObject(AbstractConfigObject): return item.mouseReleaseEvent(self, event) -class InputObject(ConfigObject): +class InputObject(SettingObject): def update_default_values(self, parent_values): self._state = None self._is_modified = False @@ -879,7 +879,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): return self.text_input.json_value() -class ListItem(QtWidgets.QWidget, ConfigObject): +class ListItem(QtWidgets.QWidget, SettingObject): _btn_size = 20 value_changed = QtCore.Signal(object) @@ -1157,7 +1157,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): return output -class ModifiableDictItem(QtWidgets.QWidget, ConfigObject): +class ModifiableDictItem(QtWidgets.QWidget, SettingObject): _btn_size = 20 value_changed = QtCore.Signal(object) @@ -1534,7 +1534,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): # Dictionaries -class DictWidget(QtWidgets.QWidget, ConfigObject): +class DictWidget(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) def __init__( @@ -1856,7 +1856,7 @@ class DictWidget(QtWidgets.QWidget, ConfigObject): return {self.key: values}, self.is_group -class DictInvisible(QtWidgets.QWidget, ConfigObject): +class DictInvisible(QtWidgets.QWidget, SettingObject): # TODO is not overridable by itself value_changed = QtCore.Signal(object) allow_actions = False @@ -2081,7 +2081,7 @@ class DictInvisible(QtWidgets.QWidget, ConfigObject): return {self.key: values}, self.is_group -class PathWidget(QtWidgets.QWidget, ConfigObject): +class PathWidget(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) platforms = ("windows", "darwin", "linux") platform_labels_mapping = { @@ -2442,7 +2442,7 @@ class FormLabel(QtWidgets.QLabel): self.item = None -class DictFormWidget(QtWidgets.QWidget, ConfigObject): +class DictFormWidget(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) allow_actions = False diff --git a/pype/tools/settings/settings/widgets/widgets.py b/pype/tools/settings/settings/widgets/widgets.py index aa1f17a7f4..bb42df6026 100644 --- a/pype/tools/settings/settings/widgets/widgets.py +++ b/pype/tools/settings/settings/widgets/widgets.py @@ -224,7 +224,7 @@ class UnsavedChangesDialog(QtWidgets.QDialog): self.done(2) -class AbstractConfigObject: +class AbstractSettingObject: abstract_attributes = ("_parent", ) def __getattr__(self, name): @@ -232,7 +232,7 @@ class AbstractConfigObject: raise NotImplementedError( "Attribute `{}` is not implemented. {}".format(name, self) ) - return super(AbstractConfigObject, self).__getattribute__(name) + return super(AbstractSettingObject, self).__getattribute__(name) def update_default_values(self, parent_values): raise NotImplementedError( From 111e11b9b15b244659b92baeecf9949648cb0eb3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:20:13 +0200 Subject: [PATCH 470/507] renamed configurations folder in pype co settings --- pype/api.py | 2 +- pype/{configurations => settings}/__init__.py | 0 .../defaults/project_anatomy/colorspace.json | 0 .../defaults/project_anatomy/dataflow.json | 0 .../defaults/project_anatomy/roots.json | 0 .../defaults/project_anatomy/templates.json | 0 .../defaults/project_configurations/ftrack/ftrack_config.json | 0 .../project_configurations/ftrack/ftrack_custom_attributes.json | 0 .../project_configurations/ftrack/partnership_ftrack_cred.json | 0 .../defaults/project_configurations/ftrack/plugins/server.json | 0 .../defaults/project_configurations/ftrack/plugins/user.json | 0 .../project_configurations/ftrack/project_defaults.json | 0 .../defaults/project_configurations/global/creator.json | 0 .../project_configurations/global/project_folder_structure.json | 0 .../defaults/project_configurations/global/sw_folders.json | 0 .../defaults/project_configurations/global/workfiles.json | 0 .../defaults/project_configurations/maya/capture.json | 0 .../project_configurations/muster/templates_mapping.json | 0 .../project_configurations/plugins/celaction/publish.json | 0 .../defaults/project_configurations/plugins/config.json | 0 .../defaults/project_configurations/plugins/ftrack/publish.json | 0 .../defaults/project_configurations/plugins/global/create.json | 0 .../defaults/project_configurations/plugins/global/filter.json | 0 .../defaults/project_configurations/plugins/global/load.json | 0 .../defaults/project_configurations/plugins/global/publish.json | 0 .../defaults/project_configurations/plugins/maya/create.json | 0 .../defaults/project_configurations/plugins/maya/filter.json | 0 .../defaults/project_configurations/plugins/maya/load.json | 0 .../defaults/project_configurations/plugins/maya/publish.json | 0 .../project_configurations/plugins/maya/workfile_build.json | 0 .../defaults/project_configurations/plugins/nuke/create.json | 0 .../defaults/project_configurations/plugins/nuke/load.json | 0 .../defaults/project_configurations/plugins/nuke/publish.json | 0 .../project_configurations/plugins/nuke/workfile_build.json | 0 .../project_configurations/plugins/nukestudio/filter.json | 0 .../project_configurations/plugins/nukestudio/publish.json | 0 .../defaults/project_configurations/plugins/resolve/create.json | 0 .../plugins/standalonepublisher/publish.json | 0 .../defaults/project_configurations/plugins/test/create.json | 0 .../defaults/project_configurations/plugins/test/publish.json | 0 .../defaults/project_configurations/premiere/asset_default.json | 0 .../defaults/project_configurations/premiere/rules_tasks.json | 0 .../project_configurations/standalonepublisher/families.json | 0 .../project_configurations/tools/slates/example_HD.json | 0 .../defaults/project_configurations/unreal/project_setup.json | 0 .../defaults/system_configurations/environments/avalon.json | 0 .../defaults/system_configurations/environments/blender.json | 0 .../defaults/system_configurations/environments/celaction.json | 0 .../defaults/system_configurations/environments/deadline.json | 0 .../defaults/system_configurations/environments/ftrack.json | 0 .../defaults/system_configurations/environments/global.json | 0 .../defaults/system_configurations/environments/harmony.json | 0 .../defaults/system_configurations/environments/houdini.json | 0 .../defaults/system_configurations/environments/maya.json | 0 .../defaults/system_configurations/environments/maya_2018.json | 0 .../defaults/system_configurations/environments/maya_2020.json | 0 .../defaults/system_configurations/environments/mayabatch.json | 0 .../system_configurations/environments/mayabatch_2019.json | 0 .../defaults/system_configurations/environments/mtoa_3.1.1.json | 0 .../defaults/system_configurations/environments/muster.json | 0 .../defaults/system_configurations/environments/nuke.json | 0 .../defaults/system_configurations/environments/nukestudio.json | 0 .../system_configurations/environments/nukestudio_10.0.json | 0 .../defaults/system_configurations/environments/nukex.json | 0 .../defaults/system_configurations/environments/nukex_10.0.json | 0 .../defaults/system_configurations/environments/photoshop.json | 0 .../defaults/system_configurations/environments/premiere.json | 0 .../defaults/system_configurations/environments/resolve.json | 0 .../system_configurations/environments/storyboardpro.json | 0 .../system_configurations/environments/unreal_4.24.json | 0 .../defaults/system_configurations/environments/vray_4300.json | 0 .../defaults/system_configurations/global/applications.json | 0 .../defaults/system_configurations/global/intent.json | 0 .../defaults/system_configurations/global/tools.json | 0 .../defaults/system_configurations/global/tray_modules.json | 0 .../defaults/system_configurations/launchers/blender_2.80.toml | 0 .../defaults/system_configurations/launchers/blender_2.81.toml | 0 .../defaults/system_configurations/launchers/blender_2.82.toml | 0 .../defaults/system_configurations/launchers/blender_2.83.toml | 0 .../system_configurations/launchers/celaction_local.toml | 0 .../system_configurations/launchers/celaction_publish.toml | 0 .../system_configurations/launchers/darwin/blender_2.82 | 0 .../defaults/system_configurations/launchers/darwin/harmony_17 | 0 .../system_configurations/launchers/darwin/harmony_17_launch | 0 .../defaults/system_configurations/launchers/darwin/python3 | 0 .../defaults/system_configurations/launchers/harmony_17.toml | 0 .../defaults/system_configurations/launchers/houdini_16.toml | 0 .../defaults/system_configurations/launchers/houdini_17.toml | 0 .../defaults/system_configurations/launchers/houdini_18.toml | 0 .../defaults/system_configurations/launchers/linux/maya2016 | 0 .../defaults/system_configurations/launchers/linux/maya2017 | 0 .../defaults/system_configurations/launchers/linux/maya2018 | 0 .../defaults/system_configurations/launchers/linux/maya2019 | 0 .../defaults/system_configurations/launchers/linux/maya2020 | 0 .../defaults/system_configurations/launchers/linux/nuke11.3 | 0 .../defaults/system_configurations/launchers/linux/nuke12.0 | 0 .../system_configurations/launchers/linux/nukestudio11.3 | 0 .../system_configurations/launchers/linux/nukestudio12.0 | 0 .../defaults/system_configurations/launchers/linux/nukex11.3 | 0 .../defaults/system_configurations/launchers/linux/nukex12.0 | 0 .../defaults/system_configurations/launchers/maya_2016.toml | 0 .../defaults/system_configurations/launchers/maya_2017.toml | 0 .../defaults/system_configurations/launchers/maya_2018.toml | 0 .../defaults/system_configurations/launchers/maya_2019.toml | 0 .../defaults/system_configurations/launchers/maya_2020.toml | 0 .../system_configurations/launchers/mayabatch_2019.toml | 0 .../system_configurations/launchers/mayabatch_2020.toml | 0 .../defaults/system_configurations/launchers/mayapy2016.toml | 0 .../defaults/system_configurations/launchers/mayapy2017.toml | 0 .../defaults/system_configurations/launchers/mayapy2018.toml | 0 .../defaults/system_configurations/launchers/mayapy2019.toml | 0 .../defaults/system_configurations/launchers/mayapy2020.toml | 0 .../defaults/system_configurations/launchers/myapp.toml | 0 .../defaults/system_configurations/launchers/nuke_10.0.toml | 0 .../defaults/system_configurations/launchers/nuke_11.0.toml | 0 .../defaults/system_configurations/launchers/nuke_11.2.toml | 0 .../defaults/system_configurations/launchers/nuke_11.3.toml | 0 .../defaults/system_configurations/launchers/nuke_12.0.toml | 0 .../system_configurations/launchers/nukestudio_10.0.toml | 0 .../system_configurations/launchers/nukestudio_11.0.toml | 0 .../system_configurations/launchers/nukestudio_11.2.toml | 0 .../system_configurations/launchers/nukestudio_11.3.toml | 0 .../system_configurations/launchers/nukestudio_12.0.toml | 0 .../defaults/system_configurations/launchers/nukex_10.0.toml | 0 .../defaults/system_configurations/launchers/nukex_11.0.toml | 0 .../defaults/system_configurations/launchers/nukex_11.2.toml | 0 .../defaults/system_configurations/launchers/nukex_11.3.toml | 0 .../defaults/system_configurations/launchers/nukex_12.0.toml | 0 .../system_configurations/launchers/photoshop_2020.toml | 0 .../defaults/system_configurations/launchers/premiere_2019.toml | 0 .../defaults/system_configurations/launchers/premiere_2020.toml | 0 .../defaults/system_configurations/launchers/python_2.toml | 0 .../defaults/system_configurations/launchers/python_3.toml | 0 .../defaults/system_configurations/launchers/resolve_16.toml | 0 .../defaults/system_configurations/launchers/shell.toml | 0 .../system_configurations/launchers/storyboardpro_7.toml | 0 .../defaults/system_configurations/launchers/unreal_4.24.toml | 0 .../system_configurations/launchers/windows/blender_2.80.bat | 0 .../system_configurations/launchers/windows/blender_2.81.bat | 0 .../system_configurations/launchers/windows/blender_2.82.bat | 0 .../system_configurations/launchers/windows/blender_2.83.bat | 0 .../system_configurations/launchers/windows/celaction_local.bat | 0 .../launchers/windows/celaction_publish.bat | 0 .../system_configurations/launchers/windows/harmony_17.bat | 0 .../system_configurations/launchers/windows/houdini_16.bat | 0 .../system_configurations/launchers/windows/houdini_17.bat | 0 .../system_configurations/launchers/windows/houdini_18.bat | 0 .../system_configurations/launchers/windows/maya2016.bat | 0 .../system_configurations/launchers/windows/maya2017.bat | 0 .../system_configurations/launchers/windows/maya2018.bat | 0 .../system_configurations/launchers/windows/maya2019.bat | 0 .../system_configurations/launchers/windows/maya2020.bat | 0 .../system_configurations/launchers/windows/mayabatch2019.bat | 0 .../system_configurations/launchers/windows/mayabatch2020.bat | 0 .../system_configurations/launchers/windows/mayapy2016.bat | 0 .../system_configurations/launchers/windows/mayapy2017.bat | 0 .../system_configurations/launchers/windows/mayapy2018.bat | 0 .../system_configurations/launchers/windows/mayapy2019.bat | 0 .../system_configurations/launchers/windows/mayapy2020.bat | 0 .../system_configurations/launchers/windows/nuke10.0.bat | 0 .../system_configurations/launchers/windows/nuke11.0.bat | 0 .../system_configurations/launchers/windows/nuke11.2.bat | 0 .../system_configurations/launchers/windows/nuke11.3.bat | 0 .../system_configurations/launchers/windows/nuke12.0.bat | 0 .../system_configurations/launchers/windows/nukestudio10.0.bat | 0 .../system_configurations/launchers/windows/nukestudio11.0.bat | 0 .../system_configurations/launchers/windows/nukestudio11.2.bat | 0 .../system_configurations/launchers/windows/nukestudio11.3.bat | 0 .../system_configurations/launchers/windows/nukestudio12.0.bat | 0 .../system_configurations/launchers/windows/nukex10.0.bat | 0 .../system_configurations/launchers/windows/nukex11.0.bat | 0 .../system_configurations/launchers/windows/nukex11.2.bat | 0 .../system_configurations/launchers/windows/nukex11.3.bat | 0 .../system_configurations/launchers/windows/nukex12.0.bat | 0 .../system_configurations/launchers/windows/photoshop_2020.bat | 0 .../launchers/windows/premiere_pro_2019.bat | 0 .../launchers/windows/premiere_pro_2020.bat | 0 .../system_configurations/launchers/windows/python3.bat | 0 .../system_configurations/launchers/windows/resolve_16.bat | 0 .../defaults/system_configurations/launchers/windows/shell.bat | 0 .../system_configurations/launchers/windows/storyboardpro_7.bat | 0 .../defaults/system_configurations/launchers/windows/unreal.bat | 0 .../system_configurations/muster/templates_mapping.json | 0 .../system_configurations/standalone_publish/families.json | 0 pype/{configurations => settings}/lib.py | 0 185 files changed, 1 insertion(+), 1 deletion(-) rename pype/{configurations => settings}/__init__.py (100%) rename pype/{configurations => settings}/defaults/project_anatomy/colorspace.json (100%) rename pype/{configurations => settings}/defaults/project_anatomy/dataflow.json (100%) rename pype/{configurations => settings}/defaults/project_anatomy/roots.json (100%) rename pype/{configurations => settings}/defaults/project_anatomy/templates.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/ftrack/ftrack_config.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/ftrack/ftrack_custom_attributes.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/ftrack/partnership_ftrack_cred.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/ftrack/plugins/server.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/ftrack/plugins/user.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/ftrack/project_defaults.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/global/creator.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/global/project_folder_structure.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/global/sw_folders.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/global/workfiles.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/maya/capture.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/muster/templates_mapping.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/celaction/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/config.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/ftrack/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/global/create.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/global/filter.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/global/load.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/global/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/maya/create.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/maya/filter.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/maya/load.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/maya/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/maya/workfile_build.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/nuke/create.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/nuke/load.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/nuke/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/nuke/workfile_build.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/nukestudio/filter.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/nukestudio/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/resolve/create.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/standalonepublisher/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/test/create.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/plugins/test/publish.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/premiere/asset_default.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/premiere/rules_tasks.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/standalonepublisher/families.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/tools/slates/example_HD.json (100%) rename pype/{configurations => settings}/defaults/project_configurations/unreal/project_setup.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/avalon.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/blender.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/celaction.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/deadline.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/ftrack.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/global.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/harmony.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/houdini.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/maya.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/maya_2018.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/maya_2020.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/mayabatch.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/mayabatch_2019.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/mtoa_3.1.1.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/muster.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/nuke.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/nukestudio.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/nukestudio_10.0.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/nukex.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/nukex_10.0.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/photoshop.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/premiere.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/resolve.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/storyboardpro.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/unreal_4.24.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/environments/vray_4300.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/global/applications.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/global/intent.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/global/tools.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/global/tray_modules.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/blender_2.80.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/blender_2.81.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/blender_2.82.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/blender_2.83.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/celaction_local.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/celaction_publish.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/darwin/blender_2.82 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/darwin/harmony_17 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/darwin/harmony_17_launch (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/darwin/python3 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/harmony_17.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/houdini_16.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/houdini_17.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/houdini_18.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/maya2016 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/maya2017 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/maya2018 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/maya2019 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/maya2020 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/nuke11.3 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/nuke12.0 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/nukestudio11.3 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/nukestudio12.0 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/nukex11.3 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/linux/nukex12.0 (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/maya_2016.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/maya_2017.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/maya_2018.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/maya_2019.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/maya_2020.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/mayabatch_2019.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/mayabatch_2020.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/mayapy2016.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/mayapy2017.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/mayapy2018.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/mayapy2019.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/mayapy2020.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/myapp.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nuke_10.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nuke_11.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nuke_11.2.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nuke_11.3.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nuke_12.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukestudio_10.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukestudio_11.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukestudio_11.2.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukestudio_11.3.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukestudio_12.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukex_10.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukex_11.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukex_11.2.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukex_11.3.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/nukex_12.0.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/photoshop_2020.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/premiere_2019.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/premiere_2020.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/python_2.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/python_3.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/resolve_16.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/shell.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/storyboardpro_7.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/unreal_4.24.toml (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/blender_2.80.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/blender_2.81.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/blender_2.82.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/blender_2.83.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/celaction_local.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/celaction_publish.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/harmony_17.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/houdini_16.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/houdini_17.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/houdini_18.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/maya2016.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/maya2017.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/maya2018.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/maya2019.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/maya2020.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/mayabatch2019.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/mayabatch2020.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/mayapy2016.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/mayapy2017.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/mayapy2018.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/mayapy2019.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/mayapy2020.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nuke10.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nuke11.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nuke11.2.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nuke11.3.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nuke12.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukestudio10.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukestudio11.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukestudio11.2.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukestudio11.3.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukestudio12.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukex10.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukex11.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukex11.2.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukex11.3.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/nukex12.0.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/photoshop_2020.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/python3.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/resolve_16.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/shell.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/storyboardpro_7.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/launchers/windows/unreal.bat (100%) rename pype/{configurations => settings}/defaults/system_configurations/muster/templates_mapping.json (100%) rename pype/{configurations => settings}/defaults/system_configurations/standalone_publish/families.json (100%) rename pype/{configurations => settings}/lib.py (100%) diff --git a/pype/api.py b/pype/api.py index c5cd28d4de..0b3439c4c2 100644 --- a/pype/api.py +++ b/pype/api.py @@ -1,4 +1,4 @@ -from .configurations.config import ( +from .settings import ( system_configurations, project_configurations ) diff --git a/pype/configurations/__init__.py b/pype/settings/__init__.py similarity index 100% rename from pype/configurations/__init__.py rename to pype/settings/__init__.py diff --git a/pype/configurations/defaults/project_anatomy/colorspace.json b/pype/settings/defaults/project_anatomy/colorspace.json similarity index 100% rename from pype/configurations/defaults/project_anatomy/colorspace.json rename to pype/settings/defaults/project_anatomy/colorspace.json diff --git a/pype/configurations/defaults/project_anatomy/dataflow.json b/pype/settings/defaults/project_anatomy/dataflow.json similarity index 100% rename from pype/configurations/defaults/project_anatomy/dataflow.json rename to pype/settings/defaults/project_anatomy/dataflow.json diff --git a/pype/configurations/defaults/project_anatomy/roots.json b/pype/settings/defaults/project_anatomy/roots.json similarity index 100% rename from pype/configurations/defaults/project_anatomy/roots.json rename to pype/settings/defaults/project_anatomy/roots.json diff --git a/pype/configurations/defaults/project_anatomy/templates.json b/pype/settings/defaults/project_anatomy/templates.json similarity index 100% rename from pype/configurations/defaults/project_anatomy/templates.json rename to pype/settings/defaults/project_anatomy/templates.json diff --git a/pype/configurations/defaults/project_configurations/ftrack/ftrack_config.json b/pype/settings/defaults/project_configurations/ftrack/ftrack_config.json similarity index 100% rename from pype/configurations/defaults/project_configurations/ftrack/ftrack_config.json rename to pype/settings/defaults/project_configurations/ftrack/ftrack_config.json diff --git a/pype/configurations/defaults/project_configurations/ftrack/ftrack_custom_attributes.json b/pype/settings/defaults/project_configurations/ftrack/ftrack_custom_attributes.json similarity index 100% rename from pype/configurations/defaults/project_configurations/ftrack/ftrack_custom_attributes.json rename to pype/settings/defaults/project_configurations/ftrack/ftrack_custom_attributes.json diff --git a/pype/configurations/defaults/project_configurations/ftrack/partnership_ftrack_cred.json b/pype/settings/defaults/project_configurations/ftrack/partnership_ftrack_cred.json similarity index 100% rename from pype/configurations/defaults/project_configurations/ftrack/partnership_ftrack_cred.json rename to pype/settings/defaults/project_configurations/ftrack/partnership_ftrack_cred.json diff --git a/pype/configurations/defaults/project_configurations/ftrack/plugins/server.json b/pype/settings/defaults/project_configurations/ftrack/plugins/server.json similarity index 100% rename from pype/configurations/defaults/project_configurations/ftrack/plugins/server.json rename to pype/settings/defaults/project_configurations/ftrack/plugins/server.json diff --git a/pype/configurations/defaults/project_configurations/ftrack/plugins/user.json b/pype/settings/defaults/project_configurations/ftrack/plugins/user.json similarity index 100% rename from pype/configurations/defaults/project_configurations/ftrack/plugins/user.json rename to pype/settings/defaults/project_configurations/ftrack/plugins/user.json diff --git a/pype/configurations/defaults/project_configurations/ftrack/project_defaults.json b/pype/settings/defaults/project_configurations/ftrack/project_defaults.json similarity index 100% rename from pype/configurations/defaults/project_configurations/ftrack/project_defaults.json rename to pype/settings/defaults/project_configurations/ftrack/project_defaults.json diff --git a/pype/configurations/defaults/project_configurations/global/creator.json b/pype/settings/defaults/project_configurations/global/creator.json similarity index 100% rename from pype/configurations/defaults/project_configurations/global/creator.json rename to pype/settings/defaults/project_configurations/global/creator.json diff --git a/pype/configurations/defaults/project_configurations/global/project_folder_structure.json b/pype/settings/defaults/project_configurations/global/project_folder_structure.json similarity index 100% rename from pype/configurations/defaults/project_configurations/global/project_folder_structure.json rename to pype/settings/defaults/project_configurations/global/project_folder_structure.json diff --git a/pype/configurations/defaults/project_configurations/global/sw_folders.json b/pype/settings/defaults/project_configurations/global/sw_folders.json similarity index 100% rename from pype/configurations/defaults/project_configurations/global/sw_folders.json rename to pype/settings/defaults/project_configurations/global/sw_folders.json diff --git a/pype/configurations/defaults/project_configurations/global/workfiles.json b/pype/settings/defaults/project_configurations/global/workfiles.json similarity index 100% rename from pype/configurations/defaults/project_configurations/global/workfiles.json rename to pype/settings/defaults/project_configurations/global/workfiles.json diff --git a/pype/configurations/defaults/project_configurations/maya/capture.json b/pype/settings/defaults/project_configurations/maya/capture.json similarity index 100% rename from pype/configurations/defaults/project_configurations/maya/capture.json rename to pype/settings/defaults/project_configurations/maya/capture.json diff --git a/pype/configurations/defaults/project_configurations/muster/templates_mapping.json b/pype/settings/defaults/project_configurations/muster/templates_mapping.json similarity index 100% rename from pype/configurations/defaults/project_configurations/muster/templates_mapping.json rename to pype/settings/defaults/project_configurations/muster/templates_mapping.json diff --git a/pype/configurations/defaults/project_configurations/plugins/celaction/publish.json b/pype/settings/defaults/project_configurations/plugins/celaction/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/celaction/publish.json rename to pype/settings/defaults/project_configurations/plugins/celaction/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/config.json b/pype/settings/defaults/project_configurations/plugins/config.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/config.json rename to pype/settings/defaults/project_configurations/plugins/config.json diff --git a/pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json b/pype/settings/defaults/project_configurations/plugins/ftrack/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/ftrack/publish.json rename to pype/settings/defaults/project_configurations/plugins/ftrack/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/create.json b/pype/settings/defaults/project_configurations/plugins/global/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/create.json rename to pype/settings/defaults/project_configurations/plugins/global/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/filter.json b/pype/settings/defaults/project_configurations/plugins/global/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/filter.json rename to pype/settings/defaults/project_configurations/plugins/global/filter.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/load.json b/pype/settings/defaults/project_configurations/plugins/global/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/load.json rename to pype/settings/defaults/project_configurations/plugins/global/load.json diff --git a/pype/configurations/defaults/project_configurations/plugins/global/publish.json b/pype/settings/defaults/project_configurations/plugins/global/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/global/publish.json rename to pype/settings/defaults/project_configurations/plugins/global/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/create.json b/pype/settings/defaults/project_configurations/plugins/maya/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/create.json rename to pype/settings/defaults/project_configurations/plugins/maya/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/filter.json b/pype/settings/defaults/project_configurations/plugins/maya/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/filter.json rename to pype/settings/defaults/project_configurations/plugins/maya/filter.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/load.json b/pype/settings/defaults/project_configurations/plugins/maya/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/load.json rename to pype/settings/defaults/project_configurations/plugins/maya/load.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/publish.json b/pype/settings/defaults/project_configurations/plugins/maya/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/publish.json rename to pype/settings/defaults/project_configurations/plugins/maya/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json b/pype/settings/defaults/project_configurations/plugins/maya/workfile_build.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/maya/workfile_build.json rename to pype/settings/defaults/project_configurations/plugins/maya/workfile_build.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/create.json b/pype/settings/defaults/project_configurations/plugins/nuke/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/create.json rename to pype/settings/defaults/project_configurations/plugins/nuke/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/load.json b/pype/settings/defaults/project_configurations/plugins/nuke/load.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/load.json rename to pype/settings/defaults/project_configurations/plugins/nuke/load.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/publish.json b/pype/settings/defaults/project_configurations/plugins/nuke/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/publish.json rename to pype/settings/defaults/project_configurations/plugins/nuke/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json b/pype/settings/defaults/project_configurations/plugins/nuke/workfile_build.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nuke/workfile_build.json rename to pype/settings/defaults/project_configurations/plugins/nuke/workfile_build.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json b/pype/settings/defaults/project_configurations/plugins/nukestudio/filter.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nukestudio/filter.json rename to pype/settings/defaults/project_configurations/plugins/nukestudio/filter.json diff --git a/pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json b/pype/settings/defaults/project_configurations/plugins/nukestudio/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/nukestudio/publish.json rename to pype/settings/defaults/project_configurations/plugins/nukestudio/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/resolve/create.json b/pype/settings/defaults/project_configurations/plugins/resolve/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/resolve/create.json rename to pype/settings/defaults/project_configurations/plugins/resolve/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json b/pype/settings/defaults/project_configurations/plugins/standalonepublisher/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/standalonepublisher/publish.json rename to pype/settings/defaults/project_configurations/plugins/standalonepublisher/publish.json diff --git a/pype/configurations/defaults/project_configurations/plugins/test/create.json b/pype/settings/defaults/project_configurations/plugins/test/create.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/test/create.json rename to pype/settings/defaults/project_configurations/plugins/test/create.json diff --git a/pype/configurations/defaults/project_configurations/plugins/test/publish.json b/pype/settings/defaults/project_configurations/plugins/test/publish.json similarity index 100% rename from pype/configurations/defaults/project_configurations/plugins/test/publish.json rename to pype/settings/defaults/project_configurations/plugins/test/publish.json diff --git a/pype/configurations/defaults/project_configurations/premiere/asset_default.json b/pype/settings/defaults/project_configurations/premiere/asset_default.json similarity index 100% rename from pype/configurations/defaults/project_configurations/premiere/asset_default.json rename to pype/settings/defaults/project_configurations/premiere/asset_default.json diff --git a/pype/configurations/defaults/project_configurations/premiere/rules_tasks.json b/pype/settings/defaults/project_configurations/premiere/rules_tasks.json similarity index 100% rename from pype/configurations/defaults/project_configurations/premiere/rules_tasks.json rename to pype/settings/defaults/project_configurations/premiere/rules_tasks.json diff --git a/pype/configurations/defaults/project_configurations/standalonepublisher/families.json b/pype/settings/defaults/project_configurations/standalonepublisher/families.json similarity index 100% rename from pype/configurations/defaults/project_configurations/standalonepublisher/families.json rename to pype/settings/defaults/project_configurations/standalonepublisher/families.json diff --git a/pype/configurations/defaults/project_configurations/tools/slates/example_HD.json b/pype/settings/defaults/project_configurations/tools/slates/example_HD.json similarity index 100% rename from pype/configurations/defaults/project_configurations/tools/slates/example_HD.json rename to pype/settings/defaults/project_configurations/tools/slates/example_HD.json diff --git a/pype/configurations/defaults/project_configurations/unreal/project_setup.json b/pype/settings/defaults/project_configurations/unreal/project_setup.json similarity index 100% rename from pype/configurations/defaults/project_configurations/unreal/project_setup.json rename to pype/settings/defaults/project_configurations/unreal/project_setup.json diff --git a/pype/configurations/defaults/system_configurations/environments/avalon.json b/pype/settings/defaults/system_configurations/environments/avalon.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/avalon.json rename to pype/settings/defaults/system_configurations/environments/avalon.json diff --git a/pype/configurations/defaults/system_configurations/environments/blender.json b/pype/settings/defaults/system_configurations/environments/blender.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/blender.json rename to pype/settings/defaults/system_configurations/environments/blender.json diff --git a/pype/configurations/defaults/system_configurations/environments/celaction.json b/pype/settings/defaults/system_configurations/environments/celaction.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/celaction.json rename to pype/settings/defaults/system_configurations/environments/celaction.json diff --git a/pype/configurations/defaults/system_configurations/environments/deadline.json b/pype/settings/defaults/system_configurations/environments/deadline.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/deadline.json rename to pype/settings/defaults/system_configurations/environments/deadline.json diff --git a/pype/configurations/defaults/system_configurations/environments/ftrack.json b/pype/settings/defaults/system_configurations/environments/ftrack.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/ftrack.json rename to pype/settings/defaults/system_configurations/environments/ftrack.json diff --git a/pype/configurations/defaults/system_configurations/environments/global.json b/pype/settings/defaults/system_configurations/environments/global.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/global.json rename to pype/settings/defaults/system_configurations/environments/global.json diff --git a/pype/configurations/defaults/system_configurations/environments/harmony.json b/pype/settings/defaults/system_configurations/environments/harmony.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/harmony.json rename to pype/settings/defaults/system_configurations/environments/harmony.json diff --git a/pype/configurations/defaults/system_configurations/environments/houdini.json b/pype/settings/defaults/system_configurations/environments/houdini.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/houdini.json rename to pype/settings/defaults/system_configurations/environments/houdini.json diff --git a/pype/configurations/defaults/system_configurations/environments/maya.json b/pype/settings/defaults/system_configurations/environments/maya.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/maya.json rename to pype/settings/defaults/system_configurations/environments/maya.json diff --git a/pype/configurations/defaults/system_configurations/environments/maya_2018.json b/pype/settings/defaults/system_configurations/environments/maya_2018.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/maya_2018.json rename to pype/settings/defaults/system_configurations/environments/maya_2018.json diff --git a/pype/configurations/defaults/system_configurations/environments/maya_2020.json b/pype/settings/defaults/system_configurations/environments/maya_2020.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/maya_2020.json rename to pype/settings/defaults/system_configurations/environments/maya_2020.json diff --git a/pype/configurations/defaults/system_configurations/environments/mayabatch.json b/pype/settings/defaults/system_configurations/environments/mayabatch.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/mayabatch.json rename to pype/settings/defaults/system_configurations/environments/mayabatch.json diff --git a/pype/configurations/defaults/system_configurations/environments/mayabatch_2019.json b/pype/settings/defaults/system_configurations/environments/mayabatch_2019.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/mayabatch_2019.json rename to pype/settings/defaults/system_configurations/environments/mayabatch_2019.json diff --git a/pype/configurations/defaults/system_configurations/environments/mtoa_3.1.1.json b/pype/settings/defaults/system_configurations/environments/mtoa_3.1.1.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/mtoa_3.1.1.json rename to pype/settings/defaults/system_configurations/environments/mtoa_3.1.1.json diff --git a/pype/configurations/defaults/system_configurations/environments/muster.json b/pype/settings/defaults/system_configurations/environments/muster.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/muster.json rename to pype/settings/defaults/system_configurations/environments/muster.json diff --git a/pype/configurations/defaults/system_configurations/environments/nuke.json b/pype/settings/defaults/system_configurations/environments/nuke.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/nuke.json rename to pype/settings/defaults/system_configurations/environments/nuke.json diff --git a/pype/configurations/defaults/system_configurations/environments/nukestudio.json b/pype/settings/defaults/system_configurations/environments/nukestudio.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/nukestudio.json rename to pype/settings/defaults/system_configurations/environments/nukestudio.json diff --git a/pype/configurations/defaults/system_configurations/environments/nukestudio_10.0.json b/pype/settings/defaults/system_configurations/environments/nukestudio_10.0.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/nukestudio_10.0.json rename to pype/settings/defaults/system_configurations/environments/nukestudio_10.0.json diff --git a/pype/configurations/defaults/system_configurations/environments/nukex.json b/pype/settings/defaults/system_configurations/environments/nukex.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/nukex.json rename to pype/settings/defaults/system_configurations/environments/nukex.json diff --git a/pype/configurations/defaults/system_configurations/environments/nukex_10.0.json b/pype/settings/defaults/system_configurations/environments/nukex_10.0.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/nukex_10.0.json rename to pype/settings/defaults/system_configurations/environments/nukex_10.0.json diff --git a/pype/configurations/defaults/system_configurations/environments/photoshop.json b/pype/settings/defaults/system_configurations/environments/photoshop.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/photoshop.json rename to pype/settings/defaults/system_configurations/environments/photoshop.json diff --git a/pype/configurations/defaults/system_configurations/environments/premiere.json b/pype/settings/defaults/system_configurations/environments/premiere.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/premiere.json rename to pype/settings/defaults/system_configurations/environments/premiere.json diff --git a/pype/configurations/defaults/system_configurations/environments/resolve.json b/pype/settings/defaults/system_configurations/environments/resolve.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/resolve.json rename to pype/settings/defaults/system_configurations/environments/resolve.json diff --git a/pype/configurations/defaults/system_configurations/environments/storyboardpro.json b/pype/settings/defaults/system_configurations/environments/storyboardpro.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/storyboardpro.json rename to pype/settings/defaults/system_configurations/environments/storyboardpro.json diff --git a/pype/configurations/defaults/system_configurations/environments/unreal_4.24.json b/pype/settings/defaults/system_configurations/environments/unreal_4.24.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/unreal_4.24.json rename to pype/settings/defaults/system_configurations/environments/unreal_4.24.json diff --git a/pype/configurations/defaults/system_configurations/environments/vray_4300.json b/pype/settings/defaults/system_configurations/environments/vray_4300.json similarity index 100% rename from pype/configurations/defaults/system_configurations/environments/vray_4300.json rename to pype/settings/defaults/system_configurations/environments/vray_4300.json diff --git a/pype/configurations/defaults/system_configurations/global/applications.json b/pype/settings/defaults/system_configurations/global/applications.json similarity index 100% rename from pype/configurations/defaults/system_configurations/global/applications.json rename to pype/settings/defaults/system_configurations/global/applications.json diff --git a/pype/configurations/defaults/system_configurations/global/intent.json b/pype/settings/defaults/system_configurations/global/intent.json similarity index 100% rename from pype/configurations/defaults/system_configurations/global/intent.json rename to pype/settings/defaults/system_configurations/global/intent.json diff --git a/pype/configurations/defaults/system_configurations/global/tools.json b/pype/settings/defaults/system_configurations/global/tools.json similarity index 100% rename from pype/configurations/defaults/system_configurations/global/tools.json rename to pype/settings/defaults/system_configurations/global/tools.json diff --git a/pype/configurations/defaults/system_configurations/global/tray_modules.json b/pype/settings/defaults/system_configurations/global/tray_modules.json similarity index 100% rename from pype/configurations/defaults/system_configurations/global/tray_modules.json rename to pype/settings/defaults/system_configurations/global/tray_modules.json diff --git a/pype/configurations/defaults/system_configurations/launchers/blender_2.80.toml b/pype/settings/defaults/system_configurations/launchers/blender_2.80.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/blender_2.80.toml rename to pype/settings/defaults/system_configurations/launchers/blender_2.80.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/blender_2.81.toml b/pype/settings/defaults/system_configurations/launchers/blender_2.81.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/blender_2.81.toml rename to pype/settings/defaults/system_configurations/launchers/blender_2.81.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/blender_2.82.toml b/pype/settings/defaults/system_configurations/launchers/blender_2.82.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/blender_2.82.toml rename to pype/settings/defaults/system_configurations/launchers/blender_2.82.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/blender_2.83.toml b/pype/settings/defaults/system_configurations/launchers/blender_2.83.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/blender_2.83.toml rename to pype/settings/defaults/system_configurations/launchers/blender_2.83.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/celaction_local.toml b/pype/settings/defaults/system_configurations/launchers/celaction_local.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/celaction_local.toml rename to pype/settings/defaults/system_configurations/launchers/celaction_local.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/celaction_publish.toml b/pype/settings/defaults/system_configurations/launchers/celaction_publish.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/celaction_publish.toml rename to pype/settings/defaults/system_configurations/launchers/celaction_publish.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/darwin/blender_2.82 b/pype/settings/defaults/system_configurations/launchers/darwin/blender_2.82 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/darwin/blender_2.82 rename to pype/settings/defaults/system_configurations/launchers/darwin/blender_2.82 diff --git a/pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17 b/pype/settings/defaults/system_configurations/launchers/darwin/harmony_17 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17 rename to pype/settings/defaults/system_configurations/launchers/darwin/harmony_17 diff --git a/pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17_launch b/pype/settings/defaults/system_configurations/launchers/darwin/harmony_17_launch similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/darwin/harmony_17_launch rename to pype/settings/defaults/system_configurations/launchers/darwin/harmony_17_launch diff --git a/pype/configurations/defaults/system_configurations/launchers/darwin/python3 b/pype/settings/defaults/system_configurations/launchers/darwin/python3 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/darwin/python3 rename to pype/settings/defaults/system_configurations/launchers/darwin/python3 diff --git a/pype/configurations/defaults/system_configurations/launchers/harmony_17.toml b/pype/settings/defaults/system_configurations/launchers/harmony_17.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/harmony_17.toml rename to pype/settings/defaults/system_configurations/launchers/harmony_17.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/houdini_16.toml b/pype/settings/defaults/system_configurations/launchers/houdini_16.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/houdini_16.toml rename to pype/settings/defaults/system_configurations/launchers/houdini_16.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/houdini_17.toml b/pype/settings/defaults/system_configurations/launchers/houdini_17.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/houdini_17.toml rename to pype/settings/defaults/system_configurations/launchers/houdini_17.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/houdini_18.toml b/pype/settings/defaults/system_configurations/launchers/houdini_18.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/houdini_18.toml rename to pype/settings/defaults/system_configurations/launchers/houdini_18.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/maya2016 b/pype/settings/defaults/system_configurations/launchers/linux/maya2016 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/maya2016 rename to pype/settings/defaults/system_configurations/launchers/linux/maya2016 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/maya2017 b/pype/settings/defaults/system_configurations/launchers/linux/maya2017 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/maya2017 rename to pype/settings/defaults/system_configurations/launchers/linux/maya2017 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/maya2018 b/pype/settings/defaults/system_configurations/launchers/linux/maya2018 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/maya2018 rename to pype/settings/defaults/system_configurations/launchers/linux/maya2018 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/maya2019 b/pype/settings/defaults/system_configurations/launchers/linux/maya2019 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/maya2019 rename to pype/settings/defaults/system_configurations/launchers/linux/maya2019 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/maya2020 b/pype/settings/defaults/system_configurations/launchers/linux/maya2020 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/maya2020 rename to pype/settings/defaults/system_configurations/launchers/linux/maya2020 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/nuke11.3 b/pype/settings/defaults/system_configurations/launchers/linux/nuke11.3 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/nuke11.3 rename to pype/settings/defaults/system_configurations/launchers/linux/nuke11.3 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/nuke12.0 b/pype/settings/defaults/system_configurations/launchers/linux/nuke12.0 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/nuke12.0 rename to pype/settings/defaults/system_configurations/launchers/linux/nuke12.0 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/nukestudio11.3 b/pype/settings/defaults/system_configurations/launchers/linux/nukestudio11.3 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/nukestudio11.3 rename to pype/settings/defaults/system_configurations/launchers/linux/nukestudio11.3 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/nukestudio12.0 b/pype/settings/defaults/system_configurations/launchers/linux/nukestudio12.0 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/nukestudio12.0 rename to pype/settings/defaults/system_configurations/launchers/linux/nukestudio12.0 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/nukex11.3 b/pype/settings/defaults/system_configurations/launchers/linux/nukex11.3 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/nukex11.3 rename to pype/settings/defaults/system_configurations/launchers/linux/nukex11.3 diff --git a/pype/configurations/defaults/system_configurations/launchers/linux/nukex12.0 b/pype/settings/defaults/system_configurations/launchers/linux/nukex12.0 similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/linux/nukex12.0 rename to pype/settings/defaults/system_configurations/launchers/linux/nukex12.0 diff --git a/pype/configurations/defaults/system_configurations/launchers/maya_2016.toml b/pype/settings/defaults/system_configurations/launchers/maya_2016.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/maya_2016.toml rename to pype/settings/defaults/system_configurations/launchers/maya_2016.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/maya_2017.toml b/pype/settings/defaults/system_configurations/launchers/maya_2017.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/maya_2017.toml rename to pype/settings/defaults/system_configurations/launchers/maya_2017.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/maya_2018.toml b/pype/settings/defaults/system_configurations/launchers/maya_2018.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/maya_2018.toml rename to pype/settings/defaults/system_configurations/launchers/maya_2018.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/maya_2019.toml b/pype/settings/defaults/system_configurations/launchers/maya_2019.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/maya_2019.toml rename to pype/settings/defaults/system_configurations/launchers/maya_2019.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/maya_2020.toml b/pype/settings/defaults/system_configurations/launchers/maya_2020.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/maya_2020.toml rename to pype/settings/defaults/system_configurations/launchers/maya_2020.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/mayabatch_2019.toml b/pype/settings/defaults/system_configurations/launchers/mayabatch_2019.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/mayabatch_2019.toml rename to pype/settings/defaults/system_configurations/launchers/mayabatch_2019.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/mayabatch_2020.toml b/pype/settings/defaults/system_configurations/launchers/mayabatch_2020.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/mayabatch_2020.toml rename to pype/settings/defaults/system_configurations/launchers/mayabatch_2020.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/mayapy2016.toml b/pype/settings/defaults/system_configurations/launchers/mayapy2016.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/mayapy2016.toml rename to pype/settings/defaults/system_configurations/launchers/mayapy2016.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/mayapy2017.toml b/pype/settings/defaults/system_configurations/launchers/mayapy2017.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/mayapy2017.toml rename to pype/settings/defaults/system_configurations/launchers/mayapy2017.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/mayapy2018.toml b/pype/settings/defaults/system_configurations/launchers/mayapy2018.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/mayapy2018.toml rename to pype/settings/defaults/system_configurations/launchers/mayapy2018.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/mayapy2019.toml b/pype/settings/defaults/system_configurations/launchers/mayapy2019.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/mayapy2019.toml rename to pype/settings/defaults/system_configurations/launchers/mayapy2019.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/mayapy2020.toml b/pype/settings/defaults/system_configurations/launchers/mayapy2020.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/mayapy2020.toml rename to pype/settings/defaults/system_configurations/launchers/mayapy2020.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/myapp.toml b/pype/settings/defaults/system_configurations/launchers/myapp.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/myapp.toml rename to pype/settings/defaults/system_configurations/launchers/myapp.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nuke_10.0.toml b/pype/settings/defaults/system_configurations/launchers/nuke_10.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nuke_10.0.toml rename to pype/settings/defaults/system_configurations/launchers/nuke_10.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nuke_11.0.toml b/pype/settings/defaults/system_configurations/launchers/nuke_11.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nuke_11.0.toml rename to pype/settings/defaults/system_configurations/launchers/nuke_11.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nuke_11.2.toml b/pype/settings/defaults/system_configurations/launchers/nuke_11.2.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nuke_11.2.toml rename to pype/settings/defaults/system_configurations/launchers/nuke_11.2.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nuke_11.3.toml b/pype/settings/defaults/system_configurations/launchers/nuke_11.3.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nuke_11.3.toml rename to pype/settings/defaults/system_configurations/launchers/nuke_11.3.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nuke_12.0.toml b/pype/settings/defaults/system_configurations/launchers/nuke_12.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nuke_12.0.toml rename to pype/settings/defaults/system_configurations/launchers/nuke_12.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukestudio_10.0.toml b/pype/settings/defaults/system_configurations/launchers/nukestudio_10.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukestudio_10.0.toml rename to pype/settings/defaults/system_configurations/launchers/nukestudio_10.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukestudio_11.0.toml b/pype/settings/defaults/system_configurations/launchers/nukestudio_11.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukestudio_11.0.toml rename to pype/settings/defaults/system_configurations/launchers/nukestudio_11.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukestudio_11.2.toml b/pype/settings/defaults/system_configurations/launchers/nukestudio_11.2.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukestudio_11.2.toml rename to pype/settings/defaults/system_configurations/launchers/nukestudio_11.2.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukestudio_11.3.toml b/pype/settings/defaults/system_configurations/launchers/nukestudio_11.3.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukestudio_11.3.toml rename to pype/settings/defaults/system_configurations/launchers/nukestudio_11.3.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukestudio_12.0.toml b/pype/settings/defaults/system_configurations/launchers/nukestudio_12.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukestudio_12.0.toml rename to pype/settings/defaults/system_configurations/launchers/nukestudio_12.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukex_10.0.toml b/pype/settings/defaults/system_configurations/launchers/nukex_10.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukex_10.0.toml rename to pype/settings/defaults/system_configurations/launchers/nukex_10.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukex_11.0.toml b/pype/settings/defaults/system_configurations/launchers/nukex_11.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukex_11.0.toml rename to pype/settings/defaults/system_configurations/launchers/nukex_11.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukex_11.2.toml b/pype/settings/defaults/system_configurations/launchers/nukex_11.2.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukex_11.2.toml rename to pype/settings/defaults/system_configurations/launchers/nukex_11.2.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukex_11.3.toml b/pype/settings/defaults/system_configurations/launchers/nukex_11.3.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukex_11.3.toml rename to pype/settings/defaults/system_configurations/launchers/nukex_11.3.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/nukex_12.0.toml b/pype/settings/defaults/system_configurations/launchers/nukex_12.0.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/nukex_12.0.toml rename to pype/settings/defaults/system_configurations/launchers/nukex_12.0.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/photoshop_2020.toml b/pype/settings/defaults/system_configurations/launchers/photoshop_2020.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/photoshop_2020.toml rename to pype/settings/defaults/system_configurations/launchers/photoshop_2020.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/premiere_2019.toml b/pype/settings/defaults/system_configurations/launchers/premiere_2019.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/premiere_2019.toml rename to pype/settings/defaults/system_configurations/launchers/premiere_2019.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/premiere_2020.toml b/pype/settings/defaults/system_configurations/launchers/premiere_2020.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/premiere_2020.toml rename to pype/settings/defaults/system_configurations/launchers/premiere_2020.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/python_2.toml b/pype/settings/defaults/system_configurations/launchers/python_2.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/python_2.toml rename to pype/settings/defaults/system_configurations/launchers/python_2.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/python_3.toml b/pype/settings/defaults/system_configurations/launchers/python_3.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/python_3.toml rename to pype/settings/defaults/system_configurations/launchers/python_3.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/resolve_16.toml b/pype/settings/defaults/system_configurations/launchers/resolve_16.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/resolve_16.toml rename to pype/settings/defaults/system_configurations/launchers/resolve_16.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/shell.toml b/pype/settings/defaults/system_configurations/launchers/shell.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/shell.toml rename to pype/settings/defaults/system_configurations/launchers/shell.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/storyboardpro_7.toml b/pype/settings/defaults/system_configurations/launchers/storyboardpro_7.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/storyboardpro_7.toml rename to pype/settings/defaults/system_configurations/launchers/storyboardpro_7.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/unreal_4.24.toml b/pype/settings/defaults/system_configurations/launchers/unreal_4.24.toml similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/unreal_4.24.toml rename to pype/settings/defaults/system_configurations/launchers/unreal_4.24.toml diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.80.bat b/pype/settings/defaults/system_configurations/launchers/windows/blender_2.80.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/blender_2.80.bat rename to pype/settings/defaults/system_configurations/launchers/windows/blender_2.80.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.81.bat b/pype/settings/defaults/system_configurations/launchers/windows/blender_2.81.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/blender_2.81.bat rename to pype/settings/defaults/system_configurations/launchers/windows/blender_2.81.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.82.bat b/pype/settings/defaults/system_configurations/launchers/windows/blender_2.82.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/blender_2.82.bat rename to pype/settings/defaults/system_configurations/launchers/windows/blender_2.82.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/blender_2.83.bat b/pype/settings/defaults/system_configurations/launchers/windows/blender_2.83.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/blender_2.83.bat rename to pype/settings/defaults/system_configurations/launchers/windows/blender_2.83.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/celaction_local.bat b/pype/settings/defaults/system_configurations/launchers/windows/celaction_local.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/celaction_local.bat rename to pype/settings/defaults/system_configurations/launchers/windows/celaction_local.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/celaction_publish.bat b/pype/settings/defaults/system_configurations/launchers/windows/celaction_publish.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/celaction_publish.bat rename to pype/settings/defaults/system_configurations/launchers/windows/celaction_publish.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/harmony_17.bat b/pype/settings/defaults/system_configurations/launchers/windows/harmony_17.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/harmony_17.bat rename to pype/settings/defaults/system_configurations/launchers/windows/harmony_17.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/houdini_16.bat b/pype/settings/defaults/system_configurations/launchers/windows/houdini_16.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/houdini_16.bat rename to pype/settings/defaults/system_configurations/launchers/windows/houdini_16.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/houdini_17.bat b/pype/settings/defaults/system_configurations/launchers/windows/houdini_17.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/houdini_17.bat rename to pype/settings/defaults/system_configurations/launchers/windows/houdini_17.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/houdini_18.bat b/pype/settings/defaults/system_configurations/launchers/windows/houdini_18.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/houdini_18.bat rename to pype/settings/defaults/system_configurations/launchers/windows/houdini_18.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/maya2016.bat b/pype/settings/defaults/system_configurations/launchers/windows/maya2016.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/maya2016.bat rename to pype/settings/defaults/system_configurations/launchers/windows/maya2016.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/maya2017.bat b/pype/settings/defaults/system_configurations/launchers/windows/maya2017.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/maya2017.bat rename to pype/settings/defaults/system_configurations/launchers/windows/maya2017.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/maya2018.bat b/pype/settings/defaults/system_configurations/launchers/windows/maya2018.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/maya2018.bat rename to pype/settings/defaults/system_configurations/launchers/windows/maya2018.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/maya2019.bat b/pype/settings/defaults/system_configurations/launchers/windows/maya2019.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/maya2019.bat rename to pype/settings/defaults/system_configurations/launchers/windows/maya2019.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/maya2020.bat b/pype/settings/defaults/system_configurations/launchers/windows/maya2020.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/maya2020.bat rename to pype/settings/defaults/system_configurations/launchers/windows/maya2020.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2019.bat b/pype/settings/defaults/system_configurations/launchers/windows/mayabatch2019.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2019.bat rename to pype/settings/defaults/system_configurations/launchers/windows/mayabatch2019.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2020.bat b/pype/settings/defaults/system_configurations/launchers/windows/mayabatch2020.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/mayabatch2020.bat rename to pype/settings/defaults/system_configurations/launchers/windows/mayabatch2020.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2016.bat b/pype/settings/defaults/system_configurations/launchers/windows/mayapy2016.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/mayapy2016.bat rename to pype/settings/defaults/system_configurations/launchers/windows/mayapy2016.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2017.bat b/pype/settings/defaults/system_configurations/launchers/windows/mayapy2017.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/mayapy2017.bat rename to pype/settings/defaults/system_configurations/launchers/windows/mayapy2017.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2018.bat b/pype/settings/defaults/system_configurations/launchers/windows/mayapy2018.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/mayapy2018.bat rename to pype/settings/defaults/system_configurations/launchers/windows/mayapy2018.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2019.bat b/pype/settings/defaults/system_configurations/launchers/windows/mayapy2019.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/mayapy2019.bat rename to pype/settings/defaults/system_configurations/launchers/windows/mayapy2019.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/mayapy2020.bat b/pype/settings/defaults/system_configurations/launchers/windows/mayapy2020.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/mayapy2020.bat rename to pype/settings/defaults/system_configurations/launchers/windows/mayapy2020.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nuke10.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nuke10.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nuke10.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nuke10.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nuke11.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nuke11.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nuke11.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nuke11.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nuke11.2.bat b/pype/settings/defaults/system_configurations/launchers/windows/nuke11.2.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nuke11.2.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nuke11.2.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nuke11.3.bat b/pype/settings/defaults/system_configurations/launchers/windows/nuke11.3.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nuke11.3.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nuke11.3.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nuke12.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nuke12.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nuke12.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nuke12.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio10.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukestudio10.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukestudio10.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukestudio10.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.2.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.2.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.2.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.2.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.3.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.3.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukestudio11.3.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.3.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukestudio12.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukestudio12.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukestudio12.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukestudio12.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukex10.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukex10.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukex10.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukex10.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukex11.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukex11.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukex11.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukex11.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukex11.2.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukex11.2.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukex11.2.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukex11.2.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukex11.3.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukex11.3.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukex11.3.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukex11.3.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/nukex12.0.bat b/pype/settings/defaults/system_configurations/launchers/windows/nukex12.0.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/nukex12.0.bat rename to pype/settings/defaults/system_configurations/launchers/windows/nukex12.0.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/photoshop_2020.bat b/pype/settings/defaults/system_configurations/launchers/windows/photoshop_2020.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/photoshop_2020.bat rename to pype/settings/defaults/system_configurations/launchers/windows/photoshop_2020.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat b/pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat rename to pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat b/pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat rename to pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/python3.bat b/pype/settings/defaults/system_configurations/launchers/windows/python3.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/python3.bat rename to pype/settings/defaults/system_configurations/launchers/windows/python3.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/resolve_16.bat b/pype/settings/defaults/system_configurations/launchers/windows/resolve_16.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/resolve_16.bat rename to pype/settings/defaults/system_configurations/launchers/windows/resolve_16.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/shell.bat b/pype/settings/defaults/system_configurations/launchers/windows/shell.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/shell.bat rename to pype/settings/defaults/system_configurations/launchers/windows/shell.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/storyboardpro_7.bat b/pype/settings/defaults/system_configurations/launchers/windows/storyboardpro_7.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/storyboardpro_7.bat rename to pype/settings/defaults/system_configurations/launchers/windows/storyboardpro_7.bat diff --git a/pype/configurations/defaults/system_configurations/launchers/windows/unreal.bat b/pype/settings/defaults/system_configurations/launchers/windows/unreal.bat similarity index 100% rename from pype/configurations/defaults/system_configurations/launchers/windows/unreal.bat rename to pype/settings/defaults/system_configurations/launchers/windows/unreal.bat diff --git a/pype/configurations/defaults/system_configurations/muster/templates_mapping.json b/pype/settings/defaults/system_configurations/muster/templates_mapping.json similarity index 100% rename from pype/configurations/defaults/system_configurations/muster/templates_mapping.json rename to pype/settings/defaults/system_configurations/muster/templates_mapping.json diff --git a/pype/configurations/defaults/system_configurations/standalone_publish/families.json b/pype/settings/defaults/system_configurations/standalone_publish/families.json similarity index 100% rename from pype/configurations/defaults/system_configurations/standalone_publish/families.json rename to pype/settings/defaults/system_configurations/standalone_publish/families.json diff --git a/pype/configurations/lib.py b/pype/settings/lib.py similarity index 100% rename from pype/configurations/lib.py rename to pype/settings/lib.py From 148ec89e94909e7bf08884999bf0ec5f801c2d54 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:23:45 +0200 Subject: [PATCH 471/507] fix few imports --- pype/tools/settings/settings/widgets/base.py | 4 ++-- pype/tools/settings/settings/widgets/lib.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index e1d167a9f2..6a7a65cb0f 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -1,8 +1,8 @@ import os import json from Qt import QtWidgets, QtCore, QtGui -from pype.configurations.lib import ( - SYSTEM_CONFIGURATIONS_KEY, +from pype.settings.lib import ( + SYSTEM_SETTINGS_KEY, SYSTEM_SETTINGS_PATH, PROJECT_SETTINGS_KEY, PROJECT_SETTINGS_PATH, diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 9f54b090cb..0c3f01cef1 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -1,7 +1,7 @@ import os import json import copy -from pype.configurations.lib import OVERRIDEN_KEY +from pype.settings.lib import OVERRIDEN_KEY from queue import Queue From d0859f4b60077f8a3886225dd81648edf39cd0ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:24:30 +0200 Subject: [PATCH 472/507] renamed folders in defaults --- .../ftrack/ftrack_config.json | 0 .../ftrack/ftrack_custom_attributes.json | 0 .../ftrack/partnership_ftrack_cred.json | 0 .../ftrack/plugins/server.json | 0 .../ftrack/plugins/user.json | 0 .../ftrack/project_defaults.json | 0 .../global/creator.json | 0 .../global/project_folder_structure.json | 0 .../global/sw_folders.json | 0 .../global/workfiles.json | 0 .../maya/capture.json | 0 .../muster/templates_mapping.json | 0 .../plugins/celaction/publish.json | 0 .../plugins/config.json | 0 .../plugins/ftrack/publish.json | 0 .../plugins/global/create.json | 0 .../plugins/global/filter.json | 0 .../plugins/global/load.json | 0 .../plugins/global/publish.json | 0 .../plugins/maya/create.json | 0 .../plugins/maya/filter.json | 0 .../plugins/maya/load.json | 0 .../plugins/maya/publish.json | 0 .../plugins/maya/workfile_build.json | 0 .../plugins/nuke/create.json | 0 .../plugins/nuke/load.json | 0 .../plugins/nuke/publish.json | 0 .../plugins/nuke/workfile_build.json | 0 .../plugins/nukestudio/filter.json | 0 .../plugins/nukestudio/publish.json | 0 .../plugins/resolve/create.json | 0 .../plugins/standalonepublisher/publish.json | 0 .../plugins/test/create.json | 0 .../plugins/test/publish.json | 0 .../premiere/asset_default.json | 0 .../premiere/rules_tasks.json | 0 .../standalonepublisher/families.json | 0 .../tools/slates/example_HD.json | 0 .../unreal/project_setup.json | 0 .../environments/avalon.json | 0 .../environments/blender.json | 0 .../environments/celaction.json | 0 .../environments/deadline.json | 0 .../environments/ftrack.json | 0 .../environments/global.json | 0 .../environments/harmony.json | 0 .../environments/houdini.json | 0 .../environments/maya.json | 0 .../environments/maya_2018.json | 0 .../environments/maya_2020.json | 0 .../environments/mayabatch.json | 0 .../environments/mayabatch_2019.json | 0 .../environments/mtoa_3.1.1.json | 0 .../environments/muster.json | 0 .../environments/nuke.json | 0 .../environments/nukestudio.json | 0 .../environments/nukestudio_10.0.json | 0 .../environments/nukex.json | 0 .../environments/nukex_10.0.json | 0 .../environments/photoshop.json | 0 .../environments/premiere.json | 0 .../environments/resolve.json | 0 .../environments/storyboardpro.json | 0 .../environments/unreal_4.24.json | 0 .../environments/vray_4300.json | 0 .../global/applications.json | 0 .../{system_configurations => system_settings}/global/intent.json | 0 .../{system_configurations => system_settings}/global/tools.json | 0 .../global/tray_modules.json | 0 .../launchers/blender_2.80.toml | 0 .../launchers/blender_2.81.toml | 0 .../launchers/blender_2.82.toml | 0 .../launchers/blender_2.83.toml | 0 .../launchers/celaction_local.toml | 0 .../launchers/celaction_publish.toml | 0 .../launchers/darwin/blender_2.82 | 0 .../launchers/darwin/harmony_17 | 0 .../launchers/darwin/harmony_17_launch | 0 .../launchers/darwin/python3 | 0 .../launchers/harmony_17.toml | 0 .../launchers/houdini_16.toml | 0 .../launchers/houdini_17.toml | 0 .../launchers/houdini_18.toml | 0 .../launchers/linux/maya2016 | 0 .../launchers/linux/maya2017 | 0 .../launchers/linux/maya2018 | 0 .../launchers/linux/maya2019 | 0 .../launchers/linux/maya2020 | 0 .../launchers/linux/nuke11.3 | 0 .../launchers/linux/nuke12.0 | 0 .../launchers/linux/nukestudio11.3 | 0 .../launchers/linux/nukestudio12.0 | 0 .../launchers/linux/nukex11.3 | 0 .../launchers/linux/nukex12.0 | 0 .../launchers/maya_2016.toml | 0 .../launchers/maya_2017.toml | 0 .../launchers/maya_2018.toml | 0 .../launchers/maya_2019.toml | 0 .../launchers/maya_2020.toml | 0 .../launchers/mayabatch_2019.toml | 0 .../launchers/mayabatch_2020.toml | 0 .../launchers/mayapy2016.toml | 0 .../launchers/mayapy2017.toml | 0 .../launchers/mayapy2018.toml | 0 .../launchers/mayapy2019.toml | 0 .../launchers/mayapy2020.toml | 0 .../launchers/myapp.toml | 0 .../launchers/nuke_10.0.toml | 0 .../launchers/nuke_11.0.toml | 0 .../launchers/nuke_11.2.toml | 0 .../launchers/nuke_11.3.toml | 0 .../launchers/nuke_12.0.toml | 0 .../launchers/nukestudio_10.0.toml | 0 .../launchers/nukestudio_11.0.toml | 0 .../launchers/nukestudio_11.2.toml | 0 .../launchers/nukestudio_11.3.toml | 0 .../launchers/nukestudio_12.0.toml | 0 .../launchers/nukex_10.0.toml | 0 .../launchers/nukex_11.0.toml | 0 .../launchers/nukex_11.2.toml | 0 .../launchers/nukex_11.3.toml | 0 .../launchers/nukex_12.0.toml | 0 .../launchers/photoshop_2020.toml | 0 .../launchers/premiere_2019.toml | 0 .../launchers/premiere_2020.toml | 0 .../launchers/python_2.toml | 0 .../launchers/python_3.toml | 0 .../launchers/resolve_16.toml | 0 .../launchers/shell.toml | 0 .../launchers/storyboardpro_7.toml | 0 .../launchers/unreal_4.24.toml | 0 .../launchers/windows/blender_2.80.bat | 0 .../launchers/windows/blender_2.81.bat | 0 .../launchers/windows/blender_2.82.bat | 0 .../launchers/windows/blender_2.83.bat | 0 .../launchers/windows/celaction_local.bat | 0 .../launchers/windows/celaction_publish.bat | 0 .../launchers/windows/harmony_17.bat | 0 .../launchers/windows/houdini_16.bat | 0 .../launchers/windows/houdini_17.bat | 0 .../launchers/windows/houdini_18.bat | 0 .../launchers/windows/maya2016.bat | 0 .../launchers/windows/maya2017.bat | 0 .../launchers/windows/maya2018.bat | 0 .../launchers/windows/maya2019.bat | 0 .../launchers/windows/maya2020.bat | 0 .../launchers/windows/mayabatch2019.bat | 0 .../launchers/windows/mayabatch2020.bat | 0 .../launchers/windows/mayapy2016.bat | 0 .../launchers/windows/mayapy2017.bat | 0 .../launchers/windows/mayapy2018.bat | 0 .../launchers/windows/mayapy2019.bat | 0 .../launchers/windows/mayapy2020.bat | 0 .../launchers/windows/nuke10.0.bat | 0 .../launchers/windows/nuke11.0.bat | 0 .../launchers/windows/nuke11.2.bat | 0 .../launchers/windows/nuke11.3.bat | 0 .../launchers/windows/nuke12.0.bat | 0 .../launchers/windows/nukestudio10.0.bat | 0 .../launchers/windows/nukestudio11.0.bat | 0 .../launchers/windows/nukestudio11.2.bat | 0 .../launchers/windows/nukestudio11.3.bat | 0 .../launchers/windows/nukestudio12.0.bat | 0 .../launchers/windows/nukex10.0.bat | 0 .../launchers/windows/nukex11.0.bat | 0 .../launchers/windows/nukex11.2.bat | 0 .../launchers/windows/nukex11.3.bat | 0 .../launchers/windows/nukex12.0.bat | 0 .../launchers/windows/photoshop_2020.bat | 0 .../launchers/windows/premiere_pro_2019.bat | 0 .../launchers/windows/premiere_pro_2020.bat | 0 .../launchers/windows/python3.bat | 0 .../launchers/windows/resolve_16.bat | 0 .../launchers/windows/shell.bat | 0 .../launchers/windows/storyboardpro_7.bat | 0 .../launchers/windows/unreal.bat | 0 .../muster/templates_mapping.json | 0 .../standalone_publish/families.json | 0 178 files changed, 0 insertions(+), 0 deletions(-) rename pype/settings/defaults/{project_configurations => project_settings}/ftrack/ftrack_config.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/ftrack/ftrack_custom_attributes.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/ftrack/partnership_ftrack_cred.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/ftrack/plugins/server.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/ftrack/plugins/user.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/ftrack/project_defaults.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/global/creator.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/global/project_folder_structure.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/global/sw_folders.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/global/workfiles.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/maya/capture.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/muster/templates_mapping.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/celaction/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/config.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/ftrack/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/global/create.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/global/filter.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/global/load.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/global/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/maya/create.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/maya/filter.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/maya/load.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/maya/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/maya/workfile_build.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/nuke/create.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/nuke/load.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/nuke/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/nuke/workfile_build.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/nukestudio/filter.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/nukestudio/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/resolve/create.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/standalonepublisher/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/test/create.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/plugins/test/publish.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/premiere/asset_default.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/premiere/rules_tasks.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/standalonepublisher/families.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/tools/slates/example_HD.json (100%) rename pype/settings/defaults/{project_configurations => project_settings}/unreal/project_setup.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/avalon.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/blender.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/celaction.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/deadline.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/ftrack.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/global.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/harmony.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/houdini.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/maya.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/maya_2018.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/maya_2020.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/mayabatch.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/mayabatch_2019.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/mtoa_3.1.1.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/muster.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/nuke.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/nukestudio.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/nukestudio_10.0.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/nukex.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/nukex_10.0.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/photoshop.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/premiere.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/resolve.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/storyboardpro.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/unreal_4.24.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/environments/vray_4300.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/global/applications.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/global/intent.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/global/tools.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/global/tray_modules.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/blender_2.80.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/blender_2.81.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/blender_2.82.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/blender_2.83.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/celaction_local.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/celaction_publish.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/darwin/blender_2.82 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/darwin/harmony_17 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/darwin/harmony_17_launch (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/darwin/python3 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/harmony_17.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/houdini_16.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/houdini_17.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/houdini_18.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/maya2016 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/maya2017 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/maya2018 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/maya2019 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/maya2020 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/nuke11.3 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/nuke12.0 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/nukestudio11.3 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/nukestudio12.0 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/nukex11.3 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/linux/nukex12.0 (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/maya_2016.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/maya_2017.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/maya_2018.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/maya_2019.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/maya_2020.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/mayabatch_2019.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/mayabatch_2020.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/mayapy2016.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/mayapy2017.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/mayapy2018.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/mayapy2019.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/mayapy2020.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/myapp.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nuke_10.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nuke_11.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nuke_11.2.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nuke_11.3.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nuke_12.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukestudio_10.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukestudio_11.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukestudio_11.2.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukestudio_11.3.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukestudio_12.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukex_10.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukex_11.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukex_11.2.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukex_11.3.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/nukex_12.0.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/photoshop_2020.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/premiere_2019.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/premiere_2020.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/python_2.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/python_3.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/resolve_16.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/shell.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/storyboardpro_7.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/unreal_4.24.toml (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/blender_2.80.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/blender_2.81.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/blender_2.82.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/blender_2.83.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/celaction_local.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/celaction_publish.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/harmony_17.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/houdini_16.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/houdini_17.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/houdini_18.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/maya2016.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/maya2017.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/maya2018.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/maya2019.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/maya2020.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/mayabatch2019.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/mayabatch2020.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/mayapy2016.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/mayapy2017.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/mayapy2018.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/mayapy2019.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/mayapy2020.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nuke10.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nuke11.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nuke11.2.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nuke11.3.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nuke12.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukestudio10.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukestudio11.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukestudio11.2.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukestudio11.3.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukestudio12.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukex10.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukex11.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukex11.2.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukex11.3.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/nukex12.0.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/photoshop_2020.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/premiere_pro_2019.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/premiere_pro_2020.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/python3.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/resolve_16.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/shell.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/storyboardpro_7.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/launchers/windows/unreal.bat (100%) rename pype/settings/defaults/{system_configurations => system_settings}/muster/templates_mapping.json (100%) rename pype/settings/defaults/{system_configurations => system_settings}/standalone_publish/families.json (100%) diff --git a/pype/settings/defaults/project_configurations/ftrack/ftrack_config.json b/pype/settings/defaults/project_settings/ftrack/ftrack_config.json similarity index 100% rename from pype/settings/defaults/project_configurations/ftrack/ftrack_config.json rename to pype/settings/defaults/project_settings/ftrack/ftrack_config.json diff --git a/pype/settings/defaults/project_configurations/ftrack/ftrack_custom_attributes.json b/pype/settings/defaults/project_settings/ftrack/ftrack_custom_attributes.json similarity index 100% rename from pype/settings/defaults/project_configurations/ftrack/ftrack_custom_attributes.json rename to pype/settings/defaults/project_settings/ftrack/ftrack_custom_attributes.json diff --git a/pype/settings/defaults/project_configurations/ftrack/partnership_ftrack_cred.json b/pype/settings/defaults/project_settings/ftrack/partnership_ftrack_cred.json similarity index 100% rename from pype/settings/defaults/project_configurations/ftrack/partnership_ftrack_cred.json rename to pype/settings/defaults/project_settings/ftrack/partnership_ftrack_cred.json diff --git a/pype/settings/defaults/project_configurations/ftrack/plugins/server.json b/pype/settings/defaults/project_settings/ftrack/plugins/server.json similarity index 100% rename from pype/settings/defaults/project_configurations/ftrack/plugins/server.json rename to pype/settings/defaults/project_settings/ftrack/plugins/server.json diff --git a/pype/settings/defaults/project_configurations/ftrack/plugins/user.json b/pype/settings/defaults/project_settings/ftrack/plugins/user.json similarity index 100% rename from pype/settings/defaults/project_configurations/ftrack/plugins/user.json rename to pype/settings/defaults/project_settings/ftrack/plugins/user.json diff --git a/pype/settings/defaults/project_configurations/ftrack/project_defaults.json b/pype/settings/defaults/project_settings/ftrack/project_defaults.json similarity index 100% rename from pype/settings/defaults/project_configurations/ftrack/project_defaults.json rename to pype/settings/defaults/project_settings/ftrack/project_defaults.json diff --git a/pype/settings/defaults/project_configurations/global/creator.json b/pype/settings/defaults/project_settings/global/creator.json similarity index 100% rename from pype/settings/defaults/project_configurations/global/creator.json rename to pype/settings/defaults/project_settings/global/creator.json diff --git a/pype/settings/defaults/project_configurations/global/project_folder_structure.json b/pype/settings/defaults/project_settings/global/project_folder_structure.json similarity index 100% rename from pype/settings/defaults/project_configurations/global/project_folder_structure.json rename to pype/settings/defaults/project_settings/global/project_folder_structure.json diff --git a/pype/settings/defaults/project_configurations/global/sw_folders.json b/pype/settings/defaults/project_settings/global/sw_folders.json similarity index 100% rename from pype/settings/defaults/project_configurations/global/sw_folders.json rename to pype/settings/defaults/project_settings/global/sw_folders.json diff --git a/pype/settings/defaults/project_configurations/global/workfiles.json b/pype/settings/defaults/project_settings/global/workfiles.json similarity index 100% rename from pype/settings/defaults/project_configurations/global/workfiles.json rename to pype/settings/defaults/project_settings/global/workfiles.json diff --git a/pype/settings/defaults/project_configurations/maya/capture.json b/pype/settings/defaults/project_settings/maya/capture.json similarity index 100% rename from pype/settings/defaults/project_configurations/maya/capture.json rename to pype/settings/defaults/project_settings/maya/capture.json diff --git a/pype/settings/defaults/project_configurations/muster/templates_mapping.json b/pype/settings/defaults/project_settings/muster/templates_mapping.json similarity index 100% rename from pype/settings/defaults/project_configurations/muster/templates_mapping.json rename to pype/settings/defaults/project_settings/muster/templates_mapping.json diff --git a/pype/settings/defaults/project_configurations/plugins/celaction/publish.json b/pype/settings/defaults/project_settings/plugins/celaction/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/celaction/publish.json rename to pype/settings/defaults/project_settings/plugins/celaction/publish.json diff --git a/pype/settings/defaults/project_configurations/plugins/config.json b/pype/settings/defaults/project_settings/plugins/config.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/config.json rename to pype/settings/defaults/project_settings/plugins/config.json diff --git a/pype/settings/defaults/project_configurations/plugins/ftrack/publish.json b/pype/settings/defaults/project_settings/plugins/ftrack/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/ftrack/publish.json rename to pype/settings/defaults/project_settings/plugins/ftrack/publish.json diff --git a/pype/settings/defaults/project_configurations/plugins/global/create.json b/pype/settings/defaults/project_settings/plugins/global/create.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/global/create.json rename to pype/settings/defaults/project_settings/plugins/global/create.json diff --git a/pype/settings/defaults/project_configurations/plugins/global/filter.json b/pype/settings/defaults/project_settings/plugins/global/filter.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/global/filter.json rename to pype/settings/defaults/project_settings/plugins/global/filter.json diff --git a/pype/settings/defaults/project_configurations/plugins/global/load.json b/pype/settings/defaults/project_settings/plugins/global/load.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/global/load.json rename to pype/settings/defaults/project_settings/plugins/global/load.json diff --git a/pype/settings/defaults/project_configurations/plugins/global/publish.json b/pype/settings/defaults/project_settings/plugins/global/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/global/publish.json rename to pype/settings/defaults/project_settings/plugins/global/publish.json diff --git a/pype/settings/defaults/project_configurations/plugins/maya/create.json b/pype/settings/defaults/project_settings/plugins/maya/create.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/maya/create.json rename to pype/settings/defaults/project_settings/plugins/maya/create.json diff --git a/pype/settings/defaults/project_configurations/plugins/maya/filter.json b/pype/settings/defaults/project_settings/plugins/maya/filter.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/maya/filter.json rename to pype/settings/defaults/project_settings/plugins/maya/filter.json diff --git a/pype/settings/defaults/project_configurations/plugins/maya/load.json b/pype/settings/defaults/project_settings/plugins/maya/load.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/maya/load.json rename to pype/settings/defaults/project_settings/plugins/maya/load.json diff --git a/pype/settings/defaults/project_configurations/plugins/maya/publish.json b/pype/settings/defaults/project_settings/plugins/maya/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/maya/publish.json rename to pype/settings/defaults/project_settings/plugins/maya/publish.json diff --git a/pype/settings/defaults/project_configurations/plugins/maya/workfile_build.json b/pype/settings/defaults/project_settings/plugins/maya/workfile_build.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/maya/workfile_build.json rename to pype/settings/defaults/project_settings/plugins/maya/workfile_build.json diff --git a/pype/settings/defaults/project_configurations/plugins/nuke/create.json b/pype/settings/defaults/project_settings/plugins/nuke/create.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/nuke/create.json rename to pype/settings/defaults/project_settings/plugins/nuke/create.json diff --git a/pype/settings/defaults/project_configurations/plugins/nuke/load.json b/pype/settings/defaults/project_settings/plugins/nuke/load.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/nuke/load.json rename to pype/settings/defaults/project_settings/plugins/nuke/load.json diff --git a/pype/settings/defaults/project_configurations/plugins/nuke/publish.json b/pype/settings/defaults/project_settings/plugins/nuke/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/nuke/publish.json rename to pype/settings/defaults/project_settings/plugins/nuke/publish.json diff --git a/pype/settings/defaults/project_configurations/plugins/nuke/workfile_build.json b/pype/settings/defaults/project_settings/plugins/nuke/workfile_build.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/nuke/workfile_build.json rename to pype/settings/defaults/project_settings/plugins/nuke/workfile_build.json diff --git a/pype/settings/defaults/project_configurations/plugins/nukestudio/filter.json b/pype/settings/defaults/project_settings/plugins/nukestudio/filter.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/nukestudio/filter.json rename to pype/settings/defaults/project_settings/plugins/nukestudio/filter.json diff --git a/pype/settings/defaults/project_configurations/plugins/nukestudio/publish.json b/pype/settings/defaults/project_settings/plugins/nukestudio/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/nukestudio/publish.json rename to pype/settings/defaults/project_settings/plugins/nukestudio/publish.json diff --git a/pype/settings/defaults/project_configurations/plugins/resolve/create.json b/pype/settings/defaults/project_settings/plugins/resolve/create.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/resolve/create.json rename to pype/settings/defaults/project_settings/plugins/resolve/create.json diff --git a/pype/settings/defaults/project_configurations/plugins/standalonepublisher/publish.json b/pype/settings/defaults/project_settings/plugins/standalonepublisher/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/standalonepublisher/publish.json rename to pype/settings/defaults/project_settings/plugins/standalonepublisher/publish.json diff --git a/pype/settings/defaults/project_configurations/plugins/test/create.json b/pype/settings/defaults/project_settings/plugins/test/create.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/test/create.json rename to pype/settings/defaults/project_settings/plugins/test/create.json diff --git a/pype/settings/defaults/project_configurations/plugins/test/publish.json b/pype/settings/defaults/project_settings/plugins/test/publish.json similarity index 100% rename from pype/settings/defaults/project_configurations/plugins/test/publish.json rename to pype/settings/defaults/project_settings/plugins/test/publish.json diff --git a/pype/settings/defaults/project_configurations/premiere/asset_default.json b/pype/settings/defaults/project_settings/premiere/asset_default.json similarity index 100% rename from pype/settings/defaults/project_configurations/premiere/asset_default.json rename to pype/settings/defaults/project_settings/premiere/asset_default.json diff --git a/pype/settings/defaults/project_configurations/premiere/rules_tasks.json b/pype/settings/defaults/project_settings/premiere/rules_tasks.json similarity index 100% rename from pype/settings/defaults/project_configurations/premiere/rules_tasks.json rename to pype/settings/defaults/project_settings/premiere/rules_tasks.json diff --git a/pype/settings/defaults/project_configurations/standalonepublisher/families.json b/pype/settings/defaults/project_settings/standalonepublisher/families.json similarity index 100% rename from pype/settings/defaults/project_configurations/standalonepublisher/families.json rename to pype/settings/defaults/project_settings/standalonepublisher/families.json diff --git a/pype/settings/defaults/project_configurations/tools/slates/example_HD.json b/pype/settings/defaults/project_settings/tools/slates/example_HD.json similarity index 100% rename from pype/settings/defaults/project_configurations/tools/slates/example_HD.json rename to pype/settings/defaults/project_settings/tools/slates/example_HD.json diff --git a/pype/settings/defaults/project_configurations/unreal/project_setup.json b/pype/settings/defaults/project_settings/unreal/project_setup.json similarity index 100% rename from pype/settings/defaults/project_configurations/unreal/project_setup.json rename to pype/settings/defaults/project_settings/unreal/project_setup.json diff --git a/pype/settings/defaults/system_configurations/environments/avalon.json b/pype/settings/defaults/system_settings/environments/avalon.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/avalon.json rename to pype/settings/defaults/system_settings/environments/avalon.json diff --git a/pype/settings/defaults/system_configurations/environments/blender.json b/pype/settings/defaults/system_settings/environments/blender.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/blender.json rename to pype/settings/defaults/system_settings/environments/blender.json diff --git a/pype/settings/defaults/system_configurations/environments/celaction.json b/pype/settings/defaults/system_settings/environments/celaction.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/celaction.json rename to pype/settings/defaults/system_settings/environments/celaction.json diff --git a/pype/settings/defaults/system_configurations/environments/deadline.json b/pype/settings/defaults/system_settings/environments/deadline.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/deadline.json rename to pype/settings/defaults/system_settings/environments/deadline.json diff --git a/pype/settings/defaults/system_configurations/environments/ftrack.json b/pype/settings/defaults/system_settings/environments/ftrack.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/ftrack.json rename to pype/settings/defaults/system_settings/environments/ftrack.json diff --git a/pype/settings/defaults/system_configurations/environments/global.json b/pype/settings/defaults/system_settings/environments/global.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/global.json rename to pype/settings/defaults/system_settings/environments/global.json diff --git a/pype/settings/defaults/system_configurations/environments/harmony.json b/pype/settings/defaults/system_settings/environments/harmony.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/harmony.json rename to pype/settings/defaults/system_settings/environments/harmony.json diff --git a/pype/settings/defaults/system_configurations/environments/houdini.json b/pype/settings/defaults/system_settings/environments/houdini.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/houdini.json rename to pype/settings/defaults/system_settings/environments/houdini.json diff --git a/pype/settings/defaults/system_configurations/environments/maya.json b/pype/settings/defaults/system_settings/environments/maya.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/maya.json rename to pype/settings/defaults/system_settings/environments/maya.json diff --git a/pype/settings/defaults/system_configurations/environments/maya_2018.json b/pype/settings/defaults/system_settings/environments/maya_2018.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/maya_2018.json rename to pype/settings/defaults/system_settings/environments/maya_2018.json diff --git a/pype/settings/defaults/system_configurations/environments/maya_2020.json b/pype/settings/defaults/system_settings/environments/maya_2020.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/maya_2020.json rename to pype/settings/defaults/system_settings/environments/maya_2020.json diff --git a/pype/settings/defaults/system_configurations/environments/mayabatch.json b/pype/settings/defaults/system_settings/environments/mayabatch.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/mayabatch.json rename to pype/settings/defaults/system_settings/environments/mayabatch.json diff --git a/pype/settings/defaults/system_configurations/environments/mayabatch_2019.json b/pype/settings/defaults/system_settings/environments/mayabatch_2019.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/mayabatch_2019.json rename to pype/settings/defaults/system_settings/environments/mayabatch_2019.json diff --git a/pype/settings/defaults/system_configurations/environments/mtoa_3.1.1.json b/pype/settings/defaults/system_settings/environments/mtoa_3.1.1.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/mtoa_3.1.1.json rename to pype/settings/defaults/system_settings/environments/mtoa_3.1.1.json diff --git a/pype/settings/defaults/system_configurations/environments/muster.json b/pype/settings/defaults/system_settings/environments/muster.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/muster.json rename to pype/settings/defaults/system_settings/environments/muster.json diff --git a/pype/settings/defaults/system_configurations/environments/nuke.json b/pype/settings/defaults/system_settings/environments/nuke.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/nuke.json rename to pype/settings/defaults/system_settings/environments/nuke.json diff --git a/pype/settings/defaults/system_configurations/environments/nukestudio.json b/pype/settings/defaults/system_settings/environments/nukestudio.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/nukestudio.json rename to pype/settings/defaults/system_settings/environments/nukestudio.json diff --git a/pype/settings/defaults/system_configurations/environments/nukestudio_10.0.json b/pype/settings/defaults/system_settings/environments/nukestudio_10.0.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/nukestudio_10.0.json rename to pype/settings/defaults/system_settings/environments/nukestudio_10.0.json diff --git a/pype/settings/defaults/system_configurations/environments/nukex.json b/pype/settings/defaults/system_settings/environments/nukex.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/nukex.json rename to pype/settings/defaults/system_settings/environments/nukex.json diff --git a/pype/settings/defaults/system_configurations/environments/nukex_10.0.json b/pype/settings/defaults/system_settings/environments/nukex_10.0.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/nukex_10.0.json rename to pype/settings/defaults/system_settings/environments/nukex_10.0.json diff --git a/pype/settings/defaults/system_configurations/environments/photoshop.json b/pype/settings/defaults/system_settings/environments/photoshop.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/photoshop.json rename to pype/settings/defaults/system_settings/environments/photoshop.json diff --git a/pype/settings/defaults/system_configurations/environments/premiere.json b/pype/settings/defaults/system_settings/environments/premiere.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/premiere.json rename to pype/settings/defaults/system_settings/environments/premiere.json diff --git a/pype/settings/defaults/system_configurations/environments/resolve.json b/pype/settings/defaults/system_settings/environments/resolve.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/resolve.json rename to pype/settings/defaults/system_settings/environments/resolve.json diff --git a/pype/settings/defaults/system_configurations/environments/storyboardpro.json b/pype/settings/defaults/system_settings/environments/storyboardpro.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/storyboardpro.json rename to pype/settings/defaults/system_settings/environments/storyboardpro.json diff --git a/pype/settings/defaults/system_configurations/environments/unreal_4.24.json b/pype/settings/defaults/system_settings/environments/unreal_4.24.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/unreal_4.24.json rename to pype/settings/defaults/system_settings/environments/unreal_4.24.json diff --git a/pype/settings/defaults/system_configurations/environments/vray_4300.json b/pype/settings/defaults/system_settings/environments/vray_4300.json similarity index 100% rename from pype/settings/defaults/system_configurations/environments/vray_4300.json rename to pype/settings/defaults/system_settings/environments/vray_4300.json diff --git a/pype/settings/defaults/system_configurations/global/applications.json b/pype/settings/defaults/system_settings/global/applications.json similarity index 100% rename from pype/settings/defaults/system_configurations/global/applications.json rename to pype/settings/defaults/system_settings/global/applications.json diff --git a/pype/settings/defaults/system_configurations/global/intent.json b/pype/settings/defaults/system_settings/global/intent.json similarity index 100% rename from pype/settings/defaults/system_configurations/global/intent.json rename to pype/settings/defaults/system_settings/global/intent.json diff --git a/pype/settings/defaults/system_configurations/global/tools.json b/pype/settings/defaults/system_settings/global/tools.json similarity index 100% rename from pype/settings/defaults/system_configurations/global/tools.json rename to pype/settings/defaults/system_settings/global/tools.json diff --git a/pype/settings/defaults/system_configurations/global/tray_modules.json b/pype/settings/defaults/system_settings/global/tray_modules.json similarity index 100% rename from pype/settings/defaults/system_configurations/global/tray_modules.json rename to pype/settings/defaults/system_settings/global/tray_modules.json diff --git a/pype/settings/defaults/system_configurations/launchers/blender_2.80.toml b/pype/settings/defaults/system_settings/launchers/blender_2.80.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/blender_2.80.toml rename to pype/settings/defaults/system_settings/launchers/blender_2.80.toml diff --git a/pype/settings/defaults/system_configurations/launchers/blender_2.81.toml b/pype/settings/defaults/system_settings/launchers/blender_2.81.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/blender_2.81.toml rename to pype/settings/defaults/system_settings/launchers/blender_2.81.toml diff --git a/pype/settings/defaults/system_configurations/launchers/blender_2.82.toml b/pype/settings/defaults/system_settings/launchers/blender_2.82.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/blender_2.82.toml rename to pype/settings/defaults/system_settings/launchers/blender_2.82.toml diff --git a/pype/settings/defaults/system_configurations/launchers/blender_2.83.toml b/pype/settings/defaults/system_settings/launchers/blender_2.83.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/blender_2.83.toml rename to pype/settings/defaults/system_settings/launchers/blender_2.83.toml diff --git a/pype/settings/defaults/system_configurations/launchers/celaction_local.toml b/pype/settings/defaults/system_settings/launchers/celaction_local.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/celaction_local.toml rename to pype/settings/defaults/system_settings/launchers/celaction_local.toml diff --git a/pype/settings/defaults/system_configurations/launchers/celaction_publish.toml b/pype/settings/defaults/system_settings/launchers/celaction_publish.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/celaction_publish.toml rename to pype/settings/defaults/system_settings/launchers/celaction_publish.toml diff --git a/pype/settings/defaults/system_configurations/launchers/darwin/blender_2.82 b/pype/settings/defaults/system_settings/launchers/darwin/blender_2.82 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/darwin/blender_2.82 rename to pype/settings/defaults/system_settings/launchers/darwin/blender_2.82 diff --git a/pype/settings/defaults/system_configurations/launchers/darwin/harmony_17 b/pype/settings/defaults/system_settings/launchers/darwin/harmony_17 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/darwin/harmony_17 rename to pype/settings/defaults/system_settings/launchers/darwin/harmony_17 diff --git a/pype/settings/defaults/system_configurations/launchers/darwin/harmony_17_launch b/pype/settings/defaults/system_settings/launchers/darwin/harmony_17_launch similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/darwin/harmony_17_launch rename to pype/settings/defaults/system_settings/launchers/darwin/harmony_17_launch diff --git a/pype/settings/defaults/system_configurations/launchers/darwin/python3 b/pype/settings/defaults/system_settings/launchers/darwin/python3 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/darwin/python3 rename to pype/settings/defaults/system_settings/launchers/darwin/python3 diff --git a/pype/settings/defaults/system_configurations/launchers/harmony_17.toml b/pype/settings/defaults/system_settings/launchers/harmony_17.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/harmony_17.toml rename to pype/settings/defaults/system_settings/launchers/harmony_17.toml diff --git a/pype/settings/defaults/system_configurations/launchers/houdini_16.toml b/pype/settings/defaults/system_settings/launchers/houdini_16.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/houdini_16.toml rename to pype/settings/defaults/system_settings/launchers/houdini_16.toml diff --git a/pype/settings/defaults/system_configurations/launchers/houdini_17.toml b/pype/settings/defaults/system_settings/launchers/houdini_17.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/houdini_17.toml rename to pype/settings/defaults/system_settings/launchers/houdini_17.toml diff --git a/pype/settings/defaults/system_configurations/launchers/houdini_18.toml b/pype/settings/defaults/system_settings/launchers/houdini_18.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/houdini_18.toml rename to pype/settings/defaults/system_settings/launchers/houdini_18.toml diff --git a/pype/settings/defaults/system_configurations/launchers/linux/maya2016 b/pype/settings/defaults/system_settings/launchers/linux/maya2016 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/maya2016 rename to pype/settings/defaults/system_settings/launchers/linux/maya2016 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/maya2017 b/pype/settings/defaults/system_settings/launchers/linux/maya2017 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/maya2017 rename to pype/settings/defaults/system_settings/launchers/linux/maya2017 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/maya2018 b/pype/settings/defaults/system_settings/launchers/linux/maya2018 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/maya2018 rename to pype/settings/defaults/system_settings/launchers/linux/maya2018 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/maya2019 b/pype/settings/defaults/system_settings/launchers/linux/maya2019 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/maya2019 rename to pype/settings/defaults/system_settings/launchers/linux/maya2019 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/maya2020 b/pype/settings/defaults/system_settings/launchers/linux/maya2020 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/maya2020 rename to pype/settings/defaults/system_settings/launchers/linux/maya2020 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/nuke11.3 b/pype/settings/defaults/system_settings/launchers/linux/nuke11.3 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/nuke11.3 rename to pype/settings/defaults/system_settings/launchers/linux/nuke11.3 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/nuke12.0 b/pype/settings/defaults/system_settings/launchers/linux/nuke12.0 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/nuke12.0 rename to pype/settings/defaults/system_settings/launchers/linux/nuke12.0 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/nukestudio11.3 b/pype/settings/defaults/system_settings/launchers/linux/nukestudio11.3 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/nukestudio11.3 rename to pype/settings/defaults/system_settings/launchers/linux/nukestudio11.3 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/nukestudio12.0 b/pype/settings/defaults/system_settings/launchers/linux/nukestudio12.0 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/nukestudio12.0 rename to pype/settings/defaults/system_settings/launchers/linux/nukestudio12.0 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/nukex11.3 b/pype/settings/defaults/system_settings/launchers/linux/nukex11.3 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/nukex11.3 rename to pype/settings/defaults/system_settings/launchers/linux/nukex11.3 diff --git a/pype/settings/defaults/system_configurations/launchers/linux/nukex12.0 b/pype/settings/defaults/system_settings/launchers/linux/nukex12.0 similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/linux/nukex12.0 rename to pype/settings/defaults/system_settings/launchers/linux/nukex12.0 diff --git a/pype/settings/defaults/system_configurations/launchers/maya_2016.toml b/pype/settings/defaults/system_settings/launchers/maya_2016.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/maya_2016.toml rename to pype/settings/defaults/system_settings/launchers/maya_2016.toml diff --git a/pype/settings/defaults/system_configurations/launchers/maya_2017.toml b/pype/settings/defaults/system_settings/launchers/maya_2017.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/maya_2017.toml rename to pype/settings/defaults/system_settings/launchers/maya_2017.toml diff --git a/pype/settings/defaults/system_configurations/launchers/maya_2018.toml b/pype/settings/defaults/system_settings/launchers/maya_2018.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/maya_2018.toml rename to pype/settings/defaults/system_settings/launchers/maya_2018.toml diff --git a/pype/settings/defaults/system_configurations/launchers/maya_2019.toml b/pype/settings/defaults/system_settings/launchers/maya_2019.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/maya_2019.toml rename to pype/settings/defaults/system_settings/launchers/maya_2019.toml diff --git a/pype/settings/defaults/system_configurations/launchers/maya_2020.toml b/pype/settings/defaults/system_settings/launchers/maya_2020.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/maya_2020.toml rename to pype/settings/defaults/system_settings/launchers/maya_2020.toml diff --git a/pype/settings/defaults/system_configurations/launchers/mayabatch_2019.toml b/pype/settings/defaults/system_settings/launchers/mayabatch_2019.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/mayabatch_2019.toml rename to pype/settings/defaults/system_settings/launchers/mayabatch_2019.toml diff --git a/pype/settings/defaults/system_configurations/launchers/mayabatch_2020.toml b/pype/settings/defaults/system_settings/launchers/mayabatch_2020.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/mayabatch_2020.toml rename to pype/settings/defaults/system_settings/launchers/mayabatch_2020.toml diff --git a/pype/settings/defaults/system_configurations/launchers/mayapy2016.toml b/pype/settings/defaults/system_settings/launchers/mayapy2016.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/mayapy2016.toml rename to pype/settings/defaults/system_settings/launchers/mayapy2016.toml diff --git a/pype/settings/defaults/system_configurations/launchers/mayapy2017.toml b/pype/settings/defaults/system_settings/launchers/mayapy2017.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/mayapy2017.toml rename to pype/settings/defaults/system_settings/launchers/mayapy2017.toml diff --git a/pype/settings/defaults/system_configurations/launchers/mayapy2018.toml b/pype/settings/defaults/system_settings/launchers/mayapy2018.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/mayapy2018.toml rename to pype/settings/defaults/system_settings/launchers/mayapy2018.toml diff --git a/pype/settings/defaults/system_configurations/launchers/mayapy2019.toml b/pype/settings/defaults/system_settings/launchers/mayapy2019.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/mayapy2019.toml rename to pype/settings/defaults/system_settings/launchers/mayapy2019.toml diff --git a/pype/settings/defaults/system_configurations/launchers/mayapy2020.toml b/pype/settings/defaults/system_settings/launchers/mayapy2020.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/mayapy2020.toml rename to pype/settings/defaults/system_settings/launchers/mayapy2020.toml diff --git a/pype/settings/defaults/system_configurations/launchers/myapp.toml b/pype/settings/defaults/system_settings/launchers/myapp.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/myapp.toml rename to pype/settings/defaults/system_settings/launchers/myapp.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nuke_10.0.toml b/pype/settings/defaults/system_settings/launchers/nuke_10.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nuke_10.0.toml rename to pype/settings/defaults/system_settings/launchers/nuke_10.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nuke_11.0.toml b/pype/settings/defaults/system_settings/launchers/nuke_11.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nuke_11.0.toml rename to pype/settings/defaults/system_settings/launchers/nuke_11.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nuke_11.2.toml b/pype/settings/defaults/system_settings/launchers/nuke_11.2.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nuke_11.2.toml rename to pype/settings/defaults/system_settings/launchers/nuke_11.2.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nuke_11.3.toml b/pype/settings/defaults/system_settings/launchers/nuke_11.3.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nuke_11.3.toml rename to pype/settings/defaults/system_settings/launchers/nuke_11.3.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nuke_12.0.toml b/pype/settings/defaults/system_settings/launchers/nuke_12.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nuke_12.0.toml rename to pype/settings/defaults/system_settings/launchers/nuke_12.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukestudio_10.0.toml b/pype/settings/defaults/system_settings/launchers/nukestudio_10.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukestudio_10.0.toml rename to pype/settings/defaults/system_settings/launchers/nukestudio_10.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukestudio_11.0.toml b/pype/settings/defaults/system_settings/launchers/nukestudio_11.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukestudio_11.0.toml rename to pype/settings/defaults/system_settings/launchers/nukestudio_11.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukestudio_11.2.toml b/pype/settings/defaults/system_settings/launchers/nukestudio_11.2.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukestudio_11.2.toml rename to pype/settings/defaults/system_settings/launchers/nukestudio_11.2.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukestudio_11.3.toml b/pype/settings/defaults/system_settings/launchers/nukestudio_11.3.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukestudio_11.3.toml rename to pype/settings/defaults/system_settings/launchers/nukestudio_11.3.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukestudio_12.0.toml b/pype/settings/defaults/system_settings/launchers/nukestudio_12.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukestudio_12.0.toml rename to pype/settings/defaults/system_settings/launchers/nukestudio_12.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukex_10.0.toml b/pype/settings/defaults/system_settings/launchers/nukex_10.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukex_10.0.toml rename to pype/settings/defaults/system_settings/launchers/nukex_10.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukex_11.0.toml b/pype/settings/defaults/system_settings/launchers/nukex_11.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukex_11.0.toml rename to pype/settings/defaults/system_settings/launchers/nukex_11.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukex_11.2.toml b/pype/settings/defaults/system_settings/launchers/nukex_11.2.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukex_11.2.toml rename to pype/settings/defaults/system_settings/launchers/nukex_11.2.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukex_11.3.toml b/pype/settings/defaults/system_settings/launchers/nukex_11.3.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukex_11.3.toml rename to pype/settings/defaults/system_settings/launchers/nukex_11.3.toml diff --git a/pype/settings/defaults/system_configurations/launchers/nukex_12.0.toml b/pype/settings/defaults/system_settings/launchers/nukex_12.0.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/nukex_12.0.toml rename to pype/settings/defaults/system_settings/launchers/nukex_12.0.toml diff --git a/pype/settings/defaults/system_configurations/launchers/photoshop_2020.toml b/pype/settings/defaults/system_settings/launchers/photoshop_2020.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/photoshop_2020.toml rename to pype/settings/defaults/system_settings/launchers/photoshop_2020.toml diff --git a/pype/settings/defaults/system_configurations/launchers/premiere_2019.toml b/pype/settings/defaults/system_settings/launchers/premiere_2019.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/premiere_2019.toml rename to pype/settings/defaults/system_settings/launchers/premiere_2019.toml diff --git a/pype/settings/defaults/system_configurations/launchers/premiere_2020.toml b/pype/settings/defaults/system_settings/launchers/premiere_2020.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/premiere_2020.toml rename to pype/settings/defaults/system_settings/launchers/premiere_2020.toml diff --git a/pype/settings/defaults/system_configurations/launchers/python_2.toml b/pype/settings/defaults/system_settings/launchers/python_2.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/python_2.toml rename to pype/settings/defaults/system_settings/launchers/python_2.toml diff --git a/pype/settings/defaults/system_configurations/launchers/python_3.toml b/pype/settings/defaults/system_settings/launchers/python_3.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/python_3.toml rename to pype/settings/defaults/system_settings/launchers/python_3.toml diff --git a/pype/settings/defaults/system_configurations/launchers/resolve_16.toml b/pype/settings/defaults/system_settings/launchers/resolve_16.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/resolve_16.toml rename to pype/settings/defaults/system_settings/launchers/resolve_16.toml diff --git a/pype/settings/defaults/system_configurations/launchers/shell.toml b/pype/settings/defaults/system_settings/launchers/shell.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/shell.toml rename to pype/settings/defaults/system_settings/launchers/shell.toml diff --git a/pype/settings/defaults/system_configurations/launchers/storyboardpro_7.toml b/pype/settings/defaults/system_settings/launchers/storyboardpro_7.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/storyboardpro_7.toml rename to pype/settings/defaults/system_settings/launchers/storyboardpro_7.toml diff --git a/pype/settings/defaults/system_configurations/launchers/unreal_4.24.toml b/pype/settings/defaults/system_settings/launchers/unreal_4.24.toml similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/unreal_4.24.toml rename to pype/settings/defaults/system_settings/launchers/unreal_4.24.toml diff --git a/pype/settings/defaults/system_configurations/launchers/windows/blender_2.80.bat b/pype/settings/defaults/system_settings/launchers/windows/blender_2.80.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/blender_2.80.bat rename to pype/settings/defaults/system_settings/launchers/windows/blender_2.80.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/blender_2.81.bat b/pype/settings/defaults/system_settings/launchers/windows/blender_2.81.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/blender_2.81.bat rename to pype/settings/defaults/system_settings/launchers/windows/blender_2.81.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/blender_2.82.bat b/pype/settings/defaults/system_settings/launchers/windows/blender_2.82.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/blender_2.82.bat rename to pype/settings/defaults/system_settings/launchers/windows/blender_2.82.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/blender_2.83.bat b/pype/settings/defaults/system_settings/launchers/windows/blender_2.83.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/blender_2.83.bat rename to pype/settings/defaults/system_settings/launchers/windows/blender_2.83.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/celaction_local.bat b/pype/settings/defaults/system_settings/launchers/windows/celaction_local.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/celaction_local.bat rename to pype/settings/defaults/system_settings/launchers/windows/celaction_local.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/celaction_publish.bat b/pype/settings/defaults/system_settings/launchers/windows/celaction_publish.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/celaction_publish.bat rename to pype/settings/defaults/system_settings/launchers/windows/celaction_publish.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/harmony_17.bat b/pype/settings/defaults/system_settings/launchers/windows/harmony_17.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/harmony_17.bat rename to pype/settings/defaults/system_settings/launchers/windows/harmony_17.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/houdini_16.bat b/pype/settings/defaults/system_settings/launchers/windows/houdini_16.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/houdini_16.bat rename to pype/settings/defaults/system_settings/launchers/windows/houdini_16.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/houdini_17.bat b/pype/settings/defaults/system_settings/launchers/windows/houdini_17.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/houdini_17.bat rename to pype/settings/defaults/system_settings/launchers/windows/houdini_17.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/houdini_18.bat b/pype/settings/defaults/system_settings/launchers/windows/houdini_18.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/houdini_18.bat rename to pype/settings/defaults/system_settings/launchers/windows/houdini_18.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/maya2016.bat b/pype/settings/defaults/system_settings/launchers/windows/maya2016.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/maya2016.bat rename to pype/settings/defaults/system_settings/launchers/windows/maya2016.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/maya2017.bat b/pype/settings/defaults/system_settings/launchers/windows/maya2017.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/maya2017.bat rename to pype/settings/defaults/system_settings/launchers/windows/maya2017.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/maya2018.bat b/pype/settings/defaults/system_settings/launchers/windows/maya2018.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/maya2018.bat rename to pype/settings/defaults/system_settings/launchers/windows/maya2018.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/maya2019.bat b/pype/settings/defaults/system_settings/launchers/windows/maya2019.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/maya2019.bat rename to pype/settings/defaults/system_settings/launchers/windows/maya2019.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/maya2020.bat b/pype/settings/defaults/system_settings/launchers/windows/maya2020.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/maya2020.bat rename to pype/settings/defaults/system_settings/launchers/windows/maya2020.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/mayabatch2019.bat b/pype/settings/defaults/system_settings/launchers/windows/mayabatch2019.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/mayabatch2019.bat rename to pype/settings/defaults/system_settings/launchers/windows/mayabatch2019.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/mayabatch2020.bat b/pype/settings/defaults/system_settings/launchers/windows/mayabatch2020.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/mayabatch2020.bat rename to pype/settings/defaults/system_settings/launchers/windows/mayabatch2020.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/mayapy2016.bat b/pype/settings/defaults/system_settings/launchers/windows/mayapy2016.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/mayapy2016.bat rename to pype/settings/defaults/system_settings/launchers/windows/mayapy2016.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/mayapy2017.bat b/pype/settings/defaults/system_settings/launchers/windows/mayapy2017.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/mayapy2017.bat rename to pype/settings/defaults/system_settings/launchers/windows/mayapy2017.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/mayapy2018.bat b/pype/settings/defaults/system_settings/launchers/windows/mayapy2018.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/mayapy2018.bat rename to pype/settings/defaults/system_settings/launchers/windows/mayapy2018.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/mayapy2019.bat b/pype/settings/defaults/system_settings/launchers/windows/mayapy2019.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/mayapy2019.bat rename to pype/settings/defaults/system_settings/launchers/windows/mayapy2019.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/mayapy2020.bat b/pype/settings/defaults/system_settings/launchers/windows/mayapy2020.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/mayapy2020.bat rename to pype/settings/defaults/system_settings/launchers/windows/mayapy2020.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nuke10.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nuke10.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nuke10.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nuke10.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nuke11.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nuke11.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nuke11.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nuke11.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nuke11.2.bat b/pype/settings/defaults/system_settings/launchers/windows/nuke11.2.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nuke11.2.bat rename to pype/settings/defaults/system_settings/launchers/windows/nuke11.2.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nuke11.3.bat b/pype/settings/defaults/system_settings/launchers/windows/nuke11.3.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nuke11.3.bat rename to pype/settings/defaults/system_settings/launchers/windows/nuke11.3.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nuke12.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nuke12.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nuke12.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nuke12.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukestudio10.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nukestudio10.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukestudio10.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukestudio10.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nukestudio11.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukestudio11.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.2.bat b/pype/settings/defaults/system_settings/launchers/windows/nukestudio11.2.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.2.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukestudio11.2.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.3.bat b/pype/settings/defaults/system_settings/launchers/windows/nukestudio11.3.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukestudio11.3.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukestudio11.3.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukestudio12.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nukestudio12.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukestudio12.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukestudio12.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukex10.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nukex10.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukex10.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukex10.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukex11.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nukex11.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukex11.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukex11.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukex11.2.bat b/pype/settings/defaults/system_settings/launchers/windows/nukex11.2.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukex11.2.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukex11.2.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukex11.3.bat b/pype/settings/defaults/system_settings/launchers/windows/nukex11.3.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukex11.3.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukex11.3.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/nukex12.0.bat b/pype/settings/defaults/system_settings/launchers/windows/nukex12.0.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/nukex12.0.bat rename to pype/settings/defaults/system_settings/launchers/windows/nukex12.0.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/photoshop_2020.bat b/pype/settings/defaults/system_settings/launchers/windows/photoshop_2020.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/photoshop_2020.bat rename to pype/settings/defaults/system_settings/launchers/windows/photoshop_2020.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat b/pype/settings/defaults/system_settings/launchers/windows/premiere_pro_2019.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2019.bat rename to pype/settings/defaults/system_settings/launchers/windows/premiere_pro_2019.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat b/pype/settings/defaults/system_settings/launchers/windows/premiere_pro_2020.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/premiere_pro_2020.bat rename to pype/settings/defaults/system_settings/launchers/windows/premiere_pro_2020.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/python3.bat b/pype/settings/defaults/system_settings/launchers/windows/python3.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/python3.bat rename to pype/settings/defaults/system_settings/launchers/windows/python3.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/resolve_16.bat b/pype/settings/defaults/system_settings/launchers/windows/resolve_16.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/resolve_16.bat rename to pype/settings/defaults/system_settings/launchers/windows/resolve_16.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/shell.bat b/pype/settings/defaults/system_settings/launchers/windows/shell.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/shell.bat rename to pype/settings/defaults/system_settings/launchers/windows/shell.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/storyboardpro_7.bat b/pype/settings/defaults/system_settings/launchers/windows/storyboardpro_7.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/storyboardpro_7.bat rename to pype/settings/defaults/system_settings/launchers/windows/storyboardpro_7.bat diff --git a/pype/settings/defaults/system_configurations/launchers/windows/unreal.bat b/pype/settings/defaults/system_settings/launchers/windows/unreal.bat similarity index 100% rename from pype/settings/defaults/system_configurations/launchers/windows/unreal.bat rename to pype/settings/defaults/system_settings/launchers/windows/unreal.bat diff --git a/pype/settings/defaults/system_configurations/muster/templates_mapping.json b/pype/settings/defaults/system_settings/muster/templates_mapping.json similarity index 100% rename from pype/settings/defaults/system_configurations/muster/templates_mapping.json rename to pype/settings/defaults/system_settings/muster/templates_mapping.json diff --git a/pype/settings/defaults/system_configurations/standalone_publish/families.json b/pype/settings/defaults/system_settings/standalone_publish/families.json similarity index 100% rename from pype/settings/defaults/system_configurations/standalone_publish/families.json rename to pype/settings/defaults/system_settings/standalone_publish/families.json From 5b50b8ede47d0507f56cf4f26701dca0ada4a110 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:31:47 +0200 Subject: [PATCH 473/507] all variables for setting not contain setting instead of configuration --- pype/api.py | 8 ++-- pype/settings/__init__.py | 8 ++-- pype/settings/lib.py | 42 +++++++++---------- .../projects_schema/0_project_gui_schema.json | 2 +- pype/tools/settings/settings/widgets/base.py | 26 ++++++------ 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/pype/api.py b/pype/api.py index 0b3439c4c2..021080b4d5 100644 --- a/pype/api.py +++ b/pype/api.py @@ -1,6 +1,6 @@ from .settings import ( - system_configurations, - project_configurations + system_settings, + project_settings ) from pypeapp import ( Logger, @@ -53,8 +53,8 @@ from .lib import ( from .lib import _subprocess as subprocess __all__ = [ - "system_configurations", - "project_configurations", + "system_settings", + "project_settings", "Logger", "Anatomy", diff --git a/pype/settings/__init__.py b/pype/settings/__init__.py index e3fc53fcfd..7e73d541a4 100644 --- a/pype/settings/__init__.py +++ b/pype/settings/__init__.py @@ -1,9 +1,9 @@ from .lib import ( - system_configurations, - project_configurations + system_settings, + project_settings ) __all__ = ( - "system_configurations", - "project_configurations" + "system_settings", + "project_settings" ) diff --git a/pype/settings/lib.py b/pype/settings/lib.py index 101b579b14..388557ca9b 100644 --- a/pype/settings/lib.py +++ b/pype/settings/lib.py @@ -14,13 +14,13 @@ POP_KEY = "__pop_key__" STUDIO_OVERRIDES_PATH = os.environ["PYPE_PROJECT_CONFIGS"] # File where studio's system overrides are stored -SYSTEM_SETTINGS_KEY = "system_configurations" +SYSTEM_SETTINGS_KEY = "system_settings" SYSTEM_SETTINGS_PATH = os.path.join( STUDIO_OVERRIDES_PATH, SYSTEM_SETTINGS_KEY + ".json" ) # File where studio's default project overrides are stored -PROJECT_SETTINGS_KEY = "project_configurations" +PROJECT_SETTINGS_KEY = "project_settings" PROJECT_SETTINGS_FILENAME = PROJECT_SETTINGS_KEY + ".json" PROJECT_SETTINGS_PATH = os.path.join( STUDIO_OVERRIDES_PATH, PROJECT_SETTINGS_FILENAME @@ -32,19 +32,19 @@ PROJECT_ANATOMY_PATH = os.path.join( STUDIO_OVERRIDES_PATH, PROJECT_ANATOMY_FILENAME ) -# Path to default configurations +# Path to default settings DEFAULTS_DIR = os.path.join(os.path.dirname(__file__), "defaults") -# Variable where cache of default configurations are stored +# Variable where cache of default settings are stored _DEFAULT_SETTINGS = None -def reset_default_configurations(): +def reset_default_settings(): global _DEFAULT_SETTINGS _DEFAULT_SETTINGS = None -def default_configuration(): +def default_settings(): global _DEFAULT_SETTINGS if _DEFAULT_SETTINGS is None: _DEFAULT_SETTINGS = load_jsons_from_dir(DEFAULTS_DIR) @@ -156,13 +156,13 @@ def load_jsons_from_dir(path, *args, **kwargs): return output -def studio_system_configurations(): +def studio_system_settings(): if os.path.exists(SYSTEM_SETTINGS_PATH): return load_json(SYSTEM_SETTINGS_PATH) return {} -def studio_project_configurations(): +def studio_project_settings(): if os.path.exists(PROJECT_SETTINGS_PATH): return load_json(PROJECT_SETTINGS_PATH) return {} @@ -190,7 +190,7 @@ def path_to_project_anatomy(project_name): ) -def project_configurations_overrides(project_name): +def project_settings_overrides(project_name): if not project_name: return {} @@ -234,25 +234,25 @@ def merge_overrides(global_dict, override_dict): return global_dict -def apply_overrides(global_presets, project_overrides): - global_presets = copy.deepcopy(global_presets) - if not project_overrides: - return global_presets - return merge_overrides(global_presets, project_overrides) +def apply_overrides(source_data, override_data): + if not override_data: + return source_data + _source_data = copy.deepcopy(source_data) + return merge_overrides(_source_data, override_data) -def system_configurations(): - default_values = default_configuration()["system_configurations"] - studio_values = studio_system_configurations() +def system_settings(): + default_values = default_settings()[SYSTEM_SETTINGS_KEY] + studio_values = studio_system_settings() return apply_overrides(default_values, studio_values) -def project_configurations(project_name): - default_values = default_configuration()["project_configurations"] - studio_values = studio_project_configurations() +def project_settings(project_name): + default_values = default_settings()[PROJECT_SETTINGS_KEY] + studio_values = studio_project_settings() studio_overrides = apply_overrides(default_values, studio_values) - project_overrides = project_configurations_overrides(project_name) + project_overrides = project_settings_overrides(project_name) return apply_overrides(studio_overrides, project_overrides) diff --git a/pype/tools/settings/settings/gui_schemas/projects_schema/0_project_gui_schema.json b/pype/tools/settings/settings/gui_schemas/projects_schema/0_project_gui_schema.json index 3d7cac68fd..fa7c6a366d 100644 --- a/pype/tools/settings/settings/gui_schemas/projects_schema/0_project_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/projects_schema/0_project_gui_schema.json @@ -18,7 +18,7 @@ ] }, { "type": "dict-invisible", - "key": "project_configurations", + "key": "project_settings", "children": [ { "type": "schema", diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index 6a7a65cb0f..90e3aca677 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -11,14 +11,14 @@ from pype.settings.lib import ( DEFAULTS_DIR, - reset_default_configurations, - default_configuration, + reset_default_settings, + default_settings, - studio_system_configurations, - studio_project_configurations, + studio_system_settings, + studio_project_settings, studio_project_anatomy, - project_configurations_overrides, + project_settings_overrides, project_anatomy_overrides, path_to_project_overrides, @@ -179,7 +179,7 @@ class SystemWidget(QtWidgets.QWidget): all_values = all_values["system"] prject_defaults_dir = os.path.join( - DEFAULTS_DIR, SYSTEM_CONFIGURATIONS_KEY + DEFAULTS_DIR, SYSTEM_SETTINGS_KEY ) keys_to_file = lib.file_keys_from_schema(self.schema) for key_sequence in keys_to_file: @@ -200,7 +200,7 @@ class SystemWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(new_values, file_stream, indent=4) - reset_default_configurations() + reset_default_settings() self._update_values() @@ -208,12 +208,12 @@ class SystemWidget(QtWidgets.QWidget): self.ignore_value_changes = True default_values = { - "system": default_configuration()["system_configurations"] + "system": default_settings()[SYSTEM_SETTINGS_KEY] } for input_field in self.input_fields: input_field.update_default_values(default_values) - system_values = {"system": studio_system_configurations()} + system_values = {"system": studio_system_settings()} for input_field in self.input_fields: input_field.update_studio_values(system_values) @@ -462,7 +462,7 @@ class ProjectWidget(QtWidgets.QWidget): _project_anatomy = lib.NOT_SET self.is_overidable = False else: - _project_overrides = project_configurations_overrides(project_name) + _project_overrides = project_settings_overrides(project_name) _project_anatomy = project_anatomy_overrides(project_name) self.is_overidable = True @@ -519,7 +519,7 @@ class ProjectWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(new_values, file_stream, indent=4) - reset_default_configurations() + reset_default_settings() self._update_values() @@ -638,12 +638,12 @@ class ProjectWidget(QtWidgets.QWidget): def _update_values(self): self.ignore_value_changes = True - default_values = {"project": default_configuration()} + default_values = {"project": default_settings()} for input_field in self.input_fields: input_field.update_default_values(default_values) studio_values = {"project": { - PROJECT_SETTINGS_KEY: studio_project_configurations(), + PROJECT_SETTINGS_KEY: studio_project_settings(), PROJECT_ANATOMY_KEY: studio_project_anatomy() }} for input_field in self.input_fields: From ee612be204b6109c4f0672750339eb13a45732fc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:35:39 +0200 Subject: [PATCH 474/507] implemented set as studio override for anatomy items --- pype/tools/settings/settings/widgets/anatomy_inputs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pype/tools/settings/settings/widgets/anatomy_inputs.py b/pype/tools/settings/settings/widgets/anatomy_inputs.py index 0e7e094be5..50a6022e3c 100644 --- a/pype/tools/settings/settings/widgets/anatomy_inputs.py +++ b/pype/tools/settings/settings/widgets/anatomy_inputs.py @@ -570,6 +570,13 @@ class RootsWidget(QtWidgets.QWidget, SettingObject): self.singleroot_widget.reset_to_pype_default() self._has_studio_override = False + def set_studio_default(self): + if self.is_multiroot: + self.multiroot_widget.reset_to_pype_default() + else: + self.singleroot_widget.reset_to_pype_default() + self._has_studio_override = True + def discard_changes(self): self._is_overriden = self._was_overriden self._is_modified = False @@ -718,6 +725,9 @@ class TemplatesWidget(QtWidgets.QWidget, SettingObject): def reset_to_pype_default(self): self.value_input.reset_to_pype_default() + def set_studio_default(self): + self.value_input.set_studio_default() + def discard_changes(self): self.value_input.discard_changes() From 38e8f5962826bd8d5edd6dc32f290b37234d6a36 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:38:51 +0200 Subject: [PATCH 475/507] renamed inputs to item_types --- pype/tools/settings/settings/widgets/__init__.py | 9 ++++----- .../widgets/{anatomy_inputs.py => anatomy_types.py} | 4 +++- .../settings/widgets/{inputs.py => item_types.py} | 0 3 files changed, 7 insertions(+), 6 deletions(-) rename pype/tools/settings/settings/widgets/{anatomy_inputs.py => anatomy_types.py} (99%) rename pype/tools/settings/settings/widgets/{inputs.py => item_types.py} (100%) diff --git a/pype/tools/settings/settings/widgets/__init__.py b/pype/tools/settings/settings/widgets/__init__.py index 034692898c..e5ea4b3129 100644 --- a/pype/tools/settings/settings/widgets/__init__.py +++ b/pype/tools/settings/settings/widgets/__init__.py @@ -1,10 +1,9 @@ from .window import MainWidget -# TODO properly register inputs to TypeToKlass class -from . import inputs -from . import anatomy_inputs +from . import item_types +from . import anatomy_type __all__ = [ "MainWidget", - "inputs", - "anatomy_inputs" + "item_types", + "anatomy_type" ] diff --git a/pype/tools/settings/settings/widgets/anatomy_inputs.py b/pype/tools/settings/settings/widgets/anatomy_types.py similarity index 99% rename from pype/tools/settings/settings/widgets/anatomy_inputs.py rename to pype/tools/settings/settings/widgets/anatomy_types.py index 50a6022e3c..9433d7a823 100644 --- a/pype/tools/settings/settings/widgets/anatomy_inputs.py +++ b/pype/tools/settings/settings/widgets/anatomy_types.py @@ -1,6 +1,8 @@ from Qt import QtWidgets, QtCore from .widgets import ExpandingWidget -from .inputs import SettingObject, ModifiableDict, PathWidget, RawJsonWidget +from .item_types import ( + SettingObject, ModifiableDict, PathWidget, RawJsonWidget +) from .lib import NOT_SET, TypeToKlass, CHILD_OFFSET, METADATA_KEY diff --git a/pype/tools/settings/settings/widgets/inputs.py b/pype/tools/settings/settings/widgets/item_types.py similarity index 100% rename from pype/tools/settings/settings/widgets/inputs.py rename to pype/tools/settings/settings/widgets/item_types.py From 0884ba26900cc7ba8e626a7a3d84a8f092a6f5bd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:39:24 +0200 Subject: [PATCH 476/507] fixed typo --- pype/tools/settings/settings/widgets/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/__init__.py b/pype/tools/settings/settings/widgets/__init__.py index e5ea4b3129..361fd9d23d 100644 --- a/pype/tools/settings/settings/widgets/__init__.py +++ b/pype/tools/settings/settings/widgets/__init__.py @@ -1,9 +1,9 @@ from .window import MainWidget from . import item_types -from . import anatomy_type +from . import anatomy_types __all__ = [ "MainWidget", "item_types", - "anatomy_type" + "anatomy_types" ] From cd36685ef8406a68b0761d5d04f346c3c511addd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:49:15 +0200 Subject: [PATCH 477/507] fix studio overrides for anatomy roots --- pype/tools/settings/settings/widgets/anatomy_types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/anatomy_types.py b/pype/tools/settings/settings/widgets/anatomy_types.py index 9433d7a823..0d94f6f86f 100644 --- a/pype/tools/settings/settings/widgets/anatomy_types.py +++ b/pype/tools/settings/settings/widgets/anatomy_types.py @@ -519,9 +519,9 @@ class RootsWidget(QtWidgets.QWidget, SettingObject): @property def child_has_studio_override(self): if self.is_multiroot: - return self.multiroot_widget.child_has_studio_override + return self.multiroot_widget.has_studio_override else: - return self.singleroot_widget.child_has_studio_override + return self.singleroot_widget.has_studio_override @property def child_modified(self): From 35beb0a657182657069e2180135118a41a348141 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:54:09 +0200 Subject: [PATCH 478/507] fixed setting pype default for anatomy --- pype/tools/settings/settings/widgets/anatomy_types.py | 5 +++++ pype/tools/settings/settings/widgets/item_types.py | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pype/tools/settings/settings/widgets/anatomy_types.py b/pype/tools/settings/settings/widgets/anatomy_types.py index 0d94f6f86f..dd4b5dc578 100644 --- a/pype/tools/settings/settings/widgets/anatomy_types.py +++ b/pype/tools/settings/settings/widgets/anatomy_types.py @@ -196,6 +196,10 @@ class AnatomyWidget(QtWidgets.QWidget, SettingObject): self.root_widget.reset_to_pype_default() self.templates_widget.reset_to_pype_default() + def set_studio_default(self): + self.root_widget.set_studio_default() + self.templates_widget.set_studio_default() + def discard_changes(self): self.root_widget.discard_changes() self.templates_widget.discard_changes() @@ -596,6 +600,7 @@ class RootsWidget(QtWidgets.QWidget, SettingObject): self.singleroot_widget.discard_changes() self._is_modified = self.child_modified + self._has_studio_override = self._had_studio_override def set_as_overriden(self): self._is_overriden = True diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index aa72f1c81f..b0de7910ab 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -194,7 +194,6 @@ class SettingObject(AbstractSettingObject): not self.is_overidable and ( self.has_studio_override - or self.child_has_studio_override ) ): action = QtWidgets.QAction("Reset to pype default") @@ -203,10 +202,9 @@ class SettingObject(AbstractSettingObject): if ( not self.is_overidable - and ( - (self.is_group and not self._had_studio_override) - or self.any_parent_is_group - ) + and not self.is_overriden + and not self.any_parent_is_group + and not self._had_studio_override ): action = QtWidgets.QAction("Set sudio default") actions_mapping[action] = self._set_studio_default From 438aab08662f48f8879136a0f83635bf7be3f298 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 18:56:16 +0200 Subject: [PATCH 479/507] added window title --- pype/tools/settings/settings/widgets/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/tools/settings/settings/widgets/window.py b/pype/tools/settings/settings/widgets/window.py index 5c7a35fa52..f83da8efe0 100644 --- a/pype/tools/settings/settings/widgets/window.py +++ b/pype/tools/settings/settings/widgets/window.py @@ -9,6 +9,7 @@ class MainWidget(QtWidgets.QWidget): def __init__(self, develop, parent=None): super(MainWidget, self).__init__(parent) self.setObjectName("MainWidget") + self.setWindowTitle("Pype Settings") self.resize(self.widget_width, self.widget_height) From 3b69f890a30b15a177d937e6db1deaa59a484e04 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 14 Sep 2020 19:00:07 +0200 Subject: [PATCH 480/507] added refresh to develop mode --- pype/tools/settings/settings/widgets/base.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index 90e3aca677..437a74b8c1 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -27,6 +27,7 @@ from pype.settings.lib import ( from .widgets import UnsavedChangesDialog from . import lib from avalon import io +from avalon.vendor import qtawesome class SystemWidget(QtWidgets.QWidget): @@ -65,9 +66,16 @@ class SystemWidget(QtWidgets.QWidget): if self.develop_mode: save_as_default_btn = QtWidgets.QPushButton("Save as Default") - footer_layout.addWidget(save_as_default_btn, 0) save_as_default_btn.clicked.connect(self._save_as_defaults) + refresh_icon = qtawesome.icon("fa.refresh", color="white") + refresh_button = QtWidgets.QPushButton() + refresh_button.setIcon(refresh_icon) + refresh_button.clicked.connect(self._on_refresh) + + footer_layout.addWidget(save_as_default_btn, 0) + footer_layout.addWidget(refresh_button, 0) + save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() footer_layout.addWidget(spacer_widget, 1) @@ -158,6 +166,9 @@ class SystemWidget(QtWidgets.QWidget): self._update_values() + def _on_refresh(self): + self.reset() + def _save_as_defaults(self): output = {} for item in self.input_fields: From d91c890a7d8335e245d3bf2d1f9939b1bf321e04 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 11:23:39 +0200 Subject: [PATCH 481/507] fixed path-widget default value for dev mode --- .../settings/settings/widgets/item_types.py | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index b0de7910ab..6433956484 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -2136,13 +2136,18 @@ class PathWidget(QtWidgets.QWidget, SettingObject): @property def default_input_value(self): + if self.multipath: + value_type = list + else: + value_type = str + if self.multiplatform: return { - platform: "" + platform: value_type() for platform in self.platforms } else: - return "" + return value_type() def create_gui(self): if not self.multiplatform and not self.multipath: @@ -2204,9 +2209,19 @@ class PathWidget(QtWidgets.QWidget, SettingObject): value = parent_values.get(self.key, NOT_SET) if value is NOT_SET: - raise ValueError( - "Default value is not set. This is implementation BUG." - ) + if self.develop_mode: + value = {self.key: self.default_input_value} + self.defaults_not_set = True + if value is NOT_SET: + raise NotImplementedError(( + "{} Does not have implemented" + " attribute `default_input_value`" + ).format(self)) + + else: + raise ValueError( + "Default value is not set. This is implementation BUG." + ) self.default_value = value self._has_studio_override = False From 67a38042264fc622c9b7bf0833d549d055db3435 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 11:45:13 +0200 Subject: [PATCH 482/507] fixed expandable widget toggle_content --- pype/tools/settings/settings/widgets/widgets.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pype/tools/settings/settings/widgets/widgets.py b/pype/tools/settings/settings/widgets/widgets.py index bb42df6026..96f8d2ec17 100644 --- a/pype/tools/settings/settings/widgets/widgets.py +++ b/pype/tools/settings/settings/widgets/widgets.py @@ -105,7 +105,7 @@ class ExpandingWidget(QtWidgets.QWidget): self.label_widget = label_widget top_part.clicked.connect(self._top_part_clicked) - self.button_toggle.clicked.connect(self.toggle_content) + self.button_toggle.clicked.connect(self._btn_clicked) self.main_layout = QtWidgets.QVBoxLayout(self) self.main_layout.setContentsMargins(0, 0, 0, 0) @@ -123,16 +123,20 @@ class ExpandingWidget(QtWidgets.QWidget): self.main_layout.addWidget(content_widget) self.content_widget = content_widget + def _btn_clicked(self): + self.toggle_content(self.button_toggle.isChecked()) + def _top_part_clicked(self): - self.toggle_content(not self.button_toggle.isChecked()) + self.toggle_content() def toggle_content(self, *args): if self.toolbox_hidden: return + if len(args) > 0: checked = args[0] else: - checked = self.button_toggle.isChecked() + checked = not self.button_toggle.isChecked() arrow_type = QtCore.Qt.RightArrow if checked: arrow_type = QtCore.Qt.DownArrow From c42927120b1fa6a7abf1ee62624666096f905bc2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 11:47:07 +0200 Subject: [PATCH 483/507] changed `expandable` to `collapsable` and `expanded` to `collapsed` --- .../projects_schema/1_plugins_gui_schema.json | 80 +++++++++---------- .../system_schema/1_intents_gui_schema.json | 2 +- .../system_schema/1_tools_gui_schema.json | 2 +- .../system_schema/1_tray_items.json | 8 +- .../settings/settings/widgets/item_types.py | 21 ++--- 5 files changed, 57 insertions(+), 56 deletions(-) diff --git a/pype/tools/settings/settings/gui_schemas/projects_schema/1_plugins_gui_schema.json b/pype/tools/settings/settings/gui_schemas/projects_schema/1_plugins_gui_schema.json index c279a6b04a..6bb14463c1 100644 --- a/pype/tools/settings/settings/gui_schemas/projects_schema/1_plugins_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/projects_schema/1_plugins_gui_schema.json @@ -1,25 +1,25 @@ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "plugins", "label": "Plugins", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "celaction", "label": "CelAction", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "publish", "label": "Publish plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "ExtractCelactionDeadline", "label": "ExtractCelactionDeadline", @@ -66,20 +66,20 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ftrack", "label": "Ftrack", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "publish", "label": "Publish plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "IntegrateFtrackNote", "label": "IntegrateFtrackNote", @@ -106,20 +106,20 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "global", "label": "Global", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "publish", "label": "Publish plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "IntegrateMasterVersion", "label": "IntegrateMasterVersion", @@ -133,7 +133,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "ExtractJpegEXR", "label": "ExtractJpegEXR", @@ -163,7 +163,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ExtractReview", "label": "ExtractReview", "checkbox_key": "enabled", @@ -181,7 +181,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ExtractBurnin", "label": "ExtractBurnin", "checkbox_key": "enabled", @@ -193,7 +193,7 @@ "label": "Enabled" }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "options", "label": "Burnin formating options", "children": [ @@ -231,7 +231,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "IntegrateAssetNew", "label": "IntegrateAssetNew", "is_group": true, @@ -244,7 +244,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ProcessSubmittedJobOnFarm", "label": "ProcessSubmittedJobOnFarm", "checkbox_key": "enabled", @@ -274,20 +274,20 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "maya", "label": "Maya", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "publish", "label": "Publish plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ValidateModelName", "label": "Validate Model Name", "checkbox_key": "enabled", @@ -309,7 +309,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ValidateAssemblyName", "label": "Validate Assembly Name", "checkbox_key": "enabled", @@ -323,7 +323,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ValidateShaderName", "label": "ValidateShaderName", "checkbox_key": "enabled", @@ -341,7 +341,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ValidateMeshHasOverlappingUVs", "label": "ValidateMeshHasOverlappingUVs", "checkbox_key": "enabled", @@ -364,20 +364,20 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "nuke", "label": "Nuke", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "create", "label": "Create plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": false, + "collapsable": false, "key": "CreateWriteRender", "label": "CreateWriteRender", "is_group": true, @@ -390,7 +390,7 @@ ] }, { "type": "dict", - "expandable": false, + "collapsable": false, "key": "CreateWritePrerender", "label": "CreateWritePrerender", "is_group": true, @@ -405,14 +405,14 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "publish", "label": "Publish plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "ExtractThumbnail", "label": "ExtractThumbnail", @@ -430,7 +430,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "ValidateNukeWriteKnobs", "label": "ValidateNukeWriteKnobs", @@ -448,7 +448,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "ExtractReviewDataLut", "label": "ExtractReviewDataLut", @@ -462,7 +462,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "ExtractReviewDataMov", "label": "ExtractReviewDataMov", @@ -480,7 +480,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "ExtractSlateFrame", "label": "ExtractSlateFrame", "is_group": true, @@ -493,7 +493,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "NukeSubmitDeadline", "label": "NukeSubmitDeadline", "is_group": true, @@ -527,20 +527,20 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "nukestudio", "label": "NukeStudio", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "publish", "label": "Publish plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "CollectInstanceVersion", "label": "Collect Instance Version", @@ -554,7 +554,7 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "checkbox_key": "enabled", "key": "ExtractReviewCutUpVideo", "label": "Extract Review Cut Up Video", @@ -577,20 +577,20 @@ ] }, { "type": "dict", - "expandable": true, + "collapsable": true, "key": "resolve", "label": "DaVinci Resolve", "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "create", "label": "Creator plugins", "is_file": true, "children": [ { "type": "dict", - "expandable": true, + "collapsable": true, "key": "CreateShotClip", "label": "Create Shot Clip", "is_group": true, diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json index a4b5e16fa1..0c252d2ca9 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json @@ -2,7 +2,7 @@ "key": "intent", "type": "dict", "label": "Intent Setting", - "expandable": true, + "collapsable": true, "is_group": true, "is_file": true, "children": [ diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_tools_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_tools_gui_schema.json index bf35326d1c..d9540eeb3e 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_tools_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_tools_gui_schema.json @@ -2,7 +2,7 @@ "key": "tools", "type": "dict", "label": "Tools", - "expandable": true, + "collapsable": true, "is_group": true, "is_file": true, "children": [ diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_tray_items.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_tray_items.json index 7507050900..6da974a415 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_tray_items.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_tray_items.json @@ -2,7 +2,7 @@ "key": "tray_modules", "type": "dict", "label": "Modules", - "expandable": true, + "collapsable": true, "is_group": true, "is_file": true, "children": [ @@ -69,7 +69,7 @@ "type": "dict", "key": "Rest Api", "label": "Rest Api", - "expandable": true, + "collapsable": true, "children": [ { "type": "number", @@ -92,7 +92,7 @@ "type": "dict", "key": "Timers Manager", "label": "Timers Manager", - "expandable": true, + "collapsable": true, "children": [ { "type": "number", @@ -110,7 +110,7 @@ "type": "dict", "key": "Clockify", "label": "Clockify", - "expandable": true, + "collapsable": true, "children": [ { "type": "text", diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 6433956484..729ab3a70f 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1343,14 +1343,15 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.body_widget = body_widget self.label_widget = body_widget.label_widget - expandable = input_data.get("expandable", True) - if not expandable: - body_widget.hide_toolbox(hide_content=False) - else: - expanded = input_data.get("expanded", False) - if expanded: + collapsable = input_data.get("collapsable", True) + if collapsable: + collapsed = input_data.get("collapsed", True) + if not collapsed: body_widget.toggle_content() + else: + body_widget.hide_toolbox(hide_content=False) + self.body_widget = body_widget self.content_widget = content_widget self.content_layout = content_layout @@ -1590,13 +1591,13 @@ class DictWidget(QtWidgets.QWidget, SettingObject): for child_data in input_data.get("children", []): self.add_children_gui(child_data) - expandable = input_data.get("expandable", True) + collapsable = input_data.get("collapsable", True) if len(self.input_fields) == 1 and self.checkbox_widget: body_widget.hide_toolbox(hide_content=True) - elif expandable: - expanded = input_data.get("expanded", False) - if expanded: + elif collapsable: + collapsed = input_data.get("collapsed", True) + if not collapsed: body_widget.toggle_content() else: body_widget.hide_toolbox(hide_content=False) From 0a474167663ac6001ea92539cf685ceda8defcd3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 11:47:36 +0200 Subject: [PATCH 484/507] modifiable dict fixed states --- .../settings/settings/widgets/item_types.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 729ab3a70f..2b6bcfe34c 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1165,7 +1165,6 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): self.set_default_attributes() self._parent = config_parent - self.is_single = False self.is_key_duplicated = False layout = QtWidgets.QHBoxLayout(self) @@ -1212,7 +1211,13 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): def key_value(self): return self.key_input.text() + def _is_enabled(self): + return self.key_input.isEnabled() + def is_key_invalid(self): + if not self._is_enabled(): + return False + if self.key_value() == "": return True @@ -1244,7 +1249,7 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): return self._parent.is_group def on_add_clicked(self): - if self.value_input.isEnabled(): + if self._is_enabled(): self._parent.add_row(row=self.row() + 1) else: self.set_as_empty(False) @@ -1278,15 +1283,17 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): @property def is_invalid(self): + if not self._is_enabled(): + return False return self.is_key_invalid() or self.value_input.is_invalid def update_style(self): - if self.is_key_invalid(): - state = "invalid" - elif self.is_key_modified(): - state = "modified" - else: - state = "" + state = "" + if self._is_enabled(): + if self.is_key_invalid(): + state = "invalid" + elif self.is_key_modified(): + state = "modified" self.key_input.setProperty("state", state) self.key_input.style().polish(self.key_input) From 703e17b35a2654e9696858acf6c0fd3679ef0532 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 11:53:57 +0200 Subject: [PATCH 485/507] removed bold style on label for invalid value --- pype/tools/settings/settings/style/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/style/style.css b/pype/tools/settings/settings/style/style.css index f6dd354935..ab88a2c36f 100644 --- a/pype/tools/settings/settings/style/style.css +++ b/pype/tools/settings/settings/style/style.css @@ -56,8 +56,8 @@ QLabel[state="overriden-modified"] {color: #137cbd;} QLabel[state="overriden-modified"]:hover {color: #1798e8;} QLabel[state="overriden"] {color: #ff8c1a;} QLabel[state="overriden"]:hover {color: #ffa64d;} -QLabel[state="invalid"] {color: #ad2e2e; font-weight: bold;} -QLabel[state="invalid"]:hover {color: #ad2e2e; font-weight: bold;} +QLabel[state="invalid"] {color: #ad2e2e;} +QLabel[state="invalid"]:hover {color: #ad2e2e;} QWidget[input-state="studio"] {border-color: #bfccd6;} From 2d4f983a88674a21f6e05b4398e1b5a4e8ac2c3a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 11:54:12 +0200 Subject: [PATCH 486/507] using only horizontal layouts --- .../system_schema/1_applications_gui_schema.json | 2 +- pype/tools/settings/settings/widgets/item_types.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json index 5ee769eed8..48f8ecbd7c 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json @@ -2,7 +2,7 @@ "key": "applications", "type": "dict", "label": "Applications", - "expandable": true, + "collapsable": true, "is_group": true, "is_file": true, "children": [ diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 2b6bcfe34c..754b4512bd 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -805,9 +805,9 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self.initial_attributes(input_data, parent, as_widget) - layout = QtWidgets.QVBoxLayout(self) + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) - layout.setSpacing(0) + layout.setSpacing(5) self.text_input = RawJsonInput(self) self.text_input.setSizePolicy( @@ -2117,10 +2117,7 @@ class PathWidget(QtWidgets.QWidget, SettingObject): self.input_fields = [] - if not self.multiplatform and not self.multipath: - layout = QtWidgets.QHBoxLayout(self) - else: - layout = QtWidgets.QVBoxLayout(self) + layout = QtWidgets.QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(5) From 1a7ba6f8d789572d755002cb8fb5362a7e9a6168 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 12:41:59 +0200 Subject: [PATCH 487/507] added `is_input_type` attribute for non input item types --- pype/tools/settings/settings/widgets/item_types.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 754b4512bd..5f995b40b7 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -12,6 +12,7 @@ from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET class SettingObject(AbstractSettingObject): + is_input_type = True default_input_value = NOT_SET allow_actions = True default_state = "" @@ -1612,6 +1613,12 @@ class DictWidget(QtWidgets.QWidget, SettingObject): def add_children_gui(self, child_configuration): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) + + if not klass.is_input_type: + item = klass(child_configuration, self) + self.content_layout.addWidget(item) + return item + if self.checkbox_key and not self.checkbox_widget: key = child_configuration.get("key") if key == self.checkbox_key: @@ -1898,6 +1905,11 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) + if not klass.is_input_type: + item = klass(child_configuration, self) + self.layout().addWidget(item) + return item + item = klass(child_configuration, self) self.layout().addWidget(item) From 0a9c96d27b4d755d7cb641304bad2d43ea82ba9c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 12:42:12 +0200 Subject: [PATCH 488/507] added anatomy widgets to TypeToKlass --- pype/tools/settings/settings/widgets/anatomy_types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pype/tools/settings/settings/widgets/anatomy_types.py b/pype/tools/settings/settings/widgets/anatomy_types.py index dd4b5dc578..785632b08d 100644 --- a/pype/tools/settings/settings/widgets/anatomy_types.py +++ b/pype/tools/settings/settings/widgets/anatomy_types.py @@ -754,3 +754,5 @@ class TemplatesWidget(QtWidgets.QWidget, SettingObject): TypeToKlass.types["anatomy"] = AnatomyWidget +TypeToKlass.types["anatomy_roots"] = AnatomyWidget +TypeToKlass.types["anatomy_templates"] = AnatomyWidget From 3bde8a77a2ac5275760fd673d8cb2dc7af21062a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 12:42:27 +0200 Subject: [PATCH 489/507] added examples schema --- .../gui_schemas/system_schema/1_examples.json | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json new file mode 100644 index 0000000000..a884dcb31e --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json @@ -0,0 +1,234 @@ +{ + "key": "example_dict", + "label": "Examples", + "type": "dict", + "is_file": true, + "children": [ + { + "key": "dict_wrapper", + "type": "dict-invisible", + "children": [ + { + "type": "boolean", + "key": "bool", + "label": "Boolean checkbox" + }, { + "type": "label", + "label": "NOTE: This is label" + }, { + "type": "splitter" + }, { + "type": "number", + "key": "integer", + "label": "Integer", + "decimal": 0, + "minimum": 0, + "maximum": 10 + }, { + "type": "number", + "key": "float", + "label": "Float (2 decimals)", + "decimal": 2, + "minimum": -10, + "maximum": -5 + }, { + "type": "text", + "key": "singleline_text", + "label": "Singleline text" + }, { + "type": "text", + "key": "multiline_text", + "label": "Multiline text", + "multiline": true + }, { + "type": "raw-json", + "key": "raw_json", + "label": "Raw json input" + }, { + "type": "list", + "key": "list_item_of_multiline_texts", + "label": "List of multiline texts", + "object_type": "text", + "input_modifiers": { + "multiline": true + } + }, { + "type": "list", + "key": "list_item_of_floats", + "label": "List of floats", + "object_type": "number", + "input_modifiers": { + "decimal": 3, + "minimum": 1000, + "maximum": 2000 + } + }, { + "type": "dict-modifiable", + "key": "modifiable_dict_of_integers", + "label": "Modifiable dict of integers", + "object_type": "number", + "input_modifiers": { + "decimal": 0, + "minimum": 10, + "maximum": 100 + } + }, { + "type": "path-widget", + "key": "single_path_input", + "label": "Single path input", + "multiplatform": false, + "multipath": false + }, { + "type": "path-widget", + "key": "multi_path_input", + "label": "Multi path input", + "multiplatform": false, + "multipath": true + }, { + "type": "path-widget", + "key": "single_os_specific_path_input", + "label": "Single OS specific path input", + "multiplatform": true, + "multipath": false + }, { + "type": "path-widget", + "key": "multi_os_specific_path_input", + "label": "Multi OS specific path input", + "multiplatform": true, + "multipath": true + }, { + "key": "collapsable", + "type": "dict", + "label": "collapsable dictionary", + "collapsable": true, + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "_nothing", + "label": "Exmaple input" + } + ] + }, { + "key": "collapsable_expanded", + "type": "dict", + "label": "collapsable dictionary, expanded on creation", + "collapsable": true, + "collapsed": false, + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "_nothing", + "label": "Exmaple input" + } + ] + }, { + "key": "not_collapsable", + "type": "dict", + "label": "Not collapsable", + "collapsable": false, + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "_nothing", + "label": "Exmaple input" + } + ] + }, { + "key": "nested_dict_lvl1", + "type": "dict", + "label": "Nested dictionary (level 1)", + "children": [ + { + "key": "nested_dict_lvl2", + "type": "dict", + "label": "Nested dictionary (level 2)", + "is_group": true, + "children": [ + { + "key": "nested_dict_lvl3", + "type": "dict", + "label": "Nested dictionary (level 3)", + "children": [ + { + "type": "boolean", + "key": "_nothing", + "label": "Exmaple input" + } + ] + }, { + "key": "nested_dict_lvl3_2", + "type": "dict", + "label": "Nested dictionary (level 3) (2)", + "children": [ + { + "type": "text", + "key": "_nothing", + "label": "Exmaple input" + }, { + "type": "text", + "key": "_nothing2", + "label": "Exmaple input 2" + } + ] + } + ] + } + ] + }, { + "key": "form_examples", + "type": "dict", + "label": "Form examples", + "children": [ + { + "key": "inputs_without_form_example", + "type": "dict", + "label": "Inputs without form", + "children": [ + { + "type": "text", + "key": "_nothing_1", + "label": "Example label" + }, { + "type": "text", + "key": "_nothing_2", + "label": "Example label ####" + }, { + "type": "text", + "key": "_nothing_3", + "label": "Example label ########" + } + ] + }, { + "key": "inputs_with_form_example", + "type": "dict", + "label": "Inputs with form", + "children": [ + { + "type": "dict-form", + "children": [ + { + "type": "text", + "key": "_nothing_1", + "label": "Example label" + }, { + "type": "text", + "key": "_nothing_2", + "label": "Example label ####" + }, { + "type": "text", + "key": "_nothing_3", + "label": "Example label ########" + } + ] + } + ] + } + ] + } + ] + } + ] +} From 3cf1c91e2b2f4c94e9df67a99885bccfd9a44fca Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 12:46:10 +0200 Subject: [PATCH 490/507] implemented label widget and splitter widget --- pype/tools/settings/settings/style/style.css | 4 +++ .../settings/settings/widgets/item_types.py | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/pype/tools/settings/settings/style/style.css b/pype/tools/settings/settings/style/style.css index ab88a2c36f..38f69fef50 100644 --- a/pype/tools/settings/settings/style/style.css +++ b/pype/tools/settings/settings/style/style.css @@ -152,6 +152,10 @@ QPushButton[btn-type="expand-toggle"] { background: #141a1f; } +#SplitterItem { + background-color: #1d272f; +} + QTabWidget::pane { border-top-style: none; } diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 5f995b40b7..bd9341973b 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -2668,6 +2668,37 @@ class DictFormWidget(QtWidgets.QWidget, SettingObject): return values, self.is_group +class LabelWidget(QtWidgets.QWidget): + is_input_type = False + + def __init__(self, configuration, parent=None): + super(LabelWidget, self).__init__(parent) + self.setObjectName("LabelWidget") + + label = configuration["label"] + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(5, 5, 5, 5) + label_widget = QtWidgets.QLabel(label, self) + layout.addWidget(label_widget) + + +class SplitterWidget(QtWidgets.QWidget): + is_input_type = False + _height = 2 + + def __init__(self, configuration, parent=None): + super(SplitterWidget, self).__init__(parent) + + layout = QtWidgets.QHBoxLayout(self) + layout.setContentsMargins(5, 5, 5, 5) + splitter_item = QtWidgets.QWidget(self) + splitter_item.setObjectName("SplitterItem") + splitter_item.setMinimumHeight(self._height) + splitter_item.setMaximumHeight(self._height) + layout.addWidget(splitter_item) + + TypeToKlass.types["boolean"] = BooleanWidget TypeToKlass.types["number"] = NumberWidget TypeToKlass.types["text"] = TextWidget @@ -2679,3 +2710,6 @@ TypeToKlass.types["dict"] = DictWidget TypeToKlass.types["dict-invisible"] = DictInvisible TypeToKlass.types["path-widget"] = PathWidget TypeToKlass.types["dict-form"] = DictFormWidget + +TypeToKlass.types["label"] = LabelWidget +TypeToKlass.types["splitter"] = SplitterWidget From 6329836c277d6908a28d5850d7fb121c163b3ed3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 12:46:23 +0200 Subject: [PATCH 491/507] lib fixed is file keys --- pype/tools/settings/settings/widgets/lib.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 0c3f01cef1..e225d65417 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -123,6 +123,11 @@ class SchemaDuplicatedKeys(Exception): def file_keys_from_schema(schema_data): output = [] + item_type = schema_data["type"] + klass = TypeToKlass.types[item_type] + if not klass.is_input_type: + return output + keys = [] key = schema_data.get("key") if key: @@ -143,6 +148,11 @@ def file_keys_from_schema(schema_data): def validate_all_has_ending_file(schema_data, is_top=True): + item_type = schema_data["type"] + klass = TypeToKlass.types[item_type] + if not klass.is_input_type: + return None + if schema_data.get("is_file"): return None From c4db7bdf620a9fc2c89b890cacfbbeae12518e4e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 12:56:41 +0200 Subject: [PATCH 492/507] mod dict item return valid value if not set --- pype/tools/settings/settings/widgets/item_types.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index bd9341973b..2cc25df270 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1303,9 +1303,11 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): return self._parent.input_fields.index(self) def config_value(self): - key = self.key_input.text() - value = self.value_input.item_value() - return {key: value} + if self._is_enabled(): + key = self.key_input.text() + value = self.value_input.item_value() + return {key: value} + return {} def mouseReleaseEvent(self, event): return QtWidgets.QWidget.mouseReleaseEvent(self, event) From 50a44e9cbc83817ebb869d562925580957bd3d13 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 13:10:56 +0200 Subject: [PATCH 493/507] modifiable dict has one more addiotional method for getting all values event invalid for roots widget --- .../tools/settings/settings/widgets/item_types.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 2cc25df270..17f8514fb9 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1302,11 +1302,14 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): def row(self): return self._parent.input_fields.index(self) + def item_value(self): + key = self.key_input.text() + value = self.value_input.item_value() + return {key: value} + def config_value(self): if self._is_enabled(): - key = self.key_input.text() - value = self.value_input.item_value() - return {key: value} + return self.item_value() return {} def mouseReleaseEvent(self, event): @@ -1468,6 +1471,12 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self._state = state + def all_item_values(self): + output = {} + for item in self.input_fields: + output.update(item.item_value()) + return output + def item_value(self): output = {} for item in self.input_fields: From d20665a845864791f29f957533d05faa51f0ee1f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 13:18:36 +0200 Subject: [PATCH 494/507] anatomy type fixes --- pype/tools/settings/settings/widgets/anatomy_types.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/tools/settings/settings/widgets/anatomy_types.py b/pype/tools/settings/settings/widgets/anatomy_types.py index 785632b08d..6d7b3292ce 100644 --- a/pype/tools/settings/settings/widgets/anatomy_types.py +++ b/pype/tools/settings/settings/widgets/anatomy_types.py @@ -261,7 +261,7 @@ class RootsWidget(QtWidgets.QWidget, SettingObject): content_widget = QtWidgets.QWidget(body_widget) path_widget_data = { - "key": "roots", + "key": self.key, "multipath": False, "multiplatform": True } @@ -270,7 +270,7 @@ class RootsWidget(QtWidgets.QWidget, SettingObject): as_widget=True, parent_widget=content_widget ) multiroot_data = { - "key": "roots", + "key": self.key, "object_type": "path-widget", "expandable": False, "input_modifiers": { @@ -497,7 +497,7 @@ class RootsWidget(QtWidgets.QWidget, SettingObject): self.multiroot_widget.set_value(mutli_value) def _from_multi_to_single(self): - mutli_value = self.multiroot_widget.item_value() + mutli_value = self.multiroot_widget.all_item_values() for value in mutli_value.values(): single_value = value break From 72ae67af1911fdfa31c98babf05367f7843281e0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 13:20:39 +0200 Subject: [PATCH 495/507] fixed PathWidget --- pype/tools/settings/settings/widgets/item_types.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 17f8514fb9..7914c6f04f 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -2234,11 +2234,17 @@ class PathWidget(QtWidgets.QWidget, SettingObject): if self._as_widget: value = parent_values elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if not self.multiplatform: + value = parent_values + else: + value = parent_values.get(self.key, NOT_SET) if value is NOT_SET: if self.develop_mode: - value = {self.key: self.default_input_value} + if self._as_widget or not self.multiplatform: + value = {self.key: self.default_input_value} + else: + value = self.default_input_value self.defaults_not_set = True if value is NOT_SET: raise NotImplementedError(( From acc2e3db0b34e0f40c812ce8a416833e161aae50 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 13:27:02 +0200 Subject: [PATCH 496/507] added refresh button to projects too --- pype/tools/settings/settings/widgets/base.py | 24 ++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index 437a74b8c1..d9be84638e 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -111,6 +111,8 @@ class SystemWidget(QtWidgets.QWidget): input_field.hierarchical_style_update() def reset(self): + reset_default_settings() + if self.content_layout.count() != 0: for widget in self.input_fields: self.content_layout.removeWidget(widget) @@ -211,9 +213,7 @@ class SystemWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(new_values, file_stream, indent=4) - reset_default_settings() - - self._update_values() + self.reset() def _update_values(self): self.ignore_value_changes = True @@ -401,9 +401,16 @@ class ProjectWidget(QtWidgets.QWidget): if self.develop_mode: save_as_default_btn = QtWidgets.QPushButton("Save as Default") - footer_layout.addWidget(save_as_default_btn, 0) save_as_default_btn.clicked.connect(self._save_as_defaults) + refresh_icon = qtawesome.icon("fa.refresh", color="white") + refresh_button = QtWidgets.QPushButton() + refresh_button.setIcon(refresh_icon) + refresh_button.clicked.connect(self._on_refresh) + + footer_layout.addWidget(save_as_default_btn, 0) + footer_layout.addWidget(refresh_button, 0) + save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() footer_layout.addWidget(spacer_widget, 1) @@ -453,6 +460,8 @@ class ProjectWidget(QtWidgets.QWidget): input_field.hierarchical_style_update() def reset(self): + reset_default_settings() + self.schema = lib.gui_schema("projects_schema", "0_project_gui_schema") self.keys = self.schema.get("keys", []) self.add_children_gui(self.schema) @@ -530,9 +539,7 @@ class ProjectWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(new_values, file_stream, indent=4) - reset_default_settings() - - self._update_values() + self.reset() def _save(self): has_invalid = False @@ -564,6 +571,9 @@ class ProjectWidget(QtWidgets.QWidget): else: self._save_overrides() + def _on_refresh(self): + self.reset() + def _save_overrides(self): data = {} for item in self.input_fields: From 9b3862eb74d1e1ab71e7ba2f2d1624e3879995ba Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 14:38:21 +0200 Subject: [PATCH 497/507] refresh and save as defaults works as expected --- pype/tools/settings/settings/widgets/base.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index d9be84638e..4769cb4e63 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -213,7 +213,10 @@ class SystemWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(new_values, file_stream, indent=4) - self.reset() + reset_default_settings() + + self._update_values() + self.hierarchical_style_update() def _update_values(self): self.ignore_value_changes = True @@ -460,7 +463,11 @@ class ProjectWidget(QtWidgets.QWidget): input_field.hierarchical_style_update() def reset(self): - reset_default_settings() + if self.content_layout.count() != 0: + for widget in self.input_fields: + self.content_layout.removeWidget(widget) + widget.deleteLater() + self.input_fields.clear() self.schema = lib.gui_schema("projects_schema", "0_project_gui_schema") self.keys = self.schema.get("keys", []) @@ -539,7 +546,10 @@ class ProjectWidget(QtWidgets.QWidget): with open(output_path, "w") as file_stream: json.dump(new_values, file_stream, indent=4) - self.reset() + reset_default_settings() + + self._update_values() + self.hierarchical_style_update() def _save(self): has_invalid = False From 452e5988f1350fe0cfde66a608dfb37335266e27 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 14:49:47 +0200 Subject: [PATCH 498/507] fixed PathWidget for other udpates --- pype/tools/settings/settings/widgets/item_types.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 7914c6f04f..51ae0fc985 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -2276,7 +2276,10 @@ class PathWidget(QtWidgets.QWidget, SettingObject): if self._as_widget: value = parent_values elif parent_values is not NOT_SET: - value = parent_values.get(self.key, NOT_SET) + if not self.multiplatform: + value = parent_values + else: + value = parent_values.get(self.key, NOT_SET) self.studio_value = value if value is not NOT_SET: @@ -2297,11 +2300,15 @@ class PathWidget(QtWidgets.QWidget, SettingObject): self._is_modified = False self._state = None self._child_state = None + override_values = NOT_SET if self._as_widget: override_values = parent_values elif parent_values is not NOT_SET: - override_values = parent_values.get(self.key, override_values) + if not self.multiplatform: + override_values = parent_values + else: + override_values = parent_values.get(self.key, NOT_SET) self._is_overriden = override_values is not NOT_SET self._was_overriden = bool(self._is_overriden) From edce6a1ea9a0fe376e62b26d6f8b0070bcc715c5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 15:19:16 +0200 Subject: [PATCH 499/507] added possibility to hide studio overrides --- pype/tools/settings/settings/widgets/base.py | 62 ++++++++++++++++++-- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index 4769cb4e63..dbcc380daf 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -41,6 +41,7 @@ class SystemWidget(QtWidgets.QWidget): super(SystemWidget, self).__init__(parent) self.develop_mode = develop_mode + self._hide_studio_overrides = False self._ignore_value_changes = False self.input_fields = [] @@ -73,8 +74,25 @@ class SystemWidget(QtWidgets.QWidget): refresh_button.setIcon(refresh_icon) refresh_button.clicked.connect(self._on_refresh) + hide_studio_overrides = QtWidgets.QCheckBox() + hide_studio_overrides.setChecked(self._hide_studio_overrides) + hide_studio_overrides.stateChanged.connect( + self._on_hide_studio_overrides + ) + + hide_studio_overrides_widget = QtWidgets.QWidget() + hide_studio_overrides_layout = QtWidgets.QHBoxLayout( + hide_studio_overrides_widget + ) + _label_widget = QtWidgets.QLabel( + "Hide studio overrides", hide_studio_overrides_widget + ) + hide_studio_overrides_layout.addWidget(_label_widget) + hide_studio_overrides_layout.addWidget(hide_studio_overrides) + footer_layout.addWidget(save_as_default_btn, 0) footer_layout.addWidget(refresh_button, 0) + footer_layout.addWidget(hide_studio_overrides_widget, 0) save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() @@ -171,6 +189,11 @@ class SystemWidget(QtWidgets.QWidget): def _on_refresh(self): self.reset() + def _on_hide_studio_overrides(self, state): + self._hide_studio_overrides = (state == QtCore.Qt.Checked) + self._update_values() + self.hierarchical_style_update() + def _save_as_defaults(self): output = {} for item in self.input_fields: @@ -227,7 +250,10 @@ class SystemWidget(QtWidgets.QWidget): for input_field in self.input_fields: input_field.update_default_values(default_values) - system_values = {"system": studio_system_settings()} + if self._hide_studio_overrides: + system_values = lib.NOT_SET + else: + system_values = {"system": studio_system_settings()} for input_field in self.input_fields: input_field.update_studio_values(system_values) @@ -377,6 +403,7 @@ class ProjectWidget(QtWidgets.QWidget): super(ProjectWidget, self).__init__(parent) self.develop_mode = develop_mode + self._hide_studio_overrides = False self.is_overidable = False self._ignore_value_changes = False @@ -411,8 +438,25 @@ class ProjectWidget(QtWidgets.QWidget): refresh_button.setIcon(refresh_icon) refresh_button.clicked.connect(self._on_refresh) + hide_studio_overrides = QtWidgets.QCheckBox() + hide_studio_overrides.setChecked(self._hide_studio_overrides) + hide_studio_overrides.stateChanged.connect( + self._on_hide_studio_overrides + ) + + hide_studio_overrides_widget = QtWidgets.QWidget() + hide_studio_overrides_layout = QtWidgets.QHBoxLayout( + hide_studio_overrides_widget + ) + _label_widget = QtWidgets.QLabel( + "Hide studio overrides", hide_studio_overrides_widget + ) + hide_studio_overrides_layout.addWidget(_label_widget) + hide_studio_overrides_layout.addWidget(hide_studio_overrides) + footer_layout.addWidget(save_as_default_btn, 0) footer_layout.addWidget(refresh_button, 0) + footer_layout.addWidget(hide_studio_overrides_widget, 0) save_btn = QtWidgets.QPushButton("Save") spacer_widget = QtWidgets.QWidget() @@ -584,6 +628,11 @@ class ProjectWidget(QtWidgets.QWidget): def _on_refresh(self): self.reset() + def _on_hide_studio_overrides(self, state): + self._hide_studio_overrides = (state == QtCore.Qt.Checked) + self._update_values() + self.hierarchical_style_update() + def _save_overrides(self): data = {} for item in self.input_fields: @@ -673,10 +722,13 @@ class ProjectWidget(QtWidgets.QWidget): for input_field in self.input_fields: input_field.update_default_values(default_values) - studio_values = {"project": { - PROJECT_SETTINGS_KEY: studio_project_settings(), - PROJECT_ANATOMY_KEY: studio_project_anatomy() - }} + if self._hide_studio_overrides: + studio_values = lib.NOT_SET + else: + studio_values = {"project": { + PROJECT_SETTINGS_KEY: studio_project_settings(), + PROJECT_ANATOMY_KEY: studio_project_anatomy() + }} for input_field in self.input_fields: input_field.update_studio_values(studio_values) From 4c54afea72e2f775e781052fbb10345c35aa6090 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 15:19:38 +0200 Subject: [PATCH 500/507] main check for develop arg changed --- pype/tools/settings/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/__main__.py b/pype/tools/settings/__main__.py index 044c2ef495..55a38b3604 100644 --- a/pype/tools/settings/__main__.py +++ b/pype/tools/settings/__main__.py @@ -11,7 +11,7 @@ if __name__ == "__main__": app.setStyleSheet(stylesheet) app.setWindowIcon(QtGui.QIcon(settings.style.app_icon_path())) - develop = "-dev" in sys.argv + develop = "-d" in sys.argv or "--develop" in sys.argv widget = settings.MainWidget(develop) widget.show() From 35a506b5f4e01f3e7dc959018489344679170bf1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 15 Sep 2020 18:43:51 +0200 Subject: [PATCH 501/507] fixed some alignments --- pype/tools/settings/settings/widgets/item_types.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 51ae0fc985..b79e6f7756 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -608,15 +608,19 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.setFocusProxy(self.text_input) + layout_kwargs = {} + if self.multiline: + layout_kwargs["alignment"] = QtCore.Qt.AlignTop + if not self._as_widget: self.key = input_data["key"] if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) + layout.addWidget(label_widget, 0, **layout_kwargs) self.label_widget = label_widget - layout.addWidget(self.text_input, 1) + layout.addWidget(self.text_input, 1, **layout_kwargs) self.text_input.textChanged.connect(self._on_value_change) @@ -823,9 +827,9 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): if not label_widget: label = input_data["label"] label_widget = QtWidgets.QLabel(label) - layout.addWidget(label_widget, 0) + layout.addWidget(label_widget, 0, alignment=QtCore.Qt.AlignTop) self.label_widget = label_widget - layout.addWidget(self.text_input, 1) + layout.addWidget(self.text_input, 1, alignment=QtCore.Qt.AlignTop) self.text_input.textChanged.connect(self._on_value_change) From c6b7346a9127712a142d72ae6e888fd4fe6e0224 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 16 Sep 2020 11:58:20 +0200 Subject: [PATCH 502/507] list widget has move up/down btns --- .../settings/settings/widgets/item_types.py | 136 ++++++++++++++++-- 1 file changed, 123 insertions(+), 13 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index b79e6f7756..8257f79fc2 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -9,6 +9,7 @@ from .widgets import ( PathInput ) from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET +from avalon.vendor import qtawesome class SettingObject(AbstractSettingObject): @@ -898,23 +899,46 @@ class ListItem(QtWidgets.QWidget, SettingObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) - self.add_btn = QtWidgets.QPushButton("+") - self.remove_btn = QtWidgets.QPushButton("-") + char_plus = qtawesome.charmap("fa.plus") + char_minus = qtawesome.charmap("fa.minus") + char_up = qtawesome.charmap("fa.angle-up") + char_down = qtawesome.charmap("fa.angle-down") + + self.add_btn = QtWidgets.QPushButton(char_plus) + self.remove_btn = QtWidgets.QPushButton(char_minus) + self.up_btn = QtWidgets.QPushButton(char_up) + self.down_btn = QtWidgets.QPushButton(char_down) + + font_plus_minus = qtawesome.font("fa", 10) + font_up_down = qtawesome.font("fa", 13) + + self.add_btn.setFont(font_plus_minus) + self.remove_btn.setFont(font_plus_minus) + self.up_btn.setFont(font_up_down) + self.down_btn.setFont(font_up_down) self.add_btn.setFocusPolicy(QtCore.Qt.ClickFocus) self.remove_btn.setFocusPolicy(QtCore.Qt.ClickFocus) + self.up_btn.setFocusPolicy(QtCore.Qt.ClickFocus) + self.down_btn.setFocusPolicy(QtCore.Qt.ClickFocus) self.add_btn.setFixedSize(self._btn_size, self._btn_size) self.remove_btn.setFixedSize(self._btn_size, self._btn_size) + self.up_btn.setFixedSize(self._btn_size, self._btn_size) + self.down_btn.setFixedSize(self._btn_size, self._btn_size) self.add_btn.setProperty("btn-type", "tool-item") self.remove_btn.setProperty("btn-type", "tool-item") + self.up_btn.setProperty("btn-type", "tool-item") + self.down_btn.setProperty("btn-type", "tool-item") layout.addWidget(self.add_btn, 0) layout.addWidget(self.remove_btn, 0) - self.add_btn.clicked.connect(self.on_add_clicked) - self.remove_btn.clicked.connect(self.on_remove_clicked) + self.add_btn.clicked.connect(self._on_add_clicked) + self.remove_btn.clicked.connect(self._on_remove_clicked) + self.up_btn.clicked.connect(self._on_up_clicked) + self.down_btn.clicked.connect(self._on_down_clicked) ItemKlass = TypeToKlass.types[object_type] self.value_input = ItemKlass( @@ -925,28 +949,62 @@ class ListItem(QtWidgets.QWidget, SettingObject): ) layout.addWidget(self.value_input, 1) + layout.addWidget(self.up_btn, 0) + layout.addWidget(self.down_btn, 0) + self.value_input.value_changed.connect(self._on_value_change) def set_as_empty(self, is_empty=True): self.value_input.setEnabled(not is_empty) self.remove_btn.setEnabled(not is_empty) + self.order_changed() self._on_value_change() + def order_changed(self): + row = self.row() + parent_row_count = self.parent_rows_count() + if parent_row_count == 1: + self.up_btn.setEnabled(False) + self.down_btn.setEnabled(False) + + elif row == 0: + self.up_btn.setEnabled(False) + self.down_btn.setEnabled(True) + + elif row == parent_row_count - 1: + self.up_btn.setEnabled(True) + self.down_btn.setEnabled(False) + + else: + self.up_btn.setEnabled(True) + self.down_btn.setEnabled(True) + def _on_value_change(self, item=None): self.value_changed.emit(self) def row(self): return self._parent.input_fields.index(self) - def on_add_clicked(self): + def parent_rows_count(self): + return len(self._parent.input_fields) + + def _on_add_clicked(self): if self.value_input.isEnabled(): self._parent.add_row(row=self.row() + 1) else: self.set_as_empty(False) - def on_remove_clicked(self): + def _on_remove_clicked(self): self._parent.remove_row(self) + def _on_up_clicked(self): + row = self.row() + self._parent.swap_rows(row - 1, row) + + def _on_down_clicked(self): + row = self.row() + self._parent.swap_rows(row, row + 1) + def config_value(self): if self.value_input.isEnabled(): return self.value_input.item_value() @@ -1044,21 +1102,58 @@ class ListWidget(QtWidgets.QWidget, InputObject): if self.count() == 0: self.add_row(is_empty=True) + def swap_rows(self, row_1, row_2): + if row_1 == row_2: + return + + if row_1 > row_2: + row_1, row_2 = row_2, row_1 + + field_1 = self.input_fields[row_1] + field_2 = self.input_fields[row_2] + + self.input_fields[row_1] = field_2 + self.input_fields[row_2] = field_1 + + layout_index = self.inputs_layout.indexOf(field_1) + self.inputs_layout.insertWidget(layout_index + 1, field_1) + + field_1.order_changed() + field_2.order_changed() + def add_row(self, row=None, value=None, is_empty=False): # Create new item item_widget = ListItem( self.object_type, self.input_modifiers, self, self.inputs_widget ) + if row is None: + if self.input_fields: + self.input_fields[-1].order_changed() + self.inputs_layout.addWidget(item_widget) + self.input_fields.append(item_widget) + else: + previous_field = None + if row > 0: + previous_field = self.input_fields[row - 1] + + next_field = None + max_index = self.count() + if row < max_index: + next_field = self.input_fields[row] + + self.inputs_layout.insertWidget(row, item_widget) + self.input_fields.insert(row, item_widget) + if previous_field: + previous_field.order_changed() + + if next_field: + next_field.order_changed() + if is_empty: item_widget.set_as_empty() item_widget.value_changed.connect(self._on_value_change) - if row is None: - self.inputs_layout.addWidget(item_widget) - self.input_fields.append(item_widget) - else: - self.inputs_layout.insertWidget(row, item_widget) - self.input_fields.insert(row, item_widget) + item_widget.order_changed() previous_input = None for input_field in self.input_fields: @@ -1085,11 +1180,26 @@ class ListWidget(QtWidgets.QWidget, InputObject): def remove_row(self, item_widget): item_widget.value_changed.disconnect() + row = self.input_fields.index(item_widget) + previous_field = None + next_field = None + if row > 0: + previous_field = self.input_fields[row - 1] + + if row != len(self.input_fields) - 1: + next_field = self.input_fields[row + 1] + self.inputs_layout.removeWidget(item_widget) - self.input_fields.remove(item_widget) + self.input_fields.pop(row) item_widget.setParent(None) item_widget.deleteLater() + if previous_field: + previous_field.order_changed() + + if next_field: + next_field.order_changed() + if self.count() == 0: self.add_row(is_empty=True) From ff2dfec0757aa7974de9f0c49e850eeba35a3180 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 16 Sep 2020 13:37:14 +0200 Subject: [PATCH 503/507] plus minus signe are without awesome font --- pype/tools/settings/settings/widgets/item_types.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 8257f79fc2..ef1e0ad2e1 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -899,21 +899,15 @@ class ListItem(QtWidgets.QWidget, SettingObject): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(3) - char_plus = qtawesome.charmap("fa.plus") - char_minus = qtawesome.charmap("fa.minus") char_up = qtawesome.charmap("fa.angle-up") char_down = qtawesome.charmap("fa.angle-down") - self.add_btn = QtWidgets.QPushButton(char_plus) - self.remove_btn = QtWidgets.QPushButton(char_minus) + self.add_btn = QtWidgets.QPushButton("+") + self.remove_btn = QtWidgets.QPushButton("-") self.up_btn = QtWidgets.QPushButton(char_up) self.down_btn = QtWidgets.QPushButton(char_down) - font_plus_minus = qtawesome.font("fa", 10) font_up_down = qtawesome.font("fa", 13) - - self.add_btn.setFont(font_plus_minus) - self.remove_btn.setFont(font_plus_minus) self.up_btn.setFont(font_up_down) self.down_btn.setFont(font_up_down) From 1f0e5b65dde7bfe366003eca8e983af043fa964f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 16 Sep 2020 13:49:28 +0200 Subject: [PATCH 504/507] labels are at the top --- pype/tools/settings/settings/widgets/item_types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index ef1e0ad2e1..06eb82ce74 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1060,7 +1060,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): if not label_widget: label_widget = QtWidgets.QLabel(input_data["label"], self) - layout.addWidget(label_widget) + layout.addWidget(label_widget, alignment=QtCore.Qt.AlignTop) self.label_widget = label_widget @@ -2258,7 +2258,7 @@ class PathWidget(QtWidgets.QWidget, SettingObject): label = input_data["label"] label_widget = QtWidgets.QLabel(label) label_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) - layout.addWidget(label_widget, 0) + layout.addWidget(label_widget, 0, alignment=QtCore.Qt.AlignTop) self.label_widget = label_widget self.content_widget = QtWidgets.QWidget(self) From f943b7967949398bc75f5c81d90b12692ae9881f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 16 Sep 2020 14:23:20 +0200 Subject: [PATCH 505/507] abstract methods are implemented directly in SettingObject --- .../settings/settings/widgets/item_types.py | 163 ++++++++++++- .../settings/settings/widgets/widgets.py | 230 ------------------ 2 files changed, 161 insertions(+), 232 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 06eb82ce74..1872d72def 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -3,7 +3,6 @@ import logging import collections from Qt import QtWidgets, QtCore, QtGui from .widgets import ( - AbstractSettingObject, ExpandingWidget, NumberSpinBox, PathInput @@ -12,11 +11,31 @@ from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET from avalon.vendor import qtawesome -class SettingObject(AbstractSettingObject): +class SettingObject: is_input_type = True default_input_value = NOT_SET allow_actions = True default_state = "" + abstract_attributes = ("_parent", ) + + def __getattr__(self, name): + if name in self.abstract_attributes: + raise NotImplementedError( + "Attribute `{}` is not implemented. {}".format(name, self) + ) + return super(SettingObject, self).__getattribute__(name) + + @classmethod + def style_state(cls, is_invalid, is_overriden, is_modified): + items = [] + if is_invalid: + items.append("invalid") + else: + if is_overriden: + items.append("overriden") + if is_modified: + items.append("modified") + return "-".join(items) or cls.default_state def set_default_attributes(self): # Default input attributes @@ -245,6 +264,146 @@ class SettingObject(AbstractSettingObject): if item: return item.mouseReleaseEvent(self, event) + def _discard_changes(self): + self.ignore_value_changes = True + self.discard_changes() + self.ignore_value_changes = False + + def discard_changes(self): + raise NotImplementedError( + "{} Method `discard_changes` not implemented!".format( + repr(self) + ) + ) + + def _set_studio_default(self): + self.ignore_value_changes = True + self.set_studio_default() + self.ignore_value_changes = False + + def set_studio_default(self): + raise NotImplementedError( + "{} Method `set_studio_default` not implemented!".format( + repr(self) + ) + ) + + def _reset_to_pype_default(self): + self.ignore_value_changes = True + self.reset_to_pype_default() + self.ignore_value_changes = False + + def reset_to_pype_default(self): + raise NotImplementedError( + "{} Method `reset_to_pype_default` not implemented!".format( + repr(self) + ) + ) + + def _remove_overrides(self): + self.ignore_value_changes = True + self.remove_overrides() + self.ignore_value_changes = False + + def remove_overrides(self): + raise NotImplementedError( + "{} Method `remove_overrides` not implemented!".format( + repr(self) + ) + ) + + def _set_as_overriden(self): + self.ignore_value_changes = True + self.set_as_overriden() + self.ignore_value_changes = False + + def set_as_overriden(self): + raise NotImplementedError( + "{} Method `set_as_overriden` not implemented!".format(repr(self)) + ) + + def hierarchical_style_update(self): + raise NotImplementedError( + "{} Method `hierarchical_style_update` not implemented!".format( + repr(self) + ) + ) + + def update_default_values(self, parent_values): + raise NotImplementedError( + "{} does not have implemented `update_default_values`".format(self) + ) + + def update_studio_values(self, parent_values): + raise NotImplementedError( + "{} does not have implemented `update_studio_values`".format(self) + ) + + def apply_overrides(self, parent_values): + raise NotImplementedError( + "{} does not have implemented `apply_overrides`".format(self) + ) + + @property + def ignore_value_changes(self): + """Most of attribute changes are ignored on value change when True.""" + raise NotImplementedError( + "{} does not have implemented `ignore_value_changes`".format(self) + ) + + @ignore_value_changes.setter + def ignore_value_changes(self, value): + """Setter for global parent item to apply changes for all inputs.""" + raise NotImplementedError(( + "{} does not have implemented setter method `ignore_value_changes`" + ).format(self)) + + @property + def child_has_studio_override(self): + """Any children item is modified.""" + raise NotImplementedError( + "{} does not have implemented `child_has_studio_override`".format( + self + ) + ) + + @property + def child_modified(self): + """Any children item is modified.""" + raise NotImplementedError( + "{} does not have implemented `child_modified`".format(self) + ) + + @property + def child_overriden(self): + """Any children item is overriden.""" + raise NotImplementedError( + "{} does not have implemented `child_overriden`".format(self) + ) + + @property + def child_invalid(self): + """Any children item does not have valid value.""" + raise NotImplementedError( + "{} does not have implemented `child_invalid`".format(self) + ) + + def get_invalid(self): + """Return invalid item types all down the hierarchy.""" + raise NotImplementedError( + "{} does not have implemented `get_invalid`".format(self) + ) + + def item_value(self): + """Value of an item without key.""" + raise NotImplementedError( + "Method `item_value` not implemented!" + ) + + def studio_value(self): + """Output for saving changes or overrides.""" + return {self.key: self.item_value()} + class InputObject(SettingObject): def update_default_values(self, parent_values): diff --git a/pype/tools/settings/settings/widgets/widgets.py b/pype/tools/settings/settings/widgets/widgets.py index 96f8d2ec17..400b9371fd 100644 --- a/pype/tools/settings/settings/widgets/widgets.py +++ b/pype/tools/settings/settings/widgets/widgets.py @@ -226,233 +226,3 @@ class UnsavedChangesDialog(QtWidgets.QDialog): def on_discard_pressed(self): self.done(2) - - -class AbstractSettingObject: - abstract_attributes = ("_parent", ) - - def __getattr__(self, name): - if name in self.abstract_attributes: - raise NotImplementedError( - "Attribute `{}` is not implemented. {}".format(name, self) - ) - return super(AbstractSettingObject, self).__getattribute__(name) - - def update_default_values(self, parent_values): - raise NotImplementedError( - "{} does not have implemented `update_default_values`".format(self) - ) - - def update_studio_values(self, parent_values): - raise NotImplementedError( - "{} does not have implemented `update_studio_values`".format(self) - ) - - def apply_overrides(self, parent_values): - raise NotImplementedError( - "{} does not have implemented `apply_overrides`".format(self) - ) - - @property - def is_modified(self): - """Has object any changes that require saving.""" - raise NotImplementedError( - "{} does not have implemented `is_modified`".format(self) - ) - - @property - def is_overriden(self): - """Is object overriden so should be saved to overrides.""" - raise NotImplementedError( - "{} does not have implemented `is_overriden`".format(self) - ) - - @property - def any_parent_is_group(self): - raise NotImplementedError( - "{} does not have implemented `any_parent_is_group`".format(self) - ) - - @property - def was_overriden(self): - """Initial state after applying overrides.""" - raise NotImplementedError( - "{} does not have implemented `was_overriden`".format(self) - ) - - @property - def is_invalid(self): - """Value set in is not valid.""" - raise NotImplementedError( - "{} does not have implemented `is_invalid`".format(self) - ) - - @property - def is_group(self): - """Value set in is not valid.""" - raise NotImplementedError( - "{} does not have implemented `is_group`".format(self) - ) - - @property - def is_nullable(self): - raise NotImplementedError( - "{} does not have implemented `is_nullable`".format(self) - ) - - @property - def is_overidable(self): - """Should care about overrides.""" - raise NotImplementedError( - "{} does not have implemented `is_overidable`".format(self) - ) - - def any_parent_overriden(self): - """Any of parent object up to top hiearchy is overriden.""" - raise NotImplementedError( - "{} does not have implemented `any_parent_overriden`".format(self) - ) - - @property - def ignore_value_changes(self): - """Most of attribute changes are ignored on value change when True.""" - raise NotImplementedError( - "{} does not have implemented `ignore_value_changes`".format(self) - ) - - @ignore_value_changes.setter - def ignore_value_changes(self, value): - """Setter for global parent item to apply changes for all inputs.""" - raise NotImplementedError(( - "{} does not have implemented setter method `ignore_value_changes`" - ).format(self)) - - @property - def child_has_studio_override(self): - """Any children item is modified.""" - raise NotImplementedError( - "{} does not have implemented `child_has_studio_override`".format( - self - ) - ) - - @property - def child_modified(self): - """Any children item is modified.""" - raise NotImplementedError( - "{} does not have implemented `child_modified`".format(self) - ) - - @property - def child_overriden(self): - """Any children item is overriden.""" - raise NotImplementedError( - "{} does not have implemented `child_overriden`".format(self) - ) - - @property - def child_invalid(self): - """Any children item does not have valid value.""" - raise NotImplementedError( - "{} does not have implemented `child_invalid`".format(self) - ) - - def get_invalid(self): - """Returns invalid items all down the hierarchy.""" - raise NotImplementedError( - "{} does not have implemented `get_invalid`".format(self) - ) - - def item_value(self): - """Value of an item without key.""" - raise NotImplementedError( - "Method `item_value` not implemented!" - ) - - def studio_value(self): - """Output for saving changes or overrides.""" - return {self.key: self.item_value()} - - @classmethod - def style_state(cls, is_invalid, is_overriden, is_modified): - items = [] - if is_invalid: - items.append("invalid") - else: - if is_overriden: - items.append("overriden") - if is_modified: - items.append("modified") - return "-".join(items) or cls.default_state - - def add_children_gui(self, child_configuration, values): - raise NotImplementedError( - "{} Method `add_children_gui` is not implemented!.".format( - repr(self) - ) - ) - - def _discard_changes(self): - self.ignore_value_changes = True - self.discard_changes() - self.ignore_value_changes = False - - def discard_changes(self): - raise NotImplementedError( - "{} Method `discard_changes` not implemented!".format( - repr(self) - ) - ) - - def _set_studio_default(self): - self.ignore_value_changes = True - self.set_studio_default() - self.ignore_value_changes = False - - def set_studio_default(self): - raise NotImplementedError( - "{} Method `set_studio_default` not implemented!".format( - repr(self) - ) - ) - - def _reset_to_pype_default(self): - self.ignore_value_changes = True - self.reset_to_pype_default() - self.ignore_value_changes = False - - def reset_to_pype_default(self): - raise NotImplementedError( - "{} Method `reset_to_pype_default` not implemented!".format( - repr(self) - ) - ) - - def _remove_overrides(self): - self.ignore_value_changes = True - self.remove_overrides() - self.ignore_value_changes = False - - def remove_overrides(self): - raise NotImplementedError( - "{} Method `remove_overrides` not implemented!".format( - repr(self) - ) - ) - - def _set_as_overriden(self): - self.ignore_value_changes = True - self.set_as_overriden() - self.ignore_value_changes = False - - def set_as_overriden(self): - raise NotImplementedError( - "{} Method `set_as_overriden` not implemented!".format(repr(self)) - ) - - def hierarchical_style_update(self): - raise NotImplementedError( - "{} Method `hierarchical_style_update` not implemented!".format( - repr(self) - ) - ) From 81df713212f3259a9b60fc76af1e179588892f46 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 16 Sep 2020 15:32:59 +0200 Subject: [PATCH 506/507] added few docstrings --- .../settings/settings/widgets/item_types.py | 117 ++++++++++++------ 1 file changed, 80 insertions(+), 37 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 1872d72def..19bfdabb9e 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -12,21 +12,19 @@ from avalon.vendor import qtawesome class SettingObject: + # `is_input_type` attribute says if has implemented item type methods is_input_type = True + # each input must have implemented default value for development + # when defaults are not filled yet default_input_value = NOT_SET + # will allow to show actions for the item type (disabled for proxies) allow_actions = True + # default state of item type default_state = "" - abstract_attributes = ("_parent", ) - - def __getattr__(self, name): - if name in self.abstract_attributes: - raise NotImplementedError( - "Attribute `{}` is not implemented. {}".format(name, self) - ) - return super(SettingObject, self).__getattribute__(name) @classmethod def style_state(cls, is_invalid, is_overriden, is_modified): + """Return stylesheet state by intered booleans.""" items = [] if is_invalid: items.append("invalid") @@ -37,7 +35,11 @@ class SettingObject: items.append("modified") return "-".join(items) or cls.default_state - def set_default_attributes(self): + def _set_default_attributes(self): + """Create and reset attributes required for all item types. + + They may not be used in the item but are required to be set. + """ # Default input attributes self._has_studio_override = False self._had_studio_override = False @@ -73,7 +75,12 @@ class SettingObject: self.defaults_not_set = False def initial_attributes(self, input_data, parent, as_widget): - self.set_default_attributes() + """Prepare attributes based on entered arguments. + + This method should be same for each item type. Few item types + may require to extend with specific attributes for their case. + """ + self._set_default_attributes() self._parent = parent self._as_widget = as_widget @@ -90,24 +97,70 @@ class SettingObject: @property def develop_mode(self): + """Tool is in develop mode or not. + + Returns: + bool + + """ return self._parent.develop_mode @property def log(self): + """Auto created logger for debugging.""" if self._log is None: self._log = logging.getLogger(self.__class__.__name__) return self._log - @property - def has_studio_override(self): - return self._has_studio_override or self._parent.has_studio_override - @property def had_studio_override(self): + """Item had studio overrides on refresh. + + Returns: + bool + + """ return self._had_studio_override + @property + def has_studio_override(self): + """Item has studio override at the moment. + + With combination of `had_studio_override` is possible to know if item + has changes (not just value change). + + Returns: + bool + + """ + return self._has_studio_override or self._parent.has_studio_override + + @property + def is_group(self): + """Item represents key that can be overriden. + + Attribute `is_group` can be set to True only once in item hierarchy. + + Returns: + bool + + """ + return self._is_group + @property def any_parent_is_group(self): + """Any parent of item is group. + + Attribute holding this information is set during creation and + stored to `_any_parent_is_group`. + + Why is this information useful: If any parent is group and + the parent is set as overriden, this item is overriden too. + + Returns: + bool + + """ if self._any_parent_is_group is None: return super(SettingObject, self).any_parent_is_group return self._any_parent_is_group @@ -130,7 +183,7 @@ class SettingObject: @property def was_overriden(self): - """Initial state after applying overrides.""" + """Item had set value of project overrides on project change.""" if self._as_widget: return self._parent.was_overriden return self._was_overriden @@ -140,13 +193,12 @@ class SettingObject: """Value set in is not valid.""" return self._is_invalid - @property - def is_group(self): - """Value set in is not valid.""" - return self._is_group - @property def is_nullable(self): + """Value of item can be set to None. + + NOT IMPLEMENTED! + """ return self._is_nullable @property @@ -155,7 +207,12 @@ class SettingObject: return self._parent.is_overidable def any_parent_overriden(self): - """Any of parent object up to top hiearchy is overriden.""" + """Any of parent objects up to top hiearchy item is overriden. + + Returns: + bool + + """ if self._parent._is_overriden: return True return self._parent.any_parent_overriden() @@ -344,20 +401,6 @@ class SettingObject: "{} does not have implemented `apply_overrides`".format(self) ) - @property - def ignore_value_changes(self): - """Most of attribute changes are ignored on value change when True.""" - raise NotImplementedError( - "{} does not have implemented `ignore_value_changes`".format(self) - ) - - @ignore_value_changes.setter - def ignore_value_changes(self, value): - """Setter for global parent item to apply changes for all inputs.""" - raise NotImplementedError(( - "{} does not have implemented setter method `ignore_value_changes`" - ).format(self)) - @property def child_has_studio_override(self): """Any children item is modified.""" @@ -1049,7 +1092,7 @@ class ListItem(QtWidgets.QWidget, SettingObject): def __init__(self, object_type, input_modifiers, config_parent, parent): super(ListItem, self).__init__(parent) - self.set_default_attributes() + self._set_default_attributes() self._parent = config_parent self._any_parent_is_group = True @@ -1430,7 +1473,7 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): def __init__(self, object_type, input_modifiers, config_parent, parent): super(ModifiableDictItem, self).__init__(parent) - self.set_default_attributes() + self._set_default_attributes() self._parent = config_parent self.is_key_duplicated = False From 1273e7c6ef9367302a77b50c2198b87b3bba84f1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 16 Sep 2020 15:36:26 +0200 Subject: [PATCH 507/507] fixed typo --- pype/tools/settings/settings/widgets/item_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 19bfdabb9e..e2d59c2e69 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -284,7 +284,7 @@ class SettingObject: and not self.any_parent_is_group and not self._had_studio_override ): - action = QtWidgets.QAction("Set sudio default") + action = QtWidgets.QAction("Set studio default") actions_mapping[action] = self._set_studio_default menu.addAction(action)