Renderer Switch - How to check for current Renderer?

Hey Guys,
I'm stuck again on a very simple script. I just want to code a macro that looks if scanline or mental ray is the current production renderer and then switches to the other one. But I just don't get it how to check for this. I've found a very similar topic in this forum, someone with the same problem, but he did not get any answers.

I tried "if (renderers.production == default_scanline_renderer)..." and "if (renderers.production == defaultScanlineRenderer)..." and so on but it won't work. I also tried to check for mental-ray-only attributes like "if (renderers.production.FinalGatherEnable2 == true)..." ,but when scanline is active it crashes my script.
I just don't know what to check for....

The little script so far:

 macroscript renderSwitch category:"Custom"
(	
	case of
			(
				(renderers.production == default_scanline_renderer): renderers.production = mental_ray_renderer()--case 1
				(renderers.production == mental_ray_renderer): renderers.production = default_scanline_renderer()--case 2
				 default: renderers.production = mental_ray_renderer()--default case
			)--end case of
)--end macroscript 

Hope you can help ;) And I'm a beginner, please keep that in mind :> Thanks!

Greetings

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
br0t's picture

Great! I learned how

Great! I learned how "format" works and that things in max do have an ID. The mental ray ID is weird :P But the Script does exactly what its supposed to do, thanks alot :]

Never get low & slow & out of ideas

Kstudio's picture

-- get classId for your

-- get classId for your renderers
for i in RendererClass.classes do format"%: %\n" i i.classID
 
case of
		(
			(renderers.current.classID[1] == 1/* default_scanline_renderer */): renderers.current = mental_ray_renderer()--case 1
			(renderers.current.classID[1] == 1492548972/* mental_ray_renderer */): renderers.current = default_scanline_renderer()--case 2
			 default: renderers.current = mental_ray_renderer()--default case
		)--end case of

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.