Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

playblast generated from commandline mayabatch looks dark

playblast generated from commandline mayabatch looks dark

Anonymous
Not applicable
2,456 Views
3 Replies
Message 1 of 4

playblast generated from commandline mayabatch looks dark

Anonymous
Not applicable

I'm generating playblasts by running maya commandline instances.  It works but it's dark. Since it is running via a commandline instance, I assume whatever renderer or viewport it generates is some default that is not the same as the one I am running in the main Maya app. 

 

I tried setting enableDefaultLight=1, but it didn't change anything.  Is there any other setting that would affect how dark everything looks? 

 

 

Accepted solutions (1)
2,457 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

couldn't figure out how to edit my post, but I went and printed out all of the defaultRenderGlobals in my batch compared to the ones live in the running Maya editor, and they all look the same.  Is there something else that could affect the lighting?

Message 3 of 4

Anonymous
Not applicable

ok well after spending all day on this, I think that one of the problems was that the commandline-run playblasts were not using the hardware renderer.  By using these lines, I get something that looks closer to what is in the viewport:

 

setCurrentRenderer "mayaHardware2";
catchQuiet(`setAttr ("hardwareRenderingGlobals.renderMode") 2`);

 

The problem now is that I don't see my textures.  I see smooth-shading with wireframes.  I can get rid of the wireframes with this command:

 

displayPref -wireframeOnShadedActive "none";

 

But I've tried a bunch of things and cannot get the textures to appear.  Anyone have any ideas?  Here's two things I tried:

 

displayStyle -textured;

modelEditor -displayTextures true modelPanel4;

 

In the editor, you set hardware texturing on a panel - but when running maya from the commandline, it seems that there are not panels, since there is no UI.  So where / how do you set the texturing for the hardware renderer it is using?

 

 

 

 

 

Message 4 of 4

Anonymous
Not applicable
Accepted solution

OK just to wrap up this days-long conversation with myself, I finally got this working.  Been down the rabbit hole and back with all these stupid flags and attributes.

 

It wasn't the arnold renderer like I thought yesterday.  I'd always been using the hardware renderer.  The rendermode of '4' is what tells it to use the textures.  But I couldn't get it to use the gamma I wanted.  I would have thought that setting the colorManagementPrefs outputTransform for the 'playblast' target would have worked, but it wouldn't, for me.

 

Finally what worked was changing the settings on the 'renderer' target.  Like this:

colorManagementPrefs -e -outputTransformEnabled true -outputTarget "renderer";
colorManagementPrefs -e -outputUseViewTransform -outputTarget "renderer";

 

so my whole playblast output script looks like this:

 

if(`objExists Playblast_Camera`)
{
     string $cams[] = `lsType("camera")`;
     for ($cam in $cams)
     {
          catchQuiet(`setAttr ($cam + ".rnd") 0`);
     }

     catchQuiet(`setAttr ("Playblast_Camera.rnd") 1`);
}
else
{
     print ("Could not find Playblast_Camera\n");
}

catchQuiet(`setAttr ("defaultResolution.width") 1280`);
catchQuiet(`setAttr ("defaultResolution.height") 1280`);

setCurrentRenderer "mayaHardware2";
catchQuiet(`setAttr ("hardwareRenderingGlobals.renderMode") 4`);

colorManagementPrefs -e -outputTransformEnabled true -outputTarget "renderer";
colorManagementPrefs -e -outputUseViewTransform -outputTarget "renderer";

playblast -clearCache 1 -viewer 0 -showOrnaments 0 -percent 100 -quality 100 -width 1280 -height 1280 -offScreen -forceOverwrite -format "avi" -filename $DestFullFilePath;