Hey Mike

Maybe you could try to explicitly set the image type (texture/imageFile) to 
image file?

pm.setAttr(ibl+'.type', 1) # to use an image file
pm.setAttr(ibl+'.type', 0) # to use a texture

Maybe you could try and set it to use a texture for now and see if that works. 

If that actually works, you could point it to a texture file node and load an 
image file from there?

Not the most elegant solution, but I believe that'll work.

Let me know if any of it helps :)

Best Regards,
Patrick

On Friday, 8 April 2016 09:32:19 UTC+8, Mike Oliver  wrote:
> Hi Everyone,
> I'm trying to set up some automated Mental Ray scripts for our studio 
> artists.  I'm having some difficulties accessing all the proper variables 
> within Mental Ray.  Specifically setting the Image Based Lighting.
> I have created IBLShapes, set their attributes and connected the IBL to 
> 'mentalrayGlobals.imageBasedLighting' yet when I set an HDR map (done 
> manually for the time being) and render, I get no IBL information and a 
> warning:
> Warning: (Mayatomr.Nodes) : mentalrayIbl1: IBL ignored. File texture not 
> found, or constant black input color. //
> 
> 
> I'm very sure there is an attribute I'm not connecting somewhere, but I cant 
> spot it. 
> 
> 
> Tracing Mayas output window I can see the miCreateIbl function (C:/Program 
> Files/Autodesk/mentalrayForMaya2014/scripts/createMentalRayIndirectLightingTab.mel).
>   I don't believe I missed anything in the Create or Update IBL functions
> 
> 
> Does anyone have any suggestions?
> 
> 
> Thanks
> 
> 
> 
> 
> 
> 
> Enter code here...
> import pymel.core as pm
> # Load MentalRay Plugin
> if not pm.pluginInfo('Mayatomr', q=1, l=1):
>     pm.loadPlugin('Mayatomr', qt=1)
> 
> 
> #Set MentalRay Options
> pm.setAttr('defaultRenderGlobals.ren', 'mentalRay', type='string')
> pm.setAttr('miDefaultOptions.globalIllum', 1)
> pm.setAttr('miDefaultOptions.globalIllumAccuracy', 500)
> pm.setAttr('miDefaultOptions.finalGather', 1)
> pm.setAttr('miDefaultOptions.finalGatherRays', 500)
> pm.setAttr('miDefaultOptions.finalGatherPresampleDensity', 5)
> pm.setAttr('miDefaultOptions.finalGatherPoints', 125)
> 
> 
> # Add IBL
> if not ibl:
>     ibl = pm.shadingNode('mentalrayIblShape', al=1)
>     pm.connectAttr(ibl+'.message','mentalrayGlobals.imageBasedLighting')
>     pm.xform(ibl, s=[5000,5000,5000])    
> 
>     pm.setAttr(ibl+'.primaryVisibility', 0)
>     pm.setAttr(ibl+'.visibleInEnvironment', 1)
>     pm.setAttr(ibl+'.visibleInReflections', 1)
>     pm.setAttr(ibl+'.visibleInRefractions', 1)
>     pm.setAttr(ibl+'.visibleInFinalGather', 1)
>     #set Image path in UI (done manually for now)

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/302957c7-89ca-4d19-b47a-ec873c088591%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to