Posted By

martinB on 02/06/09


Tagged

default settings callback


Versions (?)

New Object Defaults


 / Published in: Maxscript
 

Small example how to set up a callback to change the default parameters used for creating new objects (in this example, any new cylinder will have one height segment and 16 sides)

  1. fn myNodeCreatedCallback =
  2. (
  3. myNode = callbacks.notificationParam()
  4.  
  5. case (classOf myNode) of
  6. (
  7. Cylinder:
  8. (
  9. myNode.heightSegs = 1
  10. myNode.sides = 16
  11. )
  12. )
  13. )
  14.  
  15. callbacks.removeScripts #sceneNodeAdded id:#myDefaultSettings
  16. callbacks.addScript #sceneNodeAdded "myNodeCreatedCallback()" id:#myDefaultSettings

Report this snippet  

You need to login to post a comment.