mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Remove Xgen incremental save feature
This commit is contained in:
parent
ff6fe13e2a
commit
40f8bc25f5
2 changed files with 0 additions and 41 deletions
|
|
@ -29,43 +29,6 @@ if bool(int(os.environ.get(key, "0"))):
|
|||
)
|
||||
|
||||
|
||||
# Setup Xgen save callback.
|
||||
def xgen_on_save():
|
||||
"""Increments the xgen side car files .xgen and .xgd
|
||||
|
||||
Only works when incrementing to the same directory.
|
||||
"""
|
||||
|
||||
file_path = current_file()
|
||||
current_dir = os.path.dirname(file_path)
|
||||
basename = os.path.basename(file_path).split(".")[0]
|
||||
attrs = ["xgFileName", "xgBaseFile"]
|
||||
for palette in cmds.ls(type="xgmPalette"):
|
||||
for attr in attrs:
|
||||
source = os.path.join(
|
||||
current_dir, cmds.getAttr(palette + "." + attr)
|
||||
)
|
||||
if not os.path.exists(source):
|
||||
continue
|
||||
|
||||
destination_basename = "{}__{}{}".format(
|
||||
basename,
|
||||
palette.replace(":", "_"),
|
||||
os.path.splitext(source)[1]
|
||||
)
|
||||
destination = os.path.join(current_dir, destination_basename)
|
||||
|
||||
if source == destination:
|
||||
continue
|
||||
|
||||
shutil.copy(source, destination)
|
||||
cmds.setAttr(
|
||||
palette + "." + attr, destination_basename, type="string"
|
||||
)
|
||||
|
||||
|
||||
register_event_callback("save", xgen_on_save)
|
||||
|
||||
# Build a shelf.
|
||||
settings = get_project_settings(os.environ['AVALON_PROJECT'])
|
||||
shelf_preset = settings['maya'].get('project_shelf')
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@ Importing XGen Collections...
|
|||
# Error: XGen: Failed to import collection from file P:/PROJECTS/OP01_CG_demo/shots/sh040/work/Lighting/cg_ball_xgenMain_v035__ball_rigMain_01___collection.xgen #
|
||||
```
|
||||
|
||||
### Workfile Incremental Save
|
||||
|
||||
When you increment the Maya workfile to a new version, all `.xgen` and `.xgd` files referenced by the Xgen collection in the workspace is incremented as well.
|
||||
|
||||
## Create
|
||||
|
||||
Create an Xgen instance to publish. This needs to contain only **one Xgen collection**.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue