mel.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /*
  2. Language: MEL
  3. Description: Maya Embedded Language
  4. Author: Shuen-Huei Guan <drake.guan@gmail.com>
  5. Website: http://www.autodesk.com/products/autodesk-maya/overview
  6. Category: graphics
  7. */
  8. function mel(hljs) {
  9. return {
  10. name: 'MEL',
  11. keywords:
  12. 'int float string vector matrix if else switch case default while do for in break ' +
  13. 'continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic ' +
  14. 'addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey ' +
  15. 'affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve ' +
  16. 'alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor ' +
  17. 'animDisplay animView annotate appendStringArray applicationName applyAttrPreset ' +
  18. 'applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx ' +
  19. 'artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu ' +
  20. 'artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand ' +
  21. 'assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface ' +
  22. 'attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu ' +
  23. 'attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp ' +
  24. 'attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery ' +
  25. 'autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults ' +
  26. 'bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership ' +
  27. 'bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType ' +
  28. 'boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu ' +
  29. 'buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge ' +
  30. 'cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch ' +
  31. 'catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox ' +
  32. 'character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp ' +
  33. 'checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip ' +
  34. 'clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore ' +
  35. 'closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter ' +
  36. 'cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color ' +
  37. 'colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp ' +
  38. 'colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem ' +
  39. 'componentEditor compositingInterop computePolysetVolume condition cone confirmDialog ' +
  40. 'connectAttr connectControl connectDynamic connectJoint connectionInfo constrain ' +
  41. 'constrainValue constructionHistory container containsMultibyte contextInfo control ' +
  42. 'convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation ' +
  43. 'convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache ' +
  44. 'cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel ' +
  45. 'cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver ' +
  46. 'cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor ' +
  47. 'createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer ' +
  48. 'createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse ' +
  49. 'currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx ' +
  50. 'curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface ' +
  51. 'curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox ' +
  52. 'defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete ' +
  53. 'deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes ' +
  54. 'delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo ' +
  55. 'dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable ' +
  56. 'disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected ' +
  57. 'displayColor displayCull displayLevelOfDetail displayPref displayRGBColor ' +
  58. 'displaySmoothness displayStats displayString displaySurface distanceDimContext ' +
  59. 'distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct ' +
  60. 'doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator ' +
  61. 'duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression ' +
  62. 'dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor ' +
  63. 'dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers ' +
  64. 'editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor ' +
  65. 'editorTemplate effector emit emitter enableDevice encodeString endString endsWith env ' +
  66. 'equivalent equivalentTol erf error eval evalDeferred evalEcho event ' +
  67. 'exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp ' +
  68. 'expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof ' +
  69. 'fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo ' +
  70. 'filetest filletCurve filter filterCurve filterExpand filterStudioImport ' +
  71. 'findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster ' +
  72. 'finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar ' +
  73. 'floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo ' +
  74. 'fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint ' +
  75. 'frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss ' +
  76. 'geometryConstraint getApplicationVersionAsFloat getAttr getClassification ' +
  77. 'getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes ' +
  78. 'getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender ' +
  79. 'glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl ' +
  80. 'gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid ' +
  81. 'gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap ' +
  82. 'HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor ' +
  83. 'HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached ' +
  84. 'HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel ' +
  85. 'headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey ' +
  86. 'hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender ' +
  87. 'hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox ' +
  88. 'iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ' +
  89. 'ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ' +
  90. 'ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform ' +
  91. 'insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance ' +
  92. 'instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp ' +
  93. 'interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf ' +
  94. 'isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect ' +
  95. 'itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx ' +
  96. 'jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner ' +
  97. 'keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx ' +
  98. 'keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx ' +
  99. 'keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx ' +
  100. 'keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor ' +
  101. 'layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList ' +
  102. 'lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep ' +
  103. 'listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory ' +
  104. 'listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation ' +
  105. 'listNodeTypes listPanelCategories listRelatives listSets listTransforms ' +
  106. 'listUnselected listerEditor loadFluid loadNewShelf loadPlugin ' +
  107. 'loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log ' +
  108. 'longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive ' +
  109. 'makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext ' +
  110. 'manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx ' +
  111. 'manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout ' +
  112. 'menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp ' +
  113. 'mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move ' +
  114. 'moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute ' +
  115. 'nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast ' +
  116. 'nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint ' +
  117. 'normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect ' +
  118. 'nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref ' +
  119. 'nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType ' +
  120. 'objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface ' +
  121. 'offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit ' +
  122. 'orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier ' +
  123. 'paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration ' +
  124. 'panelHistory paramDimContext paramDimension paramLocator parent parentConstraint ' +
  125. 'particle particleExists particleInstancer particleRenderInfo partition pasteKey ' +
  126. 'pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture ' +
  127. 'pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo ' +
  128. 'pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult ' +
  129. 'pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend ' +
  130. 'polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal ' +
  131. 'polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge ' +
  132. 'polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge ' +
  133. 'polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet ' +
  134. 'polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet ' +
  135. 'polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection ' +
  136. 'polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge ' +
  137. 'polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet ' +
  138. 'polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix ' +
  139. 'polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut ' +
  140. 'polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet ' +
  141. 'polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge ' +
  142. 'polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex ' +
  143. 'polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection ' +
  144. 'polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection ' +
  145. 'polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint ' +
  146. 'polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate ' +
  147. 'polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge ' +
  148. 'polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing ' +
  149. 'polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet ' +
  150. 'polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace ' +
  151. 'popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer ' +
  152. 'projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx ' +
  153. 'propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd ' +
  154. 'python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection ' +
  155. 'radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl ' +
  156. 'readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference ' +
  157. 'referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE ' +
  158. 'registerPluginResource rehash reloadImage removeJoint removeMultiInstance ' +
  159. 'removePanelCategory rename renameAttr renameSelectionList renameUI render ' +
  160. 'renderGlobalsNode renderInfo renderLayerButton renderLayerParent ' +
  161. 'renderLayerPostProcess renderLayerUnparent renderManip renderPartition ' +
  162. 'renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor ' +
  163. 'renderWindowSelectContext renderer reorder reorderDeformers requires reroot ' +
  164. 'resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget ' +
  165. 'reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx ' +
  166. 'rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout ' +
  167. 'runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage ' +
  168. 'saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale ' +
  169. 'scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor ' +
  170. 'sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable ' +
  171. 'scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt ' +
  172. 'searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey ' +
  173. 'selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType ' +
  174. 'selectedNodes selectionConnection separator setAttr setAttrEnumResource ' +
  175. 'setAttrMapping setAttrNiceNameResource setConstraintRestPosition ' +
  176. 'setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr ' +
  177. 'setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe ' +
  178. 'setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag ' +
  179. 'setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject ' +
  180. 'setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets ' +
  181. 'shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare ' +
  182. 'shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField ' +
  183. 'shortNameOf showHelp showHidden showManipCtx showSelectionInTitle ' +
  184. 'showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface ' +
  185. 'size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep ' +
  186. 'snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound ' +
  187. 'soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort ' +
  188. 'spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString ' +
  189. 'startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp ' +
  190. 'stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex ' +
  191. 'stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex ' +
  192. 'stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString ' +
  193. 'stringToStringArray strip stripPrefixFromName stroke subdAutoProjection ' +
  194. 'subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV ' +
  195. 'subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror ' +
  196. 'subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease ' +
  197. 'subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring ' +
  198. 'surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton ' +
  199. 'symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext ' +
  200. 'texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext ' +
  201. 'texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text ' +
  202. 'textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList ' +
  203. 'textToShelf textureDisplacePlane textureHairColor texturePlacementContext ' +
  204. 'textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath ' +
  205. 'toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower ' +
  206. 'toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper ' +
  207. 'trace track trackCtx transferAttributes transformCompare transformLimits translator ' +
  208. 'trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence ' +
  209. 'twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit ' +
  210. 'unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink ' +
  211. 'uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane ' +
  212. 'viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex ' +
  213. 'waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire ' +
  214. 'wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform',
  215. illegal: '</',
  216. contains: [
  217. hljs.C_NUMBER_MODE,
  218. hljs.APOS_STRING_MODE,
  219. hljs.QUOTE_STRING_MODE,
  220. {
  221. className: 'string',
  222. begin: '`',
  223. end: '`',
  224. contains: [ hljs.BACKSLASH_ESCAPE ]
  225. },
  226. { // eats variables
  227. begin: /[$%@](\^\w\b|#\w+|[^\s\w{]|\{\w+\}|\w+)/
  228. },
  229. hljs.C_LINE_COMMENT_MODE,
  230. hljs.C_BLOCK_COMMENT_MODE
  231. ]
  232. };
  233. }
  234. module.exports = mel;