Quick Fixes for Quixel Bridge to Maya Shader Generator Script (Arnold)
AnsweredFirst I want to thank you guys creating the Bridge tool. It's really helpful.
Maybe you need to tweak a few things to give us correct results. :)
Keep up the good work.
This content is copied from my blog, you can check the original post here:
https://ddankhaziportfolio.wordpress.com/2019/08/06/quick-fixes-for-quixel-bridge-to-maya-shader-generator-script-arnold/
If you tried to use the Quixel Bridge to Maya export feature you probably recognized it’s not working correctly (a missing Displacement shader, a strange aiRange node to modulate the roughness – which is not doing anything by default, and a few other things).
A quick fix for those issues:
- Close Maya
- Open the MS_Importer.py script with a text editor (the path is something like this: ~\Megascans\Library\support\plugins\maya\4.0\MSLiveLink\)
- Find the Arnold section (def Arnold3_Setup(self): part) and replace the roughness and displacement code with this:
if "roughness" in maps_: #arn_rough_range = mc.shadingNode('aiRange', asShader=True, name=(self.ID + "_Rough_Range")) roughness_ = [item[0] for item in self.tex_nodes if item[1] == "roughness"][0] mc.connectAttr((roughness_+".outAlpha"), (arn_mat+".specularRoughness")) #mc.connectAttr((arn_rough_range+".outColor.outColorR"), (arn_mat+".specularRoughness")) mc.setAttr(roughness_+".alphaIsLuminance", 1) used_maps.append(roughness_) if "displacement" in maps_: arn_disp_shr = mc.shadingNode('displacementShader', asTexture=True, name=(self.ID + "_Displacement_shr")) displacement_ = [item[0] for item in self.tex_nodes if item[1] == "displacement"][0] mc.connectAttr((displacement_+".outAlpha"), (arn_disp_shr+".displacement")) mc.connectAttr((arn_disp_shr+".displacement"), (arn_sg+".displacementShader")) mc.setAttr(arn_disp_shr + ".aiDisplacementAutoBump", 0) mc.setAttr(displacement_+".alphaIsLuminance", 1) mc.setAttr(displacement_+".alphaOffset", -0.5) used_maps.append(displacement_)
- Make sure the “tabs” are actually spaces! The indentation is crucial in python.
- Start Maya, start the listener, use the Exporter in Bridge.
Now you’ll get correct displacement and shader connections.
Be aware, some displacement texture intensity is not necessarily in the correct value range and the middle value (the “non displacing” value) is off. You might have to change the displacement scale (displacement shader) and the alpha offset (file node) values to get correct results.
For example (check the displacement scale and alpha offset values):
Sometimes the displacement texture is not “Maya friendly”, always check the exr files in an image editor.
Also I did not fixed the unnecessary file node generation problem (so you’ll get “Gloss” and Specular map file nodes as well.) You can easily fix those if you just delete the redundant file types at line 60 and 61.
Cheers, D
-
Hi Ddankhazi, I'd like to applaud you for your great effort into this one. That said, we have a team working on it and you can be sure that we have the technical minds and people behind it. We are reworking all of our offline renderers LiveLinks, so it takes a bit of time but you can expect a major LiveLink update that we will release progressively.
Great job again for your great effort into your research.
Best,
Jin -
Thanks all, I have another issue, which may (or not :) be related to this. I noticed that when I have a polygon cube and render it out in Arnold, it looks perfect. However, if I put a Megascan shader on it (via Bridge,) the cube becomes an oval. See picture.
I noticed in the log it says
alInputScalar.dll was compiled against non-compatible Arnold 4.2.12.2
alJitterColor.dll was compiled against non-compatible Arnold 4.2.12.2Thanks
Bart
PS I'm using Maya2019 at the moment, but had the same issue with 2018, using Arnold Core 5.2.2.0
-
Hi Bart,
The change in the shapes is caused by the subdivisons. Don't worry about that.
Just turn it off if you don't need subdivisions for those objects:- Select the object
- Go to the shape (mesh) node and find the Arnold section Subdivision part
- Change the Type from catclark to none
Also if you turn off the Apply Material to Selection option in the LiveLink window this will not happen.
Actually this is not a bug, because usually you need subdivision to get nice displacements.
I recommend you to learn about subdiv modeling.https://www.dropbox.com/s/ojrd1tnijky5pb1/Screenshot%202019-08-07%2019.07.28.png?dl=0
The two error messages are not related to Megascans or the Bridge feature.
You are using an old version of the AL shader pack. Try to update that.Cheers, D
Please sign in to leave a comment.
Comments
7 comments