Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 28-07-2012 , 09:05 PM
Registered User
Join Date: May 2006
Location: SC
Posts: 2

MEL Scripting - How do I list Fur/Hair Presets

I'm looking for a way to list all of the presets for FurDescription nodes. I have noticed there is a nodePreset command in MEL but I'm not exactly sure how to use it. I want to get a list/array of the existing Fur Description presets and use that to create a menu/OptionMenuGrp and apply the selected preset to a FurDescription in my script. Any help would be greatly appreciated.

I would like to do the same with hairSystemShape.


~ Nic

Last edited by nmcelve; 28-07-2012 at 09:48 PM. Reason: changed title from statement to question to get more attention and hopefully a response.
# 2 29-07-2012 , 12:39 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
The presets are stored in MAYA_ROOT/presets/attrPresets/FurDescription. Look in there to get the preset names. (The file name is the preset name)

Then use nodePreset -load descriptionNode presetName;


Imagination is more important than knowledge.
# 3 12-08-2012 , 04:03 PM
Registered User
Join Date: May 2006
Location: SC
Posts: 2

additional information - user defined presets

Thanks for your reply. Your answer definitely helped me think through this problem more.

The location for native Maya fur description presets:
MAYA_ROOT/presets/attrPresets/FurDescription
- User defined presets for fur are not saved in this is location.
- I was surprised when I did not see the presets I created.

I did some more searching and found a way to locate where user presets are stored:
https://www.cgsutra.com/autodesk_maya...m_commands.php

// lists the directory where user presets are stored.
print (`internalVar -ups` + "\n");

../Library/Preferences/Autodesk/maya/2011-x64/presets/
- (on my Mac)

User defined/saved Fur Description presets are stored
../Library/Preferences/Autodesk/maya/2011-x64/presets/attrPresets/FurDescription

To build a drop down menu, option menu group, I'm going to have to create a list of the mel scripts in both locations, then loop through the mel script list and create an option for each mel script (preset).

I see MEL has a way to list files from a certain directory:
https://download.autodesk.com/us/maya...nds/index.html

// List the contents of the user's projects directory
//
getFileList -folder `internalVar -userWorkspaceDir`;

// List all MEL files in the user's script directory
//
getFileList -folder `internalVar -userScriptDir` -filespec "*.mel";


More info on internalVar: https://download.autodesk.com/us/maya...nds/index.html

I will be using this to create my list of presets.

I wonder how Maya does it for Fur Description Presets. It would be nice to look at their code. I'll have to try to find where that .mel file is.


~ Nic

Last edited by nmcelve; 12-08-2012 at 04:34 PM. Reason: adding more information so that readers have more to read and learn from.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads