Announcement

Collapse
No announcement yet.

Change frame in IFL while running IPR

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

  • Change frame in IFL while running IPR

    Hello,
    We're controlling Vantage using the AppSDK and would like to use animated texture sequences, but I'm having trouble getting it to work.

    I want to achieve the same result as connecting from 3ds Max to Vantage and scrubbing the timeline with an IFL texture in the scene, i.e. that the texture changes based on the frame. From 3ds Max this works great, and has very good performance.

    The problem is, I can't figure out how to do the same thing in our standalone AppSDK program. I have no problem setting up the scene, but I can't figure out how to change frame. These are the approaches I've tried, but none of them have worked:
    • Calling renderer.setCurrentTime() stops the interactive rendering and I have to restart it, which takes several seconds.
    • Calling SettingsCurrentFrame.set_current_frame() does not seem to be doing anything
    • Sending the wanted frame in a list to SettingsOutput.set_frames() does not have any effect
    I'm stumped, I can't figure out any other way of changing the frame while running interactive. SettingsCurrentFrame looks like it should be the place, according to the documentation, but I've not been able to make it do anything.
    Could you help me figure out what I'm doing wrong? Just a pointer in the right direction would be very helpful.

    The only way I've gotten any result at all is changing the ifl_start_frame() of the bitmapbuffer to the (negated) frame I want, but that's obviously not a good solution (and it's super slow).

    Best regards,
    Vidar

  • #2
    Hello Vidar,

    Assuming that the IFL parameters are set in your BitmapBuffer plugin -
    ifl_start_frame, ifl_playback_rate, ifl_end_condition - as in your Max setup:
    https://docs.chaos.com/display/VMAX/...p#heading-Time

    Instead of using the VRayRenderer interfaces from AppSDK - start() / waitForRenderEnd()
    do you get the expected result, by using - renderSequence() / continueSequence()
    e.g.
    Code:
    renderer.renderSequence();
    for (int i = 0; i < 20; ++i) {
        renderer.waitForRenderEnd();
        printf("Image Ready, frame %d (sequenceEnd = %d)\n", renderer.getCurrentFrame(), renderer.isSequenceEnded());
        renderer.continueSequence();
    }
    Best regards,
    Plamen​
    Last edited by plamen.grozev; 20-12-2023, 08:59 AM.

    Comment


    • #3
      Hi Plamen! Thanks for the reply!

      I don't think I want to use waitForRenderEnd, because I want the application to run in realtime (30 fps preferably).
      I realize that I did not give a very good explanation of what I am trying to do so I've made an example program that keeps the ipr running (or the vantage live link rather) and updates the sequence to play in realtime.

      I managed to get the sequence to play using both SettingsCurrentFrame and set_frame_number on the BitmapBuffer. I'm not sure if this is the correct way of doing it though?​

      I can't paste text onto the forum for some reason so here's a link to a github gist with the sample code instead.

      Best regards,
      Vidar
      ifl frame vray ipr. GitHub Gist: instantly share code, notes, and snippets.

      Comment


      • #4
        Hello Vidar,

        Wishing you all the best in the new year and sorry for the late response.

        Thanks to a colleague, who prepared an IFL test, I have a simple test with vrscene slightly modified the example animation/01-animate-from-scene
        To render the animation there we use the VRayRenderer interfaces only - renderSequence(), continueSequence (on frame done), plus waitForSequenceEnd()

        In general, the vrscene export from a V-Ray integration like Max should export the least necessary plugins and parameters, so that it could be loaded and rendered with AppSDK.
        Probably some parameters related to the animation settings were not exported in your vrscene, though.

        These SettingsOutput parameters are worth mentioning:
        * anim_start - Start of animation range in time units, e.g. frame_start / frames_per_second
        * anim_end - End of animation range in time units, e.g. frame_end / frames_per_second
        * frame_start - The frame number at the start of the animation range
        * frames_per_second - The requested number of frames per unit time (related to SettingsUnitsInfo::seconds_scale, which should be equal to 1.0f / frames_per_second)
        * frames - List of key frames

        About the BitmapBuffer settings in the vrscene:
        * BitmapBuffer::frame_sequence is set to 1, which should automatically set the BitmapBuffer::frame_number from the IFL in BitmapBuffer::file

        Best regards,
        Plamen​​
        Attached Files

        Comment


        • #5
          Wow, thanks a lot for the detailed example, this is very helpful!

          Thank you for the help and I wish you a good year as well

          Vidar

          Comment

          Working...
          X