This commit is contained in:
2025-11-23 23:31:18 +08:00
parent d60cdc52fd
commit 9f7667a475
710 changed files with 252869 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
# Switch the camera of current actived 3d view to persp camera.
import maya.mel as mel
mel.eval('MGP_SetActiveViewCamera "persp"')
# To-Do: replace the string with the camera name you wanna switch to.

View File

@@ -0,0 +1,7 @@
# Get currently interactive attribute button's maya attribute:
# if the attribute is not linked to a maya attribute, this will return empty string.
# the return attribute string is of format: nodeName.attributeName.
# argument: 0 for no namespace, 1 for has namespace.
import maya.mel as mel
attribute = mel.eval("MGP_GetCurrentAttributeButton_Attribute 0")

View File

@@ -0,0 +1,4 @@
# get the dierctory path of current picker file.
import maya.mel as mel
pickerDir = mel.eval("MGP_GetCurrentPickerDirectory")

View File

@@ -0,0 +1,4 @@
# get the full path of current picker file/node.
import maya.mel as mel
pickerFileOrNode = mel.eval("MGP_GetCurrentPickerFileOrNode")

View File

@@ -0,0 +1,4 @@
# get the namespace of current picker file.
import maya.mel as mel
currentPickerNamespace = mel.eval("MGP_GetCurrentPickerNamespace")

View File

@@ -0,0 +1,4 @@
# Cancel the isolation for currently activated model view.
import maya.mel as mel
mel.eval("MGP_CancelIsolation")

View File

@@ -0,0 +1,4 @@
# Isolate selected objects for currently activated model view.
import maya.mel as mel
mel.eval("MGP_IsolateSelectedObjects")

View File

@@ -0,0 +1,4 @@
# Isolate selected objects' whole rigs for currently activated model view.
import maya.mel as mel
mel.eval("MGP_IsolateSelectedRig")

View File

@@ -0,0 +1,4 @@
# Set keyframs at current frame, only on those channels are of non-default values.
import maya.mel as mel
mel.eval("MG_SetKeyframeNonDefaultChannels")

View File

@@ -0,0 +1,6 @@
# Popup a prompt dialog, which user could input a frame count to keyframe object at this each frame count.
import maya.mel as mel
mel.eval(
"MGP_SetKeyframeEachKeyOrGap 1"
) # arg: 0 for each keytick, 1 for each certain frames.

View File

@@ -0,0 +1,6 @@
# Set keyframe each keytick via time range control.The ensure each selected object all have keys at same frames.
import maya.mel as mel
mel.eval(
"MGP_SetKeyframeEachKeyOrGap 0"
) # arg: 0 for each keytick, 1 for each certain frames.

View File

@@ -0,0 +1,4 @@
# Set keyframe only if the attribute is already keyframed.
import maya.mel as mel
mel.eval("MGP_SetKeyframeForOnlyKeyframed")

View File

@@ -0,0 +1,5 @@
# Reactivate the model view, so animators could have access to the hotkeys features of Maya, such as set keys,etc.
# but ususually you don't need to do so, cos MG-Picker in animator interactive mode does so automatically after each mouse left mouse button clicking.
import maya.mel as mel
mel.eval("MGP_ReactiveModelViewport")

View File

@@ -0,0 +1,6 @@
# Add Mirrored objects into selection via current picker's mirror relationship.
import maya.mel as mel
mel.eval(
"MGP_MirrorSelection 1"
) # arg: 0 for replace selection, 1 for add to selection.

View File

@@ -0,0 +1,5 @@
# Add all selectButton & slider members of current picker panel to scene selection.
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPanelAllSelectButtons 1")

View File

@@ -0,0 +1,5 @@
# Add all selectButton & slider members of current picker to scene selection:
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPickerAllSelectButtons 1")

View File

@@ -0,0 +1,5 @@
# Deselect all selectButton & slider members of current picker panel from scene selection.
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPanelAllSelectButtons 2")

View File

@@ -0,0 +1,5 @@
# Deselect all selectButton & slider members of current picker from scene selection.
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPickerAllSelectButtons 2")

View File

@@ -0,0 +1,5 @@
# Toggle all selectButton & slider members selection states of current picker panel.
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPanelAllSelectButtons 3")

View File

@@ -0,0 +1,5 @@
# Toggle all selectButton & slider members selection states of current picker.
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPickerAllSelectButtons 3")

View File

@@ -0,0 +1,4 @@
# Mirror selection & slider via current picker's mirror relationship.
import maya.mel as mel
mel.eval("MGP_MirrorSelection 0") # arg: 0 for replace selection,1 for add selection.

View File

@@ -0,0 +1,5 @@
# Select all selectButton & slider members of current picker panel.
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPanelAllSelectButtons 0")

View File

@@ -0,0 +1,6 @@
# Select all selectButton & slider members of the picker panel with the panel index.
# The first int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
# The second int arg stands for the panel index.
import maya.mel as mel
mel.eval("MGP_EvalPanelAllSelectButtons_viaPanelIndex 0 0")

View File

@@ -0,0 +1,5 @@
# Select all selectButton & slider members of current picker.
# The int arg stands for the selection mode, 0 for replace selection,1 for add selection, 2 for remove selection, 3 for invert selection.
import maya.mel as mel
mel.eval("MGP_EvalPickerAllSelectButtons 0")

View File

@@ -0,0 +1,6 @@
import maya.mel as mel
newNamespace = "" # To-Do: replace the "newNamespace" variable with your value.
mel.eval(
'MGP_SetCurrentPickerNamespace "' + newNamespace + '"'
) # set current picker namespace.

View File

@@ -0,0 +1,4 @@
# pop up set namespace ui:
import maya.mel as mel
mel.eval("MGP_SetCurrentPickerNamespace_WithUI")

View File

@@ -0,0 +1,4 @@
# To-Do: replace the int with the target panel index, 0 is usually the first panel.
import maya.mel as mel
mel.eval("MGP_GoToPanel 0")