Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XGen Materials

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
atomicx
6728 Views, 10 Replies

XGen Materials

I have been struggling to understand how XGen handles material assignments on archives. When I import a somewhat complex archive with multiple objects and materials it will import a shading group material reference for each object in the archive. The problem I have not been able to sort out is how to manage these material assignments after the fact.

Problem 1: When importing the same archive onto separate objects with independent XGen collections it creates multiple duplicates of the materials. I haven't found a way to consolidate them. I know you can assign a material to an XGen description but that will override the materials on every archive so all the unique materials on each object are lost. This becomes a huge issue when you are dealing with 10 or 15 archives for each description. The result is hundreds and hundreds of materials in the scene.

Problem 2: When removing an archive from the description, and then later adding that archive back in will lose the material references even when importing the materials again. This persists even when all shading group references and materials have been cleaned from the scene. The removed, then replaced, archive will always render grey.

I suspect that my issues have to do with my lack of understanding of how XGen handles material references. There is no documentation to fully explain how the system works with complex archives. If someone could explain the process I would greatly appreciate it.

10 REPLIES 10
Message 2 of 11
pshwayka
in reply to: atomicx

At the risk of answering a question with a question (and being therefore no help at all) have you actually had success in creating multiple collections that have descriptions referencing the same archive?  Every time I try that and render the scene, the archive only shows up on the last object that I created a collection and description on.  What is even stranger is that the archive renders on the object that won't show a preview, while the other object that successfully shows a preview does not render the archive.

 

As for duplicate materials, as you can probably guess, it's all about namespaces.  Have you tried anything with the namespace editor in your efforts to consolidate things?  I'm not sure that would work, but it might be interesting to try...

Message 3 of 11
atomicx
in reply to: pshwayka

I have heard of that issue with adding the same archive to multiple collections. So far I haven't experienced that as a problem. I've had as many as 9 collections referencing the same archives. It seems I read somewhere that issue was addressed. I'm using Maya 2015 Ext1 + SP5 so perhaps it's fixed in this version.

 

I haven't tried the namespace editor but I think you may be onto something. I will dive in and see if I can get some results.

 

Thx.

Message 4 of 11
pshwayka
in reply to: atomicx

Just out of curiosity...have you tried doing an Edit->Delete Duplicate Shading Networks in the Hypershade window?  I just tried it in a scene that two objects populated with the same archive under different collections, and it actually deleted the namespaced lambert. Might be something to try.

 

BTW, I'm on 2015 Extension 1 SP5 under Windows 8.1.  Not sure why my multiple collections with XGen archives are so flaky for me in terms of visibility.

Message 5 of 11
atomicx
in reply to: pshwayka

I have tried that in a heavily populated scene. It did reduce some nodes but it was hard to tell which ones since there was hundreds. It didn't, however, consolidate them. There were still multiple copies. What I did was select all the materials in hypershade then selected 'Delete Duplicate Shading Networks'. Is that the same process you followed? I'm using Arnold shaders. Not sure if that's related. When I get a moment I'll do a test on a simple scene to see if I can narrow it down.

 

I did have success with my second problem by using the namespace editor. It seems that even after removing an archive, deleting the material references, and removing the materials from the scene, there are still the namespaces left. After deleting the referenced namespaces I could successfully re-import an archive without losing materials.

 

The next thing I want to try is adding a set of materials to all the namespaces so there are no duplicates. Not sure how this will work...

 

I'm running Win7 x64. Not sure if that's at all related. The process I have been primarily following is loading exported collections and descriptions on duplicate objects in the scene. However, there are still several unique objects and collections all referencing the same library of archives. I have tried creating a couple collections from scratch in the past. I was suprised that I could use the same archives on both collections since I heard it was an issue. Like I said it hasn't been an issue for me yet, knock on wood. That doesn't mean it won't. 😉

Message 6 of 11
pshwayka
in reply to: atomicx

First of all, thanks for mentioning you are using Arnold...it prompted me to try Vray instead of Mental Ray, and now things are showing up in both previews and renders.

