String Options

String options are currently Autodesk’s main method for integrating new mental ray features.  While very few people would say they “like” using string options, you don’t really have a choice if you want to use anything new in mental ray.

What are string options?

String Options are essential a tool for you to declare a variable to the mental ray renderer that is not directly built into the Maya/mentalray translator.  You can use string options to tell mental ray to turn on/off a feature and what settings to use.

You can read more about possible string options in the mental ray documentation that comes with Maya.

Where do string options hide?

The miDefaultOptions node

String options are located on the miDefaultOptions node.  There are several ways to get to the this node.  I generally use this MEL command:

select miDefaultOptions;

If you are currently screaming with horror, you should consider creating a custom button on the shelf editor with this command.  You can also select miDefaultOptions from the outliner if you have don’t have “Dag Objects Only” checked (Outliner > Display > DAG Objects Only).  Fun stuff.

If you get a “No object matches name: miDefaultOptions” error, make sure that the mental ray plugin has been loaded and that the default mental ray nodes have been created (if they have not been created, setting the renderer to mental ray in render settings should do the trick).

How to set string options

To create a new string options, click “Add New Item”.  For each string option that you create, you need to know three things: Name, Value, and Type.

Name: The name of the mental ray setting which you are adjusting.  If you don’t know this you don’t know anything.  Make sure you spell the name correctly or mental ray will ignore the setting.

Value: The value that you wish to give that setting.  Values must be of the correct Type.

Type: The data type of the specific setting:

  • “boolean” – The most basic data type representing True or False.
    • Possible Values: “true” or “false”, “on” or “off”, 1 or 0, etc.
  • “integer” – A whole number.
    • Possible Values: -2, 0, 45, 23053, etc.
  • “scalar” – A decimal number.
    • Possible Values: -23.567, 0.0, 0.00005, 3.14159, 1000000000000000000000.0, etc.
  • “string” – Any text.
    • Possible Values: “hello world”, “automatic”, “off”, “0.0”, etc.
  • “color” – A color usually represented by 3 scalars for RGB.
    • Possible Values: 1.0 1.0 1.0. (for white), 0.0 0.0 0.0 (for black), 0.5 0.234 0.0, etc.

Note: mental ray will also recognize “bool” for “boolean”, “float” for “scalar”, “int” for “integer”, or “vector” for “color”.

About bnrayner

I am a VFX developer specializing in 3d rendering. With a background in Physics and Digital Art, I enjoying using math to explain how light interacts with materials and to creating pretty pictures along the way.

Posted on October 31, 2011, in maya and tagged , , . Bookmark the permalink. 15 Comments.

  1. Please keep this blog on, I really like to read your posts.

    Great work, btw, how do you see the future of mental ray? Maya artists are now going to vray, why mental ray is falling down, at least it looks like.. tnks a lot

  2. The appearance that mental ray isn’t evolving is because Autodesk is reluctant to integrate new features and develop tools. Part of this is because Autodesk requires more testing before making features available. This is both reliant on user testing and internal testing. Both seem to be inadequate lately.

    And Autodesk also requires greater feedback to make feature requests and changes. You can affect more change by joining their beta programs at: beta.autodesk.com

  3. Despise noise to the contrary, mental ray is still a very powerful and widely used rendering engine for students, artists, and businesses in the CGI industry.

    One of the advantages of mental ray is the array of rendering solutions it can provide, all the way from scanline (the rasterizer), to adaptive ray tracing (unified sampling), to a brute force light simulation (iray). This makes mental ray appropriate for many of the niches of the CGI industry and an excellent tool for studios that bridge those niches and artists who are not yet committed to just one.

    Most of the current mental ray limitations are largely a result of old integration, not performance issues or lack of features. For those pesky render problems (there is and will always be pesky render problems, no matter what renderer you use), mental ray is established enough for workarounds to be widely known. It is important to note that the majority of corporate research in advanced rendering is done by either NVIDIA ARC (the makers of mental ray) or Pixar (the makers of RenderMan). I am sure we will continue to see new and exciting features for mental ray in the future.

    Just to help avoid any render trolls I would like to point out that any of today’s prominent renderers (RenderMan, mental ray, Arnold, V-Ray, etc) can and do deliver excellent results if put in capable hands. If someone says otherwise, they probably don’t know what they are doing.

    While I am sure many are very passionate about their renderer of choice, this blog is dedicated to helping build and foster the mental ray user community, as well providing useful tools and information for people interested in progressing their knowledge and career.

  4. Thank you so much for your replys.

    I think you are both right, I hope that Zap that is now at Autodesk will bring us the new features to the UI, not just for 3ds max but also for Maya. It’s sad to keep using strings and scripts.

    In my opinion it makes the job of a single artist, like me, more tedious. We need to worry too much about the settings and that stuff.

    I am not saying vray is better, and I think that maybe mental ray is even more versatile. But in Maya working with vray is so smooth and clean that make us think.

    I will not quit mental ray, but want to see more support from mental images like vray and their team. More real integrated features and not “R&D beta stuff”.. because I was at first passionate by mntal ray, I want to see mr rise again.

    Cheers

    • I think a lot of the defaults used in other packages are well thought out. The defaults used for mental ray inside of Maya were originally designed to smooth the transition from using Maya’s Software renderer to mental ray. Unfortunately these defaults have not changed to help the user make better decisions. On one hand that can make it more difficult to find the quality you want. But on the other hand it means you should be more informed about the choices you make through learning the process. And I can’t really say that learning a lot about this process is a bad thing. It can make you very valuable in the long run and that’s what the blog is for.

  5. When I add a string option to the miDefaultOptions is it automatically saved to the miDefaultOptions file regardless if I restart Maya ? The string for that option that I turned on will always be on and available, no more having to manually turn on the string ?

  6. Why aren’t all the string options; including those that can be turned on for MILA listed on this page; http://docs.autodesk.com/MENTALRAY/2014/CHS/mental-ray-help/files/manual/options.html#string_options.

    Is there a page, that lists, all the string options ?

    • Those are global string options in the core. Materials may make other string options known to the core and is in control of the material developer. Those options can be found with the material documents since they rely on the material usage

  1. Pingback: The user_ibl shaders: Part 1 « elemental ray

  2. Pingback: The Layering Library (MILA) UI: BETA SHADERS « elemental ray

  3. Pingback: Object Lights – mental ray 3.11 | elemental ray

  4. Pingback: How to? ( Unified Sampling ) | Sandeep Kittur

  5. Pingback: MILA New Features – May | elemental ray

  6. Pingback: GPU Ambient Occlusion in Maya 2014 | elemental ray

  7. Pingback: nVidia iray in Maya 2014 | elemental ray

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: