Xgen & Arnold issues


#1

Hello,

I have two problems with Xgen maya & Arnold (I don’t know if they’re linked or not) and it’s driving me crazy.

First one is whenever I try to export an archive with an Arnold shader on it, I got a message saying “Pythoninterpreter has stopped working”, and then arnold tells me that :

  • CRASHED in Tstring::operator==
  • signal caught: error C0000005 – access violation

Second is I can’t render any custom primitives with arnold & Xgen. I tried with spheres and it works fine, but when I switch to archives, import my archives and apply a shader, it doesn’t render.


#2

Create an object to use as archive in another scene, delete history, rename the object without numbers or : save and export this object as archive. Don’t set arnold as render engine for now.


#3

Thanks for your reply.
It doesn’t work either.
I also tried to export the archive with the lambert1, then imported them without material and applied an Arnold shader on the collection, but it doesn’t render the archives. It works fine with Mental Ray but I’d prefer to work with Arnold because of the userData nodes.


#4

I found out what was wrong. When exporting the archives, maya is supposed to create an alembic, a .mi for mental ray and a .ass for arnold. For some reason maya doesn’t create the .ass file when I export my models, so I exported it manually, and added it manually in the archive (either by editing the xarc file or by editing it in maya after adding it to the description)


#5

I’m having the same problem and it’s driving me insane. Could you go into more detail about how you fixed it please? I’d be so grateful! :smiley:


#6

Hey Pahuska, I have the exact same issue. Could you describe in more detail what you did, please?


#7

