From 625eebea25dd93c127c47d394fdfc3e3d02e5c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Fri, 18 Sep 2020 17:32:56 +0200 Subject: [PATCH] maya plugins and capture settings --- .../plugins/maya/maya/maya_capture.json | 108 +++++ .../plugins/maya/maya/publish.json | 21 + .../plugins/maya/maya/workfile_build.json | 1 + .../projects_schema/1_plugins_gui_schema.json | 101 +--- .../projects_schema/2_maya_capture.json | 433 ++++++++++++++++++ .../projects_schema/2_maya_plugins.json | 90 ++++ .../projects_schema/2_maya_workfiles.json | 6 + pype/tools/settings/settings/widgets/lib.py | 6 +- 8 files changed, 681 insertions(+), 85 deletions(-) create mode 100644 pype/settings/defaults/project_settings/plugins/maya/maya/maya_capture.json create mode 100644 pype/settings/defaults/project_settings/plugins/maya/maya/publish.json create mode 100644 pype/settings/defaults/project_settings/plugins/maya/maya/workfile_build.json create mode 100644 pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_capture.json create mode 100644 pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_plugins.json create mode 100644 pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_workfiles.json diff --git a/pype/settings/defaults/project_settings/plugins/maya/maya/maya_capture.json b/pype/settings/defaults/project_settings/plugins/maya/maya/maya_capture.json new file mode 100644 index 0000000000..b6c4893034 --- /dev/null +++ b/pype/settings/defaults/project_settings/plugins/maya/maya/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/settings/defaults/project_settings/plugins/maya/maya/publish.json b/pype/settings/defaults/project_settings/plugins/maya/maya/publish.json new file mode 100644 index 0000000000..486f0917e2 --- /dev/null +++ b/pype/settings/defaults/project_settings/plugins/maya/maya/publish.json @@ -0,0 +1,21 @@ +{ + "ValidateModelName": { + "enabled": true, + "material_file": { + "windows": "", + "darwin": "", + "linux": "" + }, + "regex": "" + }, + "ValidateAssemblyName": { + "enabled": true + }, + "ValidateShaderName": { + "enabled": true, + "regex": "(?P.*)_(.*)_SHD" + }, + "ValidateMeshHasOverlappingUVs": { + "enabled": true + } +} \ No newline at end of file diff --git a/pype/settings/defaults/project_settings/plugins/maya/maya/workfile_build.json b/pype/settings/defaults/project_settings/plugins/maya/maya/workfile_build.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/pype/settings/defaults/project_settings/plugins/maya/maya/workfile_build.json @@ -0,0 +1 @@ +{} \ No newline at end of file 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 f70495017e..560d214877 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 @@ -353,94 +353,27 @@ } ] }, { - "type": "dict", + "type": "dict-invisible", "collapsable": true, "key": "maya", "label": "Maya", "children": [ - { - "type": "dict", - "collapsable": true, - "key": "publish", - "label": "Publish plugins", - "is_file": true, - "children": [ - { - "type": "dict", - "collapsable": true, - "key": "ValidateModelName", - "label": "Validate Model Name", - "checkbox_key": "enabled", - "is_group": true, - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, { - "type": "text", - "key": "material_file", - "label": "Material File" - }, { - "type": "text", - "key": "regex", - "label": "Validation regex" - } - ] - }, { - "type": "dict", - "collapsable": true, - "key": "ValidateAssemblyName", - "label": "Validate Assembly Name", - "checkbox_key": "enabled", - "is_group": true, - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - } - ] - }, { - "type": "dict", - "collapsable": true, - "key": "ValidateShaderName", - "label": "ValidateShaderName", - "checkbox_key": "enabled", - "is_group": true, - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, { - "type": "text", - "key": "regex", - "label": "Validation regex" - } - ] - }, { - "type": "dict", - "collapsable": true, - "key": "ValidateMeshHasOverlappingUVs", - "label": "ValidateMeshHasOverlappingUVs", - "checkbox_key": "enabled", - "is_group": true, - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - } - ] - } - ] - }, { - "type": "raw-json", - "key": "workfile_build", - "label": "Workfile Build logic", - "is_file": true - } + { + "type": "dict", + "collapsable": true, + "key": "maya", + "label": "Maya", + "children": [ + { + "type": "schema", + "children": [ + "2_maya_capture", + "2_maya_plugins", + "2_maya_workfiles" + ] + } + ] + } ] }, { "type": "dict", diff --git a/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_capture.json b/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_capture.json new file mode 100644 index 0000000000..a7b44323d2 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_capture.json @@ -0,0 +1,433 @@ +{ + "type": "dict", + "collapsable": true, + "key": "maya_capture", + "label": "Maya Capture settings", + "is_file": true, + "children": [ + { + "type": "dict", + "collapsable": true, + "key": "Codec", + "label": "Codec", + "children": [ + { + "type": "text", + "key": "compression", + "label": "Compression type" + }, { + "type": "text", + "key": "format", + "label": "Data format" + }, { + "type": "number", + "key": "quality", + "label": "Quality", + "decimal": 0, + "minimum": 0, + "maximum": 100 + } + ] + }, { + "type": "dict", + "collapsable": true, + "key": "Display Options", + "label": "Display Options", + "children": [ + { + "type": "list", + "key": "background", + "label": "Background Color", + "object_type": "number", + "input_modifiers": { + "decimal": 3, + "minimum": 0, + "maximum": 1 + } + }, { + "type": "list", + "key": "backgroundBottom", + "label": "Bottom Background Color", + "object_type": "number", + "input_modifiers": { + "decimal": 3, + "minimum": 0, + "maximum": 1 + } + }, { + "type": "list", + "key": "backgroundTop", + "label": "Top Background Color", + "object_type": "number", + "input_modifiers": { + "decimal": 3, + "minimum": 0, + "maximum": 1 + } + }, { + "type": "boolean", + "key": "override_display", + "label": "Override display options" + } + ] + }, { + "type": "dict", + "collapsable": true, + "key": "Generic", + "label": "Generic", + "children": [ + { + "type": "boolean", + "key": "isolate_view", + "label": "Isolate view" + },{ + "type": "boolean", + "key": "off_screen", + "label": "Off Screen" + } + ] + },{ + "type": "dict", + "collapsable": true, + "key": "IO", + "label": "IO", + "children": [ + { + "type": "text", + "key": "name", + "label": "Name" + },{ + "type": "boolean", + "key": "open_finished", + "label": "Open finished" + },{ + "type": "boolean", + "key": "raw_frame_numbers", + "label": "Raw frame numbers" + },{ + "type": "list", + "key": "recent_playblasts", + "label": "Recent playbacks", + "object_type": "text" + },{ + "type": "boolean", + "key": "save_file", + "label": "Save file" + } + ] + },{ + "type": "dict", + "collapsable": true, + "key": "PanZoom", + "label": "Pan Zoom", + "children": [ + { + "type": "boolean", + "key": "pan_zoom", + "label": "Pan Zoom" + } + ] + },{ + "type": "dict", + "collapsable": true, + "key": "Renderer", + "label": "Renderer", + "children": [ + { + "type": "text", + "key": "rendererName", + "label": "Renderer name" + } + ] + },{ + "type": "dict", + "collapsable": true, + "key": "Resolution", + "label": "Resolution", + "children": [ + { + "type": "number", + "key": "width", + "label": "Width", + "decimal": 0, + "minimum": 0, + "maximum": 99999 + },{ + "type": "number", + "key": "height", + "label": "Height", + "decimal": 0, + "minimum": 0, + "maximum": 99999 + },{ + "type": "number", + "key": "percent", + "label": "percent", + "decimal": 1, + "minimum": 0, + "maximum": 200 + },{ + "type": "text", + "key": "mode", + "label": "Mode" + } + ] + },{ + "type": "dict", + "collapsable": true, + "key": "Time Range", + "label": "Time Range", + "children": [ + { + "type": "number", + "key": "start_frame", + "label": "Start frame", + "decimal": 0, + "minimum": 0, + "maximum": 999999 + },{ + "type": "number", + "key": "end_frame", + "label": "End frame", + "decimal": 0, + "minimum": 0, + "maximum": 999999 + },{ + "type": "text", + "key": "mode", + "label": "Mode" + },{ + "type": "text", + "key": "frame", + "label": "Frame" + },{ + "type": "text", + "key": "time", + "label": "Time" + } + ] + },{ + "type": "dict", + "collapsable": true, + "key": "Viewport Options", + "label": "Viewport Options", + "children": [ + { + "type": "boolean", + "key": "cameras", + "label": "cameras" + },{ + "type": "boolean", + "key": "clipGhosts", + "label": "clipGhosts" + },{ + "type": "boolean", + "key": "controlVertices", + "label": "controlVertices" + },{ + "type": "boolean", + "key": "deformers", + "label": "deformers" + },{ + "type": "boolean", + "key": "dimensions", + "label": "dimensions" + },{ + "type": "number", + "key": "displayLights", + "label": "displayLights", + "decimal": 0, + "minimum": 0, + "maximum": 10 + },{ + "type": "boolean", + "key": "dynamicConstraints", + "label": "dynamicConstraints" + },{ + "type": "boolean", + "key": "dynamics", + "label": "dynamics" + },{ + "type": "boolean", + "key": "fluids", + "label": "fluids" + },{ + "type": "boolean", + "key": "follicles", + "label": "follicles" + },{ + "type": "boolean", + "key": "gpuCacheDisplayFilter", + "label": "gpuCacheDisplayFilter" + },{ + "type": "boolean", + "key": "greasePencils", + "label": "greasePencils" + },{ + "type": "boolean", + "key": "grid", + "label": "grid" + },{ + "type": "boolean", + "key": "hairSystems", + "label": "hairSystems" + },{ + "type": "boolean", + "key": "handles", + "label": "handles" + },{ + "type": "boolean", + "key": "high_quality", + "label": "high_quality" + },{ + "type": "boolean", + "key": "hud", + "label": "hud" + },{ + "type": "boolean", + "key": "hulls", + "label": "hulls" + },{ + "type": "boolean", + "key": "ikHandles", + "label": "ikHandles" + },{ + "type": "boolean", + "key": "imagePlane", + "label": "imagePlane" + },{ + "type": "boolean", + "key": "joints", + "label": "joints" + },{ + "type": "boolean", + "key": "lights", + "label": "lights" + },{ + "type": "boolean", + "key": "locators", + "label": "locators" + },{ + "type": "boolean", + "key": "manipulators", + "label": "manipulators" + },{ + "type": "boolean", + "key": "motionTrails", + "label": "motionTrails" + },{ + "type": "boolean", + "key": "nCloths", + "label": "nCloths" + },{ + "type": "boolean", + "key": "nParticles", + "label": "nParticles" + },{ + "type": "boolean", + "key": "nRigids", + "label": "nRigids" + },{ + "type": "boolean", + "key": "nurbsCurves", + "label": "nurbsCurves" + },{ + "type": "boolean", + "key": "nurbsSurfaces", + "label": "nurbsSurfaces" + },{ + "type": "boolean", + "key": "override_viewport_options", + "label": "override_viewport_options" + },{ + "type": "boolean", + "key": "particleInstancers", + "label": "particleInstancers" + },{ + "type": "boolean", + "key": "pivots", + "label": "pivots" + },{ + "type": "boolean", + "key": "planes", + "label": "planes" + },{ + "type": "boolean", + "key": "pluginShapes", + "label": "pluginShapes" + },{ + "type": "boolean", + "key": "polymeshes", + "label": "polymeshes" + },{ + "type": "boolean", + "key": "shadows", + "label": "shadows" + },{ + "type": "boolean", + "key": "strokes", + "label": "strokes" + },{ + "type": "boolean", + "key": "subdivSurfaces", + "label": "subdivSurfaces" + },{ + "type": "boolean", + "key": "textures", + "label": "textures" + },{ + "type": "boolean", + "key": "twoSidedLighting", + "label": "twoSidedLighting" + } + ] + },{ + "type": "dict", + "collapsable": true, + "key": "Camera Options", + "label": "Camera Options", + "children": [ + { + "type": "boolean", + "key": "displayGateMask", + "label": "displayGateMask" + },{ + "type": "boolean", + "key": "displayResolution", + "label": "displayResolution" + },{ + "type": "boolean", + "key": "displayFilmGate", + "label": "displayFilmGate" + },{ + "type": "boolean", + "key": "displayFieldChart", + "label": "displayFieldChart" + },{ + "type": "boolean", + "key": "displaySafeAction", + "label": "displaySafeAction" + },{ + "type": "boolean", + "key": "displaySafeTitle", + "label": "displaySafeTitle" + },{ + "type": "boolean", + "key": "displayFilmPivot", + "label": "displayFilmPivot" + },{ + "type": "boolean", + "key": "displayFilmOrigin", + "label": "displayFilmOrigin" + },{ + "type": "number", + "key": "overscan", + "label": "overscan", + "decimal": 1, + "minimum": 0, + "maximum": 10 + } + ] + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_plugins.json b/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_plugins.json new file mode 100644 index 0000000000..7ba9608610 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_plugins.json @@ -0,0 +1,90 @@ +{ + "type": "dict", + "collapsable": true, + "key": "publish", + "label": "Publish plugins", + "is_file": true, + "children": [ + { + "type": "dict", + "collapsable": true, + "key": "ValidateModelName", + "label": "Validate Model Name", + "checkbox_key": "enabled", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "label", + "label": "Path to material file defining list of material names to check. This is material name per line simple text file.
It will be checked against named group shader in your Validation regex.

For example:
^.*(?P=<shader>.+)_GEO

" + }, + { + "type": "path-widget", + "key": "material_file", + "label": "Material File", + "multiplatform": true, + "multipath": false + }, + { + "type": "text", + "key": "regex", + "label": "Validation regex" + } + ] + }, { + "type": "dict", + "collapsable": true, + "key": "ValidateAssemblyName", + "label": "Validate Assembly Name", + "checkbox_key": "enabled", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + } + ] + }, { + "type": "dict", + "collapsable": true, + "key": "ValidateShaderName", + "label": "ValidateShaderName", + "checkbox_key": "enabled", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { + "type": "label", + "label": "Shader name regex can use named capture group asset to validate against current asset name.

Example:
^.*(?P=<asset>.+)_SHD

" + + }, { + "type": "text", + "key": "regex", + "label": "Validation regex" + } + ] + }, { + "type": "dict", + "collapsable": true, + "key": "ValidateMeshHasOverlappingUVs", + "label": "ValidateMeshHasOverlappingUVs", + "checkbox_key": "enabled", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + } + ] + } + ] + } diff --git a/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_workfiles.json b/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_workfiles.json new file mode 100644 index 0000000000..bae4d32abd --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/projects_schema/2_maya_workfiles.json @@ -0,0 +1,6 @@ +{ + "type": "raw-json", + "key": "workfile_build", + "label": "Workfile Build logic", + "is_file": true +} diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index e225d65417..24dc4b552c 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -300,7 +300,11 @@ def gui_schema(subfolder, main_schema_name): filepath = os.path.join(dirpath, filename) with open(filepath, "r") as json_stream: - schema_data = json.load(json_stream) + try: + schema_data = json.load(json_stream) + except Exception as e: + raise Exception((f"Unable to parse JSON file {json_stream}\n " + f" - {e}")) from e loaded_schemas[basename] = schema_data main_schema = _fill_inner_schemas(