Wondering if it is possible to make a mel script that exports the contents of your different view layers off as different files into the same directory as the MB file, with pre-set options.
what im trying to do is make something i can put in my shelf that will let me export out my High Poly, Low Poly and Cage in one click in the SBM format so i can quickly get things into xnormal.
EDIT: and i was in the wrong forum, can a mod move this up a level to Technical Talk
Replies
Yup. I didnt have xnormal installed but you should be able to copy what the log spits out and replace the path (look into the file command. Believe you can query the scene name and do some string manipulation) and append the layer name.
sweet will let you know how it goes when i get home later tonight, this should drastically speed up work flow way better than haveing ot manaully export out 3 files every-time i fucking make a small change and i already use the view layers to organize this stuff anyways.
so how would i grab the path the project MB file is stored in and use it in that string, and use the MB's files name with the layer name appended?
That will give you the current project the file is stored in. My plan would be to take that, remove the / pop off the last index of the array and construct back again. Then add $layer back and append the extensions as a string. Probably a better way to do this but dont have maya right now. Always sucked at string manipulation XD
sorry for being so stupid when it comes to scripting.
now i just need to know how to back off the .mb of file -q -sceneName commnd and it would be nice if i could add /export in the string so it puts these exported files in a subfolder called export next to the scene file.
any ideas.
would also like to find a way to make it olny work on layers with a certain prefix kinda like vtools in PS so say i have "~highpoly", it would export that layer, but if it was just "highpoly" it would be ignored.
Should be all except that ~layerName stuff. I got this working with obj and just put in the stuff for Xnormal from what you posted, let me know if it works.
Hmm just tried doing the delimiter thing and for some reason cant cast startsWith into an int.
thanks alot for this.