Announcement

Collapse
No announcement yet.

Pre/Post render commands

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

  • Pre/Post render commands

    I just tried the new pre/post render commands, and I have some questions:

    - I would like to print the current frame number after a frame is rendered. In the long run I want to do this in command line mode, but for now I just tried it in GUI. It's not giving me the results I was hoping for. I have the following code saved as curr_frame.py and I use @D:/curr_frame.py as post frame command.

    Code:
    # Get current time in seconds.
    sel_svc = lx.service.Selection()
    curr_time = sel_svc.GetTime()
    fps = modo.Scene().fps
    
    # Print current time converted to frames.
    print curr_time*fps
    When I try to render range 1-5, it just prints 1 (5 times). I was using the post frame callback and my current time indicator was on frame 1 so I guess the current frame is not evaluated when rendering. Is there a way to get the current frame that renders? I also tried some hacky methods of setting a temp envrionment variable and then reading that each frame but it's not working. Ideas?

    - What is the "Pre translate" command?

    - Are the naming of these global for all VRay implementations? I prefer Nukes naming: Pre render, pre frame render, post frame render, post render.

    - It would be super cool to have access to the names of the rendered frames when doing a post-render command. Would this be possible in the future? I'm not sure how thought. Could the vray.render_animation command could return filepaths? Or would we need python access to the vray scene for this? It would help a lot when for example adding metadata to renders.

  • #2
    Is this related to the newly added feature in the nightlies?

    "(2016.07.05) Added the ability to specify commands to be executed at various stages of V-Ray rendering;"

    What exactly is this?

    Comment


    • #3
      Originally posted by BVA View Post
      Is this related to the newly added feature in the nightlies?

      "(2016.07.05) Added the ability to specify commands to be executed at various stages of V-Ray rendering;"

      What exactly is this?
      Yes, it's the same thing.
      You can specify the scripts here :
      Click image for larger version

Name:	callbacks.PNG
Views:	1
Size:	75.7 KB
ID:	862558
      It will probably take some time to figure out what data V-Ray for MODO needs to expose to these commands, for them to be truly useful.

      Greetings,
      Vladimir Nedev
      Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

      Comment


      • #4
        When I try to render range 1-5, it just prints 1 (5 times). I was using the post frame callback and my current time indicator was on frame 1 so I guess the current frame is not evaluated when rendering. Is there a way to get the current frame that renders? I also tried some hacky methods of setting a temp envrionment variable and then reading that each frame but it's not working. Ideas?
        The current time is not changed during rendering. There is no need to do that in order to evaluate animated channels.
        Changing the time might result in some performance loss, so I don't think I should do it.

        You can use temporary user values to remember stuff between script invocations.
        You can read about them here : http://sdk.luxology.com/wiki/User_Values

        - What is the "Pre translate" command?
        This command is called before the MODO scene is translated to internal V-Ray plug-ins.
        You can modify the MODO scene in this command, and the changes will be picked up by V-Ray.

        - Are the naming of these global for all VRay implementations? I prefer Nukes naming: Pre render, pre frame render, post frame render, post render.
        I can change the UI label for "pre/post sequence command" to "pre/post render command" ? Will that be more clear ?

        - It would be super cool to have access to the names of the rendered frames when doing a post-render command. Would this be possible in the future? I'm not sure how thought. Could the vray.render_animation command could return filepaths? Or would we need python access to the vray scene for this? It would help a lot when for example adding metadata to renders.
        I can add a new command, called vray.render.info. It will allow you to query various internal parameters during the rendering, like:
        - output image for the last frame (this will be available in the "post frame command" and will change with each frame)
        - time it took to : translate the scene, create key-frames, render the image, etc...
        - number of MODO items exported
        - number of instances created by Replicator items
        - number of items with render curves enabled
        - when I add python access to the V-Ray scene, this command can return the V-Ray plug-ins that correspond to a given MODO item, and the internal V-Ray parameter(s) that correspond to a given MODO channel

        These are just examples, not sure how useful that kind of information will be and how easy it will be to provide it.
        Do you have other suggestions ?

        Greetings,
        Vladimir Nedev
        Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

        Comment


        • #5
          Originally posted by vladimir.nedev View Post
          The current time is not changed during rendering. There is no need to do that in order to evaluate animated channels.
          Changing the time might result in some performance loss, so I don't think I should do it.

          You can use temporary user values to remember stuff between script invocations.
          You can read about them here : http://sdk.luxology.com/wiki/User_Values
          Ok, thanks I'll have a look at temporary user values and see if they do the trick.

          Originally posted by vladimir.nedev View Post
          I can change the UI label for "pre/post sequence command" to "pre/post render command" ? Will that be more clear ?
          Yes I think that would be more clear. Because the pre/post render command will also be executed when rendering a still right? The word sequence indicates that it's only for animation and that's a bit confusing to me.



          Originally posted by vladimir.nedev View Post
          I can add a new command, called vray.render.info. It will allow you to query various internal parameters during the rendering, like:
          - output image for the last frame (this will be available in the "post frame command" and will change with each frame)
          - time it took to : translate the scene, create key-frames, render the image, etc...
          - number of MODO items exported
          - number of instances created by Replicator items
          - number of items with render curves enabled
          - when I add python access to the V-Ray scene, this command can return the V-Ray plug-ins that correspond to a given MODO item, and the internal V-Ray parameter(s) that correspond to a given MODO channel

          These are just examples, not sure how useful that kind of information will be and how easy it will be to provide it.
          Do you have other suggestions ?
          Very cool! Your examples sounds great.

          The ones I would add (on the top of my head):

          - A list of all render outputs rendered (including file paths) for the current frame.
          - The frame number of the rendered frame.
          - Remaining time for the rest of the frames (if there's a more clever way to anticipate remaining time then just current frame*remaining frames).

          Comment

          Working...
          X