Secondly...we may be trying too hard!  I just created a simple scene with two planes, and created two separate collections (one for each plane) that utilize the same archive file.  For the first collection, when I added the archive, I answered 'yes' when asked if the materials should be imported.  For the second one, I said 'no' when that question came up...and yet the archives showed up with the correct material on them...and Hypershade shows just the original VRay material I used when creating the archive.  It's almost as if the archives default to the correct material if it's already in Hypershade. Give it a try!

 

To answer your question, when I deleted the duplicate shading network on the old scene, I had selected the 2nd instance of the shader.

 

I envy you using Arnold...I tried the trial version about a year ago and loved it...but the last I checked, their website still says they require you to buy 5 licenses minimum, and I only need 1.  I wrote to them a while back asking when they were going to lift that restriction, and got completely ignored...

Message 7 of 11
atomicx
in reply to: pshwayka

I had tried that in the past and it did not work so I abondoned it. Now that I think about it I think I was having a namespace issue with that scene so that's why it wasn't working. Your comment got me thinking about another approach for the current scene I'm working on. As I mentioned I'm importing descriptions on multiple objects. Since the materials weren't coming in with the archives I would manually re-ad those archives to import the materials (not an elegant approach). So I tried a fresh scene and imported the descriptions on the geo, then manually imported the material .ma files from the xgen archive output for all the referenced archives. Violla! Materials render properly on all objects and no duplicates!

 

So really the approach is essentially the same. The archives are looking for materials in the namespace. If the namespace has problems so will your materials. You could import them only once when importing multiples of an archive, as you mentioned. Or you could manually import them from the .ma files.

 

This also helped me understand what is an apparent bug that happens sometimes when exporting archives. For some reason some material .ma files also export the geo with the materials. This was confusing to me why some archives would also read in the geo when you choose to import the materials. The geo didn't seem to contribute to the XGen creation so I got in the habit of deleting the objects. This became apparent when I was looking at the materials for the archives. Most of them are 30 to 60kb, and others are 70 to 150MB. Obviously containing the geo as well.

 

Thanks for your comments! Sometimes just talking it over gets you thinking in a different direction.

 

I really enjoy Arnold, although I still have a healthy respect for VRay. As far as I know they haven't lifted the 5 license minimum yet, although they advertise it is coming. They have added a nice rental program though.

Message 8 of 11
pshwayka
in reply to: atomicx

Sounds like you've got it dialed in.  Glad to have (sort of) helped...and I agree with you on the benefits of discussion.  I also have found that I have learned more about Maya by trying to help other people that I have just watching videos and reading books.  There are thousands of different ways to use the software, and each user brings a different perspective...which is constantly intriguing to me.

Message 9 of 11
atomicx
in reply to: pshwayka

Just a couple side notes. I'm still occasionally getting some namespace problems when dealing with lots of archives and collections. However, now that I understand the process better it's a pretty easy fix. When there are duplicate namespaces you will see sub namespaces in the namespace editor. You can select those and choose collapse to child.

 

I can now remove or add materials or archives without fear of breaking something. Soo much better!

 

I also found that I could clean up the erroneous materials from the archive output. Simply import the material .ma file, delete the geo, then save out the shading group reference objects again replacing the original .ma file. Makes for a cleaner import process.

Message 10 of 11
johnnyzxt
in reply to: atomicx

Hi , atomicx, I found your post on CGTalk, and follow you to this place, I have the same problem, but I want reference a xgen maya file, the namespace still exist on the material that associate with the xgen archives, when I render it , it can't find and connect the material SG automatically, how can I deal with it in a reference file? Would you like to help me ? thanks 

Message 11 of 11
Michael_Todd
in reply to: johnnyzxt

Import the material (.ma) files for the archives via the Hypershade file/import operation. Then save the file. that should rebuild the bindings between the archives and materials. 

 

This is a known issue and we are looking into it.

 

Cheers



Michael Todd

XGen Product Owner and Designer

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report