-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import maya.cmds as cmds | ||
import maya.mel as mel | ||
|
||
|
||
def inspect(): | ||
return get_ghosting_node() | ||
|
||
|
||
def fix_selected(node): | ||
unghost_node(node) | ||
|
||
|
||
def fix_all(nodes): | ||
unghost_all() | ||
|
||
|
||
def get_ghosting_node(): | ||
""" | ||
Get ghosting node in the scene | ||
:return: list. list of ghosting node names | ||
""" | ||
return cmds.ls(ghost=1) | ||
|
||
|
||
def unghost_node(node): | ||
""" | ||
Set ghosting to false on a node | ||
:param node: str. node name to un-ghost | ||
""" | ||
cmds.setAttr('{}.ghosting'.format(node), 0) | ||
cmds.setAttr('{}.ghostingControl'.format(node), 0) | ||
|
||
|
||
def unghost_all(): | ||
""" | ||
Set ghosting to false for all nodes | ||
""" | ||
mel.eval("unGhostAll;") | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import maya.cmds as cmds | ||
|
||
|
||
def inspect(): | ||
return get_unknown_node() | ||
|
||
|
||
def fix_selected(node): | ||
delete_unknown_node(node) | ||
|
||
|
||
def fix_all(nodes): | ||
delete_all_unknown() | ||
|
||
|
||
def get_unknown_node(): | ||
""" | ||
Get unknown node in the scene | ||
:return: list. names of the unknown nodes | ||
""" | ||
return cmds.ls(type="unknown") | ||
|
||
|
||
def delete_unknown_node(node): | ||
""" | ||
Delete given unknown node | ||
:param node: str. name of the unknown node | ||
""" | ||
locked_state = cmds.lockNode(node, q=1, l=1) | ||
if locked_state[0] == 1: | ||
cmds.lockNode(node, l=0) | ||
cmds.delete(node) | ||
|
||
|
||
def delete_all_unknown(): | ||
""" | ||
Delete all unknown node in scene | ||
""" | ||
cmds.delete(cmds.ls(type="unknown")) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import maya.cmds as cmds | ||
|
||
|
||
def inspect(): | ||
return get_unknown_plugin() | ||
|
||
|
||
def fix_selected(node): | ||
delete_unknown_plugin(node) | ||
|
||
|
||
def fix_all(nodes): | ||
for plugin in nodes: | ||
delete_unknown_plugin(plugin) | ||
|
||
|
||
def get_unknown_plugin(): | ||
""" | ||
Get unknown plugin in the scene | ||
:return: list. names of the unknown plugins | ||
""" | ||
return cmds.unknownPlugin(q=1, l=1) | ||
|
||
|
||
def delete_unknown_plugin(plugin): | ||
""" | ||
Delete given unknown plugins | ||
:param plugin: str. name of the unknown plugins | ||
""" | ||
cmds.unknownPlugin(plugin, remove=1) | ||
|