[Closed] Xsml shader access in Maxscript?
Hi, I am trying to create a script to automate some of the project’s material creation process, which involves a custom shader (made in Mental Mill) for the cutout channel of the arch and design material. Does anyone know if there’s a way of accessing the constructor and parameters of a custom shader? (the shader shows up in Slate under metaSL maps)
Thanks a lot if anyone knows, or can think of a way of doing it without a custom xsml shader.
Can’t speak about custom shaders (don’t have any to test), but the standard metaSL shaders are created using the name with spaces replaced by _, for example:
Texture Lookup 2d = [color=Lime]texture_lookup_2d()[/color]
Component Falloff = [color=Lime]component_falloff()[/color]
Map To Material Conversion = map_to_material_conversion()
Hope that helps,
-Eric
EDIT: It looks like you will need to possibly create a Class Name and map it in the NodeToMSL_MappingTable.xml file (located in [3ds Max Root]\mentalimages\shaders_standard\metaSL\Config\ folder). Then you should be able to create the class like other objects/maps/materials. Which you may have already done, if you already added the custom shader to the MaxMetaSLNodeTexmap.tbx.
Thank you! I shall have to look into that more tomorrow. The underscores thing works, so I can instantiate the custom map. EDIT: I just tried a few things, and am able to access the parameters! Thanks so much, I can now complete this script!
Thanks again,
P