Skip to content

Instantly share code, notes, and snippets.

proc switch_camera() {
// List of camera names in the cycle
string $cameras[] = {"persp", "front", "side", "top"};
// Get the current camera
string $current_camera = `lookThru -query`;
// Determine the next index in the cycle
int $current_index = -1;
// Iterate through camera list to find current camera index
@Fenixdg3duy
Fenixdg3duy / gist:56eae81e3064e5929938168c53d2cd88
Created May 2, 2024 18:06
back and front key in the middle
import pymel.core as pm
def insertKeyframeBetweenKeys():
try:
objects = pm.ls(sl=1)
attrs = pm.selectionConnection('graphEditor1FromOutliner', q=1, object=1)
for attr in attrs:
buffer = attr.split(".")
buffer = buffer[1]