- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am working on a maxscript to auto load the PBR bitmaps exported from substance painter into an Arnold standard surface material (and the Physical material as well.) I want to place an OSL Bitmap Lookup Map in the slots requiring a linear workflow (e.g., Normal, Roughness, Metalness) so that I can take advantage of the ability to set gamma = 1.0 with the OSL Bitmap Lookup Map. However, I have not been able to find the right syntax to do the first step of loading the OSL Bitmap Lookup Map into any slot. I am pretty sure it is something simple that I am missing.
For example, none of the following work:
--//////////////////// Attempt 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-- load Roughness map into slot and set gamma to 1.0
newMaterial.specular_roughness_shader = OSLMap()
--The above just results in the generic example OSLMap loaded into the slot and not the Bitmap Lookup OSL Map
--//////////////////// Attempt 2 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
--tried loading the file .osl file directly into slot
newMaterial.specular_roughness_shader = "C:\Program Files\Autodesk\3ds Max 2020\OSL\OSLBitmap.osl"
The above produces the following error message:
--//////////////////// Attempt 3 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-- so tried loading the file .osl file using the BitmapTexture Filename:
newMaterial.specular_roughness_shader = Bitmaptexture fileName: "C:\Program Files\Autodesk\3ds Max 2020\OSL\OSLBitmap.osl"
--The above places the .OSL into the Bitmap Parameters > Bitmap slot and not the parent slot; in other words treats it like a texture map and therefore with no access to the parameters I am interested in (gamma )
--//////////////////// Attempt 4 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
--so I tried using the <OSLMap> OSLPath method, but obviously got the syntax wrong
newMaterial.specular_roughness_shader = OSLMap.OSLPath = "C:\Program Files\Autodesk\3ds Max 2020\OSL\OSLBitmap.osl"
--The above gave the following error message:
I will not bore you with the various other (pathetic) attempts to get the syntax right, but am hoping the expertise here can guide me as to what I am doing wrong.
Thanks in advance for any guidance.
Solved! Go to Solution.