Skip to main content

Loosing Access to Shading Groups ( Mental-ray )


When Using Mental-ray, your materials could disappear from your imported assets. Thankfully, just deleting namespaces can fix this issue

This addresses an issue that I started noticing in Maya when using Mental ray . I noticed that when importing geo files with materials assigned to them ( .fbx or . ma) I was loosing access to my shading groups through the attribute editor. which meant I couldn't directly select my material in the Attribute Editor after grabbing my object in the Viewport.

I knew the materials were still assigned. When I rendered the scene , the information was still there. When I went to the hypershade, I was was able to right-click on a material and choose " Select Objects with Material" and the objects with the Material would light up in my view-port. The material was still attached so why could't I edit it in my attribute editor?!

It turns out that there is a very simple solution to this. While I can't give a definitive explanation, I think I have a pretty good theory as to why this happens.

SOLUTION : Remove references/ namespaces from your import.

A. If you haven't imported your assets yet : Turn "Use Name spaces" off in the import buffer before importing your desired object or scene file. This is the quickest way to insure that your materials import in with their shading groups.

File> Import> Option Box. This is best if you are not using Maya's UI for your file browser.
Turn off "use namespaces" in Import Options: File > Import > Option box. This is best if you are not using Maya's UI for your file browser.

If you are using Maya's UI for File Browsing, you can just turn off namespaces directly from the import window : File > Import


B. If you have already imported your assets : Strip your name spaces. The easiest way to know if your assets have name spaces is to check the outliner. Objects with name spaces will have a ":" in them. ( file_import : asset_name ). If you see that your imported assets have this syntax, you'll need to do the following to strip name spaces :

1. Windows > General Editors> Name Space Editor : The Name space editor will pop up on your screen. Any imported assets with name spaces will appear in the little list on the left.

Open the Namespace Editor : Window> General Editors > Namespace Editor

2. Select each name space and hit Delete.
3. Choose "Merge with Root". This will delete the current namespace of your selection and move all the nodes under the root namespace- basically it puts everything in your current project space.



4. Once all your namespaces are removed, close the namespace editor. Clicking on an object that previously had a namespace, will allow access to your previously hidden Shading Group within the Attribute editor.

C. You have assets in a scene without namespaces and no Shading group in AE : Once or twice I have stumbled on a scene where an object appears not to have a namespace or be a reference but I still can't access the shading group from the Attribute Editor. If this happens, the easiest fix is to :

  1. Duplicate the problem geometry.
  2. Assign a new material to the duplicate of the problem geometry
  3. Delete the old problem geometry.
  4. Assign the materials that were on the problem geometry to the duplicate geometry.


Explanation : Namespaces Behave like Flexible References.

After doing extensive testing with namespace imports and other renders ( V-ray and Iray), I have come to the conclusion that this is a little limitation in mental ray. It appears that Mental ray thinks that when an object lives under a namespace, it is not treated as a fully unlocked Geo mesh. It instead only has two tabs, much like a reference or a group would; one tab that could refer to position, scale and rotation, and the other tab that pertains to render layer overrides.

If you are just importing parts to a much larger asset, like nuts and bolts to a machine, or rafters to a building, then you probably won't want to have name spaces in your final scene so that material selection and assignment via object selection in view-port is much easier. If you are working in a production like environment, if you want to change an asset in a namespace, it is probably better to update that asset file before importing it in. While Namespaces, in no way, restrict you from creating and finding materials on assets contained within them, as your project grows and more materials get created, you may find it harder to know which material correlates to which object quickly.

Comments

Popular posts from this blog

Exploring Scales With Substance Designer

Preface Some of my first blog posts focused around how to create a "scale " material from texture to render in Maya with V-ray. The Series " Making A Seamless Scale Material " took a more "traditional" approach to creating a tile-able scale pattern. I think this method still has its strengths as it also covers valuable tips and tricks that can be used in Illustrator and Zbrush, but I wanted to share another method for creating scales by using a program dedicated to creating scale-able, flexible, and tillable procedural textures in a node based- lossless editing environment. I have been using Substance Designer almost exclusively for texture generation for the last year now and the amount of flexibility and possibilities that can be created are virtually endless. In truth, Substance Designer is no walk in the park for traditional texture artists. Its node based editing system and use of procedurals require you to think in a different way- but in the

Making a Seamless Scale Material Part I

Today, I wanted to share my process for creating a seamless, scale-able material that can either be projected onto Zbrush models or applied as materials to UV'd models inside of programs like Maya and 3Ds Max. I used this when creating my unique stylized scale surfaces. You can find breakdowns for them here : Stylized Scale Materials This is a tutorial that will be split into four parts. Below is an outline on what we will cover.  This post will be addressing part 1.            Part 1:  Approaching Scales and Creating a Pattern.           Part 2:  Refining your pattern in Zbrush.           Part 3: Creating a compelling and believable scale Material inside of Maya I will be using the following programs to create my Scale material : Adobe Photoshop (optional) , Adobe Illustrator (optional), Zbrush , Vray and Maya.  Part 1: Approaching and Creating A Pattern    Creating a seamless texture can be done in many ways. This tutorial goes over just one way to cr

Creating Spiny Fins With Curves and Surfaces ( Maya)

This "little" tutorial will go through the process of creating fins and fin shapes using curves and surfaces in Maya. I found this method to be the most "accurate"while building out the spiny shapes of fins in my current project, and thought I'd share my process. The tutorial below is broken down into three parts and will cover the basics of working with Curves in Maya. A. Building the Main Shape B. Creating the Spines C. Lofting Fin Shapes I will be diving into detail about certain tools in Maya. In this tutorial, I will go over using Live surfaces, converting edges to curves, lofting surfaces, converting nurbs to polygons, extrusions and moving constraints like snap to curve and snap to vertex. A. Building The Main Shape. Create a base curve . The base curve should match the center line of your mesh. This will define where the fin shape will start. If you have a mesh that is already topologized with a clean center line, extracting a curve f