This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pxr import Usd, UsdGeom, Sdf, Vt, Gf | |
| # Create a new stage in memory | |
| stage =Usd.Stage.Open(r"path/to/file.usd") | |
| fps = stage.GetFramesPerSecond() or 24.0 # default when not authored is 24 | |
| for prim in stage.Traverse(): | |
| if not prim.IsA(UsdGeom.PointBased): | |
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ayon_api | |
| import json | |
| addon_name = "applications" | |
| addons = ayon_api.get_addons_info()["addons"] | |
| applications_addon = next(addon for addon in addons if addon["name"] == addon_name) | |
| variants = ["production", "staging"] # ignore dev bundles for now | |
| for addon_version, version_info in applications_addon["versions"].items(): | |
| if not version_info["hasSettings"]: | |
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Utility functions to easily set some attributes on Maya nodes for Maya USD Export to use. | |
| For example, make it easy to set the purpose, type or kind for the resulting USD Prims. | |
| See Maya USD - Custom Attributes and Tagging for USD: | |
| https://github.com/Autodesk/maya-usd/blob/dev/lib/mayaUsd/commands/Readme.md#custom-attributes-and-tagging-for-usd | |
| """ | |
| from __future__ import annotations | |
| from maya import cmds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See topic: https://forums.autodesk.com/t5/maya-programming-forum/hypershade-remove-tab-quot-projects-quot-on-startup/td-p/13642706 | |
| from maya import cmds | |
| from maya import mel | |
| # def reset_hypershade_panel_lookup_table(): | |
| # mel.eval("lookupTableReset($gHyperShadePanelLookupTable);") | |
| def delete_tab_optionvar(optionvar: str): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Literal | |
| import maya.cmds as cmds | |
| def set_usd_subdivision_scheme( | |
| mesh: str, | |
| scheme: Literal["catmullClark", "none", "loop", "bilinear", None] = "catmullClark" | |
| ): | |
| """Set mesh USD Subdivision Scheme for export | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ================== | |
| >> oiiotool --buildinfo | |
| Invalid option "--buildinfo" | |
| oiiotool -- simple image processing operations | |
| OpenImageIO 2.3.10 http://www.openimageio.org | |
| Usage: oiiotool [filename|command]... | |
| Important usage tips: | |
| * The oiiotool command line is processed in order, LEFT to RIGHT. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Set selected Resolvetimeline name versions to project name version.""" | |
| from typing import Optional | |
| import re | |
| import DaVinciResolveScript as bmd | |
| VERSION_REGEX = re.compile(r'_v(\d+)') | |
| resolve = bmd.scriptapp('Resolve') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Tuple, Union, Optional | |
| def get_tool_resolution( | |
| tool, | |
| output: Union[str, int, None] = None, | |
| frame: Optional[int] = None, | |
| allow_fast_dod_query=True | |
| ) -> Tuple[int, int]: | |
| """Return tool output resolution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Example on using AYON's generative links to query whether the loaded products | |
| in current workfile happen to have input products that some of the products | |
| were also generated with and see if those versions match. | |
| For example: You have a loaded model v002 and loaded look v001, however | |
| that look version was created using model v001. You may want to identify that. | |
| This script will print out a message for each product that has a version in the | |
| inputs where another version of that input product is loaded in the scene. |
NewerOlder