Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Feature Requests => [Max] Resolved Feature Requests => Topic started by: rfletchr on 2015-10-20, 15:10:03

Title: 3dsMax /Maxscript. Remove version number from Corona's RenderClass name
Post by: rfletchr on 2015-10-20, 15:10:03
I need to be able to check the class of the  current rendering engine in order to do "Sanity"/Pre render tests before Scenes are submitted to our render farm.

Usually i do something like this
Code: [Select]
cRenderer = classof  Renderers.Current
if(classof cRender == mental_ray_renderer) then
(
--do shit
)

for renderers like mental ray / scanline this returns a consistent result regardless of the version of the renderer

Code: [Select]
mental_ray_renderer
Default_Scanline_Renderer

When i do this in corona:
Code: [Select]
Corona_1_1_1
Corona_1_2_1

so in order to check if this is infact corona i need to start doing string comparisons. Not the end of the world but its extra code and more room for errors.

Code: [Select]
sRenderer = (classof  Renderers.Current) as string
if(matchPattern sRenderer pattern:"*Corona*") then
(
 --Do shit
)

It would be alot cleaner if the RenderClass's name was simple "Corona_Renderer" and it had public property that exposed the current version.


Title: Re: 3dsMax /Maxscript. Remove version number from Corona's RenderClass name
Post by: Ondra on 2015-10-20, 15:33:43
This is so the version is displayed in renderers list/render settings header. It seems these two strings are coupled in 3dsmax and cannot be changed separately.

Can you check category, internal name, or class ID? I am not maxscript user so I am not sure if it can be done. Internal name is always "CoronaRenderer", category is always "Corona", and Class ID is always 0x62a85dcc, 0x523c3604
Title: Re: 3dsMax /Maxscript. Remove version number from Corona's RenderClass name
Post by: racoonart on 2015-10-20, 15:35:00
First of all, you can also do this:
Code: [Select]
classof renderers.current == CoronaRenderer"classof" prints the long name but is comparing the same classes, so it's working.

plus, you can use
Code: [Select]
CoronaRenderer.getCoronaVersion()which returns a string like that:
Quote
"1.3 DailyBuild Oct  5 2015, build timestamp: Oct  5 2015 21:22:28"
Title: Re: 3dsMax /Maxscript. Remove version number from Corona's RenderClass name
Post by: rfletchr on 2015-10-20, 16:14:38
First of all, you can also do this:
Code: [Select]
classof renderers.current == CoronaRenderer"classof" prints the long name but is comparing the same classes, so it's working.

plus, you can use
Code: [Select]
CoronaRenderer.getCoronaVersion()which returns a string like that:
Quote
"1.3 DailyBuild Oct  5 2015, build timestamp: Oct  5 2015 21:22:28"

Thanks DeadClown thats exactly what i needed.