Skip to content

Instantly share code, notes, and snippets.

@julik
Created July 5, 2010 22:58
Show Gist options
  • Save julik/464794 to your computer and use it in GitHub Desktop.
Save julik/464794 to your computer and use it in GitHub Desktop.
//SIZZLET Rename and Renumber Selected Trackers
// Renames or prefixes selected tracker names
dlg = NewDialog("pfxTrackersDLG")
dlg.Radio("doPrefix", "Prefix existing names", 1)
dlg.Radio("doSuffix", "Suffix existing names", 0)
dlg.Radio("doRename", "Rename and renumber in selection", 0)
dlg.String("renameString", "Name prefix", "Xtra")
dlg.Show()
obj = Scene.activeObj
ti = 0;
for (tk in obj.trk)
if(tk.isSel)
if (dlg.doRename)
ti++;
tk.nm = printf("%s_%d", dlg.renameString, ti)
elsif (dlg.doSuffix)
tk.nm = printf("%s_%s", tk.nm, dlg.renameString)
else
tk.nm = printf("%s_%s", dlg.renameString, tk.nm)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment