Announcement

Collapse
No announcement yet.

Interactive render

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

  • Interactive render

    Hello,

    I am trying to implement interactive render in 3ds Max with AppSDK.

    I am setting setKeepInteractiveRunning to true for keep running the render. On change in viewport, i am calling a function to modify the transformation. Unless i call renderer->start(), vfb remains constant.

    Is this the way to proceed? if that is the case, i need to update on each change in viewport (mesh, material, etc).

    Is there anyway to link selected viewport to vfb?

    I tried adding callback for start IPR also. but dont know how to proceed with.

    Please suggest.

    Regards,
    Gopi.

  • #2
    Hi Gopi,
    If the renderer is running in interactive mode, the change in transformation (or anything) should be reflected without the need to call VRayRenderer::start() again. You'll need to call VRayRenderer::commit(), though, if you have disabled autoCommit (it is enabled by default but we recommend disabling it).
    Best, Stan

    Comment


    • #3
      Hi Stan,

      Thanks for your reply.

      Can you give me some sample code or steps to achieve this?

      I set autocommit off before starting render. keepinteractive to true.

      where to call this commit again ? In interactive render callback function?

      Regards,
      Gopi.

      Comment


      • #4
        You make a single change or a batch of changes and then call commit() to let the renderer "see" and apply them, e.g.

        renderView.set_transform(newTransformation);
        renderer->commit();

        That's it.

        Comment


        • #5
          Thanks Stan, let me try this and will update you.

          Comment


          • #6
            Hello Stan,

            This method is not working in our case. Also, using this, we can change the view only.

            What if, user changes materials or hide node (mesh) and so many options involved. We need to implement option which will be more or less same as StartIPR() function.

            Please suggest.

            Regards,
            Gopi.

            Comment


            • #7
              Well, I have no idea why it doesn't work for you but that is the way it is supposed to be used and it should work. Check if the renderer is running in interactive mode. Check if you are trying to make changes while the renderer is in preparing stage. Set the log message callback and print all messages to see if there is anything wrong.

              Comment


              • #8
                Hi Stan,

                Got some idea on this. working on. will update you.

                Regards,
                Gopi.

                Comment


                • #9
                  Meanwhile we had similar complaints from another customer but we couldn't reproduce those issues on our end yet. We'll keep you updated if we find anything.

                  Comment


                  • #10
                    Thanks Stan,

                    for transformation, i am using redrawviews callback in max sdk, there i am modifying new transformation and commit, its doing the interactive render fine in that case.

                    for materials, i am going to use INodeEventCallback and NotifyRefChanged (as suggested by Yavor in some other post).

                    Regards,
                    Gopi.

                    Comment


                    • #11
                      Hello Stan,

                      Previously, whenever render is started, vfb window will open on top of 3ds max window, but if i click anywhere in Max window, then this vfb will go back.

                      for interactive, I need to keep the vfb window to be displayed inside max window (as a child window), so I used setParentWindow(Max window handle), now its showing inside max window, but below the other UI dialogs which are opened.

                      Please check the attached image for reference.

                      I tried with setAlwaysOnTop, but it didn't help.

                      How to show vfb on top of all opened dialogs in Max.

                      Regards,
                      Gopinath.
                      Attached Files

                      Comment


                      • #12
                        Hello Gopi,

                        I'm sorry for the late reply. I got a suggestion which might work. You could try to create a dummy window which is a child of the 3ds max window and set its window flag to be a tool window. Then you could set that dummy window as the parent of VFB.

                        Best, Stan

                        Comment


                        • #13
                          Thanks Stan,

                          Let me try this and update.

                          Regards,
                          Gopi.

                          Comment


                          • #14
                            Hi Stan,

                            I tried as you suggested. VFB window lies inside the dummy window and it stays on top of all other windows. That's fine. (check image dummy_window.jpg)

                            I am having some issues related with that.

                            - Size issue - according to the VFB size, i need to resize dummy window size also, but for that, if I tried to get the size of vfb using
                            getPositionAndSize function, its returning the previous rendered size only, not the currently changed.
                            - I am able to move vfb window inside the dummy window - in this case, do i need to move the dummy also? (check image
                            moved.jpg)

                            Please suggest.

                            Regards,
                            Gopi.
                            Attached Files

                            Comment


                            • #15
                              Well, the above pictures don't look right. Child windows don't have title bars. (There is a difference between child and owned windows.) Do you really want a child window or just an always-on-top one?
                              A colleague of ours tried to use vfbAsHandle=vfb.getNativeHandle() and SetWindowPos(vfbAsHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) and it did work. You can use the native handle to do whatever you want with it.

                              Comment

                              Working...
                              X