Message 1 of 5

Not applicable
02-15-2017
06:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to define a function to fetch the number of materials applied to a mesh:
function getMatCount meshName = ( mat = $meshName.material if mat.count != undefined then ( return mat.count ) 1 ) getMatCount "body" getMatCount "head"
Using $body.material works fine, but using $meshName inside the function doesn't work... as I would expect. What is the proper way to access the mesh?
Also, if there's a better way to fetch the number of materials by mesh name, please tell me 😉
Solved! Go to Solution.