Author Topic: 3dsMax /Maxscript. Remove version number from Corona's RenderClass name  (Read 3281 times)

2015-10-20, 15:10:03

rfletchr

  • Active Users
  • **
  • Posts: 41
    • View Profile
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.


« Last Edit: 2015-10-20, 15:22:06 by rfletchr »

2015-10-20, 15:33:43
Reply #1

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
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
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2015-10-20, 15:35:00
Reply #2

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
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"
Any sufficiently advanced bug is indistinguishable from a feature.

2015-10-20, 16:14:38
Reply #3

rfletchr

  • Active Users
  • **
  • Posts: 41
    • View Profile
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.