Skip to content

Commit

Permalink
feat: Add new hook for fix no scene name
Browse files Browse the repository at this point in the history
Signed-off-by: loonghao <[email protected]>
  • Loading branch information
loonghao committed May 14, 2024
1 parent efa16d4 commit c32ea0c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions maya_umbrella/hooks/fix_no_scene_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Import built-in modules
import os

# Import local modules
from maya_umbrella.maya_funs import cmds
from maya_umbrella.maya_funs import om


def hook(virus_cleaner):
if not cmds.file(query=1, sceneName=1):
scene_name = om.currentFile()
scene_name = scene_name.replace("\\", "/")

if os.path.exists(scene_name):
cmds.file(rename=scene_name)

0 comments on commit c32ea0c

Please sign in to comment.