Git Product home page Git Product logo

velocity-maya's Introduction

Maya Velocity Node

Calculates the instantaneous speed of an input point. Designed to be connected to a transform node, providing a technique for accurately calculating speed of a node.

In the future, this project will also provide the velocity vector and the (normalised) direction of velocity.

Features

  • Calculates speed of an input point attribute.
  • Text Output for speed.
  • Speed display unit is configurable - km/h, mph, etc.
  • Configurable scale unit - centimetres, metres, etc.

Usage

For an example usage, run the following Python code after installation.

import maya.cmds

# Load and create velocity node.
maya.cmds.loadPlugin('velocity')
node = maya.cmds.createNode('velocity')
maya.cmds.connectAttr('time1.outTime', '%s.time' % node)

# transform node
tfm = maya.cmds.createNode('transform')
maya.cmds.connectAttr('%s.translate' % tfm, '%s.translate' % node)

# create 'speed' attribute
maya.cmds.addAttr(tfm, ln='speed', at='double' )
maya.cmds.setAttr('%s.speed' % tfm, edit=True, keyable=True)
maya.cmds.connectAttr('%s.outSpeed' % node, '%s.speed' % tfm)

# Add example animation
maya.cmds.setKeyframe(tfm, attribute='translateX', time=0, value=0)
maya.cmds.setKeyframe(tfm, attribute='translateX', time=24, value=100)

See 'test.py' for more details

Building and Install

To build and install the plug-in, follow the steps below.

Dependencies

  • C++ compiler with support for C++11
  • CMake 2.6+
  • Autodesk Maya 2016+

Build and Install

A build assumes the CMakeLists.txt is set up correctly MAYA_ROOT are set correctly.

Run the following in a Bash-like shell.

Build

$ cd <project root>
$ mkdir build
$ cd build
$ cmake ..
$ make -j 4

Install

$ cd <project root>/build
$ mkdir ~/maya/<maya version>/plug-ins
$ cp velocity.so ~/maya/<maya version>/plug-ins

You may now open Autodesk Maya and load the plugin using the "maya.cmds.loadPlugin" command (see Usage section above).

Limitations and Known Bugs

  • None known.

velocity-maya's People

Contributors

david-cattermole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

velocity-maya's Issues

Vector: Direction and Velocity ?

Hi David,

Thanks for sharing those bits of code. It seems you started implementing and vector outputs for both velocity and direction ?

I've tried uncommenting the declarations and implementing a Vector handle, but I lack maya C++ plugin knowledge.

Do you happen to have the missing pieces somewhere ?

Thanks

Pre-Compile Maya Plug-in

This project is written using C++ and requires a C++ compiler, end-users don't know how to compile C++ code and will want a .so or .mll.

Build instructions should be updated, and a compiled version with install instructions should be written.

Users will likely want as many operating systems and Maya versions supported as possible, however currently Linux and Windows with Maya 2016+ is only supported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.