MILA to Arnold or V-Ray Script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  03 March 2018
MILA to Arnold or V-Ray Script

So Mental Ray's dead and I'm stuck coming to terms with that. Even as a simple hobbyist, I probably can't continue working with Mental Ray forever, so I'm looking into resources to make the eventual switch.

By far the biggest problem is the shader networks. I love MILA! I've created hundreds of them with my 'little' project (literally, I stopped trying to count after some 200 or so) . Most are only about 1-3 layers, maybe up to 6. But, my greatest and most important ones stretch up to 20-30+ layers, even plugging MILA layer nodes into shader slots of other MILA shaders! Some even wrangle other nodes and utilities in some odd ways.

I need to find or develop a python script for taking a MILA  networks and generating a shader network in the new renderer's native approach. It be great if I had one for both Arnold and V-Ray so I can compare things. But, I'm up for any information or ideas people have.
  03 March 2018
You can find several scripts on Redshift forum to examine as an example (in addition to search Google "MILA to <renderName> material converter").
You have to decide which render will you use exactly and recreate your common MILA networks with target render manually than you can reproduce this setup with Python (having you SOURCE >> TARGET material pairs in the scene).
Start with a simple example and use a working script to convert more and more complex networks. You can find some Python commands for handling materials in Maya here.
20-30 layers sound quite sophisticated but maybe you would not need crazy nested networks with Arnold (or whatever you will choose) because it allow to get the desired result without MR-style brainfucking. 
3D animation blog
  03 March 2018
Thanks for the ideas! My initial DDG search wasn't particularly helpful (all 8 found was a script for converting Maya shader nodes like Blinn, not MILA) but I'll check out that forum!

Yeah, on those highly layered MILAs it's usually 3-4 shaders per weight map, so that could see a dramatic flattening. I've not seen anything good so far about efficient execution, though. Everything I've seen indicates all layers would get evaluated each time!  MILA's smart layering came to be very important to my approach and allowed me to get away with reusable component maps building up over layers at little additional cost. Do you have any thoughts on renderers with a similar capability in its layering? Or are they all pretty much like that now?

I'll be honest, I'm still on Maya 2015, so I'm not sure exactly where I want to migrate just yet. I'm just a lone man, with precious little time for my hobby. So, I figure identiying a renderer that makes the transition easy and quick will probably play a big part in my ultimate decision. Any thoughts on that end of things?
  03 March 2018
Hard to advise which render to use instead of MR. In my opinion, any render would be better than MR. When I switch to Arnold it was like a miracle. If you like MILA — stay with MILA.
Here you can find some hints on choosing render as well.
Also, I never had 20 layers in my networks, can you show an example of such material?
3D animation blog
  03 March 2018
Sure! Those particular ones are used for my character models. (Please excuse their haphazard posing and lack of environment, I just kind threw these images together real quick. They're pretty huge, so I didn't want to post them directly.)

I'll be honest, try as I might I'm not much of a texture artist. I make up for my failings by relying heavily on shaders to help me produce interesting, colorful creations. Part of that is breaking down my character's appearance into components, which translate to one or more layers per component. So, light-markings have a greyscale texture map detailing their shape, then I use 3 layers to provide the coloration I like: a base, a Fresnel, and a custom (Schlick approximation). Sometimes a second custom or Fresnel may also be used too.

Breaking these textures down to component masks has other advantages for someone with little time and the need for a number of fairly similar-looking characters. For starters, I can reuse the texture maps with minimal modification to serve other purposes, like XGen ptex color masks, spline attribute maps, and culling maps. I am experimenting with some frugal clothing designs using this component approach and mixing together the baseline maps to provide displacement maps, as well.

If I'm being honest, MILA made it a bit easy to be lazy, in a sense, since a big weight texture covering over most the rest of the layers the same impact as the same shader with those lower layers removed. So, some times when I'm going above 30 it's because I'm being quick and lazily plugging in component layers that blot out others a bit. It's been great for rapid prototyping, experimenting, and generally just quick work!

On the character front, I can quickly mix and match components, reusing the eyebrows, eyemarkings, nose, and other features and simply changing up their color choices a bit to experiment with new character appearances. The same will be true of many parts of my future clothing design work, I believe. This can even be automated and I will eventually use it to produce a wealth of diverse background characters to fill scenes like this pool area I've been working on.
  03 March 2018
MILA was really neat: they claimed you could use as many layers as you want without impacting performance, and I've generated materials with over 60 layers and found that it really did hold up.  As far as I know, that approach to materials simply isn't possible with stock Arnold materials, so I would doubt any script that claimed to do the conversion.  The only way you could directly convert would be with layered materials, which would be unusably slow.
  03 March 2018
Sounds like Arnold is a model kit versus Mental Ray as LEGOs. Still not sure which renderer would be a good LEGOs replacement (Oh, or one that's like an Erector Set! That'd be even better!)

Follow up questions: Does Arnold have a system like Mental Ray Proxy?

I use a combination of Maya's Scene Assembly and Mental Ray Proxy for my larger scenes. Definition files contain simple box proxies pointed to mental ray proxy files. This works great for me because scene assembly helps manage Maya's memory in-editor and selectively control asset display in test renders, The miProxies help minimize pre-render load times by Maya, preprocessing, and helps with render-time memory management by Mental Ray. How would such a system work under Arnold?

Also: does anybody have any guides for using pymel to script scene assembly node setup? I have a script that creates and loads proxy files, exports gpu cache alembic files, but I can't make heads or tails of the scene assembly nodes and still have to enter those values manually.
  03 March 2018
I try Arnold after many-many years of MR headache and it was a super awesome mindblowing experience. They are beyond any compare, MR is a nightmare. Arnold has anything you may need from the render in 2018. The beauty of Arnold is that you don't need to know billions of tricks how to get expected results from the tool you are using, its just works. The learning curve is very smooth, one day of tutorials and you will be ready to go into production.

> Does Arnold have a system like Mental Ray Proxy?
It does, it called Arnold StandIn.  You export complex asset as a proxy object (standIn) and use this standIn to populate asset in the scene.

I have set of pipeline tools for Maya and Arnold, probably you can find something useful if you will decide to go with Arnold. Create standIns, apply materials, export-import animation etc, all that usual pipeline stuff. Despite it tight to a certain pipeline architecture and use Alembic caches in conjunction with referencing instead of Scene Assembly, there plenty of code snippets for similar tasks with any render engine or workflow.

P.S. Take a look at Redshift also!
3D animation blog
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:02 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.