Hi Pahuska
I have the same problem and I couldn`t find a solution yet…Any progress about this problem ?


#8

There seems to be a bug in the arnold-xgen exporter to archives (Maya 2016, maybe 2105 also). For whatever reason it can’t export a thing if arnold is involved in any way in the process, meaning you can’t export nodes with arnold shaders or being arnold itself the current renderer. Even the geometry can’t have any of the arnold attributes or it’ll fail. A workaround would be exporting the geometry setting any renderer but arnold as the current renderer and assingning lambert placeholder materials to your objects. Once done, you’ll have the usual file structure able to be renderer in MR. Create a folder called “ass” inside the “archives” folder beside the “mi”, “material” and “abc” folders. Select your geometry and export to ASS to this “ass” folder making sure you activate the “export bounding box” and “use gzip compression (.ass.gz) options. Add the required lines to the .xarc file pointing to your newly created arnold .ass.gz file (take the existing lines as template changing the “mi” part to “ass”. You’ll may have an error saying maya is unable to find the route. I don’t know why, but the arnold parser which reads this file seems to have a hardcoded “/” after the “{$PROJECT}” part, so you can safely delete it leaving it as this “”{$PROJECT}your/path/to/archives”. Import the archives into your description an save the file. Cry of joy.


#9

Thanks strangerman! I still can’t seem to render any xgen descriptions with arnold in maya 2016! No matter if I export my object as the default abc archive or try it as an .ass file…I just can’t seem to get my head around why I can’t see it in the render! Any ideas what I might be doing wrong? Thanks for your help!


#10

Me too, I’m using maya 2016 and arnold. I tried exporting a simple cube with lambert1, create an xgen description and it works, but when I render nothing is visible.
Also, strangerman, can you please post a “before/after” example? I couldn’t understand what you mean with “Add the required lines to the .xarc file pointing to your newly created arnold .ass.gz file”. I have more than one line even if I only had assigned one material to the object, see this example:

#ArchiveGroup 0 name="scaleTest" description="No description." thumbnail="scaleTest.png" materials="${PROJECT}/xgen/archives/materials/scaleTest.ma" color=[1,0,0]
0 "${PROJECT}/xgen/archives/abc/scaleTest.abc" material=scaleTest:mia_material_x1SG objects=|scale1
1 "${PROJECT}/xgen/archives/abc/scaleTest.abc" material=scaleTest:mia_material_x1SG objects=|scale1
2 "${PROJECT}/xgen/archives/abc/scaleTest.abc" material=scaleTest:mia_material_x1SG objects=|scale1
3 "${PROJECT}/xgen/archives/mi/scaleTest__scale1.mi.gz" material=scaleTest:mia_material_x1SG objects=|scale1
4 "${PROJECT}/xgen/archives/mi/scaleTest__scale1.mi.gz" material=scaleTest:mia_material_x1SG objects=|scale1
5 "${PROJECT}/xgen/archives/mi/scaleTest__scale1.mi.gz" material=scaleTest:mia_material_x1SG objects=|scale1

EDIT:now I got it working, here it is how I did it:
take the .xarc code I wrote before as an example, that’s what you get when you export an object with a mia material x.
change that in this:

#ArchiveGroup 0 name="scaleTest" description="No description." thumbnail="scaleTest.png" materials="${PROJECT}xgen/archives/materials/scaleTest.ma" color=[1,0,0]
0 "${PROJECT}xgen/archives/abc/scaleTest.abc" material=aiStandard1SG objects=|scale1
1 "${PROJECT}xgen/archives/abc/scaleTest.abc" material=aiStandard1SG objects=|scale1
2 "${PROJECT}xgen/archives/abc/scaleTest.abc" material=aiStandard1SG objects=|scale1
3 "${PROJECT}xgen/archives/ass/scaleTest.ass.gz" material=aiStandard1SG objects=|scale1
4 "${PROJECT}xgen/archives/ass/scaleTest.ass.gz" material=aiStandard1SG objects=|scale1
5 "${PROJECT}xgen/archives/ass/scaleTest.ass.gz" material=aiStandard1SG objects=|scale1

Obviously change the shading group with the one of the shader you want to assign.
Now it works as it should! thank you strangerman, you rock! :applause:
I recorded a video for how to do it:

//youtu.be/bkGc5VTMFbg


#11

Seems like a lot of work.
What if you had ten different materials with ten different xarc’s?
Is this a bug or ADSK wanting you to use native Mental Ray?
Seems like a script could fix this renaming thing or maybe the Solid Angle pples could look at it coding wise.
Thanks for the tutorials video.


#12

I have fixed the issue with Maya2016 and arnold. This could work with other Maya versions also. I’m on win10 system.
There are only two places where you need do the changes and it should up and running.

Here’s the procedure :

  1. Open C:\Program Files\Autodesk\Maya2016\plug-ins\xgen\plug-ins\xgenMR.py
    Add the bold line in the scrip (Make sure you copy the .py at safe place before changing it.)

import sys
sys.path.append( ‘C:\solidangle\mtoadeploy\2016\scripts’ )
import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds

  1. Open C:\Program Files\Autodesk\Maya2016\plug-ins\xgen\scripts\xgenm\xmaya\xgenMRExport.py (save a safe copy)
    Add the bold line in the scrip

Export Init callback. Must fill in som arrays on self

def xgmrArchiveExportInit( selfid ):
self = castSelf(selfid)
self.batch_plugins.append( “Mayatomr” )
self.batch_plugins.append( “xgenMR.py” )
self.batch_plugins.append( “mtoa” )

Open maya and run the xGen archive from menu.

P.S. When I ran it first time the maya got crashed but that had created all the related files. On the second attempt it was very smooth and Maya did not crash.


#13

Yess! This definitely works! thank you very much! :buttrock:


#14

Thank you very much for getting that to work vsanghan! It finally works! :smiley:

Just a quick question…I get an error “// Error: XGen: Failed to open file: /__collection.xgen //” when I render a scene with a xgen description in it. It renders it despite the error. Any idea what might be causing this? Thanks a bunch!


#15

Happy for you guys that the solution working for you too!! :slight_smile:

I have not came across this error.
But, I’m facing issue with arnold shader property, it doesn’t behave they way it behaves normally. Specifically opacity. I have populated trees with leaf which has alpha to cut out the shape of it. As a work around I’m exporting MEL file and re-importing it in fresh file (maya import it as instance geo) and with instance geo opacity seems working fine. (May be because it understands the opaque check box under shape node, which xGen doesn’t.)

Share any other workaround if you have cracked one. :slight_smile:


#16

Is it possible to have xgen load the actual .ass file to replicate? So one doesn’t need to have a separate material file (.ma) and a separate .ass/.abc file. Is this possible through changing the xgen xarc file? One problem that I have with exporting the description as MEL and then importing that is that it brings actual geo with instances…what if I want to simply have my .ass file instead of instanced geo. I’m sure it would be possible by editing the MEL file but I have no clue how! Any chance you could help me out with that please? I imagine that the line in the MEL file where it imports Abc and the material file and connects them would be deleted and replaced by just creating an arnold standin which gets placed around…

Any help would be much appreciated! Thanks once again!


#17

Also, I’m not able to render animated archives with Arnold. So…I’m exporting 10 frames of animation of a cube being deformed (I’ve baked the animation on it using bake simulation) as an archive. When I load the archive in xgen to replicate it I can see the first frame of the animation in the viewport but it doesn’t render. Do I need to plug an expression somewhere so that I Arnold renders the animation just like one needs to have an expression when loading an arnold standin if it has animation?

Thanks guys!


#18

Same here. Even I can’t render the animation. But, I can bring the animated archive without baking it. To play the animation for the archive you need to scrub the Frame slider in primitives attribute.

For your other query, I think so, arnold and xGen developers should create some working model. Yes, I agree instead of instance there should be some option to choose .ass file for arnold specific render. There should be one more export script just like Mel OR atleast it should render the archive (both static & animated).


#19

Thanks for the quick response. I got animated archives to render! Both baked and non baked seem to work. I don’t think I did anything different to what I was trying though…I’ve put an expression on the frame attribute so that my animation cycles. I can’t for the life of me figure out how to offset the animation randomly on the different primitives…Any clues as to how that might be achieved?!

Also, I got motion blur rendering with my animated archive…I’ll try rendering some geo with opacity maps to test that out tomorrow. You mentioned you couldn’t get that to render so I’ll see if it works for me…


#20

Just got animation and opacity on shaders working with xgen and arnold. I was able to render the animated geo (baked or unbaked) by going to File>Export patches for batch render in the Xgen window. I did this after loading the animated archive and setting frame values as I wanted.

For the opacity, you need to go to the attributes of your xgen ‘description’. There you’ll find a checkbox for Ai Opacity which you can turn off to have the opacity working as you’d expect. View attached picture…

Annoyingly if I export a MEL file of this and import that it doesn’t have any of the animation expressions that I’ve set up etc…perhaps something to sort out later.