2011年11月30日 星期三

Maxscript : isValidNode



isValidNode
Returns true if is a node value, and the node has not been deleted. Otherwise, it returns false.
isValidNode $ 
等同於
fn isValidNodeFn = ( if $!=undefined then return true else return false )


getSavePath()
getSavePath [caption:] [initialDir:]
(MAXscript Reference : Standard Open and Save File Dialogs)
This function displays a folder selection browser for the user to select a folder. Returns a string path name for the selected folder or the value undefined if the user presses Cancel in the folder browser.
If the initialDir: keyword argument is specified, the Browse For Folder dialog will be opened at the specified directory. Symbolic pathnames are acceptable as the pathname. Available in 3ds Max 8 and higher.


Try Expression
The try expression lets you bracket a piece of code and catch any runtime errors.
This allows you to respond appropriately or take corrective action, rather than let MAXScript halt the execution of your script and print an error message.
try ... catch ...
throw ... ; throw()




getNodeByName

getNodeByName "Box01"
等同於
theName = "Box01"
theObject = Execute ("$'"+theName+"'")



displayTempPrompt


displayTempPrompt
Displays the specified string on the Prompt Line for the specified number of milliseconds. After the time elapses, the string is popped from the stack. This may be used to put up a temporary error message for example. Control is returned to MAXScript immediately after the call, that is, MAXScript execution continues even while the temporary prompt is displayed.




snapshot
This function provides functionality similar to the SnapShot tool in 3ds Max. It generates a new node that contains a copy of the world-state mesh of the source at the time that the snapshot is made. Any existing modifiers are collapsed out of the new node and the mesh snapshot accounts for any space warps currently applied. As with the clone methods (copy, reference and instance,) you can add any of the standard node creation keyword arguments, such as pos:, name:, etc. 



mybox.width = if mybox.height == 10 then 20 else 10


To make MAXScript increment the index by a value other than 1, insert 'by x' after the index statement, where x is the amount to increment the index by.
for i = 1 to 5 by 2 do ( ... )


For loops can also be used to build arrays and/or access values within an array.
objAry = for obj in selection collect obj


Rotation properties and in fact all rotation-related functions in MAXScript reflect the direction convention used in the 3ds Max user interface. This convention is the right-hand rule, namely, positive angles rotate counter-clockwise about positive axes. Internally, however,3ds Max stores rotations in node matrices using the left-hand rule. It is important to remember this inversion when working directly with node transform matrices using the transform and objectTransform properties. You'll need to invert rotations (for example, by multiplying axes by [-1,-1,-1] or using the inverse() function on quaternions) when mixing them with 3ds Max and MAXScript standard rotations.
-- eg

r = $foo.transform.rotationPart
$baz.rotation = inverse r


filesArray = getFiles ( filePath + "\\*.max" )



filters.Is_EditSpline()
filters.Is_EditPatch()
filters.Is_EditPoly()
filters.is_MeshSelect()
filters.is_SplineSelect()
filters.is_PatchSelect()
filters.is_PolySelect()



沒有留言:

張貼留言