Git Product home page Git Product logo

maya-raycast's Introduction

maya-raycast

Maya raycast node that will return the closest intersection on an array of type mesh and nurbsSurface and return the closest intersection as a matrix. When useDistance is enabled the output matrix will be positioned at the closest intersection. When useNormal is enabled the normal at the closest intersection is used to calculate the rotation, the inputMatrix is used to determine the forward and side axis.

Installation

  • Extract the content of the .rar file anywhere on disk.
  • Build the plugin for a specific Maya version.
  • Drag the raycast.mel file in Maya to permanently install the script.

Compiling

Building the plugin using cmake will place the plugin in the plug-ins folder with a maya version divider. This will ensure the plug-in is compatible with the launched version of Maya.

  1. Open Terminal
cd <PATH_TO_MODULE>
mkdir build/<MAYA_VERSION>
cd build/<MAYA_VERSION>
cmake -A x64 -T v141 -DMAYA_VERSION=<MAYA_VERSION> ../../
cmake --build . --target install --config Release

Usage

Once the plug-in is build and loaded a new raycast node can be created. A matrix is required to drive the inputMatrix, in respect to that matrix the raycast can be performed along one of its axis, this axis is positive. The reverse attribute can be used reverse the ray. When bidirectional is used both directions will be queried regardless of the reverse state.

The inputMesh and inputSurface attributes are arrays and such can contain more than one connection, it is also fine to mix meshes and surfaces. All these inputs will be tested, and the closest intersection returned.

Using envelope, will allow the outputMatrix to be blended to the original inputMatrix, useDistance and useNormal have the same effect but work only the translation or rotation component.

The hit attribute is a boolean attribute that indicates if an intersection has been performed successfully. The hitDistance will be a float value of the distance, this is set to -1 if no intersection has been performed successfully.

maya-raycast's People

Contributors

robertjoosten avatar

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.