Announcement

Collapse
No announcement yet.

Get output image name with python

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

  • Get output image name with python

    Hi!

    Is there a way to get the resolved image name from the vraySettings with python? From Maya Software you can get it with

    name = renderSettings(firstImageName = True, fullPath = True)

    for example.

    Thanks!

  • #2
    Yep, something like this:
    Code:
    from vray.utils import *
    
    p=findByType('SettingsOutput')
    
    dir=p[0].get('img_dir')
    fname=p[0].get('img_file')
    
    print dir+fname
    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Very interesting, thanks !

      In my test, I get this result in the logs :
      O:/TEMP/TEST/images/testVray/masterLayer/testLay.tiff
      O:/TEMP/TEST/images/testVray/layer1/testLay.tiff
      O:/TEMP/TEST/images/testVray/layer2/testLay.tiff

      So, it is executed once for each render layer.
      Note that it's not executed once for each frame, which explains why I get testLay.tiff instead of testLay.0023.tiff

      Comment


      • #4
        Yes, the Python script is currently run only once before rendering a layer begins. We might have to add a separate callback between frames.

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

        Comment


        • #5
          Looks good, thank you! Ist vray.utils documented somewhere?

          Comment


          • #6
            There is the documentation concerning the python part here: http://www.spot3d.com/vray/help/maya...ene_access.htm

            For information about all the different types of plugins and their parameters, you can look at .vrscene files exported from V-Ray for Maya, and you can also use the plgparams tool from the SDK.

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

            Comment


            • #7
              Thanks again!

              Comment


              • #8
                I get a Fatal Error when I do this in Maya2012 HF2 with vray 2.10.01 when the funtion gets called. Any ideas?

                EDIT: With Maya2011 SP1 and the Vray 2.00.04 Release I also get a Fatal Error.

                I'm on windows7, btw.
                Last edited by pechart; 11-07-2011, 06:41 AM.

                Comment


                • #9
                  There is a problem in the recent nightly builds; should be fixed for the build tomorrow.

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

                  Comment


                  • #10
                    I just checked the latest nightly build. But I still get the Fatal Error.

                    Comment


                    • #11
                      Yes, sorry didn't get there yesterday (we had to move to a new office); I will let you know the revision number when it's fixed, hopefully a bit later today.

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

                      Comment


                      • #12
                        Hm, on my machine the crash was caused by a wrong copy of vrayformaya.mll being loaded by the python module. The crash went away after I removed the duplicate version.

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

                        Comment


                        • #13
                          Hm, okay. What was the problem last time?

                          Comment


                          • #14
                            It's been the same problem for me; can you get me the crash dump from Maya? (It's in the %temp% folder, MayaCrashLog*.dmp)

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

                            Comment


                            • #15
                              Here it is:

                              MayaCrashLog110712.1920.log.zip

                              Comment

                              Working...
                              X