Skip to content

🐶 Vim plugin for sending the contents of the current vim buffer to Maya or Motionbuilder

License

Notifications You must be signed in to change notification settings

LexFrench/vim-JakeSender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-JakeSender

GPL Licence Codacy Badge Maintainability CodeFactor

Vim-JakeSender logo

JakeSender is a basic vim plugin for sending python code from the current vim buffer (or visual selection) to Autodesk's Maya or Autodesk's Motionbuilder

Jake is a good boy (sic) that will hide your commands, like a bone, in a special safe place ($TEMPDIR) and then like Lassie, go tell Maya or Motionbuilder where to find the file and to execute the content.

Installation

Via Plugin Manager (USE ONE!)

  1. Add Plug 'lexfrench/vim-jakesender' to your vimerc file
  2. Reload your vimrc or restart vim
  3. :PlugInstall

Vundle or similar

  1. Add Plugin 'lexfrench/vim-jakesender' to your vimrc file
  2. Reload your vimrc or restart
  3. Run :BundleInstall
  1. Add NeoBundle 'lexfrench/vim-jakesender' to your vimrc file
  2. Reload your vimrc or restart
  3. Run :NeoUpdate
cd ~/.vim/bundle
git clone https://github.com/lexfrench/vim-jakesender.git

Manual Installation

Unix

(For Neovim, change ~/.vim/ to ~/.config/nvim/.)

curl -fLo ~/.vim/plugin/jakeSender.vim --create-dirs \
  https://raw.githubusercontent.com/lexfrench/vim-jakesender/master/plugin/jakeSender.vim
curl -fLo ~/.vim/doc/jakeSender.txt --create-dirs \
  https://raw.githubusercontent.com/lexfrench/vim-jakesender/master/doc/jakeSender.txt

Maya Configuration

In order to send commands to Maya, you'll need to enable the command port on startup. This can be done by adding the following to your userSetup.py file in your Maya scripts folder.

  1. Create a userSetup.py file if you don't already have one
touch ~/maya/scripts/userSetup.py
  1. Add the following
import maya.cmds as cmds

cmds.commandPort(name=":8722", sourceType="mel", noreturn=False, echoOutput=False, bufferSize=4096)

Motionbuilder Configuration

In order to send commands to Motionbuilder, you'll need to enable the python server in the Motionbuilder Preferences. Check here.

Usage

Documentation

Please see the vim help system for full documentation of all options: :help jakeSender

Commands

The following commands are available to send the buffer content to supported hosts (Maya and Motionbuilder):

  • SendBufferToMaya : Sends the current buffer to Maya's command port
  • SendBufferToMobu : Sends the current buffer to Motionbuilder's telnet server
  • SendSelectionToMobu : Sends the visual selection to Motionbuilder's telnet server
  • SendSelectionToMobu : Sends the visual selection to Motionbuilder's telnet server
  • SendLineToMaya : Sends the current (single) line to Maya's command port
  • SendLineToMobu : Sends the current (single) line to Motionbuilder's telnet server

Basic Settings

" Host's address to send commands (This should be localhost or 127.0.0.1 in 99.99999% of the cases)
let g:jakeSenderHost="localhost"

" The port to send Maya commands to
let g:jakeSenderMayaPort=8722

" The telnet port for Motionbuilder's python server
let g:jakeSenderMobuPort=4242

Default mappings

The following key mappings are provided by default:

  • <leader>m [SendBufferToMaya]
  • <leader>x [SendBufferToMobu]
  • <leader>lm [SendLineToMaya]
  • <leader>lx [SendLineToMobu]

FAQ

Q Why did you write this plugin? Aren't there other plugins for sending commands to Maya?
A Hi Carl, you don't mind if I call you Carl do you? So Carl, you're absolutely right, there are other plugins that send commands to Maya's command port. If you don't like mine, you should check out Vimya. However, for the cases I found myself in, Vimya just didn't cut it. Specifically, I wanted to send commands to both Maya and Motionbuilder, since I use both at work quite frequently. Also, I've never written a vim plugin and this seemed like a good way to spend my Saturday. So to answer your question Carl, the main reason I created this package is because I GODDAMN WANTED TO! Sheesh Carl, you're so ungrateful!

Q Why do you call it JakeSender?
A I'm glad you asked Carl! You see, at my office (where I'm going to be using this) we have an awesome office dog name Jake! And much like this tool, Jake makes my life a little better at work. But Carl, wouldn't you know it, there already is a vim-jake plugin on github. So I decided to go with JakeSender, since the script sends stuff... Get it Carl?

Q Can you port this plugin to Atom, Visual Studio Code, etc.?
A Carl, do you see me using Atom, Visual Studio Code or other inferior editors at work? Why would I waste my time writing plugins for those editors when I'm perfectly happy in vim/neovim land?

Q Why do you keep calling me Carl?
A Stop asking dumb questions Carl.

About

🐶 Vim plugin for sending the contents of the current vim buffer to Maya or Motionbuilder

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published