Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Search the Community: Showing results for tags 'mel'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Lounge/General chat
    • Education
    • Jobs
  • Houdini
    • General Houdini Questions
    • Effects
    • Modeling
    • Animation & Rigging
    • Lighting & Rendering
    • Compositing
    • Games
  • Coders Corner
    • HDK : Houdini Development Kit
    • Scripting
    • Shaders
  • Art and Challenges
    • Finished Work
    • Work in Progress
    • VFX Challenge
    • Effects Challenge Archive
  • Systems and Other Applications
    • Other 3d Packages
    • Operating Systems
    • Hardware
    • Pipeline
  • od|force
    • Feedback, Suggestions, Bugs

Found 1 result

  1. Hello, I would like to ask you if there is some sort of equivalent to VEX in Maya. I am not experienced in Maya and I don't know all its functions. Recently I tried to do a simple task on geometry - to compute facing ratio between vertex normal and light direction, and then map the result to vertex color. Well, I managed to create simple MEL script and it works but it's extremly slow and inefficient when compared to similar solution in Houdini Also is there a solution to run this dynamically? (without need of clicking shelf button) Maya has some great nodes but I don't know how to extend them or create my own. Also many people tell me that a lot of studios have Maya centered pipeline and therefore its beneficial to have skills in Maya. Do you think it is worth trying to mimick Houdini functions in Maya? Here is mentioned MEL script. global proc facing(){ // facing ratio to vertex color // selection order: geometry, light float $start = `timerX`; // start timer string $prevTool = `currentCtx`; // record current tool string $sel[] = `ls -sl`; // selection to array int $nvtx[] = `polyEvaluate -v $sel[0]`; // number of vertices float $xform[] = `xform -q -m -ws $sel[1]`; // xform mtx from light vector $light = <<0,0,1>>; // init light vector var $light = pointMatrixMult($light,$xform); // mult with xform mtx $light = unit($light); // mormalize for ($i = 0 ; $i < $nvtx[0] ; $i++) { // iterate over all vertices string $vtx = $sel[0] + ".vtx[" + $i + "]"; // current vertex float $N_array[] = `polyNormalPerVertex -q -normalXYZ $vtx`; // return array of normals vector $N = <<$N_array[0] , $N_array[1] , $N_array[2]>>; // save first normal to vector var float $factor = clamp(0,1,dot($N,$light)); // compute angle between N and light vector polyColorPerVertex -g $factor $vtx; // assign vertex color } select -r $sel[0]; // select colored object string $pVtxTool = `artAttrColorPerVertexToolScript 4`; // initialize the paintVertex tool artAttrPaintVertexCtx -e -sao "smooth" $pVtxTool; // set it to smooth for ($i = 0 ; $i <= 6 ; $i++) { artAttrPaintVertexCtx -e -clear $pVtxTool; // smooth vertex colors } select -r $sel; // restore selection setToolTo $prevTool; // restore tool float $end = `timerX`; // end timer print ("\nnumber of processed vertices: " + $nvtx[0] + "\ntime to execute: " + ($end - $start) + "sec"); // print stats }