Announcement

Collapse
No announcement yet.

Maxscript: Simplify renders.current to something non-version specific?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maxscript: Simplify renders.current to something non-version specific?

    This is petty, and it maybe important to keep it the way it is for other reasons.

    Is there a specific reason that VRay is version specific in mxs? i.e.

    V_Ray_Adv_1_50_SP3:V_Ray_Adv_1_50_SP3

    as opposed to just V_Ray or V_Ray_Adv

    like mental_ray_renderer (not that we ever use it)

  • #2
    There is no particular reason; if you want to check if the current renderer is V-Ray, it would be best to compare the class ID of the current renderer, instead of the name.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Cool, Thanks for the response. I'll figure out what that means and see what I can come up with.

      Comment


      • #4
        There are reasons for this to be nice actually. e.g. scripts that access properties that were unavailable in earlier builds and alike.

        You can check for the classID (wich is not Version-specific) with

        Code:
        renderers.current.classID
        Regards,
        Thorsten

        Comment


        • #5
          What I mean is that the check should be something like this:
          Code:
          if (renderers.current.classid[1]==1941615238 and renderers.current.classid[2]==2012806412) then (
            print "Renderer is V-Ray"
          ) else (
            print "Renderer is not V-Ray"
          )
          The class ID numbers will be the same, no matter what string is displayed as the renderer name.

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #6
            cool, thanks for the replies. after your first response we figured out half of what we were looking for... I should have made myself more clear from the beginning. We're checking and then setting the current renderer if it's not VRay. When SP4 or R2.0 comes out, we'll need to update some scripts to reflect the change in versions. We generally don't have a mix of versions running concurrently. Our software is all distributed via user policy and updates are made in big sweeping moves.

            No big deal, there will most likely be other changes we need to make and your point, Thorsten, about version specific checks is valid. Between the two of us who know any mxs at all, I'm sure we'll remember!

            Thanks guys.
            Last edited by jonahhawk; 11-06-2009, 12:27 AM.

            Comment


            • #7
              Code:
              			--find which of the current renderers is vray and set the current renderer to that
              			rc = rendererClass.classes
              			local vrClass
              			for i = 1 to rc.count where (findstring (rc[ i ] as string) "V_Ray") != undefined do vrClass = i
              			if (renderSceneDialog.isOpen()) then 
              			(
              				renderSceneDialog.close()
              				execute ("renderers.current = " + rc[ vrClass ] as string + "()")
              				renderSceneDialog.open()
              			)
              except for not executing the renderer change if the dialog is closed.. but you get the picture~
              Last edited by dbuchhofer; 11-06-2009, 06:23 AM.
              Dave Buchhofer. // Vsaiwrk

              Comment


              • #8
                although, after installing the vrayrt demo, that snippet doesn't necessarily work anymore.. so i guess you would matchpattern or findstring 'V_Ray_Adv' now
                Dave Buchhofer. // Vsaiwrk

                Comment


                • #9
                  Does it have to be so complicated; why not simply do this:
                  Code:
                  renderers.production=VRay()
                  Best regards,
                  Vlado
                  I only act like I know everything, Rogers.

                  Comment


                  • #10
                    sexy.

                    (and my message has to be at least 10 characters.)
                    Dave Buchhofer. // Vsaiwrk

                    Comment

                    Working...
                    X