Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

simpleMod - Accessing data other than vertex position

simpleMod - Accessing data other than vertex position

Anonymous
Not applicable
787 Views
2 Replies
Message 1 of 3

simpleMod - Accessing data other than vertex position

Anonymous
Not applicable

I was working on a SimpleMod plugin to have normal based noise, and have a question regarding access to vertex normals within the map event. Currently when trying to run the getNormal command, I get an error saying "-- Runtime error: Illegal SimpleMod map handler recursion: <internal:0x000079c0> ". Is there a way to access not only the local vertex position within the map event but also the vertex normal? And is it possible to have these values update with changing topology beneath the modifier like the P variable does?

 

plugin simpleMod normalNoise

name:"Normal Noise"

classID:#(0x3137b97, 0x2c7557ef)

version:1

(

     parameters main rollout:params

     (

       refNode type:#maxObject

       noiseMult type:#float ui:noiseMultUI

     )

 

     rollout params "Noise Parameters"

    (

      noiseMultUI "Noise Mult : "

    )

 

     on create do

     (

       refObj = nodeTransformMonitor node:$ forwardTransformChangeMsgs:false

     )

  

     on map i p do

     (

       vertNormal = getNormal refObj.node i

 

       p += (vertNormal * noiseMult)

 

       p

     )

 

)

0 Likes
Accepted solutions (1)
788 Views
2 Replies
Replies (2)
Message 2 of 3

Swordslayer
Advisor
Advisor
Accepted solution
Message 3 of 3

Anonymous
Not applicable

Wow I have 2016 but only the 2015 maxscript help. Thanks for introducing me to this plugin class, I didn't even know it existed and am a bit hesitant to jump into the MCG world so this is perfect. Cheers!

0 Likes