|
AM Tools 1.05
|
Utility functions for working with files. More...
Functions | |
| def | convertValidTypesToStringList |
| Convert an incoming object (oldList) into a list of strings made of only those objects permitted by the validTypes filter. | |
| def | find |
| Find files in sourcePath that match certain patterns supplied via keywords. | |
| def | copyDirectoryStructure |
| Copy a directory structure from one location into another location. | |
| def | removeFlagArgPairFromUIConfigurationScript |
| Remove a specified flag from a line in a uiConfigurationScriptNode string in a .ma file. | |
| def | patchMayaAsciiFile |
| Patch a Maya Ascii file to attempt to make it backward compatible as far as 8.5. | |
| def | batchExport |
| Batch export files in one location to another location. | |
Variables | |
| list | kUIConfigFlags2011 |
| UI configuration flags invalid before Maya 2011. | |
| list | kUIConfigFlags2009 |
| UI configuration flags invalid before Maya 2009. | |
| list | kUIConfigFlags2008 |
| UI configuration flags invalid before Maya 2008. | |
Utility functions for working with files.
Many functions are primarily intended to be executed from batch mode.
Creation Info:
Donations: http://adammechtley.com/donations/
License: The MIT License
Copyright (c) 2011 Adam Mechtley (http://adammechtley.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| def amTools.utilities.files.batchExport | ( | sourcePath, | |
| destPath, | |||
toFileType = 'fbx', |
|||
recursively = True, |
|||
matchDirectorySructure = True, |
|||
| keywords | |||
| ) |
Batch export files in one location to another location.
Returns True on success. Only intended for use in standalone mode; otherwise FBX settings are not respected. Not all FBX Export settings are currently supported. Not all versions of Maya have been completely tested; please tell me if you find errors in old versions.
| filePatterns | List corresponding to different file extensions to parse |
| filterPrefix | List corresponding to required prefixes in file names |
| filterSuffix | List corresponding to required suffixes in file names |
| filterContains | List corresponding to required string in file names |
| addPrefix | String to prefix on all exported files |
| addSuffix | String to suffix on all exported files |
| bakeAll | String specifying object types on which to bake animation |
| bakeAllRange | Tuple or list specifying a frame range |
| maVersion | Version of Maya to set for .ma exports |
| fbxVersion | FBXFileVersion string |
| fbxAscii | FBXExportInAscii |
| fbxBake | FBXExportBakeComplexAnimation boolean |
| fbxBakeStart | FBXExportBakeComplexStart float |
| fbxBakeEnd | FBXExportBakeComplexEnd |
| fbxAnimOnly | FBXExportAnimationOnly boolean |
| fbxConstraints | FBXExportConstraints boolean |
| fbxUnit | FBXConvertUnitString and FBXExportConvertUnitString |
| fbxUpAxis | FBXExportUpAxis |
| fbxAxisConvert | FBXExportAxisConversionMethod |
| fbxScale | FBXExportScaleFactor |
| def amTools.utilities.files.convertValidTypesToStringList | ( | oldList = [], |
|
validTypes = [types.StringTypes] |
|||
| ) |
Convert an incoming object (oldList) into a list of strings made of only those objects permitted by the validTypes filter.
| def amTools.utilities.files.copyDirectoryStructure | ( | sourcePath, | |
| destPath, | |||
includeHidden = False |
|||
| ) |
Copy a directory structure from one location into another location.
Returns True on success.
| def amTools.utilities.files.find | ( | sourcePath, | |
recursively = True, |
|||
includeHidden = False, |
|||
| keywords | |||
| ) |
Find files in sourcePath that match certain patterns supplied via keywords.
Hidden file detection is not implemented for Windows. Sorry, but I just don't care.
| folders | Boolean specifying that the caller wants a list of folders rather than files |
| paths | String specifying how paths should be returned with respect to sourcePath: full, relative, or no |
| filePatterns | List corresponding to different file extensions to parse |
| filterPrefix | List corresponding to required prefixes in file names |
| filterSuffix | List corresponding to required suffixes in file names |
| filterContains | List corresponding to required string in file names |
| def amTools.utilities.files.patchMayaAsciiFile | ( | file, | |
| toVersion | |||
| ) |
Patch a Maya Ascii file to attempt to make it backward compatible as far as 8.5.
This function will bake animation layers for old versions of Maya and remove other invalid requirements, flags, etc. Not all compatibility is presumed to be fixed; please use at your own risk.
| def amTools.utilities.files.removeFlagArgPairFromUIConfigurationScript | ( | line, | |
| flag | |||
| ) |
Remove a specified flag from a line in a uiConfigurationScriptNode string in a .ma file.
00001 [ 00002 '-jointXray', 00003 '-activeComponentsXray', 00004 '-lineWidth', 00005 '-shadingModel']
UI configuration flags invalid before Maya 2008.
00001 [ 00002 '-nParticles', 00003 '-organizeByLayer', 00004 '-showAnimLayerWeight', 00005 '-autoExpandLayers', 00006 '-showAssets', 00007 '-showContainedOnly', 00008 '-showPublishedAsConnected', 00009 '-showContainerContents', 00010 '-containersIgnoreFilters', 00011 '-animLayerFilterOptions', 00012 '-constrainDrag', 00013 '-mergeConnections', 00014 '-showRelationships', 00015 '-opaqueContainers', 00016 '-heatMapDisplay', 00017 '-range']
UI configuration flags invalid before Maya 2009.
00001 [ 00002 '-ignorePanZoom', 00003 '-showUpstreamCurves', 00004 '-showPinIcons', 00005 '-showStackedCurves', 00006 '-stackedCurves', 00007 '-stackedCurvesMin', 00008 '-stackedCurvesMax', 00009 '-stackedCurvesSpace', 00010 '-displayNormalized', 00011 '-preSelectionHighlight', 00012 '-manageSequencer']
UI configuration flags invalid before Maya 2011.
1.7.4