Code Monkey home page Code Monkey logo

maya-math-nodes's Introduction

Maya Math Nodes

Collection of math nodes for Autodesk Maya

Building

Build Documentation Status

To build the library on Windows, clone the repository and navigate to the cloned directory, then run the following commands:

mkdir build
cd build
cmake ../. -G "Visual Studio 16 2019 Win64"

This will generate a Visual Studio solution you can use to build.

To build the library on OSX or Linux use the following commands:

mkdir build
cd build
cmake ../. -G "CodeBlocks - Unix Makefiles"
make

The build looks for Maya in the default installation directory for each platform, however you can always provide it with a custom path:

-DMAYA_LOCATION=/apps/autodesk/

Likewise, the build defaults to Maya version 2022, this can be changed as follows:

-DMAYA_VERSION=2020

Please note that the lowest supported version is 2019.

Installation

To install the library on OSX or Linux run the following command:

make install

By default the resulting module gets installed under dist folder in the current source directory.

To make the module available in Maya, add the install location to MAYA_MODULE_PATH environment variable or copy the module to a directory already in the module path.

The install location can also be changed as follows:

-DINSTALL_DIR=/preffered/install/directory

Testing

In order to run the test suite, execute the mayapy interpreter and pass the tests directory as an argument, for example:

/Applications/Autodesk/maya2018/Maya.app/Contents/bin/mayapy tests

maya-math-nodes's People

Contributors

serguei-k avatar

Stargazers

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

Watchers

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

maya-math-nodes's Issues

Capture variables in expressions

It would be great to capture parts of an expression as a variable that could be reused inline.

Here is a motivating example:

# get plane normal
normal = eval_expression('axis(plane.matrix, 1)', 'proj')

# project vector to plane
eval_expression('src.translate - ({normal} * dot(src.translate, {normal}))'.format(normal=normal), 'proj')

The normal gets used twice in expression, therefore it needs to be evaluated separately if it is to be reused. What if we could do something like this instead:

eval_expression('src.translate - (normal * dot(src.translate, axis(plane.matrix, 1)->normal))', 'proj')

Exact syntax is TBD.
One thing to consider is that capture would need to happen on the first use of the expression segment as per operation order.

Alternative proposal is to detect duplicate sections by comparing the AST nodes and reuse output internally, so you would still write:

eval_expression('src.translate - (axis(plane.matrix, 1) * dot(src.translate, axis(plane.matrix, 1)))', 'proj')

Feedback welcomed!

v1.6 Planned Nodes

  • QuaternionFromAxisAngle
  • RotateVectorBy* (Quaternion / Matrix / Rotation)
  • MultiplyVectorByMatrix will be changed to treat vector as a point

Unable to dynamically load USD in Maya 2023

When trying to build for 2023 on Windows everything works fine until the time to load the plugin in 2023 it produces the following error:

// Error: file: C:/Program Files/Autodesk/Maya2023/scripts/others/pluginWin.mel line 316: Unable to dynamically load : C:/src/maya-math-nodes/dist/MayaMathNodes/plug-ins/2023/mayaMathNodes.mll // The specified procedure could not be found. // Error: file: C:/Program Files/Autodesk/Maya2023/scripts/others/pluginWin.mel line 316: The specified procedure could not be found. // (mayaMathNodes)

Project configured for 2023.

Modulo node suggestion

Hi Serguei!

I noticed there's no Modulo node.

It could be very useful for looping values and actually it's not even available in Maya by default. You'd think the Expression Editor's many basic math functions would have a mod() in there but it doesn't, nor is there fmod() (which exists in MEL, boo!)

I'm not very good at C++ yet or I'd try to contribute such a node myself, but just wanted to put in the feature suggestion if you find the time.

Cheers! Great work!

unit tests

Create unit tests for nodes in Python using mayapy.

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.