Announcement

Collapse
No announcement yet.

Get output image name with python

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

  • #16
    Can you get me the .dmp file, not the .log one?

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

    Comment


    • #17
      Of course, sorry.


      MayaCrashLog110712.1920.dmp.zip

      Comment


      • #18
        For some strange reason, I don't see vrayformaya.mll loaded. This would explain why the python script throws an exception (will fix this)... Is V-Ray actually loaded in Maya?

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

        Comment


        • #19
          I just tried it again with vray loaded. BUT: I didn't mention that we load vray from a network repository, maybe that's the point. We set the necessary envvars before starting maya. (EDIT: Nope, tried it with a local install, same issue. /EDIT)


          In maya I do something like:


          #---------------------
          import sys

          sys.path.append('R:\\repo\\vray_builds\\vray21501_ 16029_2011x64\\maya_vray\\scripts\\vray')

          from utils import *

          p=findByType('SettingsOutput')

          dir=p[0].get('img_dir')
          fname=p[0].get('img_file')
          #----------------------------

          Strange thing is, that the module loads fine and the error occurs when I try to call a function.
          Last edited by pechart; 13-07-2011, 01:37 AM.

          Comment


          • #20
            Ok, it won't work this way. You need to put the Python script in the V-Ray "Post-translate Python Script" field in the V-Ray settings. V-Ray will call the script automatically at the start of the rendering, when the scene is already translated for V-Ray and the SettingsOutput plugin is available.

            Otherwise calling the script directly won't give you anything - V-Ray has not translated the scene yet (in fact, it's not even loaded).

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

            Comment


            • #21
              Ok, got it. Sorry for my noobism


              (Nonetheless, it would be nice to have the way to get the name without rendering. I want to evaluate the name to pass it to our rendermanager. Maybe i can just translate the scene but not render it an catch the name that way.)
              Last edited by pechart; 13-07-2011, 02:41 AM.

              Comment


              • #22
                Back on this
                Is there a simple way to catch results from posttranslate scripts? Or do i have to do things like changing stdout?

                Comment


                • #23
                  Originally posted by pechart View Post
                  Back on this
                  Is there a simple way to catch results from posttranslate scripts? Or do i have to do things like changing stdout?
                  Can you explain, what do you want to achieve?
                  V-Ray developer

                  Comment


                  • #24
                    Sorry, if I'm spamming the forum a little bit too much with maybe noobish questions in the past days.
                    What I meant here, is that I want to use whatever a function in the posttranslate script returns in maya. So i get some values from the translated scene and use that for further processing internally in maya.
                    What I did as a workaround now: I printed the output to a tempfile and read that back in. Works for me.

                    Comment


                    • #25
                      Hm,
                      Probably you can use global variables or call a function/command, which does something (stores something in a global variable, uses optionvars or something like that).

                      But you've not told me what exactly do you want to do.
                      Would you like to explain the whole setup, so we can get some feedback if we can improve something in V-Ray?

                      /Teodor
                      V-Ray developer

                      Comment


                      • #26
                        Yes, of course, sorry. Basically I just want to get the resolved imagename of the image to be rendered. So tokens like <Layer> and <Scene> get resolved. Those will get parsed to the renderfarm manager.
                        So my first thought was, that I just can read it out from the vraySettings, like I can with mray/maya software. Then Vlado came up with the post-translate script which seemed pretty usefull to me. So I wrote a post translate script that does the things I've written before. But maybe I'm thinking way to complicated here. Maybe I should just resolve what I get from vraySettings.fileNamePrefix by hand and I'm done.

                        So, the goal was to get the output image names in order to pass it to the rendermanager. So we would be able to do some automated framechecking and stuff.

                        Comment


                        • #27
                          Ok, using the file or global functions should be the way to go then.
                          V-Ray developer

                          Comment

                          Working...
                          X