[Closed] test what render engine being used
I cant get this bit of code to work could someone show me why ? , Ive not done any script for ages and seemed to have forgot loads , anyway I am trying to find out what render engine max is using and hoped this would work just to get me started but its not doing anything but give me syntax errors
thanks for reading
if (renderers.current == Default_Scanline_Renderer:Default_Scanline_Renderer ) then (Print"we are using Scanline")
if (renderers.current == mental_ray_renderer:mental_ray_renderer ) then (Print"we are using mental_ray")
if (renderers.current == V_Ray_Adv_2_40_04:V_Ray_Adv_2_40_04 ) then (Print"we are using Vray")
ok I sorted it
if (matchPattern (renderers.current as string) pattern:"Default*") then (Print"we are using scanline")
if (matchPattern (renderers.current as string) pattern:"mental*") then (Print"we are using mental_ray")
if (matchPattern (renderers.current as string) pattern:"V_Ray*") then (Print"we are using VRay")
This is the proper way:
if ((classof renderers.current) == Default_Scanline_Renderer) then (Print "we are using scanline")
ok thanks lo I will try it that way , will this also work with different versions of Vray ? I mean will Vray version 1 return a different string than version 2 ?
Different Vray versions have different class names, but Chaos Group was wise to define the ‘Vray’ global variable which is a synonym for the currently installed version of vray.
If you want to check if any version of Vray is being used:
classof renderers.current == vray
If you want to check if a specific version of Vray is being used:
classof renderers.current == <WHATEVER THE CLASS NAME FOR THAT VERSION IS>