Scripts and Tips


UNDO problem (TIP)

I noticed a problem with the UNDO command.
Sometimes, you need to press a few times Ctrl+Z before the operation will be canceled.
If it drives you crazy - that's three things that should help.
  1. Close the Reference Editor window.
  2. Check what is written in Command Response strip or Script Editor when doing UNDO.
    If there is an inscription - isolateSelect-loadSelected modelEditor1;
    do mel command:
    isolateSelect -state 0 modelEditor1;
    (where "modelEditor1" is the same name as in response command)
  3. Switch the Show-> Isolate View -> "auto load selected objects"
I hope that helps :)


Separate namespace from selection (PYTHON)

import maya.cmds as maya
selected = maya.ls(sl=1)
splitedNames = selected[0].split(":")
obj = splitedNames.pop()
namespace = ':'.join(splitedNames)

After the operation you'll get two variables:
obj - is a name of selected object
namespace - is a string containing the namespace
Remember to join both variables by +":"+


Delete/Select animation curves (MEL)

The script allows you to delete all the animation curves produced during the setting of the skin cluster:
$selected = `ls -typ animCurveTL -typ animCurveTA -typ animCurveTU `;
delete $selected;

Also useful when you need to select and move all animation:
$selected = `ls -typ animCurveTL -typ animCurveTA -typ animCurveTU `;
select $selected;


Toggle "SnapToFrame" (Hotkey)

ALT + C
{
int $snapState = `timeControl -q -snap $gPlayBackSlider`;
if ($snapState==1)
{timeControl -e -snap false $gPlayBackSlider;}
else
{timeControl -e -snap true $gPlayBackSlider;}
}


2 komentarze:

  1. Thanks for the snapping toggle script, exactly what I was looking for.

    OdpowiedzUsuń